electron / electron/electron

Document the known differences of Electron's Node.js fork

Open
#26,593 6 comments 2 reactions 0 assignees View on GitHub
documentation :notebook: enhancement :sparkles: status/confirmed
Dominant language
C++
Stars
123k
Forks
17.5k
Avg merge
14h 22m
Merged PRs (30d)
873

Description

Mentioned in #26560, here's a separate issue to track it.

### Preflight Checklist

* [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

### Problem Description

#26560 was about the `timeout` option of the `vm` module not working in the main process. It looks like some of the Node.js tests [are disabled](https://github.com/electron/electron/blob/e017d8714e75fdc861af612404ea67229e827665/script/node-disabled-tests.json). So I must assume there are some known differences between Electron and Node.js

Another thing I came across a few months ago is that Electron uses BoringSSL and not OpenSSL.

### Proposed Solution

When searching for "electron node.js differences" I only found this page https://www.electronjs.org/docs/development/electron-vs-nwjs

What I propose is a similar page titled "Differences between Node.js and Electron's Node.js fork". This page will

1. Establish that Electron even uses a fork and not vanilla Node.js (this is not obvious to everyone)
2. List known issues with the fork linking to the GitHub issue (e.g. #26560)
3. Known differences that are deliberate with a short explanation, e.g. the use of BoringSSL.

### Additional Information

From the top of my head I've encounter at least these three:

1. vm timeout (#26560)
2. BoringSSL (#20204)
3. Different ctrl+c handling than Node.js (#5273)

I'll keep adding more as they come up:

- https://github.com/electron/electron/issues/35801
- https://github.com/electron/electron/issues/34808 (wontfix)
- https://github.com/electron/electron/issues/21457

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.