-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Make tsserver.js a library #39291
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
Make tsserver.js a library #39291
Conversation
I bet there's a cleverer way to skip the body of server.ts and I'd be happy to hear it. |
FYI @mjbvz, hopefully, this will save VS Code 8MB or so. |
Do I need to hook the new .d.ts file up to some sort of baseline/validation system? |
If we're considering this, the |
@weswigham What does "merge them" mean in this context? Drop |
|
I've done my best to port the functionality of |
VS Code (and probably others) currently consumes both tsserver.js and typescript.js, even though they have essentially the same content. This change makes it possible to use tsserver.js for both purposes, by suppressing the server startup code (including requires) and adding a declaration file (stripped of internals).
Force update was just a rebase. No manual merging required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks OK to me; but we should also have @rbuckton take a look over the build changes and @RyanCavanaugh validate when we wanna take the API break (since we'll no longer be shipping a file named tsserverlibrary
- though we could symlink it to preserve compatibility, admittedly).
There's a weird quirk there actually - unless we manually delete it next time we update the LKG, we'll continue to ship the old one. (See also #39330) |
AFAIK when we rewrote the LKG script, the only reason it doesn't automatically delete dead files was because there was some |
This would be a hack, so we're not going to pursue it. |
VS Code (and probably others) currently consumes both tsserver.js and
typescript.js, even though they have essentially the same content. This
change makes it possible to use tsserver.js for both purposes, by
suppressing the server startup code (including requires) and adding a
declaration file (stripped of internals).