-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Duplicate slot name #6061
Comments
Svelte docs say a slot can be rendered zero or more times. Should naming a slot change that behavior? I'd hope this example is a use-case in favor of allowing multiple named slots. |
With all the changes on slots I believe the docs are currently a bit outdated. It looks like there are breaking changes in v3.35. But now it's possible to have components inside slots, using |
Looks like the breaking change was mentioned in RFC comments about using duplicates.
|
In general the new However, I also have to say I find it less than ideal to push a breaking change in a minor version update (violating semver spec) and on top of that not reflecting the change in the docs (the docs don't even mention I by the way disagree with calling this a bugfix because it was documented before ("Slots can be rendered zero or more times" with no limitation for default slots). I understand the issue it caused with It would have been OK if the old syntax would still have worked and maybe just emitted a warning - then My system for example uses duplicate slots heavily, and it would be a much smoother transition if I could refactor components that use this over time, with having both the old and the new way working at the same time for a while. In my opinion the best thing to do now would be to bring back the old way with a warning and release that as 3.35.1, turning it back to an error only in 4.0.0. |
Just ran In one of our older project we too use the previous duplicated slots behavior heavily and now we have to keep svelte to its last working version because we currently cannot dedicate the time to rewrite all our design system components at once with |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing as stale - this isn't gonna change |
Describe the bug
Using multiple slots with the same name is now an error. Previously in version 3.34.0 this would render the slots.
To Reproduce
The repl examples below are the same code, but with different svelte versions.
Expected behavior
With all the work recently on slots, I'm not sure if this would be a regression or intended behavior moving forward.
The text was updated successfully, but these errors were encountered: