Serialization reads an object's class from its prototype instead of its constructor property, and reads Date, Temporal, typed array and DataView values through the built-in methods and getters instead of properties on the value. An object whose own constructor names a built-in class is now serialized as a plain object, and an object that only inherits a built-in prototype, such as Object.create(Date.prototype), is rejected.
00e3abf: Bundles that never create a live stream no longer include the LiveStream class: about 570 bytes gzipped less for toJSONAsync, fromJSON or fromCrossJSON on the production ESM build, measured with seroval's bundle size report. An object made with Object.create(LiveStream.prototype) is no longer treated as a live stream.
d85ec3f: Keep two round-trip cases intact. An object whose own constructor key holds a falsy value, such as { constructor: undefined }, now keeps Object.prototype instead of coming back with a null prototype. A null-prototype object with an own __proto__ key, or any object serialized with Feature.ObjectAssign disabled, no longer turns equal-looking values such as two new Set() into one shared object in serialize, crossSerialize and compileJSON output.
3a60f79: Republish the 1.7.2 changes through CI with npm provenance. 1.7.2 was published manually without an attestation, so pnpm's trustPolicy: no-downgrade refused to install it (#278). No code changes.
b703710: createCrossDeserializer no longer causes unhandled rejections. This covers a rejected promise that the caller never reads, and a pending promise that abort rejects. Code that awaits the promise still gets the rejection.
2d03651: serialize, toJSON, crossSerialize and toCrossJSON now throw when the value contains an async iterable or a ReadableStream, as they do for a promise. Before, they sent a stream that never got its values. Use an async or streaming function to send them.
2c25bf3: serialize, toJSON, crossSerialize and toCrossJSON now send a createStream stream that has ended with all its events. A stream that is still open, or a live stream, now throws. Before, they sent an empty stream that never ended.
9a75aae: Add the assignSharedRefsOnly option to crossSerialize and crossSerializeAsync. It stores only the values the output reads more than once in $R, which makes shorter output when no later script refers back to it.
f3f39de: Add createCrossDeserializer, a session for cross-reference JSON records that tracks unsettled promises and open streams, reports how many are still pending, and can abort them with a caller-supplied reason when the transport fails.
2324090: Streams serialized from a live stream in streaming mode are rebuilt with a live receiver: it keeps history only until its first listener subscribes, then forwards each value without retaining it and refuses a second listener. Replay streams and existing serialized data are unchanged, and readers that ignore the marker build a replay receiver.
4c0008f: Add createLiveStream(), a single-consumer stream that holds one event at a time and resolves each producer write only after the serialized record is accepted. crossSerializeStream and toCrossJSONStream callbacks may now return a promise; the next record, and the acceptance of the source event behind it, wait for it to settle. Records discovered while parsing an event are emitted after the record that introduces them, one callback runs at a time, onDone waits for the last callback and is not called after an output failure, and cleanup runs every callback once. Async iterables and ReadableStream values read their next chunk only after the previous record is accepted. Existing streaming plugin lifecycle hooks remain available; parsing a live stream is the preferred way to connect an incremental source.
f2b7d0c: Raise the supported Node.js floor from >=10 to >=20 in engines, remove the no-op typesVersions from seroval, give seroval-plugins main, module and types fields plus a typesVersions entry that points at the emitted web declarations, and link the plugins package to the workspace copy of seroval.
8a95987: Add the optional skipPlainObjects plugin field. A plugin that sets it to true is not tested against plain objects, which makes parsing faster when most values are plain objects.
5ab601f: Add plugin context hooks for parsing an async iterable as a stream source. Use them in the ReadableStream plugin to avoid a separate live-stream producer while keeping backpressure, cancellation, and wire format intact. Upgrade both packages together because the plugin requires the new core hooks.
Patch Changes
6d92c38: - Export SerializeOptions, SerializeAsyncOptions, ToJSONOptions and ToJSONAsyncOptions, the option types of serialize, serializeAsync, toJSON and toJSONAsync.
Mark Feature.ArrowFunction and SerovalMissingReferenceError as deprecated. Neither has any effect.
8b4214f: Reuse the resolved plugin list when the same plugins array is passed again, so each call no longer rebuilds it.
b7edc16: Create leaf nodes with only their t, i and s fields, cutting tree memory for primitive-heavy payloads.
dcf9a69: Report the depth limit error with its own error code.
e118511: Derive the well-known symbol name and lookup tables and the error constructor names from their single source tables.
1e13e04: Avoid temporary reference lookup wrappers in the parsers and resolve named references with one registry lookup.
3234e88: Honor depthLimit in every serializer entry point and in fromJSON, wrap failures raised while emitting output in SerovalSerializationError, and report a node id that is assigned twice with SerovalConflictedNodeIdError.
a1e185a: Build with an explicit ES2020 syntax target so the emitted syntax floor no longer follows engines.node, keeping nullish coalescing and optional chaining as written.
3b49dc3: Inline feature bits inside the library with an internal const enum. The exported Feature enum is unchanged.
d171f53: Replace the isValidIdentifier regex and first-character string slice with a charCodeAt scan.
641e424: serialize and serializeAsync no longer add an unused placeholder variable to every payload that contains a Map. It is now declared only when a Map entry needs it, so a plain Map serializes to new Map([...]).
26d263f: Define the global __SEROVAL_REFS__ store on the first createReference call instead of at import time, and mark the package side-effect free so bundlers can drop unused modules.
20de609: Export the Stream, Sequence and LiveStream classes so bundlers can drop them when unused.
f0ff974: Merge duplicated node creators, promise result and stream call handlers, and share one Temporal name table.
bd9cac0: Skip the escape loop for strings that need no escaping, escape the rest by switching on charCodeAt, and decode escapes without a per-match replace callback.
5426ea8: Check extensibility first when reading object flags so ordinary objects need one native call.
0cb3c78: Omit trailing empty fields when creating nodes.
090f5be: Generate deferred assignment expressions in one pass without an intermediate array or merged assignment objects.
37ed929: Walk object properties with Object.keys instead of Object.entries so parsing no longer allocates a key/value pair per property.
11c4446: Replace internal plugin context wrapper classes with plain objects so Rspack and webpack can tree-shake unused parser, serializer, and deserializer modules.
a758b08: Preserve reserved own property names in cyclic objects and retain Error __proto__ data properties without changing their prototypes.
Compatibility note: Error __proto__ fields previously dropped are now preserved as own data properties. Copying these results with Object.assign({}, value) can change the destination's prototype. Use { ...value } for shallow copies; later merges still require safe handling.
93adf62: Size parser child arrays up front, and stop awaiting primitives in the async parser.
96a3214: Release private references and cleanup callbacks when a Serializer closes, prevent reentrant completion, and finish other writes' cleanup when a callback throws.
f698afa: Release stream parser subscriptions and buffered nodes after use, and complete serialization once after buffered chunks are emitted.
e5d493e: Classify object keys with a first-character check so the serializer only parses keys that can be numeric, and emit deferred key assignments through one helper.
883f47f: Share the parser's marked reference set with serializer contexts instead of copying it, so streaming serializers no longer pay O(references) per emitted node.
d1cbe82: Streaming serializers reuse one plugin context per depth, so values handled by plugins no longer allocate a new context each.
a295de9: Classify objects once in a shared getObjectKind helper so the sync, stream and async parsers no longer carry separate copies of the class checks and feature gates.
f907408: Preserve stream event order during async parsing and wait for earlier chunks before completing. Live writes are accepted after their parsed event is placed.
Stop sources on parse or output failure, forward cancellation reasons, and release owned callbacks and records. Keep the original error when cleanup also fails, reject cleanup failures after otherwise successful parsing, and retain existing streaming plugin lifecycle hooks.
Keep incidental primitive callback returns synchronous. Only objects and functions are inspected for thenables, and the callable then is invoked without reading its call property.
Disposing crossSerializeStream or toCrossJSONStream no longer invokes onDone: disposal abandons output rather than completing it. Callers that close a response in onDone must also close it when disposing. Serializer.close() still invokes onDone. A failed Serializer.write() only stops that write; sibling streams and subsequent writes remain active. SerializerOptions.onError remains required.
258c8e3: toJSON, crossSerialize and toCrossJSON now throw when the value contains a promise, like serialize already did. Before, they sent a promise that never settled. Use an async or streaming function to send promises.
fa4f346: Allow bundlers to remove unused iterator factories from consumers that do not need deserialization.
7d2153c: Keep unused symbol and constant tables out of consumer bundles and register the reference store with one global lookup.
e70d7f6: Remove unused parser and deserializer context state and share guarded typed-array and DataView decoding.
5a49e1a: Unify TypedArray and DataView node creation, parsing, and serialization helpers.
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [seroval](https://seroval.vercel.app) ([source](https://github.com/lxsmnsyc/seroval)) | pnpm-workspace.overrides | minor | [`1.6.11` → `1.7.7`](https://renovatebot.com/diffs/npm/seroval/1.6.11/1.7.7) |
---
### Release Notes
<details>
<summary>lxsmnsyc/seroval (seroval)</summary>
### [`v1.7.7`](https://github.com/lxsmnsyc/seroval/releases/tag/seroval%401.7.7)
[Compare Source](https://github.com/lxsmnsyc/seroval/compare/seroval@1.7.6...seroval@1.7.7)
##### Patch Changes
- Serialization reads an object's class from its prototype instead of its `constructor` property, and reads `Date`, Temporal, typed array and `DataView` values through the built-in methods and getters instead of properties on the value. An object whose own `constructor` names a built-in class is now serialized as a plain object, and an object that only inherits a built-in prototype, such as `Object.create(Date.prototype)`, is rejected.
- [`00e3abf`](https://github.com/lxsmnsyc/seroval/commit/00e3abf): Bundles that never create a live stream no longer include the `LiveStream` class: about 570 bytes gzipped less for `toJSONAsync`, `fromJSON` or `fromCrossJSON` on the production ESM build, measured with seroval's bundle size report. An object made with `Object.create(LiveStream.prototype)` is no longer treated as a live stream.
### [`v1.7.6`](https://github.com/lxsmnsyc/seroval/releases/tag/seroval%401.7.6)
[Compare Source](https://github.com/lxsmnsyc/seroval/compare/seroval@1.7.5...seroval@1.7.6)
##### Patch Changes
- Read a RegExp's pattern and flags through the `RegExp.prototype` getters, so own `source` or `flags` properties on the value no longer change the output.
### [`v1.7.5`](https://github.com/lxsmnsyc/seroval/releases/tag/seroval%401.7.5)
[Compare Source](https://github.com/lxsmnsyc/seroval/compare/seroval@1.7.4...seroval@1.7.5)
##### Patch Changes
- [`d85ec3f`](https://github.com/lxsmnsyc/seroval/commit/d85ec3f): Keep two round-trip cases intact. An object whose own `constructor` key holds a falsy value, such as `{ constructor: undefined }`, now keeps `Object.prototype` instead of coming back with a null prototype. A null-prototype object with an own `__proto__` key, or any object serialized with `Feature.ObjectAssign` disabled, no longer turns equal-looking values such as two `new Set()` into one shared object in `serialize`, `crossSerialize` and `compileJSON` output.
### [`v1.7.4`](https://github.com/lxsmnsyc/seroval/releases/tag/seroval%401.7.4)
[Compare Source](https://github.com/lxsmnsyc/seroval/compare/seroval@1.7.3...seroval@1.7.4)
No changes in this release.
### [`v1.7.3`](https://github.com/lxsmnsyc/seroval/releases/tag/seroval%401.7.3)
[Compare Source](https://github.com/lxsmnsyc/seroval/compare/seroval@1.7.2...seroval@1.7.3)
##### Patch Changes
- [`3a60f79`](https://github.com/lxsmnsyc/seroval/commit/3a60f79): Republish the 1.7.2 changes through CI with npm provenance. 1.7.2 was published manually without an attestation, so pnpm's `trustPolicy: no-downgrade` refused to install it ([#​278](https://github.com/lxsmnsyc/seroval/issues/278)). No code changes.
### [`v1.7.2`](https://github.com/lxsmnsyc/seroval/compare/seroval@1.7.1...seroval@1.7.2)
[Compare Source](https://github.com/lxsmnsyc/seroval/compare/seroval@1.7.1...seroval@1.7.2)
### [`v1.7.1`](https://github.com/lxsmnsyc/seroval/releases/tag/seroval%401.7.1)
[Compare Source](https://github.com/lxsmnsyc/seroval/compare/seroval@1.7.0...seroval@1.7.1)
##### Patch Changes
- [`b703710`](https://github.com/lxsmnsyc/seroval/commit/b703710): `createCrossDeserializer` no longer causes unhandled rejections. This covers a rejected promise that the caller never reads, and a pending promise that `abort` rejects. Code that awaits the promise still gets the rejection.
- [`2d03651`](https://github.com/lxsmnsyc/seroval/commit/2d03651): `serialize`, `toJSON`, `crossSerialize` and `toCrossJSON` now throw when the value contains an async iterable or a `ReadableStream`, as they do for a promise. Before, they sent a stream that never got its values. Use an async or streaming function to send them.
- [`2c25bf3`](https://github.com/lxsmnsyc/seroval/commit/2c25bf3): `serialize`, `toJSON`, `crossSerialize` and `toCrossJSON` now send a `createStream` stream that has ended with all its events. A stream that is still open, or a live stream, now throws. Before, they sent an empty stream that never ended.
### [`v1.7.0`](https://github.com/lxsmnsyc/seroval/releases/tag/seroval%401.7.0)
[Compare Source](https://github.com/lxsmnsyc/seroval/compare/seroval@1.6.12...seroval@1.7.0)
##### Minor Changes
- [`9a75aae`](https://github.com/lxsmnsyc/seroval/commit/9a75aae): Add the `assignSharedRefsOnly` option to `crossSerialize` and `crossSerializeAsync`. It stores only the values the output reads more than once in `$R`, which makes shorter output when no later script refers back to it.
- [`f3f39de`](https://github.com/lxsmnsyc/seroval/commit/f3f39de): Add `createCrossDeserializer`, a session for cross-reference JSON records that tracks unsettled promises and open streams, reports how many are still pending, and can abort them with a caller-supplied reason when the transport fails.
- [`2324090`](https://github.com/lxsmnsyc/seroval/commit/2324090): Streams serialized from a live stream in streaming mode are rebuilt with a live receiver: it keeps history only until its first listener subscribes, then forwards each value without retaining it and refuses a second listener. Replay streams and existing serialized data are unchanged, and readers that ignore the marker build a replay receiver.
- [`4c0008f`](https://github.com/lxsmnsyc/seroval/commit/4c0008f): Add `createLiveStream()`, a single-consumer stream that holds one event at a time and resolves each producer write only after the serialized record is accepted. `crossSerializeStream` and `toCrossJSONStream` callbacks may now return a promise; the next record, and the acceptance of the source event behind it, wait for it to settle. Records discovered while parsing an event are emitted after the record that introduces them, one callback runs at a time, `onDone` waits for the last callback and is not called after an output failure, and cleanup runs every callback once. Async iterables and `ReadableStream` values read their next chunk only after the previous record is accepted. Existing streaming plugin lifecycle hooks remain available; parsing a live stream is the preferred way to connect an incremental source.
- [`f2b7d0c`](https://github.com/lxsmnsyc/seroval/commit/f2b7d0c): Raise the supported Node.js floor from `>=10` to `>=20` in `engines`, remove the no-op `typesVersions` from seroval, give seroval-plugins `main`, `module` and `types` fields plus a `typesVersions` entry that points at the emitted `web` declarations, and link the plugins package to the workspace copy of seroval.
- [`8a95987`](https://github.com/lxsmnsyc/seroval/commit/8a95987): Add the optional `skipPlainObjects` plugin field. A plugin that sets it to `true` is not tested against plain objects, which makes parsing faster when most values are plain objects.
- [`5ab601f`](https://github.com/lxsmnsyc/seroval/commit/5ab601f): Add plugin context hooks for parsing an async iterable as a stream source. Use them in the ReadableStream plugin to avoid a separate live-stream producer while keeping backpressure, cancellation, and wire format intact. Upgrade both packages together because the plugin requires the new core hooks.
##### Patch Changes
- [`6d92c38`](https://github.com/lxsmnsyc/seroval/commit/6d92c38): - Export `SerializeOptions`, `SerializeAsyncOptions`, `ToJSONOptions` and `ToJSONAsyncOptions`, the option types of `serialize`, `serializeAsync`, `toJSON` and `toJSONAsync`.
- Mark `Feature.ArrowFunction` and `SerovalMissingReferenceError` as deprecated. Neither has any effect.
- [`8b4214f`](https://github.com/lxsmnsyc/seroval/commit/8b4214f): Reuse the resolved plugin list when the same `plugins` array is passed again, so each call no longer rebuilds it.
- [`b7edc16`](https://github.com/lxsmnsyc/seroval/commit/b7edc16): Create leaf nodes with only their `t`, `i` and `s` fields, cutting tree memory for primitive-heavy payloads.
- [`dcf9a69`](https://github.com/lxsmnsyc/seroval/commit/dcf9a69): Report the depth limit error with its own error code.
- [`e118511`](https://github.com/lxsmnsyc/seroval/commit/e118511): Derive the well-known symbol name and lookup tables and the error constructor names from their single source tables.
- [`1e13e04`](https://github.com/lxsmnsyc/seroval/commit/1e13e04): Avoid temporary reference lookup wrappers in the parsers and resolve named references with one registry lookup.
- [`c643404`](https://github.com/lxsmnsyc/seroval/commit/c643404): The documentation moved to <https://seroval.vercel.app>. The READMEs and the package homepages now link to it.
- [`3234e88`](https://github.com/lxsmnsyc/seroval/commit/3234e88): Honor `depthLimit` in every serializer entry point and in `fromJSON`, wrap failures raised while emitting output in `SerovalSerializationError`, and report a node id that is assigned twice with `SerovalConflictedNodeIdError`.
- [`a1e185a`](https://github.com/lxsmnsyc/seroval/commit/a1e185a): Build with an explicit ES2020 syntax target so the emitted syntax floor no longer follows `engines.node`, keeping nullish coalescing and optional chaining as written.
- [`3b49dc3`](https://github.com/lxsmnsyc/seroval/commit/3b49dc3): Inline feature bits inside the library with an internal `const enum`. The exported `Feature` enum is unchanged.
- [`d171f53`](https://github.com/lxsmnsyc/seroval/commit/d171f53): Replace the `isValidIdentifier` regex and first-character string slice with a `charCodeAt` scan.
- [`641e424`](https://github.com/lxsmnsyc/seroval/commit/641e424): `serialize` and `serializeAsync` no longer add an unused placeholder variable to every payload that contains a `Map`. It is now declared only when a `Map` entry needs it, so a plain `Map` serializes to `new Map([...])`.
- [`26d263f`](https://github.com/lxsmnsyc/seroval/commit/26d263f): Define the global `__SEROVAL_REFS__` store on the first `createReference` call instead of at import time, and mark the package side-effect free so bundlers can drop unused modules.
- [`20de609`](https://github.com/lxsmnsyc/seroval/commit/20de609): Export the `Stream`, `Sequence` and `LiveStream` classes so bundlers can drop them when unused.
- [`f0ff974`](https://github.com/lxsmnsyc/seroval/commit/f0ff974): Merge duplicated node creators, promise result and stream call handlers, and share one Temporal name table.
- [`bd9cac0`](https://github.com/lxsmnsyc/seroval/commit/bd9cac0): Skip the escape loop for strings that need no escaping, escape the rest by switching on `charCodeAt`, and decode escapes without a per-match `replace` callback.
- [`5426ea8`](https://github.com/lxsmnsyc/seroval/commit/5426ea8): Check extensibility first when reading object flags so ordinary objects need one native call.
- [`0cb3c78`](https://github.com/lxsmnsyc/seroval/commit/0cb3c78): Omit trailing empty fields when creating nodes.
- [`090f5be`](https://github.com/lxsmnsyc/seroval/commit/090f5be): Generate deferred assignment expressions in one pass without an intermediate array or merged assignment objects.
- [`37ed929`](https://github.com/lxsmnsyc/seroval/commit/37ed929): Walk object properties with Object.keys instead of Object.entries so parsing no longer allocates a key/value pair per property.
- [`11c4446`](https://github.com/lxsmnsyc/seroval/commit/11c4446): Replace internal plugin context wrapper classes with plain objects so Rspack and webpack can tree-shake unused parser, serializer, and deserializer modules.
- [`a758b08`](https://github.com/lxsmnsyc/seroval/commit/a758b08): Preserve reserved own property names in cyclic objects and retain Error `__proto__` data properties without changing their prototypes.
Compatibility note: Error `__proto__` fields previously dropped are now preserved as own data properties. Copying these results with `Object.assign({}, value)` can change the destination's prototype. Use `{ ...value }` for shallow copies; later merges still require safe handling.
- [`93adf62`](https://github.com/lxsmnsyc/seroval/commit/93adf62): Size parser child arrays up front, and stop awaiting primitives in the async parser.
- [`96a3214`](https://github.com/lxsmnsyc/seroval/commit/96a3214): Release private references and cleanup callbacks when a Serializer closes, prevent reentrant completion, and finish other writes' cleanup when a callback throws.
- [`f698afa`](https://github.com/lxsmnsyc/seroval/commit/f698afa): Release stream parser subscriptions and buffered nodes after use, and complete serialization once after buffered chunks are emitted.
- [`e5d493e`](https://github.com/lxsmnsyc/seroval/commit/e5d493e): Classify object keys with a first-character check so the serializer only parses keys that can be numeric, and emit deferred key assignments through one helper.
- [`883f47f`](https://github.com/lxsmnsyc/seroval/commit/883f47f): Share the parser's marked reference set with serializer contexts instead of copying it, so streaming serializers no longer pay O(references) per emitted node.
- [`d1cbe82`](https://github.com/lxsmnsyc/seroval/commit/d1cbe82): Streaming serializers reuse one plugin context per depth, so values handled by plugins no longer allocate a new context each.
- [`a295de9`](https://github.com/lxsmnsyc/seroval/commit/a295de9): Classify objects once in a shared `getObjectKind` helper so the sync, stream and async parsers no longer carry separate copies of the class checks and feature gates.
- [`f907408`](https://github.com/lxsmnsyc/seroval/commit/f907408): Preserve stream event order during async parsing and wait for earlier chunks before completing. Live writes are accepted after their parsed event is placed.
Stop sources on parse or output failure, forward cancellation reasons, and release owned callbacks and records. Keep the original error when cleanup also fails, reject cleanup failures after otherwise successful parsing, and retain existing streaming plugin lifecycle hooks.
Keep incidental primitive callback returns synchronous. Only objects and functions are inspected for thenables, and the callable `then` is invoked without reading its `call` property.
Disposing `crossSerializeStream` or `toCrossJSONStream` no longer invokes `onDone`: disposal abandons output rather than completing it. Callers that close a response in `onDone` must also close it when disposing. `Serializer.close()` still invokes `onDone`. A failed `Serializer.write()` only stops that write; sibling streams and subsequent writes remain active. `SerializerOptions.onError` remains required.
- [`258c8e3`](https://github.com/lxsmnsyc/seroval/commit/258c8e3): `toJSON`, `crossSerialize` and `toCrossJSON` now throw when the value contains a promise, like `serialize` already did. Before, they sent a promise that never settled. Use an async or streaming function to send promises.
- [`fa4f346`](https://github.com/lxsmnsyc/seroval/commit/fa4f346): Allow bundlers to remove unused iterator factories from consumers that do not need deserialization.
- [`7d2153c`](https://github.com/lxsmnsyc/seroval/commit/7d2153c): Keep unused symbol and constant tables out of consumer bundles and register the reference store with one global lookup.
- [`e70d7f6`](https://github.com/lxsmnsyc/seroval/commit/e70d7f6): Remove unused parser and deserializer context state and share guarded typed-array and DataView decoding.
- [`5a49e1a`](https://github.com/lxsmnsyc/seroval/commit/5a49e1a): Unify `TypedArray` and `DataView` node creation, parsing, and serialization helpers.
### [`v1.6.12`](https://github.com/lxsmnsyc/seroval/compare/seroval@1.6.11...seroval@1.6.12)
[Compare Source](https://github.com/lxsmnsyc/seroval/compare/seroval@1.6.11...seroval@1.6.12)
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTguMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE5OC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Here are some key observations to aid the review process:
⏱️Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪No relevant tests
🔒No security concerns identified
⚡No major issues detected
## PR Reviewer Guide 🔍
<!-- pr-agent:review:full -->
Here are some key observations to aid the review process:
<table>
<tr><td>⏱️ <strong>Estimated effort to review</strong>: 1 🔵⚪⚪⚪⚪</td></tr>
<tr><td>🧪 <strong>No relevant tests</strong></td></tr>
<tr><td>🔒 <strong>No security concerns identified</strong></td></tr>
<tr><td>⚡ <strong>No major issues detected</strong></td></tr>
</table>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR contains the following updates:
1.6.11→1.7.7Release Notes
lxsmnsyc/seroval (seroval)
v1.7.7Compare Source
Patch Changes
constructorproperty, and readsDate, Temporal, typed array andDataViewvalues through the built-in methods and getters instead of properties on the value. An object whose ownconstructornames a built-in class is now serialized as a plain object, and an object that only inherits a built-in prototype, such asObject.create(Date.prototype), is rejected.00e3abf: Bundles that never create a live stream no longer include theLiveStreamclass: about 570 bytes gzipped less fortoJSONAsync,fromJSONorfromCrossJSONon the production ESM build, measured with seroval's bundle size report. An object made withObject.create(LiveStream.prototype)is no longer treated as a live stream.v1.7.6Compare Source
Patch Changes
RegExp.prototypegetters, so ownsourceorflagsproperties on the value no longer change the output.v1.7.5Compare Source
Patch Changes
d85ec3f: Keep two round-trip cases intact. An object whose ownconstructorkey holds a falsy value, such as{ constructor: undefined }, now keepsObject.prototypeinstead of coming back with a null prototype. A null-prototype object with an own__proto__key, or any object serialized withFeature.ObjectAssigndisabled, no longer turns equal-looking values such as twonew Set()into one shared object inserialize,crossSerializeandcompileJSONoutput.v1.7.4Compare Source
No changes in this release.
v1.7.3Compare Source
Patch Changes
3a60f79: Republish the 1.7.2 changes through CI with npm provenance. 1.7.2 was published manually without an attestation, so pnpm'strustPolicy: no-downgraderefused to install it (#278). No code changes.v1.7.2Compare Source
v1.7.1Compare Source
Patch Changes
b703710:createCrossDeserializerno longer causes unhandled rejections. This covers a rejected promise that the caller never reads, and a pending promise thatabortrejects. Code that awaits the promise still gets the rejection.2d03651:serialize,toJSON,crossSerializeandtoCrossJSONnow throw when the value contains an async iterable or aReadableStream, as they do for a promise. Before, they sent a stream that never got its values. Use an async or streaming function to send them.2c25bf3:serialize,toJSON,crossSerializeandtoCrossJSONnow send acreateStreamstream that has ended with all its events. A stream that is still open, or a live stream, now throws. Before, they sent an empty stream that never ended.v1.7.0Compare Source
Minor Changes
9a75aae: Add theassignSharedRefsOnlyoption tocrossSerializeandcrossSerializeAsync. It stores only the values the output reads more than once in$R, which makes shorter output when no later script refers back to it.f3f39de: AddcreateCrossDeserializer, a session for cross-reference JSON records that tracks unsettled promises and open streams, reports how many are still pending, and can abort them with a caller-supplied reason when the transport fails.2324090: Streams serialized from a live stream in streaming mode are rebuilt with a live receiver: it keeps history only until its first listener subscribes, then forwards each value without retaining it and refuses a second listener. Replay streams and existing serialized data are unchanged, and readers that ignore the marker build a replay receiver.4c0008f: AddcreateLiveStream(), a single-consumer stream that holds one event at a time and resolves each producer write only after the serialized record is accepted.crossSerializeStreamandtoCrossJSONStreamcallbacks may now return a promise; the next record, and the acceptance of the source event behind it, wait for it to settle. Records discovered while parsing an event are emitted after the record that introduces them, one callback runs at a time,onDonewaits for the last callback and is not called after an output failure, and cleanup runs every callback once. Async iterables andReadableStreamvalues read their next chunk only after the previous record is accepted. Existing streaming plugin lifecycle hooks remain available; parsing a live stream is the preferred way to connect an incremental source.f2b7d0c: Raise the supported Node.js floor from>=10to>=20inengines, remove the no-optypesVersionsfrom seroval, give seroval-pluginsmain,moduleandtypesfields plus atypesVersionsentry that points at the emittedwebdeclarations, and link the plugins package to the workspace copy of seroval.8a95987: Add the optionalskipPlainObjectsplugin field. A plugin that sets it totrueis not tested against plain objects, which makes parsing faster when most values are plain objects.5ab601f: Add plugin context hooks for parsing an async iterable as a stream source. Use them in the ReadableStream plugin to avoid a separate live-stream producer while keeping backpressure, cancellation, and wire format intact. Upgrade both packages together because the plugin requires the new core hooks.Patch Changes
6d92c38: - ExportSerializeOptions,SerializeAsyncOptions,ToJSONOptionsandToJSONAsyncOptions, the option types ofserialize,serializeAsync,toJSONandtoJSONAsync.Feature.ArrowFunctionandSerovalMissingReferenceErroras deprecated. Neither has any effect.8b4214f: Reuse the resolved plugin list when the samepluginsarray is passed again, so each call no longer rebuilds it.b7edc16: Create leaf nodes with only theirt,iandsfields, cutting tree memory for primitive-heavy payloads.dcf9a69: Report the depth limit error with its own error code.e118511: Derive the well-known symbol name and lookup tables and the error constructor names from their single source tables.1e13e04: Avoid temporary reference lookup wrappers in the parsers and resolve named references with one registry lookup.c643404: The documentation moved to https://seroval.vercel.app. The READMEs and the package homepages now link to it.3234e88: HonordepthLimitin every serializer entry point and infromJSON, wrap failures raised while emitting output inSerovalSerializationError, and report a node id that is assigned twice withSerovalConflictedNodeIdError.a1e185a: Build with an explicit ES2020 syntax target so the emitted syntax floor no longer followsengines.node, keeping nullish coalescing and optional chaining as written.3b49dc3: Inline feature bits inside the library with an internalconst enum. The exportedFeatureenum is unchanged.d171f53: Replace theisValidIdentifierregex and first-character string slice with acharCodeAtscan.641e424:serializeandserializeAsyncno longer add an unused placeholder variable to every payload that contains aMap. It is now declared only when aMapentry needs it, so a plainMapserializes tonew Map([...]).26d263f: Define the global__SEROVAL_REFS__store on the firstcreateReferencecall instead of at import time, and mark the package side-effect free so bundlers can drop unused modules.20de609: Export theStream,SequenceandLiveStreamclasses so bundlers can drop them when unused.f0ff974: Merge duplicated node creators, promise result and stream call handlers, and share one Temporal name table.bd9cac0: Skip the escape loop for strings that need no escaping, escape the rest by switching oncharCodeAt, and decode escapes without a per-matchreplacecallback.5426ea8: Check extensibility first when reading object flags so ordinary objects need one native call.0cb3c78: Omit trailing empty fields when creating nodes.090f5be: Generate deferred assignment expressions in one pass without an intermediate array or merged assignment objects.37ed929: Walk object properties with Object.keys instead of Object.entries so parsing no longer allocates a key/value pair per property.11c4446: Replace internal plugin context wrapper classes with plain objects so Rspack and webpack can tree-shake unused parser, serializer, and deserializer modules.a758b08: Preserve reserved own property names in cyclic objects and retain Error__proto__data properties without changing their prototypes.Compatibility note: Error
__proto__fields previously dropped are now preserved as own data properties. Copying these results withObject.assign({}, value)can change the destination's prototype. Use{ ...value }for shallow copies; later merges still require safe handling.93adf62: Size parser child arrays up front, and stop awaiting primitives in the async parser.96a3214: Release private references and cleanup callbacks when a Serializer closes, prevent reentrant completion, and finish other writes' cleanup when a callback throws.f698afa: Release stream parser subscriptions and buffered nodes after use, and complete serialization once after buffered chunks are emitted.e5d493e: Classify object keys with a first-character check so the serializer only parses keys that can be numeric, and emit deferred key assignments through one helper.883f47f: Share the parser's marked reference set with serializer contexts instead of copying it, so streaming serializers no longer pay O(references) per emitted node.d1cbe82: Streaming serializers reuse one plugin context per depth, so values handled by plugins no longer allocate a new context each.a295de9: Classify objects once in a sharedgetObjectKindhelper so the sync, stream and async parsers no longer carry separate copies of the class checks and feature gates.f907408: Preserve stream event order during async parsing and wait for earlier chunks before completing. Live writes are accepted after their parsed event is placed.Stop sources on parse or output failure, forward cancellation reasons, and release owned callbacks and records. Keep the original error when cleanup also fails, reject cleanup failures after otherwise successful parsing, and retain existing streaming plugin lifecycle hooks.
Keep incidental primitive callback returns synchronous. Only objects and functions are inspected for thenables, and the callable
thenis invoked without reading itscallproperty.Disposing
crossSerializeStreamortoCrossJSONStreamno longer invokesonDone: disposal abandons output rather than completing it. Callers that close a response inonDonemust also close it when disposing.Serializer.close()still invokesonDone. A failedSerializer.write()only stops that write; sibling streams and subsequent writes remain active.SerializerOptions.onErrorremains required.258c8e3:toJSON,crossSerializeandtoCrossJSONnow throw when the value contains a promise, likeserializealready did. Before, they sent a promise that never settled. Use an async or streaming function to send promises.fa4f346: Allow bundlers to remove unused iterator factories from consumers that do not need deserialization.7d2153c: Keep unused symbol and constant tables out of consumer bundles and register the reference store with one global lookup.e70d7f6: Remove unused parser and deserializer context state and share guarded typed-array and DataView decoding.5a49e1a: UnifyTypedArrayandDataViewnode creation, parsing, and serialization helpers.v1.6.12Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.
Failed to update PR description
PR Reviewer Guide 🔍
Here are some key observations to aid the review process: