Open
Description
Make executables thin wrappers around public API
- Public API of TypeScript is in
typescript.js
- Everything in
tsserver.js
depends on the same stuff as the API. - Same-ish is true of
typingsInstaller.js
- Everything in
- Have a PR where these files just import parts of the API from each executable.
tsserver.js
andtypingsInstaller.js
just become <1000 lines of code on top oftypescript.js
. - Great size reduction for our npm package size and editors that ship their own
tsserver.js
andtypingsInstaller.js
. - Runtime speed does not seem to be impacted.
- What about
tsc.js
?- [experiment] make tsc use the public API #57703
tsc.js
is roughly another a entry-point to our API.- You can get the same size reduction with this.
- Significant regressions!
- It's not just straight runtime, it's also start-up speed because of the extra code.
- Different implementation of constructors with different orders?
- It warrants an investigation.
Instantiation count in baselines
- We have no way to detect blow-ups of logic in the compiler other than our perf suite.
- But our test suite has a lot of esoteric work integrated into it.
- Idea is record a few metrics (assignability cache size, type count, instantiation count, symbol count) into our baseline outputs.
- Rounded so that minor changes don't cause noise.
- Have a threshold for each metric as well so not every test gets it.
- We like it.
🥳