Skip to content

[Lens] Optimize unnecessary re-renders#220366

Merged
dej611 merged 16 commits intoelastic:mainfrom
dej611:feat/optimize-react-hooks
May 28, 2025
Merged

[Lens] Optimize unnecessary re-renders#220366
dej611 merged 16 commits intoelastic:mainfrom
dej611:feat/optimize-react-hooks

Conversation

@dej611
Copy link
Contributor

@dej611 dej611 commented May 7, 2025

Summary

After a conversation with @markov00 I've ran an investigation of unwanted re-render due to an abuse of useEffect, which can be easily converted into useMemo calls.

@dej611 dej611 added the Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// label May 7, 2025
@dej611 dej611 requested a review from a team as a code owner May 7, 2025 12:38
@dej611 dej611 added release_note:skip Skip the PR/issue when compiling release notes Feature:Lens backport:skip This PR does not require backporting labels May 7, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@dej611 dej611 requested a review from markov00 May 21, 2025 16:12
@dej611 dej611 added backport:version Backport to applied version labels v9.1.0 v8.19.0 and removed backport:skip This PR does not require backporting labels May 27, 2025
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.6MB 1.6MB -350.0B

History

cc @dej611

@dej611 dej611 merged commit d859fc0 into elastic:main May 28, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15299639145

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 220366

Questions ?

Please refer to the Backport tool documentation

@dej611
Copy link
Contributor Author

dej611 commented May 28, 2025

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

dej611 added a commit to dej611/kibana that referenced this pull request May 28, 2025
## Summary

After a conversation with @markov00 I've ran an investigation of
unwanted re-render due to an abuse of `useEffect`, which can be easily
converted into `useMemo` calls.

(cherry picked from commit d859fc0)

# Conflicts:
#	x-pack/platform/plugins/shared/lens/public/editor_frame_service/editor_frame/editor_frame.test.tsx
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
## Summary

After a conversation with @markov00 I've ran an investigation of
unwanted re-render due to an abuse of `useEffect`, which can be easily
converted into `useMemo` calls.
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 30, 2025
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

2 similar comments
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @dej611

dej611 added a commit that referenced this pull request Jun 3, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[Lens] Optimize unnecessary re-renders
(#220366)](#220366)

<!--- Backport version: 10.0.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-28T12:04:03Z","message":"[Lens]
Optimize unnecessary re-renders (#220366)\n\n## Summary\n\nAfter a
conversation with @markov00 I've ran an investigation of\nunwanted
re-render due to an abuse of `useEffect`, which can be easily\nconverted
into `useMemo`
calls.","sha":"d859fc004663158cebedef1c5f401172b4be37e0","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","backport:version","v9.1.0","v8.19.0"],"title":"[Lens]
Optimize unnecessary
re-renders","number":220366,"url":"https://github.com/elastic/kibana/pull/220366","mergeCommit":{"message":"[Lens]
Optimize unnecessary re-renders (#220366)\n\n## Summary\n\nAfter a
conversation with @markov00 I've ran an investigation of\nunwanted
re-render due to an abuse of `useEffect`, which can be easily\nconverted
into `useMemo`
calls.","sha":"d859fc004663158cebedef1c5f401172b4be37e0"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220366","number":220366,"mergeCommit":{"message":"[Lens]
Optimize unnecessary re-renders (#220366)\n\n## Summary\n\nAfter a
conversation with @markov00 I've ran an investigation of\nunwanted
re-render due to an abuse of `useEffect`, which can be easily\nconverted
into `useMemo`
calls.","sha":"d859fc004663158cebedef1c5f401172b4be37e0"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 3, 2025
zacharyparikh pushed a commit to zacharyparikh/kibana that referenced this pull request Jun 4, 2025
## Summary

After a conversation with @markov00 I've ran an investigation of
unwanted re-render due to an abuse of `useEffect`, which can be easily
converted into `useMemo` calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants