@memlab/lens 1.0.3 → 2.0.0
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.js +28 -19
- package/dist/memlens.lib.bundle.js +106 -90
- package/dist/memlens.lib.bundle.min.js +1 -1
- package/dist/memlens.run.bundle.js +146 -135
- package/dist/memlens.run.bundle.min.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/ 3
|
|
6
|
-
|
|
5
|
+
/***/ 3
|
|
6
|
+
(module) {
|
|
7
7
|
|
|
8
8
|
module.exports = require("path");
|
|
9
9
|
|
|
10
|
-
/***/ }
|
|
10
|
+
/***/ },
|
|
11
11
|
|
|
12
|
-
/***/ 383
|
|
13
|
-
|
|
12
|
+
/***/ 383
|
|
13
|
+
(module) {
|
|
14
14
|
|
|
15
15
|
module.exports = require("fs");
|
|
16
16
|
|
|
17
|
-
/***/ }
|
|
17
|
+
/***/ },
|
|
18
18
|
|
|
19
|
-
/***/ 783
|
|
20
|
-
|
|
19
|
+
/***/ 783
|
|
20
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -36,15 +36,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
36
36
|
}) : function(o, v) {
|
|
37
37
|
o["default"] = v;
|
|
38
38
|
});
|
|
39
|
-
var __importStar = (this && this.__importStar) || function (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
39
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
+
var ownKeys = function(o) {
|
|
41
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
+
var ar = [];
|
|
43
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
+
return ar;
|
|
45
|
+
};
|
|
46
|
+
return ownKeys(o);
|
|
47
|
+
};
|
|
48
|
+
return function (mod) {
|
|
49
|
+
if (mod && mod.__esModule) return mod;
|
|
50
|
+
var result = {};
|
|
51
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
+
__setModuleDefault(result, mod);
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
46
56
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
47
|
-
exports.getBundleContent =
|
|
57
|
+
exports.getBundleContent = getBundleContent;
|
|
48
58
|
/**
|
|
49
59
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
50
60
|
*
|
|
@@ -58,12 +68,11 @@ const fs = __importStar(__webpack_require__(383));
|
|
|
58
68
|
const path = __importStar(__webpack_require__(3));
|
|
59
69
|
function getBundleContent() {
|
|
60
70
|
const bundlePath = path.join(__dirname, 'memlens.run.bundle.min.js');
|
|
61
|
-
return fs.readFileSync(bundlePath, '
|
|
71
|
+
return fs.readFileSync(bundlePath, { encoding: 'utf8' });
|
|
62
72
|
}
|
|
63
|
-
exports.getBundleContent = getBundleContent;
|
|
64
73
|
|
|
65
74
|
|
|
66
|
-
/***/ }
|
|
75
|
+
/***/ }
|
|
67
76
|
|
|
68
77
|
/******/ });
|
|
69
78
|
/************************************************************************/
|
|
@@ -37,8 +37,8 @@ return /******/ (() => { // webpackBootstrap
|
|
|
37
37
|
/******/ "use strict";
|
|
38
38
|
/******/ var __webpack_modules__ = ({
|
|
39
39
|
|
|
40
|
-
/***/ 54
|
|
41
|
-
|
|
40
|
+
/***/ 54
|
|
41
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
@@ -132,7 +132,7 @@ class DOMObserver {
|
|
|
132
132
|
if (document.body) {
|
|
133
133
|
// observe changes in DOM tree
|
|
134
134
|
(_a = __classPrivateFieldGet(this, _DOMObserver_mutationObserver, "f")) === null || _a === void 0 ? void 0 : _a.observe(document.body, {
|
|
135
|
-
childList: true,
|
|
135
|
+
childList: true, // Detect direct additions/removals
|
|
136
136
|
subtree: true, // Observe all descendants
|
|
137
137
|
});
|
|
138
138
|
}
|
|
@@ -230,17 +230,17 @@ _DOMObserver_elementCount = new WeakMap(), _DOMObserver_detachedElementCount = n
|
|
|
230
230
|
};
|
|
231
231
|
|
|
232
232
|
|
|
233
|
-
/***/ }
|
|
233
|
+
/***/ },
|
|
234
234
|
|
|
235
|
-
/***/ 235
|
|
236
|
-
|
|
235
|
+
/***/ 235
|
|
236
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
237
237
|
|
|
238
238
|
|
|
239
239
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
240
240
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
241
241
|
};
|
|
242
242
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
243
|
-
exports.createReactMemoryScan =
|
|
243
|
+
exports.createReactMemoryScan = createReactMemoryScan;
|
|
244
244
|
/**
|
|
245
245
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
246
246
|
*
|
|
@@ -259,13 +259,12 @@ function createReactMemoryScan(options = {}) {
|
|
|
259
259
|
// memoryScan.registerExtension(domVisualizer);
|
|
260
260
|
// return memoryScan;
|
|
261
261
|
}
|
|
262
|
-
exports.createReactMemoryScan = createReactMemoryScan;
|
|
263
262
|
|
|
264
263
|
|
|
265
|
-
/***/ }
|
|
264
|
+
/***/ },
|
|
266
265
|
|
|
267
|
-
/***/ 282
|
|
268
|
-
|
|
266
|
+
/***/ 282
|
|
267
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
269
268
|
|
|
270
269
|
|
|
271
270
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -284,13 +283,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
284
283
|
}) : function(o, v) {
|
|
285
284
|
o["default"] = v;
|
|
286
285
|
});
|
|
287
|
-
var __importStar = (this && this.__importStar) || function (
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
};
|
|
286
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
287
|
+
var ownKeys = function(o) {
|
|
288
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
289
|
+
var ar = [];
|
|
290
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
291
|
+
return ar;
|
|
292
|
+
};
|
|
293
|
+
return ownKeys(o);
|
|
294
|
+
};
|
|
295
|
+
return function (mod) {
|
|
296
|
+
if (mod && mod.__esModule) return mod;
|
|
297
|
+
var result = {};
|
|
298
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
299
|
+
__setModuleDefault(result, mod);
|
|
300
|
+
return result;
|
|
301
|
+
};
|
|
302
|
+
})();
|
|
294
303
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
295
304
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
296
305
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -563,7 +572,6 @@ class ReactMemoryScan {
|
|
|
563
572
|
return scanResult;
|
|
564
573
|
}
|
|
565
574
|
}
|
|
566
|
-
exports["default"] = ReactMemoryScan;
|
|
567
575
|
_ReactMemoryScan_elementWeakRefs = new WeakMap(), _ReactMemoryScan_isActivated = new WeakMap(), _ReactMemoryScan_intervalId = new WeakMap(), _ReactMemoryScan_elementToBoundingRects = new WeakMap(), _ReactMemoryScan_elementToComponentStack = new WeakMap(), _ReactMemoryScan_knownFiberNodes = new WeakMap(), _ReactMemoryScan_fiberAnalyzer = new WeakMap(), _ReactMemoryScan_isDevMode = new WeakMap(), _ReactMemoryScan_subscribers = new WeakMap(), _ReactMemoryScan_extensions = new WeakMap(), _ReactMemoryScan_scanIntervalMs = new WeakMap(), _ReactMemoryScan_domObserver = new WeakMap(), _ReactMemoryScan_eventListenerTracker = new WeakMap(), _ReactMemoryScan_isDisposed = new WeakMap(), _ReactMemoryScan_instances = new WeakSet(), _ReactMemoryScan_log = function _ReactMemoryScan_log(...args) {
|
|
568
576
|
if (__classPrivateFieldGet(this, _ReactMemoryScan_isDevMode, "f") && config_1.config.features.enableConsoleLogs) {
|
|
569
577
|
utils.consoleLog(...args);
|
|
@@ -644,6 +652,7 @@ _ReactMemoryScan_elementWeakRefs = new WeakMap(), _ReactMemoryScan_isActivated =
|
|
|
644
652
|
return eventListenerLeaks;
|
|
645
653
|
};
|
|
646
654
|
ReactMemoryScan.nextElementId = 0;
|
|
655
|
+
exports["default"] = ReactMemoryScan;
|
|
647
656
|
class LeakedFiber {
|
|
648
657
|
constructor(fiber) {
|
|
649
658
|
this.leakedFiber = fiber;
|
|
@@ -651,10 +660,10 @@ class LeakedFiber {
|
|
|
651
660
|
}
|
|
652
661
|
|
|
653
662
|
|
|
654
|
-
/***/ }
|
|
663
|
+
/***/ },
|
|
655
664
|
|
|
656
|
-
/***/ 302
|
|
657
|
-
|
|
665
|
+
/***/ 302
|
|
666
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
658
667
|
|
|
659
668
|
|
|
660
669
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -673,13 +682,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
673
682
|
}) : function(o, v) {
|
|
674
683
|
o["default"] = v;
|
|
675
684
|
});
|
|
676
|
-
var __importStar = (this && this.__importStar) || function (
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
};
|
|
685
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
686
|
+
var ownKeys = function(o) {
|
|
687
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
688
|
+
var ar = [];
|
|
689
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
690
|
+
return ar;
|
|
691
|
+
};
|
|
692
|
+
return ownKeys(o);
|
|
693
|
+
};
|
|
694
|
+
return function (mod) {
|
|
695
|
+
if (mod && mod.__esModule) return mod;
|
|
696
|
+
var result = {};
|
|
697
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
698
|
+
__setModuleDefault(result, mod);
|
|
699
|
+
return result;
|
|
700
|
+
};
|
|
701
|
+
})();
|
|
683
702
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
684
703
|
/**
|
|
685
704
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -781,10 +800,10 @@ class ReactFiberAnalyzer {
|
|
|
781
800
|
exports["default"] = ReactFiberAnalyzer;
|
|
782
801
|
|
|
783
802
|
|
|
784
|
-
/***/ }
|
|
803
|
+
/***/ },
|
|
785
804
|
|
|
786
|
-
/***/ 313
|
|
787
|
-
|
|
805
|
+
/***/ 313
|
|
806
|
+
(__unused_webpack_module, exports) {
|
|
788
807
|
|
|
789
808
|
|
|
790
809
|
/**
|
|
@@ -798,7 +817,17 @@ exports["default"] = ReactFiberAnalyzer;
|
|
|
798
817
|
*/
|
|
799
818
|
var _a, _b, _c;
|
|
800
819
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
801
|
-
exports.WeakMapPlus = exports.
|
|
820
|
+
exports.WeakMapPlus = exports.WeakMapNoOp = exports.WeakSetNoOp = exports.WeakRefNoOp = void 0;
|
|
821
|
+
exports.getNativeWeakMap = getNativeWeakMap;
|
|
822
|
+
exports.getNativeWeakMapOrFallback = getNativeWeakMapOrFallback;
|
|
823
|
+
exports.getNativeWeakSet = getNativeWeakSet;
|
|
824
|
+
exports.getNativeWeakSetOrFallback = getNativeWeakSetOrFallback;
|
|
825
|
+
exports.getNativeWeakRef = getNativeWeakRef;
|
|
826
|
+
exports.getNativeWeakRefOrFallback = getNativeWeakRefOrFallback;
|
|
827
|
+
exports.isWeakMapNative = isWeakMapNative;
|
|
828
|
+
exports.isWeakSetNative = isWeakSetNative;
|
|
829
|
+
exports.isWeakRefNative = isWeakRefNative;
|
|
830
|
+
exports.isWeakAPINative = isWeakAPINative;
|
|
802
831
|
const globalScope = typeof window !== 'undefined' ? window : self;
|
|
803
832
|
const _weakMap = (_a = globalScope.WeakMap) !== null && _a !== void 0 ? _a : null;
|
|
804
833
|
const _weakMapIsNative = isWeakMapNative();
|
|
@@ -862,27 +891,21 @@ exports.WeakMapNoOp = WeakMapNoOp;
|
|
|
862
891
|
function getNativeWeakMap() {
|
|
863
892
|
return _weakMapIsNative ? _weakMap : null;
|
|
864
893
|
}
|
|
865
|
-
exports.getNativeWeakMap = getNativeWeakMap;
|
|
866
894
|
function getNativeWeakMapOrFallback() {
|
|
867
895
|
return _weakMapIsNative && _weakMap ? _weakMap : WeakMapNoOp;
|
|
868
896
|
}
|
|
869
|
-
exports.getNativeWeakMapOrFallback = getNativeWeakMapOrFallback;
|
|
870
897
|
function getNativeWeakSet() {
|
|
871
898
|
return _weakSetIsNative ? _weakSet : null;
|
|
872
899
|
}
|
|
873
|
-
exports.getNativeWeakSet = getNativeWeakSet;
|
|
874
900
|
function getNativeWeakSetOrFallback() {
|
|
875
901
|
return _weakSetIsNative && _weakSet ? _weakSet : WeakSetNoOp;
|
|
876
902
|
}
|
|
877
|
-
exports.getNativeWeakSetOrFallback = getNativeWeakSetOrFallback;
|
|
878
903
|
function getNativeWeakRef() {
|
|
879
904
|
return _weakRefIsNative ? _weakRef : null;
|
|
880
905
|
}
|
|
881
|
-
exports.getNativeWeakRef = getNativeWeakRef;
|
|
882
906
|
function getNativeWeakRefOrFallback() {
|
|
883
907
|
return _weakRefIsNative && _weakRef ? _weakRef : WeakRefNoOp;
|
|
884
908
|
}
|
|
885
|
-
exports.getNativeWeakRefOrFallback = getNativeWeakRefOrFallback;
|
|
886
909
|
function normalize(input) {
|
|
887
910
|
return typeof input.replace === 'function'
|
|
888
911
|
? input.replace(/\n/g, ' ').replace(/\s+/g, ' ')
|
|
@@ -893,23 +916,19 @@ function isWeakMapNative() {
|
|
|
893
916
|
typeof _weakMap.toString === 'function' &&
|
|
894
917
|
normalize(_weakMap.toString()) === 'function WeakMap() { [native code] }');
|
|
895
918
|
}
|
|
896
|
-
exports.isWeakMapNative = isWeakMapNative;
|
|
897
919
|
function isWeakSetNative() {
|
|
898
920
|
return (_weakSet !== null &&
|
|
899
921
|
typeof _weakSet.toString === 'function' &&
|
|
900
922
|
normalize(_weakSet.toString()) === 'function WeakSet() { [native code] }');
|
|
901
923
|
}
|
|
902
|
-
exports.isWeakSetNative = isWeakSetNative;
|
|
903
924
|
function isWeakRefNative() {
|
|
904
925
|
return (_weakRef !== null &&
|
|
905
926
|
typeof _weakRef.toString === 'function' &&
|
|
906
927
|
normalize(_weakRef.toString()) === 'function WeakRef() { [native code] }');
|
|
907
928
|
}
|
|
908
|
-
exports.isWeakRefNative = isWeakRefNative;
|
|
909
929
|
function isWeakAPINative() {
|
|
910
930
|
return _weakAPIsAreNative;
|
|
911
931
|
}
|
|
912
|
-
exports.isWeakAPINative = isWeakAPINative;
|
|
913
932
|
class WeakMapPlus {
|
|
914
933
|
constructor(options = {}) {
|
|
915
934
|
this.strongMap = null;
|
|
@@ -1059,10 +1078,10 @@ class WeakMapPlus {
|
|
|
1059
1078
|
exports.WeakMapPlus = WeakMapPlus;
|
|
1060
1079
|
|
|
1061
1080
|
|
|
1062
|
-
/***/ }
|
|
1081
|
+
/***/ },
|
|
1063
1082
|
|
|
1064
|
-
/***/ 346
|
|
1065
|
-
|
|
1083
|
+
/***/ 346
|
|
1084
|
+
(__unused_webpack_module, exports) {
|
|
1066
1085
|
|
|
1067
1086
|
|
|
1068
1087
|
/**
|
|
@@ -1096,14 +1115,23 @@ exports.config = {
|
|
|
1096
1115
|
};
|
|
1097
1116
|
|
|
1098
1117
|
|
|
1099
|
-
/***/ }
|
|
1118
|
+
/***/ },
|
|
1100
1119
|
|
|
1101
|
-
/***/ 476
|
|
1102
|
-
|
|
1120
|
+
/***/ 476
|
|
1121
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
1103
1122
|
|
|
1104
1123
|
|
|
1105
1124
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1106
|
-
exports.
|
|
1125
|
+
exports.getDOMElements = getDOMElements;
|
|
1126
|
+
exports.getDOMElementCount = getDOMElementCount;
|
|
1127
|
+
exports.getMeaningfulName = getMeaningfulName;
|
|
1128
|
+
exports.isMinifiedName = isMinifiedName;
|
|
1129
|
+
exports.addCountbyKey = addCountbyKey;
|
|
1130
|
+
exports.updateWeakRefList = updateWeakRefList;
|
|
1131
|
+
exports.getBoundingClientRect = getBoundingClientRect;
|
|
1132
|
+
exports.consoleLog = consoleLog;
|
|
1133
|
+
exports.hasRunInSession = hasRunInSession;
|
|
1134
|
+
exports.setRunInSession = setRunInSession;
|
|
1107
1135
|
const visual_utils_1 = __webpack_require__(498);
|
|
1108
1136
|
function getDOMElements() {
|
|
1109
1137
|
const elements = Array.from(document.querySelectorAll('*'));
|
|
@@ -1116,7 +1144,6 @@ function getDOMElements() {
|
|
|
1116
1144
|
}
|
|
1117
1145
|
return ret;
|
|
1118
1146
|
}
|
|
1119
|
-
exports.getDOMElements = getDOMElements;
|
|
1120
1147
|
function getDOMElementCount() {
|
|
1121
1148
|
const elements = Array.from(document.querySelectorAll('*'));
|
|
1122
1149
|
let ret = 0;
|
|
@@ -1128,7 +1155,6 @@ function getDOMElementCount() {
|
|
|
1128
1155
|
}
|
|
1129
1156
|
return ret;
|
|
1130
1157
|
}
|
|
1131
|
-
exports.getDOMElementCount = getDOMElementCount;
|
|
1132
1158
|
function getMeaningfulName(name) {
|
|
1133
1159
|
if (name == null) {
|
|
1134
1160
|
return null;
|
|
@@ -1136,7 +1162,6 @@ function getMeaningfulName(name) {
|
|
|
1136
1162
|
const isMinified = isMinifiedName(name);
|
|
1137
1163
|
return isMinified ? null : name;
|
|
1138
1164
|
}
|
|
1139
|
-
exports.getMeaningfulName = getMeaningfulName;
|
|
1140
1165
|
/**
|
|
1141
1166
|
* Determines if a given function or class name is minified.
|
|
1142
1167
|
*
|
|
@@ -1159,12 +1184,10 @@ function isMinifiedName(name) {
|
|
|
1159
1184
|
const hasMeaningfulPattern = /^[A-Z][a-z]+([A-Z][a-z]*)*$|^[a-z]+([A-Z][a-z]*)*$/.test(name);
|
|
1160
1185
|
return !hasMeaningfulPattern;
|
|
1161
1186
|
}
|
|
1162
|
-
exports.isMinifiedName = isMinifiedName;
|
|
1163
1187
|
function addCountbyKey(map, key, count) {
|
|
1164
1188
|
var _a;
|
|
1165
1189
|
map.set(key, ((_a = map.get(key)) !== null && _a !== void 0 ? _a : 0) + count);
|
|
1166
1190
|
}
|
|
1167
|
-
exports.addCountbyKey = addCountbyKey;
|
|
1168
1191
|
function updateWeakRefList(weakRefList, elementRefs) {
|
|
1169
1192
|
consolidateWeakRefList(weakRefList);
|
|
1170
1193
|
const set = getElementsSet(weakRefList);
|
|
@@ -1178,7 +1201,6 @@ function updateWeakRefList(weakRefList, elementRefs) {
|
|
|
1178
1201
|
}
|
|
1179
1202
|
return weakRefList;
|
|
1180
1203
|
}
|
|
1181
|
-
exports.updateWeakRefList = updateWeakRefList;
|
|
1182
1204
|
function getElementsSet(weakRefList) {
|
|
1183
1205
|
const set = new Set();
|
|
1184
1206
|
for (const weakRef of weakRefList) {
|
|
@@ -1235,13 +1257,11 @@ function getBoundingClientRect(element) {
|
|
|
1235
1257
|
ret.scrollTop = scrollTop;
|
|
1236
1258
|
return ret;
|
|
1237
1259
|
}
|
|
1238
|
-
exports.getBoundingClientRect = getBoundingClientRect;
|
|
1239
1260
|
const _console = console;
|
|
1240
1261
|
const _consoleLog = _console.log;
|
|
1241
1262
|
function consoleLog(...args) {
|
|
1242
1263
|
_consoleLog.apply(_console, args);
|
|
1243
1264
|
}
|
|
1244
|
-
exports.consoleLog = consoleLog;
|
|
1245
1265
|
const SESSION_STORAGE_KEY = 'memory_lens_session';
|
|
1246
1266
|
function isSessionStorageAvailable() {
|
|
1247
1267
|
try {
|
|
@@ -1265,7 +1285,6 @@ function hasRunInSession() {
|
|
|
1265
1285
|
return false;
|
|
1266
1286
|
}
|
|
1267
1287
|
}
|
|
1268
|
-
exports.hasRunInSession = hasRunInSession;
|
|
1269
1288
|
function setRunInSession() {
|
|
1270
1289
|
if (!isSessionStorageAvailable()) {
|
|
1271
1290
|
return;
|
|
@@ -1277,17 +1296,21 @@ function setRunInSession() {
|
|
|
1277
1296
|
// do nothing
|
|
1278
1297
|
}
|
|
1279
1298
|
}
|
|
1280
|
-
exports.setRunInSession = setRunInSession;
|
|
1281
1299
|
|
|
1282
1300
|
|
|
1283
|
-
/***/ }
|
|
1301
|
+
/***/ },
|
|
1284
1302
|
|
|
1285
|
-
/***/ 498
|
|
1286
|
-
|
|
1303
|
+
/***/ 498
|
|
1304
|
+
(__unused_webpack_module, exports) {
|
|
1287
1305
|
|
|
1288
1306
|
|
|
1289
1307
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1290
|
-
exports.
|
|
1308
|
+
exports.isVisualizerElement = isVisualizerElement;
|
|
1309
|
+
exports.createVisualizerElement = createVisualizerElement;
|
|
1310
|
+
exports.tryToAttachOverlay = tryToAttachOverlay;
|
|
1311
|
+
exports.addTrackedListener = addTrackedListener;
|
|
1312
|
+
exports.removeAllListeners = removeAllListeners;
|
|
1313
|
+
exports.debounce = debounce;
|
|
1291
1314
|
const VISUALIZER_DATA_ATTR = 'data-visualizer';
|
|
1292
1315
|
function setVisualizerElement(element) {
|
|
1293
1316
|
element.setAttribute(VISUALIZER_DATA_ATTR, 'true');
|
|
@@ -1296,19 +1319,16 @@ function setVisualizerElement(element) {
|
|
|
1296
1319
|
function isVisualizerElement(element) {
|
|
1297
1320
|
return element.getAttribute(VISUALIZER_DATA_ATTR) === 'true';
|
|
1298
1321
|
}
|
|
1299
|
-
exports.isVisualizerElement = isVisualizerElement;
|
|
1300
1322
|
function createVisualizerElement(tag) {
|
|
1301
1323
|
const element = document.createElement(tag);
|
|
1302
1324
|
setVisualizerElement(element);
|
|
1303
1325
|
return element;
|
|
1304
1326
|
}
|
|
1305
|
-
exports.createVisualizerElement = createVisualizerElement;
|
|
1306
1327
|
function tryToAttachOverlay(overlayDiv) {
|
|
1307
1328
|
if (document.body) {
|
|
1308
1329
|
document.body.appendChild(overlayDiv);
|
|
1309
1330
|
}
|
|
1310
1331
|
}
|
|
1311
|
-
exports.tryToAttachOverlay = tryToAttachOverlay;
|
|
1312
1332
|
const listenerMap = new WeakMap();
|
|
1313
1333
|
function addTrackedListener(elRef, type, cb, options) {
|
|
1314
1334
|
var _a;
|
|
@@ -1321,7 +1341,6 @@ function addTrackedListener(elRef, type, cb, options) {
|
|
|
1321
1341
|
}
|
|
1322
1342
|
(_a = listenerMap.get(el)) === null || _a === void 0 ? void 0 : _a.push({ type, cb, options });
|
|
1323
1343
|
}
|
|
1324
|
-
exports.addTrackedListener = addTrackedListener;
|
|
1325
1344
|
function removeAllListeners(elRef) {
|
|
1326
1345
|
const el = elRef.deref();
|
|
1327
1346
|
if (!el)
|
|
@@ -1334,7 +1353,6 @@ function removeAllListeners(elRef) {
|
|
|
1334
1353
|
}
|
|
1335
1354
|
listenerMap.delete(el);
|
|
1336
1355
|
}
|
|
1337
|
-
exports.removeAllListeners = removeAllListeners;
|
|
1338
1356
|
function debounce(callback, delay) {
|
|
1339
1357
|
let timer = null;
|
|
1340
1358
|
return (...args) => {
|
|
@@ -1346,17 +1364,21 @@ function debounce(callback, delay) {
|
|
|
1346
1364
|
}, delay);
|
|
1347
1365
|
};
|
|
1348
1366
|
}
|
|
1349
|
-
exports.debounce = debounce;
|
|
1350
1367
|
|
|
1351
1368
|
|
|
1352
|
-
/***/ }
|
|
1369
|
+
/***/ },
|
|
1353
1370
|
|
|
1354
|
-
/***/ 737
|
|
1355
|
-
|
|
1371
|
+
/***/ 737
|
|
1372
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
1356
1373
|
|
|
1357
1374
|
|
|
1358
1375
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1359
|
-
exports.
|
|
1376
|
+
exports.traverseFiber = exports.getTopMostFiberWithChild = exports.getTopMostHostFiber = exports.getNearestHostFiber = exports.isHostFiber = exports.MutationMask = exports.Visibility = exports.Snapshot = exports.Ref = exports.ContentReset = exports.ChildDeletion = exports.Cloned = exports.Update = exports.Hydrating = exports.DidCapture = exports.Placement = exports.PerformedWork = exports.DEPRECATED_ASYNC_MODE_SYMBOL_STRING = exports.CONCURRENT_MODE_SYMBOL_STRING = exports.CONCURRENT_MODE_NUMBER = exports.HostRoot = exports.OffscreenComponent = exports.LegacyHiddenComponent = exports.Fragment = exports.HostText = exports.DehydratedSuspenseComponent = exports.HostSingletonTag = exports.HostHoistableTag = exports.HostComponentTag = exports.SimpleMemoComponentTag = exports.MemoComponentTag = exports.ForwardRefTag = exports.OffscreenComponentTag = exports.SuspenseComponentTag = exports.ContextConsumerTag = exports.FunctionComponentTag = exports.ClassComponentTag = void 0;
|
|
1377
|
+
exports.getFiberNodeFromElement = getFiberNodeFromElement;
|
|
1378
|
+
exports.getReactComponentStack = getReactComponentStack;
|
|
1379
|
+
exports.getDisplayNameOfFiberNode = getDisplayNameOfFiberNode;
|
|
1380
|
+
exports.isFunctionalComponent = isFunctionalComponent;
|
|
1381
|
+
exports.extractReactComponentName = extractReactComponentName;
|
|
1360
1382
|
const utils_1 = __webpack_require__(476);
|
|
1361
1383
|
const valid_component_name_1 = __webpack_require__(847);
|
|
1362
1384
|
exports.ClassComponentTag = 1;
|
|
@@ -1458,8 +1480,8 @@ const traverseFiber = (fiber, selector, ascending = false) => {
|
|
|
1458
1480
|
exports.traverseFiber = traverseFiber;
|
|
1459
1481
|
// React internal property keys
|
|
1460
1482
|
const internalKeys = [
|
|
1461
|
-
'__reactFiber$',
|
|
1462
|
-
'__reactInternalInstance$',
|
|
1483
|
+
'__reactFiber$', // React 17+
|
|
1484
|
+
'__reactInternalInstance$', // React 16
|
|
1463
1485
|
'_reactRootContainer', // React Root
|
|
1464
1486
|
];
|
|
1465
1487
|
const getOwnPropertyNames = Object.getOwnPropertyNames.bind(Object);
|
|
@@ -1473,7 +1495,6 @@ function getFiberNodeFromElement(element) {
|
|
|
1473
1495
|
}
|
|
1474
1496
|
return null;
|
|
1475
1497
|
}
|
|
1476
|
-
exports.getFiberNodeFromElement = getFiberNodeFromElement;
|
|
1477
1498
|
function getReactComponentStack(node) {
|
|
1478
1499
|
const stack = [];
|
|
1479
1500
|
const visited = new Set();
|
|
@@ -1491,7 +1512,6 @@ function getReactComponentStack(node) {
|
|
|
1491
1512
|
}
|
|
1492
1513
|
return stack;
|
|
1493
1514
|
}
|
|
1494
|
-
exports.getReactComponentStack = getReactComponentStack;
|
|
1495
1515
|
function getDisplayNameOfFiberNode(node) {
|
|
1496
1516
|
var _a, _b, _c, _d;
|
|
1497
1517
|
const elementType = (_a = node.type) !== null && _a !== void 0 ? _a : node.elementType;
|
|
@@ -1516,12 +1536,10 @@ function getDisplayNameOfFiberNode(node) {
|
|
|
1516
1536
|
const ret = (0, utils_1.getMeaningfulName)(extractReactComponentName(displayName));
|
|
1517
1537
|
return (0, valid_component_name_1.isValidComponentName)(ret) ? ret : null;
|
|
1518
1538
|
}
|
|
1519
|
-
exports.getDisplayNameOfFiberNode = getDisplayNameOfFiberNode;
|
|
1520
1539
|
function isFunctionalComponent(node) {
|
|
1521
1540
|
const elementType = node === null || node === void 0 ? void 0 : node.elementType;
|
|
1522
1541
|
return typeof elementType === 'function';
|
|
1523
1542
|
}
|
|
1524
|
-
exports.isFunctionalComponent = isFunctionalComponent;
|
|
1525
1543
|
// dom-element [from component.react] --> component.react
|
|
1526
1544
|
function extractReactComponentName(displayName) {
|
|
1527
1545
|
if (typeof displayName !== 'string') {
|
|
@@ -1541,13 +1559,12 @@ function extractReactComponentName(displayName) {
|
|
|
1541
1559
|
}
|
|
1542
1560
|
return name;
|
|
1543
1561
|
}
|
|
1544
|
-
exports.extractReactComponentName = extractReactComponentName;
|
|
1545
1562
|
|
|
1546
1563
|
|
|
1547
|
-
/***/ }
|
|
1564
|
+
/***/ },
|
|
1548
1565
|
|
|
1549
|
-
/***/ 847
|
|
1550
|
-
|
|
1566
|
+
/***/ 847
|
|
1567
|
+
(__unused_webpack_module, exports) {
|
|
1551
1568
|
|
|
1552
1569
|
|
|
1553
1570
|
/**
|
|
@@ -1560,18 +1577,17 @@ exports.extractReactComponentName = extractReactComponentName;
|
|
|
1560
1577
|
* @oncall memory_lab
|
|
1561
1578
|
*/
|
|
1562
1579
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1563
|
-
exports.isValidComponentName =
|
|
1580
|
+
exports.isValidComponentName = isValidComponentName;
|
|
1564
1581
|
const displayNameBlockList = new Set();
|
|
1565
1582
|
function isValidComponentName(name) {
|
|
1566
1583
|
return name != null && !displayNameBlockList.has(name);
|
|
1567
1584
|
}
|
|
1568
|
-
exports.isValidComponentName = isValidComponentName;
|
|
1569
1585
|
|
|
1570
1586
|
|
|
1571
|
-
/***/ }
|
|
1587
|
+
/***/ },
|
|
1572
1588
|
|
|
1573
|
-
/***/ 953
|
|
1574
|
-
|
|
1589
|
+
/***/ 953
|
|
1590
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
1575
1591
|
|
|
1576
1592
|
|
|
1577
1593
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
@@ -1703,7 +1719,7 @@ _EventListenerTracker_listenerMap = new WeakMap(), _EventListenerTracker_detache
|
|
|
1703
1719
|
EventListenerTracker.instance = null;
|
|
1704
1720
|
|
|
1705
1721
|
|
|
1706
|
-
/***/ }
|
|
1722
|
+
/***/ }
|
|
1707
1723
|
|
|
1708
1724
|
/******/ });
|
|
1709
1725
|
/************************************************************************/
|