@buoy-gg/highlight-updates 6.0.0 → 6.0.1

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 (2) hide show
  1. package/README.md +29 -178
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -1,210 +1,61 @@
1
- # @buoy/highlight-updates
1
+ # @buoy-gg/highlight-updates
2
2
 
3
- Control React DevTools' "Highlight updates when components render" feature directly from your React Native app.
3
+ [![npm version](https://img.shields.io/npm/v/@buoy-gg/highlight-updates?style=flat-square&labelColor=1c1c1c&color=10B981)](https://www.npmjs.com/package/@buoy-gg/highlight-updates) [![npm downloads](https://img.shields.io/npm/dm/@buoy-gg/highlight-updates?style=flat-square&labelColor=1c1c1c&color=10B981)](https://www.npmjs.com/package/@buoy-gg/highlight-updates)
4
4
 
5
- ## Overview
5
+ **See exactly WHY your React Native components re-render — every render gets an overlay tagged with its cause: mount, state, props, or parent.**
6
6
 
7
- This tool intercepts the React DevTools agent's `drawTraceUpdates` event to provide programmatic control over component render highlighting. When DevTools has "Highlight updates when components render" enabled, this tool lets you toggle the highlighting on/off without navigating to DevTools settings.
7
+ Part of [Buoy](https://github.com/Buoy-gg/buoy) devtools that live inside your React Native app. Install it and it auto-appears in the floating menu from [`@buoy-gg/core`](https://www.npmjs.com/package/@buoy-gg/core).
8
8
 
9
- ## Installation
9
+ ## Install
10
10
 
11
11
  ```bash
12
- npm install @buoy/highlight-updates
13
- # or
14
- yarn add @buoy/highlight-updates
15
- # or
16
- pnpm add @buoy/highlight-updates
12
+ npm install @buoy-gg/core @buoy-gg/highlight-updates
17
13
  ```
18
14
 
19
- ## Usage
20
-
21
- ### With FloatingDevTools (Recommended)
22
-
23
- The easiest way to use this tool is with the FloatingDevTools menu:
24
-
25
- ```tsx
26
- import { FloatingDevTools, autoDiscoverPresets } from '@buoy/core';
27
-
28
- // The highlight updates tool is automatically discovered if installed
29
- const apps = autoDiscoverPresets();
30
-
31
- function App() {
32
- return (
33
- <FloatingDevTools apps={apps}>
34
- <YourApp />
35
- </FloatingDevTools>
36
- );
37
- }
38
- ```
39
-
40
- Or explicitly add the preset:
15
+ ## Quick start
41
16
 
42
17
  ```tsx
43
- import { FloatingDevTools } from '@buoy/core';
44
- import { highlightUpdatesPreset } from '@buoy/highlight-updates';
18
+ import { FloatingDevTools } from "@buoy-gg/core";
45
19
 
46
- function App() {
20
+ export default function App() {
47
21
  return (
48
- <FloatingDevTools apps={[highlightUpdatesPreset]}>
22
+ <>
49
23
  <YourApp />
50
- </FloatingDevTools>
24
+ <FloatingDevTools />
25
+ </>
51
26
  );
52
27
  }
53
28
  ```
54
29
 
55
- ### Standalone Controller
30
+ That's it — the Render Highlighter appears in the floating menu. It's a standalone implementation: no React DevTools connection, no Chrome tab, no Flipper required.
56
31
 
57
- You can also use the controller directly without the FloatingDevTools menu:
32
+ Prefer to drive it yourself?
58
33
 
59
34
  ```tsx
60
- import { HighlightUpdatesController } from '@buoy/highlight-updates';
61
-
62
- // Initialize when DevTools is connected
63
- HighlightUpdatesController.initialize();
35
+ import { HighlightUpdatesController } from "@buoy-gg/highlight-updates";
64
36
 
65
- // Toggle highlights
66
37
  HighlightUpdatesController.toggle();
67
-
68
- // Enable/disable directly
69
- HighlightUpdatesController.enable();
70
- HighlightUpdatesController.disable();
71
-
72
- // Check state
73
- const isEnabled = HighlightUpdatesController.isEnabled();
74
-
75
- // Subscribe to state changes
76
- const unsubscribe = HighlightUpdatesController.subscribe((enabled) => {
77
- console.log('Highlights enabled:', enabled);
78
- });
79
-
80
- // Cleanup when done
81
- HighlightUpdatesController.destroy();
82
38
  ```
83
39
 
84
- ### Custom Configuration
85
-
86
- Create a customized version of the tool:
87
-
88
- ```tsx
89
- import { createHighlightUpdatesTool } from '@buoy/highlight-updates';
90
-
91
- const myHighlightTool = createHighlightUpdatesTool({
92
- name: 'RENDERS',
93
- enabledColor: '#ec4899', // Pink when enabled
94
- disabledColor: '#9ca3af', // Gray when disabled
95
- autoInitialize: true, // Initialize automatically
96
- });
97
- ```
40
+ ## What you get
98
41
 
99
- ## Requirements
42
+ - **Render overlays with the cause** — every render flashes a bounding box tagged mount / state change / prop change / parent re-render. No more guessing why a component updated.
43
+ - **Hook value tracking** — when state caused the render, see the before → after values of the exact `useState` or `useReducer` that changed.
44
+ - **Overlay mode** — lightweight real-time highlights while you interact with the app; perfect for spotting unnecessary re-renders.
45
+ - **Modal mode** — full inspector with render history, filtering, and detailed per-render cause breakdowns for deep debugging sessions.
46
+ - **Powers Bench's render capture** — with [`@buoy-gg/perf-monitor`](https://www.npmjs.com/package/@buoy-gg/perf-monitor) installed, benchmark recordings capture per-component render counts and durations.
47
+ - **Filters out the framework noise** — you see your components, not `View`/`Text` internals.
100
48
 
101
- For this tool to work:
49
+ ## Desktop & AI
102
50
 
103
- 1. **React DevTools must be connected** (Chrome DevTools or Flipper)
104
- 2. **"Highlight updates when components render" must be enabled** in DevTools Profiler settings
105
-
106
- This tool then allows you to temporarily disable the highlighting without going back to DevTools settings.
107
-
108
- ## How It Works
109
-
110
- The tool intercepts the DevTools agent's `drawTraceUpdates` event listener. When disabled, it simply doesn't forward the event to the original handler, effectively blocking the highlight rendering.
111
-
112
- ```
113
- React DevTools Frontend (Chrome/Flipper)
114
- | (sends drawTraceUpdates event)
115
- v
116
- React DevTools Agent
117
- | (event intercepted by HighlightUpdatesController)
118
- v
119
- HighlightUpdatesController.controlledListener
120
- | (if enabled, forwards to original)
121
- v
122
- DebuggingOverlayRegistry (original listener)
123
- | (processes component bounds)
124
- v
125
- DebuggingOverlay (native component)
126
- | (renders highlights on screen)
127
- ```
51
+ The same live session streams to [Buoy Desktop](https://github.com/Buoy-gg/Buoy-Desktop) (free, macOS/Windows/Linux) and to Claude Code or Cursor via the [Buoy MCP server](https://buoy.gg/buoy/latest/docs/mcp).
128
52
 
129
- ## API Reference
53
+ ## Free vs Pro
130
54
 
131
- ### `highlightUpdatesPreset`
55
+ Every tool is free. [Pro](https://buoy.gg/pricing) unlocks production builds, the MCP server, and unlimited capture. Every weekend, Pro features unlock free for everyone.
132
56
 
133
- Pre-configured preset for use with FloatingDevTools.
134
-
135
- ### `createHighlightUpdatesTool(options?)`
136
-
137
- Factory function to create a customized tool.
138
-
139
- | Option | Type | Default | Description |
140
- |--------|------|---------|-------------|
141
- | `name` | `string` | `"UPDATES"` | Display name in the menu |
142
- | `description` | `string` | `"Toggle component render highlights"` | Tool description |
143
- | `enabledColor` | `string` | `"#10b981"` | Icon color when enabled (green) |
144
- | `disabledColor` | `string` | `"#6b7280"` | Icon color when disabled (gray) |
145
- | `id` | `string` | `"highlight-updates"` | Unique tool identifier |
146
- | `autoInitialize` | `boolean` | `false` | Initialize automatically on load |
147
-
148
- ### `HighlightUpdatesController`
149
-
150
- Standalone controller for programmatic use.
151
-
152
- | Method | Description |
153
- |--------|-------------|
154
- | `initialize()` | Initialize the controller. Returns `true` on success. |
155
- | `enable()` | Enable highlight rendering |
156
- | `disable()` | Disable highlight rendering |
157
- | `toggle()` | Toggle the enabled state |
158
- | `isEnabled()` | Get current enabled state |
159
- | `setEnabled(enabled)` | Set enabled state |
160
- | `isInitialized()` | Check if controller is initialized |
161
- | `subscribe(callback)` | Subscribe to state changes. Returns unsubscribe function. |
162
- | `destroy()` | Cleanup and restore original listener |
163
-
164
- ## Console Access
165
-
166
- When in development mode, the controller is exposed globally:
167
-
168
- ```javascript
169
- // In Chrome DevTools console
170
- window.__HIGHLIGHT_UPDATES_CONTROLLER__.toggle();
171
- window.__HIGHLIGHT_UPDATES_CONTROLLER__.isEnabled();
172
- ```
173
-
174
- ## Troubleshooting
175
-
176
- ### Controller Not Initializing
177
-
178
- **Problem:** `initialize()` returns false
179
-
180
- **Solutions:**
181
- 1. Check DevTools is connected: `window.__REACT_DEVTOOLS_GLOBAL_HOOK__.reactDevtoolsAgent`
182
- 2. Add initialization delay: Wait 1-2 seconds after app launch
183
- 3. Ensure "Highlight updates" is enabled in DevTools first
184
-
185
- ### Highlights Still Showing After Disable
186
-
187
- **Problem:** Highlights appear even when disabled
188
-
189
- **Solutions:**
190
- 1. Verify controller is initialized: `HighlightUpdatesController.isInitialized()`
191
- 2. Check enabled state: `HighlightUpdatesController.isEnabled()`
192
- 3. Ensure listener was properly intercepted (check console logs)
193
-
194
- ## Development
195
-
196
- ### Building
197
-
198
- ```bash
199
- pnpm build
200
- ```
201
-
202
- ### Type Checking
203
-
204
- ```bash
205
- pnpm typecheck
206
- ```
57
+ ---
207
58
 
208
- ## License
59
+ 📚 [Full docs](https://buoy.gg/buoy/latest/docs/tools/highlight-updates) · [All Buoy tools](https://github.com/Buoy-gg/buoy)
209
60
 
210
- MIT
61
+ Proprietary software. © Buoy LLC. [Terms](https://buoy.gg/terms)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@buoy-gg/highlight-updates",
3
- "version": "6.0.0",
4
- "description": "Control React DevTools highlight updates feature from your app",
3
+ "version": "6.0.1",
4
+ "description": "Render highlighter for React Native see every render with its cause: mount, state, props, or parent. Part of Buoy devtools.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
7
7
  "types": "lib/typescript/index.d.ts",
@@ -26,14 +26,14 @@
26
26
  ],
27
27
  "sideEffects": false,
28
28
  "dependencies": {
29
- "@buoy-gg/shared-ui": "6.0.0",
30
- "@buoy-gg/floating-tools-core": "6.0.0"
29
+ "@buoy-gg/shared-ui": "6.0.1",
30
+ "@buoy-gg/floating-tools-core": "6.0.1"
31
31
  },
32
32
  "peerDependencies": {
33
- "@buoy-gg/license": "6.0.0",
33
+ "@buoy-gg/license": "6.0.1",
34
34
  "react": "*",
35
35
  "react-native": "*",
36
- "@buoy-gg/core": "6.0.0"
36
+ "@buoy-gg/core": "6.0.1"
37
37
  },
38
38
  "peerDependenciesMeta": {
39
39
  "@buoy-gg/core": {
@@ -44,8 +44,8 @@
44
44
  "@types/react": "^19.1.0",
45
45
  "@types/react-native": "^0.73.0",
46
46
  "typescript": "~5.8.3",
47
- "@buoy-gg/license": "6.0.0",
48
- "@buoy-gg/core": "6.0.0"
47
+ "@buoy-gg/license": "6.0.1",
48
+ "@buoy-gg/core": "6.0.1"
49
49
  },
50
50
  "react-native-builder-bob": {
51
51
  "source": "src",