Skip to content

Support JSXFragment in transform-react-constant-elements#16620

Closed
JLHwung wants to merge 4 commits intobabel:mainfrom
JLHwung:react-constant-elements-jsx-fragment
Closed

Support JSXFragment in transform-react-constant-elements#16620
JLHwung wants to merge 4 commits intobabel:mainfrom
JLHwung:react-constant-elements-jsx-fragment

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Jul 8, 2024

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

This PR is based on the @keiseiTi 's work on #16582. In this PR we also hoist the JSXFragment if possible. The hoisting logic is mostly shared with the one of JSXElement, except that we can skip handling the allowMutablePropsOnTags option.

We also add a few new test cases for other valid JSXElement's parent node types.

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories area: jsx labels Jul 8, 2024
@babel-bot
Copy link
Collaborator

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

Copy link
Member

@liuxingbaoyu liuxingbaoyu left a comment

Choose a reason for hiding this comment

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

It would be great if you could just edit the original PR next time, so that the original author will have completed the first contribution. :)

@JLHwung
Copy link
Contributor Author

JLHwung commented Jul 26, 2024

It would be great if you could just edit the original PR next time, so that the original author will have completed the first contribution. :)

Ah my bad. I will push changes to that branch.

@JLHwung JLHwung closed this Jul 26, 2024
@JLHwung JLHwung deleted the react-constant-elements-jsx-fragment branch July 27, 2024 13:47
@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 Oct 27, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: jsx outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Fragment child elements are not transformed correctly when using @babel/plugin-transform-react-constant-elements

5 participants