react-render-detective 0.5.0 → 0.6.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +2 -2
  3. package/dist/babel.cjs +2 -2
  4. package/dist/babel.d.cts +11 -0
  5. package/dist/babel.d.ts +11 -0
  6. package/dist/babel.js +1 -1
  7. package/dist/{chunk-DI5STJM4.js → chunk-3TZNM7JO.js} +66 -3
  8. package/dist/chunk-3TZNM7JO.js.map +1 -0
  9. package/dist/{chunk-HOTY7J3X.js → chunk-D7M4UC3Y.js} +26 -2
  10. package/dist/chunk-D7M4UC3Y.js.map +1 -0
  11. package/dist/{chunk-PHYYA67T.cjs → chunk-EXDRRUUQ.cjs} +69 -2
  12. package/dist/chunk-EXDRRUUQ.cjs.map +1 -0
  13. package/dist/{chunk-OSPTERGK.cjs → chunk-LCGXVRJR.cjs} +66 -3
  14. package/dist/chunk-LCGXVRJR.cjs.map +1 -0
  15. package/dist/{chunk-MCIQMYNR.js → chunk-QVHAC7AD.js} +69 -2
  16. package/dist/chunk-QVHAC7AD.js.map +1 -0
  17. package/dist/{chunk-JD4IJ4MN.cjs → chunk-RGT44QQI.cjs} +26 -2
  18. package/dist/chunk-RGT44QQI.cjs.map +1 -0
  19. package/dist/core.cjs +18 -18
  20. package/dist/core.d.cts +13 -3
  21. package/dist/core.d.ts +13 -3
  22. package/dist/core.js +1 -1
  23. package/dist/index.cjs +72 -274
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +35 -115
  26. package/dist/index.d.ts +35 -115
  27. package/dist/index.js +41 -237
  28. package/dist/index.js.map +1 -1
  29. package/dist/interactions.cjs +252 -0
  30. package/dist/interactions.cjs.map +1 -0
  31. package/dist/interactions.d.cts +110 -0
  32. package/dist/interactions.d.ts +110 -0
  33. package/dist/interactions.js +241 -0
  34. package/dist/interactions.js.map +1 -0
  35. package/dist/overlay.cjs +5 -5
  36. package/dist/overlay.js +2 -2
  37. package/dist/testing.d.cts +1 -1
  38. package/dist/testing.d.ts +1 -1
  39. package/dist/{types-gl13xwmN.d.cts → types-CRET8EhB.d.cts} +20 -2
  40. package/dist/{types-gl13xwmN.d.ts → types-CRET8EhB.d.ts} +20 -2
  41. package/dist/vite.cjs +2 -2
  42. package/dist/vite.js +1 -1
  43. package/package.json +6 -1
  44. package/dist/chunk-DI5STJM4.js.map +0 -1
  45. package/dist/chunk-HOTY7J3X.js.map +0 -1
  46. package/dist/chunk-JD4IJ4MN.cjs.map +0 -1
  47. package/dist/chunk-MCIQMYNR.js.map +0 -1
  48. package/dist/chunk-OSPTERGK.cjs.map +0 -1
  49. package/dist/chunk-PHYYA67T.cjs.map +0 -1
package/dist/core.cjs CHANGED
@@ -1,76 +1,76 @@
1
1
  'use strict';
2
2
 
3
- var chunkOSPTERGK_cjs = require('./chunk-OSPTERGK.cjs');
3
+ var chunkLCGXVRJR_cjs = require('./chunk-LCGXVRJR.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Detective", {
8
8
  enumerable: true,
9
- get: function () { return chunkOSPTERGK_cjs.Detective; }
9
+ get: function () { return chunkLCGXVRJR_cjs.Detective; }
10
10
  });
11
11
  Object.defineProperty(exports, "RingBuffer", {
12
12
  enumerable: true,
13
- get: function () { return chunkOSPTERGK_cjs.RingBuffer; }
13
+ get: function () { return chunkLCGXVRJR_cjs.RingBuffer; }
14
14
  });
15
15
  Object.defineProperty(exports, "defaultConfig", {
16
16
  enumerable: true,
17
- get: function () { return chunkOSPTERGK_cjs.defaultConfig; }
17
+ get: function () { return chunkLCGXVRJR_cjs.defaultConfig; }
18
18
  });
19
19
  Object.defineProperty(exports, "detectDev", {
20
20
  enumerable: true,
21
- get: function () { return chunkOSPTERGK_cjs.detectDev; }
21
+ get: function () { return chunkLCGXVRJR_cjs.detectDev; }
22
22
  });
