-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
move preload bits under Electron only #12491
Conversation
fe7ea11
to
4665105
Compare
4665105
to
ecf5dd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed some errors when attempting to start the electron application, the app is stuck on the loading screen:
Unable to load preload script: /home/vince/workspaces/theia-work/examples/electron/lib/preload.js
Error: Cannot find module '/home/vince/workspaces/theia-work/examples/electron/lib/preload.js'
at Module._resolveFilename (VM123 loader:1002:15)
at o._resolveFilename (VM158 renderer_init:2:3879)
at Module._load (VM123 loader:848:27)
at f._load (VM155 asar_bundle:2:13330)
at o._load (VM158 renderer_init:2:3109)
at VM158 renderer_init:2:33208
at VM158 renderer_init:2:33334
at ___electron_webpack_init__ (VM158 renderer_init:2:33338)
at VM158 renderer_init:2:33461
at BuiltinModule.compileForInternalLoader (VM10 loaders:331:7)
(anonymous) @ VM158 renderer_init:2
TypeError: Cannot read properties of undefined (reading 'getSecurityToken')
at ContainerModule.registry (electron-token-frontend-module.ts:21:74)
at __webpack_modules__.../../node_modules/inversify/lib/container/container.js.Container.load (container.ts:110:27)
at index.js:107:1
The `preload.js` generated script is included in browser builds, this will cause issues for anyone trying to build a browser app. This commit makes sure the Electron bits aren't used when building a browser app.
ecf5dd6
to
2dd3253
Compare
Fixed, wasn't expecting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
- the example-browser app works as expected (CI also successfully passes)
- the example-electron app works as expected
- a browser-only app referenced by
file:
no longer fails on build
I see the deadline for the 1.38.0 milestone is May 25, more than two weeks from now. Since this fixes a critical regression in 1.37.0, could we please get a 1.37.1 release prior to then? |
@danepowell the patch |
Awesome, thank you! |
@vince-fugnitto is this a release off master or is it branched off the 1.37 release with a "community-release" branch we can backport other fixes to? I was under the impression we don't do fix releases off master. |
The `preload.js` generated script is included in browser builds, this will cause issues for anyone trying to build a browser app. This commit makes sure the Electron bits aren't used when building a browser app.
@tsmaeder it's just a standard patch release that we've done in the past since the regression was brought up multiple times in discussions and issues. The release was performed branched off of https://github.com/eclipse-theia/theia/tree/release/1.37.0 and https://github.com/eclipse-theia/theia/tree/release/1.37.x was created (which includes the |
@vince-fugnitto so this is the normal process we're using to patch community releases, right? And any further patches for the community release like in #12479 should go to the branch https://github.com/eclipse-theia/theia/tree/release/1.37.x, right? |
@tsmaeder it's just the normal process when doing any patch release not necessarily community one. |
A community release is just a release designated as "community". So no branch off the existing branch 1.37.x require, IMO. Just as long as we branched off the 1.37.0 tag and not master. I put a topic in the community call to get everyone on the same page. |
@tsmaeder right it's definitely not, I only mentioned it since it seems to be a convention we followed in the past https://github.com/eclipse-theia/theia/tree/1.34-community-2023-02 (we have branches with |
The
preload.js
generated script is included in browser builds, this will cause issues for anyone trying to build a browser app.This commit makes sure the Electron bits aren't used when building a browser app.
Closes #12490
How to test
There should be no mention of
preload.js
in the generated files for the browser (src-gen/*
andgen-webpack.config.js
).Review checklist
Reminder for reviewers