You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: No matter what, there will be some observable difference if a synthetic-lifecycle component is slotted into a native-lifecycle component.
As demonstrated by #4248, we have some issues where we have incorrect behavior when a synthetic lifecycle component is slotted into a native lifecycle component. In particular, its disconnectedCallback may be invoked without a corresponding connectedCallback (for a true case of disconnect+reconnect).
We can fix these bugs, but I think there will still be cases where we can't perfectly emulate the old pure-synthetic-lifecycle behavior for synthetic-lifecycle components in a mixed context. For example:
In this case, a synthetic-lifecycle component is being slotted into a native-lifecycle component. However, the outer component is changing its state within its renderedCallback, which affects how the inner component is mounted/unmounted. (I used renderedCallback, but I could have also used disconnectedCallback/connectedCallback.)
The point is that the outer component has changed the timing of its state changes due to native lifecycle. Necessarily, the inner component will be unmounted/mounted based on the native timing, not the synthetic timing it expects. For example, the outer component could be inside of a list which is re-sorted, triggering a disconnect+reconnect, which the inner component may not be expecting.
So no matter what, there will be some observable difference if a synthetic-lifecycle component is slotted into a native-lifecycle component.
The text was updated successfully, but these errors were encountered:
TL;DR: No matter what, there will be some observable difference if a synthetic-lifecycle component is slotted into a native-lifecycle component.
As demonstrated by #4248, we have some issues where we have incorrect behavior when a synthetic lifecycle component is slotted into a native lifecycle component. In particular, its
disconnectedCallback
may be invoked without a correspondingconnectedCallback
(for a true case of disconnect+reconnect).We can fix these bugs, but I think there will still be cases where we can't perfectly emulate the old pure-synthetic-lifecycle behavior for synthetic-lifecycle components in a mixed context. For example:
In this case, a synthetic-lifecycle component is being slotted into a native-lifecycle component. However, the outer component is changing its state within its
renderedCallback
, which affects how the inner component is mounted/unmounted. (I usedrenderedCallback
, but I could have also useddisconnectedCallback
/connectedCallback
.)The point is that the outer component has changed the timing of its state changes due to native lifecycle. Necessarily, the inner component will be unmounted/mounted based on the native timing, not the synthetic timing it expects. For example, the outer component could be inside of a list which is re-sorted, triggering a disconnect+reconnect, which the inner component may not be expecting.
So no matter what, there will be some observable difference if a synthetic-lifecycle component is slotted into a native-lifecycle component.
The text was updated successfully, but these errors were encountered: