mirror of
https://github.com/vercel-labs/json-render.git
synced 2026-10-04 04:48:17 +08:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24bf78cfd0 |
+20
-2
@@ -1,8 +1,27 @@
|
||||
# Changelog
|
||||
|
||||
## 0.19.1
|
||||
|
||||
<!-- release:start -->
|
||||
### Bug Fixes
|
||||
|
||||
- **zod 4.4+ compatibility** — `@json-render/core` and `@json-render/shadcn-svelte` listed zod in both `dependencies` and `peerDependencies`, which could give the library its own zod copy distinct from your app's. zod 4 embeds a version literal in its types, so the duplicate copies surfaced as `Type '4' is not assignable to type '3'` errors on `_zod.version.minor` and blocked upgrading to zod 4.4+. zod is now a peer-only dependency, so your app's zod is always the single copy (#297, #303)
|
||||
- **`visible` validation on zod 4.4+** — `catalog.validate()` accepted specs that omit an element's `visible` field on zod 4.3 but rejected them on zod 4.4+, where `z.any()` object keys became non-optional. `visible` is now explicitly optional so all zod 4.x versions agree (#287, #299)
|
||||
- **Dangling children autofix** — `autoFixSpec` now prunes `children` references to elements that don't exist in the spec, the dominant remaining first-attempt validation failure for AI-generated specs. The renderer already skipped missing children at runtime, so pruning renders identically while letting the spec validate; each removal is reported in `fixes` (#300)
|
||||
- **PDF and image render types** — Fixed `Buffer`/`Uint8Array` type errors in `@json-render/image`'s `renderToPng` and `@json-render/react-pdf`'s `renderToBuffer` under current `@types/node`, and corrected `renderToStream`'s declared return type to `NodeJS.ReadableStream`, which is what `@react-pdf/renderer` actually returns (#304)
|
||||
|
||||
### Improvements
|
||||
|
||||
- **Prompt rules for children** — The default prompt now states explicitly that every element must include a `children` array (`[]` for leaves), which models otherwise omitted on roughly a third of first attempts (#299)
|
||||
- **Harness agent chat example** — New `examples/harness-chat` demo running a coding agent (Claude Code, Codex, or Pi) in a Vercel Sandbox via the AI SDK `HarnessAgent` API, rendering its work reports as json-render generative UI instead of markdown (#302)
|
||||
|
||||
### Contributors
|
||||
|
||||
- @ctate
|
||||
<!-- release:end -->
|
||||
|
||||
## 0.19.0
|
||||
|
||||
<!-- release:start -->
|
||||
### New Features
|
||||
|
||||
- **Custom directives API** — `@json-render/core` now supports custom directives via `defineDirective`, letting you declare new JSON shapes (like `$format`, `$math`) that resolve to computed values at render time. Directives compose naturally — nest `$format` over `$math` over `$state` and they resolve inside-out. All four renderers (React, Vue, Svelte, Solid) have built-in directive resolution (#279)
|
||||
@@ -15,7 +34,6 @@
|
||||
### Contributors
|
||||
|
||||
- @ctate
|
||||
<!-- release:end -->
|
||||
|
||||
## 0.18.0
|
||||
|
||||
|
||||
@@ -5,6 +5,30 @@ export const metadata = pageMetadata("docs/changelog")
|
||||
|
||||
Notable changes and updates to json-render.
|
||||
|
||||
## v0.19.1
|
||||
|
||||
July 1, 2026
|
||||
|
||||
### Fixed: zod 4.4+ compatibility
|
||||
|
||||
`@json-render/core` and `@json-render/shadcn-svelte` listed zod in both `dependencies` and `peerDependencies`, which could give the library its own zod copy distinct from your app's. zod 4 embeds a version literal in its types, so the duplicate copies surfaced as `Type '4' is not assignable to type '3'` errors on `_zod.version.minor` and blocked upgrading to zod 4.4+. zod is now a peer-only dependency, so your app's zod is always the single copy.
|
||||
|
||||
Relatedly, `catalog.validate()` accepted specs that omit an element's `visible` field on zod 4.3 but rejected them on zod 4.4+, where `z.any()` object keys became non-optional. `visible` is now explicitly optional so all zod 4.x versions agree.
|
||||
|
||||
### Fixed: dangling children autofix
|
||||
|
||||
`autoFixSpec` now prunes `children` references to elements that don't exist in the spec -- the dominant remaining first-attempt validation failure for AI-generated specs. The renderer already skipped missing children at runtime, so pruning renders identically while letting the spec validate; each removal is reported in `fixes`.
|
||||
|
||||
### Fixed: PDF and image render types
|
||||
|
||||
Fixed `Buffer`/`Uint8Array` type errors in `@json-render/image`'s `renderToPng` and `@json-render/react-pdf`'s `renderToBuffer` under current `@types/node`, and corrected `renderToStream`'s declared return type to `NodeJS.ReadableStream`, which is what `@react-pdf/renderer` actually returns.
|
||||
|
||||
### New: harness agent chat example
|
||||
|
||||
New `examples/harness-chat` demo running a coding agent (Claude Code, Codex, or Pi) in a Vercel Sandbox via the AI SDK `HarnessAgent` API, rendering its work reports as json-render generative UI instead of markdown.
|
||||
|
||||
---
|
||||
|
||||
## v0.19.0
|
||||
|
||||
May 6, 2026
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/codegen",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Utilities for generating code from json-render UI trees",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/core",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "JSON becomes real things. Define your catalog, register your components, let AI generate.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/devtools-react",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "React adapter for @json-render/devtools. Drop-in <JsonRenderDevtools /> component.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/devtools-solid",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "SolidJS adapter for @json-render/devtools. Drop-in <JsonRenderDevtools /> component.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/devtools-svelte",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Svelte adapter for @json-render/devtools. Drop-in <JsonRenderDevtools /> component.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/devtools-vue",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Vue adapter for @json-render/devtools. Drop-in <JsonRenderDevtools /> component.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/devtools",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Framework-agnostic devtools core for json-render: event store, panel UI, picker, stream taps.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/directives",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Pre-built directives for @json-render/core — $format, $math, $concat, $count, $truncate, $pluralize, $join, and $t (i18n).",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/image",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Image renderer for @json-render/core. JSON becomes SVG and PNG images via Satori.",
|
||||
"keywords": [
|
||||
|
||||
@@ -206,6 +206,5 @@ export async function renderToPng(
|
||||
|
||||
const resvg = new Resvg(svg);
|
||||
const pngData = resvg.render();
|
||||
const png = pngData.asPng();
|
||||
return new Uint8Array(png.buffer, png.byteOffset, png.byteLength);
|
||||
return pngData.asPng();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/ink",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Ink terminal renderer for @json-render/core. JSON becomes terminal UIs.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/jotai",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Jotai adapter for json-render StateStore",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/mcp",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "MCP Apps integration for @json-render/core. Serve json-render UIs as interactive MCP Apps in Claude, ChatGPT, Cursor, and VS Code.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/next",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Next.js renderer for @json-render/core. JSON becomes full Next.js applications with routes, layouts, metadata, and SSR.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/react-email",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "React Email renderer for @json-render/core. JSON becomes HTML emails.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/react-native",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "React Native renderer for @json-render/core. JSON becomes React Native components.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/react-pdf",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "React PDF renderer for @json-render/core. JSON becomes PDF documents.",
|
||||
"keywords": [
|
||||
|
||||
@@ -153,8 +153,7 @@ export async function renderToBuffer(
|
||||
options?: RenderOptions,
|
||||
): Promise<Uint8Array> {
|
||||
const document = buildDocument(spec, options);
|
||||
const buffer = await pdfRenderToBuffer(document as any);
|
||||
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
||||
return pdfRenderToBuffer(document as any);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -163,7 +162,7 @@ export async function renderToBuffer(
|
||||
export async function renderToStream(
|
||||
spec: Spec,
|
||||
options?: RenderOptions,
|
||||
): Promise<NodeJS.ReadableStream> {
|
||||
): Promise<ReadableStream> {
|
||||
const document = buildDocument(spec, options);
|
||||
return pdfRenderToStream(document as any);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/react-three-fiber",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "React Three Fiber renderer for @json-render/core. JSON becomes 3D scenes.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/react",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "React renderer for @json-render/core. JSON becomes React components.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/redux",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Redux adapter for json-render StateStore",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/remotion",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Remotion renderer for @json-render/core. JSON becomes video compositions.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/shadcn-svelte",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "shadcn-svelte component library for @json-render/svelte. JSON becomes beautiful Tailwind-styled Svelte components.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/shadcn",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "shadcn/ui component library for @json-render/core. JSON becomes beautiful Tailwind-styled React components.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/solid",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "SolidJS renderer for @json-render/core. JSON becomes Solid components.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/svelte",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Svelte 5 renderer for @json-render/core. JSON becomes Svelte components.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/vue",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Vue renderer for @json-render/core. JSON becomes Vue components.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/xstate",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "XState Store adapter for json-render StateStore",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/yaml",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "YAML wire format for @json-render/core. Progressive rendering and surgical edits via streaming YAML.",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@json-render/zustand",
|
||||
"version": "0.19.0",
|
||||
"version": "0.19.1",
|
||||
"license": "Apache-2.0",
|
||||
"description": "Zustand adapter for json-render StateStore",
|
||||
"keywords": [
|
||||
|
||||
Reference in New Issue
Block a user