-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix: thunkify deriveds on the server #14977
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 961c36b 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 |
preview: https://svelte-dev-git-preview-svelte-14977-svelte.vercel.app/ this is an automated message |
|
Brought this up to speed with Not really sure how best to resolve that so for now I'm not going to try. |
Yeah i planned to get back to this after the writable deriveds PR but wanted to check if that's the road we want to go first. I can work on this if we want. |
Closes #14954
I took a shot with the idea of thunkify every derived on the server to make them "work" in case of reassignment. As pointed out by @Rich-Harris this have some downside:
But I think regardless of the solution we will go with we will probably need functions in some way so this PR can be a good start.
I got 90% there in 10 minutes and then faced a big problem with destructured deriveds. Since we want every destructured identifier to be a function the only way i thought of is to do something like this.
it's a bit more generated code but it works fine.
Again, this is a proposal, don't know if this the actual direction we want to go but even if it's not it could be a good base.
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