fix(compiler-sfc): support TypeScript 7 - #15085
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe PR adds TypeScript module selection with a TypeScript 6 compatibility fallback, updates compiler registration and diagnostics, and introduces a TypeScript 7 declaration test configuration and test command. ChangesTypeScript loading compatibility
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant register_ts as register-ts.js
participant load_ts as load-ts.js
participant node_require as require
register_ts->>load_ts: loadTS(require)
load_ts->>node_require: load("typescript")
alt Compatible TypeScript
node_require-->>load_ts: TypeScript module
else TypeScript 7 or missing module
load_ts->>node_require: load("`@typescript/typescript6`")
node_require-->>load_ts: Compatibility module
end
load_ts-->>register_ts: Selected TypeScript module
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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. Comment |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
|
/ecosystem-ci run |
|
Thanks for the contribution! Since TypeScript 7 does not currently expose the classic compiler APIs that compiler-sfc relies on, this still requires users to install @typescript/typescript6. I think it may be better to wait until TypeScript 7 provides a stable programmatic API before adding proper support. |
|
📝 Ran ecosystem CI: Open
|
|
yeah that's why I added it as optional peerDep. Looks like TS7.1 will come with an API and there's no timeline for it so far. |
What
registerTSdeclaration@typescript/typescript6when TypeScript 7 has no classic APIWhy
TypeScript 7's root export only provides version metadata, while compiler-sfc still needs the classic compiler API for imported type resolution. The fallback follows the official TypeScript 7 migration guidance without installing a second compiler for users who do not need it.
Verification
pnpm test-unit --runpnpm test-dtspnpm checkSummary by CodeRabbit
New Features
Bug Fixes
Tests