chore: TypeScript 5.9 upgrade #1676
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First code change in ts-loader for a long time, this was caused due to compilation issues with TS 5.9 and the version of webpack being used in the ts-loader repo.
This is probably the underlying cause in TS 5.9: https://devblogs.microsoft.com/typescript/announcing-typescript-5-9/#notable-behavioral-changes
I think that this lead to changes in the webpack types (certainly the existing types did not compile with TS 5.9 anymore). webpack 5 seems to have been upgraded, and I suspect it's @alexander-akait's pull request: webpack/webpack#19777 that lead to the change which allowed ts-loader to fix the 5.9 related issues.
Upgrading the
devDependencyto the latest webpack@5 in ts-loader and recompiling surfaced different issues in the ts-loader codebase, likely linked to types getting tighter in webpack. The changes have been catered for in ts-loader, mostly this takes the form of more exhaustive null checks / type narrowing shenanigans.The comparison testpack had to be regenerated entirely to align with the newer version of webpack 5.
Other changes
This PR also drops testing against 4.x versions of TypeScript.