Skip to content

fix: generate route types from the live route configuration - #1442

Open
fhammerschmidt wants to merge 1 commit into
rescript-lang:masterfrom
fhammerschmidt:fix/1421-route-types
Open

fhammerschmidt wants to merge 1 commit into
rescript-lang:masterfrom
fhammerschmidt:fix/1421-route-types

Conversation

@fhammerschmidt

@fhammerschmidt fhammerschmidt commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Move the route table into apps/docs/route-config.mjs and share it between React Router, prerendering and route-type generation. This replaces the generator's missing import and old output path, and lets it run before ReScript compilation.

Generate packages/shared/src/Path.res from the live route tree, including MDX pages and API modules. Sort and deduplicate concrete URLs, add missing pages, and remove deleted paths and /undefined.

Generate route types before builds and when starting the ReScript watcher. Add yarn build:routes and yarn check:routes, and reject stale generated types in CI.

Merge before #1432.

Part of #1421.
Fixes #1408

Move the build-time route table to native JavaScript so React Router and route generation share one configuration without requiring compiled ReScript first.

Generate the shared Path.res before compilation, handle nested layouts and index routes, omit URL patterns, and detect stale output in CI. Add regression tests for content discovery, deterministic output, and non-writing checks from any working directory.

Fixes rescript-lang#1408.

Part of rescript-lang#1421.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T22:56:53.331246Z ace5010 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

fhammerschmidt added a commit to fhammerschmidt/rescript-lang.org that referenced this pull request Oct 9, 2026
Integrate rescript-lang#1442, keep API routes on the published v12 dataset, and regenerate Path.res from that dataset. Remove the superseded ReScript route table without restoring legacy API JSON.

Merge rescript-lang#1442 before this PR.

Fixes rescript-lang#1391.

Part of rescript-lang#1421.

This branch has not been deployed

No deployments
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.

Route type Path.res is hand-maintained and stale; its generator is broken

1 participant