refactor: split out docs/manual routes from shared MdxRoute file#1221
refactor: split out docs/manual routes from shared MdxRoute file#1221jderochervlk wants to merge 3 commits intomasterfrom
Conversation
1ae7265 to
05ae835
Compare
There was a problem hiding this comment.
Pull request overview
Refactors routing so /docs/manual/* pages are served by a dedicated DocsManualRoute (with sidebar + TOC), and introduces shared helpers/utilities to support manual doc navigation.
Changes:
- Add
DocsManualRouteto load/compile manual MDX, build sidebar categories, and generate a per-page table of contents. - Introduce
SidebarHelpersandMdxFile.loadAllAttributesto generate sidebar nav data from MDX frontmatter. - Update route configuration to include manual docs routes and exclude them from the shared
mdxRoutes; document PR/commit conventions inAGENTS.md.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/SidebarHelpers.resi | Exposes sidebar helper function signatures for nav/category construction. |
| src/SidebarHelpers.res | Implements sidebar nav item conversion and grouped category helpers. |
| src/MdxFile.resi | Adds public API for loadAllAttributes to scan MDX frontmatter. |
| src/MdxFile.res | Implements loadAllAttributes and refactors resolveFilePath formatting. |
| app/routes/DocsManualRoute.resi | Declares loader data contract for manual docs route. |
| app/routes/DocsManualRoute.res | New manual-docs route: compiles MDX, builds sidebar + TOC, renders layout. |
| app/routes.res | Registers manual-docs routes and filters them out of mdxRoutes. |
| AGENTS.md | Adds guidance for commit/PR conventions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
05ae835 to
1b8f46d
Compare
de2ead6 to
5d7a8f2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace unsafe %identity cast with dedicated sidebarEntry type - Narrow directory scan from docs/ to docs/manual/ - Add module-level cache for manualTableOfContents - Remove dead manual-specific code from MdxRoute - Move shared sidebar helpers to SidebarHelpers module
Cloudflare deploymentDeployement ID: b523ee12-d738-478e-9cd8-fa1a8f9e1fa9 ⛅️ wrangler 4.63.0 (update available 4.81.1) ✨ Uploading _redirects |
- Delete MdxRoute.res/.resi (all pages now handled by split routes) - Remove react-router-mdx from package.json and delete yarn patch - Remove react-router-mdx externals from Mdx.res - Remove mdxRoutes binding from ReactRouter.res - Remove react-router-mdx init from react-router.config.mjs and generate-route-types.mjs - Add DocsManualRoute for /docs/manual pages with sidebar and TOC - Add DocsReactRoute for /docs/react pages with sidebar and TOC - Add SyntaxLookupDetailRoute for /syntax-lookup/* detail pages - Add SidebarHelpers module for shared sidebar nav/category generation - Add MdxFile.loadAllAttributes to replace react-router-mdx loadAllMdx - Migrate BlogRoute to use MdxFile.loadAllAttributes - Migrate SyntaxLookupRoute to use MdxFile.loadAllAttributes - Migrate CommunityRoute to use SidebarHelpers and MdxFile.loadAllAttributes - Fix Mdx.sortSection comparator to handle all cases explicitly - Update routes.res to register all split routes and remove mdxRoutes Combines PRs #1221, #1222, #1225, #1227
Pull request was closed
Note
This work was done with AI assistance