Skip to content

Regression: Silence ownership warning for object class fields #11060

@michael

Description

@michael

Describe the bug

According to Dominic "Classes are excluded from the warning as they're deemed "you know what you're doing."

While everything works fine with flat class fields (like strings) we do see the warning for class fields that hold an object.

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE51Uy66bMBD9lalVCSIR2JOHVLXdVKrURXelqhwYgnOJjewhuRHyv1fGQOBGV0q7Mp7xnHmcM3SsFDUalv7qmORnZCn71DQsYnRr3MVcsCZkETOq1bmzbE2uRUP7TGYkzo3SBD9QGyW_FoKUhlKrM2QsTubW2ONkbPMQ9l0VWL-N6o1DUHwyy7gODNJnJQlfKYLj9A12hFlkq5Gg6VFhBx8NccJQ4nWePuxc7yl0pdCG_vhL8E1VMoig5nfTF4WBjaBSh8MtheAnSilMYFcrl0nCrLAwY7wRGYugcw5wdQ5lhKvRBqCRWi0Hx8ZbbeRO6zC3yX3acruYc7LP5LYQl56IzgPErsz43oSFhWPqxEItXtBM3r4fG7t8DpFF7KwKUQosWEq6RRtN6pjX8I8y-Q_eeCNgN3s6TvVxNh_W65FlYYBLENIQlzmCKhdKo4oTVNx4EiE0pIU8roDLAlyPEKrDCXNaQV5zY6AUWBcmhvV6P6Q5CFkIeQRSLo9_PX8Mtz4EOKirRG0q0QBqrfSAIWTTUo-SXnjd4q7jjYjfYzB5LmTGbTIVOsSMxYLvdVHrVekXA1dBlWoJOFy5lu7NE6V61UDyhF7m-3xXzcnMFYOvvUoKLHlbjwOdM9c5VfQUTXvcwWJj32xr0O9QRp7pKSgI_LpmlCtpSLc5Ke1_AcNq25VPlhFVwsRDTndsZuYRtj97h82kfRzGb_sX8jyRCmYFAAA=

Logs

"PersonEditor.svelte mutated a value owned by App.svelte. This is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead."

eval (playground:output:2748:39)
untrack (playground:output:1700:11)
console.<computed> [as trace] (playground:output:2748:16)
check_ownership (playground:output:603:12)
Object.set (playground:output:889:6)
eval (playground:output:2626:117)
HTMLInputElement.eval [as __on_r] (playground:output:2414:4)

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M2
    Memory: 90.53 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.10.0 - /usr/local/bin/node
    npm: 10.2.3 - /usr/local/bin/npm
  Browsers:
    Chrome: 123.0.6312.105
    Safari: 17.2.1
  npmPackages:
    svelte: 5.0.0-next.93 => 5.0.0-next.93

Severity

annoyance

Metadata

Metadata

Assignees

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