Skip to content

Releases: Andrei15193/react-model-view-viewmodel

3.0.0

17 Nov 22:18
Compare
Choose a tag to compare

This release is focused mostly on revamping the form model and providing a complete implementation for observable collections, along side observable sets and observable maps.

After using the library in more complex ways, I have managed to distill the form definitions and provide a better implementation that allows for just about any level of complexity without having to know about all features.

Using forms is as simple as it needs to be depending on the use case. If you have a simple form and need a bunch of fields, then all you would do is define the form and initialize the fields.

Validation has been revamped as well, making it easier to add and remove validators along side triggers which have been extended to include collection changed triggers (all observable collections are supported) as well as collection item changes in case there is need to validate for uniqueness of a field value or check if individual amounts in a list of items sum up to the total.

Documentation is now being generated using typedoc, check the wiki, a lot has been added especially to the Form class.

Breaking Changes

  • Everything related to forms has breaking changes, please take a migration effort into consideration when switching to this version
  • Collections no longer use spread operator when initializing with items, an iterable is being used as an optional parameter.
  • A number of hooks have been updated or removed.
  • The input component has been removed.
  • Event handler type definitions have been updated to include type-safety using generics.

Summary

3.0.0-rc.1

24 Oct 15:47
Compare
Choose a tag to compare
3.0.0-rc.1 Pre-release
Pre-release

This release is focused mostly on revamping the form model and providing a complete implementation for observable collections, along side observable sets and observable maps.

After using the library in more complex ways, I have managed to distill the form definitions and provide a better implementation that allows for just about any level of complexity without having to know about all features.

Using forms is as simple as it needs to be depending on the use case. If you have a simple form and need a bunch of fields, then all you would do is define the form and initialize the fields.

Validation has been revamped as well, making it easier to add and remove validators along side triggers which have been extended to include collection changed triggers (all observable collections are supported) as well as collection item changes in case there is need to validate for uniqueness of a field value or check if individual amounts in a list of items sum up to the total.

Documentation is now being generated using typedoc, check the wiki, a lot has been added especially to the Form class.

Breaking Changes

  • Everything related to forms has breaking changes, please take a migration effort into consideration when switching to this version
  • Collections no longer use spread operator when initializing with items, an iterable is being used as an optional parameter.
  • A number of hooks have been updated or removed.
  • The input component has been removed.
  • Event handler type definitions have been updated to include type-safety using generics.

Summary

2.2.0

22 Oct 17:06
Compare
Choose a tag to compare

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.

2.2.0-rc.3

14 Sep 20:37
Compare
Choose a tag to compare
2.2.0-rc.3 Pre-release
Pre-release

Bug Fixes

2.2.0-rc.2

08 Sep 20:24
Compare
Choose a tag to compare
2.2.0-rc.2 Pre-release
Pre-release

Bug Fixes

  • Fixed useViewModel when changing the instance without unmounting the component.

2.2.0-rc.1

03 Sep 19:20
Compare
Choose a tag to compare
2.2.0-rc.1 Pre-release
Pre-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 a single useViewModel one. The useViewModelType, useViewModelFactory, and watchViewModel hooks have been marked as deprecated and their implementation is now based on the useViewModel one. They will continue to function the exact same way, however they will be removed with the next major release.

The new useViewModel hook has 3 overloads, we can now specify deps and constructor arguments (which also act as deps), for more info see the documentation.

All hooks will follow the proper naming conventions, the ones that do not follow the conventions 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.

For more information around the reasoning around these decisions see the Discussions / React [email protected] announcement.

2.1.0

27 May 19:23
Compare
Choose a tag to compare

2.0.1

20 Jun 09:50
Compare
Choose a tag to compare

Release Notes

  • GH-2 Fixed observable collection reduce methods

2.0.0

18 Jun 13:46
Compare
Choose a tag to compare

New Features

  • Added ReadOnlyObservableCollection and ObservableCollection classes

Breaking Changes

  • Removed observableCollection function in favour of new classes
  • Added itemAdded and itemRemoved events to INotifyCollectionChanged<TItem> interface

2.0.0-beta.1

05 Jun 09:23
Compare
Choose a tag to compare
2.0.0-beta.1 Pre-release
Pre-release

New Features

  • Added ReadOnlyObservableCollection and ObservableCollection classes

Breaking Changes

  • Removed observableCollection function in favour of new classes
  • Added itemAdded and itemRemoved events to INotifyCollectionChanged<TItem> interface