Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Meeting Notes, 4/16/2024 #58414

Open
DanielRosenwasser opened this issue May 2, 2024 · 0 comments
Open

Design Meeting Notes, 4/16/2024 #58414

DanielRosenwasser opened this issue May 2, 2024 · 0 comments
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

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.
@DanielRosenwasser DanielRosenwasser added the Design Notes Notes from our design meetings label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Notes Notes from our design meetings
Projects
None yet
Development

No branches or pull requests

1 participant