Skip to content

fix: ensure directives run in sequential order #12591

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

Merged
merged 2 commits into from
Jul 24, 2024
Merged

fix: ensure directives run in sequential order #12591

merged 2 commits into from
Jul 24, 2024

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Jul 24, 2024

Fixes #11516. If we detect an action is being used, we then wrap event handlers and bindings in an event to ensure they are run in sequential order.

Copy link

changeset-bot bot commented Jul 24, 2024

🦋 Changeset detected

Latest commit: 2712ab9

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

Do we need to create a full-blown effect here, or can we just defer the task?

@trueadm
Copy link
Contributor Author

trueadm commented Jul 24, 2024

Do we need to create a full-blown effect here, or can we just defer the task?

If we don’t create an effect then it won’t be connected to the graph for teardown. So I just thought this might be simpler.

@dummdidumm
Copy link
Member

I think the effect is also important so that it runs in order, deferred microtasks are run at a different time when flushed

@Rich-Harris Rich-Harris merged commit 7a8cf3a into main Jul 24, 2024
9 checks passed
@Rich-Harris Rich-Harris deleted the fix-ordering branch July 24, 2024 21:47
This was referenced Jul 24, 2024
dummdidumm added a commit that referenced this pull request Jul 31, 2024
fixes #12673

#12591 wrongfully applied the "wrap in effect if an action on this element" logic for `bind:this`
Rich-Harris pushed a commit that referenced this pull request Jul 31, 2024
fixes #12673

#12591 wrongfully applied the "wrap in effect if an action on this element" logic for `bind:this`
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.

Svelte 5: Actions and on: directives don't respect the order they are listed
3 participants