diff --git a/.changepacks/changepack_log_turbo_compact_loader_options.json b/.changepacks/changepack_log_turbo_compact_loader_options.json new file mode 100644 index 000000000..33424c731 --- /dev/null +++ b/.changepacks/changepack_log_turbo_compact_loader_options.json @@ -0,0 +1,7 @@ +{ + "changes": { + "packages/next-plugin/package.json": "Patch" + }, + "note": "Pass the Turbopack loaders only what coordinator mode reads (the port file, the theme files and, for the CSS loader, watch), plus a short key of the setup state that re-runs them when it changes. Next serializes the resolved config into .next/required-server-files.{js,json}, which ships with the app; it no longer carries the default sheet, class map, file map, theme or file paths. CSS and JavaScript output is unchanged.", + "date": "2026-11-19T00:00:00.000Z" +} diff --git a/apps/landing/src/app/(detail)/docs/limitations/page.mdx b/apps/landing/src/app/(detail)/docs/limitations/page.mdx index 2d63a9e00..374d2a6e3 100644 --- a/apps/landing/src/app/(detail)/docs/limitations/page.mdx +++ b/apps/landing/src/app/(detail)/docs/limitations/page.mdx @@ -100,6 +100,7 @@ A dynamic value such as `width` becomes a CSS variable set in `style`, so a comp - Inside ``, `cx(getClass())` is a build error; put the result in a variable first, which then joins as a class. - `withComponent` takes a tag name or a component written as a name or `a.b`. On a component made with Devup UI's or styled-components' `styled`, a target only the runtime knows, as `withComponent(make())`, is a build error: such a component compiles to a plain function with no `withComponent`. Pass the target directly, or render with `as`. A component made with Emotion's `styled` takes `withComponent` at runtime as well, so any one target works there. Options passed beside the target are a build error. - An `.mdx` file is extracted after your MDX plugin compiles it to JavaScript, never as raw MDX. The Vite (`@mdx-js/rollup`), webpack and Rsbuild (`@mdx-js/loader`, `@rsbuild/plugin-mdx`) plugins and Next.js with webpack (`@next/mdx`) run their MDX step in a later phase: Vite in a `post` transform, webpack and Rsbuild in a `post` loader. Next.js with Turbopack (`@next/mdx`) extracts the compiled document: `@next/mdx` renames its output to `.tsx` and Turbopack runs the source rule on it again, so it works whichever of `withMDX` and `DevupUI` wraps the other. A production Turbopack build cannot extract a document before it compiles, so its stylesheet waits for the MDX route files (when `pageExtensions` lists `mdx`) and the documents they and the compiled sources import by a relative path; a document imported only through a path alias is not waited for. The Bun plugin does not extract MDX yet. The scan that reserves class names before a build reads JavaScript and TypeScript modules only, so a document's own classes are named when it compiles. Put components that need Devup UI styles in a `.tsx` module and use them from the document. +- With Turbopack, Next.js copies its resolved config into `.next/required-server-files.{js,json}` and the standalone `server.js`, so the two Devup UI loader rules (about 500 bytes, the same for any app size, with no local path) ship with the server output. They cannot be removed safely today: Next.js copies the config before any hook the plugin can register runs, and its only option that leaves bundler settings out of that copy also changes how the server reads its deployment id ([vercel/next.js#102045](https://github.com/vercel/next.js/discussions/102045)). Webpack builds add nothing there. - The plugins read `jsxImportSource` from the `tsconfig.json` (or `jsconfig.json`) in the working directory. Opt out with `importAliases: { '@emotion/react/jsx-runtime': false }`. - The outermost `ThemeProvider` also declares its theme on `:root`, in a `