Skip to content

feat(hub-ui): render json-render via the iframe view provider - #187

Closed
antfubot wants to merge 1 commit into
feat/hub-view-providersfrom
feat/hub-ui-view-provider-iframe
Closed

feat(hub-ui): render json-render via the iframe view provider#187
antfubot wants to merge 1 commit into
feat/hub-view-providersfrom
feat/hub-ui-view-provider-iframe

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

PR D of the json-render view-provider stack (plan: plans/json-render-ui-packaging.md). Stacked on #186.

Replaces hub-ui's inline Vue json-render renderer with the hub's iframe view-provider mechanism, so json-render composes with the hub UI as host + injected iframe provider — framework-agnostically.

  • ViewProvider.vue — renders a provider-backed dock (json-render, and any future provider type) in a chromeless pooled iframe pointed at the registered provider SPA, passing the dock's view as ?view=<stateKey>. Inline specs are materialized into an ephemeral shared-state key so the iframe always gets a stateKey. One pooled iframe per view.
  • No-provider empty state — when no provider is registered for the type, a placeholder explains how to add one.
  • state/view-providers.ts — reads the hub's devframe:view-providers shared state (from PR C).
  • Deletes the inline src/client/json-render/ (registry + 17 components) and ViewJsonRender.vue; drops the now-moot --jr-primary bridge (json-render themes itself in its own SPA) and the unused @json-render/core|vue deps.

Verified: workspace typecheck (26 pkgs), eslint, knip, build:css, build (embedded + standalone), build-storybook; hub-ui public API snapshot unchanged.

Requires a registered json-render provider at runtime (PR E wires jsonRenderProvider() into the examples); without one, json-render docks show the placeholder by design.

Created with the help of an agent.

Replaces hub-ui's inline Vue json-render renderer with the hub's iframe
view-provider mechanism:

- New ViewProvider.vue renders a provider-backed dock (json-render, and any
  future provider type) in a chromeless pooled iframe pointed at the registered
  provider SPA, passing the dock's view as ?view=<stateKey> (inline specs are
  materialized into an ephemeral shared-state key). One pooled iframe per view.
- Shows a built-in empty state when no provider is registered for the type.
- state/view-providers.ts reads the hub's devframe:view-providers shared state.
- Deletes the inline src/client/json-render/ (registry + 17 components) and
  ViewJsonRender.vue; drops the now-moot --jr-primary bridge (json-render themes
  itself in its own SPA) and the unused @json-render/core|vue deps.

json-render now composes with the hub UI as host + injected iframe provider,
framework-agnostically.
@antfu
antfu force-pushed the feat/hub-ui-view-provider-iframe branch from 6638a55 to ca8ddbd Compare August 10, 2026 04:55
@antfu antfu closed this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants