Skip to content

Releases: edmundhung/conform

v1.11.0

25 Sep 08:32
ec2669a

Choose a tag to compare

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> (previously FormMetadata<ErrorShape, Metadata>)
  • FieldMetadata<FieldShape, ErrorShape = string> (previously FieldMetadata<FieldShape, Metadata>)
  • Fieldset<FieldShape, ErrorShape = string> (previously Fieldset<FieldShape, Metadata>)

Improvements

  • Added standard schema issue support to report (#1041)

    The report helper now accepts standard schema issues directly, eliminating the need to use formatResult in most cases:

    return report(submission, {
    +  error: { issues: result.error.issues },  // Zod
    +  error: { issues: result.issues },        // Valibot
    -  error: formatResult(result),
    });

    When both issues and formErrors / fieldErrors are provided, they will be merged together, with issues being 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 report directly without using formatResult. But it is still useful when you need to customize the error shape.

  • Added schemaValue property to the onValidate callback argument containing the validated value from successful schema validation. This property is undefined when 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

17 Sep 19:08
0803efd

Choose a tag to compare

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

Full Changelog: v1.10.0...v1.10.1

v1.10.0

15 Sep 11:44
6e44246

Choose a tag to compare

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/future or @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, and IntentDispatcher. (#1033)

New in @conform-to/valibot/future

Fixes and improvements

  • Fixed an issue where the valid metadata did not properly consider subfield errors. (#1024)
  • Fixed an issue where useForm might clear all form values during form submission after a form reset. (#1028)
  • Inlined types from @standard-schema/spec to fix type inference issues with standard schema. (#1029)
  • Improved file handling so that the future useForm hook does not crash when submitting an empty file input. (#1027)

Full Changelog: v1.9.1...v1.10.0

v1.9.1

10 Sep 23:06
2a7cafb

Choose a tag to compare

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, errorId and descriptionId properties to form metadata
  • Adding valid property to both form and field metadata with invalid deprecated and to be removed in 1.10.0
  • Adding formId property to field metadata
  • Adding fieldErrors to field metadata (renamed from v1's allErrors) 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

05 Sep 21:49
49b0c08

Choose a tag to compare

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 isDirty helper.
  • 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

15 Jul 20:10
4a9fb82

Choose a tag to compare

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.0 by @chimame in #985
  • docs: added ja translation in ui-libraries.md by @WataruNishimura in #986
  • chore: update vitest config to prevent unnecessary tests from being executed by @chimame in #984

New Contributors

Full Changelog: v1.8.1...v1.8.2

v1.8.1

03 Jul 23:15
53a5da2

Choose a tag to compare

What's Changed

  • fix(future-export): useControl now properly resets file inputs when receiving an empty array (#976)

Full Changelog: v1.8.0...v1.8.1

v1.8.0

30 Jun 21:34
9f9c1c9

Choose a tag to compare

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 useControl hook in this release. Everything should continue to work as expected.

Full Changelog: v1.7.2...v1.8.0

v1.7.2

20 Jun 20:00
a4c5e9d

Choose a tag to compare

What's Changed

  • Fixed zod 4 nested discriminated unions support by @chimame (#969)

Full Changelog: v1.7.1...v1.7.2

v1.7.1

19 Jun 18:58
f75e567

Choose a tag to compare

What's Changed

  • Stop setting aria-invalid attriabute when using getFormProps or getFieldsetProps by @evaogbe (#963)
  • Ensure the useControl future export works when File or FileList is undefined by @edmundhung (#966)

New Contributors

Full Changelog: v1.7.0...v1.7.1