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

refactor: bundle the browser and renderer process electron code #18553

Merged
merged 9 commits into from Jun 2, 2019

Conversation

Projects
None yet
3 participants
@MarshallOfSound
Copy link
Member

commented May 31, 2019

  • Bundles browser/init, renderer/init and worker/init
    • Improves load performance of electron main process init by ~85% (90ms -> 10ms)
    • Improves load performance of renderer process init by ~50%
  • Prevents users from importing our "requiring" our internal logic such
    as ipc-main-internal. This makes those message buses safer as they are
    less accessible, there is still some more work to be done though to lock
    down those buses completely.
  • The electron.asar file now only contains 2 files, as a future
    improvement maybe we can use atom_natives to ship these two files
    embedded in the binary
  • This also removes our dependency on browserify which had some strange
    edge cases that caused us to have to hack around require-order and
    stopped us using certain ES6/7 features we should have been able to use
    (async / await in some files in the sandboxed renderer init script)
  • Instead we now use webpack to bundle All The Things

TLDR: Things are faster and better :)

Notes: no-notes

refactor: bundle the browser and renderer process electron code
* Bundles browser/init and renderer/init
  * Improves load performance of main process by ~40%
  * Improves load performance of renderer process by ~30%
* Prevents users from importing our "requiring" our internal logic such
as ipc-main-internal.  This makes those message buses safer as they are
less accessible, there is still some more work to be done though to lock
down those buses completely.
* The electron.asar file now only contains 2 files, as a future
improvement maybe we can use atom_natives to ship these two files
embedded in the binary
* This also removes our dependency on browserify which had some strange
edge cases that caused us to have to hack around require-order and
stopped us using certain ES6/7 features we should have been able to use
(async / await in some files in the sandboxed renderer init script)

TLDR: Things are faster and better :)
@nornagon
Copy link
Contributor

left a comment

terrifying. i don't know enough about how node's module loader works to have a reasonable opinion on whether this will all explode at some point, but if it does it will probably explode spectacularly rather than quietly, which is good.

Show resolved Hide resolved docs/api/sandbox-option.md Outdated
Show resolved Hide resolved BUILD.gn Outdated
Show resolved Hide resolved filenames.auto.gni
Show resolved Hide resolved lib/browser/api/module-keys.js

@MarshallOfSound MarshallOfSound force-pushed the bundle-browser-and-main branch from 3c1cc4a to 2ad1e29 Jun 1, 2019

MarshallOfSound added some commits Jun 1, 2019

fix: use webpacks ProvidePlugin to keep global, process and Buffer al…
…ive after deletion from global scope for use in internal code
@MarshallOfSound

This comment has been minimized.

Copy link
Member Author

commented Jun 1, 2019

FWIW macOS is not a flake, please do not merge 👍

macOS is all good now, PR is green and good to go

@electron-cation electron-cation bot removed the new-pr 🌱 label Jun 1, 2019

@miniak

miniak approved these changes Jun 2, 2019

@MarshallOfSound MarshallOfSound merged commit bc527f6 into master Jun 2, 2019

11 of 12 checks passed

Artifact Comparison Changes Detected
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
electron-arm64-testing Build #20190602.1 succeeded
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Jun 2, 2019

No Release Notes

@MarshallOfSound MarshallOfSound deleted the bundle-browser-and-main branch Jun 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.