Skip to content

Modern Tooling, Part 7: vendor remark-typescript-tools and update to TS7 - #5390

Merged
markerikson merged 1 commit into
landing/rtk-6from
landing/rtk-7
Sep 6, 2026
Merged

markerikson merged 1 commit into
landing/rtk-6from
landing/rtk-7

Conversation

@markerikson

Copy link
Copy Markdown
Collaborator

Removing Prettier in RTK-2 left transpileCodeblocks with no config to
find. It logs a warning per code block and emits unformatted code tabs -
940 warnings a build. Netlify sets CI=true, so that ships the moment
the oxfmt PR merges. This repairs it.

The published remark-typescript-tools cannot be upgraded in place.
TypeScript 7's main export is { version, versionMajorMinor }; there is
no typescript.js and no typescript.d.ts, so every tool driving the
classic ts.* API stops working, and this plugin drives it heavily.
The port replaces the hand-written LanguageServiceHost with one API
instance from typescript/unstable/sync over an overlay filesystem,
moves emit to oxc-transform because the TS 7 API has no emit, and
formats with oxfmt instead of Prettier.

It is vendored rather than depended on because the port cannot ship a
release yet: rollup-plugin-dts drives the classic API and crashes
under TS 7, so the package has no declaration output. Nothing here needs
declarations - docusaurus.config.ts imports the source directly. An
upstream PR carries the same port. When a release lands, delete
website/plugins/remark-typescript-tools and depend on the package
again. This is a bridge, not a fork.

