[docs-infra] Update docs to support turbopack mode#4888
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,197.02 ms -51.99 ms(-4.2%) | Renders: 50 (+0) | Paint: 1,842.32 ms -53.07 ms(-2.8%)
11 tests within noise — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
||
| const EAGER_COUNT = 2; | ||
|
|
||
| export function rehypeEagerCodeBlocks() { |
There was a problem hiding this comment.
Default exports are read through string based plugin paths.
| "#test-utils": "./test/index.ts", | ||
| "#formatErrorMessage": "@base-ui/utils/formatErrorMessage" | ||
| }, | ||
| "type": "commonjs", |
There was a problem hiding this comment.
Explicit type to commonjs leads turbopack to fail with error -
./packages/utils/src/warn.ts
Specified module format (CommonJs) is not matching the module format of the source code (EcmaScript Modules)
The CommonJs module format was specified in the package.json that is affecting this source file or by using an special extension, but Ecmascript import/export syntax is used in the source code.
The module was automatically converted to an EcmaScript module, but that is in conflict with the specified module format. Either change the "type" field in the package.json or replace EcmaScript import/export syntax with CommonJs syntas in the source file.So we can either omit the field (as in PR) or add a nested package.json inside src stating type: module.
|
We should enable https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopackFileSystemCache |
TL;DR
loadPrecomputedTypes(1–2s per types.ts) in both modes. We need to improve this on the docs-infra package side.rm -rf .next)Ready in~3× faster ready time.
//react/components/popover/react/components/dialog/react/components/select/react/components/comboboxpopover/page.mdxPopoverPopup.tsx(workspace pkg)CodeBlock.tsxrm -rf .next export)@dav-is When building the docs, I got a bunch of -
Also, I need you to check if everything is working as far as docs-infra related transforms are concerned since you have larger context. I have already verified that a bunch of pages are working as expected.