feat: remove MdxRoute and react-router-mdx dependency#1227
Closed
jderochervlk wants to merge 37 commits intomasterfrom
Closed
feat: remove MdxRoute and react-router-mdx dependency#1227jderochervlk wants to merge 37 commits intomasterfrom
jderochervlk wants to merge 37 commits intomasterfrom
Conversation
Collaborator
jderochervlk
commented
Apr 3, 2026
- 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
…nto vlk/split-out-blog-route
…nto vlk/split-out-blog-route
- 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
b4e2ece to
d20ee94
Compare
4412018 to
8fda350
Compare
9 tasks
0342826 to
c18352c
Compare
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.