diff --git a/packages/obj-diff/CHANGELOG.md b/packages/obj-diff/CHANGELOG.md index 0f4bee0..0362595 100644 --- a/packages/obj-diff/CHANGELOG.md +++ b/packages/obj-diff/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +## [0.16.0] - 2026-07-17 + ### Added - `serialize(diff)` / `deserialize(wire)` — a self-describing JSON wire format for diffs. `diff()` returns live objects by reference, so `JSON.stringify` mangles them (`Date`→string, `Map`/`Set`→`{}`, `TypedArray`→numeric-keyed object, `BigInt`→throws). `serialize` keeps `value`/`path` readable but replaces each special value with a lightweight reference token `"@n"` and collects the real types in a per-op `$refs` table (`{ "n": { _t, _v } }`); `deserialize` resolves the tokens back into live typed values so a `patch()` on the far side reconstructs the correct objects. Covers `Date`, `RegExp`, `Map`, `Set`, all `TypedArray`s, `ArrayBuffer`, `DataView`, `Error` (+ standard subclasses), boxed primitives, `BigInt`, `NaN`/`±Infinity`/`-0`, `undefined`, and `Temporal` values, nested to any depth (incl. `Map`/`Set`/object keys in `path`). Real strings shaped like `"@n"` are escaped. Symbols, functions, class instances, and circular references throw. Deserializing a `Temporal` value needs a `Temporal` implementation on `globalThis`. - Native diffing support for all **Temporal** types (`Temporal.Instant`, `PlainDate`, `PlainTime`, `PlainDateTime`, `PlainYearMonth`, `PlainMonthDay`, `ZonedDateTime`, `Duration`). They are compared as immutable, atomic values — replaced wholesale via a single `CHANGED` op when they differ, and preserved by reference through `patch()`. Equality uses each type's own `.equals()`; `Duration` (which has no `.equals()`) is compared structurally by its canonical string, so two equal-length but differently-expressed durations (e.g. `PT2H` vs `PT120M`) are treated as a change and the exact value is reconstructed on patch. Detection is brand-based (`Symbol.toStringTag`), so it works with the native global or the `@js-temporal/polyfill`. diff --git a/packages/obj-diff/package.json b/packages/obj-diff/package.json index 2b7e87b..84ea9af 100644 --- a/packages/obj-diff/package.json +++ b/packages/obj-diff/package.json @@ -11,7 +11,7 @@ "json", "track" ], - "version": "0.15.0", + "version": "0.16.0", "author": { "name": "Thanga Ganapathy", "email": "ganapathy888@gmail.com",