fix: update CDN bundle configurations, enable setTheme on globalThis#36113
Open
chrisdholt wants to merge 9 commits intomicrosoft:masterfrom
Open
fix: update CDN bundle configurations, enable setTheme on globalThis#36113chrisdholt wants to merge 9 commits intomicrosoft:masterfrom
chrisdholt wants to merge 9 commits intomicrosoft:masterfrom
Conversation
be4e4ff to
277ec77
Compare
07aebe7 to
d70f3fc
Compare
📊 Bundle size report✅ No changes found |
|
Pull request demo site: URL |
3ef91a5 to
c00ef25
Compare
a1ccd24 to
68f7a07
Compare
radium-v
reviewed
May 7, 2026
Contributor
There was a problem hiding this comment.
Instead of duplicating all of the define imports, they could be moved to a define-all.ts and that module could be imported in both modules
marchbox
reviewed
May 7, 2026
|
|
||
| // Expose setTheme on globalThis for CDN/script-tag consumers | ||
| // @ts-expect-error - CDN bundle intentionally sets globals | ||
| globalThis.setTheme = setTheme; |
Contributor
There was a problem hiding this comment.
Do we worry about setTheme being too generic on globalThis?
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.
Previous Behavior
Rollup was used to compile a single bundle for everything, setTheme was not available as an export.
New Behavior
setTheme is available for use by assigning it to
globalThis.This change now enables the distribution of two bundles both uncompressed and minified:
web-components-all.js=> Everything from the package re-exported. This previously was the only export.web-components.js=> Just the side-effectful definitions and setTheme (this is the new default and the primary use case )By way of touching related files, this PR also removes the deprecated
setThemeForutility assetThemesupports the behavior.Related Issue(s)