-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix(slots): consume eagerly rendered slot after one use #8929
Conversation
🦋 Changeset detectedLatest commit: 4dcc09c The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
.changeset/plenty-spiders-act.md
Outdated
'astro': patch | ||
--- | ||
|
||
Fixes an issue where a slot rendered multiple times resulted in the same output each time. |
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.
Fixes an issue where a slot rendered multiple times resulted in the same output each time. | |
Fixes an issue where rendering multiple slots resulted in the same output each time. |
super-nit: "a slot" rendered multiple times makes me think it's the same one slot, so the output should be the same! Would this be a correct description? (non-blocking, though)
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.
It is the same one slot.
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.
Now that you bring it up though, I think there is room for clarification. Before this PR, the first render was reused when users tried to manually render the same slot multiple times.
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.
OK, then maybe something like.... (wordy, but trying to see if this is the right idea)
Fixes an issue where a slot rendered multiple times incorrectly used the same initial rendering for each instance
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.
Implementation LGTM! I think it could be refactored to be slightly more clear, but it's up to you. I wouldn't block a merge as-is.
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.
LGTM!
* render slots lazily * add test * add changeset * refactor * reword changeset
Changes
Testing
Added a case to an existing fixture.
Docs
Does not affect usage.