@next-core/brick-kit 2.159.2 → 2.159.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.bundle.js +29 -13
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +29 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/types/auth.d.ts.map +1 -1
- package/dist/types/core/Kernel.d.ts +3 -1
- package/dist/types/core/Kernel.d.ts.map +1 -1
- package/dist/types/core/LocationContext.d.ts.map +1 -1
- package/dist/types/core/Router.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1220,7 +1220,8 @@ function authenticate(newAuth) {
|
|
|
1220
1220
|
accessRule: newAuth.accessRule,
|
|
1221
1221
|
isAdmin: newAuth.isAdmin,
|
|
1222
1222
|
csrfToken: newAuth.csrfToken,
|
|
1223
|
-
license: newAuth.license
|
|
1223
|
+
license: newAuth.license,
|
|
1224
|
+
userShowValue: newAuth.userShowValue
|
|
1224
1225
|
});
|
|
1225
1226
|
|
|
1226
1227
|
// re-init analytics to set user_id
|
|
@@ -8106,9 +8107,9 @@ class Kernel {
|
|
|
8106
8107
|
} = _this.bootstrapData;
|
|
8107
8108
|
if (storyboard.dependsAll) {
|
|
8108
8109
|
var dllPath = window.DLL_PATH || {};
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8110
|
+
return {
|
|
8111
|
+
pendingTask: loadScriptOfDll(Object.values(dllPath)).then(() => loadScriptOfBricksOrTemplates(brickPackages.map(item => item.filePath).concat(templatePackages.map(item => item.filePath)))).then(() => loadAllLazyBricks())
|
|
8112
|
+
};
|
|
8112
8113
|
} else {
|
|
8113
8114
|
// 先加载模板
|
|
8114
8115
|
var templateDeps = getTemplateDepsOfStoryboard(storyboard, templatePackages);
|
|
@@ -8121,9 +8122,11 @@ class Kernel {
|
|
|
8121
8122
|
} = getDllAndDepsOfStoryboard(yield asyncProcessStoryboard(storyboard, brickTemplateRegistry, templatePackages), brickPackages, {
|
|
8122
8123
|
ignoreBricksInUnusedCustomTemplates: true
|
|
8123
8124
|
});
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8125
|
+
// 加载构件资源时,不再阻塞后续业务数据的加载,在挂载构件时再等待该任务完成。
|
|
8126
|
+
// 挂载构件可能包括:Provider 构件实时挂载、路由准备完成后的统一挂载等。
|
|
8127
|
+
return {
|
|
8128
|
+
pendingTask: loadScriptOfDll(dll).then(() => loadScriptOfBricksOrTemplates(deps)).then(() => loadLazyBricks(bricks))
|
|
8129
|
+
};
|
|
8127
8130
|
}
|
|
8128
8131
|
});
|
|
8129
8132
|
return function (_x) {
|
|
@@ -8526,14 +8529,14 @@ class Kernel {
|
|
|
8526
8529
|
args[_key - 1] = _arguments[_key];
|
|
8527
8530
|
}
|
|
8528
8531
|
try {
|
|
8529
|
-
yield fn(...args);
|
|
8532
|
+
return yield fn(...args);
|
|
8530
8533
|
} catch (e) {
|
|
8531
8534
|
if (e instanceof Event && e.target instanceof HTMLScriptElement) {
|
|
8532
8535
|
// The scripts maybe stale when a user stays in page while upgrades been applied.
|
|
8533
8536
|
// So we force reloading again automatically.
|
|
8534
8537
|
// NOTE: reload only once to avoid a infinite loop.
|
|
8535
8538
|
yield _this8.reloadMicroApps();
|
|
8536
|
-
yield fn(...args);
|
|
8539
|
+
return yield fn(...args);
|
|
8537
8540
|
} else {
|
|
8538
8541
|
throw e;
|
|
8539
8542
|
}
|
|
@@ -9882,6 +9885,7 @@ class LocationContext {
|
|
|
9882
9885
|
if (expandedBrickConf.bg) {
|
|
9883
9886
|
// A bg brick has no slotId.
|
|
9884
9887
|
brick.slotId = undefined;
|
|
9888
|
+
yield _this7.kernel.loadDynamicBricks([brick.type]);
|
|
9885
9889
|
appendBrick(brick, _this7.kernel.mountPoints.bg);
|
|
9886
9890
|
} else {
|
|
9887
9891
|
if (expandedBrickConf.portal) {
|
|
@@ -10843,6 +10847,9 @@ class Router {
|
|
|
10843
10847
|
var tracePageEnd = (_apiAnalyzer$getInsta = apiAnalyzer.getInstance()) === null || _apiAnalyzer$getInsta === void 0 ? void 0 : _apiAnalyzer$getInsta.tracePage();
|
|
10844
10848
|
var locationContext = _this3.locationContext = new LocationContext(_this3.kernel, location);
|
|
10845
10849
|
var storyboard = locationContext.matchStoryboard(_this3.kernel.bootstrapData.storyboards);
|
|
10850
|
+
|
|
10851
|
+
/** Pending task for loading bricks */
|
|
10852
|
+
var pendingTask;
|
|
10846
10853
|
if (storyboard) {
|
|
10847
10854
|
var _storyboard$meta, _storyboard$meta2, _storyboard$meta3;
|
|
10848
10855
|
yield _this3.kernel.fulfilStoryboard(storyboard);
|
|
@@ -10874,7 +10881,9 @@ class Router {
|
|
|
10874
10881
|
|
|
10875
10882
|
// 如果找到匹配的 storyboard,那么根据路由匹配得到的 sub-storyboard 加载它的依赖库。
|
|
10876
10883
|
var subStoryboard = _this3.locationContext.getSubStoryboardByRoute(storyboard);
|
|
10877
|
-
|
|
10884
|
+
({
|
|
10885
|
+
pendingTask
|
|
10886
|
+
} = yield _this3.kernel.loadDepsOfStoryboard(subStoryboard));
|
|
10878
10887
|
|
|
10879
10888
|
// 注册 Storyboard 中定义的自定义模板和函数。
|
|
10880
10889
|
_this3.kernel.registerCustomTemplatesInStoryboard(storyboard);
|
|
@@ -11050,14 +11059,21 @@ class Router {
|
|
|
11050
11059
|
}
|
|
11051
11060
|
_this3.setNavConfig(mountRoutesResult);
|
|
11052
11061
|
_this3.kernel.toggleLegacyIframe(actualLegacy === "iframe");
|
|
11053
|
-
menuInBg.
|
|
11054
|
-
|
|
11055
|
-
|
|
11062
|
+
yield Promise.all(menuInBg.map( /*#__PURE__*/function () {
|
|
11063
|
+
var _ref2 = _asyncToGenerator$3(function* (brick) {
|
|
11064
|
+
yield _this3.kernel.loadDynamicBricks([brick.type]);
|
|
11065
|
+
appendBrick(brick, mountPoints.portal);
|
|
11066
|
+
});
|
|
11067
|
+
return function (_x3) {
|
|
11068
|
+
return _ref2.apply(this, arguments);
|
|
11069
|
+
};
|
|
11070
|
+
}()));
|
|
11056
11071
|
|
|
11057
11072
|
// When we have a matched route other than an abstract route,
|
|
11058
11073
|
// we say *page found*, otherwise, *page not found*.
|
|
11059
11074
|
if (route && route.type !== "routes" || failed) {
|
|
11060
11075
|
var _this3$kernel$bootstr, _this3$kernel$bootstr2, _getAuth$license;
|
|
11076
|
+
yield pendingTask;
|
|
11061
11077
|
main.length > 0 && mountTree(main, mountPoints.main);
|
|
11062
11078
|
portal.length > 0 && mountTree(portal, mountPoints.portal);
|
|
11063
11079
|
afterMountTree(mountPoints.main);
|