Releases: edmundhung/conform
v1.11.0
What's Changed
Breaking change (Future APIs)
In this release, we simplified some of the type signatures by removing the Metadata generic parameter (#1045):
FormMetadata<ErrorShape = string>(previouslyFormMetadata<ErrorShape, Metadata>)FieldMetadata<FieldShape, ErrorShape = string>(previouslyFieldMetadata<FieldShape, Metadata>)Fieldset<FieldShape, ErrorShape = string>(previouslyFieldset<FieldShape, Metadata>)
Improvements
-
Added standard schema issue support to
report(#1041)The
reporthelper now accepts standard schema issues directly, eliminating the need to useformatResultin most cases:return report(submission, { + error: { issues: result.error.issues }, // Zod + error: { issues: result.issues }, // Valibot - error: formatResult(result), });When both
issuesandformErrors/fieldErrorsare provided, they will be merged together, withissuesbeing formatted first:return report(submission, { error: { issues: result.error.issues, formErrors: ['Custom form error'], }, });
This allows you to pass the validation results from Zod and Valibot to
reportdirectly without usingformatResult. But it is still useful when you need to customize the error shape. -
Added
schemaValueproperty to theonValidatecallback argument containing the validated value from successful schema validation. This property isundefinedwhen no schema is provided or when validation fails. (#1046)const form = useForm({ schema: z.object({ email: z.string().email() }), onValidate({ schemaValue }) { if (schemaValue) { // Access the validated data: { email: string } console.log(schemaValue.email); } }, });
Full Changelog: v1.10.1...v1.11.0
v1.10.1
What's Changed
- Fixed an issue with
form.getFieldset()requiring a name parameter. This should be optional instead. (#1037 by @luchsamapparat) - Improved the form state setup to fix Next.js prerendering hydration issues (#1039 by @apostolos)
New Contributors
- @luchsamapparat made their first contribution in #1037
Full Changelog: v1.10.0...v1.10.1
v1.10.0
What's changed
This release brings better Valibot integration with the future useForm hook while also fixing a few rough edges.
Breaking change
-
The memoize helper has moved into
@conform-to/react/future. (#1022 by @chimame)
If you were previously importing it from@conform-to/zod/v3/futureor@conform-to/zod/v4/future, you will need to update your imports:- import { memoize } from '@conform-to/zod/v4/future'; + import { memoize } from '@conform-to/react/future';
No other changes are required.
New in @conform-to/react/future
- Exposed several internal types, which can be useful if you are building abstractions on top of Conform:
Submission,SubmissionResult,FormContext,FormMetadata,FormRef,FieldMetadata,FieldName, andIntentDispatcher. (#1033)
New in @conform-to/valibot/future
- Added formatResult helpers for smoother integration with the future
useFormhook. (#1018 by @chimame)
Fixes and improvements
- Fixed an issue where the
validmetadata did not properly consider subfield errors. (#1024) - Fixed an issue where
useFormmight clear all form values during form submission after a form reset. (#1028) - Inlined types from
@standard-schema/specto fix type inference issues with standard schema. (#1029) - Improved file handling so that the future
useFormhook does not crash when submitting an empty file input. (#1027)
Full Changelog: v1.9.1...v1.10.0
v1.9.1
What's Changed
This release restored form and field metadata that were present in v1 but accidentally omitted from the future useForm hook (#1020). This includes:
- Adding
key,errorIdanddescriptionIdproperties to form metadata - Adding
validproperty to both form and field metadata withinvaliddeprecated and to be removed in 1.10.0 - Adding
formIdproperty to field metadata - Adding
fieldErrorsto field metadata (renamed from v1'sallErrors) with improvements:- Keys use relative paths scoped to the parent field instead of full field names
- Excludes the current field's own errors (only includes child field errors)
Full Changelog: v1.9.0...v1.9.1
v1.9.0
What's changed
This version introduces a set of new experimental APIs under the future export.
Learn more about these APIs in the announcement post.
New React APIs (@conform-to/react/future)
- useForm: The future main hook for form state, validation, and submission
- useFormMetadata: Access form-level metadata (errors, validation state)
- useField: Access individual field metadata with auto-generated IDs
- useIntent: Create intent dispatchers for programmatic form actions
- parseSubmission: Parses FormData/URLSearchParams into structured objects with nested data support. This is already used internally by the
isDirtyhelper. - report: Creates submission results with validation errors and security features
Enhanced Zod Integration (@conform-to/zod/v3/future or @conform-to/zod/v4/future):
- coerceFormValue: Enhances the schema to strip empty value and coerce form value
- formatResult: Transforms Zod validation results into Conform's error format, supporting value extraction and custom error formatting
- memoize: Caches most recent result to prevent redundant API calls during async validation
Additional Changes
- Improved ZodPipe resolution in
getZodConstraint()with zod v4. Thanks @taku-hatano!
No changes were made to the existing future hook in this release. Everything should continue to work as expected.
Full Changelog: v1.8.2...v1.9.0
v1.8.2
What's Changed
- fix: ensure input not managed by conform are untouched during form reset by @edmundhung in #980
- fix: updated
@conform-to/zod's zod version requirements to^3.21.0 || ^4.0.0by @chimame in #985 - docs: added ja translation in
ui-libraries.mdby @WataruNishimura in #986 - chore: update vitest config to prevent unnecessary tests from being executed by @chimame in #984
New Contributors
- @WataruNishimura made their first contribution in #986
Full Changelog: v1.8.1...v1.8.2
v1.8.1
What's Changed
- fix(future-export):
useControlnow properly resets file inputs when receiving an empty array (#976)
Full Changelog: v1.8.0...v1.8.1
v1.8.0
What's changed
This version introduced two new experimental APIs under the future export.
-
useFormData: A low-level React hook that lets you derive a value from the current FormData of a form and re-render only when that value changes.const fullName = useFormData( formRef, (formData) => formData?.get('role') === 'admin', );
-
isDirty: A utility function for checking whether the current form values differ from the default values.const dirty = isDirty(formData, { defaultValue });
These APIs are designed to decouple form state from the core logic and provide more flexibility for reacting to form changes without relying on internal context. They are also part of the groundwork for a simpler useForm model in future versions.
Learn more in the announcement post.
No changes were made to the future
useControlhook in this release. Everything should continue to work as expected.
Full Changelog: v1.7.2...v1.8.0
v1.7.2
What's Changed
Full Changelog: v1.7.1...v1.7.2
v1.7.1
What's Changed
- Stop setting
aria-invalidattriabute when usinggetFormPropsorgetFieldsetPropsby @evaogbe (#963) - Ensure the
useControlfuture export works when File or FileList is undefined by @edmundhung (#966)
New Contributors
Full Changelog: v1.7.0...v1.7.1