Skip to content

chore: switch from vendored devalue fork to upstream devalue 6 - #3914

Merged
lucacasonato merged 1 commit into
nextfrom
chore/upstream-devalue
Oct 17, 2026
Merged

lucacasonato merged 1 commit into
nextfrom
chore/upstream-devalue

Conversation

@lucacasonato

Copy link
Copy Markdown
Member

devalue 6 ships the js tagged-template replacer API from sveltejs/devalue#182, which is what our vendored fork existed for. This drops src/vendor/devalue and depends on devalue@^6.0.3 instead.

  • Replacer: createSerializer now returns js fragments instead of calling recurse. Import aliases and factory args aren't known until runtime, so a small source() helper builds the template strings array by hand. This relies on js only checking that strings and strings.raw are arrays, which isn't documented upstream.
  • Shared references: because the holes in a fragment are visited during devalue's reference analysis, a signal inside a factory's args and in a sibling position now revives as one instance. This wasn't preserved before — there's a new test for it.
  • Round-trip tests: unit round-trips for Temporal types, ArrayBuffer and every typed array (incl. subarrays and shared buffers), DataView, URL / URLSearchParams, sparse arrays, and undefined / NaN / ±Infinity / -0. These found three bugs in the old fork (sparse array holes, BigInt64Array elements, DataView offsets) that upstream 6 doesn't have.

`devalue` 6 ships the `js` tagged-template replacer API from
sveltejs/devalue#182, which is what the fork existed for. The replacer now
returns `js` fragments, so a signal inside a factory's args and in a sibling
position revives as one instance. Also adds unit round-trips for Temporal
types, typed arrays, `DataView`, `URL`, sparse arrays and special numbers.
@lucacasonato
lucacasonato merged commit 065612f into next Oct 17, 2026
4 checks passed
@lucacasonato
lucacasonato deleted the chore/upstream-devalue branch October 17, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant