Conversation
…t/index.spec.js Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
TODO: make it actually get bundled
# Conflicts: # scripts/test-utils/test-fixture-dir.ts
wjhsf
approved these changes
Mar 5, 2025
wjhsf
approved these changes
Mar 5, 2025
...rc/__tests__/fixtures/attribute-class/with-scoped-styles-only-in-child/dynamic/expected.html
Show resolved
Hide resolved
e0a9cd2 to
caad597
Compare
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
Contributor
Author
|
Downstream failure is unrelated to this PR. |
This was referenced Mar 6, 2025
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
This implements style deduplication in SSRv2 (see RFC #136 for more info). With this change, an
<lwc-style>tag is inserted alongside the first instance of a given component's<style>tag. In subsequent renders of that component, only the<lwc-style>tag is present in the generated markup. Under the hood, each instance of the component shares a constructed stylesheet, making it so that the browser does not need to repeatedly parse and apply the same CSS (which is expensive for large stylesheets). This constitutes a performance improvement.In order to take advantage of the
<lwc-style>perf improvement, the document must first register theStyleDeduplicatorcustom element (not an LWC). This can be accomplished by callingregisterLwcStyleComponentwhich is provided in the new top-level LWC package@lwc/ssr-client-utils.Style deduplication is opt-in. It is enabled in our tests for SSRv2. But you must opt-in when calling
serverSideRenderComponent. That function now has the following signature:The
styleDedupePrefixmust be provided if more than one "island" of SSR'd content will be present in a single HTML document. If not supplied and multiple islands are rendered on the page, there will be conflicts between the style identifiers in those islands.Does this pull request introduce a breaking change?
Does this pull request introduce an observable change?
GUS work item
W-17381768