Repository navigation
Enable TS Server plugins on web #47376
Description
Activity
At the moment VS Code doesn't even try to initialize plugins with the server. However once I remove this check on the VS Code side, the code starts failing at
requirenot being implemented:TypeScript/src/webServer/webServer.ts
Line 139 in c0796c1
require: () => ({ module: undefined, error: new Error("Not implemented") }), I wonder if we need a browser version of these plugins too, similar to what VS Code does for extensions in browsers
- We wouldn't try executing code the relies on node. Instead plugin authors would have to opt-in
- Authors could easily vary their implementation between node and browser
- We could require the plugin be compiled to a single file, just like we do for vscode extensions in browsers
- added a commit that references this issue
on Jan 11, 2022 - addedCommittedThe team has roadmapped this issueThe team has roadmapped this issueSuggestionAn idea for TypeScriptAn idea for TypeScript
on Jan 13, 2022 I've cleaned up my prototype in #47377 quite a bit. Noteworthy changes:
- Plugins are now only loaded if they have a
browserfield in theirpackage.json - Plugins are loaded using
import(...)in web - Plugins on web must be compiled to a module that can be imported
I think web enabled plugins are good opportunity to move plugins to adopt modern JS practices. Trying to load plugins synchronously on web is also very ugly as my original prototype showed
- Plugins are now only loaded if they have a
Thanks all for the help. Ron Buckton (@rbuckton) Since this change is already merged, do you have any idea when would this be available?
RyanCavanaugh commented
on Jun 16, 2022 MemberMore actionsPRs merged today will be in the nightly build starting immediately the following day, and also in 4.8 Beta (plus any subsequent release)
For microsoft/vscode#140455
A few key VS Code extensions — such as IntelliCode — are powered by TS Server plugins. Currently we don't support loading these plugins at all on web versions of TypeScript
This feature request tracks enabling plugins from extensions on vscode.dev and GitHub.dev. We don't plan to support plugins from the workspace since these require running npm install