Skip to content

Design Meeting Notes, 4/16/2024 #58414

@DanielRosenwasser

Description

@DanielRosenwasser

The configDir Configuration Variable

#57485

  • Configuration variable for directory of the current tsconfig.json
    • We are leaning towards configDir
    • We are also looking towards using ${ and } as the delimiters.
      • This is awful because lint rules.
  • < and > avoid conflicts, but we kinda like.
  • Why configDir? Why not projectDir?
    • Shrug.
  • We like that it matches VS Code's style and matches intuitions JS template strings.

Correctly Check this Type Predicates

#57341

  • We were not correctly checking this type predicates.

  • This PR actually performs the checking.

  • Unfortunate that this breaks:

    interface Animal {
      isDog() this is Dog;
    }
    
    interface Dog {
      isDog(): true;
    }
  • Kind of weird that someone wrote this

    interface Animal {
      isDog() this is Dog;
    }
    
    interface Dog {
      isDog(): this is never;
    }
    • But this is wrong - type predicates have to be invariant.
      • Wait really?
      • Yes really.
      • Why?
      • Because type predicates returning false implies that the type should be narrowed to the negative cases.
      • If you had Poodle say this is Poodle, then returning false implies that you don't have a Dog if you have a BorderCollie.
  • Is there a similar problem for assertion function?

  • This seems correct.

Perf Suites Benchmarking Additions/Modifications

microsoft/typescript-benchmarking#32

  • We are trying to fix up our perf suite to get representative tests.
  • Also, moving away from internal testing. Huge pain to maintain.
  • Need to put out a call for test cases.
    • Medium-sized (compiles between 10s to 30s)
    • Modern (works on the latest version)
    • Exhibits usage of diverse features
      • Module modes (nodenext, bundler, preserve)
      • JSX
      • Decorators
      • ...

noCheck (or skipCheck?)

  • Will we be adding this as a --build option in the future?
  • We will probably need it for ourselves.
  • However, if you run this from the command line, there's no way to know how to do this incrementally.
    • So you'd have to have 2 tsconfig.jsons for each project.
  • What exaclty is going wrong?
    • tsc -b --skipCheck outputs all .d.ts files.
    • Then when you run tsc -b, all the outputs are newer so it doesn't try to rebuild!
  • We would need different metadata to be stored to make this work.
  • Also: likely won't work with noEmitOnError.
    • Or at least - it may work awkwardly with noEmitOnError.
  • On the CLI, we don't feel like the UX makes sense yet, but we want to add this internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design NotesNotes from our design meetings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions