You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Prototype TS plugins on web
This prototype allows service plugins to be loaded on web TSServer
Main changes:
- Adds a new host entryPoint called `importServicePlugin` for overriding how plugins can be loaded. This may be async
- Implement `importServicePlugin` for webServer
- The web server plugin implementation looks for a `browser` field in the plugin's `package.json`
- It then uses `import(...)` to load the plugin (the plugin source must be compiled to support being loaded as a module)
* use default export from plugins
This more or less matches how node plugins expect the plugin module to be an init function
* Allow configure plugin requests against any web servers in partial semantic mode
* Addressing some comments
- Use result value instead of try/catch (`ImportPluginResult`)
- Add awaits
- Add logging
* add tsserverWeb to patch in dynamic import
* Remove eval
We should throw instead when dynamic import is not implemented
* Ensure dynamically imported plugins are loaded in the correct order
* Add tests for async service plugin timing
* Update src/server/editorServices.ts
Co-authored-by: Nathan Shively-Sanders <[email protected]>
* Partial PR feedback
* Rename tsserverWeb to dynamicImportCompat
* Additional PR feedback
Co-authored-by: Ron Buckton <[email protected]>
Co-authored-by: Nathan Shively-Sanders <[email protected]>
this.logger.info(`Skipped loading plugin ${pluginConfigEntry.name||JSON.stringify(pluginConfigEntry)} because only package name is allowed plugin name`);
4079
+
return;
4080
+
}
4081
+
4082
+
// If the host supports dynamic import, begin enabling the plugin asynchronously.
this.projectService.logger.info(`Skipped loading plugin ${pluginConfigEntry.name||JSON.stringify(pluginConfigEntry)} because only package name is allowed plugin name`);
1613
-
return;
1614
-
}
1638
+
/**
1639
+
* Performs the initial steps of enabling a plugin by finding and instantiating the module for a plugin synchronously using 'require'.
0 commit comments