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
{{ message }}
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
In order to make this hydration technique as solid as possible, it is important that it doesn't rely on any execution order. One of our goals is to support client-side navigations where both the new HTML (containing wp-block tags) and the JS files associated with those blocks can come in any other, including the DOM modification first (and therefore the connectedCallback execution) and the frontend component (JS file) later. We need to make sure that hydration works even if the frontend component is registered after the connectedCallback execution.
This doesn't need to be complicated. I think that if some blockType is missing from the registry, the connectedCallback can just annotate it somehow so the registry registerBlockType() can trigger the hydration manually when it receives that blockType.
Another thing that could cause a race condition could be the JS containing registerBlockType() and the components using it, but we can figure out if we need something else for that later.
The text was updated successfully, but these errors were encountered:
luisherranz
changed the title
Make sure Frontend components are automatically hydrated even if their component is registered after the connectedCallback execution
Make sure View components are automatically hydrated even if their component is registered after the connectedCallback execution
Aug 24, 2022
In order to make this hydration technique as solid as possible, it is important that it doesn't rely on any execution order. One of our goals is to support client-side navigations where both the new HTML (containing
wp-block
tags) and the JS files associated with those blocks can come in any other, including the DOM modification first (and therefore theconnectedCallback
execution) and the frontend component (JS file) later. We need to make sure that hydration works even if the frontend component is registered after theconnectedCallback
execution.This doesn't need to be complicated. I think that if some
blockType
is missing from the registry, theconnectedCallback
can just annotate it somehow so the registryregisterBlockType()
can trigger the hydration manually when it receives thatblockType
.Something like this:
Another thing that could cause a race condition could be the JS containing
registerBlockType()
and the components using it, but we can figure out if we need something else for that later.The text was updated successfully, but these errors were encountered: