Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

chore: switch to production typescript - #612

#612
Open
43081j wants to merge 5 commits into
unjs:mainunjs/unplugin:mainfrom
43081j:jg/tsgone43081j/unplugin:jg/tsgoneCopy head branch name to clipboard
Open

chore: switch to production typescript#612
43081j wants to merge 5 commits into
unjs:mainunjs/unplugin:mainfrom
43081j:jg/tsgone43081j/unplugin:jg/tsgoneCopy head branch name to clipboard

Conversation

@43081j

@43081j 43081j commented Jul 27, 2026

Copy link
Copy Markdown
Member

With TypeScript 7 out, we no longer need the
@typescript/native-preview package as 7.x is the prod version of that.

Summary by CodeRabbit

  • Chores
    • Updated the project’s type-checking command to use the standard TypeScript compiler directly.
    • Updated the shared TypeScript version to 7.0.2 via a new TypeScript 7 alias.
    • Removed the experimental TypeScript native preview development dependency.
    • Added a dedicated TypeScript 7 development dependency to match the shared version.

With TypeScript 7 out, we no longer need the
`@typescript/native-preview` package as 7.x is the prod version of that.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d6e6290-6cdf-470b-8884-68af0f151d51

📥 Commits

Reviewing files that changed from the base of the PR and between a69585e and 643318e.

📒 Files selected for processing (1)
  • pnpm-workspace.yaml
💤 Files with no reviewable changes (1)
  • pnpm-workspace.yaml

📝 Walkthrough

Walkthrough

The workspace replaces the native TypeScript preview compiler with TypeScript 7, adds a catalog alias and dependency, and updates the typecheck script to invoke TypeScript 7 directly.

Changes

TypeScript toolchain

Layer / File(s) Summary
Align TypeScript dependency and typecheck command
pnpm-workspace.yaml, package.json
The workspace adds a typescript-7 alias, removes @typescript/native-preview, adds typescript-7, and runs typechecking with its tsc binary and --noEmit.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: moving from the preview TypeScript package to the production TypeScript release.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/unplugin@612

commit: 643318e

@antfu

antfu commented Jul 27, 2026

Copy link
Copy Markdown
Member

It seems that ESLint is not working well with TypeScript v7 yet

@43081j

43081j commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

@antfu TSESLint isn't. but that should be fine.. this is what nested dependencies are for.

im not sure why TSESLint is falling over here. it should have a dependency (or peer dependency) of typescript < 6 basically. and yet here it seems to be skipping that and trying to use our typescript 7...

ill have to dig a bit more but TSESLint is at fault, not us

@sxzz

sxzz commented Jul 27, 2026

Copy link
Copy Markdown
Member

TSESLint requires TS API, even if type-aware linting is not enabled.
See also typescript-eslint/typescript-eslint#10940

@43081j

43081j commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

yep fully understood 👍

that's not the problem here. the problem here is that pnpm should be giving TSESLint the TS it asks for (<6) and isn't. it is only installing 7.x which obviously won't work with TSESLint.

this PR was created already knowing TSESLint doesn't support TS 7.x yet. it should still be possible by normal, nested dependency resolution.

43081j added 4 commits July 27, 2026 13:49
pnpm doesn't install peers by version, so we end up with one copy of
typescript even though TSESLint wants another one. This obviously causes
TSESLint to error at runtime.

The only solution seems to be to alias it for now until the day TSESLint
supports 7.x.
Conflicts messed it up.

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pnpm-workspace.yaml (1)

20-20: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Remove the stale native-preview catalog entry.

@typescript/native-preview is still declared here, but static analysis reports that no package.json uses it. This currently fails the unit-test/lint check and contradicts the intended removal.

-    '`@typescript/native-preview`': 7.0.0-dev.20260707.2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm-workspace.yaml` at line 20, Remove the stale
'`@typescript/native-preview`' entry from the workspace catalog in
pnpm-workspace.yaml, leaving all other catalog dependencies unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@pnpm-workspace.yaml`:
- Line 20: Remove the stale '`@typescript/native-preview`' entry from the
workspace catalog in pnpm-workspace.yaml, leaving all other catalog dependencies
unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a861f3ef-04f3-493e-9073-525f00390968

📥 Commits

Reviewing files that changed from the base of the PR and between cb5e956 and a69585e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • pnpm-workspace.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

Comment thread package.json
"simple-git-hooks": "catalog:dev",
"tsdown": "catalog:dev",
"typescript": "catalog:dev",
"typescript-7": "catalog:dev",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMHO, we should keep it as @typescript/native-preview, since typescript-7 is not a widely recognized name among tools such as tsdown, nx, and Next.js. As shown in https://grep.app/search?q=@typescript/native-preview, they are still using the existing name. Using a different name (such as typescript-7 or typescript7) within this repository would be fine, but I think we should follow the established convention.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it doesn't feel any better pretending one package is another. typescript is not @typescript/native-preview. aliasing it as such is flaky and relying on the hope that the two expose the same shape etc.

luckily neither has an API really so it will probably work, but it doesn't make it any better.

there is no existing convention for what we're doing here - aliasing typescript in a way that satisfies pnpm enough to not break TSESLint. you chose to alias it to @typescript/native-preview, but that isn't a convention you followed, it is just your preference.

the only convention i know of for aliasing typescript installs is that of DT:
https://github.com/microsoft/DefinitelyTyped-tools/blob/8b9e12cd2b5680c748838204995618eeb3e3b58a/packages/typescript-packages/package.json#L25-L29

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

on a side note, i don't want to bikeshed here. if you feel like we can't move on without naming this the way you want it named, let's just name it that.

i'm more interested in doing the migration than what we call it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since @antfu is also involved in this PR, I'll wait for his input.

@antfu

antfu commented Jul 28, 2026

Copy link
Copy Markdown
Member

I personally would prefer to wait a bit for the ecosystem to catch up, as in this repo we are just really a customer of TypeScript; upgrading or not doesn't really change anything other than local development (while unplugin is not a heavy project to gain the benefit for native TS a lot either). When ts7 is widely avaiable, we will start to bump for all the projects anyway.

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.