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