-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: SSR scoped classes for <select value> elements #16821
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: SSR scoped classes for <select value> elements #16821
Conversation
🦋 Changeset detectedLatest commit: 449868d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
packages/svelte/src/compiler/phases/3-transform/server/visitors/RegularElement.js
Outdated
Show resolved
Hide resolved
Another bug from that PR is async attributes are awaited twice. I guess |
@7nik. Thanks for the review! I’ve applied all three points: – Added I’d value your thoughts. I’m happy to adjust if needed. |
packages/svelte/src/compiler/phases/3-transform/server/visitors/RegularElement.js
Outdated
Show resolved
Hide resolved
2dd8e2c
to
b125ec0
Compare
@7nik Thanks for pointing that out! I had overlooked |
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, thank you!
Fixes #16813
Server-rendered
<select>
elements stopped getting their scoped CSS because the specialselect
branch skipped the hashing/directive merge. I pass the hash and directive data through to$$renderer.select
, then let the existingattributes(...)
helper merge them so the flow matches other elements. If there’s a better way to do this, I’m happy to adjust. Added a renderer unit test and an SSR sample to cover the regression.Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.packages/svelte/src
, add a changeset (npx changeset
).Tests and linting
pnpm test
and lint the project withpnpm lint