@glimt/record 0.0.35 → 0.0.36
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/record.cjs +1 -43
- package/dist/record.cjs.map +1 -1
- package/dist/record.js +1 -43
- package/dist/record.js.map +1 -1
- package/dist/record.umd.cjs +1 -43
- package/dist/record.umd.cjs.map +2 -2
- package/dist/record.umd.min.cjs +17 -17
- package/dist/record.umd.min.cjs.map +3 -3
- package/package.json +1 -1
package/dist/record.umd.cjs
CHANGED
|
@@ -1205,7 +1205,6 @@ function serializeTextNode(n2, options) {
|
|
|
1205
1205
|
};
|
|
1206
1206
|
}
|
|
1207
1207
|
function serializeElementNode(n2, options) {
|
|
1208
|
-
const start = performance.now();
|
|
1209
1208
|
const {
|
|
1210
1209
|
doc,
|
|
1211
1210
|
blockClass,
|
|
@@ -1404,19 +1403,6 @@ function serializeElementNode(n2, options) {
|
|
|
1404
1403
|
if (customElements.get(tagName)) isCustomElement = true;
|
|
1405
1404
|
} catch (e2) {
|
|
1406
1405
|
}
|
|
1407
|
-
const took = performance.now() - start;
|
|
1408
|
-
if (!window.serialization_perf_map) window.serialization_perf_map = {};
|
|
1409
|
-
if (!(tagName in window.serialization_perf_map)) {
|
|
1410
|
-
window.serialization_perf_map[tagName] = {
|
|
1411
|
-
avg: 0,
|
|
1412
|
-
times: []
|
|
1413
|
-
};
|
|
1414
|
-
}
|
|
1415
|
-
window.serialization_perf_map[tagName].times.push(took);
|
|
1416
|
-
if (window.serialization_perf_map[tagName].times.length > 1e3) {
|
|
1417
|
-
window.serialization_perf_map[tagName].times.shift();
|
|
1418
|
-
}
|
|
1419
|
-
window.serialization_perf_map[tagName].avg = window.serialization_perf_map[tagName].times.reduce((a2, b) => a2 + b, 0) / window.serialization_perf_map[tagName].times.length;
|
|
1420
1406
|
return {
|
|
1421
1407
|
type: NodeType$2.Element,
|
|
1422
1408
|
tagName,
|
|
@@ -9793,15 +9779,6 @@ class DoubleLinkedList {
|
|
|
9793
9779
|
}
|
|
9794
9780
|
}
|
|
9795
9781
|
const moveKey = (id, parentId) => `${id}@${parentId}`;
|
|
9796
|
-
function makeid(length = 8) {
|
|
9797
|
-
var result2 = "";
|
|
9798
|
-
var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
9799
|
-
var charactersLength = characters.length;
|
|
9800
|
-
for (var i2 = 0; i2 < length; i2++) {
|
|
9801
|
-
result2 += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
9802
|
-
}
|
|
9803
|
-
return result2;
|
|
9804
|
-
}
|
|
9805
9782
|
class MutationBuffer {
|
|
9806
9783
|
constructor() {
|
|
9807
9784
|
__publicField(this, "frozen", false);
|
|
@@ -9838,7 +9815,6 @@ class MutationBuffer {
|
|
|
9838
9815
|
__publicField(this, "canvasManager");
|
|
9839
9816
|
__publicField(this, "processedNodeManager");
|
|
9840
9817
|
__publicField(this, "unattachedDoc");
|
|
9841
|
-
__publicField(this, "bufId", makeid());
|
|
9842
9818
|
__publicField(this, "stormBatches", []);
|
|
9843
9819
|
__publicField(this, "stormInfo", null);
|
|
9844
9820
|
__publicField(this, "stormSettings", {
|
|
@@ -9852,11 +9828,6 @@ class MutationBuffer {
|
|
|
9852
9828
|
__publicField(this, "handleStormMutations", (muts) => {
|
|
9853
9829
|
const time = Date.now();
|
|
9854
9830
|
if (this.stormInfo == null) {
|
|
9855
|
-
console.log(
|
|
9856
|
-
"detected probable mutation storm start",
|
|
9857
|
-
"buffer id:",
|
|
9858
|
-
this.bufId
|
|
9859
|
-
);
|
|
9860
9831
|
this.stormInfo = {
|
|
9861
9832
|
startedAt: time,
|
|
9862
9833
|
totalMutations: 0,
|
|
@@ -9887,18 +9858,6 @@ class MutationBuffer {
|
|
|
9887
9858
|
__publicField(this, "handleStormFinish", () => {
|
|
9888
9859
|
if (!this.stormInfo) return;
|
|
9889
9860
|
const { stormExceededLimit } = this.stormInfo;
|
|
9890
|
-
console.log(
|
|
9891
|
-
"mutation storm finished",
|
|
9892
|
-
"totalMutations:",
|
|
9893
|
-
this.stormInfo.totalMutations,
|
|
9894
|
-
"stormExceededLimit:",
|
|
9895
|
-
stormExceededLimit,
|
|
9896
|
-
"storm duration:",
|
|
9897
|
-
Date.now() - this.stormInfo.startedAt,
|
|
9898
|
-
"ms",
|
|
9899
|
-
"buffer id:",
|
|
9900
|
-
this.bufId
|
|
9901
|
-
);
|
|
9902
9861
|
clearTimeout(this.stormInfo.timeout);
|
|
9903
9862
|
this.stormInfo = null;
|
|
9904
9863
|
if (!stormExceededLimit) {
|
|
@@ -10386,6 +10345,7 @@ class MutationBuffer {
|
|
|
10386
10345
|
}
|
|
10387
10346
|
});
|
|
10388
10347
|
}
|
|
10348
|
+
// private bufId: string = makeid();
|
|
10389
10349
|
init(options) {
|
|
10390
10350
|
[
|
|
10391
10351
|
"mutationCb",
|
|
@@ -12454,7 +12414,6 @@ function record(options = {}) {
|
|
|
12454
12414
|
if (!recordDOM) {
|
|
12455
12415
|
return;
|
|
12456
12416
|
}
|
|
12457
|
-
const start = performance.now();
|
|
12458
12417
|
wrappedEmit(
|
|
12459
12418
|
{
|
|
12460
12419
|
type: EventType.Meta,
|
|
@@ -12522,7 +12481,6 @@ function record(options = {}) {
|
|
|
12522
12481
|
document.adoptedStyleSheets,
|
|
12523
12482
|
mirror.getId(document)
|
|
12524
12483
|
);
|
|
12525
|
-
console.log("full snapshot took", performance.now() - start, "ms");
|
|
12526
12484
|
};
|
|
12527
12485
|
try {
|
|
12528
12486
|
const handlers = [];
|