@widgetic/creator 0.3.69 → 0.3.70
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/utils/freezeWatchdog.js +1 -18
- package/package.json +1 -1
|
@@ -132,27 +132,10 @@ export function installFreezeWatchdog() {
|
|
|
132
132
|
URL.revokeObjectURL(url);
|
|
133
133
|
let lastStatus = '';
|
|
134
134
|
let pendingBreadcrumbs = [];
|
|
135
|
-
let lastLongTaskSentAt = performance.now();
|
|
136
|
-
function longTasksSince(since) {
|
|
137
|
-
if (typeof performance === 'undefined' || typeof performance.getEntriesByType !== 'function')
|
|
138
|
-
return [];
|
|
139
|
-
const found = [];
|
|
140
|
-
for (const entry of performance.getEntriesByType('longtask')) {
|
|
141
|
-
const endedAt = entry.startTime + entry.duration;
|
|
142
|
-
if (endedAt < since || entry.duration < BREADCRUMB_MIN_MS)
|
|
143
|
-
continue;
|
|
144
|
-
const attribution = entry.attribution?.[0];
|
|
145
|
-
const source = attribution?.containerSrc || attribution?.containerName || attribution?.containerType;
|
|
146
|
-
found.push({ label: 'longtask', duration: entry.duration, source });
|
|
147
|
-
}
|
|
148
|
-
return found;
|
|
149
|
-
}
|
|
150
135
|
worker.onmessage = (event) => {
|
|
151
136
|
const data = event.data;
|
|
152
137
|
if (data?.type === 'ping') {
|
|
153
|
-
|
|
154
|
-
lastLongTaskSentAt = performance.now();
|
|
155
|
-
worker.postMessage({ type: 'pong', status: lastStatus, breadcrumbs });
|
|
138
|
+
worker.postMessage({ type: 'pong', status: lastStatus, breadcrumbs: pendingBreadcrumbs });
|
|
156
139
|
pendingBreadcrumbs = [];
|
|
157
140
|
}
|
|
158
141
|
else if (data?.type === 'freeze-report' && data.message) {
|