From d253d9b4bd396fa98e19bba48df12be734fe6149 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Sat, 18 May 2019 16:51:29 +0200 Subject: [PATCH] fix(hydrate): shadow-dom needs shim --- .../component-hydrate/hydrate-runtime-cmp-meta.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.ts b/src/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.ts index 82c040ff6ce..9c2a7b042e8 100644 --- a/src/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.ts +++ b/src/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.ts @@ -2,6 +2,7 @@ import * as d from '../../../declarations'; import { convertValueToLiteral, createStaticGetter } from '../transform-utils'; import { formatComponentRuntimeMeta } from '../../app-core/format-component-runtime-meta'; import ts from 'typescript'; +import { CMP_FLAGS } from '@utils'; export function addHydrateRuntimeCmpMeta(classMembers: ts.ClassElement[], cmp: d.ComponentCompilerMeta) { @@ -13,6 +14,10 @@ export function addHydrateRuntimeCmpMeta(classMembers: ts.ClassElement[], cmp: d $listeners$: compactMeta[3], $attrsToReflect$: [] }; + // We always need shadow-dom shim in hydrate runtime + if (cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) { + cmpMeta.$flags$ |= CMP_FLAGS.needsShadowDomShim; + } const staticMember = createStaticGetter('cmpMeta', convertValueToLiteral(cmpMeta)); classMembers.push(staticMember); }