@octanejs/devtools 0.0.51 → 0.0.53

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.51",
3
+ "version": "0.0.53",
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.12.0"
45
+ "octane": "^0.13.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@octanejs/testing-library": "0.1.62",
48
+ "@octanejs/testing-library": "0.1.63",
49
49
  "@tanstack/devtools-event-bus": "0.4.2",
50
50
  "@testing-library/jest-dom": "^6.9.1",
51
- "octane": "0.12.0",
51
+ "octane": "0.13.6",
52
52
  "vitest": "^4.1.10"
53
53
  },
54
54
  "scripts": {
package/src/bridge.ts CHANGED
@@ -1,3 +1,5 @@
1
+ 'use strong';
2
+
1
3
  import {
2
4
  OctaneDevtoolsEventClient,
3
5
  type NodeDetail,
@@ -37,6 +39,7 @@ function getProfiler(): ProfilerGlobal | undefined {
37
39
  // own re-renders from perpetually changing the profile snapshot — which, with
38
40
  // the dedupe below, lets the live view settle when the app is idle.
39
41
  const DEVTOOLS_OWN_COMPONENTS = new Set([
42
+ 'OctaneDevtoolsPanel',
40
43
  'OctanePanel',
41
44
  'ComponentsTab',
42
45
  'ProfilerTab',
package/src/client.ts CHANGED
@@ -1,3 +1,5 @@
1
+ 'use strong';
2
+
1
3
  import { EventClient } from '@tanstack/devtools-event-client';
2
4
 
3
5
  export const PLUGIN_ID = 'octane';
package/src/index.ts CHANGED
@@ -1,11 +1,7 @@
1
- /** @jsxImportSource octane */
2
1
  'use client';
2
+ 'use strong';
3
3
 
4
- import { createElement } from 'octane';
5
- import { OctaneDevtoolsEventClient } from './client';
6
- import { startBridge } from './bridge';
7
- import { OctanePanel } from './panel/OctanePanel.tsrx';
8
-
4
+ export { octaneDevtools } from './plugin.tsrx';
9
5
  export { OctaneDevtoolsEventClient } from './client';
10
6
  export { startBridge } from './bridge';
11
7
  export { ComponentsTab } from './panel/ComponentsTab.tsrx';
@@ -14,22 +10,3 @@ export { TransitionsTab } from './panel/TransitionsTab.tsrx';
14
10
  export { PerfModelTab } from './panel/PerfModelTab.tsrx';
15
11
  export { OctanePanel } from './panel/OctanePanel.tsrx';
16
12
  export type { TreeSnapshot, NodeDetail, WireTreeNode } from './client';
17
-
18
- /**
19
- * A TanStack Devtools plugin exposing live Octane runtime diagnostics. Add it to
20
- * `<TanStackDevtools plugins={[octaneDevtools()]} />`. Starts the app-side bridge
21
- * on first render; the bridge is a no-op unless the app was built with devtools
22
- * enabled (`octane({ devtools: true })`).
23
- */
24
- export function octaneDevtools() {
25
- const client = new OctaneDevtoolsEventClient();
26
- let stop: (() => void) | null = null;
27
- return {
28
- id: 'octane',
29
- name: 'Octane',
30
- render: () => {
31
- if (stop === null) stop = startBridge(client);
32
- return createElement(OctanePanel, { client });
33
- },
34
- };
35
- }
@@ -1,3 +1,5 @@
1
+ 'use strong';
2
+
1
3
  // The Components tab: subscribes to the app-side bridge's `tree`/`inspect` events
2
4
  // (startBridge) and renders the live component tree plus a selected-node state
3
5
  // inspector. Read-only — selecting a node only asks the app to describe it
@@ -112,6 +114,7 @@ export function ComponentsTab(props: { client: OctaneDevtoolsEventClient }): Oct
112
114
  setSelected(null);
113
115
  }
114
116
  });
117
+ client.emit('refresh', {});
115
118
  return () => {
116
119
  offTree();
117
120
  offInspect();
@@ -1,7 +1,9 @@
1
+ 'use strong';
2
+
1
3
  // The tab shell hosting the Components (P1), Profiler (P2), Transitions (P3),
2
4
  // and Performance-model (P4) tabs. This is the plugin's top-level render()
3
- // node — see ../index.ts. It injects the Octane-branded panel stylesheet once
4
- // and asks the bridge for a fresh snapshot on mount so tabs populate immediately.
5
+ // node — see ../index.ts. It injects the Octane-branded panel stylesheet once;
6
+ // each tab subscribes before requesting its current snapshot.
5
7
  import { useEffect, useState } from 'octane';
6
8
  import type { OctaneNode } from 'octane';
7
9
  import { OctaneDevtoolsEventClient } from '../client';
@@ -33,9 +35,6 @@ export function OctanePanel(props: { client: OctaneDevtoolsEventClient }): Octan
33
35
  el.textContent = OCTANE_DEVTOOLS_CSS;
34
36
  document.head.appendChild(el);
35
37
  }
36
- // Pull a current snapshot so tabs show data on open, not only after the
37
- // next scheduler flush.
38
- client.emit('refresh', {});
39
38
  });
