Skip to content
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

Unlike Svelte 4, the current rc version of Svelte 5 executes children actions after parent actions #13382

Open
divdavem opened this issue Sep 24, 2024 · 2 comments · May be fixed by #13384
Open
Assignees
Labels
Milestone

Comments

@divdavem
Copy link

divdavem commented Sep 24, 2024

Describe the bug

As reported by @quentinderoubaix in the svelte-5-rc discord channel, the current rc version of Svelte 5 (5.0.0-next.258) changes the order of execution of actions compared to Svelte 4.

This breaks one of our actions that depends on the full initialization of its children (including executing their actions) to be able to properly achieve its own work.

Reproduction

<script>
	const action = (element) => {
		console.log(`Action run for element ${element.id}`);
	};
</script>

<div use:action id="0">
	<div use:action id="1">
	</div>
</div>

Check in Svelte 4
Check in Svelte 5

Logs

In Svelte 4:

Action run for element 1
Action run for element 0

In Svelte 5:

Action run for element 0
Action run for element 1

System Info

Tested with Svelte 5.0.0-next.258

Severity

blocking an upgrade

@trueadm
Copy link
Contributor

trueadm commented Sep 24, 2024

We can either change the behaviour of actions to match Svelte 4, so child element actions come first – or we can document this change as a breaking change for Svelte 5.

@trueadm trueadm self-assigned this Sep 24, 2024
@trueadm
Copy link
Contributor

trueadm commented Sep 24, 2024

We've decided to make it work like Svelte 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants