Skip to content

feat(core): add support for ShadowDOM v1 - #24718

Closed
robwormald wants to merge 1 commit into
angular:masterfrom
robwormald:shadow-dom-v1-2
Closed

robwormald wants to merge 1 commit into
angular:masterfrom
robwormald:shadow-dom-v1-2

Conversation

@robwormald

@robwormald robwormald commented Jun 29, 2018 •

Copy link
Copy Markdown
Contributor

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.

@robwormald
robwormald requested a review from mhevery June 29, 2018 17:32
@robwormald robwormald added the target: patch This PR is targeted for the next patch release label Jun 29, 2018
@mary-poppins

Copy link
Copy Markdown

You can preview e7dd025 at https://pr24718-e7dd025.ngbuilds.io/.

Comment thread packages/core/src/metadata/view.ts Outdated
*/
Emulated = 0,
/**
* @deprecated use {ViewEncapsulation.ShadowDom}

Copy link
Copy Markdown
Contributor

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}

declarations: [
TestCmp, SomeApp, CmpEncapsulationEmulated, CmpEncapsulationNative, CmpEncapsulationNone
TestCmp, SomeApp, CmpEncapsulationEmulated, CmpEncapsulationNative, CmpEncapsulationNone,
CmpEncapsulationNative

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a suite

@robwormald
robwormald force-pushed the shadow-dom-v1-2 branch 2 times, most recently from 73948ea to 163e6a5 Compare June 29, 2018 23:21
@mary-poppins

Copy link
Copy Markdown

You can preview 73948ea at https://pr24718-73948ea.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 163e6a5 at https://pr24718-163e6a5.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 323d332 at https://pr24718-323d332.ngbuilds.io/.

Comment thread packages/core/src/metadata/view.ts Outdated

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Copy Markdown
Contributor Author

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

@robwormald
robwormald force-pushed the shadow-dom-v1-2 branch 2 times, most recently from 0d87aff to 65902db Compare June 30, 2018 17:40
add a new ViewEncapsulation.ShadowDom option that uses the v1 Shadow DOM API to provide style encapsulation.
@mary-poppins

Copy link
Copy Markdown

You can preview 65902db at https://pr24718-65902db.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview afe3494 at https://pr24718-afe3494.ngbuilds.io/.

@mhevery mhevery added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note action: merge The PR is ready for merge by the caretaker and removed merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Jul 2, 2018
mhevery pushed a commit that referenced this pull request Jul 2, 2018
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
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes freq1: low target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Shadow DOM V1

5 participants