Skip to content

Commit

Permalink
fix(): back-compatibility with old stencil runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Jun 27, 2019
1 parent 91fb61d commit 10a5704
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime/connected-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const connectedCallback = (elm: d.HostElement, cmpMeta: d.ComponentRuntim
while ((ancestorComponent = (ancestorComponent.parentNode as any || ancestorComponent.host as any))) {
// climb up the ancestors looking for the first
// component that hasn't finished its lifecycle update yet
if ((BUILD.hydrateClientSide && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute('s-id')) || (ancestorComponent['s-init'] && !ancestorComponent['s-lr'])) {
if ((BUILD.hydrateClientSide && ancestorComponent.nodeType === NODE_TYPE.ElementNode && ancestorComponent.hasAttribute('s-id')) || (ancestorComponent['s-init'] && ancestorComponent['s-lr'] === false)) {
// we found this components first ancestor component
// keep a reference to this component's ancestor component
hostRef.$ancestorComponent$ = ancestorComponent;
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/initialize-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const initializeComponent = async (elm: d.HostElement, hostRef: d.HostRef

// we've successfully created a lazy instance
const ancestorComponent = hostRef.$ancestorComponent$;
if (BUILD.lifecycle && BUILD.lazyLoad && ancestorComponent && !ancestorComponent['s-lr'] && ancestorComponent['s-rc']) {
if (BUILD.lifecycle && BUILD.lazyLoad && ancestorComponent && ancestorComponent['s-lr'] === false && ancestorComponent['s-rc']) {
// this is the intial load and this component it has an ancestor component
// but the ancestor component has NOT fired its will update lifecycle yet
// so let's just cool our jets and wait for the ancestor to continue first
Expand Down

0 comments on commit 10a5704

Please sign in to comment.