@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/dist/index.d.cts CHANGED
@@ -1257,6 +1257,13 @@ declare class Overlay {
1257
1257
  * @returns Severity level
1258
1258
  */
1259
1259
  private getSeverity;
1260
+ /**
1261
+ * Record a render event (updates stats even without DOM element)
1262
+ * @param render - Render information
1263
+ */
1264
+ recordRender(render: RenderInfo): void;
1265
+ /** Total render count */
1266
+ private totalRenders;
1260
1267
  /**
1261
1268
  * Update toolbar stats
1262
1269
  */
package/dist/index.d.ts CHANGED
@@ -1257,6 +1257,13 @@ declare class Overlay {
1257
1257
  * @returns Severity level
1258
1258
  */
1259
1259
  private getSeverity;
1260
+ /**
1261
+ * Record a render event (updates stats even without DOM element)
1262
+ * @param render - Render information
1263
+ */
1264
+ recordRender(render: RenderInfo): void;
1265
+ /** Total render count */
1266
+ private totalRenders;
1260
1267
  /**
1261
1268
  * Update toolbar stats
1262
1269
  */
package/dist/index.js CHANGED
@@ -5208,6 +5208,18 @@ var Overlay = class {
5208
5208
  if (render.renderCount > 20) return "warning";
5209
5209
  return "healthy";
5210
5210
  }
5211
+ /**
5212
+ * Record a render event (updates stats even without DOM element)
5213
+ * @param render - Render information
5214
+ */
5215
+ recordRender(render) {
5216
+ const count = (this.renderCounts.get(render.componentName) ?? 0) + 1;
5217
+ this.renderCounts.set(render.componentName, count);
5218
+ this.totalRenders++;
5219
+ this.updateStats();
5220
+ }
5221
+ /** Total render count */
5222
+ totalRenders = 0;
5211
5223
  /**
5212
5224
  * Update toolbar stats
5213
5225
  */
@@ -5216,9 +5228,7 @@ var Overlay = class {
5216
5228
  let critical = 0;
5217
5229
  let warning = 0;
5218
5230
  let healthy = 0;
5219
- let total = 0;
5220
5231
  for (const [, count] of this.renderCounts) {
5221
- total += count;
5222
5232
  if (count > 50) critical++;
5223
5233
  else if (count > 20) warning++;
5224
5234
  else healthy++;
@@ -5230,7 +5240,7 @@ var Overlay = class {
5230
5240
  if (criticalEl) criticalEl.textContent = String(critical);
5231
5241
  if (warningEl) warningEl.textContent = String(warning);
5232
5242
  if (healthyEl) healthyEl.textContent = String(healthy);
5233
- if (rendersEl) rendersEl.textContent = String(total);
5243
+ if (rendersEl) rendersEl.textContent = String(this.totalRenders);
5234
5244
  }
5235
5245
  /**
5236
5246
  * Clear all highlights
@@ -5257,6 +5267,7 @@ var Overlay = class {
5257
5267
  this.clearHighlights();
5258
5268
  this.clearBadges();
5259
5269
  this.renderCounts.clear();
5270
+ this.totalRenders = 0;
5260
5271
  this.updateStats();
5261
5272
  }
5262
5273
  /**
@@ -5357,6 +5368,7 @@ var ReactCheckInjector = class {
5357
5368
  setupScannerEvents() {
5358
5369
  this.scanner.on("render", (render) => {
5359
5370
  this.send({ type: "render", payload: render });
5371
+ this.overlay.recordRender(render);
5360
5372
  const element = this.findDOMElement(render.componentName);
5361
5373
  if (element) {
5362
5374
  this.overlay.highlight(render, element);