@oxog/react-check 1.0.3 → 1.1.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/CHANGELOG.md +58 -0
- package/README.md +54 -0
- package/dist/browser-inject.global.js +3 -3
- package/dist/cli.js +1447 -101
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +15 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/package.json +8 -2
package/dist/index.cjs
CHANGED
|
@@ -5210,6 +5210,18 @@ var Overlay = class {
|
|
|
5210
5210
|
if (render.renderCount > 20) return "warning";
|
|
5211
5211
|
return "healthy";
|
|
5212
5212
|
}
|
|
5213
|
+
/**
|
|
5214
|
+
* Record a render event (updates stats even without DOM element)
|
|
5215
|
+
* @param render - Render information
|
|
5216
|
+
*/
|
|
5217
|
+
recordRender(render) {
|
|
5218
|
+
const count = (this.renderCounts.get(render.componentName) ?? 0) + 1;
|
|
5219
|
+
this.renderCounts.set(render.componentName, count);
|
|
5220
|
+
this.totalRenders++;
|
|
5221
|
+
this.updateStats();
|
|
5222
|
+
}
|
|
5223
|
+
/** Total render count */
|
|
5224
|
+
totalRenders = 0;
|
|
5213
5225
|
/**
|
|
5214
5226
|
* Update toolbar stats
|
|
5215
5227
|
*/
|
|
@@ -5218,9 +5230,7 @@ var Overlay = class {
|
|
|
5218
5230
|
let critical = 0;
|
|
5219
5231
|
let warning = 0;
|
|
5220
5232
|
let healthy = 0;
|
|
5221
|
-
let total = 0;
|
|
5222
5233
|
for (const [, count] of this.renderCounts) {
|
|
5223
|
-
total += count;
|
|
5224
5234
|
if (count > 50) critical++;
|
|
5225
5235
|
else if (count > 20) warning++;
|
|
5226
5236
|
else healthy++;
|
|
@@ -5232,7 +5242,7 @@ var Overlay = class {
|
|
|
5232
5242
|
if (criticalEl) criticalEl.textContent = String(critical);
|
|
5233
5243
|
if (warningEl) warningEl.textContent = String(warning);
|
|
5234
5244
|
if (healthyEl) healthyEl.textContent = String(healthy);
|
|
5235
|
-
if (rendersEl) rendersEl.textContent = String(
|
|
5245
|
+
if (rendersEl) rendersEl.textContent = String(this.totalRenders);
|
|
5236
5246
|
}
|
|
5237
5247
|
/**
|
|
5238
5248
|
* Clear all highlights
|
|
@@ -5259,6 +5269,7 @@ var Overlay = class {
|
|
|
5259
5269
|
this.clearHighlights();
|
|
5260
5270
|
this.clearBadges();
|
|
5261
5271
|
this.renderCounts.clear();
|
|
5272
|
+
this.totalRenders = 0;
|
|
5262
5273
|
this.updateStats();
|
|
5263
5274
|
}
|
|
5264
5275
|
/**
|
|
@@ -5359,6 +5370,7 @@ var ReactCheckInjector = class {
|
|
|
5359
5370
|
setupScannerEvents() {
|
|
5360
5371
|
this.scanner.on("render", (render) => {
|
|
5361
5372
|
this.send({ type: "render", payload: render });
|
|
5373
|
+
this.overlay.recordRender(render);
|
|
5362
5374
|
const element = this.findDOMElement(render.componentName);
|
|
5363
5375
|
if (element) {
|
|
5364
5376
|
this.overlay.highlight(render, element);
|