You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(inspect): explain the Instances tab and register example hub hosts
Give the Instances tab a self-describing empty state — what it lists,
where discovery comes from (`~/.devframe/instances/`), and how to make
instances appear (start another dev server, or a host that calls
`registerDevframeInstance`; note the disable env var) — plus a one-line
toolbar hint.
Register the in-process example hub hosts in the instance registry so
they show up in the tab like any standalone devframe: the vite-devframe-hub
(which the tab previously left empty) and the a11y-messages-playground,
mirroring the next-devframe-hub that already self-registers. Registration
waits for the dev server to listen, reuses its own origin, and is folded
into teardown so restarts don't leave ghost records. READMEs updated to
keep the hub examples at parity.
Copy file name to clipboardExpand all lines: examples/next-devframe-hub/README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@ Selecting a tool loads its SPA in the stage. The bottom drawer mirrors the hub's
20
20
21
21
The A11y Inspector shows a live axe-core report of this hub's own page: the host serves the plugin's in-page agent module (`a11yAgentBundlePath`) same-origin through the catch-all route and attaches it as the a11y dock's `clientScript`; the hub client runtime — `createDevframeClientHost()` booted in `app/page.tsx` — imports it into the page, so the docked panel and the agent share the origin their BroadcastChannel rides.
22
22
23
+
The **RPC & State Inspector** carries an **Instances** tab that lists every devframe dev server running on your machine. The host registers itself in the shared registry (`~/.devframe/instances/`) on startup via `registerDevframeInstance()`, so it shows up as "this instance"; start another example (e.g. `pnpm --filter vite-devframe-hub dev`, or any `node bin.mjs` CLI example) in a second terminal and it appears there too, each linking to its own SPA.
24
+
23
25
## What the example proves
24
26
25
27
-`createHubContext()` boots a hub with no Vite-specific code path; a `DevframeHost` impl plugs Next specifics (static mounts, connection meta, storage, origin) in uniformly
@@ -35,7 +37,7 @@ The plugins run node-side (child processes, the native `zigpty` PTY backend) and
35
37
36
38
| File | Role |
37
39
|---|---|
38
-
|`src/client/devframe/next-devframe-hub.ts`| The Next host — hub context, static-mount registry (incl. the a11y agent), side-car WS |
40
+
|`src/client/devframe/next-devframe-hub.ts`| The Next host — hub context, static-mount registry (incl. the a11y agent), side-car WS, instance-registry registration|
39
41
|`src/client/app/%5F_hub/%5F_connection.json/route.ts`| Boots the singleton host and serves `/__hub/__connection.json`|
40
42
|`src/client/app/%5F_[id]/[[...path]]/route.ts`| Serves each mounted SPA and its connection meta under `/__<id>/`|
41
43
|`src/client/app/page.tsx`| The browser UI that consumes the hub protocol |
Copy file name to clipboardExpand all lines: examples/vite-devframe-hub/README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,8 @@ Selecting a tool loads its SPA in the stage. The bottom drawer mirrors the hub's
20
20
21
21
The A11y Inspector shows a live axe-core report of this hub's own page. `vite.config.ts` attaches the plugin's in-page agent as the a11y dock's `clientScript` (served via `/@fs/`), and the hub client runtime — `createDevframeClientHost()` booted in `src/client/main.ts` — imports it into the host page. Panel and agent share the Vite origin their BroadcastChannel rides; hover a violation to ring the offending element in the hub UI.
22
22
23
+
The **RPC & State Inspector** carries an **Instances** tab that lists every devframe dev server running on your machine. The host registers itself in the shared registry (`~/.devframe/instances/`) on startup via `registerDevframeInstance()`, so it shows up as "this instance"; start another example (`pnpm --filter a11y-messages-playground dev`, or any `node bin.mjs` CLI example) in a second terminal and it appears there too, each linking to its own SPA.
24
+
23
25
## What the example proves
24
26
25
27
-`createHubContext()` boots a hub with no Vite-specific code path; a `DevframeHost` impl plugs framework specifics (static mounts, connection meta, storage, origin) in uniformly
@@ -36,7 +38,7 @@ The dock UI is plain DOM in `src/client/`. To skin your own viewer, read the sam
36
38
37
39
| File | Role |
38
40
|---|---|
39
-
|`src/vite-devframe-hub.ts`| The Vite host — hub context, static + connection-meta mounts, side-car WS |
41
+
|`src/vite-devframe-hub.ts`| The Vite host — hub context, static + connection-meta mounts, side-car WS, instance-registry registration|
40
42
|`vite.config.ts`| Mounts the built-in plugins via the host's `devframes` option; attaches the a11y agent as its dock's `clientScript`|
41
43
|`src/client/main.ts`| The browser UI that consumes the hub protocol |
42
44
|`src/client/icons.ts`| Offline Phosphor icons for the dock |
0 commit comments