Skip to content

Conversation

@johnnyreilly
Copy link
Member

@johnnyreilly johnnyreilly commented Aug 23, 2025

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 devDependency to 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.

@johnnyreilly johnnyreilly changed the title Ts 5 9 TypeScript 5.9 upgrade Aug 23, 2025
@johnnyreilly johnnyreilly changed the title TypeScript 5.9 upgrade chore: TypeScript 5.9 upgrade Aug 23, 2025
@johnnyreilly johnnyreilly merged commit ba825c2 into main Aug 24, 2025
94 checks passed
@johnnyreilly johnnyreilly deleted the ts-5-9 branch August 24, 2025 04:36
@alexander-akait
Copy link
Contributor

@johnnyreilly Yeah, webpack is now using strict mode for types, so some types need to be checked on null/undefined and in some places narrowing is required

@johnnyreilly
Copy link
Member Author

Excellent! Thanks!

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