@next-core/brick-kit 2.199.1 → 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.
- package/dist/index.bundle.js +26 -2
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +26 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/StoryboardFunctionRegistryFactory.d.ts +1 -1
- package/dist/types/core/StoryboardFunctionRegistryFactory.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.bundle.js
CHANGED
|
@@ -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:
|
|
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,
|