Skip to content

feat: remove MdxRoute and react-router-mdx dependency#1227

Draft
jderochervlk wants to merge 37 commits intovlk/split-out-api-overviewfrom
vlk/remove-mdx-route
Draft

feat: remove MdxRoute and react-router-mdx dependency#1227
jderochervlk wants to merge 37 commits intovlk/split-out-api-overviewfrom
vlk/remove-mdx-route

Conversation

@jderochervlk
Copy link
Copy Markdown
Collaborator

  • Delete MdxRoute.res and MdxRoute.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 (loadMdx, loadAllMdx, useMdxComponent, useMdxAttributes, useMdxFiles, allMdx wrapper)
  • Remove mdxRoutes binding from ReactRouter.res
  • Remove mdxRoutes variable and spread from routes.res
  • Remove react-router-mdx init from react-router.config.mjs and generate-route-types.mjs
  • Migrate BlogRoute to use MdxFile.loadAllAttributes instead of Mdx.allMdx
  • Migrate SyntaxLookupRoute to use MdxFile.loadAllAttributes instead of loadAllMdx

jderochervlk and others added 30 commits March 19, 2026 11:16
- Use String.startsWith instead of String.includes for blog route
  filtering to avoid accidentally excluding non-blog routes that
  contain 'blog' as a substring

- Replace JsExn.throw with JsError.throwWithMessage in
  BlogArticleRoute for consistency with BlogApi.res and to get
  proper Error objects with stack traces

- Normalize path separators in MdxFile.scanDir to fix Windows
  compatibility where Node.Path.join2 produces backslashes
Updates the Markdown image caption test to use a new caption and image.
Regenerates all related test screenshots to reflect the change.
Add detailed instructions for running and updating Vitest
browser-based unit tests in the README. Remove outdated
screenshot baseline PNGs from __tests__/__screenshots__.
Add guidance in README to be selective when updating screenshots.
- 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
- Create DocsReactRoute.res/.resi for /docs/react/* pages, following the
  same pattern as DocsManualRoute with React-specific sidebar categories
  (Overview, Main Concepts, Hooks & State Management, Guides) and
  breadcrumbs (Docs > rescript-react)
- Register docsReactRoutes in app/routes.res via MdxFile.scanPaths and
  filter docs/react paths out of the legacy mdxRoutes
- Fix inconsistent comparator in Mdx.sortSection: items with an order
  field now always sort before items without one, and items without order
  preserve their relative position (was _ => -1.0, now handles all four
  cases explicitly)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…escript-lang.org into vlk/split-out-docs-manual
…rescript-lang.org into vlk/split-out-docs-react
…escript-lang.org into vlk/split-out-docs-guidelines
- Create CommunityRoute.res with dedicated loader and community sidebar
- Register communityRoutes in routes.res, filter community from mdxRoutes
- Remove communityTableOfContents, community branches from MdxRoute
…kupDetailRoute

- Create SyntaxLookupDetailRoute.res with dedicated loader for /syntax-lookup/* pages
- Register syntaxLookupDetailRoutes in routes.res, filter syntax-lookup from mdxRoutes
- Remove syntax-lookup branch, mdxSources/activeSyntaxItem fields, and components dict from MdxRoute
- Flatten loader body after if/else removal
- Create ApiOverviewRoute.res for /docs/manual/api with ApiOverviewLayout.Docs
- Add explicit route in routes.res pointing docs/manual/api to ApiOverviewRoute
- Remove API overview branch, manualTableOfContents, and sidebar helpers from MdxRoute
- MdxRoute now only handles docs/manual and docs/react pages via react-router-mdx
- Delete MdxRoute.res and MdxRoute.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 (loadMdx, loadAllMdx, useMdxComponent, useMdxAttributes, useMdxFiles, allMdx wrapper)
- Remove mdxRoutes binding from ReactRouter.res
- Remove mdxRoutes variable and spread from routes.res
- Remove react-router-mdx init from react-router.config.mjs and generate-route-types.mjs
- Migrate BlogRoute to use MdxFile.loadAllAttributes instead of Mdx.allMdx
- Migrate SyntaxLookupRoute to use MdxFile.loadAllAttributes instead of loadAllMdx
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.

1 participant