Skip to content

Commit

Permalink
fix(hydrate): shadow-dom needs shim
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed May 18, 2019
1 parent c01c049 commit d253d9b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}

0 comments on commit d253d9b

Please sign in to comment.