fix: unstate object in Svelte 5 dev mode#12095
Conversation
...before checking serializability fixes #11363
🦋 Changeset detectedLatest commit: 33c944b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
| import { writable } from 'svelte/store'; | ||
| import { VERSION } from 'svelte/compiler'; |
There was a problem hiding this comment.
I'd put these two lines up with the other svelte import just to keep things a little organized
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
|
looks good to me once the test failures are addressed |
|
With sveltejs/svelte#11180 this will need a different approach, since we would need to use runes then. |
|
@dummdidumm Can you not import from |
|
Feels like there's a deeper question here: when would you ever use In #11363, the argument to |
|
Tinkered locally and I think the right fix for #11363 is to change this line: kit/packages/kit/src/runtime/client/client.js Line 561 in f71f381 -data: data_changed ? data : page.data
+data: data_changed ? Object.freeze(data) : page.data
|
|
I think the underlying problem is that in Another way to solve this is to make - if (Object.getOwnPropertySymbols(thing).length > 0) {
+ const enumerable_symbols = Object.getOwnPropertySymbols(thing).filter(s => Object.getOwnPropertyDescriptor(thing, s).enumerable);
+ if (enumerable_symbols.length > 0) {
throw new DevalueError(
`Cannot stringify POJOs with symbolic keys`,
keys
);
}I don't think that people expect things added to |
|
Released a new version of |
|
I merged the rennovate PR to bump devalue to v5 here: #12141. I have not yet released it |
|
I released it and confirmed that it fixes #11363, so I'm going to close this. We can revisit the |
...before checking serializability
fixes #11363
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits