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

Update @wordpress/data to version 4.27.3 using patch-package #8826

Closed
14 tasks
kuasha420 opened this issue Jun 6, 2024 · 6 comments
Closed
14 tasks

Update @wordpress/data to version 4.27.3 using patch-package #8826

kuasha420 opened this issue Jun 6, 2024 · 6 comments
Labels
javascript Pull requests that update Javascript code P0 High priority Team M Issues for Squad 2 Type: Infrastructure Engineering infrastructure & tooling

Comments

@kuasha420
Copy link
Contributor

kuasha420 commented Jun 6, 2024

Feature Description

Following on from the update to @wordpress/data 4.23.0 in #1769, we should update to version 4.27.3. This is the latest version that supports (via @wordpress/element) React 16.

Based on the learning from #6356 and recent hackathon exploration and its output branch here, we will use patch package to mitigate the bug discovered while working on the aforementioned issue.

This is a temporary solution until we are able to upgrade to v9.0.0 or later version of @wordpress/data in which version, the bug has been officially fixed! See this PR.

For patch-package, see the note about CI and caching here. Note that, our workflows does not cache node_module but the global package cache instead, so changes in patches folder should not require any changes for caching mechanism, just noting for completeness.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • @wordpress/data should be updated to version 4.27.3, and necessary patches should be applied using patch-package to mitigate the discovered bug.
  • No JavaScript errors and no new warnings should be triggered when visiting any Site Kit pages and Widgets (Dashboard, Settings, WP Dashboard, Adminbar widgets etc).
  • All JavaScript unit tests and E2E tests should continue to pass and no regression should be introduced.

Implementation Brief

Note for IB author: the hackathon branch can be used for a starting point while drafting the IB and/or implementing the issue in Execution.

  • In package.json:
    • Update @wordpress/data to 4.27.3.
      • Update the @wordpress/compose to 3.25.3 to match with the version used by the updated version of @wordpress/data.
    • Add patch-package as a dev dependency.
      • Add "postinstall": "patch-package" script in package.json.
  • Across the codebase, search for __experimentalResolveSelect and replace with resolveSelect.
  • Compare the packages/data/src/components/use-select/index.js file in gutenberg repo between the v4.23.0 and v4.27.3 version, and make note of the changes to prepare for a patch.
    • A diff can be generated using git diff @wordpress/[email protected] @wordpress/[email protected] -- packages/data/src/components/use-select/index.js.
    • Distinguish between the relevant change pertaining to the __experimentalSubscribeStore.
    • Patch the node_modules/@wordpress/data/build-module/components/use-select/index.js (used by jest tests) and node_modules/@wordpress/data/build/components/use-select/index.js (used by plugin build).
    • See the patches/@wordpress+data+4.27.3.patch file in linked branch for an example.
  • While the previous failing tests should pass after the patch, it would be beneficial to create additional tests in assets/js/googlesitekit/data that has some additional tests for verifying the changes.
    • A selector that selects from multiple stores conditionally,
    • Another similar selector, that does the same thing, using createRegistrySelector.
    • See here for some example.

Test Coverage

  • All existing tests should pass.
  • See the above note in IB for additional tests.

QA Brief

  • This is an infra change and no user facing changes should be observed.
  • It may be beneficial to perform a general smoke testing of the plugin, or being vigilant about any odd behaviors during plugin release testing, looking out for any UI stalls, errors or console errors.
  • QA:Eng - all unit, integration and e2e tests should continue to pass locally and in CI.

Changelog entry

  • Update @wordpress/data to version 4.27.3, including a patch to avoid breaking changes.
@kuasha420 kuasha420 added P0 High priority Type: Infrastructure Engineering infrastructure & tooling javascript Pull requests that update Javascript code labels Jun 6, 2024
@kuasha420 kuasha420 assigned kuasha420 and unassigned kuasha420 Jun 6, 2024
@binnieshah binnieshah added the Team S Issues for Squad 1 label Jun 6, 2024
@tofumatt tofumatt self-assigned this Jun 10, 2024
@tofumatt
Copy link
Collaborator

All sounds good to me 👍🏻

IB ✅

@tofumatt tofumatt removed their assignment Jun 11, 2024
@binnieshah binnieshah added Team M Issues for Squad 2 and removed Team S Issues for Squad 1 labels Jun 12, 2024
@kuasha420 kuasha420 self-assigned this Jun 12, 2024
@kuasha420 kuasha420 removed their assignment Jul 1, 2024
@techanvil techanvil assigned techanvil and unassigned techanvil Jul 4, 2024
@techanvil techanvil assigned tofumatt and unassigned techanvil Jul 4, 2024
@tofumatt tofumatt removed their assignment Jul 4, 2024
@mohitwp mohitwp self-assigned this Jul 5, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Jul 8, 2024

QA Update ✅

  • Tested on dev environment.
  • Done smoke testing of all functionalities.
  • Verified all widgets on main and entity dashboard.
  • Verified WP dashboard widgets.
  • Verified settings page.

@mohitwp mohitwp removed their assignment Jul 8, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Jul 8, 2024

I completed my testing but moving this back to QA. As per QAB it requires QA:Eng review also.

@mohitwp
Copy link
Collaborator

mohitwp commented Jul 8, 2024

@tofumatt @techanvil Can you please confirm if all unit, integration and e2e tests are pass locally and in CI during CR ? If yes, then I will move this to approval.

@tofumatt
Copy link
Collaborator

tofumatt commented Jul 8, 2024

@mohitwp Yes, everything is passing, this can be moved to Approval 👍🏻

@tofumatt tofumatt removed their assignment Jul 8, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Jul 8, 2024

Thank you @tofumatt ! Moving this back to approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code P0 High priority Team M Issues for Squad 2 Type: Infrastructure Engineering infrastructure & tooling
Projects
None yet
Development

No branches or pull requests

6 participants