Skip to content

Conversation

@Rich-Harris
Copy link
Member

Another change extracted from #17362. I realised while reviewing it that there's no reason a reaction should ever be MAYBE_DIRTY if it has no dependencies. After a reaction with no dependencies first runs, it goes from DIRTY to CLEAN, and should never again be anything other than CLEAN.

The corollary is that we can simplify the code in is_dirty, because we know that reaction.deps is not null. Except that right now we do erroneously mark some effects MAYBE_DIRTY — legacy $: effects — so this PR fixes that too.

I'm not including a changeset with this one, because it's not making any user-observable changes (those MAYBE_DIRTY effects will never actually re-run, they will just unnecessarily go through the is_dirty process and be marked CLEAN) and falls under the #17362 umbrella. Self-merging once green to continue with that PR.

@changeset-bot
Copy link

changeset-bot bot commented Jan 9, 2026

⚠️ No Changeset found

Latest commit: 9a10e37

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Playground

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

@Rich-Harris Rich-Harris merged commit f8bdadc into main Jan 9, 2026
18 checks passed
@Rich-Harris Rich-Harris deleted the simplify-is-dirty branch January 9, 2026 18:23
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.

2 participants