feat(kit): adopt @devframes/json-render (devframe v0.7.9)#454
Merged
Conversation
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
devframe 0.7.6 extracts json-render out of @devframes/hub into the opt-in @devframes/json-render package, so the hub no longer ships createJsonRenderer, defineJsonRenderSpec, or the JsonRender* types. Rewire the kit onto the new package while preserving the kit's public API: - ctx.createJsonRenderer(spec) is now backed by createJsonRenderView; the returned handle keeps updateSpec/updateState/_stateKey and defines its methods non-enumerably so it stays serializable on a json-render dock entry. - Re-map the JsonRenderSpec/JsonRenderElement types onto @devframes/json-render and register the kit's json-render dock entry into the hub dock registry. - Provide the client-side dock-renderer registry now required by the hub 0.7.6 DocksContext. The in-house webcomponents registry stays (no @devframes/json-render-ui), but its components now speak the @devframes/json-render base-catalog vocabulary, since createJsonRenderView validates element props against that catalog at ingress. Update the git-ui example, docs, and stories to the base prop names. Created with the help of an agent.
Bump devframe, @devframes/hub, @devframes/json-render, and the built-in
@devframes/plugin-* integrations to 0.7.9.
devframe/hub 0.7.6 → 0.7.9 has no functional change to the public API we
consume — the dist output is otherwise identical (the zod → valibot
migration mentioned in devframe's own dependency list is an internal
implementation detail that doesn't cross the public surface). The one
adaptation required: hub 0.7.9 re-added its own deprecated `createJsonRenderer`
/ `JsonRenderSpec` / `JsonRenderer` on `DevframeHubContext` as a back-compat
shim for pre-0.7 call sites ("kept working... will be removed in 0.8"), typed
against the hub's own looser (optional `props`) spec shape. That collides with
the kit's `createJsonRenderer`, which is intentionally typed against
`@devframes/json-render`'s stricter `Spec` (the non-deprecated, recommended
surface we already adopted):
- `KitNodeContext` now extends `Omit<DevframeHubContext, 'createJsonRenderer'>`
before redeclaring its own factory, since the hub's deprecated property
makes the plain `extends` an invalid override.
- `createPluginFromDevframe` casts through `DevframeHubContext` at the
`mountDevframe` call site (which never calls `createJsonRenderer`) rather
than widening the kit's own factory's type.
`@devframes/json-render` itself only gained an optional per-view `title`
(published to a new opt-in shared-state "view index" for multi-view
frontends) — additive and irrelevant to the kit's single-ref-per-dock usage.
An element whose `type` has no entry in the in-house registry — a spec authored against a newer base-catalog version than this client implements, a third-party catalog extension, or a plain typo — silently rendered nothing: upstream `@json-render/vue` only logs a console warning and returns `null` when `registry[type]` is missing. Add `UnsupportedComponent`, wired as `<Renderer>`'s upstream `fallback` prop (already supported by `@json-render/vue`, just previously unused here) in both `ViewJsonRender.vue` and the Storybook gallery. An unrenderable element now degrades to a visible, inspectable placeholder — the element's `type` name in a dashed warning-colored box — instead of disappearing. Also adds a dedicated `UnsupportedComponentFallback` story and a short note in the json-render docs.
antfubot
force-pushed
the
frank-peaches-unite
branch
from
July 22, 2026 08:03
9708c33 to
199bbef
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.
Description
devframe 0.7.6 extracted the json-render layer out of
@devframes/hubinto the opt-in@devframes/json-renderpackage. This PR rewires Vite DevTools onto the new package (now upgraded through 0.7.9) while keeping the kit's public API stable and without pulling in@devframes/json-render-ui— the in-house webcomponents registry stays.Kit (node/types)
ctx.createJsonRenderer(spec)is now backed bycreateJsonRenderViewfrom@devframes/json-render/node. The returned handle keepsupdateSpec/updateState/_stateKey, and its methods are defined non-enumerably so the handle stays fully serializable when carried on ajson-renderdock entry'suifield.JsonRenderSpec/JsonRenderElementre-map onto@devframes/json-render;defineJsonRenderSpecbecomes a kit-local identity helper (the hub dropped it).json-renderdock entry into the hub's open dock registry.createJsonRenderer/JsonRenderSpec/JsonRendereronDevframeHubContextas a back-compat shim for pre-0.7 call sites ("kept working... will be removed in 0.8"), typed against a looser (optionalprops) spec shape than ours.KitNodeContextnow extendsOmit<DevframeHubContext, 'createJsonRenderer'>before redeclaring its own (stricter, non-deprecated) factory, andcreatePluginFromDevframecasts throughDevframeHubContextat themountDevframecall site (which never callscreateJsonRenderer) instead of widening the kit's own type. No other functional change was needed between hub/devframe 0.7.6 and 0.7.9 — verified by diffing the publisheddist/of both.Core (client)
DocksContext.@devframes/json-renderbase-catalog vocabulary —createJsonRenderViewvalidates element props against that catalog at ingress, so specs must use the base prop names (e.g. Stackdirection: 'row' | 'column', Texttext, Badgevariant: 'danger', KeyValueTabledata, DataTable/CodeBlockheight, TreedefaultExpanded).typewith no entry in the registry (a spec authored against a newer base-catalog version than this client implements, a third-party catalog extension, or a typo) previously rendered nothing —@json-render/vue's<Renderer>only logs a console warning and returnsnull. AddedUnsupportedComponent, wired as<Renderer>'s upstreamfallbackprop, so an unrenderable element now degrades to a visible, inspectable placeholder instead of silently disappearing. Includes a dedicated Storybook story and a docs note.catalog.ts/index.tsare removed.Example / docs / stories updated to the base-catalog prop names.
Verified with
pnpm typecheck && pnpm test && pnpm lint && pnpm build(export API snapshots for@vitejs/devtools-kitrefreshed to match the new surface).Linked Issues
Additional context
Reviewers may want to focus on: the serializability of the
JsonRendererhandle on dock entries (non-enumerable methods), the base-catalog vocabulary alignment of the in-house components, and theOmit<DevframeHubContext, 'createJsonRenderer'>type fix for hub 0.7.9's back-compat shim.This PR was created with the help of an agent.