Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore supporting Electron 5.0 default renderer configuration #68302

Closed
13 of 17 tasks
bpasero opened this issue Feb 9, 2019 · 1 comment
Closed
13 of 17 tasks

Explore supporting Electron 5.0 default renderer configuration #68302

bpasero opened this issue Feb 9, 2019 · 1 comment
Assignees
Labels
plan-item VS Code - planned item for upcoming
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Feb 9, 2019

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:

@bpasero bpasero added the plan-item VS Code - planned item for upcoming label Feb 9, 2019
@bpasero bpasero added this to the February 2019 milestone Feb 9, 2019
@microsoft microsoft locked and limited conversation to collaborators Feb 9, 2019
@bpasero bpasero modified the milestones: February 2019, March 2019 Feb 25, 2019
@bpasero bpasero modified the milestones: March 2019, April 2019 Mar 25, 2019
@bpasero bpasero modified the milestones: April 2019, May 2019 Apr 24, 2019
@bpasero
Copy link
Member Author

bpasero commented May 9, 2019

We will continue this investigation but current thinking is to adopt Electron 5 and 6 with nodeIntegration still being enabled as before.

@bpasero bpasero closed this as completed May 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plan-item VS Code - planned item for upcoming
Projects
None yet
Development

No branches or pull requests

2 participants