@next-core/brick-kit 2.114.0 → 2.115.0

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.esm.js CHANGED
@@ -8838,15 +8838,11 @@ class LocationContext {
8838
8838
  }
8839
8839
 
8840
8840
  if (isRouteConfOfRoutes(route) && Array.isArray(route.routes)) {
8841
+ yield _this.preFetchMenu(route.context);
8841
8842
  yield _this.mountRoutes(route.routes, slotId, mountRoutesResult);
8842
8843
  } else if (isRouteConfOfBricks(route) && Array.isArray(route.bricks)) {
8843
- var useMenus = scanAppGetMenuInAny(route);
8844
-
8845
- if (useMenus.length) {
8846
- yield constructMenuByMenusList(useMenus, _this.getCurrentContext(), _this.kernel);
8847
- }
8848
-
8849
- yield _this.mountBricks(route.bricks, matched.match, slotId, mountRoutesResult); // analytics data (page_view event)
8844
+ yield _this.mountBricks(route.bricks, matched.match, slotId, mountRoutesResult);
8845
+ yield _this.preFetchMenu(route); // analytics data (page_view event)
8850
8846
 
8851
8847
  if (route.analyticsData) {
8852
8848
  mountRoutesResult.analyticsData = computeRealValue(route.analyticsData, context, true);
@@ -9102,6 +9098,9 @@ class LocationContext {
9102
9098
  var expandedBrickConf = brickConf;
9103
9099
 
9104
9100
  if (tplTagName) {
9101
+ var _customTemplateRegist;
9102
+
9103
+ yield _this6.preFetchMenu((_customTemplateRegist = customTemplateRegistry.get(tplTagName)) === null || _customTemplateRegist === void 0 ? void 0 : _customTemplateRegist.bricks);
9105
9104
  expandedBrickConf = yield asyncExpandCustomTemplate(_objectSpread(_objectSpread({}, brickConf), {}, {
9106
9105
  brick: tplTagName,
9107
9106
  // Properties are computed for custom templates.
@@ -9322,6 +9321,18 @@ class LocationContext {
9322
9321
  }
9323
9322
  }
9324
9323
 
9324
+ preFetchMenu(data) {
9325
+ var _this7 = this;
9326
+
9327
+ return _asyncToGenerator$4(function* () {
9328
+ var useMenus = scanAppGetMenuInAny(data);
9329
+
9330
+ if (useMenus.length) {
9331
+ yield constructMenuByMenusList(useMenus, _this7.getCurrentContext(), _this7.kernel);
9332
+ }
9333
+ })();
9334
+ }
9335
+
9325
9336
  }
9326
9337
 
9327
9338
  function unmountTree(mountPoint) {