Repository navigation
feat(web_core)!: remove Zod 3 support - #42
Closed
louis-bompart wants to merge 1 commit into
Closed
louis-bompart wants to merge 1 commit into
louis-bompart wants to merge 1 commit into
Conversation
EntrySchema no longer accepts a Zod 3 schema, and the zod3 entry point,
fromZod3, spec(), specDef(), exclusiveUnion, markChildRef and
childRefKindOf are removed, with their Zod 4 replacements in place. The
JSON Schema view, serializer, generator, entry schemas and issue formatter
lose their Zod 3 paths, and web_core drops zod-to-json-schema.
getKnownSchemaKeys reads Zod 4's additionalProperties: {} as open. Tests,
renderers, the agent SDK, the composer and the docs import zod/v4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 29, 2026
Collaborator
Author
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.
Description
This PR removes Zod 3 support, stacked on #41. It's the last step of the plan: no source or test in the repository imports
zod/v3any more, and web_core no longer depends onzod-to-json-schema.Removed, with their replacements:
EntrySchemaA2uiSchema: Zod 4, another Standard JSON Schema library, or JSON Schema@a2ui/web_core/zod3,fromZod3spec().meta(specMeta(...))specDef().meta(specMeta({defName}))exclusiveUnionz.xor()markChildRef,childRefKindOf,ChildRefKind.meta({$ref})toComponentIdorChildListSpecMixinis now a name, andJsonSpecAnnotationisSpecAnnotation.RefSchemaOptionsstays, forcomponentId()andchildList().Zod 3 paths removed from the core:
zod-to-json-schemaconversion, theREF:andmarkChildRefhandling, and the spec-view facts it added;zodSchemaFor,themeSchemaOf,validateEntry);ZodErrorhandling;formatZodIssue, which now formats Zod 4 issues only.Fixed along the way.
getKnownSchemaKeystreated onlyadditionalProperties: trueas open. Zod 4 writes a loose object asadditionalProperties: {}, so a function whose arguments were a Zod 4 loose object had its unknown arguments rejected. Both forms now count as open. A test found it once its loose object was Zod 4.Behavior the tests now pin:
specMeta()replaces the annotation of the schema it wraps rather than merging with it. The generated catalogs set one annotation per node, so their documents don't change..strict()returns a copy that drops metadata set before it, so.describe()goes after.strict(), or you usez.strictObject.Tests.
REF:markers in views,markChildRefstamps, Zod 3 issue shapes in the formatter, typing a Zod 3 schema.spec()tospecMeta(),specDef()tospecMeta({defName}),exclusiveUniontoz.xorandREF:markers to.meta({$ref}).schema_generators.test.ts, which checks the generator's output text, is unchanged.Also:
zod/v4.yarn.lockdrops web_core'szod-to-json-schemaentry. Other packages still use it.Not in this PR: the generator scripts still write Zod 3 text internally and convert it to Zod 4 with
toZod4Code. Nothing imports Zod 3 at runtime there; making them write Zod 4 directly is a cleanup for later.Validation
yarn buildfrom cleannode --test "dist/**/*.test.js": 1448 passing, 0 failing, 40 todonode tests/conformance/conformance_test.mjs: all vectors passingyarn lint: 0 errors, five warnings feweryarn format:checkyarn testpasses intypescript/catalogs/{mcp,vegachart},typescript/renderers/{lit,react,markdown-it},typescript/agents/a2ui_agent(plus its 478 conformance tests), the Lit and React explorers andtools/composer, which also builds.test:unit(328) andtest:integration(222) pass.test:closure-compilerneeds Java 21.toJson()andvalidationSchema, byte for byte;Part of a2ui-project#2160
Pre-launch Checklist
One time:
For this PR:
🤖 Generated with Claude Code