react-render-detective 0.3.0 → 0.5.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/core.d.cts CHANGED
@@ -15,6 +15,8 @@ interface Lifecycle {
15
15
  unmounts: number;
16
16
  /** Mounts that followed an unmount of the same component. */
17
17
  remounts: number;
18
+ /** When the most recent remount was observed. */
19
+ lastRemountAt?: number;
18
20
  }
19
21
  interface NodeRecord {
20
22
  id: string;
@@ -118,6 +120,16 @@ declare class Detective {
118
120
  */
119
121
  inlineDefinitionSuspected(name: string): boolean;
120
122
  lifecycleOf(name: string): Lifecycle;
123
+ /**
124
+ * Did a whole-tree rebuild just happen?
125
+ *
126
+ * Hot reload is the most common cause of remounts in development, and this
127
+ * tool only ever runs in development — so without this it would confidently
128
+ * blame a `key` every time React Fast Refresh replaced a module. A real key
129
+ * or inline-definition problem affects one component; a reload affects many
130
+ * at once.
131
+ */
132
+ private reloadSuspectedAt;
121
133
  /** Hot path. Must stay allocation-free and O(1). */
122
134
  recordAttempt(node: NodeRecord, props: Record<string, unknown>): void;
123
135
  recordStateChange(node: NodeRecord, change: TrackedStateChange): void;
@@ -196,6 +208,8 @@ interface DiagnosisInput {
196
208
  remounts: number;
197
209
  /** The component looks like it is declared inside another component's render body. */
198
210
  inlineDefinitionSuspected: boolean;
211
+ /** Many components remounted at once — a hot reload or a route change. */
212
+ treeReloadSuspected: boolean;
199
213
  selfDuration: number;
200
214
  attempts: number;
201
215
  committed: boolean;
package/dist/core.d.ts CHANGED
@@ -15,6 +15,8 @@ interface Lifecycle {
15
15
  unmounts: number;
16
16
  /** Mounts that followed an unmount of the same component. */
17
17
  remounts: number;
18
+ /** When the most recent remount was observed. */
19
+ lastRemountAt?: number;
18
20
  }
19
21
  interface NodeRecord {
20
22
  id: string;
@@ -118,6 +120,16 @@ declare class Detective {
118
120
  */
119
121
  inlineDefinitionSuspected(name: string): boolean;
120
122
  lifecycleOf(name: string): Lifecycle;
123
+ /**
124
+ * Did a whole-tree rebuild just happen?
125
+ *
126
+ * Hot reload is the most common cause of remounts in development, and this
127
+ * tool only ever runs in development — so without this it would confidently
128
+ * blame a `key` every time React Fast Refresh replaced a module. A real key
129
+ * or inline-definition problem affects one component; a reload affects many
130
+ * at once.
131
+ */
132
+ private reloadSuspectedAt;
121
133
  /** Hot path. Must stay allocation-free and O(1). */
122
134
  recordAttempt(node: NodeRecord, props: Record<string, unknown>): void;
123
135
  recordStateChange(node: NodeRecord, change: TrackedStateChange): void;
@@ -196,6 +208,8 @@ interface DiagnosisInput {
196
208
  remounts: number;
197
209
  /** The component looks like it is declared inside another component's render body. */
198
210
  inlineDefinitionSuspected: boolean;
211
+ /** Many components remounted at once — a hot reload or a route change. */
212
+ treeReloadSuspected: boolean;
199
213
  selfDuration: number;
200
214
  attempts: number;
201
215
  committed: boolean;
package/dist/core.js CHANGED
@@ -1,3 +1,3 @@
1
- export { Detective, RingBuffer, defaultConfig, detectDev, diagnose, diffProps, formatInspected, getDetective, inspect, isPlainObject, isReactElement, matches, mergeConfig, severityFor, shallowEqual, shouldInstrument, valueType } from './chunk-QOGTEVBP.js';
1
+ export { Detective, RingBuffer, defaultConfig, detectDev, diagnose, diffProps, formatInspected, getDetective, inspect, isPlainObject, isReactElement, matches, mergeConfig, severityFor, shallowEqual, shouldInstrument, valueType } from './chunk-DI5STJM4.js';
2
2
  //# sourceMappingURL=core.js.map
3
3
  //# sourceMappingURL=core.js.map