Skip to content

Svelte 5 same referenced object reactivity #16419

@felbsn

Description

@felbsn

Describe the bug

Same referenced objects in a list not updated simultaneously, $state handles them as complete different entries.

Reproduction

Here is a minimal example what I get in svelte 4 and can't get in svelte 5

svelte 4 REPL

svelte 5 REPL

So I did implement a workaround by declaring a reactive wrapper class

svelte 5 workaround REPL

with this, at least it works but what I want is also updating raw rows as I refer them as coming from another library/method so I don't want to pass them with their proxified version to other typescript methods and there is a alot of usages so I don't really wanted call $state.snapshot() everytime (also don't want to broke original references).

Well I did come up something like this. using $state.raw and manual reactivity triggering

svelte 5 workaround + bind fix REPL
Not proud of it but works, with a lot of warnings and not sure it will continue to work.

We are migrating svelte 4 to svelte 5 and its a blocking behavior for us.

Logs

System Info

-

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy