-
Notifications
You must be signed in to change notification settings - Fork 393
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
refactor: use fragments for slots in light DOM (BREAKING CHANGE) #3649
Merged
Conversation
This file contains 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
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This was referenced Aug 8, 2023
We're breaking downstreams, need salesforce/lwc-test#205 to be released first |
…gments-slots-light-dom
nolanlawson
changed the base branch from
prerelease-v4.0.0
to
milestone-v4.0.0
August 10, 2023 16:40
abdulsattar
approved these changes
Aug 14, 2023
/nucleus test |
1 similar comment
/nucleus test |
/nucleus ignore --reason 'downstream webruntime test has SSR snapshot with duplicate style that apparently this PR fixes' |
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.
Details
Same as #3308, but uses API versioning. This is still a breaking change (for off-core consumers).
Does this pull request introduce a breaking change?
Off-core consumers, or those bumping their component's metadata
apiVersion
to 60+, will see additional empty text nodes rendered in light DOM slots. This can change use cases like the following:In API versions <60, the above
this.childNodes[0]
would resolve to the first slotted element in the light DOM component.In API versions >=60, it will be an empty text node. This is due to the new system using
VFragment
s to enclose light DOM slots, which means there is an additional empty text node before and after the slot.Affected APIs are:
childNodes
firstChildNode
lastChildNode
Component authors are encouraged to use
lwc:ref
orthis.querySelector
rather than relying on the exact makeup of child nodes. Usingchildren
/firstChild
/lastChild
will also work, since text nodes are not elements (simply nodes).Additionally, Jest snapshots will change to have additional whitespace, unless you have upgraded to lwc-test v13.0.0+.
Does this pull request introduce an observable change?
See above.
GUS work item
W-13818735