Skip to content

fix: load API docs from published compiler data - #1432

Open
fhammerschmidt wants to merge 5 commits into
rescript-lang:masterfrom
fhammerschmidt:fix/1421-api-data
Open

fhammerschmidt wants to merge 5 commits into
rescript-lang:masterfrom
fhammerschmidt:fix/1421-api-data

Conversation

@fhammerschmidt

@fhammerschmidt fhammerschmidt commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

The API reference advertised v12 (latest) while reading the old v12.0.0-rc.5 snapshots inside apps/docs. The compiler already publishes newer data to the repository-root data/api directory, but route generation and page loaders never consumed it.

This makes the compiler publication the source for API routes, sidebar navigation, and page content. The website selects the newest numeric version matching its configured documentation major, currently v12.3.1, and rejects missing, incomplete, or invalid publications. Each library must contain its root module, and all modules are validated before the snapshot is cached. Data is loaded on demand so importing route modules does not read API snapshots during runtime SSR.

  • Integrate fix: generate route types from the live route configuration #1442's native route configuration and generator, retaining published API-data selection and regenerating the shared route type. Merge fix: generate route types from the live route configuration #1442 first.
  • Share the documentation major through apps/docs/docs-version.json and version selection between ReScript loaders and the Node link checker.
  • Validate API links against the selected dataset, preserving the exact-route checks now on master. Adapt the three link-checker regression fixtures to the monorepo publication layout.
  • Remove 36 obsolete generated JSON files and the unused legacy generator, plus their ignore entries. Most of the diff is deletion of those unused snapshots; the compiler's root publications remain intact.
  • Add 23 API data regression tests, including root-module and module-shape validation.

Targets website master (v12). No compiler repository changes are needed. The loader supports selecting v13 publications; the website v13 port is tracked in #1433, alongside the compiler publication issue.

Validation: strict ReScript compilation, all 79 Node-mode script tests, and the seven route-generation tests pass after integration with #1442. The production build passes, and all 139 published API modules have prerendered HTML and loader data. All six CI jobs pass after integration, including route freshness, site checks, browser and visual regression tests, Wrangler startup, and homepage end-to-end tests.

Fixes #1391
Part of #1421

Use the repository-root compiler publication for API routes, navigation,
and module content. Select the latest dataset within the configured docs
major and share version selection with link validation.

Remove obsolete snapshots, the unused TOC, and the legacy generator.
Add regression coverage for version selection, published data, and API links.

Fixes rescript-lang#1391
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-09T17:30:41.575186Z 693123f Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a6f1992eb

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/docs/src/data/ApiData.res Outdated
Require each library root and validate module fields before caching published API data. Fail invalid publications with their file and module paths instead of prerendering blank pages.

Add regression coverage for empty libraries, missing roots, and malformed root or child modules. Document the required publication structure.

Fixes rescript-lang#1391

Part of rescript-lang#1421
@fhammerschmidt

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 693123f9b6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Integrate master through rescript-lang#1430 while retaining the published API data lookup and monorepo regression fixtures. Preserve exact route validation without duplicating the API route list during the merge.
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.
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.

API reference serves v12.0.0-rc.5 data as "v12 (latest)"

1 participant