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

Optimize useInViewSelect #8789

Closed
2 tasks done
aaemnnosttv opened this issue Jun 3, 2024 · 5 comments
Closed
2 tasks done

Optimize useInViewSelect #8789

aaemnnosttv opened this issue Jun 3, 2024 · 5 comments
Labels
P1 Medium priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature

Comments

@aaemnnosttv
Copy link
Collaborator

aaemnnosttv commented Jun 3, 2024

Feature Description

In #4096 we added useInViewSelect, a decorated version of the useSelect hook we use liberally throughout our components.

There are a few details which were missed in the initial implementation which should be revisited to avoid unnecessary performance hits.


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

Acceptance criteria

Implementation Brief

  • Update mapSelectCallback's dependency array to use the provided deps. The necessary eslint-disable-next-line is explained in the latest version of useSelect which we could copy here as well
  • Replace the () => undefined function to a stable named function outside of the component

Test Coverage

  • Adding a test to cover the expected number of invocations of the given mapSelect function across renders in and out of view

QA Brief

  • Setup Site Kit and all modules
  • Do overall smoke testing to verify that all widgets work as expected/before - Site Kit dashboard and entity dashboard, and widgets on WP dashboard

Changelog entry

  • Update the useInViewSelect hook to use dependencies.
@aaemnnosttv aaemnnosttv added P1 Medium priority Type: Enhancement Improvement of an existing feature labels Jun 3, 2024
@aaemnnosttv aaemnnosttv self-assigned this Jun 3, 2024
@binnieshah binnieshah added the Next Up Issues to prioritize for definition label Jun 14, 2024
@eugene-manuilov eugene-manuilov self-assigned this Jun 20, 2024
@eugene-manuilov
Copy link
Collaborator

IB ✔️

@eugene-manuilov eugene-manuilov removed their assignment Jun 20, 2024
@binnieshah binnieshah added Team S Issues for Squad 1 and removed Next Up Issues to prioritize for definition labels Jun 24, 2024
@zutigrm zutigrm self-assigned this Jun 24, 2024
@zutigrm zutigrm mentioned this issue Jun 24, 2024
18 tasks
@zutigrm zutigrm removed their assignment Jun 24, 2024
@zutigrm zutigrm assigned eugene-manuilov and unassigned zutigrm Jun 25, 2024
@zutigrm zutigrm assigned eugene-manuilov and unassigned zutigrm Jun 26, 2024
@eugene-manuilov eugene-manuilov removed their assignment Jun 26, 2024
@mohitwp mohitwp self-assigned this Jul 1, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Jul 8, 2024

QA Update ✅

  • Tested on dev environment.
  • Verified all widgets on main and entity dashboard.
  • Verified WP dashboard widgets.
  • Verified site kit bar in front end.
  • Verified all widgets are working as expected.

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

I've opened a very small follow up here to address one detail missed which resulted in a larger change here.

@nfmohit nfmohit self-assigned this Jul 12, 2024
@nfmohit nfmohit removed their assignment Jul 12, 2024
@nfmohit
Copy link
Collaborator

nfmohit commented Jul 12, 2024

Update: The follow-up PR has been merged.

@aaemnnosttv
Copy link
Collaborator Author

Thanks @nfmohit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Medium priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

6 participants