v1.21.0
Breaking Changes (Future APIs)
Important
The following deprecated future APIs have now been removed:
- Removed
stripEmptyValuesfromparseSubmission(). (#1285) - Removed the
valueoption fromreport(). UsetargetValueinstead. (#1285) - Removed the
invalidmetadata property. Use!validinstead. (#1285) - Removed
getZodConstraint()andgetValibotConstraint()from the future exports. UsegetConstraints()instead. (#1285)
Deprecations (Future APIs)
-
Deprecated the
valueoption passed toonSubmit()’supdate()function. UsetargetValueinstead. The alias will be removed in the next minor release. (#1286)update({ reset: true, - value, + targetValue: value, }); -
Deprecated
includeValuein the future Zod and ValibotformatResult()APIs. The option will be removed in the next minor release, after whichformatResult()will always return botherrorandvalue. (#1287)
What's Changed
-
Added
serialize()to intent dispatcher methods, allowing native submit buttons to trigger form intents when JavaScript is unavailable. (#1283)<button name={form.intentName} value={intent.validate.serialize('title')} > Validate title </button>
-
Updated
resolveSubmission()so submit intents and form intents can share the same field name. Plain intent values are now preserved as submit intent payloads. (#1280) -
Added support for passing
URLSearchParamsdirectly touseForm()as its default value. (#1284) -
Improved intent types so
reset,update,insert, andremovepreserve the inferred form and field shapes of their values. (#1289) -
Fixed
DefaultValueto preserve string literal types, including values inferred fromz.literal()and enum-like schemas. Thanks @transparent-citizen! (#1288) -
Re-exported
SubmissionandSubmissionResultfrom the stable Zod, Valibot, and Yup adapters, preventing non-portable inferred declaration types and TS2742/TS2883 errors with TypeScript 5.9 and strict dependency layouts. (#1292)
Full Changelog: v1.20.2...v1.21.0