Skip to content

fix(hub): restore ctx.createJsonRenderer as a working 0.7 deprecation, remove in 0.8#125

Merged
antfu merged 1 commit into
mainfrom
fix/restore-ctx-create-json-renderer
Jul 22, 2026
Merged

fix(hub): restore ctx.createJsonRenderer as a working 0.7 deprecation, remove in 0.8#125
antfu merged 1 commit into
mainfrom
fix/restore-ctx-create-json-renderer

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Why

0.7 removed ctx.createJsonRenderer outright (docs/guide/migration-0.7.md), while #122 only restored defineJsonRenderSpec and the associated types as deprecated compatibility shims — ctx.createJsonRenderer itself was left broken with no deprecation window. A 0.7 minor shouldn't hard-break a public method; that's what 0.8 is for.

What

  • Restores ctx.createJsonRenderer on DevframeHubContext, reimplemented against its exact pre-0.7 logic (auto-incrementing devframe:json-render:<n> shared-state key, updateSpec/updateState/_stateKey).
  • Kept fully self-contained against context.rpc.sharedState rather than delegating to @devframes/json-render's createJsonRenderView, so @devframes/hub still carries zero dependency — direct or peer — on that opt-in package. (@devframes/json-render already peer-depends on @devframes/hub for its dock-type augmentation; wiring the reverse direction would create a real circular workspace build dependency, since turbo.json already orders @devframes/json-render#build after @devframes/hub#build.)
  • Aligns the deprecation language across context.ts, define.ts, types/json-render.ts, types/docks.ts, and the migration guide: everything in this compatibility surface (ctx.createJsonRenderer, defineJsonRenderSpec, JsonRenderSpec/JsonRenderElement/JsonRenderer) is now consistently documented as "removed in 0.8" instead of an unspecified future release.
  • Adds coverage in context.test.ts for the spec/state round-trip and per-renderer state-key uniqueness.

Verified

  • pnpm --filter @devframes/hub typecheck/lint clean
  • pnpm build for devframe, @devframes/hub, @devframes/json-render, @devframes/json-render-ui — no circular-dependency issues
  • Full @devframes/hub vitest suite (85 tests) passes
  • @devframes/hub tsnapi export snapshots (10 tests) pass unchanged

Created with the help of an agent.

…, remove in 0.8

0.7 hard-removed ctx.createJsonRenderer instead of deprecating it, breaking
existing call sites without a migration window. Restore it against hub's
own pre-0.7 shared-state implementation (not @devframes/json-render, which
would create a circular workspace dependency since json-render already
depends on hub) so it keeps working through the 0.7 series. Mark it, and
the related defineJsonRenderSpec/JsonRenderSpec/JsonRenderElement/JsonRenderer
aliases, as removed in 0.8 instead of an unspecified future release.
@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 5330cbc
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a6067c2e78570000873045b
😎 Deploy Preview https://deploy-preview-125--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 merged commit ffbda00 into main Jul 22, 2026
12 checks passed
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