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

fix: restore src-gen frontend production behavior #12950

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- [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
- [core] improve frontend startup time [#12936](https://github.com/eclipse-theia/theia/pull/12936) - Contributed on behalf of STMicroelectronics
- [dev-packages] restore src-gen frontend production behavior [12950](https://github.com/eclipse-theia/theia/pull/12950) - 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
- [vsx-registry] added a hint to extension fetching ENOTFOUND errors [#12858](https://github.com/eclipse-theia/theia/pull/12858) - Contributed by STMicroelectronics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async function preload(parent) {
container.parent = parent;
try {
${Array.from(frontendPreloadModules.values(), jsModulePath => `\
await load(container, import('${jsModulePath}'));`).join(EOL)}
await load(container, ${this.importOrRequire()}('${jsModulePath}'));`).join(EOL)}
const { Preloader } = require('@theia/core/lib/browser/preload/preloader');
const preloader = container.get(Preloader);
await preloader.initialize();
Expand Down 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.importOrRequire()}('${jsModulePath}'));`).join(EOL)}
await start();
} catch (reason) {
console.error('Failed to start the frontend application.');
Expand All @@ -142,6 +142,10 @@ ${Array.from(frontendModules.values(), jsModulePath => `\
`;
}

protected importOrRequire(): string {
return this.options.mode !== 'production' ? 'import' : 'require';
}

/** HTML for secondary windows that contain an extracted widget. */
protected compileSecondaryWindowHtml(): string {
return `<!DOCTYPE html>
Expand Down
Loading