feat(json-render): client-only json-render docks via an inline view spec#131
Merged
Conversation
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…eamVersion
The `json-render` dock's `view` field now accepts either `{ stateKey }`
(subscribe to a live shared state) or `{ spec }` (an inline spec rendered
directly), so a client host can synthesize a view entirely in the browser
with no shared-state round-trip. Both dock renderers (Vue + the example's
React registry) render the inline spec statically and keep subscribing for
the shared-state variant.
Removes the `upstreamVersion` field and the `JSON_RENDER_UPSTREAM_VERSION`
export along with the renderer's version-mismatch warning, simplifying the
serializable view contract.
BREAKING CHANGE: `JsonRenderViewRef` no longer carries `upstreamVersion`;
`JSON_RENDER_UPSTREAM_VERSION` and the `JsonRenderView` `upstreamVersion`
prop are removed.
Turns the inline client-authored view into a small interactive playground: `$bindState` text/switch inputs write into the view's own state, `$state` reads mirror them live, and Add / Clear buttons drive the built-in `pushState` / `setState` actions to mutate a notes list that re-renders — all client-side, with no server and no shared state. Applied to both the Vite (Vue) and Next (React) hub shells.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Lets a client host register a client-only
json-renderdock whose view is authored entirely in the browser, and reshapes thejson-renderview contract to make that ergonomic.Builds on #129 (client-only
docks.register()).Changes
Library (
@devframes/json-render,@devframes/json-render-ui)JsonRenderViewRefis now a union:{ stateKey }(subscribe to a live shared state — whatcreateJsonRenderViewproduces) or{ spec }(an inline spec rendered directly, no shared-state round-trip). NewJsonRenderViewStateRef/JsonRenderViewInlineReftypes are exported.createJsonRenderDockRenderer, and the example's mini React registry) render the inline spec statically and keep subscribing for the shared-state variant.upstreamVersionfield, theJSON_RENDER_UPSTREAM_VERSIONexport, and the renderer's version-mismatch warning /upstreamVersionprop — simplifying the serializable view contract.Examples
minimal-vite-devframe-hub,minimal-next-devframe-hub) register a client-onlyjson-renderdock ("Client Metrics") whose spec is carried inline (view: { spec }) — no shared state, never syncing to the hub or other viewers — alongside the client-only iframe dock.Docs / tests
create-viewand client-host renderer tests updated; tsnapi API snapshots regenerated.Verification
pnpm typecheck,pnpm lint,pnpm build, and the fullvitestsuite (852 tests) all pass; both example apps build.BREAKING CHANGE:
JsonRenderViewRefno longer carriesupstreamVersion;JSON_RENDER_UPSTREAM_VERSIONand theJsonRenderViewupstreamVersionprop are removed.This PR was created with the help of an agent.