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: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
**`devframe`** is the framework-neutral container for one devtool integration, portable across viewers. Build a single tool (its RPC, its SPA, its diagnostics, its CLI/build/spa/embedded outputs) without caring how it'll be displayed. A devframe app runs standalone (CLI, static deploy, embedded SPA) just as well as it mounts inside a hub.
6
6
7
-
**`@devframes/hub`** is the framework-neutral hub layer that sits on top of devframe and provides the multi-integration orchestration (docks, terminals, messages, commands). It does not ship UI — implementers (e.g. `@vitejs/devtools-kit`) provide their own UI on top of the hub's RPC + shared-state protocol. It does ship a **headless client runtime** (`createDevframeClientHost()` from `@devframes/hub/client`): booted in the host page, it assembles the shared `DevframeClientContext` (panel, docks, commands, when) and imports each dock entry's client script (`action` / `custom-render` / iframe `clientScript`) into that page — how a plugin like the a11y inspector runs code inside the page being inspected. See `examples/minimal-vite-devframe-hub/` for a working ~120-line Vite host demonstrating the protocol end to end.
7
+
**`@devframes/hub`** is the framework-neutral hub layer that sits on top of devframe and provides the multi-integration orchestration (docks, terminals, messages, commands). It does not ship UI — implementers (e.g. `@vitejs/devtools-kit`) provide their own UI on top of the hub's RPC + shared-state protocol. It does ship a **headless client runtime** (`createDevframeClientHost()` from `@devframes/hub/client`): booted in the host page, it assembles the shared `DevframeClientContext` (panel, docks, commands, when) and imports each dock entry's client script (`action` / `custom-render` / iframe `clientScript`) into that page — how a plugin like the a11y inspector runs code inside the page being inspected. See `examples/vite-devframe-hub/` for a working ~120-line Vite host demonstrating the protocol end to end.
Copy file name to clipboardExpand all lines: docs/examples/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ End-to-end examples that exercise the full adapter surface, each a runnable app
9
9
| Example | UI framework | What it shows |
10
10
|---------|--------------|---------------|
11
11
|[files-inspector](./files-inspector)| Preact | Lists files in the cwd via RPC; exercises the CLI dev / build / spa surfaces. |
12
-
|[minimal-json-render](./minimal-json-render)| Vue | A server-authored JSON-render view rendered by `@devframes/json-render-ui`, with live state and an action bridge. |
12
+
|[json-render](./json-render)| Vue | A server-authored JSON-render view rendered by `@devframes/json-render-ui`, with live state and an action bridge. |
13
13
|[streaming-chat](./streaming-chat)| Preact | Streams synthetic chat tokens server → client, with history kept in shared state. |
14
14
|[next-runtime-snapshot](./next-runtime-snapshot)| React (Next.js) | A Next.js App Router SPA over RPC, surfacing the host Node runtime. |
15
-
|[minimal-vite-devframe-hub](./minimal-vite-devframe-hub)| Vanilla TypeScript (Vite) | A ~120-line Vite host wiring `@devframes/hub` end to end. |
16
-
|[minimal-next-devframe-hub](./minimal-next-devframe-hub)| React (Next.js) | The same hub protocol, hosted from a Next.js route handler. |
15
+
|[vite-devframe-hub](./vite-devframe-hub)| Vanilla TypeScript (Vite) | A ~120-line Vite host wiring `@devframes/hub` end to end. |
16
+
|[next-devframe-hub](./next-devframe-hub)| React (Next.js) | The same hub protocol, hosted from a Next.js route handler. |
Copy file name to clipboardExpand all lines: docs/examples/next-devframe-hub.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,16 @@
2
2
outline: deep
3
3
---
4
4
5
-
# minimal-next-devframe-hub
5
+
# next-devframe-hub
6
6
7
-
The same hub protocol as the [Vite host](./minimal-vite-devframe-hub), hosted from a **Next.js** App Router app. It wires [`@devframes/hub`](/guide/hub) by lazily starting a side-car RPC / WebSocket server from a Node route handler — proof that the hub is host-runtime-agnostic.
7
+
The same hub protocol as the [Vite host](./vite-devframe-hub), hosted from a **Next.js** App Router app. It wires [`@devframes/hub`](/guide/hub) by lazily starting a side-car RPC / WebSocket server from a Node route handler — proof that the hub is host-runtime-agnostic.
-`createHubContext()` boots a hub without any Vite-specific code path.
14
-
-A `DevframeHost` implementation plugs the Next host specifics into the hub uniformly.
14
+
-The [`@devframes/next`](/helpers/next) bridge supplies the `DevframeHost` and a single `fetch` handler both route handlers delegate to — serving every mounted SPA and its connection meta through devframe's own static handler.
15
15
-`mountDevframe(ctx, def)` registers any `DevframeDefinition` as a dock.
16
16
- The built-in `hub:commands:execute` RPC dispatches any registered server command, regardless of how the host was constructed.
17
17
- The browser-side `connectDevframe({ baseURL: '/__hub/' })` discovers the WS endpoint via the Next route handler at `/__hub/__connection.json`, which starts the singleton host on demand.
Open the printed URL to see the docks, commands, messages, and terminals lists, plus a button that dispatches a sample command through `hub:commands:execute`.
29
29
30
+
## See also
31
+
32
+
-[Next Helper](/helpers/next) — the `@devframes/next` host bridge this example runs on
- A scoped context (`ctx.scope('devframe-streaming-chat')`) auto-namespaces every id.
13
+
- A scoped context (`ctx.scope('example:streaming-chat')`) auto-namespaces every id.
14
14
-`my.rpc.streaming.create('tokens', …)` registers a streaming channel for low-latency token rendering.
15
15
-`my.rpc.sharedState('history', …)` keeps the message log on the server; each `send` appends a user + assistant pair atomically.
16
16
- The producer streams tokens live, then commits the joined content back to shared state when done — so refreshes and new clients see the finished message immediately.
Copy file name to clipboardExpand all lines: docs/examples/vite-devframe-hub.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
outline: deep
3
3
---
4
4
5
-
# minimal-vite-devframe-hub
5
+
# vite-devframe-hub
6
6
7
7
A protocol-witness host: roughly 120 lines of Vite plugin code that wire [`@devframes/hub`](/guide/hub) into a Vite dev server. The browser UI is plain **vanilla TypeScript**, so nothing distracts from the hub protocol itself. Every framework's hub host follows the same shape.
Open the printed URL to see the docks, commands, messages, and terminals lists the hub exposes, plus a button that dispatches a sample command through `hub:commands:execute`.
That announcement is what the adapter attaches to. Both minimal hubs wire this end to end — see the "Tabbed Tool" in [`examples/minimal-vite-devframe-hub`](https://github.com/devframes/devframe/tree/main/examples/minimal-vite-devframe-hub) and [`examples/minimal-next-devframe-hub`](https://github.com/devframes/devframe/tree/main/examples/minimal-next-devframe-hub), including the SPA's `postMessage` shim.
189
+
That announcement is what the adapter attaches to. Both minimal hubs wire this end to end — see the "Tabbed Tool" in [`examples/vite-devframe-hub`](https://github.com/devframes/devframe/tree/main/examples/vite-devframe-hub) and [`examples/next-devframe-hub`](https://github.com/devframes/devframe/tree/main/examples/next-devframe-hub), including the SPA's `postMessage` shim.
Copy file name to clipboardExpand all lines: docs/guide/hub.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,7 +152,7 @@ Each mounted SPA is served at `/__<id>/` and references its assets relatively (`
152
152
exportdefault { skipTrailingSlashRedirect:true }
153
153
```
154
154
155
-
[`examples/minimal-next-devframe-hub/`](https://github.com/devframes/devframe/tree/main/examples/minimal-next-devframe-hub) is a working Next.js App Router host that mounts the built-in plugins this way.
155
+
[`examples/next-devframe-hub/`](https://github.com/devframes/devframe/tree/main/examples/next-devframe-hub) is a working Next.js App Router host that mounts the built-in plugins this way.
156
156
157
157
### Duplicate devframes
158
158
@@ -260,8 +260,8 @@ The hub also ships a headless browser runtime, `createDevframeClientHost()` from
260
260
261
261
Two minimal, copyable hubs mount every built-in plugin (git, terminals, code-server, inspect, a11y) behind an icon dock — the same shape [vite-devtools](https://github.com/vitejs/devtools) wears as the full Vite viewer, shrunk to the smallest thing you can build your own viewer from:
262
262
263
-
-[`examples/minimal-vite-devframe-hub/`](https://github.com/devframes/devframe/tree/main/examples/minimal-vite-devframe-hub) — a ~120-line Vite plugin host with a vanilla DOM UI.
264
-
-[`examples/minimal-next-devframe-hub/`](https://github.com/devframes/devframe/tree/main/examples/minimal-next-devframe-hub) — the same protocol hosted from a Next.js App Router app.
263
+
-[`examples/vite-devframe-hub/`](https://github.com/devframes/devframe/tree/main/examples/vite-devframe-hub) — a ~120-line Vite plugin host with a vanilla DOM UI.
264
+
-[`examples/next-devframe-hub/`](https://github.com/devframes/devframe/tree/main/examples/next-devframe-hub) — the same protocol hosted from a Next.js App Router app.
265
265
266
266
Both also mount a "Tabbed Tool" that demonstrates [shared-iframe soft navigation](./client-context#shared-iframe-soft-navigation) — one SPA whose tabs surface as separate docks sharing a single iframe.
0 commit comments