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

fix(rendering): allow render instructions to propagate while rendering slots #10316

Merged
merged 4 commits into from
Mar 5, 2024

Conversation

lilnasy
Copy link
Contributor

@lilnasy lilnasy commented Mar 4, 2024

Changes

  • Fixes Fragment + nested client:only components + slots problem #9996
  • The slot rendered first eagerly and stringified the island script with it. The slot was then put inside a template tag because the parent component is client:only.
  • Island script should have been rendered right before the parent component itself. The RenderDestination-RenderInstance system makes sure that while things execute out of sequence, they get "stringified" in sequence.
  • The reason was that slots are rendered in a temporary render destination and some chunk types are not handled there, falling back to stringifying immediately.
  • The fix is to defer stringifying to the real destination, accumulating instructions in the SlotString untouched.

Testing

  • Added a case in an existing E2E fixture.

Docs

  • Does not affect usage.

Copy link

changeset-bot bot commented Mar 4, 2024

🦋 Changeset detected

Latest commit: 708e927

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 4, 2024
@lilnasy lilnasy marked this pull request as ready for review March 4, 2024 21:14
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would ask @bluwy and @matthewp to look at the PR. It seems good to me though

Comment on lines 30 to 39
projects: [
{
name: 'Chrome Stable',
use: {
browserName: 'chromium',
channel: 'chrome',
args: ['--use-gl=egl'],
},
},
],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need this to run E2E tests locally. It shouldn't have been committed. I'll undo it.

@lilnasy lilnasy merged commit 507b4ac into withastro:main Mar 5, 2024
13 checks passed
@lilnasy lilnasy deleted the fix/9996 branch March 5, 2024 15:55
@astrobot-houston astrobot-houston mentioned this pull request Mar 5, 2024
peng added a commit to peng/astro that referenced this pull request Mar 6, 2024
* main:
  [ci] release (withastro#10337)
  Revert bad release (withastro#10336)
  [ci] release (withastro#10332)
  add missing changeset (withastro#10335)
  [ci] set `--tag` on release (withastro#10323)
  [ci] format
  add back data loss confirmation handling (withastro#10330)
  [ci] format
  fix(rendering): allow render instructions to propagate while rendering slots (withastro#10316)
  [ci] format
  fix: fixed an error in the vue component editor (withastro#10293)
  chore(vercel): update @vercel/nft (withastro#10305)
  Update turbo test dependsOn (withastro#10329)
  Add minimal @astrojs/db readme (withastro#10331)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fragment + nested client:only components + slots problem
4 participants