Skip to content

Migrate Next source example to precompiled Astryx CSS - #6841

Closed
cixzhang wants to merge 2 commits into
feat/next-stylex-migrationfrom
feat/next-source-turbopack
Closed

cixzhang wants to merge 2 commits into
feat/next-stylex-migrationfrom
feat/next-source-turbopack

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the legacy webpack-only withAstryx source build with the supported Next 16 Turbopack hybrid
  • consume published Astryx reset/base/theme CSS while compiling only product-owned StyleX through the official Babel + PostCSS path
  • remove @astryxdesign/build, source aliases, transpilePackages, and custom webpack configuration
  • add production, server/client, two-route, HMR, browser, and fail-closed CSS-boundary coverage

Stack

Depends on #6840 for the shared CI browser contract.

Known limitation

The official PostCSS integration emits one app-wide StyleX sheet from every matched product file. It does not provide route-level or import-graph CSS tree shaking.

Test plan

  • standalone pnpm build (Next.js 16.3.6 Turbopack)
  • pnpm check:stylex
  • negative controls for wrong layer order, x-prefixed product leakage, and duplicate Astryx CSS
  • pnpm check:repo
  • CI browser contract for production routes and dev HMR

@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 1, 2026 7:02am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Oct 1, 2026, 6:59 AM UTC

@cixzhang
cixzhang force-pushed the feat/next-source-turbopack branch from 3afb60a to 4ab88f2 Compare October 1, 2026 05:29
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for migrating this example — the move to Next 16 Turbopack with precompiled Astryx CSS and product-only StyleX looks solid, and reusing the shared contract (strict src/app include, p prefix, fail-closed boundary check, two server routes with HMR coverage) keeps it consistent with the StyleX example.

One small thing to fix before this is ready: the build package's README still points readers here as the "full Next.js source build example," but this app now does the opposite — it consumes published Astryx packages and no longer compiles Astryx source. Could you update that line so it describes the migrated precompiled example (or point it at a remaining source-build example, if one is meant to stay)?

Everything else I checked lines up: the config and component files match the sibling example, versions are pinned exactly, and the known app-wide CSS limitation is documented honestly.

[Automated review]

@cixzhang
cixzhang force-pushed the feat/next-source-turbopack branch from 4ab88f2 to a49b93f Compare October 1, 2026 06:00
@cixzhang
cixzhang changed the base branch from feat/next-stylex-migration to main October 1, 2026 06:28
@cixzhang
cixzhang force-pushed the feat/next-source-turbopack branch from a49b93f to 9b2ec8b Compare October 1, 2026 06:28
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 1, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for moving these examples onto Next 16 Turbopack with precompiled Astryx CSS and product-only StyleX — the shared pattern (strict src/app include, p prefix, fail-closed boundary check, server routes with an HMR probe) reads consistently across both apps, the versions are pinned exactly, and the app-wide CSS limitation is documented honestly. The build README line that used to describe the source example backwards is also fixed at this revision.

Two things need attention before this is ready:

  • As presented against main, this change carries both example migrations at once (the StyleX migration is already open separately as the stacked parent). Could you land or rebase the stack in order so this PR presents just the source migration? That keeps the review surface to one migration and matches how the work is already split.
  • The new CI contract is currently red for the source example: test-build fails on the current revision. Since the two apps' relevant files are identical, this may be a flake — a rerun that goes green, or a fix if it reproduces, is what's needed.

[Automated review]

@cixzhang
cixzhang force-pushed the feat/next-source-turbopack branch from 9b2ec8b to 0df55fe Compare October 1, 2026 06:57

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for moving these examples onto Next 16 Turbopack with precompiled Astryx CSS and product-only StyleX — the shared pattern (strict src/app include, p prefix, fail-closed boundary check, server routes with an HMR probe) reads consistently across both apps, the versions are pinned exactly, and the app-wide CSS limitation is documented honestly.

One thing needs attention before this is ready: as presented against main, this change carries both example migrations at once (the StyleX migration is already open separately as the stacked parent). Could you land or rebase the stack in order so this PR presents just the source migration? That keeps the review surface to one migration and matches how the work is already split. The browser contract for both consumers should also be green when it lands.

[Automated review]

@cixzhang
cixzhang changed the base branch from main to feat/next-stylex-migration October 1, 2026 07:26
@cixzhang

cixzhang commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Restacked as requested: the base is feat/next-stylex-migration again, so this PR now presents only the source-example migration. Full CI, including the production and HMR Chromium contracts for both consumers, passed on the exact current head 0df55fefee1da1b0192df1962a75700f18c39805 before the base was restored.

@cixzhang

Copy link
Copy Markdown
Contributor Author

(Posted by Cindy's agent.) Superseded, so closing with thanks. Its stacked parent #6840 closed today for the same reason: main's Next.js StyleX example already uses the official StyleX Babel + PostCSS setup with plain next dev, which is Turbopack on Next 16 (#10680, #11305). This pull request would turn example-nextjs-source into a second precompiled-CSS app. That example deliberately stays the one that compiles Astryx from source: its README explains why it runs on webpack, and withAstryx refuses a Turbopack config (#6109). The branch stays in place.

@cixzhang cixzhang closed this Nov 12, 2026
@github-actions
github-actions Bot deleted the feat/next-source-turbopack branch November 13, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — 0df55fef Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant