fix(core): enforce native slots for isolated shadow dom#68691
Draft
ryan-bendel wants to merge 1 commit into
Draft
fix(core): enforce native slots for isolated shadow dom#68691ryan-bendel wants to merge 1 commit into
ryan-bendel wants to merge 1 commit into
Conversation
Contributor
Author
|
@dgp1130 - Hey 👋 - long time no speak Not sure where things currently stand with the work you were doing on updating angulars renderer, but noticed you'd merged a PR in recently (#67947) I've taken a fresh cut of the latest code and made a fresh attempt at fixing/finishing the If you could take a nosey at this draft when you get the chance? Working stackblitz: |
80aeaf5 to
b8c5dc3
Compare
ExperimentalIsolatedShadowDom is intended to keep component styles isolated to the component shadow root while leaving projected light DOM and child component styles outside of that root. Previously it still used Angular content projection and registered the shadow root with SharedStylesHost, which meant <ng-content> could be used and styles from emulated/none child components could be copied into the isolated shadow root. It was also silently downgraded during SSR. Update isolated shadow DOM rendering so it only supports native <slot> projection, keeps only the component's own styles in the shadow root preserves child/global styles in the document head, and throws during SSR. Fixes issue with native slots and HMR where on re-render, slotted content was removed and not re-added
1f0c17d to
fc20a81
Compare
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.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
ExperimentalIsolatedShadowDom is intended to keep component styles isolated to the component shadow root while leaving projected light DOM and child component styles outside of that root.
Previously it still used Angular content projection and registered the shadow root with SharedStylesHost, which meant could be used and styles from emulated/none child components could be copied into the isolated shadow root. It was also silently downgraded during SSR.
Update isolated shadow DOM rendering so it only supports native projection, keeps only the component's own styles in the shadow root preserves child/global styles in the document head, and throws during SSR.
Fixes issue with native slots and HMR where on re-render, slotted content was removed and not re-added
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
We have introduced IsolatedShadowDom as experimental, and it was only half implemented at the time (emulated child components didn't work correctly for example)