Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Patch structuredClone in dev to correctly clone $state proxies #14599

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/weak-flowers-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

patch structuredClone in dev to error on $state proxies
6 changes: 6 additions & 0 deletions documentation/docs/98-reference/.generated/shared-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ Certain lifecycle methods can only be used during component initialisation. To f
`%name%` is not a store with a `subscribe` method
```

### structured_clone_state_proxy

```
To correctly clone a `$state` proxy, use `$state.snapshot` instead of `structuredClone`
```

### svelte_element_invalid_this_value

```
Expand Down
4 changes: 4 additions & 0 deletions packages/svelte/messages/shared-errors/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Certain lifecycle methods can only be used during component initialisation. To f

> `%name%` is not a store with a `subscribe` method

## structured_clone_state_proxy

> To correctly clone a `$state` proxy, use `$state.snapshot` instead of `structuredClone`

## svelte_element_invalid_this_value

> The `this` prop on `<svelte:element>` must be a string, if defined
Loading
Loading