@buoy-gg/highlight-updates 7.0.41 → 7.0.43

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 (108) hide show
  1. package/README.md +11 -71
  2. package/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +1 -281
  3. package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1 -1474
  4. package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +1 -641
  5. package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +1 -273
  6. package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +1 -188
  7. package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +1 -293
  8. package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +1 -508
  9. package/lib/commonjs/highlight-updates/components/RenderDetailView.js +1 -846
  10. package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +1 -915
  11. package/lib/commonjs/highlight-updates/components/RenderListItem.js +1 -235
  12. package/lib/commonjs/highlight-updates/components/RendersCopySettingsView.js +1 -469
  13. package/lib/commonjs/highlight-updates/components/StatsDisplay.js +1 -73
  14. package/lib/commonjs/highlight-updates/types/copySettings.js +1 -107
  15. package/lib/commonjs/highlight-updates/utils/CommitProfiler.js +1 -455
  16. package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1 -1929
  17. package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +26 -359
  18. package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +1 -371
  19. package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +5 -1840
  20. package/lib/commonjs/highlight-updates/utils/RenderTracker.js +1 -952
  21. package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +1 -264
  22. package/lib/commonjs/highlight-updates/utils/copySettingsStorage.js +1 -32
  23. package/lib/commonjs/highlight-updates/utils/devtoolsComponentNames.js +1 -188
  24. package/lib/commonjs/highlight-updates/utils/namedComposite.js +1 -41
  25. package/lib/commonjs/highlight-updates/utils/ownStateChanged.js +1 -103
  26. package/lib/commonjs/highlight-updates/utils/rawEventEmitter.js +1 -50
  27. package/lib/commonjs/highlight-updates/utils/rawEventEmitter.web.js +1 -12
  28. package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +1 -58
  29. package/lib/commonjs/highlight-updates/utils/rendersExportFormatter.js +1 -485
  30. package/lib/commonjs/highlight-updates/utils/screenElements.js +1 -1269
  31. package/lib/commonjs/highlight-updates/utils/tapMatch.js +1 -83
  32. package/lib/commonjs/highlight-updates/utils/testIDs.js +1 -68
  33. package/lib/commonjs/highlight-updates/utils/touchCapture.js +1 -277
  34. package/lib/commonjs/index.js +1 -429
  35. package/lib/commonjs/preset.js +1 -278
  36. package/lib/commonjs/sync/highlightUpdatesSyncAdapter.js +1 -235
  37. package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +1 -274
  38. package/lib/module/highlight-updates/components/HighlightFilterView.js +1 -1468
  39. package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +1 -634
  40. package/lib/module/highlight-updates/components/IdentifierBadge.js +1 -265
  41. package/lib/module/highlight-updates/components/IsolatedRenderList.js +1 -183
  42. package/lib/module/highlight-updates/components/ModalHeaderContent.js +1 -288
  43. package/lib/module/highlight-updates/components/RenderCauseBadge.js +1 -499
  44. package/lib/module/highlight-updates/components/RenderDetailView.js +1 -840
  45. package/lib/module/highlight-updates/components/RenderHistoryViewer.js +1 -908
  46. package/lib/module/highlight-updates/components/RenderListItem.js +1 -230
  47. package/lib/module/highlight-updates/components/RendersCopySettingsView.js +1 -465
  48. package/lib/module/highlight-updates/components/StatsDisplay.js +1 -70
  49. package/lib/module/highlight-updates/types/copySettings.js +1 -102
  50. package/lib/module/highlight-updates/utils/CommitProfiler.js +1 -451
  51. package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1 -1925
  52. package/lib/module/highlight-updates/utils/PerformanceLogger.js +26 -353
  53. package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +1 -358
  54. package/lib/module/highlight-updates/utils/RenderCauseDetector.js +5 -1830
  55. package/lib/module/highlight-updates/utils/RenderTracker.js +1 -949
  56. package/lib/module/highlight-updates/utils/ViewTypeMapper.js +1 -255
  57. package/lib/module/highlight-updates/utils/copySettingsStorage.js +1 -26
  58. package/lib/module/highlight-updates/utils/devtoolsComponentNames.js +1 -178
  59. package/lib/module/highlight-updates/utils/namedComposite.js +1 -36
  60. package/lib/module/highlight-updates/utils/ownStateChanged.js +1 -98
  61. package/lib/module/highlight-updates/utils/rawEventEmitter.js +1 -46
  62. package/lib/module/highlight-updates/utils/rawEventEmitter.web.js +1 -3
  63. package/lib/module/highlight-updates/utils/renderExportFormatter.js +1 -54
  64. package/lib/module/highlight-updates/utils/rendersExportFormatter.js +1 -478
  65. package/lib/module/highlight-updates/utils/screenElements.js +1 -1263
  66. package/lib/module/highlight-updates/utils/tapMatch.js +1 -76
  67. package/lib/module/highlight-updates/utils/testIDs.js +1 -60
  68. package/lib/module/highlight-updates/utils/touchCapture.js +1 -270
  69. package/lib/module/index.js +1 -130
  70. package/lib/module/preset.js +1 -272
  71. package/lib/module/sync/highlightUpdatesSyncAdapter.js +1 -230
  72. package/lib/web/index.mjs +28 -29
  73. package/package.json +7 -11
  74. package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +0 -1
  75. package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +0 -1
  76. package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +0 -1
  77. package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +0 -1
  78. package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +0 -1
  79. package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +0 -1
  80. package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +0 -1
  81. package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +0 -1
  82. package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +0 -1
  83. package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +0 -1
  84. package/lib/typescript/highlight-updates/components/RendersCopySettingsView.d.ts.map +0 -1
  85. package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +0 -1
  86. package/lib/typescript/highlight-updates/types/copySettings.d.ts.map +0 -1
  87. package/lib/typescript/highlight-updates/utils/CommitProfiler.d.ts.map +0 -1
  88. package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +0 -1
  89. package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +0 -1
  90. package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +0 -1
  91. package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +0 -1
  92. package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +0 -1
  93. package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +0 -1
  94. package/lib/typescript/highlight-updates/utils/copySettingsStorage.d.ts.map +0 -1
  95. package/lib/typescript/highlight-updates/utils/devtoolsComponentNames.d.ts.map +0 -1
  96. package/lib/typescript/highlight-updates/utils/namedComposite.d.ts.map +0 -1
  97. package/lib/typescript/highlight-updates/utils/ownStateChanged.d.ts.map +0 -1
  98. package/lib/typescript/highlight-updates/utils/rawEventEmitter.d.ts.map +0 -1
  99. package/lib/typescript/highlight-updates/utils/rawEventEmitter.web.d.ts.map +0 -1
  100. package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +0 -1
  101. package/lib/typescript/highlight-updates/utils/rendersExportFormatter.d.ts.map +0 -1
  102. package/lib/typescript/highlight-updates/utils/screenElements.d.ts.map +0 -1
  103. package/lib/typescript/highlight-updates/utils/tapMatch.d.ts.map +0 -1
  104. package/lib/typescript/highlight-updates/utils/testIDs.d.ts.map +0 -1
  105. package/lib/typescript/highlight-updates/utils/touchCapture.d.ts.map +0 -1
  106. package/lib/typescript/index.d.ts.map +0 -1
  107. package/lib/typescript/preset.d.ts.map +0 -1
  108. package/lib/typescript/sync/highlightUpdatesSyncAdapter.d.ts.map +0 -1
