jaredpalmer / formik

Build forms in React, without the tears 😭
https://formik.org
Apache License 2.0
33.77k stars 2.78k forks source link

feat(validationSchema): support yup transforms in validate & submit #3796

Closed quantizor closed 1 year ago

quantizor commented 1 year ago

Closes #728 Closes #608

Add support for Yup "transforms".

I do not believe this is a semver-major change as it's an optional Yup feature; it's actually probably confusing that it hasn't worked to date.

Original credit for this work belongs to @sshmyg, I just modernized it and added tests.

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 390d77149fd355cf1d0399db7dbc9b375573b222

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ------------- | ----- | | formik | Minor | | formik-native | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
formik-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2023 1:22pm
codesandbox-ci[bot] commented 1 year ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 390d77149fd355cf1d0399db7dbc9b375573b222:

Sandbox Source
Formik TypeScript Playground Configuration
rdenman commented 1 year ago

FYI this probably would have been a good major release. We had breaking changes after bumping to the latest version of formik over the weekend (we use Renovate to auto-update).

We had a yup validation schema that called lowercase before checking for an existing name to prevent duplicates. Previously, the api call wouldn't send that transformed version in the body, but with latest, all our requests sent the field as lowercase. Not a huge issue, but I'd consider it breaking