Skip to content

Identity de-dupe with replacers in uneval#159

Open
lucacasonato wants to merge 2 commits into
sveltejs:mainfrom
lucacasonato:identity_dedupe_replacer_uneval
Open

Identity de-dupe with replacers in uneval#159
lucacasonato wants to merge 2 commits into
sveltejs:mainfrom
lucacasonato:identity_dedupe_replacer_uneval

Conversation

@lucacasonato

Copy link
Copy Markdown

This commit implements a mechanism to enable
reducers in uneval to not duplicate values that
are referenced multiple times.

This fix involves sometimes calling replacer
twice for the same value. Right now it also calls
replacer twice for the same value when we can know
to avoid it, but the bookkeeping required to avoid
it likely not worth the memory complexity it adds.

Fixes #158

This commit implements a mechanism to enable
reducers in `uneval` to not duplicate values that
are referenced multiple times.

This fix involves sometimes calling `replacer`
twice for the same value. Right now it also calls
replacer twice for the same value when we can know
to avoid it, but the bookkeeping required to avoid
it likely not worth the memory complexity it adds.
@changeset-bot

changeset-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1702212

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
devalue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

uneval custom serializer can cause duplicates objects (identity breaks)

1 participant