Skip to content

Commit 6213cbf

Browse files
JeanMecheAndrewKushnir
authored andcommitted
refactor(core): rename ExperimentalIsolatedShadowDom to IsolatedShadowDom
This API is still experimental (cherry picked from commit 21ca49c)
1 parent 5e86299 commit 6213cbf

11 files changed

Lines changed: 12 additions & 15 deletions

File tree

goldens/public-api/core/index.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ export abstract class ViewContainerRef {
20142014
// @public
20152015
export enum ViewEncapsulation {
20162016
Emulated = 0,
2017-
IsolatedShadowDom = 4,
2017+
ExperimentalIsolatedShadowDom = 4,
20182018
None = 2,
20192019
ShadowDom = 3
20202020
}

packages/compiler-cli/src/ngtsc/annotations/component/src/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ export class ComponentDecoratorHandler
890890

891891
if (
892892
(encapsulation === ViewEncapsulation.ShadowDom ||
893-
encapsulation === ViewEncapsulation.IsolatedShadowDom) &&
893+
encapsulation === ViewEncapsulation.ExperimentalIsolatedShadowDom) &&
894894
metadata.selector !== null
895895
) {
896896
const selectorError = checkCustomElementSelectorForErrors(metadata.selector);

packages/compiler/src/compiler_facade_interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export enum ViewEncapsulation {
346346
// Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
347347
None = 2,
348348
ShadowDom = 3,
349-
IsolatedShadowDom = 4,
349+
ExperimentalIsolatedShadowDom = 4,
350350
}
351351

352352
export type ChangeDetectionStrategy = number;

packages/compiler/src/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export enum ViewEncapsulation {
2323
// Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
2424
None = 2,
2525
ShadowDom = 3,
26-
IsolatedShadowDom = 4,
26+
ExperimentalIsolatedShadowDom = 4,
2727
}
2828

2929
export enum ChangeDetectionStrategy {

packages/core/src/compiler/compiler_facade_interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export enum ViewEncapsulation {
346346
// Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
347347
None = 2,
348348
ShadowDom = 3,
349-
IsolatedShadowDom = 4,
349+
ExperimentalIsolatedShadowDom = 4,
350350
}
351351

352352
export type ChangeDetectionStrategy = number;

packages/core/src/hydration/annotate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ function componentUsesShadowDomEncapsulation(lView: LView): boolean {
798798
const def = getComponentDef(instance.constructor);
799799
return (
800800
def?.encapsulation === ViewEncapsulation.ShadowDom ||
801-
def?.encapsulation === ViewEncapsulation.IsolatedShadowDom
801+
def?.encapsulation === ViewEncapsulation.ExperimentalIsolatedShadowDom
802802
);
803803
}
804804

packages/core/src/metadata/view.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
* @publicApi
2121
*/
2222
export enum ViewEncapsulation {
23-
// TODO: consider making `ViewEncapsulation` a `const enum` instead. See
24-
// https://github.com/angular/angular/issues/44119 for additional information.
25-
2623
/**
2724
* Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the
2825
* component's host element and applying the same attribute to all the CSS selectors provided
@@ -54,5 +51,5 @@ export enum ViewEncapsulation {
5451
*
5552
* @experimental 21.0
5653
*/
57-
IsolatedShadowDom = 4,
54+
ExperimentalIsolatedShadowDom = 4,
5855
}

packages/core/src/render3/hmr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function recreateLView(
247247
// with the clone and use it for the newly-created LView.
248248
if (
249249
oldDef.encapsulation === ViewEncapsulation.ShadowDom ||
250-
oldDef.encapsulation === ViewEncapsulation.IsolatedShadowDom
250+
oldDef.encapsulation === ViewEncapsulation.ExperimentalIsolatedShadowDom
251251
) {
252252
const newHost = host.cloneNode(false) as HTMLElement;
253253
host.replaceWith(newHost);

packages/core/src/render3/instructions/shared.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export function locateHostElement(
180180
const preserveContent =
181181
preserveHostContent ||
182182
encapsulation === ViewEncapsulation.ShadowDom ||
183-
encapsulation === ViewEncapsulation.IsolatedShadowDom;
183+
encapsulation === ViewEncapsulation.ExperimentalIsolatedShadowDom;
184184
const rootElement = renderer.selectRootElement(elementOrSelector, preserveContent);
185185
applyRootElementTransform(rootElement as HTMLElement);
186186
return rootElement;

packages/platform-browser/src/dom/dom_renderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export class DomRendererFactory2 implements RendererFactory2, OnDestroy {
167167
typeof ngServerMode !== 'undefined' &&
168168
ngServerMode &&
169169
(type.encapsulation === ViewEncapsulation.ShadowDom ||
170-
type.encapsulation === ViewEncapsulation.IsolatedShadowDom)
170+
type.encapsulation === ViewEncapsulation.ExperimentalIsolatedShadowDom)
171171
) {
172172
// Domino does not support shadow DOM.
173173
type = {...type, encapsulation: ViewEncapsulation.Emulated};
@@ -224,7 +224,7 @@ export class DomRendererFactory2 implements RendererFactory2, OnDestroy {
224224
tracingService,
225225
sharedStylesHost,
226226
);
227-
case ViewEncapsulation.IsolatedShadowDom:
227+
case ViewEncapsulation.ExperimentalIsolatedShadowDom:
228228
return new ShadowDomRenderer(
229229
eventManager,
230230
element,

0 commit comments

Comments
 (0)