-
-
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
Do not expose default slot let bindings to named slots #6049
Merged
Conversation
This file contains 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
tanhauhau
changed the title
Tanhauhau/gh 5865
Do not expose default slot let bindings to named slots
Mar 4, 2021
tanhauhau
force-pushed
the
tanhauhau/gh-5865
branch
2 times, most recently
from
March 4, 2021 02:08
12c9e62
to
76b3472
Compare
tanhauhau
force-pushed
the
tanhauhau/gh-5865
branch
from
March 4, 2021 02:45
a1edc91
to
716eb89
Compare
tanhauhau
force-pushed
the
tanhauhau/gh-5865
branch
from
October 13, 2022 14:42
ffa85f3
to
a4fbc31
Compare
If we decide to go with it we can only do so for v4, as it's a breaking change |
This comment was marked as outdated.
This comment was marked as outdated.
@tanhauhau is attempting to deploy a commit to the Svelte Team on Vercel. A member of the Team first needs to authorize it. |
dummdidumm
reviewed
May 26, 2023
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.
Looks good mostly, left a few comments
5 tasks
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.
BREAKING CHANGE
Default slot let bindings are not available on named slots anymore and vice versa:
This makes slot bindings more consistent as the behavior is undefined when for example the default slot is from a list and the named slot is not.
To fix this, make the bindings you need available on the named slot (or default slot) and bind to them there.
PR description
Fixes #5865
Fixes #5684
Fixes #7245
Fixes #7709
@Rich-Harris this takes an opposite approach of #2419 from fixing #2320
where defining the
let:value
on Component,<Component let:value>
will only apply to the default slot.To make it clear,
<Component>
levelvalue
in named slot will have"missing-declaration"
warninglet:
on the<Component>
<Component >
#2419 exposes the default slot data to named slot:
This assumes that the default slot will always be there whenever
foo
slot exists, and there will be 1 default slot.This immediately turns complicated and does not make sense if there's multiple of default
<slot />
This MR fixes #2320 with a separate direction, where specifying
let:data
in the<Component>
attribute will be solely for default slot and will not be available to the named slot.Before submitting the PR, please make sure you do the following
Tests
npm test
and lint the project withnpm run lint