Repository navigation
dogfooding fixes: document StyleX build requirement for swizzled components - #3475
Merged
Merged
Conversation
josephfarina
requested review from
cixzhang,
ejhammond,
imdreamrunner,
marie-lucas,
nynexman4464 and
thedjpetersen
as code owners
July 2, 2026 22:53
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 |
Swizzled components ship raw StyleX source that needs a build-time StyleX compiler; without one they render unstyled with no error. The swizzle command now prints a StyleX build-setup note after copying (with the Next.js caveat that the StyleX Babel plugin disables SWC and breaks next/font, so an SWC-based transform is required), and `astryx docs styling` gains a StyleX Build Setup section covering per-bundler setup. Fixes #3373
cixzhang
force-pushed
the
navi/docs/swizzle-stylex-setup
branch
from
July 3, 2026 23:58
ce01c11 to
702fc54
Compare
cixzhang
requested changes
Jul 4, 2026
cixzhang
left a comment
Contributor
There was a problem hiding this comment.
We might be able to streamline this process a bit better before documenting it. I left a suggestion for exploring the build package.
| label: 'next.config.mjs — SWC-based StyleX transform (keeps next/font working)', | ||
| code: `import stylexPlugin from '@stylexswc/nextjs-plugin'; | ||
|
|
||
| export default stylexPlugin({ |
Contributor
There was a problem hiding this comment.
Hmm were you able to try the config helpers in the build package?
cixzhang
approved these changes
Jul 11, 2026
5 tasks done
This branch was successfully deployed
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 this fixes
astryx swizzle <Component>copies a component's raw StyleX source into your app. That source needs a build-time StyleX compiler to produce atomic CSS — but nothing in the CLI output or docs said so, and there was no framework-specific setup guidance. Result: a freshly swizzled component compiles but renders unstyled, with no error, and it's non-obvious why. Fixes #3373.Changes
1. Post-copy CLI note (only when the swizzled source actually uses StyleX). The copy loop now detects
@stylexjs/stylexusage and, for StyleX components, prints:Components with no StyleX get no note (verified by a negative test). The
--jsonpayload also gains ausesStyleXboolean for machine consumers.2. Docs: a "StyleX Build Setup" section in
astryx docs styling. The issue noted that grepping the docs forbabel,swc,next.config,compiler,transform, orpluginreturned nothing. The new section covers:next/font— so an SWC-based transform (e.g. the community@stylexswc/nextjs-plugin) is the working path, with anext.configexample.apps/example-nextjs-stylexin the repo.defineTheme+astryx theme build) needs no StyleX compiler.Why point at
astryx docs stylingrather than a wiki pageThe issue mentioned
astryx docs swizzle, but there is noswizzledocs topic, and no StyleX-setup wiki page exists yet. Rather than invent a URL, this puts the setup content in the existingstylingdoc (which the issue explicitly named as a gap) and points the CLI note there.Verification
astryx swizzle Buttonin the monorepo: the StyleX note prints with the Next.js caveat and theastryx docs stylingpointer.astryx docs styling: the "StyleX Build Setup" section renders with the table, the Next.js note, and thenext.configexample.swizzle.routing.test.mjs: a StyleX component reportsusesStyleX: trueand prints the note (asserting the compiler requirement, theunstyledsymptom, thenext/fontcaveat, and the docs pointer); a non-StyleX component reportsusesStyleX: falseand prints no note.