Details:

  • The plugin is its own workspace package purely to pin TypeScript 7 to
    its own directory. The rest of the repo stays on 6.0.3. Nothing
    imports it by name; the config uses a relative path.
  • ts7.cjs is the one edit to upstream's source. Docusaurus loads the
    config through jiti, jiti transpiles TypeScript 7's ESM to CommonJS
    and leaves import.meta in it, and the result throws. Node's own
    require(esm) loads it fine. A plain CommonJS file gives jiti nothing
    to transform, so Node's native require handles the inner call. Only
    the three value imports route through it; type imports are erased
    before runtime and still point at typescript/unstable/ast.
  • website/plugins/** is in ignorePatterns in .oxfmtrc.json so the
    vendored copy stays diffable against upstream.
  • prettier leaves website/package.json. The plugin was its only
    remaining user.

Measured on the 156 code blocks in these docs: no transpilation 75s,
TypeScript 6.0.3 with the published plugin 177s, TypeScript 7.0.2 with
this port 100s, and 80s with oxfmt formatting.

Verified with CI=true pnpm build:docs: build succeeds, zero formatting
warnings. The 24 remaining "could not find overload" messages come from
linkDocblocks and are upstream's own code, unchanged by the port.

Upstream base: phryneas/remark-typescript-tools main @ 5c375b1.
Port: feat/typescript-7-and-oxfmt @ b2ce7f2.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@codesandbox

codesandbox Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web Editor • VS Code • Insiders

Open Preview

@pkg-pr-new

pkg-pr-new Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@reduxjs/rtk-codemods

npm i https://pkg.pr.new/@reduxjs/rtk-codemods@dd377be -D
yarn add https://pkg.pr.new/@reduxjs/rtk-codemods@dd377be.tgz -D
pnpm add https://pkg.pr.new/@reduxjs/rtk-codemods@dd377be.tgz -D
bun add https://pkg.pr.new/@reduxjs/rtk-codemods@dd377be.tgz -D

@rtk-query/codegen-openapi

npm i https://pkg.pr.new/@rtk-query/codegen-openapi@dd377be -D
yarn add https://pkg.pr.new/@rtk-query/codegen-openapi@dd377be.tgz -D
pnpm add https://pkg.pr.new/@rtk-query/codegen-openapi@dd377be.tgz -D
bun add https://pkg.pr.new/@rtk-query/codegen-openapi@dd377be.tgz -D

@rtk-query/graphql-request-base-query

npm i https://pkg.pr.new/@rtk-query/graphql-request-base-query@dd377be -D
yarn add https://pkg.pr.new/@rtk-query/graphql-request-base-query@dd377be.tgz -D
pnpm add https://pkg.pr.new/@rtk-query/graphql-request-base-query@dd377be.tgz -D
bun add https://pkg.pr.new/@rtk-query/graphql-request-base-query@dd377be.tgz -D

@reduxjs/toolkit

npm i https://pkg.pr.new/@reduxjs/toolkit@dd377be -D
yarn add https://pkg.pr.new/@reduxjs/toolkit@dd377be.tgz -D
pnpm add https://pkg.pr.new/@reduxjs/toolkit@dd377be.tgz -D
bun add https://pkg.pr.new/@reduxjs/toolkit@dd377be.tgz -D

commit: dd377be

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

size-limit report 📦

Path Size
3. fetchBaseQuery (.modern.mjs) 5.26 KB (+0.21% 🔺)

Removing Prettier in RTK-2 left `transpileCodeblocks` with no config to
find. It logs a warning per code block and emits unformatted code tabs -
940 warnings a build. Netlify sets `CI=true`, so that ships the moment
the oxfmt PR merges. This repairs it.

The published `remark-typescript-tools` cannot be upgraded in place.
TypeScript 7's main export is `{ version, versionMajorMinor }`; there is
no `typescript.js` and no `typescript.d.ts`, so every tool driving the
classic `ts.*` API stops working, and this plugin drives it heavily.
The port replaces the hand-written `LanguageServiceHost` with one `API`
instance from `typescript/unstable/sync` over an overlay filesystem,
moves emit to `oxc-transform` because the TS 7 API has no emit, and
formats with oxfmt instead of Prettier.

It is vendored rather than depended on because the port cannot ship a
release yet: `rollup-plugin-dts` drives the classic API and crashes
under TS 7, so the package has no declaration output. Nothing here needs
declarations - `docusaurus.config.ts` imports the source directly. An
upstream PR carries the same port. When a release lands, delete
`website/plugins/remark-typescript-tools` and depend on the package
again. This is a bridge, not a fork.

Details:

- The plugin is its own workspace package purely to pin TypeScript 7 to
  its own directory. The rest of the repo stays on 6.0.3. Nothing
  imports it by name; the config uses a relative path.
- `ts7.cjs` is the one edit to upstream's source. Docusaurus loads the
  config through jiti, jiti transpiles TypeScript 7's ESM to CommonJS
  and leaves `import.meta` in it, and the result throws. Node's own
  require(esm) loads it fine. A plain CommonJS file gives jiti nothing
  to transform, so Node's native require handles the inner call. Only
  the three value imports route through it; type imports are erased
  before runtime and still point at `typescript/unstable/ast`.
- `website/plugins/**` is in `ignorePatterns` in `.oxfmtrc.json` so the
  vendored copy stays diffable against upstream.
- `prettier` leaves `website/package.json`. The plugin was its only
  remaining user.

Measured on the 156 code blocks in these docs: no transpilation 75s,
TypeScript 6.0.3 with the published plugin 177s, TypeScript 7.0.2 with
this port 100s, and 80s with oxfmt formatting.

Verified with `CI=true pnpm build:docs`: build succeeds, zero formatting
warnings. The 24 remaining "could not find overload" messages come from
`linkDocblocks` and are upstream's own code, unchanged by the port.

Upstream base: phryneas/remark-typescript-tools main @ 5c375b1.
Port: feat/typescript-7-and-oxfmt @ b2ce7f2.
@netlify

netlify Bot commented Sep 6, 2026

Copy link
Copy Markdown

✅ Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit dd377be
🔍 Latest deploy log https://app.netlify.com/projects/redux-starter-kit-docs/deploys/6a9cca32c93d989ba104c337
😎 Deploy Preview https://deploy-preview-5390--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@markerikson
markerikson merged commit 46e95ea into master Sep 6, 2026
48 checks passed
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