Releases: JoviDeCroock/Hooked-Form
4.2.1
The long wait
Breaking
- The components have made place for a full hooks implementation (
Field
,FieldArray
andError
are gone). useFieldArray.remove
now only accepts a numerical index instead of an object or an index.validateOnBlur
is now defaultfalse
in<HookedForm />
in theForm
HOC it will remain defaulttrue
Deprecation
The Form
HOC is deprecated in favor of the <HookedForm />
component
Features
<HookedForm>
component which abstracts the<form>
field away, you can pass in props just as you would normally do.initialErrors
are supported on<HookedForm>
onSuccess
now receives aSuccessBag
containingresetForm
useSpy
hook that allows you to spy on arbitrary form values and execute a callback with access to context.
Internals
We have moved to an internal emitter which is winning us a lot in the performance and bundle size area's
Concluding: performance++ and size -300Bytes (even with the added features)
Performance
After seeing results of: https://81swz.codesandbox.io/
I decided to focus a bit on more bundle size savings and performance.
Only internal changes have been made to achieve this.
Performance!
1.6.0
Unofficial Preact X support (all tests succeed but one and this is not due to it not working but due to a scheduling diff in preact and react)!
You can use the components with preact/compat
.
The hooks and Form are available in preact
Feature
- Hooked-form now offers a new feature named
useFormConnect
, this hooks returns you all the metadata and values for the current form. - isDirty is now injected into the form.
Fixes
- toPath now does not fail when trying to resolve numbers like pins[200] this would return 2 before this fix.
Chores
- After a great PR by @Pruxis where he replaced all object recreation with mutations in the reduce function to deriveInitial values etc we went even further and made the reduce into a for in.
- nested if statements have been reduced by inlining them all (these were mainly dev checks)
Planned
- Deprecate injection of values, touched and validate. This can be asked by using
useFormConnect
, the main reason behind this being the notion that this rerenders the component very often without too much added value.
React hooks official release
1.3.1 chore: update lockfile
bundle size oriented release
After a few releases fully focussed on performance and helping new devs not fall into common pitfalls this new one focusses on reducing the bundle to 2.8KB (minzipped)!
Focussed on performance
- Heavily reduced bundleSize
- New Array methods (swap, ...)
First Draft
This is the first working draft of the library, still needs some working on the array methods but in essence it serves its purpose for my usage goals.