minimal-next-devframe-hub
The same hub protocol as the Vite host, hosted from a Next.js App Router app. It wires @devframes/hub by lazily starting a side-car RPC / WebSocket server from a Node route handler — proof that the hub is host-runtime-agnostic.
Package: minimal-next-devframe-hub · framework: React (Next.js)
What it proves
createHubContext()boots a hub without any Vite-specific code path.- A
DevframeHostimplementation plugs the Next host specifics into the hub uniformly. mountDevframe(ctx, def)registers anyDevframeDefinitionas a dock.- The built-in
hub:commands:executeRPC dispatches any registered server command, regardless of how the host was constructed. - 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. - The JSON-render hub integration with registry replacement: the host authors a view and projects it onto a
json-renderdock, and the React client renders it with a small in-example React registry (rather than the Vue@devframes/json-render-ui) — the path a non-Vue host uses.
Run it
sh
pnpm install
pnpm --filter minimal-next-devframe-hub devOpen the printed URL to see the docks, commands, messages, and terminals lists, plus a button that dispatches a sample command through hub:commands:execute.