-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
Design NotesNotes from our design meetingsNotes from our design meetings
Description
satisfies in JSDoc
- Provides a contextual type in JavaScript without casting or calling a helper function - really nice.
- It's unfortunate that
@typewas used as the original name for JSDoc type assertions.@typewould have been a better syntax for what satisfies does.- Or
@castand@satisfies, and@typejust stays on declarations.
- Or
- But if you know you want to use
satisfies - How should this work?
- Expression positions the same way
@typeworks seems fine. - What about declaration forms? Lots of examples of
@typeor@param.- We would like
@satisfiesto also work in declaration positions - enforce the assignability check on, and also contextually type, the initializer expression(s?).
- We would like
- Expression positions the same way
Optimizations
- Nice wins from monomorphizing our object types.
- What's next?
- Can still do this for
Signature,Type, more.
- Can still do this for
- Experimenting with removing the notion of object allocators (our factory for node classes).
- Slight aside - some difficulties with polymorphism analysis tooling due to esbuild renaming.
- Fixed shapes for
FlowNodes?- [experiment] Try using consistent shapes for FlowNodes #51585
- Should retry once the deopt tooling is available.
- Also, harder to analyze because they're just object literals.
- Analysis works better when the allocation site consistently comes from a constructor. (e.g.
new Blah(), etc.)
- Analysis works better when the allocation site consistently comes from a constructor. (e.g.
- We sort of do this with
FlowNode- But we still set properties after the fact.
- We ran a deopt analysis on the compiler during the meeting. We saw some interesting things.
writeFileis 16% of the time??? (MS Defender????)- 600ms on
tsnamespace - but it has almost no code???const enumpreservation?- That's nuts.
- Tradeoff for debuggability.
- Suspicious.
emitFlagsis never set, so an|=can't be immediately optimized.- We could just set it to
0?
- We could just set it to
Metadata
Metadata
Assignees
Labels
Design NotesNotes from our design meetingsNotes from our design meetings