chore(deps): update dependency zod to v4.4.3#34
Open
certible-renovate[bot] wants to merge 1 commit into
Open
Conversation
11fc47c to
e5351ab
Compare
e5351ab to
5f30b41
Compare
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.
This PR contains the following updates:
4.3.6→4.4.3Release Notes
colinhacks/zod (zod)
v4.4.3Compare Source
Commits:
4c2fa95docs: use Zernio primary wordmark for gold sponsor logo2aeec83docs: prune lapsed gold sponsors and rebalance logo sizing7391be8docs: prune lapsed silver/bronze sponsors and add active ones2c70332docs: normalize bronze sponsor logos to github avatar pattern9195250docs: remove Mintlify from bronze sponsors (churned)b8dffe9docs: remove Numeric and Speakeasy (2+ missed monthly cycles)1cab693fix(v4): restore catch handling for absent object keys (#5937) (#5939)c2be4f8fix(v4): generalize optin/fallback to transform; restore preprocess on absent keys (#5941)f3c9ec04.4.31fb56a5docs: document release procedure in AGENTS.mdv4.4.2Compare Source
Commits:
0c62df0Clean up docs navigation and stale labels (#5901)20cc794chore: add security policy and refresh tooling deps6fbe07bfix(docs): heading anchor links now include the hash so it doesnt scoll all the way up, follows navbar logic (#5791)4bbed1bTighten discriminated union option typingbbac3e5Update PR guidance for agentscf0dc94Merge remote-tracking branch 'origin/main' into fix-discriminated-union-key-constraint292c894docs: add Zernio gold sponsor1fc9f31docs: document codec inversion1373c85docs: remove AI disclosure guidancee20d02bchore: ignore triage notese58ea4ddocs: test Zod Mini tab code heights905761adocs: document preprocess input type narrowingbf64bacchore: tighten test guidance in AGENTS.md8ec4e73chore: update play.ts scratch02c2bafMake z.preprocess defer optionality to inner schema (#5929)88015dffix(docs): drop deprecatedbaseUrlfrom tsconfigc59d4474.4.2v4.4.1Compare Source
Commits:
481f7beci: gate release publishing on full test workflow95ccab4test(v3): restore optional undefined expectationscede2c6fix(v4): reject tuple holes before required defaults (#5900)edd0bf0release: 4.4.1180d83ddocs: remove Jazz featured sponsorv4.4.0Compare Source
4.4.0
This is a minor release with a wide set of correctness and soundness fixes. Some fixes intentionally make Zod stricter, so code that depended on previously accepted invalid or ambiguous inputs may need small updates.
Potentially breaking bug fixes
Tuple defaults now materialize output values correctly
Fixed in #5661. Tuple parsing now more accurately reflects defaults, optional tails, explicit
undefined, and under-filled inputs. The headline behavior is that defaults in tuple positions now properly appear in parsed output.Trailing optional elements that are absent still stay absent; they are not filled with
undefined.But explicit
undefinedvalues supplied by the caller are preserved.When optional elements appear before later defaults, the parsed tuple is now dense so array operations behave predictably.
Tuple length errors are also more consistent now. Since
z.function()arguments are tuple-shaped, function input errors may look different.Required object properties with
z.undefined()Fixed in #5661, with follow-up coverage in
57d80a82. A property whose schema isz.undefined()is now treated as required. The key must be present, but its value may beundefined.Use
.optional()when the key itself may be absent.This also affects related
.catch(),.partial(),.default(), and.prefault()combinations that previously relied on missingz.undefined()keys being treated as optional.Safer
.merge()behavior with refinementsFixed in #5856. The
.merge()method now throws when the receiver has refinements, rather than silently producing ambiguous refinement behavior. Refinements from the second schema are preserved.JSON Schema
$defsentries no longer include redundantidFixed in #5759. JSON Schema conversion through
z.toJSONSchema()now strips redundantidfields from$defsentries. This is required for correctness in older JSON Schema dialects from before$idwas introduced: in those dialects,idchanges the resolution scope, so leaving it inside an extracted definition can make references resolve incorrectly. The removed value was redundant because the schema had already been extracted into$defs, so the definition key itself is the identifier. This may affect consumers that were reading those internalidfields directly.Other JSON Schema fixes in this release:
.describe(): #5797String validators are stricter
Base64 validation now rejects whitespace instead of allowing
atob()-style whitespace stripping. Fixed in #5888.Other string validator changes:
z.cuid()has been tightened, and CUID v1 is now deprecated. Fixed in #5880.z.httpUrl()now rejects malformed HTTP(S) URLs with a missing slash after the protocol. The underlyingURLconstructor normalizes inputs likehttps:/example.com, but Zod now rejects them instead of accepting the repaired URL. Fixed in #5672, related to #5284.Union paths are fixed in formatted errors
Two union-related error fixes landed:
z.treeifyError()andz.formatError(). Fixed in #5708 and60ff3987.ZodErroroutput.Other fixes
Record key transforms now run
Fixed in #5891. Record schemas now run transforms on record keys.
Related record fixes:
invalid_keyissues. Fixed in #5719.z.record(valueType)form works again. Fixed in0e960108.Metadata and input handling in
fromJSONSchema()Schema generation from JSON Schema now applies metadata more consistently across
enum,const,not,anyOf, and multi-type schemas. Fixed in #5758. It also rejects or normalizes more non-JSON-like inputs, including cyclic objects andBigInt. Fixed in87cf0f93.Codecs
Codec changes:
z.discriminatedUnion().encode()now works when the discriminator uses a codec. Fixed in #5769.Transform context
Transform callbacks now support
ctx.addIssue(). Fixed in #5699.Conditional
.superRefine()withwhenThe
whenoption was added for.superRefine(). Added in #5741, with related abort behavior fixed in #5681.Defaults for
MapandSetDefaults for
MapandSetare now cloned instead of shared across parses. Fixed in #5855.Empty unions
Empty
z.union([]),z.xor([]), and discriminated unions no longer crash at construction time. They construct and fail at parse time. Fixed in #5869.Floating-point multiples
Number
multipleOf()/step()validation is more accurate for decimal and exponent edge cases. Fixed in #5687 and #5793.Global config and
jitlessConfiguration fixes:
globalThis, improving behavior across mixed CJS/ESM module instances. Fixed in #5889.Prototype pollution hardening
Object catchall paths now skip
__proto__keys. Fixed in #5898.Performance improvements
Reduced memory usage from lazy-bound methods
Fixed in #5897. Classic builder methods are now lazy-bound through a shared internal prototype instead of eagerly attached per schema instance. This significantly reduces per-schema method allocation overhead, especially in codebases that construct many schemas. Detached methods continue to work:
Improved tree-shaking
Implemented in
195e8696and #5689. Top-level factory calls are annotated as pure, and generated stub package manifests now includesideEffects: false. This gives bundlers more room to remove unused Zod code.This is intended as the conclusive fix for a long-standing class of tree-shaking and bundle-size issues, especially in Next.js and Turbopack projects. The most visible symptom was that unused validators and locales could survive bundling even when importing from
zod/minior from a narrow subpath.Related reports include:
zod/minibundle-size reports: #5561, #5665, #4369, #4572{ "sideEffects": false }Locales
Added or updated locale support:
Locale message text changed in some cases, which may affect snapshots.
Closed issues
The following issues were closed by PRs included in this release:
string.abort: truein.refine()checks withwhen.addIssueto transform context.deleteinfinalizeIssue.optionsto invalid discriminator errors.fromJSONSchema().idfrom$defsentries in JSON Schema output.z.custom()docs for v4 compatibility.discriminatedUnion().encode()with codec discriminators.multipleOf()validation.MapandSetdefaults..merge()refinement semantics with.extend().jitlessconfig in the eval probe.z.union([])andz.xor([]).z.record().Commits
44f6a03efix(locales): correct Georgian translation for 'string' to 'ველი' (#5655) by @tushargr0ver7b43bc64docs(ecosystem): add Hono Takibi (#5651) by @nakita628119376b9feat: add map support to Uzbek locale (#5599) by @uchkunr8fbf701etest: add edge case tests for boundary values (#5601) by @uchkunrf1f93c2bFix order of brand method examples in api.mdx (#5604) by @onurtemiz10105ee4docs: Fix typos in json-schema documentation (#5608) by @SaKaNa-Y2d367139feat: add hr translation (#5610) by @vuki65654902cb7chore: update pullfrog.yml workflow89ba70f2chore: add sideEffects false to stub package.json for tree-shaking (#5689) by @jesse-holdeneaa3c2c3Update positive checks to use alias.gt(0)in the docs (#5671) by @Fredkiss365f1f404fix typo (#5676) by @Nikita0x5b574501fix: respectabort: truein.refine()for checks withwhenfunction (#5681)539de140docs: fix README links for async refinements/transforms (#5682) by @pavan-sh46cd10e7docs: fix README anchor links for async APIs (#5683) by @pavan-sh55747b3cRemove deprecated downlevelIteration option (#5684) by @RyanCavanaugh3a818de1fix(v4): handle multi-digit exponents in floatSafeRemainder (#5687) by @shakecodeslikecray3cd45ebcfix(v4): add strict validation tohttpUrl()(#5672) by @LuckySilver00217d98c909add Sanity as silver sponsor and Mintlify as bronze sponsorc7805073move Sanity and Mintlify to top of sponsor listsbee2dc8ddocs: movez.iso.time()from format to pattern section (#5696)2f8414bcfix: add missing addIssue to transform context (#5699) by @F-A-N-D-Ed3c0ec87docs: add note about removed.errorsalias in v4 changelog (#5705) by @togami2864fa338a3bfix(v4): JSON schema min/max intersection for draft-04 and openapi-3.0 (#5700) by @ebroder3473b288chore: bump zshy to ^0.7.1cc8f9b7cdocs: improve README wording and fix typos (#5736) by @vedanshshettif5336717feat: add json-up to ecosystem (#5740) by @mrspence60ff3987fix(v4): preserve parent path when treeifying nested union/key/element issues08b14b51perf: avoiddeleteinfinalizeIssueto keep V8 fast mode (#5718)9cf868d2fix(v4): treeify error nested union bug (#5708) by @dstashevskyi28f39a6dAdd JSONType export (#5709) by @RobinVdBroeck65fab33efeat: allowwhenparameter in.superRefine()(#5741) by @vilvai7f87df1erefactor(v4): remove unnecessary type assertions (#5720) by @chisaki66518f15ddPreprocess is not deprecated (#5721) by @mxdvl2e5b23dcfix: add options to invalid discriminator errors (#5723) by @Danielchinasa7f789deffix: skip non-enumerable properties in record validation (#5719) by @veeceeyee15fa19docs: add AGENTS notes for JSDoc, PR comments, and PR worktree workflowf52b4d28Revert "docs: improve README wording and fix typos (#5736)"ddb41391test: increase timeout for redos checker in datetime.test.ts (#5744) by @rishadaufabc07e459docs: fix doc (#5745) by @xgaiae06af5deUpdate Hey API description (#5748) by @mrlubos28c156e2fix: apply description and default metadata to enum, const, and not schemas in fromJSONSchema (#5758) by @mibragimovf457edf1Fix grammar in CONTRIBUTING.md (#5765) by @siekmang411f6c64fix(v4): resolve stack overflow in toJSONSchema for recursive lazy with describe (#5797) by @Hassad67445dd421edocs: add tone guidelines for issue and PR comments to AGENTS.mdddd20a30test: align optional property assertions with actual inferred typesa1cf8a93docs: update z.custom example for v4 compatibility (#5763) by @andrewdameliob6a3b336fix: strip redundant id from$defsentries in toJSONSchema (#5759) by @mibragimovc7a8ccc0fix: discriminatedUnion encode() with codec discriminator (#5769) by @mahmoodhamdi87cf0f93fix(fromJSONSchema): normalize input via JSON round-trip7163e6f2feat: add.invert()method to ZodCodec (#5770) by @mahmoodhamdib59b9b13fix: replace.defaultwith.prefault(#5776) by @alanskovrlj93bba686docs: add Zod AOT to ecosystem page (#5806) by @wakita1810092564caa4fix(docs): add custom 404 page with proper theme support (#5779) by @WolfieLeader5b7ed214fix: correct multipleOf float validation using tolerance-based comparison (#5793) by @cyphercodescc9139d2docs: fix self-referencing schema in refine when() example (#5812) by @claygeo0e960108fix(v4): support v3-style single-arg z.record(valueType)41b25af9docs(agents): refine PR comment tone guidance4c03c20dUpdate Italian locale error messages for validation (#5852) by @pastorello37ac1ba0fix(fr): translate issue.origin in too_big/too_small errors (#5845) by @Ouaziz-chedli345be203docs: add validex to ecosystem (#5848) by @chiptoma3c1f32bdfeat(locales/en): handle instanceof and add comprehensive locale tests888e52bbfeat(locales): add Greek (el) locale (#5840) by @saileshbrobf6d99edRevert "feat(locales/en): handle instanceof and add comprehensive locale tests"e8196a8dfix(resolution): align expected fr message with translated localeb6b12882correct logic for validating length (#5843) by @nameearly34f60159fix(v4): clone Map and Set in shallowClone to prevent shared state across.default()parses (#5855) by @artur-seppa91a7d0d1fix(v4): reject whitespace in z.base64() to close atob bypass23edf484Revert "fix(v4): reject whitespace in z.base64() to close atob bypass"15cafa13fix(v4): throw on.merge()receiver with refinements; preserve refinements from second schema (#5856) by @solssak584b1089fix(v4): reject whitespace in z.base64() to close atob bypass (#5888) by @colinhacksb9b62c65fix(core): honourjitlessconfig inallowsEvalprobe (#5864) by @doksonfffe99bdfix(v4): construct empty unions instead of crashing (#5869) by @tjenkinson285bde7ffeat(core): shareglobalConfigacross module systems viaglobalThis(#5889) by @colinhacks195e8696perf(v4): mark top-level factory calls as/*@​__PURE__*/for tree-shaking61d7bedbfix(v4): apply key schema transforms in z.record() (#5891) by @colinhacks45acd2adci(release): switch to npm trusted publishing via OIDC (#5890) by @colinhacks476ae243Tighten cuid() regex and deprecate CUID v1 (#5880) by @colinhacks6217527edocs(agents): document push-to-main footgun and version-bump rule (#5883) by @colinhacks757f0b0ffix(v4): apply util.Writeable in strictObject/looseObject for shape display parity (#5882) by @colinhacksfa4a3740fix(v4): apply util.Writeable in mini object constructors and extend/safeExtend/partial/required (#5895) by @colinhacksebc8287cfix(v4): emit falsy prefault values in toJSONSchema (#5893) by @mixelburg8fcb71a5perf(v4): lazy-bind builder methods to shared internal prototype (#5897) by @colinhacks76e8f706fix(v4): skip__proto__key in object catchall (#5898) by @colinhacksf0b0608eecosystem:eslint-plugin-zod-xiseslint-plugin-zodnow (#5637) by @marcalexiei0b5c3bc2docs: fix refinements examples in api.mdx (#5649) by @playoffthecuff327e152edocs(agents): refine PR comment tone guidance further57d80a82test(v4): pin object/tuple key optionality through optout propagationf19860f1fix: preserve context immutability in parse functions (#5632) by @bgk614ec979ad7feat: add Romanian (ro) locale (#5657) by @tushargr0verb6066b3efix(v4): align object and tuple optionality handling (#5661) by @Cyjin-janiad0b8271ci: update release workflow for trusted publishing6db607befix(release): keep JSR manifest publishablef778e02abuild: bump zshy for JSR wildcard exportsConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.