Skip to content

Commit 5f09acc

Browse files
committed
fix(core): child applied template js not execute sequentially
1 parent decda95 commit 5f09acc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/runtime/core/src/module/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export class App {
224224
this.mounting = true;
225225
try {
226226
// add container and compile js with cjs
227-
const asyncJsProcess = this.compileAndRenderContainer();
227+
const asyncJsProcess = await this.compileAndRenderContainer();
228228

229229
// Good provider is set at compile time
230230
const provider = await this.getProvider();

packages/runtime/core/src/plugins/performance/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ export function GarfishPerformance() {
1010
name: 'performance',
1111
async beforeLoad(appInfo) {
1212
if (!subAppMap[appInfo.name]) {
13+
let appDomGetter = appInfo.domGetter;
14+
if (typeof appInfo.domGetter === 'function') {
15+
appDomGetter = await appInfo.domGetter();
16+
}
1317
// 运营平台子应用跟节点 id 为 'master-app'
1418
subAppMap[appInfo.name] = new SubAppObserver({
15-
subAppRootSelector: appInfo.domGetter as Element,
19+
subAppRootSelector: appDomGetter as Element,
1620
});
1721
}
1822
subAppMap[appInfo.name].subAppBeforeLoad(appInfo.entry);

0 commit comments

Comments
 (0)