|
1 | 1 | # mobx-view-model |
2 | 2 |
|
| 3 | +## 8.0.0 |
| 4 | + |
| 5 | +### Major Changes |
| 6 | + |
| 7 | +- [#24](https://github.com/js2me/mobx-view-model/pull/24) [`16d7a26`](https://github.com/js2me/mobx-view-model/commit/16d7a26a694eb1eed5854aa90f2d49d6dee67f70) Thanks [@js2me](https://github.com/js2me)! - removed all marked as deprecation properties and methods |
| 8 | + |
| 9 | + - Removed `config` property in `ViewModelParams` interface (renamed to `vmConfig`) |
| 10 | + - Removed `linkStore` method in `ViewModelSimple` interface (renamed to `attachViewModelStore`) |
| 11 | + - Removed type `ComponentWithLazyViewModel` (renamed to `VMLazyComponent`) |
| 12 | + - Removed type `ComponentWithViewModel` (renamed to `VMComponent`) |
| 13 | + - Removed `params` property in `ViewModelBase` class (renamed to `vmParams`) |
| 14 | + |
| 15 | +- [#24](https://github.com/js2me/mobx-view-model/pull/24) [`16d7a26`](https://github.com/js2me/mobx-view-model/commit/16d7a26a694eb1eed5854aa90f2d49d6dee67f70) Thanks [@js2me](https://github.com/js2me)! - modified global payload processing |
| 16 | + |
| 17 | + Previosly `viewModelsConfig` haved the following configuration: |
| 18 | + |
| 19 | + ```ts |
| 20 | + comparePayload: 'strict', |
| 21 | + payloadObservable: 'ref', |
| 22 | + payloadComputed: false, |
| 23 | + ``` |
| 24 | + |
| 25 | + So it was a bit performance overhead. Now it is: |
| 26 | + |
| 27 | + ```ts |
| 28 | + comparePayload: false, |
| 29 | + payloadComputed: 'struct', |
| 30 | + payloadObservable: 'ref', |
| 31 | + ``` |
| 32 | + |
| 33 | +### Minor Changes |
| 34 | + |
| 35 | +- [#24](https://github.com/js2me/mobx-view-model/pull/24) [`16d7a26`](https://github.com/js2me/mobx-view-model/commit/16d7a26a694eb1eed5854aa90f2d49d6dee67f70) Thanks [@js2me](https://github.com/js2me)! - added default implementation for `generateId` property in global `viewModelsConfig` |
| 36 | + |
| 37 | +- [#24](https://github.com/js2me/mobx-view-model/pull/24) [`16d7a26`](https://github.com/js2me/mobx-view-model/commit/16d7a26a694eb1eed5854aa90f2d49d6dee67f70) Thanks [@js2me](https://github.com/js2me)! - `id` property now is optional for implementation for `ViewModelSimple` interface |
| 38 | + |
| 39 | + Now you can do not implement `ViewModelSimple` interface to work with this library: |
| 40 | + |
| 41 | + ```tsx |
| 42 | + class MyVM { |
| 43 | + bar = '1' |
| 44 | + } |
| 45 | + ... |
| 46 | + const model = useCreateViewModel(MyVM); |
| 47 | + return <div>{model.bar}</div>; |
| 48 | + ``` |
| 49 | + |
| 50 | + ```tsx |
| 51 | + class MyVM { |
| 52 | + foo = '1'; |
| 53 | + } |
| 54 | + ... |
| 55 | + const YouComponent = withViewModel(MyVM, ({ model }) => { |
| 56 | + return <div>{model.foo}</div> |
| 57 | + }); |
| 58 | + ``` |
| 59 | + |
| 60 | +- [#24](https://github.com/js2me/mobx-view-model/pull/24) [`16d7a26`](https://github.com/js2me/mobx-view-model/commit/16d7a26a694eb1eed5854aa90f2d49d6dee67f70) Thanks [@js2me](https://github.com/js2me)! - `parentViewModel` property for `ViewModelSimple` interface |
| 61 | + |
| 62 | +### Patch Changes |
| 63 | + |
| 64 | +- [#24](https://github.com/js2me/mobx-view-model/pull/24) [`16d7a26`](https://github.com/js2me/mobx-view-model/commit/16d7a26a694eb1eed5854aa90f2d49d6dee67f70) Thanks [@js2me](https://github.com/js2me)! - fixed typings for `ParentViewModel` generic type argument for all interfaces/classes (support AnyViewModelSimple) |
| 65 | + |
3 | 66 | ## 7.2.0 |
4 | 67 |
|
5 | 68 | ### Minor Changes |
|
0 commit comments