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, 8/17/2022 #50522

Closed
DanielRosenwasser opened this issue Aug 29, 2022 · 0 comments
Closed

Design Meeting Notes, 8/17/2022 #50522

DanielRosenwasser opened this issue Aug 29, 2022 · 0 comments
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

satisfies Proposal

#47920

  • x satisfies T
  • What about
    • x as satisfies T
    • Why?
    • Usable in other places.
      • <satisfies T>x in angle-bracket assertions.
      • /** @type {satisfies T} */ in JSDoc.
  • Angle bracket priority?
    • We generally de-prioritize this feature due to JSX.
    • But you usually know the type ahead of time. The type coming first allows auto-complete to work better and signals what is coming ahead.
  • JSDoc?
    • We try not to add new tags that aren't doc'd in the usejsdoc site.
    • Ship has sailed with TS-specific syntax in JSDoc, right?
  • Seems like the stand-alone satisfies syntax is the cleanest and reads the best, even with all the speculative design space.

Massive Slowdown

#50290

  • We have an optimization whenever we have a large union.
    • We have an optimization where if you have very large unions, we try relating in a specific order.
  • Someone is using the Babel type definitions where they have a union-based type for their nodes.
  • @types/babel__traverse is a discriminated union.
  • get method was declared with a conditional type.
    • The true branch creates an internal intersection type in the true branch.
    • Converting the conditional type to a type alias allows us to use pre-computed variance calculation on the alias.
  • So one option is to fix the type definition in DefinitelyTyped. Dramatically better
  • 4.7
    • About 7.5 seconds with or without the Definitely Typed fix.
  • 4.8
    • About 45 seconds today.
    • About 6.5 seconds with Definitely Typed fix.
  • Also have two PRs to help with this. Doesn't have the same savings as rewriting the conditional to a size, but avoids the regression.
    • First - try to remove parts of an intersection.
    • Second - remove the relationship cap size/make it higher?
      • Debatable cap.
      • No, but really shouldn't allow 80 second check-times.
  • Can do all.
  • But bringing a change in for 4.8? Risky.
    • Can try to do this in 4.9, back-port if necessary.
  • Also, can try to cache ad-hoc conditonal wthout aliases.
  • Conclusions:
    • Make the DT test.
    • Removing the relationship cap? Experiment.
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

2 participants