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
Electron 5.0 disables node integration (by default). Explore if we can run VSCode in such an environment where node.js cannot be used from the renderer.
Development
All changes happen on master. To run, simply append --nodeless to the startup, e.g.
scripts/code.sh --nodeless
This will open a version of the workbench that can run without node by pulling in src/vs/workbench/workbench.nodeless.main.ts. This is a list of dependencies that have no node.js or electron dependency. It closely mirrors src/vs/workbench/workbench.main.ts as much as possible.
Many services in src/vs/workbench/workbench.nodeless.main.ts are shimmed with a simple implementation until they are adopted (see src/vs/workbench/browser/nodeless.simpleservices.ts).
Example: make emmet fit to run without node/electron
We recently pushed changes to support emmet fully in an environment without node. The steps involved:
this typically means to avoid using node.js or electron API by using a service instead that can be referenced from common or browser
Example: make the hash service fit to run without node/electron
We have a IHashService that can be used to compute SHA1 hashes of strings that is implemented by using the node.js API. To allow to use this service from an environment without node:
we created as src/vs/workbench/services/hash/common/hashService.ts that is fully implemented to run without node
we updated src/vs/workbench/workbench.nodeless.main.ts to use that implementation instead of the simple implementations from src/vs/workbench/browser/nodeless.simpleservices.ts
Note: if the new implementation of the service is good enough, we can drop the existing one to ensure we only have one service implementation.
Synopsis
Electron 5.0 disables node integration (by default). Explore if we can run VSCode in such an environment where node.js cannot be used from the renderer.
Development
All changes happen on
master
. To run, simply append--nodeless
to the startup, e.g.This will open a version of the workbench that can run without node by pulling in
src/vs/workbench/workbench.nodeless.main.ts
. This is a list of dependencies that have no node.js or electron dependency. It closely mirrorssrc/vs/workbench/workbench.main.ts
as much as possible.Many services in
src/vs/workbench/workbench.nodeless.main.ts
are shimmed with a simple implementation until they are adopted (seesrc/vs/workbench/browser/nodeless.simpleservices.ts
).Example: make emmet fit to run without node/electron
We recently pushed changes to support emmet fully in an environment without node. The steps involved:
common
orbrowser
layer (more info on our layers)common
orbrowser
Example: make the hash service fit to run without node/electron
We have a
IHashService
that can be used to compute SHA1 hashes of strings that is implemented by using the node.js API. To allow to use this service from an environment without node:src/vs/workbench/services/hash/common/hashService.ts
that is fully implemented to run without nodesrc/vs/workbench/workbench.nodeless.main.ts
to use that implementation instead of the simple implementations fromsrc/vs/workbench/browser/nodeless.simpleservices.ts
Note: if the new implementation of the service is good enough, we can drop the existing one to ensure we only have one service implementation.
Backlog
Related Issues:
IRequestService
that works inbrowser
context (using XHR) (blocks Revisit need for node/electron-browser in workbench/contrib/preferences #69111)node/electron-browser
inworkbench/contrib/watermark
Revisit need for node/electron-browser in workbench/contrib/watermark #69117node/electron-browser
inworkbench/contrib/welcome
Revisit need for node/electron-browser in workbench/contrib/welcome #69116node/electron-browser
inworkbench/contrib/terminal
Revisit need for node/electron-browser in workbench/contrib/terminal #69115node/electron-browser
inworkbench/contrib/tasks
Revisit need for node/electron-browser in workbench/contrib/tasks #69113node/electron-browser
inworkbench/contrib/scm
Revisit need for node/electron-browser in workbench/contrib/scm #69112node/electron-browser
inworkbench/contrib/preferences
Revisit need for node/electron-browser in workbench/contrib/preferences #69111node/electron-browser
inworkbench/contrib/output
Revisit need for node/electron-browser in workbench/contrib/output #69110node/electron-browser
inworkbench/contrib/markers
Revisit need for node/electron-browser in workbench/contrib/markers #69109node/electron-browser
inworkbench/contrib/experiments
Revisit need for node/electron-browser in workbench/contrib/experiments #69108electron-browser
inworkbench/contrib/execution
Revisit need for electron-browser in workbench/contrib/execution #69107electron-browser
inworkbench/contrib/emmet
Revisit need for electron-browser in workbench/contrib/emmet #69105electron-browser
inworkbench/contrib/debug
Revisit need for electron-browser in workbench/contrib/debug #69104electron-browser
inworkbench/contrib/comments
Revisit need for electron-browser in workbench/contrib/comments #69103electron-browser
inworkbench/contrib/codeEditor
Revisit need for electron-browser in workbench/contrib/codeEditor #69102The text was updated successfully, but these errors were encountered: