Repository navigation
build(core): make @stylexjs/stylex a required peerDependency - #3313
Merged
Merged
Conversation
Move @stylexjs/stylex from `dependencies` to a required `peerDependency` (^0.18.3) so a consumer who authors their own StyleX shares a single runtime with astryx (resolution dedupes to their own install, browser + Node) instead of silently getting a second copy on version drift, and an incompatible version is flagged at install (npm errors, pnpm/yarn warn). Consumers who don't author StyleX are unaffected: the runtime is required to render astryx components and is auto-installed by npm 7+ and pnpm. Not added to devDependencies: like react/react-dom (also peers here), the runtime resolves from the hoisted workspace for our own build/test. Test plan: - rm -rf all node_modules && pnpm install: @stylexjs/[email protected] at root; core resolves it; lockfile unchanged vs main. - pnpm -F @astryxdesign/core build: green (esm + tsc + css + umd). - core tests: 5038 passed; the 42 failures are pre-existing on main (verified on a pristine tree) and unrelated (no stylex-resolution errors).
|
Deployment failed with the following error: View Documentation: https://vercel.com/docs/accounts/team-members-and-roles |
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 |
imdreamrunner
marked this pull request as ready for review
July 1, 2026 19:12
imdreamrunner
requested review from
cixzhang,
ejhammond,
josephfarina,
marie-lucas,
nynexman4464 and
thedjpetersen
as code owners
July 1, 2026 19:12
cixzhang
approved these changes
Jul 1, 2026
imdreamrunner
added a commit
that referenced
this pull request
Jul 28, 2026
Follow-up to #3313, which moved @stylexjs/stylex to a peer-only declaration. Consumer research shows the astryx base predominantly uses Yarn, and neither Yarn 1 nor Yarn Berry auto-installs peer dependencies (verified) — so peer-only leaves the StyleX runtime ABSENT for those consumers, a hard render failure since every component calls stylex.props(). Declare @stylexjs/stylex in BOTH dependencies and peerDependencies (^0.18.3): dependencies guarantees the runtime is present on every package manager (incl. Yarn 1/Berry); peerDependencies keeps the version guardrail and dedupes a StyleX-authoring consumer to a single shared runtime (browser + Node). Test plan: - pnpm install + pnpm -F @astryxdesign/core build: green. - Verified: peer-only leaves the runtime absent on Yarn 1 and Yarn Berry 4.9.2 (warning only); adding dependencies restores presence.
imdreamrunner
added a commit
that referenced
this pull request
Jul 29, 2026
Follow-up to #3313, which moved @stylexjs/stylex to a peer-only declaration. Consumer research shows the astryx base predominantly uses Yarn, and neither Yarn 1 nor Yarn Berry auto-installs peer dependencies (verified) — so peer-only leaves the StyleX runtime ABSENT for those consumers, a hard render failure since every component calls stylex.props(). Declare @stylexjs/stylex in BOTH dependencies and peerDependencies (^0.18.3): dependencies guarantees the runtime is present on every package manager (incl. Yarn 1/Berry); peerDependencies keeps the version guardrail and dedupes a StyleX-authoring consumer to a single shared runtime (browser + Node). Test plan: - pnpm install + pnpm -F @astryxdesign/core build: green. - Verified: peer-only leaves the runtime absent on Yarn 1 and Yarn Berry 4.9.2 (warning only); adding dependencies restores presence.
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.
Summary
Moves
@stylexjs/stylexfromdependenciesto a requiredpeerDependency(^0.18.3) for@astryxdesign/core, so a StyleX-authoring consumer dedupes to a single shared runtime and gets aversion guardrail.
What merged here
@stylexjs/stylex:dependencies→ requiredpeerDependencies(^0.18.3).compatibility guardrail.