Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4.6k
fix: lift unsafe_state_mutation constraints for SvelteSet and SvelteMap created inside the derived#16221
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ap created inside the derived
changeset-botbot commentedJun 24, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
🦋 Changeset detectedLatest commit:a784607 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 |
… and SvelteURLSearchParams created inside the derived
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think it makes sense...thanks for exploring and fix this! 🧡
2af7ba2
intosveltejs:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Closes#16211. Changes are mostly tests.
Currently mutating signals local to derived is allowed for primitives, arrays and objects, but not for sets and maps. Since the goal of derived is to be pure, mutating signals created inside it does not violate purity anyhow. This PR makes behavior consistent for sets and maps. Also covering all the other cases with tests to ensure future consistency.
Update: also applied the change to SvelteDate, SvelteURL and SvelteURLSearchParams
Tests are passing, but
pnpm lint
is crashing withError: Cannot find module ' /Code/svelte/node_modules/.pnpm/svelte-eslint-parser@0.43.0_svelte@packages+svelte/node_modules/svelte/compiler/index.js'
. Not sure what to do about it.Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.packages/svelte/src
, add a changeset (npx changeset
).Tests and linting
pnpm test
and lint the project withpnpm lint