@octanejs/devtools 0.0.49 → 0.0.51
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/package.json +4 -4
- package/src/panel/ComponentsTab.tsrx +76 -71
- package/src/panel/OctanePanel.tsrx +24 -20
- package/src/panel/PerfModelTab.tsrx +46 -44
- package/src/panel/ProfilerTab.tsrx +40 -42
- package/src/panel/TransitionsTab.tsrx +18 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/devtools",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"@tanstack/devtools-event-client": "0.5.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"octane": "^0.
|
|
45
|
+
"octane": "^0.12.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@octanejs/testing-library": "0.1.
|
|
48
|
+
"@octanejs/testing-library": "0.1.62",
|
|
49
49
|
"@tanstack/devtools-event-bus": "0.4.2",
|
|
50
50
|
"@testing-library/jest-dom": "^6.9.1",
|
|
51
|
-
"octane": "0.
|
|
51
|
+
"octane": "0.12.0",
|
|
52
52
|
"vitest": "^4.1.10"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
@@ -49,9 +49,9 @@ function NativeReadRows(props: { label: string; reads: readonly NativeReadWire[]
|
|
|
49
49
|
@if (read.source.dependencies.length > 0) {
|
|
50
50
|
<div class="odt-muted">
|
|
51
51
|
{'Dependencies: ' +
|
|
52
|
-
read.source.dependencies
|
|
53
|
-
(dependency) => dependency.scopeKey + ':' + dependency.key
|
|
54
|
-
|
|
52
|
+
read.source.dependencies
|
|
53
|
+
.map((dependency) => dependency.scopeKey + ':' + dependency.key)
|
|
54
|
+
.join(', ')}
|
|
55
55
|
</div>
|
|
56
56
|
}
|
|
57
57
|
</div>
|
|
@@ -80,9 +80,9 @@ function TreeRow(props: {
|
|
|
80
80
|
class={['odt-tree-row', props.selected === props.node.id && 'odt-selected']}
|
|
81
81
|
onClick={() => props.onSelect(props.node.id)}
|
|
82
82
|
>
|
|
83
|
-
<span
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
<span class={['odt-kind', props.node.kind === 'root' && 'odt-kind-root']}>
|
|
84
|
+
{props.node.kind}
|
|
85
|
+
</span>
|
|
86
86
|
<span>{props.node.name}</span>
|
|
87
87
|
</button>
|
|
88
88
|
@if (props.node.children.length > 0) {
|
|
@@ -125,74 +125,79 @@ export function ComponentsTab(props: { client: OctaneDevtoolsEventClient }): Oct
|
|
|
125
125
|
client.emit('inspect-request', { id });
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
-
return
|
|
129
|
-
<div class="odt-
|
|
130
|
-
<div class="odt-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
@
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
</div>
|
|
139
|
-
<div class="odt-col">
|
|
140
|
-
@if (detail) {
|
|
141
|
-
<div>
|
|
142
|
-
<div class="odt-node-name">
|
|
143
|
-
{detail.name}
|
|
144
|
-
<span class="odt-badge">{detail.effectCount} effects</span>
|
|
145
|
-
</div>
|
|
146
|
-
<div class="odt-h">Hooks</div>
|
|
147
|
-
@if (detail.hooks.length === 0) {
|
|
148
|
-
<div class="odt-empty odt-muted">No tracked hooks.</div>
|
|
149
|
-
} @else {
|
|
150
|
-
@for (const cell of detail.hooks; index i) {
|
|
151
|
-
<div class="odt-kv">
|
|
152
|
-
<span class="odt-kv-key">{cell.kind}</span>
|
|
153
|
-
<span class="odt-kv-val"> {JSON.stringify(cell.value)}</span>
|
|
154
|
-
</div>
|
|
155
|
-
}
|
|
128
|
+
return (
|
|
129
|
+
<div class="odt-split">
|
|
130
|
+
<div class="odt-col odt-col-tree">
|
|
131
|
+
<div class="odt-h">Component tree</div>
|
|
132
|
+
@if (nodes.length === 0) {
|
|
133
|
+
<div class="odt-empty">No mounted roots yet.</div>
|
|
134
|
+
} @else {
|
|
135
|
+
@for (const node of nodes; key node.id) {
|
|
136
|
+
<TreeRow node={node} onSelect={onSelect} selected={selected} />
|
|
156
137
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
138
|
+
}
|
|
139
|
+
</div>
|
|
140
|
+
<div class="odt-col">
|
|
141
|
+
@if (detail) {
|
|
142
|
+
<div>
|
|
143
|
+
<div class="odt-node-name">
|
|
144
|
+
{detail.name}
|
|
145
|
+
<span class="odt-badge">{detail.effectCount} effects</span>
|
|
146
|
+
</div>
|
|
147
|
+
<div class="odt-h">Hooks</div>
|
|
148
|
+
@if (detail.hooks.length === 0) {
|
|
149
|
+
<div class="odt-empty odt-muted">No tracked hooks.</div>
|
|
150
|
+
} @else {
|
|
151
|
+
@for (const cell of detail.hooks; index i) {
|
|
161
152
|
<div class="odt-kv">
|
|
162
|
-
<span class="odt-kv-key">{
|
|
163
|
-
<span class="odt-kv-val"> {JSON.stringify(
|
|
153
|
+
<span class="odt-kv-key">{cell.kind}</span>
|
|
154
|
+
<span class="odt-kv-val"> {JSON.stringify(cell.value)}</span>
|
|
164
155
|
</div>
|
|
165
156
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<div>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
157
|
+
}
|
|
158
|
+
@if (detail.context.length > 0) {
|
|
159
|
+
<>
|
|
160
|
+
<div class="odt-h">Context</div>
|
|
161
|
+
@for (const c of detail.context; index i) {
|
|
162
|
+
<div class="odt-kv">
|
|
163
|
+
<span class="odt-kv-key">{c.name}</span>
|
|
164
|
+
<span class="odt-kv-val"> {JSON.stringify(c.value)}</span>
|
|
165
|
+
</div>
|
|
166
|
+
}
|
|
167
|
+
</>
|
|
168
|
+
}
|
|
169
|
+
@if (detail.nativeReads) {
|
|
170
|
+
<div>
|
|
171
|
+
<div class="odt-h">Native reads</div>
|
|
172
|
+
<div class="odt-muted">{'Scheduled owner #' + detail.nativeReads.ownerId}</div>
|
|
173
|
+
<NativeReadRows
|
|
174
|
+
label="Accepted reads"
|
|
175
|
+
reads={detail.nativeReads.committed?.reads ?? []}
|
|
176
|
+
/>
|
|
177
|
+
@if (detail.nativeReads.committed?.mixed) {
|
|
178
|
+
<div class="odt-muted">Mixed revisions in this attempt.</div>
|
|
179
|
+
}
|
|
180
|
+
@for (const attempt of detail.nativeReads.pending; index i) {
|
|
181
|
+
<div>
|
|
182
|
+
<NativeReadRows label="Pending attempt" reads={attempt.reads} />
|
|
183
|
+
@if (attempt.mixed) {
|
|
184
|
+
<div class="odt-muted">Mixed revisions in this attempt.</div>
|
|
185
|
+
}
|
|
186
|
+
</div>
|
|
187
|
+
}
|
|
188
|
+
@if (detail.nativeReads.retry.length > 0) {
|
|
189
|
+
<NativeReadRows
|
|
190
|
+
label="Suspended retry sources"
|
|
191
|
+
reads={detail.nativeReads.retry}
|
|
192
|
+
/>
|
|
193
|
+
}
|
|
194
|
+
</div>
|
|
195
|
+
}
|
|
196
|
+
</div>
|
|
197
|
+
} @else {
|
|
198
|
+
<div class="odt-empty">Select a component.</div>
|
|
199
|
+
}
|
|
200
|
+
</div>
|
|
196
201
|
</div>
|
|
197
|
-
|
|
202
|
+
);
|
|
198
203
|
}
|
|
@@ -38,25 +38,29 @@ export function OctanePanel(props: { client: OctaneDevtoolsEventClient }): Octan
|
|
|
38
38
|
client.emit('refresh', {});
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
return
|
|
42
|
-
<div class="odt-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
return (
|
|
42
|
+
<div class="odt-root">
|
|
43
|
+
<div class="odt-tabs">
|
|
44
|
+
@for (const t of TABS; key t.id) {
|
|
45
|
+
<button
|
|
46
|
+
class={['odt-tab', tab === t.id && 'odt-tab-active']}
|
|
47
|
+
onClick={() => setTab(t.id)}
|
|
48
|
+
>
|
|
49
|
+
{t.label}
|
|
50
|
+
</button>
|
|
51
|
+
}
|
|
52
|
+
</div>
|
|
53
|
+
<div class="odt-body">
|
|
54
|
+
@if (tab === 'components') {
|
|
55
|
+
<ComponentsTab client={client} />
|
|
56
|
+
} @else if (tab === 'profiler') {
|
|
57
|
+
<ProfilerTab client={client} />
|
|
58
|
+
} @else if (tab === 'transitions') {
|
|
59
|
+
<TransitionsTab client={client} />
|
|
60
|
+
} @else {
|
|
61
|
+
<PerfModelTab client={client} />
|
|
62
|
+
}
|
|
63
|
+
</div>
|
|
49
64
|
</div>
|
|
50
|
-
|
|
51
|
-
@if (tab === 'components') {
|
|
52
|
-
<ComponentsTab client={client} />
|
|
53
|
-
} @else if (tab === 'profiler') {
|
|
54
|
-
<ProfilerTab client={client} />
|
|
55
|
-
} @else if (tab === 'transitions') {
|
|
56
|
-
<TransitionsTab client={client} />
|
|
57
|
-
} @else {
|
|
58
|
-
<PerfModelTab client={client} />
|
|
59
|
-
}
|
|
60
|
-
</div>
|
|
61
|
-
</div>;
|
|
65
|
+
);
|
|
62
66
|
}
|
|
@@ -42,51 +42,53 @@ export function PerfModelTab(props: { client: OctaneDevtoolsEventClient }): Octa
|
|
|
42
42
|
return Math.max(1, ...snapshot.recentEvents.map((e) => e.selfDuration));
|
|
43
43
|
}, [snapshot]);
|
|
44
44
|
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
@
|
|
55
|
-
|
|
56
|
-
<
|
|
45
|
+
return (
|
|
46
|
+
<div>
|
|
47
|
+
@if (snapshot === null || snapshot.summaries.length === 0) {
|
|
48
|
+
<div class="odt-empty">No performance data yet — interact with the app.</div>
|
|
49
|
+
} @else {
|
|
50
|
+
<>
|
|
51
|
+
<div class="odt-h">Slowest mounts (self time)</div>
|
|
52
|
+
@if (slowestMounts.length === 0) {
|
|
53
|
+
<div class="odt-empty odt-muted">No mounts recorded yet.</div>
|
|
54
|
+
} @else {
|
|
55
|
+
@for (const e of slowestMounts; index i) {
|
|
56
|
+
<div class="odt-commit-row">
|
|
57
|
+
<span class="odt-name-cell">{e.component}</span>
|
|
58
|
+
<span
|
|
59
|
+
class="odt-bar"
|
|
60
|
+
style={{ width: `${Math.max(6, (e.selfDuration / maxSelf) * 120)}px` }}
|
|
61
|
+
></span>
|
|
62
|
+
<span class="odt-num">{fmt(e.selfDuration)}ms</span>
|
|
63
|
+
</div>
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
<div class="odt-h">Queue-delay hotspots</div>
|
|
67
|
+
@if (queueHotspots.length === 0) {
|
|
68
|
+
<div class="odt-empty odt-muted">No additional hotspots.</div>
|
|
69
|
+
} @else {
|
|
70
|
+
@for (const s of queueHotspots; index i) {
|
|
71
|
+
<div class="odt-commit-row">
|
|
72
|
+
<span class="odt-name-cell">{s.component}</span>
|
|
73
|
+
<span class="odt-muted">{fmt(s.averageQueueDelay)}ms avg queue</span>
|
|
74
|
+
</div>
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
<div class="odt-h">Recent commit self-time</div>
|
|
78
|
+
<div style={{ display: 'flex', alignItems: 'flex-end', gap: '2px', height: '30px' }}>
|
|
79
|
+
@for (const ev of snapshot.recentEvents; index i) {
|
|
57
80
|
<span
|
|
58
81
|
class="odt-bar"
|
|
59
|
-
|
|
82
|
+
title={`${ev.component}: ${fmt(ev.selfDuration)}ms`}
|
|
83
|
+
style={{
|
|
84
|
+
width: '7px',
|
|
85
|
+
height: `${Math.min(28, Math.max(2, (ev.selfDuration / maxSelf) * 28))}px`,
|
|
86
|
+
}}
|
|
60
87
|
></span>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<div class="odt-empty odt-muted">No additional hotspots.</div>
|
|
68
|
-
} @else {
|
|
69
|
-
@for (const s of queueHotspots; index i) {
|
|
70
|
-
<div class="odt-commit-row">
|
|
71
|
-
<span class="odt-name-cell">{s.component}</span>
|
|
72
|
-
<span class="odt-muted">{fmt(s.averageQueueDelay)}ms avg queue</span>
|
|
73
|
-
</div>
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
<div class="odt-h">Recent commit self-time</div>
|
|
77
|
-
<div style={{ display: 'flex', alignItems: 'flex-end', gap: '2px', height: '30px' }}>
|
|
78
|
-
@for (const ev of snapshot.recentEvents; index i) {
|
|
79
|
-
<span
|
|
80
|
-
class="odt-bar"
|
|
81
|
-
title={`${ev.component}: ${fmt(ev.selfDuration)}ms`}
|
|
82
|
-
style={{
|
|
83
|
-
width: '7px',
|
|
84
|
-
height: `${Math.min(28, Math.max(2, (ev.selfDuration / maxSelf) * 28))}px`,
|
|
85
|
-
}}
|
|
86
|
-
></span>
|
|
87
|
-
}
|
|
88
|
-
</div>
|
|
89
|
-
</>
|
|
90
|
-
}
|
|
91
|
-
</div>;
|
|
88
|
+
}
|
|
89
|
+
</div>
|
|
90
|
+
</>
|
|
91
|
+
}
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
92
94
|
}
|
|
@@ -19,48 +19,46 @@ export function ProfilerTab(props: { client: OctaneDevtoolsEventClient }): Octan
|
|
|
19
19
|
return () => off();
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<th>Component</th>
|
|
32
|
-
<th class="odt-num">Renders</th>
|
|
33
|
-
<th class="odt-num">Self ms</th>
|
|
34
|
-
<th class="odt-num">Max ms</th>
|
|
35
|
-
<th class="odt-num">Queue ms</th>
|
|
36
|
-
<th>Cause</th>
|
|
37
|
-
</tr>
|
|
38
|
-
</thead>
|
|
39
|
-
<tbody>
|
|
40
|
-
@for (const s of snapshot.summaries; index i) {
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
@if (snapshot === null || snapshot.summaries.length === 0) {
|
|
25
|
+
<div class="odt-empty">No profiling data yet — interact with the app.</div>
|
|
26
|
+
} @else {
|
|
27
|
+
<>
|
|
28
|
+
<div class="odt-h">Slowest components (self time)</div>
|
|
29
|
+
<table class="odt-table">
|
|
30
|
+
<thead>
|
|
41
31
|
<tr>
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
<
|
|
32
|
+
<th>Component</th>
|
|
33
|
+
<th class="odt-num">Renders</th>
|
|
34
|
+
<th class="odt-num">Self ms</th>
|
|
35
|
+
<th class="odt-num">Max ms</th>
|
|
36
|
+
<th class="odt-num">Queue ms</th>
|
|
37
|
+
<th>Cause</th>
|
|
48
38
|
</tr>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
39
|
+
</thead>
|
|
40
|
+
<tbody>
|
|
41
|
+
@for (const s of snapshot.summaries; index i) {
|
|
42
|
+
<tr>
|
|
43
|
+
<td class="odt-name-cell">{s.component}</td>
|
|
44
|
+
<td class="odt-num">{s.attempts}</td>
|
|
45
|
+
<td class="odt-num">{fmt(s.totalSelfTime)}</td>
|
|
46
|
+
<td class="odt-num">{fmt(s.maxInclusiveTime)}</td>
|
|
47
|
+
<td class="odt-num">{fmt(s.averageQueueDelay)}</td>
|
|
48
|
+
<td class="odt-muted">{(s.dominantCause ?? '-') as string}</td>
|
|
49
|
+
</tr>
|
|
50
|
+
}
|
|
51
|
+
</tbody>
|
|
52
|
+
</table>
|
|
53
|
+
<div class="odt-h">Recent commits</div>
|
|
54
|
+
@for (const ev of snapshot.recentEvents; index i) {
|
|
55
|
+
<div class="odt-commit-row">
|
|
56
|
+
{ev.component}·{ev.phase}·{fmt(ev.selfDuration)}ms ·
|
|
57
|
+
{ev.causes.join(',') || ev.outcome}
|
|
58
|
+
</div>
|
|
59
|
+
}
|
|
60
|
+
</>
|
|
61
|
+
}
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
66
64
|
}
|
|
@@ -23,21 +23,23 @@ export function TransitionsTab(props: { client: OctaneDevtoolsEventClient }): Oc
|
|
|
23
23
|
return () => off();
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
return
|
|
27
|
-
<div
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
return (
|
|
27
|
+
<div>
|
|
28
|
+
<div class="odt-stat">Pending transitions: {snapshot.pendingCount}</div>
|
|
29
|
+
<div class="odt-h">Suspense boundaries</div>
|
|
30
|
+
@if (snapshot.boundaries.length === 0) {
|
|
31
|
+
<div class="odt-empty">No Suspense boundaries.</div>
|
|
32
|
+
} @else {
|
|
33
|
+
@for (const b of snapshot.boundaries; index i) {
|
|
34
|
+
<div class="odt-boundary">
|
|
35
|
+
<span class={stateClass(b)}>{b.state}</span>
|
|
36
|
+
<span>{b.label}</span>
|
|
37
|
+
@if (b.hasResolved && b.state !== 'resolved') {
|
|
38
|
+
<span class="odt-muted">resolved once</span>
|
|
39
|
+
}
|
|
40
|
+
</div>
|
|
41
|
+
}
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
43
45
|
}
|