@buoy-gg/js-top 7.0.36 → 7.0.38
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/README.md +34 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
JS Top ranks measured callback time. For example, a task table might look like this (illustrative values):
|
|
14
14
|
|
|
15
15
|
```
|
|
16
16
|
# TASK ORIGIN 5S MS %BUSY CALLS AVG MAX
|
|
@@ -21,17 +21,35 @@ Every React Native developer has watched JS FPS tank and asked: **what is using
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
- **Pure JavaScript.** No native module, no debugger, no dev client — works in **Expo Go** and even release builds.
|
|
24
|
-
- **
|
|
25
|
-
- **Honest accounting.** Exclusive-time bookkeeping (nested callbacks never double-count), a calibrated
|
|
24
|
+
- **Capture lifecycle.** The engine only runs while the tool is open (or a Buoy Desktop dashboard is watching).
|
|
25
|
+
- **Honest accounting.** Exclusive-time bookkeeping (nested callbacks never double-count), a calibrated probe that estimates thread occupancy, and an explicit *unattributed* row for work no JS wrapper can see.
|
|
26
26
|
- **Blocking-task attribution.** Every 50ms+ freeze (via React Native's `longtask` observer) is matched to the callback that overlapped it.
|
|
27
27
|
|
|
28
28
|
## Install
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npm install @buoy-gg/js-top
|
|
31
|
+
npm install @buoy-gg/core @buoy-gg/js-top
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
## Before you start
|
|
35
|
+
|
|
36
|
+
Use a development build with `@buoy-gg/core` and a Free or Pro Buoy account key. From your app’s directory, sign in:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx --package=@buoy-gg/core buoy login
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
For Expo, initialize Buoy before rendering the menu:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { Buoy } from "@buoy-gg/core";
|
|
46
|
+
|
|
47
|
+
Buoy.init({ licenseKey: process.env.EXPO_PUBLIC_BUOY_KEY });
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The login command writes the Expo key to `.env.local`. For React Native CLI, pass the key from your app’s environment configuration; React Native does not load `.env.local` automatically. Mount `FloatingDevTools` inside the same providers as your screens and restart the development server after installation. The [Quick Start](https://buoy.gg/buoy/latest/docs/quick-start) shows the complete root component setup.
|
|
51
|
+
|
|
52
|
+
After setup, open JS Top, run a known timer-driven interaction, and inspect the task table. Explicit registration:
|
|
35
53
|
|
|
36
54
|
```tsx
|
|
37
55
|
import { FloatingDevTools } from "@buoy-gg/core";
|
|
@@ -42,15 +60,23 @@ import { jsTopPreset, jsTopModalPreset } from "@buoy-gg/js-top";
|
|
|
42
60
|
|
|
43
61
|
## How it works
|
|
44
62
|
|
|
45
|
-
You can't sample a blocked JS thread from JS — so JS Top doesn't sample. It wraps
|
|
63
|
+
You can't sample a blocked JS thread from JS — so JS Top doesn't sample. It wraps supported scheduling entry points (`setTimeout` / `setInterval` / `setImmediate` / `requestAnimationFrame` / `queueMicrotask` / Promise reactions / legacy-bridge call-ins) and deterministically times each callback, attributing cost to **where the callback was scheduled from** — with lazy stack capture so hot origins get named `setInterval ← startPolling` while limiting stack-capture work.
|
|
64
|
+
|
|
65
|
+
On the New Architecture, touch/React-commit work enters through paths pure JS can't wrap; that time shows as *unattributed* (the in-tool banner explains). Work outside wrapped paths, including some async/await continuations and native entry points, can remain unattributed.
|
|
46
66
|
|
|
47
|
-
|
|
67
|
+
## Desktop & AI
|
|
48
68
|
|
|
49
|
-
|
|
69
|
+
To connect a React Native app to [Buoy Desktop](https://github.com/Buoy-gg/Buoy-Desktop) or MCP, install `@buoy-gg/external-sync` and follow the [Desktop connection guide](https://buoy.gg/buoy/latest/docs/desktop). Sign in to Desktop separately. [MCP setup](https://buoy.gg/buoy/latest/docs/mcp) also requires a process account and Pro access. Available remote actions depend on the tool and app integration.
|
|
70
|
+
|
|
71
|
+
## Remote capabilities
|
|
50
72
|
|
|
51
73
|
- The desktop dashboard mirrors the device's task table live, and adds a dev-only **per-function Hermes sampler** (attaches to Metro's inspector).
|
|
52
74
|
- Via the Buoy MCP server, your AI agent can call `get_js_thread_top` — "why is JS FPS low?" becomes one tool call.
|
|
53
75
|
|
|
76
|
+
## Account and plan requirements
|
|
77
|
+
|
|
78
|
+
Use a Free or Pro Buoy account. History limits and paid features vary by tool; see [pricing](https://buoy.gg/pricing). Production access requires Pro where supported. Development-only hooks and actions remain unavailable in release builds.
|
|
79
|
+
|
|
54
80
|
## License
|
|
55
81
|
|
|
56
82
|
Part of [React Buoy](https://buoy.gg). See buoy.gg for licensing.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/js-top",
|
|
3
|
-
"version": "7.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.0.38",
|
|
4
|
+
"description": "Inspect instrumented JavaScript timers, promises and callbacks to investigate work on the React Native JS thread.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"sideEffects": false,
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
15
|
+
"@buoy-gg/shared-ui": "^7.0.38"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": "*",
|