@buoy-gg/highlight-updates 2.1.10 → 2.1.11
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/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +285 -1
- package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1371 -1
- package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +591 -1
- package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +267 -1
- package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +178 -1
- package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +303 -1
- package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +500 -1
- package/lib/commonjs/highlight-updates/components/RenderDetailView.js +830 -1
- package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +894 -1
- package/lib/commonjs/highlight-updates/components/RenderListItem.js +220 -1
- package/lib/commonjs/highlight-updates/components/StatsDisplay.js +70 -1
- package/lib/commonjs/highlight-updates/components/index.js +97 -1
- package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1435 -1
- package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +359 -1
- package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +371 -1
- package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +1828 -1
- package/lib/commonjs/highlight-updates/utils/RenderTracker.js +903 -1
- package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +264 -1
- package/lib/commonjs/highlight-updates/utils/renderExportFormatter.js +58 -1
- package/lib/commonjs/index.js +311 -1
- package/lib/commonjs/preset.js +278 -1
- package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +278 -1
- package/lib/module/highlight-updates/components/HighlightFilterView.js +1365 -1
- package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +585 -1
- package/lib/module/highlight-updates/components/IdentifierBadge.js +259 -1
- package/lib/module/highlight-updates/components/IsolatedRenderList.js +174 -1
- package/lib/module/highlight-updates/components/ModalHeaderContent.js +298 -1
- package/lib/module/highlight-updates/components/RenderCauseBadge.js +491 -1
- package/lib/module/highlight-updates/components/RenderDetailView.js +826 -1
- package/lib/module/highlight-updates/components/RenderHistoryViewer.js +888 -1
- package/lib/module/highlight-updates/components/RenderListItem.js +215 -1
- package/lib/module/highlight-updates/components/StatsDisplay.js +67 -1
- package/lib/module/highlight-updates/components/index.js +16 -1
- package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1431 -1
- package/lib/module/highlight-updates/utils/PerformanceLogger.js +353 -1
- package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +358 -1
- package/lib/module/highlight-updates/utils/RenderCauseDetector.js +1818 -1
- package/lib/module/highlight-updates/utils/RenderTracker.js +900 -1
- package/lib/module/highlight-updates/utils/ViewTypeMapper.js +255 -1
- package/lib/module/highlight-updates/utils/renderExportFormatter.js +54 -1
- package/lib/module/index.js +71 -1
- package/lib/module/preset.js +272 -1
- package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/RenderListItem.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/components/index.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts.map +1 -0
- package/lib/typescript/highlight-updates/utils/renderExportFormatter.d.ts.map +1 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/preset.d.ts.map +1 -0
- package/package.json +16 -16
- package/LICENSE +0 -58
|
@@ -1 +1,215 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* RenderListItem
|
|
5
|
+
*
|
|
6
|
+
* Compact list item showing a tracked component render.
|
|
7
|
+
* Displays viewType, identifier (testID/nativeID/component), render count, and timing.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import React, { useMemo } from "react";
|
|
11
|
+
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
12
|
+
import { ChevronRight, buoyColors, useRelativeTime } from "@buoy-gg/shared-ui";
|
|
13
|
+
import { IdentifierBadge } from "./IdentifierBadge";
|
|
14
|
+
import { RenderCauseBadge } from "./RenderCauseBadge";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
function RenderListItemInner({
|
|
17
|
+
render,
|
|
18
|
+
onPress
|
|
19
|
+
}) {
|
|
20
|
+
// Get best identifier to show (primary)
|
|
21
|
+
const identifier = useMemo(() => {
|
|
22
|
+
if (render.testID) return {
|
|
23
|
+
type: "testID",
|
|
24
|
+
value: render.testID
|
|
25
|
+
};
|
|
26
|
+
if (render.nativeID) return {
|
|
27
|
+
type: "nativeID",
|
|
28
|
+
value: render.nativeID
|
|
29
|
+
};
|
|
30
|
+
if (render.componentName) return {
|
|
31
|
+
type: "component",
|
|
32
|
+
value: render.componentName
|
|
33
|
+
};
|
|
34
|
+
if (render.accessibilityLabel) return {
|
|
35
|
+
type: "accessibilityLabel",
|
|
36
|
+
value: render.accessibilityLabel
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
type: "nativeTag",
|
|
40
|
+
value: String(render.nativeTag)
|
|
41
|
+
};
|
|
42
|
+
}, [render.testID, render.nativeID, render.componentName, render.accessibilityLabel, render.nativeTag]);
|
|
43
|
+
|
|
44
|
+
// Get secondary identifier (accessibilityLabel if not already primary)
|
|
45
|
+
const secondaryIdentifier = useMemo(() => {
|
|
46
|
+
if (render.accessibilityLabel && identifier.type !== "accessibilityLabel") {
|
|
47
|
+
return {
|
|
48
|
+
type: "accessibilityLabel",
|
|
49
|
+
value: render.accessibilityLabel
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}, [render.accessibilityLabel, identifier.type]);
|
|
54
|
+
|
|
55
|
+
// Format time since last render (live-updating)
|
|
56
|
+
const timeSinceRender = useRelativeTime(render.lastRenderTime);
|
|
57
|
+
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
58
|
+
style: styles.container,
|
|
59
|
+
onPress: () => onPress(render),
|
|
60
|
+
activeOpacity: 0.7,
|
|
61
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
62
|
+
style: [styles.colorIndicator, {
|
|
63
|
+
backgroundColor: render.color
|
|
64
|
+
}]
|
|
65
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
66
|
+
style: styles.content,
|
|
67
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
68
|
+
style: styles.topRow,
|
|
69
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
70
|
+
style: styles.viewTypeContainer,
|
|
71
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
72
|
+
style: styles.viewType,
|
|
73
|
+
numberOfLines: 1,
|
|
74
|
+
children: render.displayName
|
|
75
|
+
}), secondaryIdentifier ? /*#__PURE__*/_jsx(IdentifierBadge, {
|
|
76
|
+
type: secondaryIdentifier.type,
|
|
77
|
+
value: secondaryIdentifier.value,
|
|
78
|
+
compact: true,
|
|
79
|
+
shortLabel: true
|
|
80
|
+
}) : render.displayName !== render.viewType ? /*#__PURE__*/_jsx(Text, {
|
|
81
|
+
style: styles.nativeType,
|
|
82
|
+
numberOfLines: 1,
|
|
83
|
+
children: render.viewType
|
|
84
|
+
}) : null]
|
|
85
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
86
|
+
style: [styles.renderCountBadge, {
|
|
87
|
+
backgroundColor: render.color + "30"
|
|
88
|
+
}],
|
|
89
|
+
children: /*#__PURE__*/_jsxs(Text, {
|
|
90
|
+
style: [styles.renderCount, {
|
|
91
|
+
color: render.color
|
|
92
|
+
}],
|
|
93
|
+
children: [render.renderCount, "x"]
|
|
94
|
+
})
|
|
95
|
+
})]
|
|
96
|
+
}), render.lastRenderCause && /*#__PURE__*/_jsx(View, {
|
|
97
|
+
style: styles.causeRow,
|
|
98
|
+
children: /*#__PURE__*/_jsx(RenderCauseBadge, {
|
|
99
|
+
cause: render.lastRenderCause,
|
|
100
|
+
compact: true,
|
|
101
|
+
showKeys: true,
|
|
102
|
+
showTwoLevel: true
|
|
103
|
+
})
|
|
104
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
105
|
+
style: styles.bottomRow,
|
|
106
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
107
|
+
style: styles.identifierContainer,
|
|
108
|
+
children: /*#__PURE__*/_jsx(IdentifierBadge, {
|
|
109
|
+
type: identifier.type,
|
|
110
|
+
value: identifier.value,
|
|
111
|
+
compact: true,
|
|
112
|
+
shortLabel: true
|
|
113
|
+
})
|
|
114
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
115
|
+
style: styles.timing,
|
|
116
|
+
children: timeSinceRender
|
|
117
|
+
})]
|
|
118
|
+
})]
|
|
119
|
+
}), /*#__PURE__*/_jsx(ChevronRight, {
|
|
120
|
+
size: 16,
|
|
121
|
+
color: buoyColors.textMuted
|
|
122
|
+
})]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Memoize with custom comparison - only re-render when relevant props change
|
|
127
|
+
// This is critical for performance when the modal is open during rapid renders
|
|
128
|
+
export const RenderListItem = /*#__PURE__*/React.memo(RenderListItemInner, (prevProps, nextProps) => {
|
|
129
|
+
// Return true if props are EQUAL (skip re-render)
|
|
130
|
+
// Return false if props are DIFFERENT (trigger re-render)
|
|
131
|
+
const prevRender = prevProps.render;
|
|
132
|
+
const nextRender = nextProps.render;
|
|
133
|
+
return prevRender.id === nextRender.id && prevRender.renderCount === nextRender.renderCount && prevRender.color === nextRender.color && prevRender.lastRenderTime === nextRender.lastRenderTime && prevRender.lastRenderCause?.type === nextRender.lastRenderCause?.type && prevRender.lastRenderCause?.componentCause === nextRender.lastRenderCause?.componentCause && prevProps.onPress === nextProps.onPress;
|
|
134
|
+
});
|
|
135
|
+
const styles = StyleSheet.create({
|
|
136
|
+
container: {
|
|
137
|
+
flexDirection: "row",
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
paddingVertical: 10,
|
|
140
|
+
paddingHorizontal: 12,
|
|
141
|
+
marginHorizontal: 12,
|
|
142
|
+
marginBottom: 6,
|
|
143
|
+
backgroundColor: buoyColors.card,
|
|
144
|
+
borderRadius: 8,
|
|
145
|
+
borderWidth: 1,
|
|
146
|
+
borderColor: buoyColors.border
|
|
147
|
+
},
|
|
148
|
+
colorIndicator: {
|
|
149
|
+
width: 4,
|
|
150
|
+
height: 36,
|
|
151
|
+
borderRadius: 2,
|
|
152
|
+
marginRight: 10
|
|
153
|
+
},
|
|
154
|
+
content: {
|
|
155
|
+
flex: 1,
|
|
156
|
+
marginRight: 8
|
|
157
|
+
},
|
|
158
|
+
topRow: {
|
|
159
|
+
flexDirection: "row",
|
|
160
|
+
alignItems: "center",
|
|
161
|
+
marginBottom: 4
|
|
162
|
+
},
|
|
163
|
+
causeRow: {
|
|
164
|
+
marginBottom: 4
|
|
165
|
+
},
|
|
166
|
+
viewTypeContainer: {
|
|
167
|
+
flex: 1,
|
|
168
|
+
marginRight: 8
|
|
169
|
+
},
|
|
170
|
+
viewType: {
|
|
171
|
+
fontSize: 13,
|
|
172
|
+
fontWeight: "600",
|
|
173
|
+
color: buoyColors.text
|
|
174
|
+
},
|
|
175
|
+
nativeType: {
|
|
176
|
+
fontSize: 10,
|
|
177
|
+
color: buoyColors.textMuted,
|
|
178
|
+
fontFamily: "monospace",
|
|
179
|
+
marginTop: 1
|
|
180
|
+
},
|
|
181
|
+
accessibilityLabel: {
|
|
182
|
+
fontSize: 10,
|
|
183
|
+
color: buoyColors.primary,
|
|
184
|
+
fontStyle: "italic",
|
|
185
|
+
marginTop: 1
|
|
186
|
+
},
|
|
187
|
+
renderCountBadge: {
|
|
188
|
+
paddingHorizontal: 8,
|
|
189
|
+
paddingVertical: 2,
|
|
190
|
+
borderRadius: 10
|
|
191
|
+
},
|
|
192
|
+
renderCount: {
|
|
193
|
+
fontSize: 11,
|
|
194
|
+
fontWeight: "700",
|
|
195
|
+
fontFamily: "monospace"
|
|
196
|
+
},
|
|
197
|
+
bottomRow: {
|
|
198
|
+
flexDirection: "row",
|
|
199
|
+
alignItems: "center",
|
|
200
|
+
justifyContent: "space-between",
|
|
201
|
+
gap: 8
|
|
202
|
+
},
|
|
203
|
+
identifierContainer: {
|
|
204
|
+
flex: 1,
|
|
205
|
+
flexShrink: 1,
|
|
206
|
+
overflow: "hidden"
|
|
207
|
+
},
|
|
208
|
+
timing: {
|
|
209
|
+
fontSize: 10,
|
|
210
|
+
color: buoyColors.textMuted,
|
|
211
|
+
fontWeight: "500",
|
|
212
|
+
flexShrink: 0
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
export default RenderListItem;
|
|
@@ -1 +1,67 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* StatsDisplay
|
|
5
|
+
*
|
|
6
|
+
* Isolated component for displaying render statistics in the header.
|
|
7
|
+
* Subscribes to RenderTracker updates independently so parent header
|
|
8
|
+
* doesn't re-render when stats change.
|
|
9
|
+
*
|
|
10
|
+
* Following the optimization guide: move subscriptions to child components.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import React, { useState, useEffect, memo } from "react";
|
|
14
|
+
import { View, Text, StyleSheet } from "react-native";
|
|
15
|
+
import { Activity, buoyColors } from "@buoy-gg/shared-ui";
|
|
16
|
+
import { RenderTracker } from "../utils/RenderTracker";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Isolated stats display that owns its own subscription.
|
|
20
|
+
* Only this component re-renders when stats change.
|
|
21
|
+
*/
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
function StatsDisplayInner() {
|
|
24
|
+
const [stats, setStats] = useState({
|
|
25
|
+
totalComponents: 0,
|
|
26
|
+
totalRenders: 0
|
|
27
|
+
});
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const unsubscribe = RenderTracker.subscribe(() => {
|
|
30
|
+
setStats(RenderTracker.getStats());
|
|
31
|
+
});
|
|
32
|
+
return unsubscribe;
|
|
33
|
+
}, []);
|
|
34
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
35
|
+
nativeID: "__rn_buoy__stats-row",
|
|
36
|
+
style: styles.headerChip,
|
|
37
|
+
children: [/*#__PURE__*/_jsx(Activity, {
|
|
38
|
+
size: 12,
|
|
39
|
+
color: buoyColors.primary
|
|
40
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
41
|
+
style: [styles.headerChipValue, {
|
|
42
|
+
color: buoyColors.primary
|
|
43
|
+
}],
|
|
44
|
+
children: stats.totalComponents
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export const StatsDisplay = /*#__PURE__*/memo(StatsDisplayInner);
|
|
49
|
+
const styles = StyleSheet.create({
|
|
50
|
+
headerChip: {
|
|
51
|
+
flexDirection: "row",
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
gap: 4,
|
|
54
|
+
backgroundColor: buoyColors.hover,
|
|
55
|
+
paddingHorizontal: 8,
|
|
56
|
+
paddingVertical: 5,
|
|
57
|
+
borderRadius: 12,
|
|
58
|
+
borderWidth: 1,
|
|
59
|
+
borderColor: buoyColors.border
|
|
60
|
+
},
|
|
61
|
+
headerChipValue: {
|
|
62
|
+
fontSize: 12,
|
|
63
|
+
fontWeight: "600",
|
|
64
|
+
fontFamily: "monospace"
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export default StatsDisplay;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Highlight Updates Modal Components
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { HighlightUpdatesModal } from "./HighlightUpdatesModal";
|
|
8
|
+
export { RenderListItem } from "./RenderListItem";
|
|
9
|
+
export { RenderDetailView } from "./RenderDetailView";
|
|
10
|
+
export { HighlightFilterView } from "./HighlightFilterView";
|
|
11
|
+
export { IdentifierBadge, CategoryBadge, IDENTIFIER_CONFIG } from "./IdentifierBadge";
|
|
12
|
+
|
|
13
|
+
// Performance-optimized isolated components
|
|
14
|
+
export { IsolatedRenderList } from "./IsolatedRenderList";
|
|
15
|
+
export { StatsDisplay } from "./StatsDisplay";
|
|
16
|
+
export { MainListHeader, FilterViewHeader, DetailViewHeader, HeaderActions, SearchSection } from "./ModalHeaderContent";
|