-
-
Notifications
You must be signed in to change notification settings - Fork 264
fix!: use distinct names for label props and slots (svelte 5 fix) #2408
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
metonym
merged 21 commits into
carbon-design-system:master
from
spburtsev:distinct-label-children
Dec 7, 2025
Merged
fix!: use distinct names for label props and slots (svelte 5 fix) #2408
metonym
merged 21 commits into
carbon-design-system:master
from
spburtsev:distinct-label-children
Dec 7, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8b57958 to
3806960
Compare
0bd66da to
800af90
Compare
800af90 to
cc3c9ef
Compare
metonym
approved these changes
Dec 7, 2025
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Thanks for fixing this papercut. My thoughts:
- Scope: This solves a TypeScript issue with using
#snippetwith Svelte 5. No runtime issues, andslotcan still be used. It's acceptable to make a breaking change, since downstream impact is minimal (should be a one-line change). - Naming: I like the
prefix<Children>pattern.childrenis now a reserved prop in Svelte 5, but I think the pattern is semantic. I'd also consideredprefix<Slot>, but "slots" are already legacy. - Other shadowed prop names: There are other shadowed prop names; I've created these as sub-issues of #2105.
I added more test coverage for named slots in #2410.
I rebased on master and grouped related changes into their distinct commits.
This was referenced Dec 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2411, supports #2105
Breaking changes:
labelTextslot renamed tolabelChildrento resolve Svelte 5 errors when passing snippetsIn Svelte 5, having both a
labelTextprop andlabelTextslot causes the static analyzer to flag errors when using snippet syntax. Renaming the slot eliminates this error and creates a clearer distinction between text-only labels (prop) and rich content labels (slot/snippet).