Repository navigation
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 |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fs callbacks Each compiled file's content is now added as a persistent fileSystem layer on the instance snapshot (sent in the same request as any openFiles for it), replacing the readFile/fileExists callbacks and runWithTemporaryFileUpdate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- install typescript@beta rather than next - list projectReferences among the accepted-but-inert options - correct errorFormatter's colors type Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
useCaseSensitiveFileNames now defaults to probing the volume the tsconfig.json is on (as tsc does, and as v9 did via ts.sys) instead of assuming case-sensitive on every non-Windows platform, and the resolved value is passed to the TypeScript API so both agree on which paths are the same file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d8b541b to
141bc0f
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed assertion thrown from webpack's watch callback left the watcher open, so mocha never exited; the harness now closes it and fails the test. A patch file named <file>.__deleted__ now deletes <file> when applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- compare paths canonically (via resolvedFilePathCache) when finding a changed file's dependants: the API echoes back the casing it was given, so on a case-insensitive filesystem exact-string comparison found none - treat a modified file the program didn't previously contain as created: clear directImportsCache (other files' imports may now resolve) and tell the API it was created - merge, rather than overwrite, unconsumed watcher changes, so a rebuild that compiles nothing (e.g. a pure deletion) doesn't lose them Adds the deletedFileWatch comparison test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ts-loader passed its canonical (lowercased, when case-insensitive) paths to the API, which echoes back whatever casing it is given - so on Windows, and on macOS since case sensitivity is detected, TypeScript's messages showed lowercased paths. The canonical form is now only used for ts-loader's own cache keys; openProjects, openFiles and file notifications get real-cased paths. The comparison test harness no longer forces useCaseSensitiveFileNames: true, so the default is tested on every OS; snapshots change only in the options-derived instance hash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sending removePrograms in the same snapshot update as createPrograms crashes tsgo 7.1.0-beta (nil dereference in ProjectCollectionBuilder.HandleAPIRequest), so any project with more than 20 orphan files killed the compiler process once the synthetic-program cap started evicting. Adds manyOrphanFiles (25 orphan files) as a regression test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Files outside the configured project each got their own synthetic program (capped at 20, least-recently-used evicted), each a near-complete copy of the project - so a tsconfig whose files list only a .d.ts (every module an orphan) rebuilt programs constantly: 8.1s vs 0.6s for the same 300-file fixture with an include glob. They now share one program, as classic ts-loader's single language service did, whose extra roots are only the orphan files it doesn't already contain via an import. Being a superset of the primary project, it also gives the transitive- dependant recheck the full import graph, so dependants of a changed orphan file are rechecked again (a regression from classic). Adds an all-orphan-files variant of the benchmark fixture with cold and hub-touch typeCheck scenarios: -92% and -95% vs the previous commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every module is an orphan (the tsconfig lists only a .d.ts); changing an imported file's type must still be reported in the unchanged importer, which only the transitive-dependant recheck catches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clarified the status of unsupported features in the CHANGELOG.
Removed sections on upgrading to v10 and Yarn Plug’n’Play from the README.
- set version to 10.0.0-beta.0 - restrict typescript peer dependency to >=7.1.0-beta - add a files allowlist so only built output is published - document installing the beta via the next dist-tag Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Here's what Codex had to say (feel free to ignore):
|
- type-check project files webpack doesn't bundle (all on the first build, then the ones webpack's watcher reports changed), and watch them so edits trigger a rebuild - matching v9 without onlyCompileBundledFiles - drop stored diagnostics and declaration files for files that are no longer in the program or a webpack module, e.g. deleted files - comparison-test harness records diagnostics-only rebuilds (same hash) - update fixture .d.ts files to valid TS 7 syntax Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dependency tracking and the transitive-dependant recheck only followed relative specifiers, resolved by hand, so a change reached through a tsconfig paths alias (or baseUrl, package exports, ...) left stale diagnostics. Resolve every import via the program's getResolvedModuleFromModuleSpecifier instead, batched into one round trip per pass, skipping unresolved and external-library imports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @acutmore - all three were real, and reproduced. Fixed in:
Turning on the unbundled check also surfaced real TS 7 errors (TS1540 Agree with the architectural direction - leaning on the native |
|
okay I think we're ready to ship a beta - I'll merge this into a |
Copilot didn't write this - I did! The below can also be found in the CHANGELOG.md.
This is a ground-up rewrite of ts-loader's compilation engine. Instead of driving TypeScript's classic
LanguageService/Program/ watch APIs, ts-loader now compiles exclusively through TypeScript's new nativetypescript/syncAPI (the tsgo-powered engine) - the legacy compiler API integration has been removed entirely.Not supported yet
getCustomTransformers,resolveModuleNameandresolveTypeReferenceDirectiveare still accepted for backwards compatibility but are now inert - the native API doesn't expose equivalent extension points, so custom transformers and custom module/type-reference resolution are no longer applied. It is possible that the API will support these in future, and so the options have been left in place for now, but they will be removed if the API never exposes them.tsconfig.jsonare followed by the native API. TheprojectReferencesloader option is accepted but has no effect, and v10 doesn't build referenced projects to disk the waytsc --builddoes.Breaking changes:
typescript@beta) or later.compileroption must now resolve to a package exposing a<compiler>/syncentry point (the TypeScript native API). Drop-in classic-API compilers (e.g.ttypescript) are no longer supported.compilerOptionsloader option; the native API resolves a project's compiler options purely from its on-disk tsconfig.json, with no per-loader-instance override hook. Set compiler options intsconfig.jsoninstead.contextloader option; the native API always resolves relative paths against the config file's own directory, with no basePath override exposed to let a tsconfig live outside the project root.happyPackModeloader option - HappyPack / thread-loader based parallelisation is no longer supported this way.experimentalFileCachingloader option; there's no equivalent under the native API's own caching model.experimentalWatchApiloader option, now that the native API supersedes TypeScript's classic watch API.onlyCompileBundledFilesloader option; the native API always resolves a project's own root files and offers no hook to restrict them to what webpack actually bundles.logInfoToStdOut. SetlogInfoToStdOut: trueto keep them on stdout.errorFormatter'scolorsargument is now a smallpicocolors-backed helper object instead of achalkinstance;chalkhas been dropped as a runtime dependency in favour ofpicocolors.