Skip to content

refactor: split out docs/manual routes from shared MdxRoute file#1221

Closed
jderochervlk wants to merge 3 commits intomasterfrom
vlk/split-out-docs-manual
Closed

refactor: split out docs/manual routes from shared MdxRoute file#1221
jderochervlk wants to merge 3 commits intomasterfrom
vlk/split-out-docs-manual

Conversation

@jderochervlk
Copy link
Copy Markdown
Collaborator

@jderochervlk jderochervlk commented Apr 3, 2026

  • Add DocsManualRoute for /docs/manual pages with sidebar and TOC
  • Implement SidebarHelpers for sidebar nav/category generation
  • Add MdxFile.loadAllAttributes for loading manual doc frontmatter
  • Update routes to support manual docs and exclude from mdxRoutes
  • Document commit/PR conventions in AGENTS.md

Note

This work was done with AI assistance

@jderochervlk jderochervlk changed the title docs: add language manual route and sidebar helpers refactor: split out docs/manual routes from shared MdxRoute file Apr 3, 2026
Base automatically changed from vlk/split-out-blog-route to master April 3, 2026 21:25
@jderochervlk jderochervlk marked this pull request as ready for review April 5, 2026 15:50
@jderochervlk jderochervlk force-pushed the vlk/split-out-docs-manual branch from 1ae7265 to 05ae835 Compare April 5, 2026 15:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DocsManualRoute to load/compile manual MDX, build sidebar categories, and generate a per-page table of contents.
  • Introduce SidebarHelpers and MdxFile.loadAllAttributes to 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 in AGENTS.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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@jderochervlk jderochervlk marked this pull request as ready for review April 7, 2026 19:57
@jderochervlk jderochervlk enabled auto-merge (squash) April 7, 2026 22:38
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Cloudflare deployment

Deployement ID: b523ee12-d738-478e-9cd8-fa1a8f9e1fa9
Deployment Environment: preview

⛅️ wrangler 4.63.0 (update available 4.81.1)
─────────────────────────────────────────────
✨ Compiled Worker successfully
Uploading... (7173/7663)
Uploading... (7336/7663)
Uploading... (7500/7663)
Uploading... (7663/7663)
✨ Success! Uploaded 490 files (7173 already uploaded) (4.31 sec)

✨ Uploading _redirects
✨ Uploading Functions bundle
🌎 Deploying...
✨ Deployment complete! Take a peek over at https://b523ee12.rescript-lang.pages.dev
✨ Deployment alias URL: https://vlk-split-out-docs-manual.rescript-lang.pages.dev

jderochervlk added a commit that referenced this pull request Apr 12, 2026
- 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
auto-merge was automatically disabled April 12, 2026 23:42

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants