-
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
fix: restore src-gen frontend production behavior #12950
fix: restore src-gen frontend production behavior #12950
Conversation
c80e87a
to
8e391de
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.
Does it make sense to replace all import
statements with require
? I.e. even in development build? Is there a benefit of using import
at all in this context?
Note that we should definitely replace the import
call at line 100
.
Ah I missed that! Good catch! Will update the PR.
Good questions, I assumed that the webpack build can be a bit faster, including in watch mode, if all modules are bundled separately. However I did not check whether that's really the case. |
b4b4fce
to
dedc6aa
Compare
I did a quick test with |
4a7316b
to
ed2025d
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.
Looks good to me 👍
Please rebase so I can merge :)
Restores the usage of 'require' in production mode when loading included modules. At the moment, both in development as well as in production mode, the frontend will be generated using the 'import' function. Webpack will use this opportunity for code splitting, leading to the generation of many small bundles. As they are sequentially loaded, this has a negative effect on the startup speed of the frontend. By using 'require' instead, weppack will produce a single bundle, which is faster to transmit without additional roundtrips. This behavior was used for production mode in all previous Theia versions and is now restored. Contributed on behalf of STMicroelectronics
ed2025d
to
e80e819
Compare
Restores the usage of 'require' in production mode when loading included modules.
At the moment, both in development as well as in production mode, the frontend will be generated using the 'import' function. Webpack will use this opportunity for code splitting, leading to the generation of many small bundles. As they are sequentially loaded, this has a negative effect on the startup speed of the frontend.
By using 'require' instead, webpack will produce a single bundle, which is faster to transmit without additional roundtrips. This behavior was used for production mode in all previous Theia versions and is now restored.
Contributed on behalf of STMicroelectronics
What it does
Use
require
for importing frontend modules inproduction
mode, useimport
in the remaining modes (mainly development).How to test
Trigger src-gen for the included example applications. Trigger with
--mode development
as well as--mode production
.Review checklist
Reminder for reviewers
Context
The require generation was removed with #12590