refactor(dts)!: remove native-preview support#1760
Conversation
Deploying rslib with
|
| 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 |
There was a problem hiding this comment.
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-previewsupport and simplify tsgo executable resolution to only usetypescript. - Update backend selection logic and tests: TypeScript 7+ uses a single
ts7-executablebackend; explicittsgo: truewithout TS7+ throws a clear error. - Refresh documentation and dependency metadata to remove
@typescript/native-previewreferences.
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
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
This PR removes the deprecated
@typescript/native-previewsupport path for declaration generation.dts.tsgonow resolves the native TypeScript executable only fromtypescript>= 7.0.0, and explicitdts.tsgo: truewithout 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
typescript@7after upstream packages support the TypeScript 7 peer range.prebundleon roottypescript@^6.0.3for now, because its toolchain still depends on the TypeScript 6-compatible peer/API surface.Checklist