Skip to content

Conversation

@trueadm
Copy link
Contributor

@trueadm trueadm commented Nov 16, 2024

If an expression references a rune, then it's not safe to mark as pure.

@changeset-bot
Copy link

changeset-bot bot commented Nov 16, 2024

🦋 Changeset detected

Latest commit: d7a8714

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

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

@Rich-Harris
Copy link
Member

preview: https://svelte-dev-git-preview-svelte-14333-svelte.vercel.app/

this is an automated message

@github-actions
Copy link
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@14333

@Rich-Harris
Copy link
Member

Is this right? If I do {$state.snapshot(1)} — ignore that that's an obviously strange thing to do — then it feels odd that the expression should be marked as impure. Same if I did, I don't know, {$host().nodeName}, and potentially other things we add in future.

Maybe we should just be changing the behaviour of $effect.tracking()? See #13903

@trueadm
Copy link
Contributor Author

trueadm commented Nov 19, 2024

@Rich-Harris Good point. I made that change.

@Rich-Harris Rich-Harris merged commit 747d408 into main Nov 19, 2024
11 checks passed
@Rich-Harris Rich-Harris deleted the pure-tracking branch November 19, 2024 19:04
@github-actions github-actions bot mentioned this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doc mismatch with $effect.tracking() behavior in optimized static blocks

3 participants