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, 5/24/2019 #31584

Closed
DanielRosenwasser opened this issue May 24, 2019 · 2 comments
Closed

Design Meeting Notes, 5/24/2019 #31584

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

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented May 24, 2019

Correct Constraint Checking

#31006

  • Could park behind a flag, maybe within --strict mode
    • But silly not to give this to everyone?
  • Breaks Ember's .d.ts files (@chriskrycho)
  • Does this help everyone, or is this something you notice as a power-user?
  • Conclusion: update PR, update user test suite, re-evaluate and update Ember if necessary

OOM Woes

#30050

  • We've been receiving a lot of OOM woes.
  • All seem to have the same root cause.
  • Related to normalization of large intersection types.
    • (A | B | C | D) & (E | F | G | D)

      interface A { A: "A" }
      interface B { B: "B" }
      interface C { C: "C" }
      interface D { D: "D" }
      
      interface E { E: "E" }
      interface F { F: "F" }
      interface G { G: "G" }
      interface H { H: "H" }
      
      type BLAH = (A | B | C | D) & (E | F | G | H)
      
      // Equivalent to...
      type BLAH = (A & E) | (A & F) | (A & G) | (A & H) | (B & E) | (B & F) | (B & G) | (B & H) | (C & E) | (C & F) | (C & G) | (C & H) | (D & E) | (D & F) | (D & G) | (D & H)
      • This grows pretty fast.
      • Comes up a lot when you use something like keyof React.ReactHTML
        • We run out of memory at 2**19, and some operations on React have calculated 2 ** 111.
      • We now have a limiter during the normalization pass to compute the upper-bound of the number of unions we might generate, so that we gracefully fail instead of generating out-of-memory errors.
  • This will generate some trouble for React users.
  • Also looks like there are a lot of bogus intersections we choke up on.
    • "a" & { __tag: "adsad" }
    • Maybe there's a subset of intersections with object types.
    • We need some way of doing nominal tagging
    • Can we just determine what to do based on number of members?
      • Nope, expensive to determine this.
  • Resolution: Need to put this into the breaking changes list.
@DanielRosenwasser DanielRosenwasser added the Design Notes Notes from our design meetings label May 24, 2019
@chriskrycho
Copy link

Thanks for the ping! I am happy to carve out some time next week to look at Ember's types with you folks, and will also dig into the PR in question to try to understand why it breaks our types.

@zpdDG4gta8XKpMCd
Copy link

zpdDG4gta8XKpMCd commented May 25, 2019

We need some way of doing nominal tagging

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

3 participants