@next-core/brick-kit 2.199.0 → 2.199.2

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.
@@ -1430,9 +1430,16 @@
1430
1430
  }
1431
1431
  });
1432
1432
  var currentApp;
1433
+ var needPerf = false;
1433
1434
  function registerStoryboardFunctions(functions, app) {
1434
1435
  if (app) {
1436
+ var _app$config, _app$config$settings;
1435
1437
  currentApp = app;
1438
+ needPerf = app === null || app === void 0 ? void 0 : (_app$config = app.config) === null || _app$config === void 0 ? void 0 : (_app$config$settings = _app$config.settings) === null || _app$config$settings === void 0 ? void 0 : _app$config$settings.perfStoryboardFunctions;
1439
+ if (needPerf) {
1440
+ // Clear perf data when initialize functions.
1441
+ window.STORYBOARD_FUNCTIONS_PERF = [];
1442
+ }
1436
1443
  }
1437
1444
  registeredFunctions.clear();
1438
1445
  if (Array.isArray(functions)) {
@@ -1474,11 +1481,15 @@
1474
1481
  storyboardFunctions,
1475
1482
  isStoryboardFunction: true
1476
1483
  }), !!collectCoverage),
1477
- hooks: collector && {
1484
+ hooks: _objectSpread__default["default"]({
1485
+ perfCall: needPerf ? duration => {
1486
+ perf(name, fn.source, duration);
1487
+ } : undefined
1488
+ }, collector ? {
1478
1489
  beforeEvaluate: collector.beforeEvaluate,
1479
1490
  beforeCall: collector.beforeCall,
1480
1491
  beforeBranch: collector.beforeBranch
1481
- }
1492
+ } : null)
1482
1493
  });
1483
1494
  fn.processed = true;
1484
1495
  return fn.cooked;
@@ -1494,6 +1505,19 @@
1494
1505
  }
1495
1506
  };
1496
1507
  }
1508
+ function perf(name, source, duration) {
1509
+ var _window, _window$STORYBOARD_FU;
1510
+ var list = (_window$STORYBOARD_FU = (_window = window).STORYBOARD_FUNCTIONS_PERF) !== null && _window$STORYBOARD_FU !== void 0 ? _window$STORYBOARD_FU : _window.STORYBOARD_FUNCTIONS_PERF = [];
1511
+ var data = list.find(item => item.name === name);
1512
+ if (!data) {
1513
+ list.push(data = {
1514
+ name,
1515
+ durations: [],
1516
+ source
1517
+ });
1518
+ }
1519
+ data.durations.push(Math.round(duration * 1000));
1520
+ }
1497
1521
 
1498
1522
  var {
1499
1523
  storyboardFunctions,
@@ -3958,7 +3982,7 @@
3958
3982
  applyPageTitle(pageTitle) {
3959
3983
  var _kernel$currentApp;
3960
3984
  var baseTitle = this.getBrandSettings().base_title;
3961
- document.title = pageTitle ? ((_kernel$currentApp = kernel.currentApp) === null || _kernel$currentApp === void 0 ? void 0 : _kernel$currentApp.localeTitle) || "".concat(pageTitle, " - ").concat(baseTitle) : baseTitle;
3985
+ document.title = ((_kernel$currentApp = kernel.currentApp) === null || _kernel$currentApp === void 0 ? void 0 : _kernel$currentApp.localeTitle) || (pageTitle ? "".concat(pageTitle, " - ").concat(baseTitle) : baseTitle);
3962
3986
  }
3963
3987
  }
3964
3988