Skip to content

refactor(devframe)!: relocate json-render from devframe to devtools-kit#327

Merged
antfu merged 1 commit intomainfrom
antfu/create-pr
May 11, 2026
Merged

refactor(devframe)!: relocate json-render from devframe to devtools-kit#327
antfu merged 1 commit intomainfrom
antfu/create-pr

Conversation

@antfu
Copy link
Copy Markdown
Member

@antfu antfu commented May 11, 2026

Description

JSON-render is a hub-layer concern: the spec is rendered by the Vite DevTools component catalog, the renderer handle is only consumable via a DevToolsViewJsonRender dock entry (a kit type), and every example pairs createJsonRenderer with ctx.docks.register({ type: 'json-render', ui }). This PR moves the types, the createJsonRenderer factory, and defineJsonRenderSpec from devframe to @vitejs/devtools-kit, restoring DevToolsNodeContext to a framework-neutral, single-integration surface as documented in CLAUDE.md §"Dep Boundary".

BREAKING: ctx.createJsonRenderer is no longer on DevToolsNodeContext. Consumers must use KitNodeContext (the type passed to Plugin.devtools.setup and to createPluginFromDevframe's options.setup). All in-repo consumers already run under kit.

Linked Issues

Additional context

The shared-state key stays devframe:json-render:${counter} for consistency with other kit-owned keys (devframe:docks, devframe:commands). Verified with pnpm lint && pnpm test && pnpm typecheck && pnpm build — 450/450 tests pass; tsnapi snapshots regenerated to drop the four names from devframe's public surface (kit's surface is unchanged, the names just resolve locally now).

JSON-render is a hub-layer concern: the spec is rendered by the
Vite DevTools component catalog, the renderer handle is only
consumable via a `DevToolsViewJsonRender` dock entry (kit type),
and every example pairs `createJsonRenderer` with
`ctx.docks.register({ type: 'json-render', ui })`. Move types,
factory, and `defineJsonRenderSpec` to `@vitejs/devtools-kit` so
the API lives in the package that owns the runtime contract;
`DevToolsNodeContext` is now framework-neutral as intended.

BREAKING: `ctx.createJsonRenderer` is no longer on
`DevToolsNodeContext`; use `KitNodeContext` (passed to
`Plugin.devtools.setup` and `createPluginFromDevframe`'s
`options.setup`). All in-repo consumers already run under kit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 11, 2026

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 79fd1d2
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a013182f513d90008ec3f8e
😎 Deploy Preview https://deploy-preview-327--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 11, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/devtools@327
npm i https://pkg.pr.new/@vitejs/devtools-kit@327
npm i https://pkg.pr.new/@vitejs/devtools-rolldown@327
npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@327

commit: 79fd1d2

@antfu antfu changed the title refactor(kit)!: relocate json-render from devframe to devtools-kit refactor(devframe)!: relocate json-render from devframe to devtools-kit May 11, 2026
@antfu antfu merged commit fdb3193 into main May 11, 2026
13 checks passed
@antfu antfu deleted the antfu/create-pr branch May 11, 2026 01:37
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.

1 participant