@next-core/brick-kit 2.199.2 → 2.199.3

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.
@@ -1464,6 +1464,7 @@
1464
1464
  collector = collectCoverage.createCollector(name);
1465
1465
  }
1466
1466
  var precooked = brickUtils.precookFunction(fn.source, {
1467
+ cacheKey: fn,
1467
1468
  typescript: fn.typescript,
1468
1469
  hooks: collector && {
1469
1470
  beforeVisit: collector.beforeVisit
@@ -2726,7 +2727,9 @@
2726
2727
  if (globals.some(key => data.includes(key))) {
2727
2728
  var {
2728
2729
  attemptToVisitGlobals
2729
- } = brickUtils.preevaluate(data);
2730
+ } = brickUtils.preevaluate(data, {
2731
+ cache: true
2732
+ });
2730
2733
  return globals.some(key => attemptToVisitGlobals.has(key));
2731
2734
  }
2732
2735
  } else if (globals.includes("APP")) {
@@ -2895,7 +2898,9 @@
2895
2898
  // A `SyntaxError` maybe thrown.
2896
2899
  var precooked;
2897
2900
  try {
2898
- precooked = brickUtils.preevaluate(raw);
2901
+ precooked = brickUtils.preevaluate(raw, {
2902
+ cache: true
2903
+ });
2899
2904
  } catch (error) {
2900
2905
  var message = "".concat(error.message, ", in \"").concat(raw, "\"");
2901
2906
  if (options.isReEvaluation) {
@@ -12091,7 +12096,7 @@
12091
12096
  render(location) {
12092
12097
  var _this3 = this;
12093
12098
  return _asyncToGenerator__default["default"](function* () {
12094
- var _apiAnalyzer$getInsta, _storyboard$app, _this3$kernel$previou, _currentApp$config, _currentApp$config$_e, _this3$kernel$bootstr, _this3$kernel$bootstr2, _getLocalAppsTheme, _storyboard$app$homep, _storyboard$app2;
12099
+ var _apiAnalyzer$getInsta, _storyboard$app, _this3$kernel$previou, _currentApp, _currentApp2, _currentApp2$config, _currentApp2$config$_, _this3$kernel$bootstr, _this3$kernel$bootstr2, _getLocalAppsTheme, _currentApp3, _currentApp4, _storyboard$app$homep, _storyboard$app2;
12095
12100
  _this3.state = "initial";
12096
12101
  var renderId = _this3.renderId = _.uniqueId("render-id-");
12097
12102
  resetAllInjected();
@@ -12123,6 +12128,14 @@
12123
12128
  version: storyboard.app.currentVersion
12124
12129
  });
12125
12130
  }
12131
+ var previousApp = _this3.kernel.currentApp;
12132
+ var currentApp = storyboard ? storyboard.app : undefined;
12133
+ // Storyboard maybe re-assigned, e.g. when open launchpad.
12134
+ var appChanged = previousApp && currentApp ? previousApp.id !== currentApp.id : previousApp !== currentApp;
12135
+ brickUtils.clearExpressionASTCache();
12136
+ if (appChanged) {
12137
+ brickUtils.clearFunctionASTCache();
12138
+ }
12126
12139
 
12127
12140
  /** Pending task for loading bricks */
12128
12141
  var pendingTask;
@@ -12169,18 +12182,15 @@
12169
12182
  registerMock((_storyboard$meta2 = storyboard.meta) === null || _storyboard$meta2 === void 0 ? void 0 : _storyboard$meta2.mocks);
12170
12183
  registerFormRenderer();
12171
12184
  collectContract((_storyboard$meta3 = storyboard.meta) === null || _storyboard$meta3 === void 0 ? void 0 : _storyboard$meta3.contracts);
12185
+
12186
+ // `app` maybe fulfilled
12187
+ currentApp = storyboard.app;
12172
12188
  }
12173
- var {
12174
- mountPoints,
12175
- currentApp: previousApp
12176
- } = _this3.kernel;
12177
- var currentApp = storyboard ? storyboard.app : undefined;
12178
- // Storyboard maybe re-assigned, e.g. when open launchpad.
12179
- var appChanged = previousApp && currentApp ? previousApp.id !== currentApp.id : previousApp !== currentApp;
12189
+ var mountPoints = _this3.kernel.mountPoints;
12180
12190
  var legacy = currentApp ? currentApp.legacy : undefined;
12181
- var layoutType = (currentApp === null || currentApp === void 0 ? void 0 : currentApp.layoutType) || "console";
12191
+ var layoutType = ((_currentApp = currentApp) === null || _currentApp === void 0 ? void 0 : _currentApp.layoutType) || "console";
12182
12192
  var faviconElement = document.querySelector("link[rel='shortcut icon']");
12183
- var customFaviconHref = currentApp === null || currentApp === void 0 ? void 0 : (_currentApp$config = currentApp.config) === null || _currentApp$config === void 0 ? void 0 : (_currentApp$config$_e = _currentApp$config._easyops_app_favicon) === null || _currentApp$config$_e === void 0 ? void 0 : _currentApp$config$_e.default;
12193
+ var customFaviconHref = (_currentApp2 = currentApp) === null || _currentApp2 === void 0 ? void 0 : (_currentApp2$config = _currentApp2.config) === null || _currentApp2$config === void 0 ? void 0 : (_currentApp2$config$_ = _currentApp2$config._easyops_app_favicon) === null || _currentApp2$config$_ === void 0 ? void 0 : _currentApp2$config$_.default;
12184
12194
  var settingsFaviconHref = (_this3$kernel$bootstr = _this3.kernel.bootstrapData.settings) === null || _this3$kernel$bootstr === void 0 ? void 0 : (_this3$kernel$bootstr2 = _this3$kernel$bootstr.brand) === null || _this3$kernel$bootstr2 === void 0 ? void 0 : _this3$kernel$bootstr2.favicon;
12185
12195
  if (faviconElement) {
12186
12196
  if (customFaviconHref) {
@@ -12199,7 +12209,7 @@
12199
12209
  transform: "translateY(-100px)",
12200
12210
  height: "calc(100vh - var(--app-bar-height))"
12201
12211
  };
12202
- setTheme(((_getLocalAppsTheme = getLocalAppsTheme()) === null || _getLocalAppsTheme === void 0 ? void 0 : _getLocalAppsTheme[currentApp === null || currentApp === void 0 ? void 0 : currentApp.id]) || (currentApp === null || currentApp === void 0 ? void 0 : currentApp.theme) || "light");
12212
+ setTheme(((_getLocalAppsTheme = getLocalAppsTheme()) === null || _getLocalAppsTheme === void 0 ? void 0 : _getLocalAppsTheme[(_currentApp3 = currentApp) === null || _currentApp3 === void 0 ? void 0 : _currentApp3.id]) || ((_currentApp4 = currentApp) === null || _currentApp4 === void 0 ? void 0 : _currentApp4.theme) || "light");
12203
12213
  getRuntime().getFeatureFlags()["support-ui-8.2-compact-layout"] ? document.body.classList.add("compact-layout") : document.body.classList.remove("compact-layout");
12204
12214
  setMode("default");
12205
12215
  devtoolsHookEmit("rendering");
@@ -12395,12 +12405,12 @@
12395
12405
  // When we have a matched route other than an abstract route,
12396
12406
  // we say *page found*, otherwise, *page not found*.
12397
12407
  if (route && route.type !== "routes" || failed) {
12398
- var _this3$kernel$bootstr3, _this3$kernel$bootstr4, _getAuth$license;
12408
+ var _currentApp5, _this3$kernel$bootstr3, _this3$kernel$bootstr4, _getAuth$license;
12399
12409
  if (!failed) {
12400
12410
  yield pendingTask;
12401
12411
  }
12402
12412
  window.DISABLE_REACT_FLUSH_SYNC = false;
12403
- setUIVersion(currentApp === null || currentApp === void 0 ? void 0 : currentApp.uiVersion);
12413
+ setUIVersion((_currentApp5 = currentApp) === null || _currentApp5 === void 0 ? void 0 : _currentApp5.uiVersion);
12404
12414
  main.length > 0 && mountTree(main, mountPoints.main);
12405
12415
  portal.length > 0 && mountTree(portal, mountPoints.portal);
12406
12416
  afterMountTree(mountPoints.main);