Releases: Andrei15193/react-model-view-viewmodel
2.2.0
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
Bug Fixes
- Separated
useViewModel
callback overload into separateuseViewModelMemo
hook. There is no guaranteed way of checking whether a function can be used with thenew
operator or not in JavaScript other than attempting a call. This makes it impossible to safely distinguish between the type and callback overload. More information here: https://stackoverflow.com/questions/30758961/how-to-check-if-a-variable-is-an-es6-class-declaration.
2.2.0-rc.2
Bug Fixes
- Fixed
useViewModel
when changing the instance without unmounting the component.
2.2.0-rc.1
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 MVVM@2.2.0 announcement.
2.1.0
2.0.1
2.0.0
New Features
- Added
ReadOnlyObservableCollection
andObservableCollection
classes
Breaking Changes
- Removed
observableCollection
function in favour of new classes - Added
itemAdded
anditemRemoved
events toINotifyCollectionChanged<TItem>
interface
2.0.0-beta.1
New Features
- Added
ReadOnlyObservableCollection
andObservableCollection
classes
Breaking Changes
- Removed
observableCollection
function in favour of new classes - Added
itemAdded
anditemRemoved
events toINotifyCollectionChanged<TItem>
interface
1.0.0
A library for developing React applications using Model-View-ViewModel inspired by .NET.
The Model-View-ViewModel architectural pattern is a viable alternative to the Flux architectural pattern, it does not have the same issues Flux has, but knowing and understanding the Flux principles can increase the quality of code written using MVVM.
This release includes a wide range of tools for implementing applications using MVVM as well as a simple, yet effective event system inspired by the one in .NET. Base implementations of core interfaces and features (ViewModel, FormFieldViewModel<TValue>, FormFieldCollectionViewModel and DispatchEvent<TEventArgs>) as well as an observable collection that extends the read-only array interface, observableCollection<TItem>.
The library provides a wide range of custom React hooks to make development easier. The project wiki contains the entire list as well as API documentation, a tutorials list as well as project motivation and overview.
1.0.0-beta6
A library for developing React applications using Model-View-ViewModel inspired by .NET.
This is a preparation release to test integration with other applications from the npm repository as a package dependency. While the library is unit tested extensively, the usage in different application will serve as additional testing. The testing application used for this purpose is HintKeep, refer to the related project for more information and usage.
For more information about the package see the wiki.