Skip to content

Commit d471f9d

Browse files
committed
docs: update changelog for primitive object changes
1 parent 1609fea commit d471f9d

1 file changed

Lines changed: 61 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,65 @@ and this project adheres to
88

99
## [Unreleased]
1010

11+
> [!IMPORTANT]
12+
>
13+
> This version made some backwards-incompatible changes, but they are not likely
14+
> to affect typical users, unless they're explicitly creating and persisting
15+
> `JSPrimitiveObject` or customising decoding.
16+
17+
<details>
18+
<summary><h3>Backwards-incompatible changes<h3></summary>
19+
20+
#### Encoding/decoding primitive string objects
21+
22+
The encoding/decoding of primitive string objects was incorrect in 0.1.0 and has
23+
changed to match the current V8 serialisation format (see the fixed section).
24+
The backwards compatibility impact of this is that `JSPrimitiveObject` values
25+
containing strings serialized by `v8serialize` in 0.1.0 are not deserializable
26+
in this version.
27+
28+
These objects are not created by default, so to be affected, code would need to
29+
have explicitly created and serialised instances and persisted the serialised
30+
representation to be loaded by this version.
31+
32+
Instances of this value sent to or received from real V8 implementations are not
33+
affected in a backwards-incompatible way, as values would fail to decode in
34+
either direction because of the mutually-incompatible encoding.
35+
36+
#### API changes
37+
38+
The `v8serialize.decode.ReadableTagStream.read_js_primitive_object` method now
39+
requires a `ctx: DecodeContext` argument, as many other methods on this type do.
40+
This was required to fix [#8].
41+
42+
</details>
43+
44+
[#8]: https://github.com/h4l/v8serialize/issues/8
45+
46+
### Fixed
47+
48+
- [Wrapped/boxed string values][MDN Primitive] (JavaScript `new String("x")` /
49+
Python `JSPrimitiveObject("x")`, (used to distinguish `new String("x")` from
50+
`"x"`)) are now encoded/decoded correctly. Previously they were incorrectly
51+
being encoded/decoded using an obsolete version of the V8 serialization
52+
format, earlier than the currently-used format, and earlier than the minimum
53+
version `v8serialize` supports. ([#8])
54+
55+
### Added
56+
57+
- Support for round-tripping wrapped/boxed JavaScript primitive type objects.
58+
59+
The `loads()` function and `TagReader` class now take a `js_primitive_objects`
60+
bool option (defaulting `False`) that uses `JSPrimitiveObject` values in
61+
decoded values rather than their unwrapped primitive value.
62+
63+
[MDN Primitive]: https://developer.mozilla.org/en-US/docs/Glossary/Primitive
64+
65+
## [0.2.0-alpha.0] - 2024-12-30
66+
67+
I never tagged & published a stable release of this alpha release, I forgot as I
68+
was installing the project from git and then working on other things, sorry!
69+
1170
### Added
1271

1372
- Marked SerializationFeature.Float16Array as released from V8 13.1.201 (was
@@ -59,8 +118,7 @@ and this project adheres to
59118
- This is compatible with Python's numeric type system as `int` types are
60119
accepted by types requiring `float`, and the `/` and `//` operators work
61120
equivalently with `int` and `float` representations of the same value.
62-
63-
([#7](https://github.com/h4l/v8serialize/pull/7))
121+
([#7](https://github.com/h4l/v8serialize/pull/7))
64122

65123
## [0.1.0] - 2024-09-24
66124

@@ -70,3 +128,4 @@ and this project adheres to
70128

71129
[unreleased]: https://github.com/h4l/v8serialize/compare/v0.1.0...HEAD
72130
[0.1.0]: https://github.com/h4l/v8serialize/releases/tag/v0.1.0
131+
[0.2.0-alpha.0]: https://github.com/h4l/v8serialize/releases/tag/v0.2.0-alpha.0

0 commit comments

Comments
 (0)