formik

Build forms in React, without the tears 😭

APACHE-2.0 License

Downloads
11.2M
Stars
33.5K
Committers
456

Bot releases are hidden (Show)

formik -

Published by jaredpalmer over 5 years ago

Fixes

  • Fixed bug causing React to warn against unmounted setState calls during certain validation scenarios (#1338)
formik -

Published by jaredpalmer over 5 years ago

Improvements

  • Added initialStatus and mapPropsToStatus so that status can be initialized. This could be useful if you are trying to have some arbitrary state that should be reset with your form.

Commits:

  • Finish initialStatus (#1321) 812b67e
  • Add initialStatus (#1263) 88be029
  • Fix arrayHelper insert and alterTouched falsy behavior (#1311) 1524339
  • Update documentation according to the issue #445 (#1313) 6b55b35
  • Add example usage of the second parameter of the onSubmit method. (#1305) 7e42ed7
  • Update FieldProps to mimic formik handlers (#1287) 02b8911
  • Swap setSubmitting(false) and next(values) (#1304) cdf2aca
  • Do not forward shouldUpdate to component (#1258) 0307a46
  • We need to use cross platform cp command to support windows developers (#1282) 786458d
  • Update docs for 1.4.3 29996e3
formik -

Published by jaredpalmer over 5 years ago

Patch

  • Fixed typescript types of connect. For some reason, the last build included an extra generic to the returned React.ComponentType causing certain versions of the react types to get mad.

Internal changes

  • Updated internal Rollup setup
    • Moved to latest version of rollup
    • Replaced uglify with terser
  • Moved my personal site (https://jaredpalmer.com) and thus the Formik docs site off Now.sh to Netlify. Whenever Formik merges to master it sends Netlify a webhook and triggers a rebuild of my site. In my site's build setup, I code load formik source, build the docs site, and move it to the /formik directory (a poor man's GitHub pages basically).
formik -

Published by jaredpalmer over 5 years ago

Fixes πŸ›

  • Fixed isSubmitting and isValidating behavior during submission
  • Fixed various issues with setState when unmounted

Health πŸ‘©β€βš•οΈ

  • 100% of tests now pass for v2
formik -

Published by jaredpalmer almost 6 years ago

Patch Release

  • Massive improvement to TypeScript inferencing for TS 2.9+
  • Improved treeshaking thanks to tiny-warning (thanks @TrySound !)

Improved TypeScript type inferencing for TS 2.9+

Before: Without explicit types, render prop & onSubmit's parameters yielded any type.

After: Types are now inferred by initialValues!!! No generics are needed if you are using TS 3.2.2

Commits

  • 0e459bc Attempt to fix inferencing (#1220)
  • 1172cb6 add documentation referencing issue #1210 (#1212)
  • 970e573 Update formik.md
  • 13954fd Replace warning (#1192)
  • 5f9afc1 Add resource to resources.md. (#1186)
  • a77c4b3 Update version on docs site
formik -

Published by jaredpalmer almost 6 years ago

Patch Release

  • Remove double rendering on each key stroke. Huge perf boost.

Commits

  • Avoid over-rendering by deeply comparing errors to state (#1189) 8c9f501
  • Update Formik.tsx (#995) ebde5e6
  • Fix wrong TS types for onBlur (#1109) 286fe67
  • Add exemptLabels to stale bot config (#1182) a668e80
  • wrote tests (#1181) bb9159a
formik -

Published by jaredpalmer almost 6 years ago

Minor Release

tl;dr

  • Massive performance improvement over 1.3.x with tiny change to isValidating and smarter internal orchestration of validation
  • Treeshaking thanks to @TrySound

About that #perf boost...

In 1.4.x isValidating will only now toggle during submission and if you manually call validateForm, otherwise it will remain false. In the past, it toggled on change and blur which caused a performance regression with certain libraries (like styled-components). Additionally, Formik internally runs validation slightly more intelligently: it will now cancel a running validation promise if a newer one is executed prior to committing the update. This can save lots and lots of renders.

Commits

  • Update yarn.lock for react-fast-compare v2 d02beb8
  • upgrade react-fast-compare to get bugfix (#1149) f5c6a43
  • Only use isValidating during submit (#1169) 2ae0537
  • Make validateForm internally cancellable (#1163) 32a69be
  • Stricter typing for FormikActions resetForm method (#1166) 109324a
  • Correct Field render props docs example (#1167) c5e7b18
  • Correct docs examples (#1162) 13a1e12
  • Remove warnings from production bundle (#1161) 731d13e
  • Replace lodash.package with lodash/package (#1160) 3588f4a
  • Set displayName on connected component. (#1152) 356a728
  • Remove extra β€œthe” (#1147) fbed327
  • Add working with React Select v2 example (#1130) fa2ca38
  • Update tutorial.md (#1128) 5779f59
  • [ImgBot] Optimize images (#1142) 2802d7b
  • Update validation.md (#1123) 0cc611a
  • Update React, @types/react, typescript 85d15b3
  • Bump react and react-dom devDeps 6526200
  • Remove enzyme from FieldArray test ace898c
  • Changed FieldArray.updateArrayField to use prevState (#1059) ddf1bef
  • Bump docs to 1.3.2 a250d6a
  • v1.3.2 82f45bf
  • New size snap 784d803

Update on Formik v2

Formik v2 is coming very soon (#1063)!!! We'll start to publish canary releases next week. Stay tuned!

formik -

Published by jaredpalmer almost 6 years ago

New stuff

  • Support for <button type="reset> will now call handleReset
  • Treeshaking and build improvements by @TrySound !!
  • setIn now keeps the same object if nothing has changed

Internals

  • Refactored all tests to use react-testing-library instead of enzyme
  • Lots of docs improvements
formik -

Published by jaredpalmer about 6 years ago

Improvements πŸŽ‰

  • Late Registration: <Field> and <FastField> now "register" with the parent <Formik> during componentDidMount() instead of in componentWillMount/constructor. This change also ensures that Formik is React Fiber ready.
  • <FastField> will now rerender when isSubmitting changes

Bug Fixes πŸ›

  • Added support for TypeScript 3.1.1 and @types/react 16.4.x #898. Formik is not friendly with TS 3.0 because of a known issue with type inferencing πŸ€·β€β™‚οΈ . The official solution is to upgrade to TS 3.1.1.
  • Bumped a lot of deps internally
  • Fixed bug in <FieldArray> when changing indexes where touched was incorrect
  • Lots of docs updates
  • Updated examples for React Native and MultiStep

Commits

  • Version the docs for 1.3.1 5920a82
  • Bump deps, fixes @types/react 16.4 (#898) f58f85a
  • Add missing ErrorMessage import in docs overview (#949) b3fadb7
  • Fix missing variable reference for field API (#948) 23ef6ce
  • Add proper descriptions for custom pages c89b99b
  • Merge branch 'master' of github.com:jaredpalmer/formik 695b763
  • Add video to overview, tutorial 41fb6f7
  • Tiny copy fix for the render prop definition (#944) 3024758
  • Alter errors and touched object on index change (#925) df6d4e5
  • fixed bug changing {} to Object (#931) fffaf9b
  • Fix calls to validation with outdated values (#939) 94524f1
  • Add original id to resources 0259340
  • Add React Alicante talk to docs 28189b0
  • Make sure site is being indexed 29872a1
  • Merge branch 'master' of github.com:jaredpalmer/formik 5f8189d
  • Fix #934. Update edit urls on nested docs 4ce23a1
  • Add ErrorMessage import (#933) ddb6d9c
  • Fix minor things in docs (#932) 49e6623
  • update MultistepWizard to reset touched object on navigating to next page of a multistep form (#928) 268cc30
  • yupToFormErrors accepts a single ValidationError (#917) 25c0bb5
  • Use late registration (#900) 5cba633
  • Fix links in docs (#927) 723ee85
  • Fix typo (#922) e0d8e3f
  • Rerender when isSubmitting has changed (#915) 63a87eb
  • Update Snack example for React Native (#919) c2b27df
  • Update examples with (#908) 6899dc5
  • Fix typo 665c9b7
  • Fix typo in formik.md (#901) 5092b29
  • Update overview.md 77eb25d
  • Added 'replace' into FieldArray (#899) 3d8407b
  • Version docs to 1.3.0. Fix #894 e445c11
formik -

Published by jaredpalmer about 6 years ago

Minor Release

  • Added <ErrorMessage /> component! (#896)
  • More docs

Commits

  • Cleanup conditional 8d6bf7b
  • Add search facet filters to website e67684f
  • Add versions 6a699a8
  • Update travis 0e12d1e
  • Add <ErrorMessage /> (#896) f05e9d3
  • Prevent users to set state when the form is unmounted (#895) 2c24959
  • fix(FieldArray): Add name to FieldArray render prop type (#889) f6a577a
  • fix email regex in documentation (#888) 0067a6e
  • Correct Validation.md with [Yup] part (#886) 4dc035a
  • added RVshare as a user (#884) d526a89
  • Fix validateForm typescript typings and documentation (#885) 626e252
  • Merge branch 'master' of github.com:jaredpalmer/formik c507bba
  • Add docs for fieldarray 5549ebb
  • Use "option" instead of "key" e1b84cc
  • Fix typos 202d33b
  • Update form.md d2bb7d0
  • Remove bracket links from withFormik() d2301af
  • Remove brackets from Formik docs 90176bf
  • Tweak docs font-size 0d6386b
  • Refactor README to point to website (#880) 5ee5363
  • More docs (#879) cc57e7d
  • More docs (#876) 682d94d
  • Update arrays.md d9fdd50
formik -

Published by jaredpalmer about 6 years ago

Minor Release

  • <FastField> was broken by React 16.4 (#659). The registration technique we were using led to a bunch of weird edge cases, especially around submission and blur. In this release, <FastField> now works as expected (and now also has full documentation).
  • Speaking of documentation..... https://jaredpalmer.com/formik is up and running. There's a lot missing right now but we are on the right track. Plan is to get this baby into shape this next week and next. So look for lots of docs PRs.

Commits:

  • Add docsearch keys (#875) ad50e65
  • Add fastfield to docs (#874) d610ea1
  • Add link to author on blog post 0c782d0
  • Add resource links, authors, dates 0215158
  • Update resources.md b00159c
  • Add typescript article to resource b5ce100
  • Add TypeScript sandbox 85b698e
  • Update overview.md 4a13455
  • Fix users links to palmer.net 8602c40
  • Update connect.md a9553ad
  • Implement sCU for (#873) d92ea8d
  • Update siteConfig.js ec0dfe7
  • Fix edit page button 3b2c5b6
  • Fix get started button on website addf9c5
  • Fix travis script d24983f
  • Website! (#866) 891ab5e
formik -

Published by jaredpalmer about 6 years ago

Patch Release

  • Remove redundant Field handlers now that validation lives in parent (#872) b177c7e
  • Fix uncaught error when use validateField on async validation (#855) 8d7d586
  • Prevent setState calls in submit if unmounted after validation (#861) 01f852e
  • Add registration methods to InjectFormikProps TS type (#864) 11a1362
  • placeholder should be lastName (#863) 46449ac
  • rename yupHelpers tests so they will be picked up by jest testMatch (#858) d59bd90
  • Minor grammatical fixes to README.md (#856) ed7391a
formik -

Published by jaredpalmer about 6 years ago

  • Swapped the ordering of Formik's TypeScript Generics for more ergonomic usage with TypeScript 3.x. You can now do <Formik<Values> ....> instead of <Formik<{}, Values> ....>. The first generic was used for so that we could properly get type safety on withFormik(). Ordering didn't matter prior to the introduction of JSX Generics, but now, with this swap, the more common usage is easier to type.
formik -

Published by jaredpalmer about 6 years ago

Bugs squashed

  • Fixed array helpers push()
  • Fixed error merging, when values contains array of objects

Commits:

  • Fix MultistepWizard example (#840) 257e203
  • Fix array helpers push side effect issue (#842) 55d56d4
  • Bump TypeScript to 3.0.1 internally 142add3
  • Add @types/yup to devDeps 30adbc1
  • Fix error merging, when values contains array of objects (#836) 72d5b7f
formik - v1.0.3

Published by jaredpalmer about 6 years ago

Patch Release

Bug fixes

  • Update examples/Basic.tsx (#810)
  • fix: correct typing of handleSubmit in FormikHandlers (#817)
  • Fix FastField for number input with empty value (#806)
  • fix: remove key from object on setIn with undefined value (#781)
  • Fix type of handleChange on FormikHandlers (#799)
  • Fix small typo in README.md (#800)
  • Set error and reset isValidating in validateField (#792)
formik -

Published by jaredpalmer about 6 years ago

Patch Release

  • Added tslib as a dependency for a smaller bundle!
  • Field-level validation now works with nested dot paths (was broken before)
  • Fixed some typos in docs
  • New Formik x React Native demo on Expo Snack

Commits:

  • Fix typo (duplicate word) in ReadMe (#787) 39efcfe
  • Tweak package.json (trying to publish with np with 2fa) c94368a
  • Update README.md (#776) a4fb200
  • Update README.md (#777) 0074812
  • Fixes README gzip badge. (#782) d8f3aa7
  • Add tslib as a dependency (#765) d74445f
  • Fix #773. Field Level Validation not using getIn (#774) e0ab364
  • Add React Native Demo via Expo Snack 3cfebfb
  • Update README.md b78781e
formik -

Published by jaredpalmer about 6 years ago

Smoke test

  • Added tslib as a dependency for a smaller bundle, and want to smoke test it on some applications. Let us know if you run into problems
  • Field-level validation now works with nested dot paths
  • Some docs
  • Added a link to a Formik x React Native demo on Expo Snack

Commits:

  • Tweak package.json (trying to publish with np with 2fa) c94368a
  • Update README.md (#776) a4fb200
  • Update README.md (#777) 0074812
  • Fixes README gzip badge. (#782) d8f3aa7
  • Add tslib as a dependency (#765) d74445f
  • Fix #773. Field Level Validation not using getIn (#774) e0ab364
  • Add React Native Demo via Expo Snack 3cfebfb
  • Update README.md b78781e
formik -

Published by jaredpalmer over 6 years ago

Patch

  • Fixes submit behavior when validation fails. Do not use beta.9 #759
  • Added tests for new validation and submit behavior
formik -

Published by jaredpalmer over 6 years ago

Minor Improvement

Fully backwards compat

  • Added more docs and FAQ's about submission process
  • Documented connect() higher-order component
  • Added isValidating: boolean to Formik state!!! #753
    • isValidating is now set to true whenever validation is run. This includes validation before submission. This means that you can display UI in response to more state combinations. Mostly, if isSubmitting is true and isValidating is false, you can now know you are going executing you submission handler. When both isSubmitting and isValidating are false, you know you are back to idle state. Remember, that isSubmitting still means "is submit being attempted?" so you can / should still use it to prevent double submits by using it to disable buttons etc.

What's next?

  • Deprecate submitCount for submitAttemptCount
  • Add submitSuccessCount and submitFailCount
  • 1.0 Launch
  • Open discussion about starting to fully unify the the API's for Formik and withFormik to simplify the documentation.
formik -

Published by jaredpalmer over 6 years ago

Patch

  • Fixed #720 which appears to have impacted 1.0.0-beta.4+ where generated TypeScript 2.9 definitions had incorrect paths to certain deps. This turned out to be a TypeScript bug https://github.com/Microsoft/TypeScript/issues/25511 ...womp..womp. Since TypeScript 3.0 is coming very very soon, I upgrade Formik's TypeScript devDep to 3 and used that to build before publishing this release to NPM. This should mitigate this problem.

Thank you to everyone who reported the issue.

Package Rankings
Top 0.27% on Npmjs.org
Top 3.35% on Proxy.golang.org
Badges
Extracted from project README
Stable Release Blazing Fast gzip size license Discord