mobx-keystone 2.4.0 → 2.4.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 2.4.1
4
+
5
+ - `Serializer.decodeCall` and `Serializer.decodeValue` take a `{ generateNewIds }` option (`DecodeOptions`) that gives new model ids to the models decoded from snapshots, nested ones included, e.g. for a server that accepts snapshots from clients, where duplicate ids would break `applyPatches` and `applySnapshot` on replicas. References are unaffected and ids are still kept by default. Value serializers see it as `DecodeContext.generateNewIds`.
6
+ - A custom value serializer with the tag of a built-in now replaces that built-in in `createSerializer` (it used to throw because of the duplicate tag), so a built-in can be swapped without `builtins: false`.
7
+ - A custom value serializer tagged `snapshot` now works like the built-in snapshot serializer it replaces: its encoded value is written unmarked and it decodes every `$modelType` / `$frozen` value. It used to be bypassed silently for those values unless it was a copy of the built-in. Its encoded value must be a snapshot, or encoding fails with `CannotEncode`.
8
+
3
9
  ## 2.4.0
4
10
 
5
11
  - New serialization API for sending values and calls as JSON (see the new "Serialization" docs page):