Skip to content

Explore supporting Electron 5.0 default renderer configuration #68302

@bpasero

Description

@bpasero

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.

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:

  • moving the code itself to a common or browser layer (more info on our layers)
  • 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.

Backlog

Related Issues:

Metadata

Metadata

Labels

plan-itemVS Code - planned item for upcoming

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions