Repository navigation
feat(kit)!: move json-render to @vitejs/devtools - #604
Merged
Merged
Conversation
`@devframes/json-render` pulled `@json-render/core` and `zod` (~7.4 MB) into every `@vitejs/devtools-kit` install, more than all of kit's other dependencies combined. Vite DevTools is the only host that creates the kit context, so it now owns the dependency and attaches `ctx.createJsonRenderer()` itself, typing it onto `KitNodeContext` via module augmentation. Plugins running under `@vitejs/devtools` keep working unchanged. Authors who import `JsonRenderSpec` / `JsonRenderer` / `defineJsonRenderSpec` now take them from `@vitejs/devtools` instead of the kit. BREAKING CHANGE: `@vitejs/devtools-kit` no longer exports `defineJsonRenderSpec`, `JsonRenderSpec`, `JsonRenderElement`, `JsonRenderer`, `JsonRenderView`, `JsonRenderViewRef` or `DevToolsViewJsonRender`; import them from `@vitejs/devtools`.
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
…nder Keeps the root entry focused on the plugin and hub API. The root still loads the `KitNodeContext.createJsonRenderer` augmentation so plugin authors who only import `DevTools()` keep the typed method.
webfansplz
approved these changes
Oct 7, 2026
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
Shrinks the install footprint of
@vitejs/devtools-kitby moving@devframes/json-renderout of it.@devframes/json-renderpulls@json-render/core(1.2 MB) andzod(5.9 MB) — about 7.4 MB, more than all of kit's other dependencies combined (devframe+@devframes/hub+ the rest ≈ 1.4 MB).@devframes/hubdoes not depend on it, andcreateKitContextis only ever called by Vite DevTools, so core is the natural owner.What changes:
@devframes/json-renderdependency, thecreateJsonRenderermember onKitNodeContext,defineJsonRenderSpec, and theJsonRender*/DevToolsViewJsonRendertype re-exports. Kit'sdist/has no json-render reference left.@devframes/json-render, attachesctx.createJsonRenderer()increateDevToolsContext, and types it ontoKitNodeContextwithdeclare module '@vitejs/devtools-kit'.@vitejs/devtools/json-renderexportsdefineJsonRenderSpecand theJsonRenderSpec/JsonRenderElement/JsonRenderer/JsonRenderView/JsonRenderViewRef/DevToolsViewJsonRendertypes. The root entry still loads the augmentation, so anyone importingDevTools()invite.config.tskeeps the typedctx.createJsonRenderer.examples/plugin-git-ui,docs/kit/json-render.md, and the kit skill import the types from the new subpath.TSNAPI_ALLOW_BREAKING=1).Plugins that call
ctx.createJsonRenderer()under Vite DevTools keep working with no code change.BREAKING CHANGE (kit only):
defineJsonRenderSpec,JsonRenderSpec,JsonRenderElement,JsonRenderer,JsonRenderView,JsonRenderViewRefandDevToolsViewJsonRenderare no longer exported from@vitejs/devtools-kit. Import them from@vitejs/devtools/json-render.Linked Issues
Additional context
Reviewers: the one design point worth a look is
packages/core/src/node/json-render.ts— thedeclare module '@vitejs/devtools-kit'augmentation merges through kit'sexport type *re-export ofKitNodeContext(verified byvue-tsc -band in the built.d.ts, where root and subpath share the chunk carrying it).local-pkg(≈1 MB viamlly/acorn) was considered and intentionally kept.Created with the help of an agent.