clarity-visualize 0.8.67 → 0.8.68
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.
|
@@ -1302,19 +1302,24 @@ class LayoutHelper {
|
|
|
1302
1302
|
this.hashMapBeta = {};
|
|
1303
1303
|
this.primaryHtmlNodeId = null;
|
|
1304
1304
|
};
|
|
1305
|
-
this.get = (hash) => {
|
|
1305
|
+
this.get = (hash, silent = false) => {
|
|
1306
1306
|
if (hash in this.hashMapBeta && this.hashMapBeta[hash].isConnected) {
|
|
1307
1307
|
return this.hashMapBeta[hash];
|
|
1308
1308
|
}
|
|
1309
1309
|
else if (hash in this.hashMapAlpha && this.hashMapAlpha[hash].isConnected) {
|
|
1310
|
+
// Beta lookup missed but the Alpha (fallback) selector resolved the element.
|
|
1311
|
+
// Surface this so we can measure how often Alpha is still required before retiring it.
|
|
1312
|
+
if (!silent && this.state.options.onalphaFallback) {
|
|
1313
|
+
this.state.options.onalphaFallback(hash);
|
|
1314
|
+
}
|
|
1310
1315
|
return this.hashMapAlpha[hash];
|
|
1311
1316
|
}
|
|
1312
1317
|
return null;
|
|
1313
1318
|
};
|
|
1314
1319
|
this.addToHashMap = (data, parent) => {
|
|
1315
1320
|
// In case of selector collision, prefer the first inserted node
|
|
1316
|
-
this.hashMapAlpha[data.hashAlpha] = this.get(data.hashAlpha) || parent;
|
|
1317
|
-
this.hashMapBeta[data.hashBeta] = this.get(data.hashBeta) || parent;
|
|
1321
|
+
this.hashMapAlpha[data.hashAlpha] = this.get(data.hashAlpha, true) || parent;
|
|
1322
|
+
this.hashMapBeta[data.hashBeta] = this.get(data.hashBeta, true) || parent;
|
|
1318
1323
|
};
|
|
1319
1324
|
this.resize = (el, width, height) => {
|
|
1320
1325
|
if (el && el.nodeType === 1 /* NodeType.ELEMENT_NODE */ && width && height) {
|