@oxog/devinspector 1.5.1 → 1.5.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/CHANGELOG.md +5 -0
- package/dist/{chunk-NP2SAIEA.js → chunk-D4LKJXON.js} +10 -2
- package/dist/chunk-D4LKJXON.js.map +1 -0
- package/dist/{console-monitor-AO67CSAK.js → console-monitor-4ILYG5HB.js} +2 -2
- package/dist/devinspector.umd.cjs +17 -4
- package/dist/devinspector.umd.cjs.map +1 -1
- package/dist/devinspector.umd.js +17 -4
- package/dist/devinspector.umd.js.map +1 -1
- package/dist/devinspector.umd.min.cjs +2 -2
- package/dist/devinspector.umd.min.cjs.map +1 -1
- package/dist/devinspector.umd.min.js +2 -2
- package/dist/devinspector.umd.min.js.map +1 -1
- package/dist/{error-monitor-AVTYBTS7.js → error-monitor-I6H3VVLI.js} +2 -2
- package/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/{network-monitor-QHVMB5F3.js → network-monitor-YJETSJKW.js} +2 -2
- package/dist/{performance-monitor-ULNHXBYX.js → performance-monitor-ESLQ3XM6.js} +6 -3
- package/dist/performance-monitor-ESLQ3XM6.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-NP2SAIEA.js.map +0 -1
- package/dist/performance-monitor-ULNHXBYX.js.map +0 -1
- /package/dist/{console-monitor-AO67CSAK.js.map → console-monitor-4ILYG5HB.js.map} +0 -0
- /package/dist/{error-monitor-AVTYBTS7.js.map → error-monitor-I6H3VVLI.js.map} +0 -0
- /package/dist/{network-monitor-QHVMB5F3.js.map → network-monitor-YJETSJKW.js.map} +0 -0
package/dist/devinspector.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oxog/devinspector v1.5.
|
|
2
|
+
* @oxog/devinspector v1.5.2
|
|
3
3
|
* (c) Ersin Koc <ersinkoc@gmail.com>
|
|
4
4
|
* Released under the MIT License
|
|
5
5
|
*/
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
/** Package version, kept in sync with package.json (checked by tests). */
|
|
338
|
-
const VERSION = '1.5.
|
|
338
|
+
const VERSION = '1.5.2';
|
|
339
339
|
|
|
340
340
|
/**
|
|
341
341
|
* DevInspector - the default inspector: floating widget plus a panel with
|
|
@@ -2393,7 +2393,7 @@
|
|
|
2393
2393
|
result = func.apply(thisArg, args);
|
|
2394
2394
|
return result;
|
|
2395
2395
|
};
|
|
2396
|
-
|
|
2396
|
+
const throttled = function (...args) {
|
|
2397
2397
|
const now = Date.now();
|
|
2398
2398
|
const remaining = wait - (now - lastCallTime);
|
|
2399
2399
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -2420,6 +2420,15 @@
|
|
|
2420
2420
|
}
|
|
2421
2421
|
return result;
|
|
2422
2422
|
};
|
|
2423
|
+
/** Drops a pending trailing call and its timer. */
|
|
2424
|
+
throttled.cancel = () => {
|
|
2425
|
+
if (timeout) {
|
|
2426
|
+
clearTimeout(timeout);
|
|
2427
|
+
timeout = null;
|
|
2428
|
+
}
|
|
2429
|
+
lastArgs = lastThis = null;
|
|
2430
|
+
};
|
|
2431
|
+
return throttled;
|
|
2423
2432
|
}
|
|
2424
2433
|
function generateId() {
|
|
2425
2434
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
@@ -4463,7 +4472,9 @@
|
|
|
4463
4472
|
this.metricsCollector = new MetricsCollector(this.handleMetrics.bind(this));
|
|
4464
4473
|
this.longTaskDetector = new LongTaskDetector(this.handleLongTask.bind(this));
|
|
4465
4474
|
// Throttle the performance data emission
|
|
4466
|
-
|
|
4475
|
+
const throttledEmit = throttle(this.emitPerformanceData.bind(this), 100);
|
|
4476
|
+
this.emitPerformanceData = throttledEmit;
|
|
4477
|
+
this.cancelPendingEmit = throttledEmit.cancel;
|
|
4467
4478
|
}
|
|
4468
4479
|
start() {
|
|
4469
4480
|
if (this.isActive)
|
|
@@ -4483,6 +4494,8 @@
|
|
|
4483
4494
|
this.memoryMonitor.stop();
|
|
4484
4495
|
this.metricsCollector.stop();
|
|
4485
4496
|
this.longTaskDetector.stop();
|
|
4497
|
+
// A trailing emission still pending must not fire after stop()
|
|
4498
|
+
this.cancelPendingEmit();
|
|
4486
4499
|
this.isActive = false;
|
|
4487
4500
|
}
|
|
4488
4501
|
handleFPSData(data) {
|