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

Svelte 5: default intro to true when using mount #11280

Open
Rich-Harris opened this issue Apr 21, 2024 · 2 comments
Open

Svelte 5: default intro to true when using mount #11280

Rich-Harris opened this issue Apr 21, 2024 · 2 comments
Milestone

Comments

@Rich-Harris
Copy link
Member

Describe the problem

Presently, we disable intro transitions when mounting components. The reason we do this is to avoid flashes when hydrating (we don't want to 'fade in' an element that's already visible), but that only really applies to hydrate.

Describe the proposed solution

Default intro to true when calling mount, and false when calling hydrate. Continue to respect the option if it is set explicitly (which only really applies to mount; it would be very unusual to enable intros when hydrating).

This would be a breaking change.

Importance

nice to have

@Rich-Harris Rich-Harris added this to the 5.0 milestone Apr 21, 2024
@dummdidumm
Copy link
Member

Has there been widespread confusion about the existing behavior? Couldn't this have been done this way in Svelte 3, too (due to the hydrate constructor option)? Trying to estimate what the majority wants here and if this switch of defaults is warranted.

@Rich-Harris
Copy link
Member Author

I don't know about widespread confusion — it's fairly well signposted in the docs. We absolutely could have done it in Svelte 3, we just overlooked it, and a new major is the right time to rectify a bad decision. It feels like an absolute no-brainer to me — as a component author you've already made your intent explicit by adding the transition: directive in the first place. I guess we could run a poll but we should be wary of creating poll fatigue by running them for every small decision

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

No branches or pull requests

2 participants