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

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@robwormald
Member

robwormald commented Jun 29, 2018

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.

@mary-poppins

This comment has been minimized.

mary-poppins commented Jun 29, 2018

@@ -23,6 +23,7 @@ export enum ViewEncapsulation {
*/
Emulated = 0,
/**
* @deprecated use {ViewEncapsulation.ShadowDom}

This comment has been minimized.

@mhevery

mhevery Jun 29, 2018

Member

@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

This comment has been minimized.

@mhevery

mhevery Jun 29, 2018

Member

need to add more tests demonstrating the full usage

This comment has been minimized.

@robwormald

robwormald Jun 29, 2018

Member

added a suite

@mary-poppins

This comment has been minimized.

mary-poppins commented Jun 29, 2018

@mary-poppins

This comment has been minimized.

mary-poppins commented Jun 29, 2018

@mary-poppins

This comment has been minimized.

mary-poppins commented Jun 29, 2018

*
* 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.

This comment has been minimized.

@mhevery

mhevery Jun 30, 2018

Member

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

This comment has been minimized.

@robwormald

This comment has been minimized.

@robwormald

robwormald Jun 30, 2018

Member

Looks kinda funky in the table, but let's go with it https://pr24718-65902db.ngbuilds.io/api/core/ViewEncapsulation

feat(core): add support for ShadowDOM v1
add a new ViewEncapsulation.ShadowDom option that uses the v1 Shadow DOM API to provide style encapsulation.
@mary-poppins

This comment has been minimized.

mary-poppins commented Jun 30, 2018

@mary-poppins

This comment has been minimized.

mary-poppins commented Jun 30, 2018

@mhevery

mhevery approved these changes Jul 2, 2018

mhevery added a commit that referenced this pull request Jul 2, 2018

feat(core): add support for ShadowDOM v1 (#24718)
add a new ViewEncapsulation.ShadowDom option that uses the v1 Shadow DOM API to provide style encapsulation.

PR Close #24718

@mhevery mhevery closed this in 3553977 Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment