Skip to content

Commit

Permalink
fix: restore src-gen frontend production behavior
Browse files Browse the repository at this point in the history
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, wepack 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
  • Loading branch information
sdirix committed Sep 27, 2023
1 parent 7e3aa42 commit c80e87a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

## v1.42.0

- [application-package] restore src-gen frontend production behavior [12950](https://github.com/eclipse-theia/theia/pull/12950) - Contributed on behalf of STMicroelectronics
- [core] fixed logger level propagation when log config file changes at runtime [#12566](https://github.com/eclipse-theia/theia/pull/12566) - Contributed on behalf of STMicroelectronics
- [vscode] stub TestController invalidateTestResults [#12944](https://github.com/eclipse-theia/theia/pull/12944) - Contributed by STMicroelectronics
- [vscode] support iconPath in QuickPickItem [#12945](https://github.com/eclipse-theia/theia/pull/12945) - Contributed by STMicroelectronics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = (async () => {
try {
${Array.from(frontendModules.values(), jsModulePath => `\
await load(container, import('${jsModulePath}'));`).join(EOL)}
await load(container, ${this.options.mode !== 'production' ? 'import' : 'require'}('${jsModulePath}'));`).join(EOL)}
await start();
} catch (reason) {
console.error('Failed to start the frontend application.');
Expand Down

0 comments on commit c80e87a

Please sign in to comment.