r/javascript • u/DanielRosenwasser TypeScript • Mar 01 '23
Announcing TypeScript 5.0 RC
https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-rc[removed] — view removed post
69
Upvotes
r/javascript • u/DanielRosenwasser TypeScript • Mar 01 '23
[removed] — view removed post
59
u/robpalme Mar 01 '23
There's a LOT to be happy about in this release but I will mention only one feature.
IMO Andrew Branch's work on
--moduleResolution bundlermay be the most impactful here in terms of propelling ESM adoption across the ecosystem.Up until now, some people were put off using ESM in Node because they were forced to specify the file extension in
importstatements. Whereas in TypeScript 5.0 the new resolution mode allows the file extension to be omitted because TypeScript can delegate to the bundler to ensure runtime resolution works.This may seem like a trivial/aesthetic choice, but regardless it is a deal-breaker for some folk. So I'm glad TypeScript 5.0 introduces choice and unlocks the next incremental wave of migration to use standard ES modules.