Upgrade to Docusaurus 3#3144
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedToo many files! This PR contains 300 files, which is 150 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (300)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
Summary
Brings the docs site green on Docusaurus 3 with future.v4: true and trailingSlash: true. Five categories of mechanical changes plus targeted swizzle rewrites for the CodeBlock theme refactor.
What changed
1. MDX 3 syntax compliance (~595 doc files)
2. CodeBlock theme swizzle migration (src/theme/CodeBlock/)
Docusaurus 3 rewrote the CodeBlock components around a new context provider + slot-based architecture. The site's three customizations (CustomizableValue integration in titles, copy handler, and line tokens) were ported.
3. Redirect collisions (2 deletions)
Removed docs/library/stay-up-to-date/{updating,versioning}.md. These pages had been superseded by /2.0/docs/library/guides/updating-modules and /versioning, with redirects already in src/redirects.js. The new client-redirects plugin refuses to overwrite real pages (older versions silently ignored this).
4. Internal link rewrites (~131 doc files)
Replaced 148 internal references to the deleted pages with their /2.0/docs/library/guides/... equivalents. Docusaurus 3's broken-link checker no longer trusts redirect targets, so links must point to canonical URLs.
5. Trailing-slash relative-path fixes (14 files)
The trailingSlash: true change broke a small number of pre-existing relative links (now resolving one directory deeper than intended). Converted to absolute paths or corrected ../ depth in:
6. Segment plugin runtime guard
Added src/clientModules/segmentShim.js, registered in docusaurus.config.js. The unmaintained @twilio-labs/docusaurus-plugin-segment@0.1.0 (peer-deps React 16/17) loads its onRouteDidUpdate callback in Docusaurus 3 dev mode despite skipping the inline init snippet, leaving window.analytics undefined and crashing on navigation. The shim defines window.analytics as a no-op fallback, which also hardens production against ad-blockers/CSP that block the Segment loader.
Test plan
Out of scope