GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — Adds experimental support for running TS Server in a web worker by mjbvz · Pull Request #39656 · microsoft/TypeScript Conversation
|
|
Ryan Cavanaugh (@RyanCavanaugh) Let's sync tomorrow on the next steps for this work. I've done work on the VS Code side to pull in my forked typescript version (microsoft/vscode#102990) for web builds. This unblocks us but is only a short term workaround My proposal is that during the start of TS 4.1 development, we collaborate on getting this PR merged into master. In order to keep package sizes down, I think we probably want to ship web support in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This change makes it possible to run a syntax old TS server in a webworker. This is will let serverless versions of VS Code web run the TypeScript extension with minimal changes. As the diff on `server.ts` is difficult to parse, here's an overview of the changes: - Introduce the concept of a `Runtime`. Valid values are `Node` and `Web`. - Move calls to `require` into the functions that use these modules - Wrap existing server logic into `startNodeServer` - Introduce web server with `startWebServer`. This uses a `WorkerSession` - Add a custom version of `ts.sys` for web - Have the worker server start when it is passed an array of arguments in a message In order to make the server logic more clear, this change also tries to reduce the reliance on closures and better group function declarations vs the server spawning logic. **Next Steps** I'd like someone from the TS team to help get these changes into a shippable state. This will involve: - Adddress todo comments - Code cleanup - Make sure these changes do not regress node servers - Determine if we should add a new `tsserver.web.js` file instead of having the web worker logic all live in `tsserver.js`
Use import types instead
90e38eb to
94faf66
Compare
|
Here's how to test these changes in a web build of VS Code:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
7a69aeb to
e1122d2
Compare
|
Looked at the changes and have updated them: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
e1122d2 to
f3178b6
Compare
This implements enough of `ServerHost` that we can load the standard d.ts files using synchronous XMLHttpRequests. I also had to patch some code in `editorServices`. I don't know if these changes are correct and need someone on the TS team to review
|
Sheetal Nandi (@sheetalkamat) Just pushed 6202c51 that enables support for loading the standard The problem is that the standard library files have filenames such as |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Sheetal Nandi <[email protected]>
This is required for cases where `self.location` does not point to the directory where all the typings are stored
There was an error while loading. Please reload this page.
|
Sheetal Nandi (@sheetalkamat) Just pushed changes that enables TS Server logging on web. You'll also need to use the latest VS Code build from our main branch to use this Right now the logger prints to the console. Here's what that looks like: As you can see, not ideal for grouped messages but it gets the job done. Let me know if we should look into logging into a VS Code output window instead. For that, we'd likely want to post special logging messages back to VS Code that it can append onto the output |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
// TODO: is this really needed or can vscode take care of this How do we handle when opening lib.d.ts as response to goto def in open files
80cbd9c to
0820519
Compare
…cheduling Fixes failing tests
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
First round of comments.
Also, does this create a new output file? Should it?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
My understanding is that the goal is to have Will let Ryan Cavanaugh (@RyanCavanaugh) Matt Bierner (@mjbvz) Daniel Rosenwasser (@DanielRosenwasser) Mine Starks (@minestarks) chime in their thoughts. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'll probably add some more organizational notes, but this approach looks fine.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| unknownServerMode?: string; | ||
| startSession: (option: StartSessionOptions, logger: Logger, cancellationToken: ServerCancellationToken) => void; | ||
| } | ||
| function start({ args, logger, cancellationToken, serverMode, unknownServerMode, startSession: startServer }: StartInput, platform: string) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This seems like a convoluted way to share this initialization code. For example, serverMode is extracted from the StartInput and then passed back into startServer. It might be tidier to extract some initialization helpers (e.g. logHeader) and then have each code path (i.e. web and node) call them separately. Such an exercise might also reveal bits that shouldn't be shared (e.g. why does the web server need to print out the node version in its header?).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.