Skip to content

Re-use common JSX element transform for <>...</>#15047

Merged
nicolo-ribaudo merged 3 commits intobabel:mainfrom
nicolo-ribaudo:fragment-not-special
Dec 13, 2022
Merged

Re-use common JSX element transform for <>...</>#15047
nicolo-ribaudo merged 3 commits intobabel:mainfrom
nicolo-ribaudo:fragment-not-special

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo commented Oct 16, 2022

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Instead of duplicating the logic to transform JSX fragments and common elements, we can transform JSX fragments to <React.Fragment> elements.

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Oct 16, 2022

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

columnNumber: 11
}, this)
}, void 0, false);
}, void 0, false, void 0, void 0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid emitting these two? By default terser can not strip them because otherwise arguments length will be changed.

@nicolo-ribaudo nicolo-ribaudo merged commit ce37692 into babel:main Dec 13, 2022
@nicolo-ribaudo nicolo-ribaudo deleted the fragment-not-special branch December 13, 2022 20:43
@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 Mar 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants