jaredpalmer / formik

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

Make formik sync when validation functions are sync #3976

Open fbarbare opened 1 week ago

fbarbare commented 1 week ago

When the given validation function are synchronous there is no reason to make them async. Making them async actually makes the whole code much slower and creates unecessary re-renders.

vercel[bot] commented 1 week 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 Jun 27, 2024 9:39am
codesandbox-ci[bot] commented 1 week 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.

changeset-bot[bot] commented 1 week ago

⚠️ No Changeset found

Latest commit: 1c6c3e6847f117edce6589c5ed8d99f2bf021ff2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

fbarbare commented 1 week ago

@jaredpalmer This change goes in the direction that you are mentioning in https://github.com/jaredpalmer/formik/pull/2140 but is backwards compatible since it's not removing any functionality. The deprecation of the async validation methods could be done in a later stage so we can first make things more synchronous (which will improve performance of a lot of apps) and then proceed with the removal of the async stuff. Any thoughts?