@octanejs/devtools 0.0.61 → 0.0.62

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/devtools",
3
- "version": "0.0.61",
3
+ "version": "0.0.62",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -45,13 +45,13 @@
45
45
  "@tanstack/devtools-event-client": "0.5.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "octane": "^0.21.0"
48
+ "octane": "^0.22.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@octanejs/testing-library": "0.1.73",
51
+ "@octanejs/testing-library": "0.1.74",
52
52
  "@tanstack/devtools-event-bus": "0.4.2",
53
53
  "@testing-library/jest-dom": "^6.9.1",
54
- "octane": "0.21.0",
54
+ "octane": "0.22.0",
55
55
  "vitest": "^4.1.10"
56
56
  },
57
57
  "scripts": {
@@ -4,7 +4,7 @@
4
4
  // (startBridge) and renders the live component tree plus a selected-node state
5
5
  // inspector. Read-only — selecting a node only asks the app to describe it
6
6
  // (`inspect-request`); it never mutates app state (see docs/devtools.md P1 scope).
7
- import { useEffect, useState } from 'octane';
7
+ import { useEffect, useMemo, useState } from 'octane';
8
8
  import type { OctaneNode } from 'octane';
9
9
  import {
10
10
  OctaneDevtoolsEventClient,
@@ -94,6 +94,7 @@ function flattenTree(nodes: readonly WireTreeNode[]): TreeLine[] {
94
94
  export function ComponentsTab(props: { client: OctaneDevtoolsEventClient }): OctaneNode {
95
95
  const { client } = props;
96
96
  const [nodes, setNodes] = useState<WireTreeNode[]>([]);
97
+ const lines = useMemo(() => flattenTree(nodes));
97
98
  const [selected, setSelected, getSelected] = useState<number | null>(null);
98
99
  const [detail, setDetail] = useState<NodeDetail | null>(null);
99
100
 
@@ -129,7 +130,7 @@ export function ComponentsTab(props: { client: OctaneDevtoolsEventClient }): Oct
129
130
  @if (nodes.length === 0) {
130
131
  <div class="odt-empty">No mounted roots yet.</div>
131
132
  } @else {
132
- @for (const line of flattenTree(nodes); key line.node.id) {
133
+ @for (const line of lines; key line.node.id) {
133
134
  <button
134
135
  class={['odt-tree-row', selected === line.node.id && 'odt-selected']}
135
136
  style={{ paddingLeft: `${6 + line.depth * 12}px` }}