40
39
 
41
40
  return (
@@ -1,3 +1,5 @@
1
+ 'use strong';
2
+
1
3
  // The Performance-model tab: derives aggregate "what's slow" views from the SAME
2
4
  // `profile` event the Profiler tab already consumes — no new event, bridge path, or
3
5
  // runtime probe. Where the Profiler tab shows a per-commit table, this tab shows
@@ -17,6 +19,7 @@ export function PerfModelTab(props: { client: OctaneDevtoolsEventClient }): Octa
17
19
 
18
20
  useEffect(() => {
19
21
  const off = client.on('profile', (e) => setSnapshot(e.payload));
22
+ client.emit('refresh', {});
20
23
  return () => off();
21
24
  });
22
25
 
@@ -1,3 +1,5 @@
1
+ 'use strong';
2
+
1
3
  // The Profiler tab: subscribes to the app-side bridge's `profile` event (startBridge,
2
4
  // which reads globalThis.__OCTANE_PROFILER__ per flush) and renders a ranked
3
5
  // self-time table plus a recent-commits list. Absent a profiler global on the app
@@ -16,6 +18,7 @@ export function ProfilerTab(props: { client: OctaneDevtoolsEventClient }): Octan
16
18
 
17
19
  useEffect(() => {
18
20
  const off = client.on('profile', (e) => setSnapshot(e.payload));
21
+ client.emit('refresh', {});
19
22
  return () => off();
20
23
  });
21
24
 
@@ -1,3 +1,5 @@
1
+ 'use strong';
2
+
1
3
  // The Transitions & Suspense tab: subscribes to the app-side bridge's `transition`
2
4
  // event (startBridge, which reads the devtools hook's getTransitionState() per
3
5
  // flush) and renders the live pending-transition count plus each Suspense boundary's
@@ -20,6 +22,7 @@ export function TransitionsTab(props: { client: OctaneDevtoolsEventClient }): Oc
20
22
 
21
23
  useEffect(() => {
22
24
  const off = client.on('transition', (e) => setSnapshot(e.payload));
25
+ client.emit('refresh', {});
23
26
  return () => off();
24
27
  });
25
28
 
@@ -1,3 +1,5 @@
1
+ 'use strong';
2
+
1
3
  // Self-contained Octane-branded stylesheet for the DevTools panel. The panel is
2
4
  // portaled into the TanStack DevTools host, so the website's `:root` custom
3
5
  // properties are not reliably in scope — we inject our own tokens + rules once,
@@ -0,0 +1,28 @@
1
+ 'use client';
2
+ 'use strong';
3
+
4
+ import { OctaneDevtoolsEventClient } from './client';
5
+ import { startBridge } from './bridge';
6
+ import { OctanePanel } from './panel/OctanePanel.tsrx';
7
+
8
+ /**
9
+ * A TanStack Devtools plugin exposing live Octane runtime diagnostics. Add it to
10
+ * `<TanStackDevtools plugins={[octaneDevtools()]} />`. Starts the app-side bridge
11
+ * on first render; the bridge is a no-op unless the app was built with devtools
12
+ * enabled (`octane({ devtools: true })`).
13
+ */
14
+ export function octaneDevtools() {
15
+ const client = new OctaneDevtoolsEventClient();
16
+ let stop: (() => void) | null = null;
17
+ const OctaneDevtoolsPanel = () => @{
18
+ <OctanePanel client={client} />
19
+ };
20
+ return {
21
+ id: 'octane',
22
+ name: 'Octane',
23
+ render: () => {
24
+ if (stop === null) stop = startBridge(client);
25
+ return OctaneDevtoolsPanel;
26
+ },
27
+ };
28
+ }
@@ -0,0 +1,10 @@
1
+ // Declaration companion for plugin.tsrx.
2
+ import type { ComponentBody } from 'octane';
3
+
4
+ export declare function octaneDevtools(): {
5
+ id: string;
6
+ name: string;
7
+ render: () => ComponentBody;
8
+ };
9
+
10
+ export {};