Repository navigation
Modern Tooling, Part 7: vendor remark-typescript-tools and update to TS7 - #5390
Merged
Merged
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
@reduxjs/rtk-codemods
@rtk-query/codegen-openapi
@rtk-query/graphql-request-base-query
@reduxjs/toolkit
commit: |
markerikson
force-pushed
the
landing/rtk-7
branch
from
August 24, 2026 02:03
74dfadc to
7476ae8
Compare
size-limit report 📦
|
markerikson
force-pushed
the
landing/rtk-7
branch
from
August 24, 2026 03:29
7476ae8 to
464ee0c
Compare
markerikson
force-pushed
the
landing/rtk-7
branch
from
September 6, 2026 01:05
464ee0c to
a5e82d4
Compare
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.
markerikson
force-pushed
the
landing/rtk-7
branch
from
September 6, 2026 01:29
a5e82d4 to
dd377be
Compare
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Removing Prettier in RTK-2 left
transpileCodeblockswith no config tofind. It logs a warning per code block and emits unformatted code tabs -
940 warnings a build. Netlify sets
CI=true, so that ships the momentthe oxfmt PR merges. This repairs it.
The published
remark-typescript-toolscannot be upgraded in place.TypeScript 7's main export is
{ version, versionMajorMinor }; there isno
typescript.jsand notypescript.d.ts, so every tool driving theclassic
ts.*API stops working, and this plugin drives it heavily.The port replaces the hand-written
LanguageServiceHostwith oneAPIinstance from
typescript/unstable/syncover an overlay filesystem,moves emit to
oxc-transformbecause the TS 7 API has no emit, andformats with oxfmt instead of Prettier.
It is vendored rather than depended on because the port cannot ship a
release yet:
rollup-plugin-dtsdrives the classic API and crashesunder TS 7, so the package has no declaration output. Nothing here needs
declarations -
docusaurus.config.tsimports the source directly. Anupstream PR carries the same port. When a release lands, delete
website/plugins/remark-typescript-toolsand depend on the packageagain. This is a bridge, not a fork.
Details:
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.cjsis the one edit to upstream's source. Docusaurus loads theconfig through jiti, jiti transpiles TypeScript 7's ESM to CommonJS
and leaves
import.metain it, and the result throws. Node's ownrequire(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 inignorePatternsin.oxfmtrc.jsonso thevendored copy stays diffable against upstream.
prettierleaveswebsite/package.json. The plugin was its onlyremaining 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 formattingwarnings. The 24 remaining "could not find overload" messages come from
linkDocblocksand 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 💬