@@ -1,103 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.hookStateChanged = hookStateChanged;
7
- exports.ownStateChanged = ownStateChanged;
8
- /**
9
- * "Did this component's own state actually change?" — one implementation.
10
- *
11
- * This package classifies render causes twice, on purpose. `RenderCauseDetector`
12
- * serves the overlay and rides React DevTools' `traceUpdates`, which hands it
13
- * fibers at an ambiguous moment — hence its WeakMap fallbacks and fiber-swap
14
- * detection. `CommitProfiler` serves Bench's render capture from inside
15
- * `onCommitFiberRoot`, where `fiber` is current and `fiber.alternate` is
16
- * previous by definition, and where it runs on every composite fiber of every
17
- * commit and so counts allocations. Those are genuinely different problems and
18
- * the two classifiers should stay separate.
19
- *
20
- * This ONE question is not different between them, and it is the question they
21
- * both got wrong:
22
- *
23
- * `prev.memoizedState !== next.memoizedState`
24
- *
25
- * For a function component `memoizedState` is the head of the hook linked list,
26
- * and React rebuilds that list on every update — `updateWorkInProgressHook`
27
- * clones each node — so the head is a fresh object whether or not a single
28
- * hook's value moved. Read as "state changed" it makes "state"/"hooks" the
29
- * answer for every component that uses ANY hook (a lone `useEffect` is enough)
30
- * and leaves "parent" reachable only by the vanishingly rare component that
31
- * uses none.
32
- *
33
- * That is the one distinction in either tool a developer acts on: "parent"
34
- * means memoize it or lift the state, "state" means it genuinely updated and
35
- * should be left alone. Backwards, it sends you to optimise the thing that was
36
- * already fine — and in Bench it also silently shrank `wastedRenders`, the
37
- * number that says whether there is anything to fix at all.
38
- *
39
- * Both tools reached that wrong line independently, which is exactly why the
40
- * answer lives here now rather than in two places that happen to agree.
41
- */
42
-
43
- /** React work tag for a class component — its `memoizedState` IS the state. */
44
- const CLASS_COMPONENT = 1;
45
-
46
- /** Guardrail on the hook-list walk; deep hook lists are pathological. */
47
- const MAX_HOOKS_WALKED = 64;
48
-
49
- /** Does this look like React's hook linked list rather than class state? */
50
- function isHookList(head) {
51
- return !!head && typeof head === "object" && ("next" in head || "queue" in head || "memoizedState" in head);
52
- }
53
-
54
- /**
55
- * True when a STATE hook's value actually moved between two hook-list heads.
56
- *
57
- * `queue` is the marker: `useState` and `useReducer` — and everything built on
58
- * them — own one; effects, memos, callbacks and refs do not. An effect's
59
- * `memoizedState` is a brand-new object on every single render, which is the
60
- * specific thing that broke the identity check.
61
- *
62
- * Note that a `useRef` mutation is deliberately NOT a state change here. It
63
- * cannot cause a render, so a render attributed to one is a render blamed on
64
- * something that did not do it.
65
- *
66
- * Conservative where it cannot tell: a class component, or a `memoizedState`
67
- * that is not a recognisable hook list, falls back to the identity comparison.
68
- * There the identity IS meaningful (or is the best signal available), so the
69
- * old behaviour is the right behaviour.
70
- *
71
- * Takes the HEADS rather than the fibers because only one of the two callers
72
- * has a previous fiber to hand — the overlay may be working from a WeakMap
73
- * snapshot of the previous `memoizedState` instead. Use `ownStateChanged` when
74
- * you do have both fibers.
75
- */
76
- function hookStateChanged(prevHead, nextHead, options) {
77
- if (prevHead === nextHead) return false;
78
- if (options?.isClassComponent) return true;
79
- if (!isHookList(nextHead)) return true;
80
- let p = prevHead;
81
- let n = nextHead;
82
- for (let depth = 0; n != null && depth < MAX_HOOKS_WALKED; depth++) {
83
- if (n.queue != null) {
84
- // A hook the previous render did not have is a real change.
85
- if (p == null) return true;
86
- if (!Object.is(p.memoizedState, n.memoizedState)) return true;
87
- }
88
- n = n.next;
89
- p = p != null ? p.next : null;
90
- }
91
- return false;
92
- }
93
-
94
- /**
95
- * `hookStateChanged` for callers holding both fibers — the common case inside
96
- * `onCommitFiberRoot`, where `fiber.alternate` is the previous fiber by
97
- * definition.
98
- */
99
- function ownStateChanged(prev, next) {
100
- return hookStateChanged(prev?.memoizedState, next?.memoizedState, {
101
- isClassComponent: next?.tag === CLASS_COMPONENT
102
- });
103
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.hookStateChanged=hookStateChanged;exports.ownStateChanged=ownStateChanged;const CLASS_COMPONENT=1;const MAX_HOOKS_WALKED=64;function isHookList(e){return!!e&&typeof e==="object"&&("next"in e||"queue"in e||"memoizedState"in e)}function hookStateChanged(e,t,r){if(e===t)return false;if(r?.isClassComponent)return true;if(!isHookList(t))return true;let n=e;let o=t;for(let u=0;o!=null&&u<MAX_HOOKS_WALKED;u++){if(o.queue!=null){if(n==null)return true;if(!Object.is(n.memoizedState,o.memoizedState))return true}o=o.next;n=n!=null?n.next:null}return false}function ownStateChanged(e,t){return hookStateChanged(e?.memoizedState,t?.memoizedState,{isClassComponent:t?.tag===CLASS_COMPONENT})}
@@ -1,50 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.resolveRawEventEmitter = resolveRawEventEmitter;
7
- /**
8
- * The one guarded require for React Native's RawEventEmitter.
9
- *
10
- * `RawEventEmitter` mirrors every event React Native dispatches BEFORE React's
11
- * plugins or components see it, which makes it the only way to observe what a
12
- * HUMAN is touching without instrumenting the app: Buoy mounts as a sibling of
13
- * the app tree, not a parent, so there is no root View to put a capture
14
- * responder on.
15
- *
16
- * Two things this file is careful about, both learned the hard way in
17
- * focus-inspector's copy:
18
- *
19
- * 1. It is a DEEP import that RN's export map warns about and could move in any
20
- * release. The failure has to degrade to "capture unavailable" rather than
21
- * taking the host app's bundle down — and Metro only treats a require as
22
- * optional when it sits LEXICALLY inside a try statement, so wrapping it in
23
- * a helper or an arrow makes Metro hard-fail the bundle instead.
24
- * 2. Keeping it in its own module gives the unit suite a seam: Node's `require`
25
- * ignores Vitest's module mocks, so the emitter can only be faked by mocking
26
- * a module reached with a real `import`.
27
- */
28
-
29
- function resolveRawEventEmitter() {
30
- let mod;
31
- try {
32
- mod = require("react-native/Libraries/Core/RawEventEmitter");
33
- } catch (e) {
34
- return {
35
- emitter: null,
36
- reason: e?.message ?? "RawEventEmitter is unavailable"
37
- };
38
- }
39
- const candidate = mod?.default ?? mod;
40
- if (typeof candidate?.addListener !== "function") {
41
- return {
42
- emitter: null,
43
- reason: "RawEventEmitter has no addListener"
44
- };
45
- }
46
- return {
47
- emitter: candidate,
48
- reason: null
49
- };
50
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveRawEventEmitter=resolveRawEventEmitter;function resolveRawEventEmitter(){let e;try{e=require("react-native/Libraries/Core/RawEventEmitter")}catch(r){return{emitter:null,reason:r?.message??"RawEventEmitter is unavailable"}}const t=e?.default??e;if(typeof t?.addListener!=="function"){return{emitter:null,reason:"RawEventEmitter has no addListener"}}return{emitter:t,reason:null}}
@@ -1,12 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "resolveRawEventEmitter", {
7
- enumerable: true,
8
- get: function () {
9
- return _utils.resolveDOMEventEmitter;
10
- }
11
- });
12
- var _utils = require("@buoy-gg/shared-ui/utils");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"resolveRawEventEmitter",{enumerable:true,get:function(){return _utils.resolveDOMEventEmitter}});var _utils=require("@buoy-gg/shared-ui/utils");
@@ -1,58 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.generateRendersJson = generateRendersJson;
7
- /**
8
- * Render Export Formatter
9
- *
10
- * Simple JSON export for render tracking data.
11
- */
12
-
13
- /**
14
- * Generate JSON export of all tracked renders
15
- */
16
- function generateRendersJson(renders) {
17
- const exportData = {
18
- exportedAt: new Date().toISOString(),
19
- totalComponents: renders.length,
20
- totalRenders: renders.reduce((sum, r) => sum + r.renderCount, 0),
21
- components: renders.map(render => ({
22
- // Identity
23
- componentName: render.componentName || render.displayName,
24
- viewType: render.viewType,
25
- nativeTag: render.nativeTag,
26
- // Identifiers
27
- testID: render.testID,
28
- nativeID: render.nativeID,
29
- accessibilityLabel: render.accessibilityLabel,
30
- // Render stats
31
- renderCount: render.renderCount,
32
- firstRenderTime: render.firstRenderTime,
33
- lastRenderTime: render.lastRenderTime,
34
- // Last render cause
35
- lastRenderCause: render.lastRenderCause ? {
36
- type: render.lastRenderCause.type,
37
- componentCause: render.lastRenderCause.componentCause,
38
- changedKeys: render.lastRenderCause.changedKeys,
39
- hookChanges: render.lastRenderCause.hookChanges?.map(h => ({
40
- type: h.type,
41
- index: h.index,
42
- description: h.description
43
- }))
44
- } : null,
45
- // Render history (if available)
46
- renderHistory: render.renderHistory?.map(event => ({
47
- renderNumber: event.renderNumber,
48
- timestamp: event.timestamp,
49
- cause: {
50
- type: event.cause.type,
51
- componentCause: event.cause.componentCause,
52
- changedKeys: event.cause.changedKeys
53
- }
54
- }))
55
- }))
56
- };
57
- return JSON.stringify(exportData, null, 2);
58
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.generateRendersJson=generateRendersJson;function generateRendersJson(a){const s={exportedAt:new Date().toISOString(),totalComponents:a.length,totalRenders:a.reduce((e,t)=>e+t.renderCount,0),components:a.map(e=>({componentName:e.componentName||e.displayName,viewType:e.viewType,nativeTag:e.nativeTag,testID:e.testID,nativeID:e.nativeID,accessibilityLabel:e.accessibilityLabel,renderCount:e.renderCount,firstRenderTime:e.firstRenderTime,lastRenderTime:e.lastRenderTime,lastRenderCause:e.lastRenderCause?{type:e.lastRenderCause.type,componentCause:e.lastRenderCause.componentCause,changedKeys:e.lastRenderCause.changedKeys,hookChanges:e.lastRenderCause.hookChanges?.map(t=>({type:t.type,index:t.index,description:t.description}))}:null,renderHistory:e.renderHistory?.map(t=>({renderNumber:t.renderNumber,timestamp:t.timestamp,cause:{type:t.cause.type,componentCause:t.cause.componentCause,changedKeys:t.cause.changedKeys}}))}))};return JSON.stringify(s,null,2)}