23
23
  Object.defineProperty(exports, "diagnose", {
24
24
  enumerable: true,
25
- get: function () { return chunkOSPTERGK_cjs.diagnose; }
25
+ get: function () { return chunkLCGXVRJR_cjs.diagnose; }
26
26
  });
27
27
  Object.defineProperty(exports, "diffProps", {
28
28
  enumerable: true,
29
- get: function () { return chunkOSPTERGK_cjs.diffProps; }
29
+ get: function () { return chunkLCGXVRJR_cjs.diffProps; }
30
30
  });
31
31
  Object.defineProperty(exports, "formatInspected", {
32
32
  enumerable: true,
33
- get: function () { return chunkOSPTERGK_cjs.formatInspected; }
33
+ get: function () { return chunkLCGXVRJR_cjs.formatInspected; }
34
34
  });
35
35
  Object.defineProperty(exports, "getDetective", {
36
36
  enumerable: true,
37
- get: function () { return chunkOSPTERGK_cjs.getDetective; }
37
+ get: function () { return chunkLCGXVRJR_cjs.getDetective; }
38
38
  });
39
39
  Object.defineProperty(exports, "inspect", {
40
40
  enumerable: true,
41
- get: function () { return chunkOSPTERGK_cjs.inspect; }
41
+ get: function () { return chunkLCGXVRJR_cjs.inspect; }
42
42
  });
43
43
  Object.defineProperty(exports, "isPlainObject", {
44
44
  enumerable: true,
45
- get: function () { return chunkOSPTERGK_cjs.isPlainObject; }
45
+ get: function () { return chunkLCGXVRJR_cjs.isPlainObject; }
46
46
  });
47
47
  Object.defineProperty(exports, "isReactElement", {
48
48
  enumerable: true,
49
- get: function () { return chunkOSPTERGK_cjs.isReactElement; }
49
+ get: function () { return chunkLCGXVRJR_cjs.isReactElement; }
50
50
  });
51
51
  Object.defineProperty(exports, "matches", {
52
52
  enumerable: true,
53
- get: function () { return chunkOSPTERGK_cjs.matches; }
53
+ get: function () { return chunkLCGXVRJR_cjs.matches; }
54
54
  });
55
55
  Object.defineProperty(exports, "mergeConfig", {
56
56
  enumerable: true,
57
- get: function () { return chunkOSPTERGK_cjs.mergeConfig; }
57
+ get: function () { return chunkLCGXVRJR_cjs.mergeConfig; }
58
58
  });
59
59
  Object.defineProperty(exports, "severityFor", {
60
60
  enumerable: true,
61
- get: function () { return chunkOSPTERGK_cjs.severityFor; }
61
+ get: function () { return chunkLCGXVRJR_cjs.severityFor; }
62
62
  });
63
63
  Object.defineProperty(exports, "shallowEqual", {
64
64
  enumerable: true,
65
- get: function () { return chunkOSPTERGK_cjs.shallowEqual; }
65
+ get: function () { return chunkLCGXVRJR_cjs.shallowEqual; }
66
66
  });
67
67
  Object.defineProperty(exports, "shouldInstrument", {
68
68
  enumerable: true,
69
- get: function () { return chunkOSPTERGK_cjs.shouldInstrument; }
69
+ get: function () { return chunkLCGXVRJR_cjs.shouldInstrument; }
70
70
  });
71
71
  Object.defineProperty(exports, "valueType", {
72
72
  enumerable: true,
73
- get: function () { return chunkOSPTERGK_cjs.valueType; }
73
+ get: function () { return chunkLCGXVRJR_cjs.valueType; }
74
74
  });
75
75
  //# sourceMappingURL=core.cjs.map
76
76
  //# sourceMappingURL=core.cjs.map
package/dist/core.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DetectiveConfig, T as TrackedStateChange, R as RenderReason, a as DetectiveOptions, b as RenderEvent, c as RenderPhase, C as ContextChange, d as ComponentStats, A as AppStats, P as PropChange, e as Thresholds, f as Diagnosis, I as Inspected, g as InspectionLimits, h as PropValueType } from './types-gl13xwmN.cjs';
2
- export { i as ComponentInfo, j as Confidence, M as Mode, k as PropChangeKind, l as RenderTimings } from './types-gl13xwmN.cjs';
1
+ import { D as DetectiveConfig, T as TrackedStateChange, S as SelectorChange, R as RenderReason, a as DetectiveOptions, b as RenderEvent, c as RenderPhase, C as ContextChange, d as ComponentStats, A as AppStats, P as PropChange, e as Thresholds, f as Diagnosis, I as Inspected, g as InspectionLimits, h as PropValueType } from './types-CRET8EhB.cjs';
2
+ export { i as ComponentInfo, j as Confidence, M as Mode, k as PropChangeKind, l as RenderTimings } from './types-CRET8EhB.cjs';
3
3
 
