Skip to content

v1.21.0

Choose a tag to compare

@edmundhung edmundhung released this 09 Aug 16:38
· 27 commits to main since this release
6099ac1

Breaking Changes (Future APIs)

Important

The following deprecated future APIs have now been removed:

  • Removed stripEmptyValues from parseSubmission(). (#1285)
  • Removed the value option from report(). Use targetValue instead. (#1285)
  • Removed the invalid metadata property. Use !valid instead. (#1285)
  • Removed getZodConstraint() and getValibotConstraint() from the future exports. Use getConstraints() instead. (#1285)

Deprecations (Future APIs)

  • Deprecated the value option passed to onSubmit()’s update() function. Use targetValue instead. The alias will be removed in the next minor release. (#1286)

     update({
       reset: true,
    -  value,
    +  targetValue: value,
     });
  • Deprecated includeValue in the future Zod and Valibot formatResult() APIs. The option will be removed in the next minor release, after which formatResult() will always return both error and value. (#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 URLSearchParams directly to useForm() as its default value. (#1284)

  • Improved intent types so reset, update, insert, and remove preserve the inferred form and field shapes of their values. (#1289)

  • Fixed DefaultValue to preserve string literal types, including values inferred from z.literal() and enum-like schemas. Thanks @transparent-citizen! (#1288)

  • Re-exported Submission and SubmissionResult from 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