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
feat(core): add support for ShadowDOM v1 #24718
Conversation
You can preview e7dd025 at https://pr24718-e7dd025.ngbuilds.io/. |
packages/core/src/metadata/view.ts
Outdated
@@ -23,6 +23,7 @@ export enum ViewEncapsulation { | |||
*/ | |||
Emulated = 0, | |||
/** | |||
* @deprecated use {ViewEncapsulation.ShadowDom} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deprecated v4.0.0 - use {ViewENcapsulation.ShadowDom}
@@ -20,7 +20,8 @@ import {NAMESPACE_URIS} from '../../src/dom/dom_renderer'; | |||
beforeEach(() => { | |||
TestBed.configureTestingModule({ | |||
declarations: [ | |||
TestCmp, SomeApp, CmpEncapsulationEmulated, CmpEncapsulationNative, CmpEncapsulationNone | |||
TestCmp, SomeApp, CmpEncapsulationEmulated, CmpEncapsulationNative, CmpEncapsulationNone, | |||
CmpEncapsulationNative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to add more tests demonstrating the full usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a suite
73948ea
to
163e6a5
Compare
You can preview 73948ea at https://pr24718-73948ea.ngbuilds.io/. |
You can preview 163e6a5 at https://pr24718-163e6a5.ngbuilds.io/. |
163e6a5
to
323d332
Compare
You can preview 323d332 at https://pr24718-323d332.ngbuilds.io/. |
* | ||
* For the DOM this means using modern [Shadow | ||
* DOM](https://w3c.github.io/webcomponents/spec/shadow/) and | ||
* creating a ShadowRoot for Component's Host Element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to make sure that all new documentation is up to new standard. Can you add example of how to use it. Here is an example of how to add an example https://github.com/angular/angular/blob/master/packages/core/src/application_ref.ts#L461
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks kinda funky in the table, but let's go with it https://pr24718-65902db.ngbuilds.io/api/core/ViewEncapsulation
0d87aff
to
65902db
Compare
add a new ViewEncapsulation.ShadowDom option that uses the v1 Shadow DOM API to provide style encapsulation.
65902db
to
afe3494
Compare
You can preview 65902db at https://pr24718-65902db.ngbuilds.io/. |
You can preview afe3494 at https://pr24718-afe3494.ngbuilds.io/. |
add a new ViewEncapsulation.ShadowDom option that uses the v1 Shadow DOM API to provide style encapsulation. PR Close #24718
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Partially resolves #23636 - it adds a new ViewEncapsulation option which uses the modern Shadow DOM API - .attachShadow({ mode: 'open' })
This should allow Angular Elements to be used in combination with
<slot>
elements for basic native content projection.ViewEncapsulation.Shadow is added as a new API, rather than changing the behavior of the ViewEncapsulation.Native option, which could lead to unexpected results for developers currently using the v0 API.
This should (eventually?) deprecate the ViewEncapsulation.Native option.