Skip to content

refactor(dts)!: remove native-preview support#1760

Merged
Timeless0911 merged 6 commits into
mainfrom
david/refactor-dts-native-preview
Jul 9, 2026
Merged

refactor(dts)!: remove native-preview support#1760
Timeless0911 merged 6 commits into
mainfrom
david/refactor-dts-native-preview

Conversation

@Timeless0911

@Timeless0911 Timeless0911 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR removes the deprecated @typescript/native-preview support path for declaration generation. dts.tsgo now resolves the native TypeScript executable only from typescript >= 7.0.0, and explicit dts.tsgo: true without TypeScript 7+ now fails with a clear error. This is a breaking change for projects relying on @typescript/native-preview; install TypeScript 7+ instead.

The docs are updated to point at typescript@latest.

TODO

  • Update examples, templates, and website to typescript@7 after upstream packages support the TypeScript 7 peer range.
  • Keep prebundle on root typescript@^6.0.3 for now, because its toolchain still depends on the TypeScript 6-compatible peer/API surface.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings July 9, 2026 07:44
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploying rslib with  Cloudflare Pages  Cloudflare Pages

Latest commit: b2483a0
Status: ✅  Deploy successful!
Preview URL: https://7baed6d0.rslib.pages.dev
Branch Preview URL: https://david-refactor-dts-native-pr.rslib.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the deprecated @typescript/native-preview-based tsgo execution path in rsbuild-plugin-dts, standardizing TypeScript Go declaration generation on TypeScript >= 7.0.0 (via the typescript package) and failing fast when dts.tsgo: true is used without TS7+. It also updates user-facing docs to recommend installing typescript@latest.

Changes:

  • Remove @typescript/native-preview support and simplify tsgo executable resolution to only use typescript.
  • Update backend selection logic and tests: TypeScript 7+ uses a single ts7-executable backend; explicit tsgo: true without TS7+ throws a clear error.
  • Refresh documentation and dependency metadata to remove @typescript/native-preview references.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
website/docs/zh/guide/advanced/dts.mdx Remove @typescript/native-preview instructions; recommend typescript@latest.
website/docs/zh/config/lib/dts.mdx Same doc update for config reference (zh).
website/docs/en/guide/advanced/dts.mdx Remove deprecated path; recommend typescript@latest.
website/docs/en/config/lib/dts.mdx Same doc update for config reference (en).
pnpm-lock.yaml Drop @typescript/native-preview from the lockfile and adjust resolved snapshots.
packages/plugin-dts/tests/backend.test.ts Update expectations for the new ts7-executable backend and new error behavior.
packages/plugin-dts/src/tsgo.ts Remove native-preview resolution and always resolve the native executable from typescript.
packages/plugin-dts/src/dts.ts Update executable-backend detection and remove passing the backend through to tsgo emission.
packages/plugin-dts/src/backend.ts Collapse executable backend into ts7-executable and enforce TS7 requirement when tsgo: true.
packages/plugin-dts/README.md Remove deprecated install/config examples; recommend typescript@latest.
packages/plugin-dts/package.json Remove @typescript/native-preview peer dependency; simplify TypeScript peer range.
packages/core/package.json Align TypeScript peer dependency range with the updated plugin expectations.
package.json Remove repo devDependency on @typescript/native-preview.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread packages/plugin-dts/src/tsgo.ts Outdated

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

ℹ️ 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 packages/plugin-dts/src/backend.ts
Comment thread packages/plugin-dts/package.json

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

ℹ️ 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 packages/plugin-dts/package.json Outdated
@Timeless0911

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 955c4ae28c

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

@Timeless0911 Timeless0911 merged commit dbe5e5f into main Jul 9, 2026
11 checks passed
@Timeless0911 Timeless0911 deleted the david/refactor-dts-native-preview branch July 9, 2026 12:06
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.

3 participants