Skip to content

2.2.0

Compare
Choose a tag to compare
@Andrei15193 Andrei15193 released this 22 Oct 17:06
· 136 commits to dev since this release

This is more or less a consolidation release. After using the library for a while and encountering different scenarios I have come to the conclusion that some adjustments need to be made to improve it.

Hook Naming and Unification

With this release I am unifying the view model related hooks under useViewModel for useViewModelType and watchViewModel, while useViewModelFactory is renamed to useViewModelMemo.

The existing hooks will still work, they have been marked as deprecated and their implementations are now based on the new ones.

For more information, check the wiki.

With this release, all hooks will follow the proper naming conventions, the ones that do not have been marked as deprecated and will be removed with the next major release. For more information see Reusing Logic with Custom Hooks - Hook names always start with use.

Form Field Flag Deprecations

The .isFocused and .isTouched flags have been marked as deprecated. The former is not exactly a UI logic concern, but rather a purely UI presentation concern, the components handle the focus state of the inputs, not the view model. The latter was removed as not all forms may need this and can easily be added back, along side any other desired properties, though form extensibility.

Form Extensibility

Forms have been updated to allow easier extensibility, the base types are still available, however it is easier to have custom fields and reuse/extend the form field collection type.

Fields follow the config-style approach for constructors allowing for instances to be created and have their properties set in one go. This works well with subclasses as the base config interface can be extended to include more fields.

Tutorials

The tutorials are covered as GitHub Discussions as this allows for easier maintenance and long-term support. People can add comments and react. The ToDo list tutorial will be retired along with the repository for it, the tutorials can be run on CodeSandbox.

For more information check the Guides and Tutorials category.