@jbrowse/mobx-state-tree 5.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md ADDED
@@ -0,0 +1,677 @@
1
+ The manually-updated changelog has been discontinued. For versions > 4.0.0, go here to view changes:
2
+
3
+ [https://github.com/mobxjs/mobx-state-tree/releases](https://github.com/mobxjs/mobx-state-tree/releases)
4
+
5
+ # 4.0.0
6
+
7
+ [BREAKING CHANGE] MST 4.0 requires MobX 6
8
+
9
+ # 3.17.3
10
+
11
+ Add onValidated support to safeReference [#1540 by @orlovcs](https://github.com/mobxjs/mobx-state-tree/pull/1540)
12
+
13
+ # 3.17.2
14
+
15
+ Fix incorrect access to global `fail` symbol [#1549](https://github.com/mobxjs/mobx-state-tree/pull/1549)
16
+
17
+ # 3.17.1
18
+
19
+ Re-release 3.17.0
20
+
21
+ # 3.17.0
22
+
23
+ - Added experimental helpers toGenerator and toGeneratorFunction. [#1543](https://github.com/mobxjs/mobx-state-tree/pull/1543) by [@fruitraccoon](https://github.com/fruitraccoon)
24
+
25
+ # 3.16.0
26
+
27
+ - Added search field to the docs
28
+ - Custom types can now receive environments as second argument of the `fromSnapshot` option. [#1410](https://github.com/mobxjs/mobx-state-tree/pull/1410) by [@k-g-a](https://github.com/k-g-a)
29
+ - Added option `maxHistoryLength` to the `UndoManager`, implements [#1417](https://github.com/mobxjs/mobx-state-tree/issues/1417) through [#1426](https://github.com/mobxjs/mobx-state-tree/pull/1426) by [@tibotiber](https://github.com/tibotiber).
30
+ - Improved TypeScript typings of `flow`, fixes [#1378](https://github.com/mobxjs/mobx-state-tree/pull/1378) through [#1409](https://github.com/mobxjs/mobx-state-tree/pull/1409) by [@nulladdict](https://github.com/nulladdict)
31
+ - Fixed that calling `createObservableInstanceIfNeeded` would execute an action, even if the function immediately returned. (significant since the extraneous actions would pollute the mobx dev-tools on mere accesses, eg. by ComplexType.prototype.getValue) Fixes [#1421](https://github.com/mobxjs/mobx-state-tree/issues/1421) trough [#1422](https://github.com/mobxjs/mobx-state-tree/pull/1422) by [@Venryx](https://github.com/Venryx)
32
+ - Fix issue where `snapshotProcessor.is` does not correctly handle model instances. Fixes [#1494](https://github.com/mobxjs/mobx-state-tree/issues/1494) through [#1495](https://github.com/mobxjs/mobx-state-tree/pull/1495) by [@KevinSjoberg](https://github.com/KevinSjoberg)
33
+ - Make sure that MST no longer requires `setImmediate` to be present, but fallback to other solutions. [#1501](https://github.com/mobxjs/mobx-state-tree/pull/1501) by [@isaachinman](https://github.com/isaachinman)
34
+
35
+ # 3.15.0
36
+
37
+ - Fix for flow typings. This means that now using flows requires at least TypeScript v3.6 and that `castFlowReturn` becomes deprecated.
38
+ - Fix for empty models / models with all properties set to optional being able to take any value in TypeScript through [#1269](https://github.com/mobxjs/mobx-state-tree/pull/1269) by [@xaviergonz](https://github.com/xaviergonz).
39
+
40
+ # 3.14.1
41
+
42
+ - Made it possible to force full run-time type-checking (for better error messages) in production builds by setting `ENABLE_TYPE_CHECK=true` as environment variable. Fixes [#1332](https://github.com/mobxjs/mobx-state-tree/pull/1332) through [#1337](https://github.com/mobxjs/mobx-state-tree/pull/1337) by [@OverseePublic](https://github.com/OverseePublic)
43
+ - Fixed an issue where `Type.is` doesn't behave correctly for types that has snapshot processors. Fixes [#1321](https://github.com/mobxjs/mobx-state-tree/issues/1321) through [#1323](https://github.com/mobxjs/mobx-state-tree/pull/1323) by [@Tucker-Eric](https://github.com/Tucker-Eric)
44
+ - Changed the implementation of the internal `STNValue` type, to fix TS 3.5.3 compatibility. If somebody notices regressions in the TypeScript integration, please report. Fixes [#1343](https://github.com/mobxjs/mobx-state-tree/issues/1343), [#1307](https://github.com/mobxjs/mobx-state-tree/issues/1307)
45
+ - Added `acceptsUndefined` as option for `safeReference` so it is more suitable to be used inside arrays/maps, through [#1245](https://github.com/mobxjs/mobx-state-tree/pull/1245) by [@xaviergonz](https://github.com/xaviergonz).
46
+
47
+ # 3.14.0
48
+
49
+ - Fixed a regression with `atomic` middleware with async flows [#1250](https://github.com/mobxjs/mobx-state-tree/issues/1250).
50
+ - Added filter function to `recordActions` to filter out recording some actions. Also added `recording` and `resume` methods.
51
+ - Added `getRunningActionContext()` to get the currently executing MST action context (if any). Also added the action context helper functions `isActionContextChildOf()` and `isActionContextThisOrChildOf`.
52
+ - Reduced type nesting to avoid Typescript 3.4 errors about infinite types. Sadly due to this change `types.create` is no longer smart enough in TS to know if skipping the snapshot parameter is valid or not. Through [#1251](https://github.com/mobxjs/mobx-state-tree/pull/1251) by [@xaviergonz](https://github.com/xaviergonz).
53
+
54
+ # 3.13.0
55
+
56
+ - Fixed `Instance<typeof variable>` not giving the proper type in Typescript when the type included both objects and primitives.
57
+ - Through PR [#1196](https://github.com/mobxjs/mobx-state-tree/pull/1196) by [@xaviergonz](https://github.com/xaviergonz)
58
+ - Added `createActionTrackerMiddleware2`, a more easy to use version of the first one, which makes creating middlewares for both sync and async actions more universal.
59
+ - Added an optional filter to `recordPatches` to be able to skip recording certain patches.
60
+ - `atomic` now uses the new `createActionTrackerMiddleware2`.
61
+ - `UndoManager` fixes and improvements:
62
+ - Uses the new `createActionTrackerMiddleware2`.
63
+ - Added `clearUndo` and `clearRedo` to only clear those.
64
+ - Added `undoLevels` and `redoLevels` to know how many undo/redo actions are available.
65
+ - Made undo manager actions atomic, so they won't actually do any partial changes if for some reason they fail.
66
+ - Fix for `withoutUndo` so it will only skip recording what is inside, not the whole action - fixes [#1195](https://github.com/mobxjs/mobx-state-tree/issues/1195).
67
+
68
+ # 3.12.2
69
+
70
+ - Added more output formats for the library (common-js minified version and umd minified version). Note that now the umd version will be the development version while the new umd.min version will be the production version. This change is to keep it in sync with the parent mobx package. Also the npm package is now leaner since it mistakenly included separatedly compiled js files and source maps.
71
+
72
+ # 3.12.1
73
+
74
+ - Fixed a regression with `getEnv` sometimes not returning the proper environment.
75
+ - Fixed an issue where `map.put` would not work with snapshots of types with an optional id [#1131](https://github.com/mobxjs/mobx-state-tree/issues/1131) through [#1226](https://github.com/mobxjs/mobx-state-tree/pull/1226) by [@xaviergonz](https://github.com/xaviergonz).
76
+
77
+ # 3.12.0
78
+
79
+ - Added `TypeOfValue<typeof variable>` to extract the type of a complex (non primitive) variable in Typescript.
80
+ - Fixed some Typescript issues with optional arrays [#1218](https://github.com/mobxjs/mobx-state-tree/issues/1218) through [#1229](https://github.com/mobxjs/mobx-state-tree/pull/1229) by [@xaviergonz](https://github.com/xaviergonz)
81
+ - Added `getNodeId` to get the internal unique node id for an instance [#1168](https://github.com/mobxjs/mobx-state-tree/issues/1168) through [#1225](https://github.com/mobxjs/mobx-state-tree/pull/1225) by [@xaviergonz](https://github.com/xaviergonz)
82
+ - Fixed nodes being `pop`/`shift`/`splice` from an array not getting properly destroyed through [#1205](https://github.com/mobxjs/mobx-state-tree/pull/1205) by [@xaviergonz](https://github.com/xaviergonz). Not that this means that in order to access the returned dead nodes data without getting a liveliness error/warning then the returned dead nodes have to be either cloned (`clone`) or their snapshots (`getSnapshot`) have to be used first.
83
+
84
+ # 3.11.0
85
+
86
+ - Added an optional third argument to `types.optional` that allows to set alternative optional values other than just `undefined` through [#1192](https://github.com/mobxjs/mobx-state-tree/pull/1192) by [@xaviergonz](https://github.com/xaviergonz)
87
+ - Fixed detaching arrays/maps killing their children [#1173](https://github.com/mobxjs/mobx-state-tree/issues/1173) through [#1175](https://github.com/mobxjs/mobx-state-tree/pull/1175) by [@xaviergonz](https://github.com/xaviergonz)
88
+ - Added `types.snapshotProcessor` [#947](https://github.com/mobxjs/mobx-state-tree/issues/947) through [#1165](https://github.com/mobxjs/mobx-state-tree/pull/1165) by [@xaviergonz](https://github.com/xaviergonz). This feature will eventually deprecate `postProcessSnapshot` and `preProcessSnapshot` from models in a next major version.
89
+ - Performance improvement for event handlers so they consume less RAM through [#1160](https://github.com/mobxjs/mobx-state-tree/pull/1160) by [@xaviergonz](https://github.com/xaviergonz)
90
+ - Make liveliness errors give more info to trace their cause [#1142](https://github.com/mobxjs/mobx-state-tree/issues/1142) through [#1147](https://github.com/mobxjs/mobx-state-tree/pull/1147) by [@xaviergonz](https://github.com/xaviergonz)
91
+
92
+ # 3.10.2
93
+
94
+ - Fixed a regression regarding json paths not being correctly rooted to the base [#1128](https://github.com/mobxjs/mobx-state-tree/issues/1128) through [#1146](https://github.com/mobxjs/mobx-state-tree/pull/1146) by [@xaviergonz](https://github.com/xaviergonz)
95
+
96
+ # 3.10.1
97
+
98
+ - Fixed mobx 5.9.0 compatibility [#1143](https://github.com/mobxjs/mobx-state-tree/issues/1143) through [#1144](https://github.com/mobxjs/mobx-state-tree/pull/1144) by [@xaviergonz](https://github.com/xaviergonz)
99
+ - Made liveliness checking in warn mode log an error so the stack trace can be seen [#1142](https://github.com/mobxjs/mobx-state-tree/issues/1142) through [#1145](https://github.com/mobxjs/mobx-state-tree/pull/1145) by [@xaviergonz](https://github.com/xaviergonz)
100
+ - Fixed JSON path escaping, where '/' and '~' were incorrectly being encoded/decoded as '~0' and '~1' rather than '~1' and '~0'. Also fixed empty keys not being handled correctly by JSON patches [#1128](https://github.com/mobxjs/mobx-state-tree/issues/1128). Fixed through [#1129](https://github.com/mobxjs/mobx-state-tree/pull/1129) by [@xaviergonz](https://github.com/xaviergonz)
101
+
102
+ # 3.10.0
103
+
104
+ - Fix for safeReference doesn't work when multiple nodes reference a single reference that gets deleted [#1115](https://github.com/mobxjs/mobx-state-tree/issues/1115) through [#1121](https://github.com/mobxjs/mobx-state-tree/pull/1121) by [@xaviergonz](https://github.com/xaviergonz)
105
+ - Little fix for `castFlowReturn` not typecasting the promise to its actual result.
106
+ - Made `isAlive(node)` reactive, so it can be reacted upon through [#1100](https://github.com/mobxjs/mobx-state-tree/pull/1100) by [@xaviergonz](https://github.com/xaviergonz)
107
+ - Fix for unaccessed nodes not unregistering their identifiers [#1112](https://github.com/mobxjs/mobx-state-tree/issues/1112) through [#1113](https://github.com/mobxjs/mobx-state-tree/pull/1113) by [@xaviergonz](https://github.com/xaviergonz)
108
+ - Added `clear()` to `UndoManager` middleware through [#1118](https://github.com/mobxjs/mobx-state-tree/pull/1118) by [@chemitaxis](https://github.com/chemitaxis)
109
+
110
+ # 3.9.0
111
+
112
+ - TypeScript 3.0 or later is now required when using TypeScript. This brings some improvements:
113
+ - `flow` arguments and return types are now correctly inferred automatically. One exception is when the last return of a `flow` is a `Promise`. In these cases `castFlowReturn(somePromise)` needs to be used so the return type can be inferred properly.
114
+ - `create` method is now smart enough to warn when no snapshot argument is provided on types that have some mandatory properties.
115
+ - Added `setLivelinessChecking` and `getLivelinessChecking`, the old `setLivelynessChecking` will eventually be deprecated.
116
+ - Added `onInvalidated` option for references and `types.safeReference` (see readme) through [#1091](https://github.com/mobxjs/mobx-state-tree/pull/1091) by [@xaviergonz](https://github.com/xaviergonz)
117
+ - Added `tryReference` and `isValidReference` to use references that might be no longer pointing to any nodes in a safe way through [#1087](https://github.com/mobxjs/mobx-state-tree/pull/1087) by [@xaviergonz](https://github.com/xaviergonz)
118
+ - Readded `IComplexType` for backwards compatibility.
119
+
120
+ # 3.8.1
121
+
122
+ - Fixed non-initialized nodes not being destroyed [#1080](https://github.com/mobxjs/mobx-state-tree/issues/1080) through [#1082](https://github.com/mobxjs/mobx-state-tree/pull/1082) by [@k-g-a](https://github.com/k-g-a)
123
+ - Fixed a memory leak in createActionTrackingMiddleware when using flow [#1083](https://github.com/mobxjs/mobx-state-tree/issues/1083) through [#1084](https://github.com/mobxjs/mobx-state-tree/pull/1084) by [@robinfehr](https://github.com/robinfehr)
124
+
125
+ # 3.8.0
126
+
127
+ - Added castToSnapshot/castToReferenceSnapshot methods for TypeScript and fixed some TypeScript typings not being properly detected when using SnapshotIn types through [#1074](https://github.com/mobxjs/mobx-state-tree/pull/1074) by [@xaviergonz](https://github.com/xaviergonz)
128
+ - Fixed redux middleware throwing an error when a flow is called before it is connected [#1065](https://github.com/mobxjs/mobx-state-tree/issues/1065) through [#1079](https://github.com/mobxjs/mobx-state-tree/pull/1079) by [@mkramb](https://github.com/mkramb) and [@xaviergonz](https://github.com/xaviergonz)
129
+ - Made `addDisposer` return the passed disposer through [#1059](https://github.com/mobxjs/mobx-state-tree/pull/1059) by [@xaviergonz](https://github.com/xaviergonz)
130
+
131
+ # 3.7.1
132
+
133
+ - Fixed references to nodes being broken after the node was replaced [#1052](https://github.com/mobxjs/mobx-state-tree/issues/1052), plus speed up of reference resolving when using IDs through [#1053](https://github.com/mobxjs/mobx-state-tree/pull/1053) by [@xaviergonz](https://github.com/xaviergonz)
134
+
135
+ # 3.7.0
136
+
137
+ - Middleware events now also contain `allParentIds` (chain of causing ids, from root until (excluding) current)
138
+ - Improved redux dev tools integration, now supporting flows and showing action chains through [#1035](https://github.com/mobxjs/mobx-state-tree/pull/1035) based on a fix by [@bourquep](https://github.com/bourquep)
139
+
140
+ # 3.6.0
141
+
142
+ - Made type Typescript compilation when 'declarations' is set to true + type completion faster thanks to some type optimizations through [#1043](https://github.com/mobxjs/mobx-state-tree/pull/1043) by [@xaviergonz](https://github.com/xaviergonz)
143
+ - Fix for array reconciliation of union types with ids [#1045](https://github.com/mobxjs/mobx-state-tree/issues/1045) through [#1047](https://github.com/mobxjs/mobx-state-tree/pull/1047) by [@xaviergonz](https://github.com/xaviergonz)
144
+ - Fixed bug where the eager option for the union type defaulted to true when no options argument was passed but false when it was passed. Now they both default to true when not specified. Fixed through [#1046](https://github.com/mobxjs/mobx-state-tree/pull/1046) by [@xaviergonz](https://github.com/xaviergonz)
145
+
146
+ # 3.5.0
147
+
148
+ - Fix for afterCreate/afterAttach sometimes throwing an exception when a node was created as part of a view/computed property [#967](https://github.com/mobxjs/mobx-state-tree/issues/967) through [#1026](https://github.com/mobxjs/mobx-state-tree/pull/1026) by [@xaviergonz](https://github.com/xaviergonz). Note that this fix will only work if your installed peer mobx version is >= 4.5.0 or >= 5.5.0
149
+ - Fix for cast method being broken in Typescript 3.1.1 through [#1028](https://github.com/mobxjs/mobx-state-tree/pull/1028) by [@xaviergonz](https://github.com/xaviergonz)
150
+
151
+ # 3.4.0
152
+
153
+ - Added getPropertyMembers(typeOrNode) through [#1016](https://github.com/mobxjs/mobx-state-tree/pull/1016) by [@xaviergonz](https://github.com/xaviergonz)
154
+ - Fix for preProcessSnapshot not copied on compose [#613](https://github.com/mobxjs/mobx-state-tree/issues/613) through [#1013](https://github.com/mobxjs/mobx-state-tree/pull/1013) by [@theRealScoobaSteve](https://github.com/theRealScoobaSteve)
155
+ - Fix for actions sometimes failing to resolve this to self through [#1014](https://github.com/mobxjs/mobx-state-tree/pull/1014) by [@xaviergonz](https://github.com/xaviergonz)
156
+ - Fix for preProcessSnapshot not copied on compose [#613](https://github.com/mobxjs/mobx-state-tree/issues/613) through [#1013](https://github.com/mobxjs/mobx-state-tree/pull/1013) by [@theRealScoobaSteve](https://github.com/theRealScoobaSteve)
157
+ - Improvements to the bookshop example through [#1009](https://github.com/mobxjs/mobx-state-tree/pull/1009) by [@programmer4web](https://github.com/programmer4web)
158
+ - Fix for a regression with optional identifiers [#1019](https://github.com/mobxjs/mobx-state-tree/issues/1019) through [#1020](https://github.com/mobxjs/mobx-state-tree/pull/1020) by [@xaviergonz](https://github.com/xaviergonz)
159
+
160
+ # 3.3.0
161
+
162
+ - Fix for references sometimes not intializing its parents [#993](https://github.com/mobxjs/mobx-state-tree/issues/993) through [#997](https://github.com/mobxjs/mobx-state-tree/pull/997) by [@xaviergonz](https://github.com/xaviergonz)
163
+ - Fix for TS3 issues with reference type [#994](https://github.com/mobxjs/mobx-state-tree/issues/994) through [#995](https://github.com/mobxjs/mobx-state-tree/pull/995) by [@xaviergonz](https://github.com/xaviergonz)
164
+ - types.optional will now throw if an instance is directly passed as default value [#1002](https://github.com/mobxjs/mobx-state-tree/issues/1002) through [#1003](https://github.com/mobxjs/mobx-state-tree/pull/1003) by [@xaviergonz](https://github.com/xaviergonz)
165
+ - Doc fixes and improvements by [@AjaxSolutions](https://github.com/AjaxSolutions) and [@agilgur5](https://github.com/agilgur5)
166
+
167
+ # 3.2.4
168
+
169
+ - Further improvements for Typescript support for enumeration by [@xaviergonz](https://github.com/xaviergonz)
170
+ - Smaller generated .d.ts files through [#990](https://github.com/mobxjs/mobx-state-tree/pull/990) by [@xaviergonz](https://github.com/xaviergonz)
171
+ - Fix for exception when destroying children of types.maybe through [#985](https://github.com/mobxjs/mobx-state-tree/pull/985) by [@dsabanin](https://github.com/dsabanin)
172
+
173
+ # 3.2.3
174
+
175
+ - Fixed incorrect typing generation for mst-middlewares [#979](https://github.com/mobxjs/mobx-state-tree/issues/979)
176
+
177
+ # 3.2.2
178
+
179
+ - Fixes for the reconciliation algorithm of arrays [#928](https://github.com/mobxjs/mobx-state-tree/issues/928) through [#960](https://github.com/mobxjs/mobx-state-tree/pull/960) by [@liuqiang1357](https://github.com/liuqiang1357)
180
+ - Better Typescript support for enumeration, compose, union, literal and references by [@xaviergonz](https://github.com/xaviergonz)
181
+ - Updated dependencies to latest versions by [@xaviergonz](https://github.com/xaviergonz)
182
+ - [Internal] Cleanup 'createNode' and related codepaths through [#962](https://github.com/mobxjs/mobx-state-tree/pull/962) by [@k-g-a](https://github.com/k-g-a)
183
+
184
+ # 3.2.1
185
+
186
+ - Fix for wrong generated TS import [#968](https://github.com/mobxjs/mobx-state-tree/issues/968) through [#969](https://github.com/mobxjs/mobx-state-tree/pull/969) by [@k-g-a](https://github.com/k-g-a)
187
+
188
+ # 3.2.0
189
+
190
+ - Made the internal CreationType/SnapshotType/Type official via the new [`SnapshotIn`, `SnapshotOut`, `Instance` and `SnapshotOrInstance<typeof X>`](README.md#typeScript-and-mst) by [@xaviergonz](https://github.com/xaviergonz)
191
+ - A new [`cast` method](README.md#snapshots-can-be-used-to-write-values) that makes automatic casts from instances/input snapshots for assignments by [@xaviergonz](https://github.com/xaviergonz)
192
+
193
+ # 3.1.1
194
+
195
+ - Fixed typings of `getParent` and `getRoot`. Fixes [#951](https://github.com/mobxjs/mobx-state-tree/issues/951) through [#953](https://github.com/mobxjs/mobx-state-tree/pull/953) by [@xaviergonz](https://github.com/xaviergonz)
196
+
197
+ # 3.1.0
198
+
199
+ - Fixed issue where snapshot post-processors where not always applied. Fixes [#926](https://github.com/mobxjs/mobx-state-tree/issues/926), [#961](https://github.com/mobxjs/mobx-state-tree/issues/961), through [#959](https://github.com/mobxjs/mobx-state-tree/pull/959) by [@k-g-a](https://github.com/k-g-a)
200
+
201
+ # 3.0.3
202
+
203
+ - Fixed re-adding the same objects to an array. Fixes [#928](https://github.com/mobxjs/mobx-state-tree/issues/928) through [#949](https://github.com/mobxjs/mobx-state-tree/pull/949) by [@Krivega](https://github.com/Krivega)
204
+
205
+ # 3.0.2
206
+
207
+ - Introduced `types.integer`! By [@jayarjo](https://github.com/jayarjo) through [#935](https://github.com/mobxjs/mobx-state-tree/pull/935)
208
+ - Improved typescript typings, several fixes to the type system. Awesome contribution by [@xaviergonz](https://github.com/xaviergonz) through [#937](https://github.com/mobxjs/mobx-state-tree/pull/937) and [#945](https://github.com/mobxjs/mobx-state-tree/pull/945). Fixes [#922](https://github.com/mobxjs/mobx-state-tree/issues/922), [#930](https://github.com/mobxjs/mobx-state-tree/issues/930), [#932](https://github.com/mobxjs/mobx-state-tree/issues/932), [#923](https://github.com/mobxjs/mobx-state-tree/issues/923)
209
+ - Improved handling of `types.late`
210
+
211
+ # 3.0.1 (retracted)
212
+
213
+ # 3.0.0
214
+
215
+ Welcome to MobX-state-tree! This version introduces some breaking changes, but nonetheless is an recommended upgrade as all changes should be pretty straight forward and there is no reason anymore to maintain the 2.x range (3.0 is still compatible with MobX 4)
216
+
217
+ ## Most important changes
218
+
219
+ MST 3 is twice as fast in initializing trees with half the memory consumption compared to version 2:
220
+
221
+ Running `yarn speedtest` on Node 9.3:
222
+
223
+ | | MST 2 | MST 3 |
224
+ | --------------- | ------ | ------ |
225
+ | Time | 24sec | 12 sec |
226
+ | Mem | 315MB | 168MB |
227
+ | Size (min+gzip) | 14.1KB | 15.0KB |
228
+
229
+ Beyond that, MST 3 uses TypeScript 2.8, which results in more accurate TypeScript support.
230
+
231
+ The type system has been simplified and improved in several areas. Several open issues around maps and (numeric) keys have been resolved. The `frozen` type can now be fully typed. See below for the full details.
232
+
233
+ Also, the 'object has died' exception can be suppressed now. One should still address it, but at least it won't be a show-stopper from now on.
234
+
235
+ ## Changes in the type system
236
+
237
+ - **[BREAKING]** `types.identifier` can no longer be parameterized with either `types.string` or `types.number`. So instead of `types.identifier()` use `types.identifier`. Identifiers are now always normalized to strings. This reflects what was already happening internally and solves a lot of edge cases. To use numbers as identifiers, `types.identifierNumber` (instead of `types.identifier(types.number)`) can be used, which serializes it's snapshot to a number, but will internally work like a string based identifier
238
+ - **[BREAKING]** `types.maybe` now serializes to / from `undefined` by default, as it is more and more the common best practice to don't use `null` at all and MST follows this practice. Use `types.maybeNull` for the old behavior (see [#830](https://github.com/mobxjs/mobx-state-tree/issues/830))
239
+ - **[BREAKING]** `types.frozen` is now a function, and can now be invoked in a few different ways:
240
+ 1. `types.frozen()` - behaves the same as `types.frozen` in MST 2.
241
+ 2. `types.frozen(SubType)` - provide a valid MST type and frozen will check if the provided data conforms the snapshot for that type. Note that the type will not actually be instantiated, so it can only be used to check the _shape_ of the data. Adding views or actions to `SubType` would be pointless.
242
+ 3. `types.frozen(someDefaultValue)` - provide a primitive value, object or array, and MST will infer the type from that object, and also make it the default value for the field
243
+ 4. `types.frozen<TypeScriptType>()` - provide a typescript type, to help in strongly typing the field (design time only)
244
+ - It is no longer necessary to wrap `types.map` or `types.array` in `types.optional` when used in a `model` type, `map` and `array` are now optional by default when used as property type. See [#906](https://github.com/mobxjs/mobx-state-tree/issues/906)
245
+ - **[BREAKING]** `postProcessSnapshot` can no longer be declared as action, but, like `preProcessSnapshot`, needs to be defined on the type rather than on the instance.
246
+ - **[BREAKING]** `types.union` is now eager, which means that if multiple valid types for a value are encountered, the first valid type is picked, rather then throwing. #907 / #804, `dispatcher` param => option,
247
+
248
+ ## Other improvements
249
+
250
+ - **[BREAKING]** MobX-state-tree now requires at least TypeScript 2.8 when using MST with typescript. The type system has been revamped, and should now be a lot more accurate, especially concerning snapshot types.
251
+ - **[BREAKING]** `map.put` will now return the inserted node, rather than the map itself. This makes it easier to find objects for which the identifier is not known upfront. See [#766](https://github.com/mobxjs/mobx-state-tree/issues/766) by [k-g-a](https://github.com/k-g-a)
252
+ - **[BREAKING]** The order of firing hooks when instantiating has slighlty changed, as the `afterCreate` hook will now only be fired upon instantiation of the tree node, which now happens lazily (on first read / action). The internal order in which hooks are fired within a single node has remained the same. See [#845](https://github.com/mobxjs/mobx-state-tree/issues/845) for details
253
+ - Significantly improved the performance of constructing MST trees. Significantly reduced the memory footprint of MST. Big shoutout to the relentless effort by [k-g-a](https://github.com/k-g-a) to optimize all the things! See [#845](https://github.com/mobxjs/mobx-state-tree/issues/845) for details.
254
+ - Introduced `setLivelynessChecking("warn" | "ignore" | "error")`, this can be used to customize how MST should act when one tries to read or write to a node that has already been removed from the tree. The default behavior is `warn`.
255
+ - Improved the overloads of `model.compose`, see [#892](https://github.com/mobxjs/mobx-state-tree/pull/892) by [t49tran](https://github.com/t49tran)
256
+ - Fixed issue where computed properties based on `getPath` could return stale results, fixes [#917](https://github.com/mobxjs/mobx-state-tree/issues/917)
257
+ - Fixed issue where onAction middleware threw on dead nodes when attachAfter option was used
258
+ - Fixed several issues with maps and numeric identifiers, such as [#884](https://github.com/mobxjs/mobx-state-tree/issues/884) and [#826](https://github.com/mobxjs/mobx-state-tree/issues/826)
259
+
260
+ ## TL,DR Migration guide
261
+
262
+ - `types.identifier(types.number)` => `types.identifierNumber`
263
+ - `types.identifier()` and `types.identifier(types.string)` =>`types.identifier`
264
+ - `types.frozen` => `types.frozen()`
265
+ - `types.maybe(x)` => `types.maybeNull(x)`
266
+ - `postProcessSnapshot` should now be declared on the type instead of as action
267
+
268
+ # 2.2.0
269
+
270
+ - Added support for MobX 5. Initiative by [@jeffberry](https://github.com/jeffberry) through [#868](https://github.com/mobxjs/mobx-state-tree/pull/868/files). Please note that there are JavaScript engine restrictions for MobX 5 (no Internet Explorer, or React Native Android). If you need to target those versions please keep using MobX 4 as peer dependency (MST is compatible with both)
271
+ - Reduced memory footprint with ~10-20%, by [k-g-a](https://github.com/k-g-a) through [#872](https://github.com/mobxjs/mobx-state-tree/pull/872)
272
+ - Fixed issue where undo manager was not working correctly for non-root stores, by [marcofugaro](https://github.com/marcofugaro) trough [#875](https://github.com/mobxjs/mobx-state-tree/pull/875)
273
+
274
+ # 2.1.0
275
+
276
+ - Fixed issue where default values of `types.frozen` where not applied correctly after apply snapshot. [#842](https://github.com/mobxjs/mobx-state-tree/pull/842) by [SirbyAlive](https://github.com/SirbyAlive). Fixes [#643](https://github.com/mobxjs/mobx-state-tree/issues/634)
277
+ - Fixed issue where empty patch sets resulted in in unnecessary history items. [#838](https://github.com/mobxjs/mobx-state-tree/pull/838) by [chemitaxis](https://github.com/chemitaxis). Fixes [#837](https://github.com/mobxjs/mobx-state-tree/issues/837)
278
+ - `flow`s of destroyed nodes can no 'safely' resume. [#798](https://github.com/mobxjs/mobx-state-tree/pull/798/files) by [Bnaya](https://github.com/Bnaya). Fixes [#792](https://github.com/mobxjs/mobx-state-tree/issues/792)
279
+ - Made sure the type `Snapshot` is exposed. [#821](https://github.com/mobxjs/mobx-state-tree/pull/821) by [dsabanin](https://github.com/dsabanin)
280
+ - Fix: the function parameter was incorrectly typed as non-optional. [#851](https://github.com/mobxjs/mobx-state-tree/pull/851) by [abruzzihraig](https://github.com/abruzzihraig)
281
+
282
+ # 2.0.5
283
+
284
+ - It is now possible to get the snapshot of a node without triggering the `postProcessSnapshot` hook. See [#745](https://github.com/mobxjs/mobx-state-tree/pull/745) for details. By @robinfehr
285
+ - Introduced `getParentOfType` and `hasParentOfType`. See [#767](https://github.com/mobxjs/mobx-state-tree/pull/767) by @k-g-a
286
+ - Fixed issue where running `typeCheck` accidentally logged typecheck errors to the console. Fixes [#781](https://github.com/mobxjs/mobx-state-tree/issues/781)
287
+
288
+ # 2.0.4
289
+
290
+ - Removed accidental dependency on mobx
291
+
292
+ # 2.0.3
293
+
294
+ - Fixed issue where middleware that changed arguments wasn't properly picked up. See [#732](https://github.com/mobxjs/mobx-state-tree/pull/732) by @robinfehr. Fixes [#731](https://github.com/mobxjs/mobx-state-tree/issues/731)
295
+ - Fixed reassigning to a custom type from a different type in a union silently failing. See [#737](https://github.com/mobxjs/mobx-state-tree/pull/737) by @univerio. Fixes [#736](https://github.com/mobxjs/mobx-state-tree/issues/736)
296
+ - Fixed typings issue with TypeScript 2.8. See [#740](https://github.com/mobxjs/mobx-state-tree/pull/740) by @bnaya.
297
+ - Fixed undo manager apply grouped patches in the wrong order. See [#755](https://github.com/mobxjs/mobx-state-tree/pull/755) by @robinfehr. Fixes [#754](https://github.com/mobxjs/mobx-state-tree/issues/754)
298
+
299
+ # 2.0.2
300
+
301
+ - Fixed bidirectional references from nodes to nodes, see [#728](https://github.com/mobxjs/mobx-state-tree/pull/728) by @robinfehr
302
+ - `joinJsonPath` and `splitJsonPath` are now exposed as utilities, see [#724](https://github.com/mobxjs/mobx-state-tree/pull/724) by @jjrv
303
+ - Several documentation and example fixes
304
+
305
+ # 2.0.1
306
+
307
+ - Fixed typings for maps of maps [#704](https://github.com/mobxjs/mobx-state-tree/pull/704) by @xaviergonz
308
+ - Fixed dependency issue in `mst-middlewares` package
309
+
310
+ # 2.0.0
311
+
312
+ **Breaking changes**
313
+
314
+ - MobX-state-tree now requires MobX 4.0 or higher
315
+ - Identifiers are now internally always normalized to strings. This also means that adding an object with an number identifier to an observable map, it should still be requested back as string. In general, we recommend to always use string based identifiers to avoid confusion.
316
+ - Due to the changes in Mobx 4.0, `types.map(subType).keys()` will return `Iterator` instead of `ObservableArrays`. In order to address this issue, wrap the keys with `Array.from()`.
317
+
318
+ # 1.4.0
319
+
320
+ **Features**
321
+
322
+ - It is now possible to create [custom primitive(like) types](https://github.com/mobxjs/mobx-state-tree/blob/master/docs/API/README.md#custom)! Implements [#673](https://github.com/mobxjs/mobx-state-tree/issues/673) through [#689](https://github.com/mobxjs/mobx-state-tree/pull/689)
323
+ - [`getIdentifier`](https://github.com/mobxjs/mobx-state-tree/blob/master/docs/API/README.md#getidentifier) is now exposed as function, to get the identifier of a model instance (if any). Fixes [#674](https://github.com/mobxjs/mobx-state-tree/issues/674) through [#678](https://github.com/mobxjs/mobx-state-tree/pull/678) by TimHollies
324
+ - Writing [middleware](https://github.com/mobxjs/mobx-state-tree/blob/master/docs/middleware.md) has slightly changed, to make it less error prone and more explicit whether a middleware chain should be aborted. For details, see [#675](https://github.com/mobxjs/mobx-state-tree/pull/675) by Robin Fehr
325
+ - It is now possible to configure whether [attached middleware](https://github.com/mobxjs/mobx-state-tree/blob/master/docs/API/README.md#addmiddleware) should be triggered for the built-in hooks / operations. [#653](https://github.com/mobxjs/mobx-state-tree/pull/653) by Robin Fehr
326
+ - We exposed an [api](https://github.com/mobxjs/mobx-state-tree/blob/master/docs/API/README.md#getmembers) to perform reflection on model instances. [#649](https://github.com/mobxjs/mobx-state-tree/pull/649) by Robin Fehr
327
+
328
+ **Fixes**
329
+
330
+ - Fixed a bug where items in maps where not properly reconciled when the `put` operation was used. Fixed [#683](https://github.com/mobxjs/mobx-state-tree/issues/683) and [#672](https://github.com/mobxjs/mobx-state-tree/issues/672) through [#693](https://github.com/mobxjs/mobx-state-tree/pull/693)
331
+ - Fixed issue where trying to resolve a path would throw exceptions. Fixed [#686](https://github.com/mobxjs/mobx-state-tree/issues/686) through [#692](https://github.com/mobxjs/mobx-state-tree/pull/692)
332
+ - In non production builds actions and views on models can now be replaced, to simplify mocking. Fixes [#646](https://github.com/mobxjs/mobx-state-tree/issues/646) through [#690](https://github.com/mobxjs/mobx-state-tree/pull/690)
333
+ - Fixed bug where `tryResolve` could leave a node in a corrupt state. [#668](https://github.com/mobxjs/mobx-state-tree/pull/668) by dnakov
334
+ - Fixed typings for TypeScript 2.7, through [#667](https://github.com/mobxjs/mobx-state-tree/pull/667) by Javier Gonzalez
335
+ - Several improvements to error messages
336
+
337
+ # 1.3.1
338
+
339
+ - Fixed bug where `flows` didn't properly batch their next ticks properly in actions, significantly slowing processes down. Fixes [#563](<[#563](https://github.com/mobxjs/mobx-state-tree/issues/563)>)
340
+
341
+ # 1.3.0
342
+
343
+ - Significantly improved the undo/redo manager. The undo manager now supports groups. See [#504](https://github.com/mobxjs/mobx-state-tree/pull/504) by @robinfehr! See the [updated docs](https://github.com/mobxjs/mobx-state-tree/blob/master/packages/mst-middlewares/README.md#undomanager) for more details.
344
+ - Significantly improved performance, improvements of 20% could be expected, but changes of course per case. See [#553](https://github.com/mobxjs/mobx-state-tree/pull/553)
345
+ - Implemented `actionLogger` middleware, which logs most events for async actions
346
+ - Slightly changed the order in which life cycle hooks are fired. `afterAttach` will no fire first on the parent, then on the children. So, unlike `afterCreate`, in `afterAttach` one can assume in `afterAttach that the parent has completely initialized.
347
+
348
+ # 1.2.1
349
+
350
+ - 1.2.0 didn't seem to be released correctly...
351
+
352
+ # 1.2.0
353
+
354
+ - Introduced customizable reference types. See the [reference and identifiers](https://github.com/mobxjs/mobx-state-tree#references-and-identifiers) section.
355
+ - Introduced `model.volatile` to more easily declare and reuse volatile instance state. Volatile state can contain arbitrary data, is shallowly observable and, like props, cannot be modified without actions. See [`model.volatile`](https://github.com/mobxjs/mobx-state-tree#model-volatile) for more details.
356
+
357
+ # 1.1.1
358
+
359
+ ### Improvements
360
+
361
+ - Fixed an issue where nodes where not always created correctly, see #534. Should fix #513 and #531.
362
+ - All tests are now run in both PROD and non PROD configurations, after running into some bugs that only occurred in production builds.
363
+ - Some internal optimizations have been applied (and many more will follow). Like having internal leaner node for immutable data. See #474
364
+ - A lot of minor improvements on the docs
365
+
366
+ # 1.1.0
367
+
368
+ ### Improvements
369
+
370
+ - The concept of process (asynchronous actions) has been renamed to flows. (Mainly to avoid issues with bundlers)
371
+ - We changed to a lerna setup which allows separately distributing middleware and testing examples with more ease
372
+ - Every MST middleware is now shipped in a separate package named `mst-middlewares`. They are now written in TypeScript and fully transpiled to ES5 to avoid problems with uglifyjs in create-react-app bundling.
373
+ - Introduced `createActionTrackingMiddleware`, this significantly simplifies writing middleware for common scenarios. Especially middleware that deals with asynchronous actions (flows)
374
+ - Renamed `process` to `flow`. Deprecated `process`.
375
+ - **BREAKING** As a result some middleware event names have also been changed. If you have custom middlewares this change might affect you. Rename middleware event type prefixes starting with `process` to now start with `flow`.
376
+
377
+ ### Fixes
378
+
379
+ - Fixed nested maps + environments not working correctly, [#447](https://github.com/mobxjs/mobx-state-tree/pull/447) by @xaviergonz
380
+ - Improved typescript typings for enumerations, up to 50 values are now supported [#424](https://github.com/mobxjs/mobx-state-tree/pull/447) by @danielduwaer
381
+
382
+ # 1.0.2
383
+
384
+ - Introduced `modelType.extend` which allows creating views and actions with shared state.
385
+
386
+ # 1.0.1
387
+
388
+ ### Features
389
+
390
+ - Added the middlewares `atomic` and types `TimeTraveller`, `UndoManager`. Check out the [docs](https://github.com/mobxjs/mobx-state-tree/blob/master/docs/middleware.md)!
391
+ - Introduced `createActionTrackingMiddleware` to simplify the creation of middleware that support complex async processes
392
+ - exposed `typecheck(type, value)` as public api (will ignore environment flags)
393
+
394
+ ### Improvements
395
+
396
+ - `getEnv` will return an empty object instead of throwing when a tree was initialized without environment
397
+ - Fixed issue where patches generated for nested maps were incorrect (#396)
398
+ - Fixed the escaping of (back)slashes in JSON paths (#405)
399
+ - Improved the algorithm that reconcile items in an array (#384)
400
+ - Assigning a node that has an environment to a parent is now allowed, as long as the environment is strictly the same (#387)
401
+ - Many minor documentation improvements. Thanks everybody who created a PR!
402
+
403
+ # 1.0.0
404
+
405
+ No changes
406
+
407
+ # 0.12.0
408
+
409
+ - **BREAKING** The redux utilities are no longer part of the core package, but need to be imported from `mobx-state-tree/middleware/redux`.
410
+
411
+ # 0.11.0
412
+
413
+ ### Breaking changes
414
+
415
+ - **BREAKING** `onAction` middleware no longer throws when encountering unserializable arguments. Rather, it serializes a struct like `{ $MST_UNSERIALIZABLE: true, type: "someType" }`. MST Nodes are no longer automatically serialized. Rather, one should either pass 1: an id, 2: a (relative) path, 3: a snapshot
416
+ - **BREAKING** `revertPatch` has been dropped. `IReversableJsonPatch` is no longer exposed, instead use the inverse patches generated by `onPatch`
417
+ - **BREAKING** some middleware events have been renamed: `process_yield` -> `process_resume`, `process_yield_error` -> `process_resume_error`, to make it less confusing how these events relate to `yield` statements.
418
+ - **BREAKING** patchRecorder's field `patches` has been renamed to `rawPatches,`cleanPatches`to`patches`, and`inversePatches` was added.
419
+
420
+ ### New features
421
+
422
+ - Introduced `decorate(middleware, action)` to easily attach middleware to a specific action
423
+ - Handlers passed to `onPatch(handler: (patch, inversePatch) => void)` now receive as second argument the inverse patch of the emitted patch
424
+ - `onAction` lister now supports an `attachAfter` parameter
425
+ - Middleware events now also contain `parentId` (id of the causing action, `0` if none) and `tree` (the root of context)
426
+
427
+ ### Fixes
428
+
429
+ - ReduxDevTools connection is no longer one step behind [#287](https://github.com/mobxjs/mobx-state-tree/issues/287)
430
+ - Middleware is no longer run as part of the transaction of the targeted action
431
+ - Fixed representation of `union` types in error messages
432
+
433
+ # 0.10.3
434
+
435
+ - **BREAKISH** Redefining lifecycle hooks will now automatically compose them, implements [#252](https://github.com/mobxjs/mobx-state-tree/issues/252)
436
+ - Added dev-only checks, typecheck will be performed only in dev-mode and top-level API-calls will be checked.
437
+ - The internal types `IMiddleWareEvent`, `IMiddlewareEventType`, `ISerializedActionCall` are now exposed (fixes [#315](https://github.com/mobxjs/mobx-state-tree/issues/315))
438
+
439
+ # 0.10.2
440
+
441
+ - Object model instances no longer share a prototype.
442
+
443
+ # 0.10.1
444
+
445
+ - Removed accidental dependency on the codemod
446
+
447
+ # 0.10.0
448
+
449
+ - **BREAKING** the syntax to define model types has been updated. See the [updated docs](https://github.com/mobxjs/mobx-state-tree#creating-models) or the original proposal:[#282](https://github.com/mobxjs/mobx-state-tree/pull/286), but no worries, theres a codemod! :D
450
+ - **BREAKING** `preProcessSnapshot` hook is no longer a normal hook that can be defined as action. Instead, it should be defined on the type using `types.model(...).preProcessSnapshot(value => value)`
451
+ - **BREAKING** Asynchronous process should now be defined using `process`. See this [example](https://github.com/mobxjs/mobx-state-tree/blob/adba1943af263898678fe148a80d3d2b9f8dbe63/examples/bookshop/src/stores/BookStore.js#L25) or the [asynchronous action docs](https://github.com/mobxjs/mobx-state-tree/blob/master/docs/async-actions.md).
452
+
453
+ **How to run the codemod?**
454
+
455
+ The codemod is provided as npm package command line tool. It has been written using the TypeScript parser, so it will successfully support either TS or regular JavaScript source files.
456
+
457
+ To run the codemod, you need to first install it globally by `npm install -g mst-codemod-to-0.10`.
458
+ After that, the `mst-codemod-to-0.10` command will be available in your command line.
459
+
460
+ To perform the codemod, you need to call in your command line `mst-codemod-to-0.10` followed by the filename you want to codemod. A `.bak` file with the original source will be created for backup purposes, and the file you provided will be updated to the new syntax! Have fun!
461
+
462
+ PS: You could also use `npx` instead of installing the codemod globally! :)
463
+
464
+ # 0.9.5
465
+
466
+ - Asynchronous actions are now a first class concept in mobx-state-tree. See the [docs](https://github.com/mobxjs/mobx-state-tree/blob/master/docs/async-actions.md)
467
+
468
+ # 0.9.4
469
+
470
+ - Introduced `types.null` and `types.undefined`
471
+ - Introduced `types.enumeration(name?, options)`
472
+
473
+ # 0.9.3
474
+
475
+ - Fix `note that a snapshot is compatible` when assigning a type to an optional version of itself
476
+ - Fix error when deleting a non existing item from a map [#255](https://github.com/mobxjs/mobx-state-tree/issues/255)
477
+ - Now all required TypeScript interfaces are exported in the main mobx-state-tree package [#256](https://github.com/mobxjs/mobx-state-tree/issues/256)
478
+
479
+ # 0.9.2
480
+
481
+ Introduced the concept of reverse patches, see [#231](https://github.com/mobxjs/mobx-state-tree/pull/231/)
482
+
483
+ - Introduced the `revertPatch` operation, that takes a patch or list of patches, and reverse applies it to the target.
484
+ - `onPatch` now takes a second argument, `includeOldValue`, defaulting to `false`, which, if set to true, includes in the patch any value that is being overwritten as result of the patch. Setting this option to true produces patches that can be used with `revertPatch`
485
+ - `patchRecorder` now introduces additional fields / methods to be able to reverse apply changes: `patchRecorder.cleanPatches`, `patchRecorder.undo`
486
+
487
+ # 0.9.1
488
+
489
+ - Applying a snapshot or patches will now emit an action as well. The name of the emitted action will be `@APPLY_PATCHES`resp `@APPLY_SNAPSHOT`. See [#107](https://github.com/mobxjs/mobx-state-tree/issues/107)
490
+ - Fixed issue where same Date instance could'nt be used two times in the same state tree [#229](https://github.com/mobxjs/mobx-state-tree/issues/229)
491
+ - Fixed issue with reapplying snapshots to Date field resulting in snapshot typecheck error[#233](https://github.com/mobxjs/mobx-state-tree/issues/233)
492
+ - Declaring `types.maybe(types.frozen)` will now result into an error [#224](https://github.com/mobxjs/mobx-state-tree/issues/224)
493
+ - Added support for Mobx observable arrays in type checks [#221](https://github.com/mobxjs/mobx-state-tree/issues/221) (from [alessioscalici](https://github.com/alessioscalici))
494
+
495
+ # 0.9.0
496
+
497
+ - **BREAKING** Removed `applyPatches` and `applyActions`. Use `applyPatch` resp. `applyAction`, as both will now also accept an array as argument
498
+ - **BREAKING** `unprotect` and `protect` can only be applied at root nodes to avoid confusing scenarios Fixed [#180](https://github.com/mobxjs/mobx-state-tree/issues/180)
499
+ - Fixed [#141](https://github.com/mobxjs/mobx-state-tree/issues/141), actions / views are no longer wrapped in dynamically generated functions for a better debugging experience
500
+ - Small improvements to typings, fixed compilation issues with TypeScript 2.4.1.
501
+ - Fixed issues where `compose` couldn't overwrite getters. [#209](https://github.com/mobxjs/mobx-state-tree/issues/209), by @homura
502
+ - Fixed CDN links in readme
503
+ - Added TodoMVC to the examples section
504
+
505
+ # 0.8.2
506
+
507
+ - Fixed issue in rollup module bundle
508
+
509
+ # 0.8.1
510
+
511
+ - Fixed issue in release script, rendering 0.8.0 useless
512
+
513
+ # 0.8.0
514
+
515
+ - **BREAKING** Dropped `types.extend` in favor of `types.compose`. See [#192](https://github.com/mobxjs/mobx-state-tree/issues/192)
516
+ - Introduced the lifecycle hooks `preProcessSnapshot` and `postProcessSnapshot`. See [#203](https://github.com/mobxjs/mobx-state-tree/pull/203) / [#100](https://github.com/mobxjs/mobx-state-tree/issues/100)
517
+ - Use rollup as bundler [#196](https://github.com/mobxjs/mobx-state-tree/pull/196)
518
+
519
+ # 0.7.3
520
+
521
+ - Introduced the concept of volatile / local state in models. See [#168](https://github.com/mobxjs/mobx-state-tree/issues/168), or [docs](https://github.com/mobxjs/mobx-state-tree/tree/master#volatile-state)
522
+ - Fixed issue with types.map() with types.identifier(types.number) [#191](https://github.com/mobxjs/mobx-state-tree/issues/191) reported by @boatkorachal
523
+ - Fixed issue with reconciler that affected types.map when node already existed at that key reported by @boatkorachal [#191](https://github.com/mobxjs/mobx-state-tree/issues/191)
524
+
525
+ # 0.7.2
526
+
527
+ - Fixed `cannot read property resolve of undefined` thanks to @cpunion for reporting, now value of dead nodes will be undefined. [#186](https://github.com/mobxjs/mobx-state-tree/issues/186)
528
+ - Fixed `[LateType] is not defined` thanks to @amir-arad for reporting, when using late as model property type [#187](https://github.com/mobxjs/mobx-state-tree/issues/187)
529
+ - Fixed `Object.freeze can only be called on Object` thanks to @ds300 for reporting, when using MST on a ReactNative environment [#189](https://github.com/mobxjs/mobx-state-tree/issues/189)
530
+ - Now the entire codebase is prettier! :D [#187](https://github.com/mobxjs/mobx-state-tree/issues/187)
531
+
532
+ # 0.7.1
533
+
534
+ - Fixed `array.remove` not working
535
+
536
+ # 0.7.0
537
+
538
+ The type system and internal administration has been refactoring, making the internals both simpler and more flexible.
539
+ Things like references and identifiers are now first class types, making them much better composable. [#152](https://github.com/mobxjs/mobx-state-tree/issues/152)
540
+
541
+ - **BREAKING** References with a predefined lookup path are no longer supported. Instead of that, identifiers are now looked up in the entire tree. For that reasons identifiers now have to be unique in the entire tree, per type.
542
+ - **BREAKING** `resolve` is renamed to `resolvePath`
543
+ - Introduced `resolveIdentifier(type, tree, identifier)` to find objects by identifier
544
+ - **BREAKING** `types.reference` is by default non-nullable. For nullable identifiers, use `types.maybe(types.reference(X))`
545
+ - Many, many improvements. Related open issues will be updated.
546
+ - **BREAKING** `isMST` is renamed to `isStateTreeNode`
547
+
548
+ # 0.6.3
549
+
550
+ - Fixed issue with array/maps of union types @abruzzihraig [#151](https://github.com/mobxjs/mobx-state-tree/issues/151)
551
+ - Make types.extend support computed attributes @cpunion [#169](https://github.com/mobxjs/mobx-state-tree/issues/169)
552
+ - Fixed issue with map of primitive types and applySnapshot @pioh [#155](https://github.com/mobxjs/mobx-state-tree/issues/155)
553
+ - Better type declarations for union, up to 10 supported types
554
+
555
+ # 0.6.2
556
+
557
+ - Fixed issue where arrays where not properly serialized as action argument
558
+
559
+ # 0.6.1
560
+
561
+ - Improved reporting of Type.is(), now it returns a fine grained report of why the provided value is not applicable.
562
+
563
+ ```
564
+ [mobx-state-tree] Error while converting [{}] to AnonymousModel[]:
565
+ at path "/name" snapshot undefined is not assignable to type: string.
566
+ at path "/quantity" snapshot undefined is not assignable to type: number.
567
+ ```
568
+
569
+ - Fixed support for `types.reference` in combination with `types.late`, by @robinfehr
570
+
571
+ # 0.6.0
572
+
573
+ - **BREAKING** `types.withDefault` has been renamed to `types.optional`
574
+ - **BREAKING** Array and map types can no longer be left out of snapshots by default. Use `optional` to make them optional in the snapshot
575
+ - **BREAKING** Literals no longer have a default value by default (use optional + literal instead)
576
+ - **BREAKING** Disabled inlining type.model definitions as introduced in 0.5.1; to many subtle issues
577
+ - Improved identifier support, they are no properly propagated through utility types like `maybe`, `union` etc
578
+ - Fixed issue where fields where not referred back to default when a partial snapshot was provided
579
+ - Fixed #122: `types.identifier` now also accepts a subtype to override the default string type; e.g. `types.identifier(types.number)`
580
+
581
+ # 0.5.1
582
+
583
+ - Introduced support for lazy evaluating values in `withDefault`, useful to generate UUID's, timestamps or non-primitive default values
584
+ - ~~It is now possible to define something like~~ Removed in 0.6.0
585
+
586
+ ```javascript
587
+ const Box = types.model({
588
+ point: {
589
+ x: 10,
590
+ y: 10
591
+ }
592
+ }
593
+ ```
594
+
595
+ Where the type of `point` property is inferred to `point: types.withDefault(types.model({ x: 10, y: 10}), () => ({ x: 10, y: 10 }))`
596
+
597
+ # 0.5.0
598
+
599
+ - ** BREAKING ** protection is now enabled by default (#101)
600
+ - ** BREAKING ** it is no longer possible to read values from a dead object. Except through `getSnapshot` or `clone` (#102)
601
+ - ** BREAKING ** `types.recursive` has been removed in favor of `types.late`
602
+ - Introduced `unprotect`, to disable protection mode for a certain instance. Useful in `afterCreate` hooks
603
+ - Introduced `types.late`. Usage: `types.late(() => typeDefinition)`. Can be used for circular / recursive type definitions, even across files. See `test/circular(1|2).ts` for an example (#74)
604
+
605
+ # 0.4.0
606
+
607
+ **BREAKING** `types.model` no requires 2 parameters to define a model. The first parameter defines the properties, derived values and view functions. The second argument is used to define the actions. For example:
608
+
609
+ ```javascript
610
+ const Todo = types.model("Todo", {
611
+ done: types.boolean,
612
+ toggle() {
613
+ this.done = !this.done
614
+ }
615
+ })
616
+ ```
617
+
618
+ Now should be defined as:
619
+
620
+ ```javascript
621
+ const Todo = types.model(
622
+ "Todo",
623
+ {
624
+ done: types.boolean
625
+ },
626
+ {
627
+ toggle() {
628
+ this.done = !this.done
629
+ }
630
+ }
631
+ )
632
+ ```
633
+
634
+ It is still possible to define functions on the first object. However, those functions are not considered to be actions, but views. They are not allowed to modify values, but instead should produce a new value themselves.
635
+
636
+ # 0.3.3
637
+
638
+ - Introduced lifecycle hooks `afterCreate`, `afterAttach`, `beforeDetach`, `beforeDestroy`, implements #76
639
+ - Introduced the convenience method `addDisposer(this, cb)` that can be used to easily destruct reactions etc. which are set up in `afterCreate`. See #76
640
+
641
+ # 0.3.2
642
+
643
+ - Fix: actions where not bound automatically
644
+ - Improved and simplified the reconciliation mechanism, fixed many edge cases
645
+ - Improved the reference mechanism, fixed many edge cases
646
+ - Improved performance
647
+
648
+ # 0.3.1
649
+
650
+ - (re) introduced the concept of environments, which can be passed as second argument to `.create`, and picked up using `getEnv`
651
+
652
+ # 0.3.0
653
+
654
+ - Removed `primitive` type, use a more specific type instead
655
+ - Improved typescript typings of snapshots
656
+ - Added `depth` parameter to `getParent` and `hasParent`
657
+ - Separated the concepts of middleware and serializable actions. It is now possible to intercept, modify actions etc through `addMiddleWare`. `onAction` now uses middleware, if it is used, all parameters of actions should be serializable!
658
+
659
+ # 0.2.2
660
+
661
+ - Introduced the concept of liveliness; if nodes are removed from the the tree because they are replaced by some other value, they will be marked as "died". This should help to early signal when people hold on to references that are not part of the tree anymore. To explicitly remove an node from a tree, with the intent to spawn a new state tree from it, use `detach`.
662
+ - Introduced the convenience method `destroy` to remove a model from it's parent and mark it as dead.
663
+ - Introduced the concept of protected trees. If a tree is protected using `protect`, it can only be modified through action, and not by mutating it directly anymore.
664
+
665
+ # 0.2.1
666
+
667
+ - Introduced .Type and .SnapshotType to be used with TypeScript to get the type for a model
668
+
669
+ # 0.2.0
670
+
671
+ - Renamed `createFactory` to `types.model` (breaking!)
672
+ - Renamed `composeFactory` to `types.extend` (breaking!)
673
+ - Actions should now be declared as `name(params) { body }`, instead of `name: action(function (params) { body})` (breaking!)
674
+ - Models are no longer constructed by invoking the factory as function, but by calling `factory.create` (breaking!)
675
+ - Introduced `identifier`
676
+ - Introduced / improved `reference`
677
+ - Greatly improved typescript support, type inference etc. However there are still limitations as the full typesystem of MST cannot be expressed in TypeScript. Especially concerning the type of snapshots and the possibility to use snapshots as first class value.