Skip to content

Enable TS Server plugins on web  #47376

Description

@mjbvz

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

Activity

  1. mjbvz commented on Jan 11, 2022

    @mjbvz
    Author

    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 require not being implemented:

    require: () => ({ module: undefined, error: new Error("Not implemented") }),

  2. mjbvz commented on Jan 11, 2022

    @mjbvz
    Author

    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
  3. mjbvz commented on Feb 16, 2022

    @mjbvz
    Author

    I've cleaned up my prototype in #47377 quite a bit. Noteworthy changes:

    • Plugins are now only loaded if they have a browser field in their package.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

  4. leti367 commented on Jun 16, 2022

    @leti367
    Member

    Thanks all for the help. Ron Buckton (@rbuckton) Since this change is already merged, do you have any idea when would this be available?

  5. RyanCavanaugh commented on Jun 16, 2022

    @RyanCavanaugh
    Member

    PRs merged today will be in the nightly build starting immediately the following day, and also in 4.8 Beta (plus any subsequent release)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

CommittedThe team has roadmapped this issueSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions