Repository navigation
docs(cli): name the StyleX plugin that works under Vite - #12893
josephfarina wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
The Vite rows now name a StyleX compiler that only transforms script modules, so a StyleX page template compiles with astryx.css still loaded, and the template note lands on the plugin table. There are no blocking findings.
- The head commit's message ends with
[skip ci], which stops GitHub from starting this pull request's CI at this head even after it is marked ready; push a commit without it so the required checks run here.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the StyleX setup docs name
@stylexjs/unplugin(stylex.vite()) for Vite and keep@stylexjs/rollup-pluginfor Rollup: verified (styling-overview.doc.mjs:151-155,tokens-and-setup.doc.mjs:89-91; both doc sections print the new rows). - Claim: under Vite, the Rollup plugin fails on
astryx.css: verified by mechanism; its transform runs Babel on any module whose text containsstylex, with no file-type filter, and the published stylesheet containsstylexand opens with an@layerrule. - Claim: the Rollup plugin writes its CSS only at bundle time, so the dev server gets none: verified (
generateBundleis its only CSS output). - Claim:
@stylexjs/unplugincompiles the template and serves its CSS in dev and in a build: verified from its source (script modules only; dev CSS injected into the page by default). - Claim: a page template that uses StyleX stayed blank, and renders after the change: stated by the author from a fresh Vite app; consistent with the mechanism above, not rerun.
- Claim: the template note points to the setup section, and
noteskeeps its shape: verified (template-needs.mjs:480; the note is still one string). - Claim: no template, command or JSON field changes, and the Webpack, Babel, Next.js, plain and Tailwind paths are unchanged: verified from the diff.
- Claim: the existing template-needs test still checks that the note names
styling-overview: verified (template-needs.test.mjs:261-274, passing). - Claim: public text carries no internal context: verified.
- File
.changeset/vite-stylex-plugin-doc.md: clear. - File
packages/cli/assets/docs/styling-overview.doc.mjs: clear. - File
packages/cli/assets/docs/tree/tokens-and-setup.doc.mjs: clear. - File
packages/cli/foundation/discovery/template-needs.mjs: clear.
9628495 to
90a1dfb
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
The Vite rows now name a StyleX compiler that transforms only script modules, so a StyleX page template compiles with astryx.css still loaded; the template note lands on the plugin table, and the docs-topics golden matches the new table. There are no blocking findings.
- The head commit's message ends with
[skip ci], which keeps GitHub from starting this pull request's CI at this head even after it is marked ready; push a commit without it so the required checks run here.
Claims and files checked
Review mode: full; reason: history
- Claim (description): before the change, the template note points to the whole styling overview, and that doc names the Rollup plugin for Vite: verified (the base's note and doc output).
- Claim (changeset, description): the StyleX setup docs name
@stylexjs/unplugin(stylex.vite()) for Vite and keep@stylexjs/rollup-pluginfor Rollup: verified (styling-overview.doc.mjs:151-155,tokens-and-setup.doc.mjs:90-91; both doc sections print the new rows). - Claim (changeset, description): under Vite, the Rollup plugin parses
astryx.cssand fails: verified by mechanism; its transform runs Babel on any module whose text containsstylex, with no file-type filter, and the published stylesheet containsstylexand opens with an@layerrule. The exact error text was not rerun. - Claim (description): the Rollup plugin writes its CSS only at bundle time, so the dev server gets none: verified (
generateBundleis its only CSS output). - Claim (description):
@stylexjs/unplugincompiles the template and serves its CSS in dev and in a build: verified from its source (script and Svelte modules only; dev CSS injected into the page by default). - Claim (changeset, description): a StyleX page template stayed blank, and renders after the change: stated by the author from a fresh Vite app; consistent with the mechanism above, not rerun.
- Claim (changeset, description): the template note points to the setup section, and
noteskeeps its shape: verified (template-needs.mjs:480; the note is still one string). - Claim (description): no template, command or JSON field changes, and the Webpack, Babel, Next.js, plain and Tailwind paths are unchanged: verified from the diff.
- Claim (description): the existing template-needs test still checks that the note names
styling-overview: verified (template-needs.test.mjs:261-274, passing). - Claim (description): the docs-topics golden's digest for the styling overview changes in one line: verified (the docs-topics test passes at this head and leaves the file unchanged).
- Claim (description): the template-notes and package-stylesheet requirements it cites govern the change: verified against the current records.
- Claim (description): public text carries no internal context: verified.
- File
.changeset/vite-stylex-plugin-doc.md: clear. - File
packages/cli/assets/docs/styling-overview.doc.mjs: clear. - File
packages/cli/assets/docs/tree/tokens-and-setup.doc.mjs: clear. - File
packages/cli/foundation/discovery/template-needs.mjs: clear. - File
packages/cli/test/__golden__/no-icon-set/docs-topics.json: clear.
A page template that uses StyleX needs a StyleX compiler. The setup docs named @stylexjs/rollup-plugin for Vite, but under Vite it also reads CSS imports and fails on astryx.css, so the page stayed blank. The docs now name @stylexjs/unplugin (stylex.vite()) for Vite, and the template note points to the setup section. [skip ci]
90a1dfb to
616cf7a
Compare
|
/approve-spec 616cf7a |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
The Vite rows now name a StyleX compiler that transforms only script modules, so a StyleX page template compiles with astryx.css still loaded; the template note lands on the plugin table, and the docs-topics golden matches the new table. There are no blocking findings.
- The head commit's message carries
[skip ci], so GitHub has not started this pull request's CI on this head; the required checks still need to pass before it merges.
Claims and files checked
Review mode: full; reason: rebase
- Claim (description): before the change, the template note points to the whole styling overview, and that doc names the Rollup plugin for Vite: verified (the base's note and doc output).
- Claim (changeset, description): the StyleX setup docs name
@stylexjs/unplugin(stylex.vite()) for Vite and keep@stylexjs/rollup-pluginfor Rollup: verified (styling-overview.doc.mjs:151-155,tokens-and-setup.doc.mjs:90-91; both doc sections print the new rows). - Claim (changeset, description): under Vite, the Rollup plugin parses
astryx.cssand fails: verified; a Vite build of a fresh page that imports the published stylesheet fails in the Rollup plugin with the decorators error at its@layerline, because its transform runs Babel on any module whose text containsstylex, with no file-type filter. - Claim (description): the Rollup plugin writes its CSS only at bundle time, so the dev server gets none: verified (
generateBundleis its only CSS output). - Claim (description):
@stylexjs/unplugincompiles the template and serves its CSS in dev and in a build: verified for the build (the same page builds and its StyleX rules land in the stylesheet) and from its source for dev (script and Svelte modules only; dev CSS injected into the page by default). - Claim (changeset, description): a StyleX page template stayed blank, and renders after the change: stated by the author from a fresh Vite app; consistent with the build result above, the browser render was not rerun.
- Claim (changeset, description): the template note points to the setup section, and
noteskeeps its shape: verified (template-needs.mjs:480; the note is still one string). - Claim (description): no template, command or JSON field changes, and the Webpack, Babel, Next.js, plain and Tailwind paths are unchanged: verified from the diff.
- Claim (description): the existing template-needs test still checks that the note names
styling-overview: verified (template-needs.test.mjs:261-274, passing). - Claim (description): the docs-topics golden's digest for the styling overview changes in one line: verified (the docs-topics test passes at this head and leaves the file unchanged).
- Claim (description): the template-notes and package-stylesheet requirements it cites govern the change: verified against the current records.
- Claim (description): public text carries no internal context: verified.
- File
.changeset/vite-stylex-plugin-doc.md: clear. - File
packages/cli/assets/docs/styling-overview.doc.mjs: clear. - File
packages/cli/assets/docs/tree/tokens-and-setup.doc.mjs: clear. - File
packages/cli/foundation/discovery/template-needs.mjs: clear. - File
packages/cli/test/__golden__/no-icon-set/docs-topics.json: clear.
- #12407 fix(cli): theme palette generate names a newer CLI's recipe and the update step Author: @josephfarina - #12729 fix(cli): a padding of two to four lengths where only one works offers its sides Author: @josephfarina - #12893 docs(cli): name the StyleX plugin that works under Vite Author: @josephfarina
|
Landed in #13025. |
User impact
In a new Vite React app on the default prebuilt-CSS path (
reset.css+astryx.css, no build plugin), a page template that uses StyleX (for examplekanban-boardortable-inbox) renders a blank page withUnexpected 'stylex.create' call at runtime. The template note says to add a StyleX compiler plugin and points toastryx docs styling-overview. For Vite, that doc names@stylexjs/rollup-plugin. A user who follows it gets a dev server error on every page, so the page is still blank.Problem and solution fit
stylex.create()in the app's own code, and nothing compiles it.@stylexjs/rollup-pluginalso receives CSS imports. It parses@astryxdesign/core/astryx.cssas JavaScript and fails (Support for the experimental syntax 'decorators' isn't currently enabled), so the module graph does not load. It also writes its CSS only at bundle time, so the dev server gets none of it.StyleX's own Vite integration,
@stylexjs/unplugin(stylex.vite()), compiles the template and serves its CSS in dev and in a build. The docs now name it for Vite, and keep@stylexjs/rollup-pluginfor Rollup.Expected behavior and authority
spec:AST-048FR20: a template'snotessay that the project needs a StyleX compiler and name the docs that set one up.spec:AST-080FR5: the path for a product that compiles its own StyleX keeps loading the prebuilt stylesheets. With@stylexjs/rollup-pluginunder Vite, that path cannot loadastryx.css; with@stylexjs/unplugin, it can.Smallest restoration
styling-overview("StyleX for your own code"): theVite / Rolluprow becomes aViterow (@stylexjs/unplugin,stylex.vite()invite.config, and that the Rollup plugin fails onastryx.cssunder Vite) and aRolluprow (@stylexjs/rollup-plugin).styling/tokens-and-setup("StyleX Build Setup"): the same split.astryx docs styling-overview stylex-own-code. Thenotesarray of strings in--jsonkeeps its shape.No template, command, or JSON field changes.
Evidence
All in a fresh Vite
react-tsapp outside the repository, with the 0.7.17 CLI and Core packs, checked in headless Chromium:astryx template kanban-board src/kanbanandtable-inbox src/inbox, rendered withreset.css+astryx.css: both pages have an empty root and throwUnexpected 'stylex.create' call at runtime.@stylexjs/rollup-plugininvite.config): the dev server returns 500 for the entry, with theastryx.cssparse error above;vite buildfails with the same error.npm install -D @stylexjs/unplugin,plugins: [stylex.vite(), react()]): both pages render fully with no console errors, in the dev server and invite build+vite preview, with and without a theme stylesheet.styling-overview. Thestyling-overviewtable gains a row, so the docs-topics golden's skeleton digest for that topic is updated (one line).Scope
Components:
packages/cli(docs, template notes)Testing
CI=1 pnpm exec vitest run --project node --changed origin/mainastryx docs styling-overview stylex-own-codeandastryx docs styling/tokens-and-setup stylex-setupread back the new rows.preflight: pass 90a1dfb