fix: run effects in pending snippets#17719
Conversation
🦋 Changeset detectedLatest commit: 02a8f39 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 |
|
There was a problem hiding this comment.
Mostly looks good but this has the consequence that there's now no more state updates in a failed state: playground
This is arguably worse than the short-lived pending snippet.
If fixing this means removing those lines I added the TODO to, then I think it's reasonable to make this very pedantically strictly speaking breaking change which noone will run into in practise and bubble up an error within a failed snippet to the next boundary (and also add a test to codify this)
Nevermind this was a playground bug not firing events
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## svelte@5.51.3 ### Patch Changes - fix: prevent event delegation logic conflicting between svelte instances ([#17728](#17728)) - fix: treat CSS attribute selectors as case-insensitive for HTML enumerated attributes ([#17712](#17712)) - fix: locate Rollup annontaion friendly to JS downgraders ([#17724](#17724)) - fix: run effects in pending snippets ([#17719](#17719)) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Boundaries are buggy: if the
pendingsnippet contains state, changes to that state won't cause updates:The issue is that the boundary's
this.#effecthas theBOUNDARY_EFFECTflag, andthis.#pending_effectis a child thereof. Instead,this.#main_effectshould have the flag. (It turns outthis.#failed_effectalso needs the flag, because errors that occur in afailedsnippet cause the boundary to re-render in itsfailedstate, which I found somewhat confusing to be honest. Probably the right choice though.)I was able to simplify the code a bit, too.
(Actually now that I think about it do we needthis.#effectat all? Will check.)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 testand lint the project withpnpm lint