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/9/2021 #43742

Closed
DanielRosenwasser opened this issue Apr 20, 2021 · 0 comments
Closed

Design Meeting Notes, 4/9/2021 #43742

DanielRosenwasser opened this issue Apr 20, 2021 · 0 comments
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

Generalized Index Signatures

#26797

  • People ask for an index signature for symbol.
  • But also now that we have template literal types, people want stuff like `data-${string}`.
    • But if you allow things like that, you have to allow generics.
  • You can get the same effect today with mapped types.
  • Today we do relation checking for string and number index signatures in a pretty loose way.
    • Seems like we need some loose rules.
  • Do we? Seems like you can create a slight loosening.
  • You need to be sensitive to the signatures with which an overload overlaps.
  • With noUncheckedIndexedAccess, we have another layer of relating differently.
  • Would it be possible to have generic index signatures?
    • Maybe, but we don't exactly know how that would work.
  • The original idea was to unify mapped types and index signatures.

importsNotUsedAsValues: preserve Doesn't Preserve Names

#43393

Perf Regressions

#43422

  • Caused by better aliasing of union types.
  • 1.5s to 5s regression
    • The actual repro was 30s to 50s.
  • But this is expected - like a see-saw, we did better on other codebases, but we'll do worse on this one.
  • It's expected because we're manufacturing new type IDs.
    • But we can potentially do some cleverness with the non-aliased union type.
  • Experiment.

#43437

  • Swapping a declaration/statement actually slows down the type-checking process.
  • We cache a whole bunch of type relationships before hitting one.
    • Doing the assignment first forces a ton of work to happen against an anonymous type.
    • While we do this, we stick in the keys of the things we're relating into a stack.
    • That stack gets about 17,500 entries inserted.
    • But as you relate, it's not caching.
    • So you have an O(n * m) check.
    • Fix is to use a map or set.
    • Seems to avoid the odd regression.
@DanielRosenwasser DanielRosenwasser added the Design Notes Notes from our design meetings label Apr 20, 2021
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