fix(docs): enable trailingSlash to prevent 404 flash on direct navigation#3039
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughDocusaurus trailing slash handling is enabled in configuration, and Plex documentation link paths are adjusted to reflect the new URL structure. Two minimal, coordinated changes affecting documentation URL generation and relative navigation. ChangesDocumentation URL Configuration Alignment
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
Description
Since #2981 added per-endpoint webpack chunks for OpenAPI docs, the chunk count tripled (~100 to ~300). This made the docs site's JS bundle large enough that a previously imperceptible flash of PAGE NOT FOUND became visible when navigating directly to any URL with a trailing slash (e.g.
/getting-started/).(previously with 100 chunks):
Screen_Recording_20260406_040014_Firefox.Beta.mp4
With
trailingSlash: false, Docusaurus outputs pages asgetting-started.htmlrather thangetting-started/index.html. When GitHub Pages receives a request for/getting-started/, it cannot find the file and serves404.html, which then loads the full React app to client-side redirect to the correct page. With ~100 chunks this was fast enough to go unnoticed. With ~300 chunks the JS takes long enough to parse and execute that the 404 page is briefly visible before the redirect happens.This PR changes the setting
trailingSlash: truemaking Docusaurus outputgetting-started/index.htmlinstead, so GitHub Pages serves the file directly without the 404 detour and no JS is required for the initial render, thus, no flash.This was identified as a side effect of the JS minimizer fix in d88242f (context: #3035 (comment)).
How Has This Been Tested?
Locally built and tested.
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit
Documentation
Chores