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
Copy file name to clipboardExpand all lines: docs/content/1.guide/17.client-context.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,12 +55,13 @@ A failed import retries on the next dock update.
55
55
56
56
### Shipping a client script
57
57
58
-
`importFrom` accepts two shapes:
58
+
`importFrom` accepts three shapes:
59
59
60
60
-**A URL served by the host framework** — a self-contained ES module; works on every host framework.
61
61
-**A bare npm specifier** (`'vite-plugin-vue-tracer/client/vite-devtools'`) — resolved through the host framework.
62
+
-**An absolute filesystem path**, declared on the definition's `dock.clientScript`. The hub serves its directory under `<base>__page-script/` and rewrites `importFrom` to that URL, so mounting by package name needs no host wiring.
62
63
63
-
For a URL, attach it via `ctx.install(myDevframe, { dock: { clientScript: { importFrom } } })`. Under Vite `/@fs/<absolute path>` serves it; other host frameworks mount the directory statically.
64
+
Per-mount, attach a URL via `ctx.install(myDevframe, { dock: { clientScript: { importFrom } } })`; under Vite `/@fs/<absolute path>` serves it, and other host frameworks mount the directory statically.
Copy file name to clipboardExpand all lines: docs/content/5.plugins/4.a11y.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,15 @@ The page script and the panel talk over the [in-page channel](/guide/in-page-cha
31
31
32
32
## In a hub
33
33
34
-
The page script is the a11y dock's [client script](/guide/client-context): attach `a11yPageScriptBundlePath` as the dock's `clientScript` and the hub imports it into the page. It also mirrors each scan into the hub's messages feed — a summary plus one per rule:
34
+
The definition declares the page script as its dock [client script](/guide/client-context), so mounting by package name just works:
The hub serves the bundle same-origin and a client runtime imports it into the host page. Each scan also mirrors into the hub's messages feed — a summary plus one per rule.
41
+
42
+
A host can also mount the module itself — e.g. a Vite host via `/@fs/`:
Copy file name to clipboardExpand all lines: examples/hub-next/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Open the printed URL. The dock rail on the left lists every mounted tool with it
20
20
21
21
Selecting a tool loads its SPA in the stage. The bottom drawer mirrors the hub's **Commands**, **Messages**, and **Terminals** subsystems, plus a button that dispatches a command through `hub:commands:execute`, and a **Transport** section showing which RPC transport the connection runs on (`websocket` or `sse`) with a segmented Auto / WS / SSE toggle - the choice rides a `?transport=` URL param and reconnects the whole client runtime on the pinned transport.
22
22
23
-
The A11y Inspector shows a live axe-core report of this hub's own page: the hub serves the devframe's page-script module (`a11yPageScriptBundlePath`) same-origin inside the hub namespace and attaches it as the a11y dock's `clientScript` (the `{ devframe, dock }` entry form); the hub client runtime - `createDevframeClientRuntime()` booted in `app/page.tsx` - imports it into the page, so the docked panel and the page script share the origin and tab their in-page channel handshakes across.
23
+
The A11y Inspector shows a live axe-core report of this hub's own page: the devframe declares its own page-script module as the a11y dock's `clientScript`, so the hub serves it same-origin with no host wiring; the hub client runtime - `createDevframeClientRuntime()` booted in `app/page.tsx` - imports it into the page, so the docked panel and the page script share the origin and tab their in-page channel handshakes across.
24
24
25
25
The **RPC & State Inspector** carries an **Instances** tab that lists every devframe dev server running on your machine. The hub 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 hub-vite dev`, or any `node bin.mjs` CLI example) in a second terminal and it appears there too, each linking to its own SPA.
26
26
@@ -57,7 +57,7 @@ The built-in devframes run node-side (child processes, the native `zigpty` PTY b
57
57
58
58
| File | Role |
59
59
|---|---|
60
-
|`src/client/devframe/next-devframe-hub.ts`| The Next host - one `initHub()` call: devframes (incl. the a11y page script as its dock's `clientScript`), hub RPCs, commands, the json-render dock + renderer manifest, instance-registry registration |
60
+
|`src/client/devframe/next-devframe-hub.ts`| The Next host - one `initHub()` call: devframes, hub RPCs, commands, the json-render dock + renderer manifest, instance-registry registration |
61
61
|`src/client/devframe/unrendered-dock.ts`| A dock type registered with no renderer on purpose - the missing-renderer fallback witness |
62
62
|`../demo-dock-client/`| The shared demo client script, consumed here as a statically-mounted self-contained bundle |
63
63
|`src/client/app/%5F_devframes/[[...path]]/route.ts`| The one catch-all - delegates every `/__devframes/*` request to the instance's `handler`|
Copy file name to clipboardExpand all lines: examples/hub-vite/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Open the printed URL. The dock rail on the left lists every mounted tool with it
20
20
21
21
Selecting a tool loads its SPA in the stage. The bottom drawer mirrors the hub's **Commands**, **Messages**, and **Terminals** subsystems, plus a button that dispatches a command through `hub:commands:execute`, and a **Transport** section showing which RPC transport the connection runs on (`websocket` or `sse`) with a segmented Auto / WS / SSE toggle - the choice rides a `?transport=` URL param and reconnects the whole client runtime on the pinned transport.
22
22
23
-
The A11y Inspector shows a live axe-core report of this hub's own page. `vite.config.ts` attaches the devframe's page script as the a11y dock's `clientScript` (served via `/@fs/`), and the hub client runtime - `createDevframeClientRuntime()` booted in `src/client/main.ts` - imports it into the host page. Panel and page script share the Vite origin and tab their in-page channel handshakes across; hover a violation to ring the offending element in the hub UI.
23
+
The A11y Inspector shows a live axe-core report of this hub's own page. The devframe declares its own page script as the a11y dock's `clientScript`, so the hub serves it same-origin and the hub client runtime - `createDevframeClientRuntime()` booted in `src/client/main.ts` - imports it into the host page automatically (no wiring in `vite.config.ts`). Panel and page script share the Vite origin and tab their in-page channel handshakes across; hover a violation to ring the offending element in the hub UI.
24
24
25
25
The **RPC & State Inspector** carries an **Instances** tab that lists every devframe dev server running on your machine. The hub 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.
26
26
@@ -45,7 +45,7 @@ The dock UI is plain DOM in `src/client/`. To skin your own hub UI provider, rea
45
45
| File | Role |
46
46
|---|---|
47
47
|`src/vite-devframe-hub.ts`| The Vite host - one `initHub()` call mounted as connect middleware, plus instance-registry registration |
48
-
|`vite.config.ts`| Passes the built-in and demo devframes to the hub's `devframes` option; attaches the a11y page script as its dock's `clientScript`; composes the json-render frontend via `renderers`|
48
+
|`vite.config.ts`| Passes the built-in and demo devframes to the hub's `devframes` option; composes the json-render frontend via `renderers`|
49
49
|`src/unrendered-dock.ts`| A dock type registered with no renderer on purpose - the missing-renderer fallback witness |
50
50
|`../demo-dock-client/`| The shared demo client script, consumed here via bare specifier (`action: { importFrom: 'demo-dock-client' }`) |
51
51
|`src/client/main.ts`| The browser UI that consumes the hub protocol, including the interactive-OTP authorization view |
0 commit comments