From 0bd01ca64aa65f29ef651117efbc1015a4baf441 Mon Sep 17 00:00:00 2001 From: dario-piotrowicz Date: Sat, 6 Nov 2021 16:57:20 +0000 Subject: [PATCH] refactor(core): move outdated comment to view.ts (#44099) remove the comment suggesting to use a const enum for ViewEncapsulation in the renderer3/definitions.ts file and add a similar comment in the view.ts file in which the enum is defined Note: the new comment does not contain the suggestion of changing `None` to `0` as it is unclear what benefits that would bring (for more info see: https://github.com/angular/angular/pull/44099#discussion_r744157686) PR Close #44099 --- packages/core/src/metadata/view.ts | 3 +++ packages/core/src/render3/definition.ts | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/src/metadata/view.ts b/packages/core/src/metadata/view.ts index cdf97234fe0..5cc72c69662 100644 --- a/packages/core/src/metadata/view.ts +++ b/packages/core/src/metadata/view.ts @@ -19,6 +19,9 @@ * @publicApi */ export enum ViewEncapsulation { + // TODO: consider making `ViewEncapsulation` a `const enum` instead. See + // https://github.com/angular/angular/issues/44119 for additional information. + /** * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host * Element and pre-processing the style rules provided via {@link Component#styles styles} or diff --git a/packages/core/src/render3/definition.ts b/packages/core/src/render3/definition.ts index 30eb02df44d..f3f336b6057 100644 --- a/packages/core/src/render3/definition.ts +++ b/packages/core/src/render3/definition.ts @@ -315,8 +315,6 @@ export function ɵɵdefineComponent(componentDefinition: { viewQuery: componentDefinition.viewQuery || null, features: componentDefinition.features as DirectiveDefFeature[] || null, data: componentDefinition.data || {}, - // TODO(misko): convert ViewEncapsulation into const enum so that it can be used - // directly in the next line. Also `None` should be 0 not 2. encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated, id: 'c', styles: componentDefinition.styles || EMPTY_ARRAY,