Adopt Docusaurus Faster so the docs site survives the 3.10 bump - #139
Conversation
Docusaurus 3.10 added the `future.v4.fasterByDefault` flag, and the
`future: { v4: true }` shorthand this site uses now expands to *every*
v4 flag — including that one, which in turn enables all `future.faster.*`
options (Rspack, SWC, Lightning CSS). Those ship in a separate package,
so on 3.10.2 both `docusaurus start` and `docusaurus build` abort with:
Error: To enable Docusaurus Faster options, your site must add the
@docusaurus/faster package as a dependency.
Take the forward option rather than opting back out with an explicit
`future.v4: { fasterByDefault: false, ... }` — Faster is what v4 does
anyway, and it works cleanly here.
- bump the five @docusaurus/* packages to 3.10.2 (supersedes #135)
- add @docusaurus/faster as a docs dependency
- skip @swc/core's postinstall: Faster pulls in SWC, and that script only
probes the native binding before falling back to @swc/wasm. The
platform-specific optional dep installs on its own, so this matches the
existing biome/core-js entries.
Verified on Rspack 1.7.12: clean production build, dev server, and the
demo page under both — remote Visium HD store loads, the hires image
layer decodes through the codec workers, parquet-wasm loads, no local
asset failures and no console errors. The linux-x64-gnu bindings for
both @swc/core and @rspack are in the lockfile, so the CI
--frozen-lockfile install resolves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 48 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughThe documentation workspace upgrades Docusaurus to 3.10.2, adds ChangesDocusaurus upgrade
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm-workspace.yaml`:
- Around line 7-10: Enable the `@swc/core` lifecycle script by changing its
allowBuilds entry from false to true in the workspace configuration, ensuring
postinstall.js can validate the native binding and install `@swc/wasm` when
needed. Do not retain the current script-skipping setting unless an equivalent
fallback is implemented and tested.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0e7dc68e-17bb-4bc8-8cd0-439a01b4a4e3
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
docs/docusaurus.config.tsdocs/package.jsonpnpm-workspace.yaml
Comment-only. Answers the review question rather than changing behaviour: the script is a no-op on a healthy install, all 12 platform bindings are lockfile-tracked, and its @swc/wasm fallback shells out to npm and writes outside the lockfile so --frozen-lockfile CI could never reproduce it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Supersedes #135.
The problem
#135 is a straight bump of the five
@docusaurus/*packages from 3.9.1 to 3.10.2. Merging it as-is breaks the docs site outright —docusaurus startanddocusaurus buildboth abort before doing any work:Docusaurus 3.10 added a new future flag,
v4.fasterByDefault. This site uses thefuture: { v4: true }shorthand, and that shorthand expands to every v4 flag — so it now turns onfasterByDefault, which in turn enables allfuture.faster.*options (Rspack bundler, SWC, Lightning CSS). Those live in a separate@docusaurus/fasterpackage.@docusaurus/bundler'sgetCurrentBundler()readssiteConfig.future.faster.rspackBundler, hitsimportRspack(), and throws.The fix
Take the forward option — actually adopt Faster — rather than opting back out with an explicit
future.v4: { fasterByDefault: false, ... }. It's what v4 will do anyway, and it works cleanly here.@docusaurus/*packages to 3.10.2 (the content of Bump the docs-stack group with 5 updates #135)@docusaurus/faster3.10.2 as a docs dependency'@swc/core': falseinallowBuilds— Faster pulls in SWC, whose postinstall only probes the native binding before falling back to@swc/wasm. The platform-specific optional dep installs on its own, so this matches the existing biome/core-js entries.v4: trueflag recording why@docusaurus/fasteris now a hard dependency, so the coupling isn't a surprise next timeVerification
Everything below was run against Rspack 1.7.12:
docusaurus buildsucceeds from a clean.docusaurus/buildparquet-wasmloads, zero local asset failures, zero console errorsdisableDevSplitChunksplugin'soptimization.splitChunks: falseis fine on Rspack@swc/core-linux-x64-gnuand@rspack/binding-linux-x64-gnuare both in the lockfile, so the--frozen-lockfileinstall in.github/workflows/docs.ymlresolves on CI runnersNotes
The build emits one warning —
Critical dependency: the request of a dependency is an expression, fromweb-worker's Node shim during SSR. It's the classic bundler warning, non-fatal, and not introduced by Faster.Unrelated and pre-existing, so left alone here:
pnpm --filter docs typecheckfails withsh: tsc: command not found, because the script callstscwhile the workspace catalog mapstypescriptto@typescript/typescript6(bintsc6). Nothing in CI runs it, which is why it went unnoticed.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Maintenance