4
4
  /** What an instrumentation site reports at commit time. */
5
5
  interface CommitInput {
@@ -34,6 +34,8 @@ interface NodeRecord {
34
34
  attempts: number;
35
35
  /** Named state updates reported by `useTrackedState`, consumed at the next commit. */
36
36
  pendingState: TrackedStateChange[];
37
+ /** Selector value changes reported by tracked `useSelector`, consumed at the next commit. */
38
+ pendingSelectors: SelectorChange[];
37
39
  /** Set as soon as a commit is queued, so mount detection never waits on flush. */
38
40
  seenCommit: boolean;
39
41
  /** Has this instance ever been attached? Distinguishes a real mount from a StrictMode replay. */
@@ -66,6 +68,9 @@ declare class Detective {
66
68
  private nodes;
67
69
  private events;
68
70
  private listeners;
71
+ /** Registered by optional entry points so they follow clear()/reset() without being imported here. */
72
+ private clearHooks;
73
+ private resetHooks;
69
74
  private pending;
70
75
  private contextChanges;
71
76
  /** Orders renders and context updates so they can be matched without timers. */
@@ -93,6 +98,8 @@ declare class Detective {
93
98
  configure(options?: DetectiveOptions): void;
94
99
  get isInitialized(): boolean;
95
100
  get enabled(): boolean;
101
+ registerClearHook(hook: () => void): void;
102
+ registerResetHook(hook: () => void): void;
96
103
  subscribe(listener: (event: RenderEvent) => void): () => void;
97
104
  /**
98
105
  * Creates a node without publishing it. StrictMode's double mount renders
@@ -133,6 +140,7 @@ declare class Detective {
133
140
  /** Hot path. Must stay allocation-free and O(1). */
134
141
  recordAttempt(node: NodeRecord, props: Record<string, unknown>): void;
135
142
  recordStateChange(node: NodeRecord, change: TrackedStateChange): void;
143
+ recordSelectorChange(node: NodeRecord, change: SelectorChange): void;
136
144
  /**
137
145
  * Hot path. Called from Profiler#onRender; only enqueues.
138
146
  *
@@ -204,6 +212,8 @@ interface DiagnosisInput {
204
212
  contextChanges: ContextChange[];
205
213
  /** Named state updates from `useTrackedState`. Empty unless opted in. */
206
214
  trackedState: TrackedStateChange[];
215
+ /** External-store selector values that changed. Empty unless selectors are tracked. */
216
+ selectorChanges: SelectorChange[];
207
217
  /** How many times this component has been rebuilt rather than re-rendered. */
208
218
  remounts: number;
209
219
  /** The component looks like it is declared inside another component's render body. */
@@ -250,4 +260,4 @@ declare class RingBuffer<T> {
250
260
  resize(capacity: number): void;
251
261
  }
252
262
 
253
- export { AppStats, ComponentStats, ContextChange, Detective, DetectiveConfig, DetectiveOptions, Diagnosis, type DiagnosisInput, Inspected, InspectionLimits, PropChange, PropValueType, RenderEvent, RenderPhase, RenderReason, RingBuffer, Thresholds, TrackedStateChange, defaultConfig, detectDev, diagnose, diffProps, formatInspected, getDetective, inspect, isPlainObject, isReactElement, matches, mergeConfig, severityFor, shallowEqual, shouldInstrument, valueType };
263
+ export { AppStats, ComponentStats, ContextChange, Detective, DetectiveConfig, DetectiveOptions, Diagnosis, type DiagnosisInput, Inspected, InspectionLimits, PropChange, PropValueType, RenderEvent, RenderPhase, RenderReason, RingBuffer, SelectorChange, Thresholds, TrackedStateChange, defaultConfig, detectDev, diagnose, diffProps, formatInspected, getDetective, inspect, isPlainObject, isReactElement, matches, mergeConfig, severityFor, shallowEqual, shouldInstrument, valueType };
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DetectiveConfig, T as TrackedStateChange, R as RenderReason, a as DetectiveOptions, b as RenderEvent, c as RenderPhase, C as ContextChange, d as ComponentStats, A as AppStats, P as PropChange, e as Thresholds, f as Diagnosis, I as Inspected, g as InspectionLimits, h as PropValueType } from './types-gl13xwmN.js';
2
- export { i as ComponentInfo, j as Confidence, M as Mode, k as PropChangeKind, l as RenderTimings } from './types-gl13xwmN.js';
1
+ import { D as DetectiveConfig, T as TrackedStateChange, S as SelectorChange, R as RenderReason, a as DetectiveOptions, b as RenderEvent, c as RenderPhase, C as ContextChange, d as ComponentStats, A as AppStats, P as PropChange, e as Thresholds, f as Diagnosis, I as Inspected, g as InspectionLimits, h as PropValueType } from './types-CRET8EhB.js';
2
+ export { i as ComponentInfo, j as Confidence, M as Mode, k as PropChangeKind, l as RenderTimings } from './types-CRET8EhB.js';
3
3
 
4
4
  /** What an instrumentation site reports at commit time. */
5
5
  interface CommitInput {
@@ -34,6 +34,8 @@ interface NodeRecord {
34
34
  attempts: number;
35
35
  /** Named state updates reported by `useTrackedState`, consumed at the next commit. */
36
36
  pendingState: TrackedStateChange[];
37
+ /** Selector value changes reported by tracked `useSelector`, consumed at the next commit. */
38
+ pendingSelectors: SelectorChange[];
37
39
  /** Set as soon as a commit is queued, so mount detection never waits on flush. */
38
40
  seenCommit: boolean;
39
41
  /** Has this instance ever been attached? Distinguishes a real mount from a StrictMode replay. */
@@ -66,6 +68,9 @@ declare class Detective {
66
68
  private nodes;
67
69
  private events;
68
70
  private listeners;
71
+ /** Registered by optional entry points so they follow clear()/reset() without being imported here. */
72
+ private clearHooks;
73
+ private resetHooks;
69
74
  private pending;
70
75
  private contextChanges;
71
76
  /** Orders renders and context updates so they can be matched without timers. */
@@ -93,6 +98,8 @@ declare class Detective {
93
98
  configure(options?: DetectiveOptions): void;
94
99
  get isInitialized(): boolean;
95
100
  get enabled(): boolean;
101
+ registerClearHook(hook: () => void): void;
102
+ registerResetHook(hook: () => void): void;
96
103
  subscribe(listener: (event: RenderEvent) => void): () => void;
97
104
  /**
98
105
  * Creates a node without publishing it. StrictMode's double mount renders
@@ -133,6 +140,7 @@ declare class Detective {
133
140
  /** Hot path. Must stay allocation-free and O(1). */
134
141
  recordAttempt(node: NodeRecord, props: Record<string, unknown>): void;
135
142
  recordStateChange(node: NodeRecord, change: TrackedStateChange): void;
143
+ recordSelectorChange(node: NodeRecord, change: SelectorChange): void;
136
144
  /**
137
145
  * Hot path. Called from Profiler#onRender; only enqueues.
138
146
  *
@@ -204,6 +212,8 @@ interface DiagnosisInput {
204
212
  contextChanges: ContextChange[];
205
213
  /** Named state updates from `useTrackedState`. Empty unless opted in. */
206
214
  trackedState: TrackedStateChange[];
215
+ /** External-store selector values that changed. Empty unless selectors are tracked. */
216
+ selectorChanges: SelectorChange[];
207
217
  /** How many times this component has been rebuilt rather than re-rendered. */
208
218
  remounts: number;
209
219
  /** The component looks like it is declared inside another component's render body. */
@@ -250,4 +260,4 @@ declare class RingBuffer<T> {
250
260
  resize(capacity: number): void;
251
261
  }
252
262
 
253
- export { AppStats, ComponentStats, ContextChange, Detective, DetectiveConfig, DetectiveOptions, Diagnosis, type DiagnosisInput, Inspected, InspectionLimits, PropChange, PropValueType, RenderEvent, RenderPhase, RenderReason, RingBuffer, Thresholds, TrackedStateChange, defaultConfig, detectDev, diagnose, diffProps, formatInspected, getDetective, inspect, isPlainObject, isReactElement, matches, mergeConfig, severityFor, shallowEqual, shouldInstrument, valueType };
263
+ export { AppStats, ComponentStats, ContextChange, Detective, DetectiveConfig, DetectiveOptions, Diagnosis, type DiagnosisInput, Inspected, InspectionLimits, PropChange, PropValueType, RenderEvent, RenderPhase, RenderReason, RingBuffer, SelectorChange, Thresholds, TrackedStateChange, defaultConfig, detectDev, diagnose, diffProps, formatInspected, getDetective, inspect, isPlainObject, isReactElement, matches, mergeConfig, severityFor, shallowEqual, shouldInstrument, valueType };
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-DI5STJM4.js';
1
+ export { Detective, RingBuffer, defaultConfig, detectDev, diagnose, diffProps, formatInspected, getDetective, inspect, isPlainObject, isReactElement, matches, mergeConfig, severityFor, shallowEqual, shouldInstrument, valueType } from './chunk-3TZNM7JO.js';
2
2
  //# sourceMappingURL=core.js.map
3
3
  //# sourceMappingURL=core.js.map