Support TypeScript 7.1 API - #1704
Conversation
|
@copilot update ts-loader/.github/workflows/push.yml Line 52 in 53082fb ts-loader/.github/workflows/push.yml Line 84 in 53082fb We expect execution-tests to pass after this change |
Updated in |
|
@copilot great work! We would like the following to succeed:
Remember backwards compatibility is not required - feel free to make changes |
Verified on |
|
@copilot we have explictly removed the historic typescript version from dependencies and moved to use 7.1 directly. This has broken compilation. Please fix it. You will likely need to use new APIs in TypeScript 7 to achieve this. No cheating. |
Updated in |
|
@copilot make |
Addressed in |
Comment out the DIAGNOSTIC_CODE_FILE_NOT_FOUND constant.
|
TypeScript ESLint cannot pass for now - see typescript-eslint/typescript-eslint#10940 |
program.getSourceFileNames()/getConfigFileNames() and related lookups return the TypeScript API's forward-slash-normalized paths, but several call sites handed those straight to Node's OS-native `path` functions or to webpack's addDependency/addBuildDependency (which reject non-native absolute paths on Windows). This surfaced as a cluster of Windows-only comparison-test failures with no macOS/Linux equivalent: - getDirectResolvedImports/resolveRelativeSpecifier: dependant-recheck lookups failing (dependencyErrors) - findTransitiveDependants: multi-hop BFS matching failing (simpleDependency) - ensureSyntheticConfigForFile: synthetic project config content keyed under the wrong path, degrading emit for any file compiled via the synthetic single-file project fallback (basic, externals) - registerTypeScriptDependencies: two addDependency/addBuildDependency call sites passed a forward-slash path straight to webpack (externals) - createTypeScriptApiInstance: missing fileExists override for purely synthetic identities like component.vue.ts under appendTsSuffixTo (appendSuffixTo) Also: normalizes platform-dependent path depth embedded in TS18003/ TS5055/TS6059 compiler diagnostic messages in the comparison-test harness (same compiler behaviour on both platforms, just displayed relative to a different reference point), adds an on-demand windows-test-probe.yml workflow for fast, targeted Windows CI iteration, and reduces the test retry count. Verified against real Windows CI: all 50 comparison-test suites pass.
d040428 to
d508d26
Compare
…ub.com/TypeStrong/ts-loader into copilot/implement-new-tsgo-api-support
…by testing Isolated and reverted each individually against real Windows CI (full suite where the change had broad reach, targeted tests otherwise) - all three passed without the change, confirming they were never load-bearing: - bumpMtimes in the comparison-test harness: added chasing a watchpack mtime-equality theory for dependencyErrors that turned out wrong; the actual fix was in getDirectResolvedImports (already in place). - ensureSyntheticConfigForFile's files-array path normalization: added before the real fix (syntheticConfigContents' store-side key normalization, which remains); the API evidently normalizes each files-array entry internally regardless of separator style. - registerTypeScriptDependencies' getConfigFileNames loop normalization: added speculatively alongside the confirmed addDependency fix in the same edit; never independently exercised by any actual failure. Full local suite (50/50) and full Windows CI suite (50/50) still pass with all three removed.
This PR migrates ts-loader to fully support and integrate with the TypeScript 7.1+ Native API (powered by the tsgo engine). Ignore the ESLint failures - TypeScript ESLint also doesn't yet support TS 7. It'll come!
The implementation has moved past the initial hybrid/experimental design to route core operations through the native typescript/unstable/sync architecture by default. Historical TypeScript version dependencies have been removed in favour of direct 7.1 alignment.
🚀 What Changed
📦 Integration Details
🧪 Verification Status