fix(json-render-ui): stop leaking frontend packages as runtime deps - #254
Merged
Conversation
The reference Vue frontend is delivered only as self-contained prebuilt bundles — the standalone SPA (`/spa`) and the hub renderer module (`/hub`), each inlining Vue, the upstream renderer, and the compiled @antfu/design styles. The tsdown `.`/`components` library entries were the only surface that externalised those frontend packages, yet nothing consumes them at runtime. Drop the `.` and `./components` exports so the package ships zero runtime frontend dependencies: `@json-render/vue` moves to devDependencies (bundled into the Vite artifacts), `vue`/`@devframes/json-render` leave the peer set, and the node-safe entries keep only `@devframes/hub` + `devframe` as optional, type-only peers. Also switch tsdown to the node platform and scope `neverBundle` to the type-only references, so `dist/spa.d.mts` references `devframe` instead of inlining its entire type graph (3150 -> 32 lines) and the build no longer walks devframe's server source. BREAKING CHANGE: `@devframes/json-render-ui` no longer exports `.` or `./components`. `JsonRenderView`, `createRenderer`, the component exports, and `createJsonRenderDockRenderer` are no longer importable; consume the Vue frontend via the prebuilt `/spa` SPA or the `/hub` renderer module, and build custom frontends against the `@devframes/json-render/hub` contract. Created with the help of an agent.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Intent
@devframes/json-render-uideclared frontend packages as runtime dependencies that never needed to ship. Both browser artifacts anything actually consumes — the standalone SPA (/spa) and the hub renderer module (/hub) — are already self-contained Vite bundles that inline Vue, the upstream renderer, and the compiled@antfu/designstyles. The only surface externalising those packages was the tsdown./componentslibrary entries, which nothing in the repo consumes at runtime.This drops those two entries so the package ships zero runtime frontend dependencies, and re-scopes the tsdown config to the node-safe entries it actually keeps.
What changed
package.json— removed the.and./componentsexports (published surface is now./hub+./spa); deleted thedependenciesblock (@json-render/vue→devDependencies); slimmedpeerDependenciesto@devframes/hub+devframeas optional, type-only peers (droppedvueand@devframes/json-renderfrom peers).tsdown.config.ts—platform: browser→node; dropped theindex/componentsentries; rescopedneverBundleto the type-only references so the emitted.d.mtsreferences those packages instead of inlining their type graphs.index/componentstsnapi snapshots, refreshed theknip.jsonccomment, and rewrote the docs sections that referenced the removed exports (docs/guide/json-render.md,docs/guide/client-context.md).Wins
dependencies: 1 → 0 (now matches@devframes/hub-ui);@antfu/designis no longer an undeclared runtime peer.dist/spa.d.mts: 3150 → 32 lines — referencesdevframeinstead of inlining its whole type universe; the build no longer walks devframe's server source.Breaking change
@devframes/json-render-uino longer exports.or./components.JsonRenderView,createRenderer, the component exports, andcreateJsonRenderDockRendererare no longer importable. Consume the Vue frontend via the prebuilt/spaSPA or the/hubrenderer module, and build custom frontends against the@devframes/json-render/hubcontract (see the Next hub example).Verification
pnpm build(23/23),pnpm lint,pnpm knip,pnpm exec vitest run(1163 passed, incl. tsnapi export snapshots), and per-packagetypecheckforjson-render-ui/hub/hub-ui/json-renderall green.This PR was created with the help of an agent.