feat(hub): generic view-provider mechanism - #186
Closed
antfubot wants to merge 1 commit into
Closed
Conversation
…hared state)
A dock view *type* can resolve to a swappable iframe provider SPA:
- initHub({ viewProviders: { <type>: DevframeDefinition } }) mounts each
provider's SPA at <base><id>/ (serving its connection meta + statics) and
publishes <type> -> { base } to the read-only devframe:view-providers shared
state a UI reads to resolve the iframe URL (and to detect 'no provider').
- mountDevframe gains registerDock?: boolean; mountViewProvider(ctx, type, def)
is the reusable primitive (used by initHub, callable on the manual
createHubContext path). The headless core ships no provider — the reference
json-render provider comes from @devframes/json-render-ui.
- Keeps the in-process renderers seam untouched.
Adds VIEW_PROVIDERS_STATE_KEY + DevframeViewProviders types.
antfu
force-pushed
the
feat/hub-view-providers
branch
from
August 10, 2026 04:55
95e077b to
7f6fbee
Compare
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.
PR C of the json-render view-provider stack (plan:
plans/json-render-ui-packaging.md). Stacked on #185.Adds the generic mechanism that lets a dock view type resolve to a swappable iframe provider SPA — decoupling renderers from the hub UI's framework.
initHub({ viewProviders: { <type>: DevframeDefinition } })— mounts each provider's SPA at<base><id>/(serving its connection meta + statics) without a dock of its own, and publishes<type> → { base }to a read-onlydevframe:view-providersshared state a UI reads to resolve the iframe URL and to detect "no provider".mountViewProvider(ctx, type, def, { base })— the reusable primitive (used byinitHub; callable directly on the manualcreateHubContext+mountDevframepath).mountDevframegainsregisterDock?: boolean.@devframes/json-render-ui(jsonRenderProvider(), feat(json-render-ui): provider SPA (single-view + theming + provider factory) #185). The in-processrenderersseam is untouched (kept for custom in-process types).Adds
VIEW_PROVIDERS_STATE_KEY(@devframes/hub/constants) +DevframeViewProviderstypes (@devframes/hub/types).Verified: workspace typecheck (26 pkgs), eslint, build, a new
mountViewProvidertest (no dock + shared-state entry), additive API snapshots.Created with the help of an agent.