fix(core): bundle StyleX runtime — remove consumer dependency - #545
Merged
Conversation
…eeded Bundle @stylexjs/stylex and styleq into the @xds/core dist output instead of requiring consumers to install them separately. The compiled output only uses stylex.props() at runtime, which is just styleq (a ~5KB deduplicating class name merger). By inlining it: - Consumers no longer need @stylexjs/stylex as a dependency - CDN/script-tag usage works without shimming the StyleX runtime - Net bundle size actually decreased by ~5KB (esbuild optimizes better without the external boundary) Moves @stylexjs/stylex from dependencies to devDependencies since it's still needed at build time (Babel plugin) but no longer at runtime. Co-authored-by: Navi <navi@navibot.dev>
Theme packages no longer import @stylexjs/stylex — they use defineTheme from @xds/core instead. Remove the dead external declaration from all three theme tsup configs. Co-authored-by: Navi <navi@navibot.dev>
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
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.
What
Bundle the StyleX runtime (
styleq, ~5KB) into@xds/coredist so consumers don't need to install@stylexjs/stylex.Why
The compiled output only calls
stylex.props()at runtime — which is juststyleq(a deduplicating class name merger). There's no reason to leak this as a consumer dependency. It blocks CDN/script-tag usage and adds friction for anyone who doesn't use StyleX in their own build.Changes
packages/core/tsup.config.tsnoExternal: ['@stylexjs/stylex', 'styleq']to bundle the runtime into distpackages/core/package.json@stylexjs/stylexfromdependencies→devDependencies(still needed at build time for the Babel plugin)packages/themes/*/tsup.config.ts@stylexjs/stylexfrom externals — theme packages don't import it anymore (they usedefineThemefrom@xds/core)Impact
@stylexjs/styleximports in dist