Skip to content

Commit d7d1914

Browse files
committed
fix(mode): ensure multiple component modes can async load
1 parent 5150526 commit d7d1914

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

src/client/platform-main.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,7 @@ export const createPlatformMain = (namespace: string, Context: d.CoreContext, wi
8484
perf.mark(`request_bundle_start:${elm.nodeName.toLowerCase()}:${elm['s-id']}`);
8585
}
8686

87-
if (cmpMeta.componentConstructor) {
88-
// we're already all loaded up :)
89-
queueUpdate(plt, elm, perf);
90-
91-
if (_BUILD_.profile) {
92-
perf.mark(`request_bundle_end:${elm.nodeName.toLowerCase()}:${elm['s-id']}`);
93-
perf.measure(`request_bundle:${elm.nodeName.toLowerCase()}:${elm['s-id']}`, `request_bundle_start:${elm.nodeName.toLowerCase()}:${elm['s-id']}`, `request_bundle_end:${elm.nodeName.toLowerCase()}:${elm['s-id']}`);
94-
}
95-
96-
} else if (_BUILD_.externalModuleLoader) {
87+
if (_BUILD_.externalModuleLoader) {
9788
// using a 3rd party bundler to import modules
9889
// at this point the cmpMeta will already have a
9990
// static function as a the bundleIds that returns the module

src/core/host-snapshot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ export const initHostSnapshot = (domApi: d.DomApi, cmpMeta: d.ComponentMeta, hos
88
// have finished adding attributes and child nodes to the host
99
// before we go all out and hydrate this beast
1010
// let's first take a snapshot of its original layout before render
11-
if (_BUILD_.hasMode && !hostElm.mode) {
11+
if (_BUILD_.hasMode) {
1212
// looks like mode wasn't set as a property directly yet
1313
// first check if there's an attribute
1414
// next check the app's global
15-
hostElm.mode = domApi.$getMode(hostElm);
15+
hostElm.mode = hostElm.mode || domApi.$getMode(hostElm);
1616
} else {
1717
hostElm.mode = DEFAULT_STYLE_MODE;
1818
}

0 commit comments

Comments
 (0)