Skip to content
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

[babel 8] Better file ext handling for TS and Flow presets #14955

Merged
merged 8 commits into from Mar 29, 2023

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Sep 20, 2022

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#2773
Any Dependency Changes?
License MIT

This PR moves #11316 from babel-8-dev to main. The first commit is #14954, please ignore it when reviewing this PR.

It provides a better configuration experience when using Flow, TypeScript or JSX. The two main changes are that the plugins/presets don't opaquely disable other plugins, and that a filename isn't required anymore. I also changed the options they take regarding file names:

  • When using the TS preset, the filename is not required anymore
  • When both the TS and Flow plugins are enabled on the same file, an error is thrown rather then giving the precedence to TS
  • The TypeScript plugin doesn't disable JSX anymore
  • By default, the Flow preset only enables the plugin when applied to a non-ts file
  • The .isTSX option has been removed from the TS pluginsand preset, since users can directly enable the JSX plugin.
  • The .allExtensions option has been removed from the TS plugin, since it was used to replace the extension test with the removed .isTSX option
  • A new option, .ignoreExtensions, has been added to both the TS and Flow plugins, to make it possible to run them on JS and TS files respectively

@babel-bot
Copy link
Collaborator

babel-bot commented Sep 20, 2022

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/54177/

@nicolo-ribaudo nicolo-ribaudo mentioned this pull request Sep 20, 2022
34 tasks
@nicolo-ribaudo nicolo-ribaudo force-pushed the move-11316-to-main branch 4 times, most recently from 29ece64 to 3084c3f Compare September 21, 2022 15:37
@nicolo-ribaudo
Copy link
Member Author

Merging with a single approval since this is just a backport of an already approved and merged PR.

@nicolo-ribaudo nicolo-ribaudo changed the title [babel 8] Better file extension handling for TS and Flow presets [babel 8] Better file ext handling for TS and Flow presets Mar 29, 2023
@nicolo-ribaudo nicolo-ribaudo merged commit fe7c9a0 into babel:main Mar 29, 2023
54 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the move-11316-to-main branch March 29, 2023 11:24
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2023
@JLHwung JLHwung added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release and removed babel 8 labels Aug 9, 2023
@JLHwung JLHwung added this to the v8.0.0 milestone Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: config area: flow area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants