Create googlesitekit-data
variant for use in Site Kit's Gutenberg blocks
#10483
Labels
Next Up
Issues to prioritize for definition
P1
Medium priority
Type: Enhancement
Improvement of an existing feature
Feature Description
We should create a variant of
googlesitekit-data
for use in Site Kit's Gutenberg blocks. This will be a subset of thegooglesitekit-data
store which uses the external@wordpress/data
package (this is mapped to@wordpress-core/data
in our block builds).The primary driver of this update is to enable the use of
useSelect()
in Site Kit's blocks. We currently have a workaround in place for existing blocks, but it's not a long-term solution.Notes:
@wordpress/data 4.27.3
to fix a bug which is present until version9.0.0
. Version9.0.0
of@wordpress/data
was published with Gutenberg version15.5.0
. Therefore, we need to wait until Site Kit's minimum version of WordPress is6.4
or above before we can reliably use Site Kit's selectors in blocks viauseSelect()
in the same way that we do in the rest of Site Kit.useSelect()
before this, but only when we can ensure that the bug doesn't have any impact on the functionality of the block. This means being aware that stores which are not selected in the first render will not be subscribed to, and so will not trigger a re-render when their data changes. See Update @wordpress/data to version 4.27.3 #6356 (comment) for more details.5.9
if we want to use selectors which callresolveSelect()
, as this is__experimentalResolveSelect()
until@wordpress/data
version4.27.0
, which was published with Gutenberg10.3.0
.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Test Coverage
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: