Skip to content

fix(json-render-ui): stop leaking frontend packages as runtime deps - #254

Merged
antfu merged 1 commit into
mainfrom
chore/json-render-ui-drop-frontend-deps
Aug 18, 2026
Merged

fix(json-render-ui): stop leaking frontend packages as runtime deps#254
antfu merged 1 commit into
mainfrom
chore/json-render-ui-drop-frontend-deps

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Intent

@devframes/json-render-ui declared 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/design styles. The only surface externalising those packages was the tsdown ./components library 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 ./components exports (published surface is now ./hub + ./spa); deleted the dependencies block (@json-render/vuedevDependencies); slimmed peerDependencies to @devframes/hub + devframe as optional, type-only peers (dropped vue and @devframes/json-render from peers).
  • tsdown.config.tsplatform: browsernode; dropped the index/components entries; rescoped neverBundle to the type-only references so the emitted .d.mts references those packages instead of inlining their type graphs.
  • Removed the stale index/components tsnapi snapshots, refreshed the knip.jsonc comment, and rewrote the docs sections that referenced the removed exports (docs/guide/json-render.md, docs/guide/client-context.md).

Wins

  • Runtime dependencies: 1 → 0 (now matches @devframes/hub-ui); @antfu/design is no longer an undeclared runtime peer.
  • dist/spa.d.mts: 3150 → 32 lines — references devframe instead of inlining its whole type universe; 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 (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-package typecheck for json-render-ui/hub/hub-ui/json-render all green.

Note: a pre-existing, unrelated pnpm typecheck failure in @devframes/plugin-git (devframe/utils/get-port missing from alias.ts paths at main) is untouched by this change.

This PR was created with the help of an agent.

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.
@netlify

netlify Bot commented Aug 18, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 1ac595f
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a83ad6f87f28400088f130b
😎 Deploy Preview https://deploy-preview-254--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.

@antfu antfu changed the title chore(json-render-ui)!: stop leaking frontend packages as runtime deps fix(json-render-ui): stop leaking frontend packages as runtime deps Aug 18, 2026
@antfu
antfu merged commit c549b68 into main Aug 18, 2026
12 checks passed
@antfu
antfu deleted the chore/json-render-ui-drop-frontend-deps branch August 18, 2026 01:39
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.

2 participants