Repository navigation
feat(web_core)!: remove Zod 3 support - #54
Draft
louis-bompart wants to merge 3 commits into
Draft
louis-bompart wants to merge 3 commits into
louis-bompart wants to merge 3 commits into
Conversation
spec(), specDef() and exclusiveUnion are deprecated in favor of specMeta() and z.xor(). SpecShaper keeps an authored oneOf, so a z.xor union is written as oneOf; the loader compiles oneOf to z.xor, and formatZodIssue reports z.xor's "more than one option matched" issue. The README documents the Zod 4 authoring API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BasicCatalogThemeSchema moves to Zod 4 and keeps accepting any CSS color. themeSchemaOf returns a catalog's own theme schema whenever it is a validator, so a Zod 4 theme is validated as a Zod 3 one was, instead of against the document's stricter hexadecimal theme, or not at all when the document writes none. Angular's catalogs take their theme schema as an EntrySchema. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
This was referenced Oct 29, 2026
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
With every built-in schema in Zod 4, this PR removes Zod 3 support from
@a2ui/web_core. Schemas are written with Zod 4 (import {z} from 'zod/v4'), another Standard JSON Schema library, or as JSON Schema objects.EntrySchemais anA2uiSchema. The@a2ui/web_core/zod3entry point,spec(),specDef(),exclusiveUnion,markChildRef,childRefKindOfandChildRefKindare removed: annotate with.meta(specMeta(...)), name a model with.meta(specMeta({defName})), write an exclusive union withz.xor(), and refer toComponentIdorChildListwith.meta({$ref}).Catalog.toJson()writes an exclusive union of a specification-shaped model asoneOf, and aoneOfloaded withCatalog.fromJsoncompiles toz.xor.BasicCatalogThemeSchemais Zod 4, and the core validates a theme with the catalog's own theme schema whenever that schema is a validator.getKnownSchemaKeysreadsadditionalProperties: {}, as Zod 4 writes a loose object, as allowing any key.zod-to-json-schema, and the remainingzod/v3imports in the repo, including upstream's newer files, move tozod/v4.zod3entry point) and describes thezod@^4.6.7dependency as Zod 4.Validation
yarn buildintypescript/core/web_core, thennode --test "dist/**/*.test.js": 1534 tests, 0 failing.node tests/conformance/conformance_test.mjs: every vector passes.yarn lintintypescript/core/web_core: 0 errors.yarn buildandyarn testintypescript/catalogs/mcp,typescript/catalogs/vegachart,typescript/renderers/markdown-it,typescript/renderers/lit,typescript/renderers/reactandtypescript/agents/a2ui_agent: all pass.yarn buildintypescript/renderers/angular,tools/composer,tools/editorandtools/inspector. The Angular tests were not run: the local Java is too old for the Closure Compiler step.Regroups #40, #41 and #42.
Part of a2ui-project#2160.
🤖 Generated with Claude Code