@@ -89,8 +89,44 @@ validation.
8989
9090## Rendering standalone
9191
92- The app supplies the frontend lib and devframe serves its SPA. Connect, read the
93- view's shared state, and render it with ` JsonRenderView ` :
92+ ### Out-of-box SPA (no client build)
93+
94+ ` @devframes/json-render-ui/spa ` ships a prebuilt renderer, so an app serves a
95+ JSON-render UI without authoring or building any client. Wrap the definition
96+ with ` createJsonRenderDevframe ` — it points ` cli.distDir ` at the shipped SPA
97+ (` jsonRenderSpaDir ` ) and sets ` spa.loader: 'none' ` :
98+
99+ ``` ts
100+ import { createJsonRenderDevframe } from ' @devframes/json-render-ui/spa'
101+ import { createJsonRenderView } from ' @devframes/json-render/node'
102+
103+ export default createJsonRenderDevframe ({
104+ id: ' my-app' ,
105+ name: ' My App' ,
106+ version ,
107+ packageName ,
108+ homepage ,
109+ description ,
110+ cli: { command: ' my-app' , port: 9800 },
111+ setup(ctx ) {
112+ createJsonRenderView (ctx , { id: ' main' , title: ' Dashboard' , spec })
113+ },
114+ })
115+ ```
116+
117+ The SPA discovers views from the ** view index** (` JSON_RENDER_INDEX_KEY ` ), a
118+ shared state the node factory maintains as views are created and disposed. A
119+ single view renders full-bleed on its own; once more than one view is
120+ registered, a top bar appears with the shared segmented switcher, labelling each
121+ view with its ` title ` (defaulting to the view id). The
122+ ` @devframes/json-render-ui/spa ` entry is node-safe — it exposes only the asset
123+ path and the wiring helper, pulling in no Vue.
124+
125+ ### Custom frontend
126+
127+ To render with your own client, supply the frontend lib and let devframe serve
128+ its SPA. Connect, read the view's shared state, and render it with
129+ ` JsonRenderView ` :
94130
95131``` ts
96132import { JSON_RENDER_UPSTREAM_VERSION } from ' @devframes/json-render'
@@ -185,5 +221,11 @@ A third party replaces the whole registry — pass a custom `registry` to
185221` @devframes/json-render-ui ` is the reference implementation, not a hard
186222dependency of the protocol; the hub acquires no Vue.
187223
224+ A frontend need not implement every component. When a spec references a
225+ component the active registry lacks, the renderer isolates that element behind a
226+ placeholder — showing the component type and a gist of its prop keys (`{ label,
227+ onPress }` ) — and logs a ` console.warn`, while the rest of the view renders
228+ normally.
229+
188230See the [ ` minimal-json-render ` example] ( /examples/minimal-json-render ) for a
189231runnable end-to-end app.
0 commit comments