Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create googlesitekit-data variant for use in Site Kit's Gutenberg blocks #10483

Open
1 task
techanvil opened this issue Mar 19, 2025 · 0 comments
Open
1 task
Labels
Next Up Issues to prioritize for definition P1 Medium priority Type: Enhancement Improvement of an existing feature

Comments

@techanvil
Copy link
Collaborator

techanvil commented Mar 19, 2025

Feature Description

We should create a variant of googlesitekit-data for use in Site Kit's Gutenberg blocks. This will be a subset of the googlesitekit-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:

  • We currently patch @wordpress/data 4.27.3 to fix a bug which is present until version 9.0.0. Version 9.0.0 of @wordpress/data was published with Gutenberg version 15.5.0. Therefore, we need to wait until Site Kit's minimum version of WordPress is 6.4 or above before we can reliably use Site Kit's selectors in blocks via useSelect() in the same way that we do in the rest of Site Kit.
  • However, we can still make use of 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.
  • Either way, we still need to wait until Site Kit's minimum version of WordPress is 5.9 if we want to use selectors which call resolveSelect(), as this is __experimentalResolveSelect() until @wordpress/data version 4.27.0, which was published with Gutenberg 10.3.0.
  • See also: discussion on the block issues document.

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

@techanvil techanvil added P1 Medium priority Type: Enhancement Improvement of an existing feature labels Mar 19, 2025
@binnieshah binnieshah added the Next Up Issues to prioritize for definition label Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Next Up Issues to prioritize for definition P1 Medium priority Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants