@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/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.115.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.114.0...@next-core/brick-kit@2.115.0) (2022-03-30)
7
+
8
+
9
+ ### Features
10
+
11
+ * APP.getMenu support scan template & routes ([5498846](https://github.com/easyops-cn/next-core/commit/54988465a5357a97834aaca317b41b3fcb2c6a65))
12
+ * loactionContext preFetchMenu ([9a0ec7b](https://github.com/easyops-cn/next-core/commit/9a0ec7b0a19e26633772a71de829f014574ec735))
13
+ * support walkAny unit function ([8adff8e](https://github.com/easyops-cn/next-core/commit/8adff8e2538a43676c5eef1f275e1c5a8127171a))
14
+ * unit test update ([00b3606](https://github.com/easyops-cn/next-core/commit/00b3606c2a2d7ba9a26f3a0255721a11e225c7d9))
15
+
16
+
17
+
18
+
19
+
6
20
  # [2.114.0](https://github.com/easyops-cn/next-core/compare/@next-core/brick-kit@2.113.0...@next-core/brick-kit@2.114.0) (2022-03-29)
7
21
 
8
22
 
@@ -8837,15 +8837,11 @@
8837
8837
  }
8838
8838
 
8839
8839
  if (isRouteConfOfRoutes(route) && Array.isArray(route.routes)) {
8840
+ yield _this.preFetchMenu(route.context);
8840
8841
  yield _this.mountRoutes(route.routes, slotId, mountRoutesResult);
8841
8842
  } else if (isRouteConfOfBricks(route) && Array.isArray(route.bricks)) {
8842
- var useMenus = brickUtils.scanAppGetMenuInAny(route);
8843
-
8844
- if (useMenus.length) {
8845
- yield constructMenuByMenusList(useMenus, _this.getCurrentContext(), _this.kernel);
8846
- }
8847
-
8848
- yield _this.mountBricks(route.bricks, matched.match, slotId, mountRoutesResult); // analytics data (page_view event)
8843
+ yield _this.mountBricks(route.bricks, matched.match, slotId, mountRoutesResult);
8844
+ yield _this.preFetchMenu(route); // analytics data (page_view event)
8849
8845
 
8850
8846
  if (route.analyticsData) {
8851
8847
  mountRoutesResult.analyticsData = computeRealValue(route.analyticsData, context, true);
@@ -9101,6 +9097,9 @@
9101
9097
  var expandedBrickConf = brickConf;
9102
9098
 
9103
9099
  if (tplTagName) {
9100
+ var _customTemplateRegist;
9101
+
9102
+ yield _this6.preFetchMenu((_customTemplateRegist = customTemplateRegistry.get(tplTagName)) === null || _customTemplateRegist === void 0 ? void 0 : _customTemplateRegist.bricks);
9104
9103
  expandedBrickConf = yield asyncExpandCustomTemplate(_objectSpread__default["default"](_objectSpread__default["default"]({}, brickConf), {}, {
9105
9104
  brick: tplTagName,
9106
9105
  // Properties are computed for custom templates.
@@ -9321,6 +9320,18 @@
9321
9320
  }
9322
9321
  }
9323
9322
 
9323
+ preFetchMenu(data) {
9324
+ var _this7 = this;
9325
+
9326
+ return _asyncToGenerator__default["default"](function* () {
9327
+ var useMenus = brickUtils.scanAppGetMenuInAny(data);
9328
+
9329
+ if (useMenus.length) {
9330
+ yield constructMenuByMenusList(useMenus, _this7.getCurrentContext(), _this7.kernel);
9331
+ }
9332
+ })();
9333
+ }
9334
+
9324
9335
  }
9325
9336
 
9326
9337
  function unmountTree(mountPoint) {