Conversation
🦋 Changeset detectedLatest commit: 7db338d The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Member
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ref #3055
Merge adjacent fully static DOM elements in a JSX fragment into a single template.
Previously:
created and cloned two independent templates. It now compiles to a single multi-root template:
Implementation
Detect maximal runs of adjacent, fully static DOM roots during fragment lowering.
Combine those roots into one template while explicitly closing every non-void root.
Preserve the external fragment shape by returning the cloned roots as a Node[].
Add bit 4 to the internal template() flag:
Flags remain composable, so 5 represents a multi-root template that requires importNode.
Keep the existing single-root cloning path unchanged and select the cloning strategy when the factory is created rather than branching for every clone.
Implement the same lowering in both the Babel plugin and the native Oxc compiler.
Support both generate: "dom" and generate: "dynamic" when the selected renderer is DOM.
The optimization is deliberately limited to safe static runs. Expressions, components, meaningful text, dynamic attributes, effects, refs, spreads, and wrapped SVG/MathML partials break the group. Hydratable
output is unchanged.
Added coverage for:
How did you test this change?