fix: dudupe light scoped issue, hydration coverage#5438
Merged
jhefferman-sfdc merged 7 commits intomasterfrom Aug 1, 2025
Merged
fix: dudupe light scoped issue, hydration coverage#5438jhefferman-sfdc merged 7 commits intomasterfrom
jhefferman-sfdc merged 7 commits intomasterfrom
Conversation
jhefferman-sfdc
commented
Jul 31, 2025
| const styleId = stylesheetToId.get(stylesheet); | ||
| result += `<lwc-style style-id="lwc-style-${styleDedupePrefix}-${styleId}"></lwc-style>`; | ||
| // TODO [#2869]: `<style>`s should not have scope token classes, but required for hydration to function correctly (W-19087941). | ||
| result += `<lwc-style${hasAnyScopedStyles ? ` class="${scopeToken}"` : ''} style-id="lwc-style-${styleDedupePrefix}-${styleId}"></lwc-style>`; |
Contributor
Author
There was a problem hiding this comment.
Needs to match current non-deduped behavior here for hydration to function properly
Contributor
|
👍 |
wjhsf
approved these changes
Aug 1, 2025
| Main, | ||
| config.props || {}, | ||
| false, | ||
| true, |
| @@ -0,0 +1,9 @@ | |||
| export default { | |||
| test(target, snapshot, consoleCalls) { | |||
| // Expect no errors or warnings, hydration or otherwise | |||
Contributor
There was a problem hiding this comment.
Suggested change
| // Expect no errors or warnings, hydration or otherwise | |
| // W-19087941: Expect no errors or warnings, hydration or otherwise |
This is a pretty small test and it's not obvious why it exists, so we should try to keep the context around.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
For scoped styles the scopeToken is appended as a class to the style element. This was not being done where
<lwc-style>replaces itself with a<style>placeholder, which resulted in hydration failure and the<style>tag not being deduped.Karma coverage for style dedupe has been enabled and tested and fixtures also corrected. Will add web test runner coverage in follow up PR due to time constraints and existing mismatches in web test runner.
Does this pull request introduce a breaking change?
Does this pull request introduce an observable change?
GUS work item
W-19087941