Hooked-Form

Performant 2KB React library to manage your forms

MIT License

Downloads
340
Stars
112
Committers
9

Bot releases are visible (Hide)

Hooked-Form - 4.2.1 Latest Release

Published by JoviDeCroock over 4 years ago

This release includes some improvements to the general typings and a size improvment of 30kb minzipped!

Hooked-Form - The long wait

Published by JoviDeCroock almost 5 years ago

Breaking

  • The components have made place for a full hooks implementation (Field, FieldArray and Error are gone).
  • useFieldArray.remove now only accepts a numerical index instead of an object or an index.
  • validateOnBlur is now default false in <HookedForm /> in the Form HOC it will remain default true

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 a SuccessBag containing resetForm
  • 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)

Hooked-Form - Performance

Published by JoviDeCroock over 5 years ago

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.

Hooked-Form - Performance!

Published by JoviDeCroock over 5 years ago

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.
Hooked-Form - React hooks official release

Published by JoviDeCroock over 5 years ago

Hooked-Form - bundle size oriented release

Published by JoviDeCroock over 5 years ago

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)!

Hooked-Form - Focussed on performance

Published by JoviDeCroock almost 6 years ago

  • Heavily reduced bundleSize
  • New Array methods (swap, ...)
Hooked-Form - First Draft

Published by JoviDeCroock almost 6 years ago

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.