-
Couldn't load subscription status.
- Fork 13.1k
Deprecate --module amd, umd, system, none; --moduleResolution classic; change defaults
#62669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate --module amd, umd, system, none; --moduleResolution classic; change defaults
#62669
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR deprecates several legacy module formats (amd, umd, system, none) and the classic module resolution strategy, while changing the default moduleResolution for ES module formats from classic to bundler. These deprecated options will stop functioning in TypeScript 7.0.
Key Changes
- Deprecated
--moduleoptions:amd,umd,system, andnone - Deprecated
--moduleResolution classic - Changed default
moduleResolutionfor ES module series fromclassictobundler - Updated test baselines to reflect new deprecation warnings and changed module resolution behavior
Reviewed Changes
Copilot reviewed 299 out of 1932 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
Multiple *.errors.txt files |
Added deprecation warnings for deprecated module formats and classic resolution |
Multiple *.js baseline files |
Removed AMD/UMD/System wrapper code, showing CommonJS output instead |
Multiple *.types baseline files |
Updated type information reflecting bundler resolution |
Multiple *.symbols baseline files |
Updated import paths from bare specifiers to relative paths |
| Config baseline files | Updated error messages to remove deprecated options from valid choices |
|
Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page. Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up. |
|
@typescript-bot user test this |
|
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
|
@jakebailey Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Everything looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🫡
|
I am going to go ahead and port this into tsgo-port since none of these things are implemented in Corsa anyway. It should light up a bunch of new tests and make other diffs go away. @typescript-bot cherry-pick into tsgo-port |
|
@jakebailey Here are the results of running the top 800 repos with tsc comparing Something interesting changed - please have a look. Details
|
|
Hey, @andrewbranch! I was unable to cherry-pick this PR. Check the logs at: https://github.com/microsoft/TypeScript/actions/runs/18793106856 |
|
Interesting; I'll try to see what Azure Data Studio and VS Code are trying to do with |
…n classic`; change defaults (microsoft#62669)
This leaves the
moduledefault as-is for now, but changes the computedmoduleResolutiondefault for theesseries to bebundler. Deprecatedmodulemodes still default toclassic.I went through compiler tests and fourslash tests and changed them to use non-deprecated options if they weren’t intending to test the newly deprecated options. That will allow them to come into typescript-go for better coverage.
Closes #62199
Closes #62206