-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
bugfix(svelte): fix colliding id's generated from $props.id
#13339
Conversation
…zing the new `uidPrefix` option exposed for both server and client side rendering.
🦋 Changeset detectedLatest commit: 37bc918 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 |
@Hugos68 ping me when the related svelte PR is merged and released |
@florian-lefebvre Merged and released in: sveltejs/svelte#15428. API is available in version 5.22.0! |
I'll aim to update my PR and will request a review after. |
@florian-lefebvre I've implemented the |
I'll look into it later today! |
Looking at sveltejs/svelte#15428, I think svelte takes care of ids on the client |
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
…ugos68/astro into bugfix/svelte-collide-props-id
|
Ok, sounds good, so then if the server side prefixing looks correct I'll move it to a ready for review PR. |
…ugos68/astro into bugfix/svelte-collide-props-id
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.
Thanks for the help and the contribution upstream!
Yeah I think I borked something when merging upstream changes back to this branch, thanks for picking these up. |
…tro#13339) * bugfix(svelte): fix colliding id's generating from $props.id by utilizing the new `uidPrefix` option exposed for both server and client side rendering. * bugfix(svelte): changeset * Add server side ID prefix, not sure how to do this on the client. * Discard changes to packages/integrations/svelte/client.svelte.js * Update .changeset/flat-cherries-rule.md Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> * feat: context * revert peerDep bump * revert html variable seperation * feat: rename * fix lockfile --------- Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Closes #13327
Utilizes the new
idPrefix
option from server/client side rendering added in sveltejs/svelte#15403 in Svelte to inject a unique prefix generated by Astro.Changes
$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