Skip to content

Conversation

@hmnd
Copy link
Contributor

@hmnd hmnd commented Dec 9, 2025

fixes #17197, fixes #17304, fixes #17301, fixes #17309, possibly others

Thanks to @dummdidumm's prior digging into this here

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.
  • If this PR changes code within packages/svelte/src, add a changeset (npx changeset).

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: 19baf10

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

Playground

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

@soniquete0
Copy link

I tested this with my repro mentioned in this comment - sveltejs/kit#15059 (comment)
It does fix the hovering a link bug.
There seems to be one more bug related to async as well related to navigation also mentioned in the comment. I am leaving a comment about it here as I thought that you might find it interesting.

@svelte-docs-bot
Copy link

Comment on lines +867 to +871
// Track branches toggled during fork execution so we can restore
// their CLEAN flag after flush
if (current_batch !== null && current_batch.is_fork) {
(current_batch.toggled_branches ??= new Set()).add(effect);
}
Copy link
Member

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...there's only one thing that it kinda irks me here: we are restoring ALL the branches to CLEAN but wouldn't this lead to over-running?

Copy link
Contributor Author

@hmnd hmnd Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I don't think that's a concern because we only do this for branches that had CLEAN before the fork. I'm pretty sure setting CLEAN doesn't necessarily mean branches will run either, it just allows them to be scheduled.

@Heniker
Copy link

Heniker commented Dec 29, 2025

I am not sure If I understand fork correctly, but it seems that just using fork(() => {}) can completely hang the app: REPL (offending line is commented)

This seems to be even execution order-dependent.

@hmnd
Copy link
Contributor Author

hmnd commented Dec 30, 2025

@Heniker you're seeing a combination of the bug fixed in this pr, and the bug with deriveds (which {@const} compiles to) in my other pr #17362. Stacking the two prs fixes your repro and doesn't result in a freeze

@hmnd
Copy link
Contributor Author

hmnd commented Jan 2, 2026

@teemingc let me know if you'd prefer for me to combine this PR with #17362. As you can see from the above comment, this PR is sort of dependent on that one to fully fix reactivity, although they touch different parts of the runtime.

@teemingc
Copy link
Member

teemingc commented Jan 3, 2026

Thanks David. I think it's completely fine to keep the PRs separate as they make reviewing the changes easier. I'd recommend editing the descriptions to mention how the two are linked.

Unfortunately, I'm not too familiar with the Svelte codebase so I'd wait for one of the more experienced maintainers to review the two PRs once everyone's back from their holidays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants