Skip to content

fix(hub): restore json-render pre-0.7 exports as deprecated aliases#122

Merged
antfu merged 1 commit into
mainfrom
fix/restore-define-json-render-spec-deprecated
Jul 22, 2026
Merged

fix(hub): restore json-render pre-0.7 exports as deprecated aliases#122
antfu merged 1 commit into
mainfrom
fix/restore-define-json-render-spec-deprecated

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

What

PR #116 moved json-render out of `@devframes/hub` into the opt-in `@devframes/json-render` integration and deleted `defineJsonRenderSpec`, `JsonRenderSpec`, `JsonRenderElement`, `JsonRenderer`, and `DevframeViewJsonRender` outright — unlike the `cac` adapter rename in the same release, which kept `createCli` around as a deprecated alias. Any consumer still importing the old json-render names hit a hard `SyntaxError` at module load:

```
SyntaxError: The requested module '@devframes/hub' does not provide an export named 'defineJsonRenderSpec'
```

Fix

Restore all five as deprecated compatibility shims, following the same pattern already used for `createCli`/`createCac`:

  • `defineJsonRenderSpec` is back as an identity function, tagged `@deprecated` and pointing callers at `createJsonRenderView` (`@devframes/json-render/node`).
  • `JsonRenderSpec`, `JsonRenderElement`, and `JsonRenderer` are restored in `packages/hub/src/types/json-render.ts`, each tagged `@deprecated` with its `@devframes/json-render` equivalent.
  • `DevframeViewJsonRender` is restored as a standalone type but deliberately not rejoined to `DevframeDockUserEntry`/`DevframeDockEntryRegistry` — that union now takes its `'json-render'` member from `@devframes/json-render/hub`'s declaration merge (a different shape, `view: JsonRenderViewRef` vs. the old `ui: JsonRenderer`), and re-adding it there would conflict with that merge.
  • Documented the change in `docs/guide/migration-0.7.md` alongside the existing `cac` section, with a before/after table.

Verified `@devframes/hub`'s and `@devframes/json-render`'s `tsc --noEmit` both pass with no declaration-merge conflict, and confirmed the built `dist/index.mjs` now exports a working `defineJsonRenderSpec` again.

Checks

`pnpm lint && pnpm test && pnpm typecheck && pnpm build` all pass (updated the `tsnapi` API snapshots for the five restored exports).


This PR was created with the help of an agent.

PR #116 removed `defineJsonRenderSpec`, `JsonRenderSpec`,
`JsonRenderElement`, `JsonRenderer`, and `DevframeViewJsonRender` from
`@devframes/hub` outright when json-render moved to the opt-in
`@devframes/json-render` integration, breaking any consumer still
importing them (unlike the `cac` adapter rename, which kept a deprecated
`createCli` alias).

Restore all five as deprecated compatibility shims — `defineJsonRenderSpec`
stays an identity function, and `DevframeViewJsonRender" is kept as a
standalone type without rejoining `DevframeDockUserEntry`, so it can't
clash with `@devframes/json-render/hub`'s declaration-merged `'json-render'`
registry entry.

Document the migration in the 0.7 guide alongside the cac adapter section.
@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit c9ae260
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a604d907274c60009f9ca2d
😎 Deploy Preview https://deploy-preview-122--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 3e0f825 into main Jul 22, 2026
12 checks passed
@antfu
antfu deleted the fix/restore-define-json-render-spec-deprecated branch July 22, 2026 04:58
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