Skip to content

Show deprecation reason message in API docs - #1328

Open
aspeddro wants to merge 3 commits into
rescript-lang:masterfrom
aspeddro:fix-api-docs-message
Open

Show deprecation reason message in API docs#1328
aspeddro wants to merge 3 commits into
rescript-lang:masterfrom
aspeddro:fix-api-docs-message

Conversation

@aspeddro

@aspeddro aspeddro commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

TODO

  • Update compiler repo action to store json files in apps/docs/data/api instead of data/api

Close #1259

@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: f08775ca79

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


let moduleContent =
Fs.readFileSync(`markdown-pages/docs/api/${moduleName}.json`)->JSON.parseOrThrow
let versions = Fs.readdirSync(dir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Defer filesystem enumeration to the loader

When a browser loads an API route, ApiRoute.default imports this module to render <ApiDocs>, so this top-level readdirSync is evaluated outside the loader. In this ssr: false app the browser has no Node fs; unlike the previous implementation, which deferred the filesystem read until getVersion and guarded its top-level path lookup, this can make the API bundle throw before rendering. Enumerate the versions inside the loader-only path instead.

AGENTS.md reference: AGENTS.md:L101-L104

Useful? React with 👍 / 👎.

Comment on lines +33 to +35
NpmSemver.make(
`${major->Int.toString}.${minor->Int.toString}.${patch->Int.toString}-${pre}`,
)->Null.getOrThrow

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the v prefix in constructed versions

When compilerVersionForRuntimeImport normalizes v10/v11 or early v12-alpha compilers, it calls Semver.make, but this constructor string omits v and toString now returns t.raw. The npm semver constructor preserves that raw spelling, so runtime URLs become /11.2.0-beta.2/... rather than /v11.2.0-beta.2/..., breaking runtime imports for those selectable compilers and contradicting the existing GuideRuntime_ expectations. Prefix the constructed version or make toString return the canonical v-prefixed form.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment thread apps/guide/app/root.jsx Outdated
Comment on lines +10 to +12
return <html
lang={"en"}
>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Revert formatting changes to generated JSX

The corresponding root.res and routes.res files are unchanged, so these are formatting-only edits to compiler outputs; the next ReScript compilation can overwrite them and reintroduce recurring dirty diffs. Revert the changes in both tracked .jsx files and make any intended changes in their .res sources only.

AGENTS.md reference: AGENTS.md:L210-L216

Useful? React with 👍 / 👎.

@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: 9aee263681

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

| "dom" => parseApi(await Node.Fs.readFile("./markdown-pages/docs/api/dom.json", "utf-8"))
| _ => parseApi(await Node.Fs.readFile("./markdown-pages/docs/api/stdlib.json", "utf-8"))
}
let apiDocs = parseApi(await Node.Fs.readFile(`data/api/${version}/${basePath}.json`, "utf-8"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Register routes from the versioned API data

When v13 becomes the selected documentation version, new modules in this dataset remain unreachable: this commit adds stdlib/taggedtemplate to data/api/v13.0.0/stdlib.json, but DocsRoutes.res lines 3–11 still generates the static route table from markdown-pages/docs/api/stdlib.json, where that key is absent. Consequently /docs/manual/api/stdlib/taggedtemplate falls through to the wildcard route instead of invoking this loader; generate API routes from the same versioned data source.

AGENTS.md reference: AGENTS.md:L5-L5

Useful? React with 👍 / 👎.

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.

Show deprecation reason in stdlib docs on rescript-lang.org

1 participant