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

bugfix(svelte): fix colliding id's generated from $props.id #13339

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Hugos68
Copy link

@Hugos68 Hugos68 commented Feb 28, 2025

Closes #13327

Utilizes the new uidPrefix option from server/client side rendering added in sveltejs/svelte#15403 in Svelte to inject a unique prefix generated by Astro.

Note: The linked PR has not been merged yet, we would need to wait until the next version of Svelte releases and install that version, until then this PR will remain a draft.

Changes

  • Enables different Svelte islands to generate non colliding $props.id

Testing

No tests were added because it looks like the Svelte integration isn't tested, at all?

Docs

This would only solve problems, it's highly unlikely a user depended on colliding ID's for their app to work. It's also a very niche use case using two client side Astro Svelte components with $props.id

…zing the new `uidPrefix` option exposed for both server and client side rendering.
Copy link

changeset-bot bot commented Feb 28, 2025

🦋 Changeset detected

Latest commit: 94b8c20

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 Feb 28, 2025
@florian-lefebvre
Copy link
Member

@Hugos68 ping me when the related svelte PR is merged and released

@Hugos68
Copy link
Author

Hugos68 commented Mar 4, 2025

@florian-lefebvre Merged and released in: sveltejs/svelte#15428. API is available in version 5.22.0!

@Hugos68
Copy link
Author

Hugos68 commented Mar 4, 2025

I'll aim to update my PR and will request a review after.

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.

[@astrojs/svelte] $props.id is identical across islands.
2 participants