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

feat: add flag to render legacy CSS scope tokens #3734

Merged
merged 3 commits into from
Sep 26, 2023

Conversation

nolanlawson
Copy link
Collaborator

@nolanlawson nolanlawson commented Sep 25, 2023

Details

Adds a runtime flag that, when enabled, renders the legacy CSS attributes/classes in addition to the new ones.

The reason for rendering both is that we still want the SVG static perf optimization, but some folks need the flag enabled to support legacy global stylesheets.

The reason for a runtime flag is because we can't vary the output of the compiler on the flag, so the check must be done entirely at runtime. To accomplish this, we output the compiled template with both tokens, e.g.:

tmpl.stylesheetToken = "lwc-2idtulmc17f";
tmpl.legacyStylesheetToken = "x-shadow_shadow";

Does this pull request introduce a breaking change?

  • ✅ No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • ✅ No, it does not introduce an observable change.

GUS work item

W-14181175

@nolanlawson nolanlawson requested a review from a team as a code owner September 25, 2023 22:09
return (this as any)[KEY__LEGACY_SHADOW_TOKEN_PRIVATE];
},
configurable: true,
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is largely copypasta from shadow-token.ts, but I'm hoping we can just remove it eventually. So creating an abstraction would have just made it harder to remove in the future.

@nolanlawson nolanlawson changed the title feat: add flagi to render legacy CSS scope tokens feat: add flag to render legacy CSS scope tokens Sep 25, 2023
@nolanlawson
Copy link
Collaborator Author

/nucleus test

1 similar comment
@nolanlawson
Copy link
Collaborator Author

/nucleus test

@nolanlawson
Copy link
Collaborator Author

/nucleus ignore --reason 'nucleus is having issues, webruntime has brittle snapshot tests'

@nolanlawson
Copy link
Collaborator Author

/nucleus ignore --reason 'broken downstreams are gone now'

@nolanlawson nolanlawson merged commit 3fd53ac into master Sep 26, 2023
2 checks passed
@nolanlawson nolanlawson deleted the nolan/legacy-scope-token branch September 26, 2023 20:48
nolanlawson added a commit that referenced this pull request Sep 26, 2023
nolanlawson added a commit that referenced this pull request Sep 26, 2023
nolanlawson added a commit that referenced this pull request Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants