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

Add support for Svelte 5 @render syntax #12328

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

Robertsson
Copy link
Contributor

Changes

  • Adds support for Svelte 5's new @render syntax in Astro integration
  • Maintains backward compatibility with traditional Svelte slots
  • Updates both client and server integrations to handle both patterns:
    • Legacy: $$slots and <slot />
    • New: @render children and {@render children()}
<!-- Legacy pattern  -->
  <slot />
<!-- New Svelte 5 pattern  -->
{@render children()}

Can't be combined in the same component.

Svelte 5 Render »

Testing

Created test Astro project with Svelte integration
Tested with both legacy and new syntax patterns

Docs

No documentation probably needed for this. Example project for svelte might need to be updated later on.

Copy link

changeset-bot bot commented Oct 28, 2024

🦋 Changeset detected

Latest commit: 694e33a

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 pkg: svelte Related to Svelte (scope) pkg: integration Related to any renderer integration (scope) labels Oct 28, 2024
@bluwy
Copy link
Member

bluwy commented Nov 6, 2024

Thanks for fixing this! I tested it locally and it seems to work well too. Let's merge this one before working on full Svelte 5 support at #12364

@bluwy bluwy linked an issue Nov 6, 2024 that may be closed by this pull request
1 task
@bluwy bluwy merged commit 3d90136 into withastro:next Nov 6, 2024
13 checks passed
@bluwy
Copy link
Member

bluwy commented Nov 6, 2024

I just realized this is merged into next, should be main...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope) pkg: svelte Related to Svelte (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Astro slots passed as Svelte 5 snippets don't statically render
2 participants