fix dashboard grid item performs 2 DOM queries every render#199390
fix dashboard grid item performs 2 DOM queries every render#199390nreese merged 15 commits intoelastic:mainfrom
Conversation
|
/ci |
|
/ci |
|
/ci |
|
/ci |
|
/ci |
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
|
@elasticmachine merge upstream |
|
merge conflict between base and head |
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
packages/core/rendering/core-rendering-browser/src/use_app_fixed_viewport.ts
Outdated
Show resolved
Hide resolved
TinaHeiligers
left a comment
There was a problem hiding this comment.
useAppFixedViewport is an implementation and needs to be declared in the core-rendering-browser-internal package.
See suggested fixes.
packages/core/rendering/core-rendering-browser/src/use_app_fixed_viewport.ts
Show resolved
Hide resolved
packages/core/rendering/core-rendering-browser-internal/src/rendering_service.tsx
Show resolved
Hide resolved
TinaHeiligers
left a comment
There was a problem hiding this comment.
The changes don't strictly follow Core's packages conventions.
I won't hold the PR up though, as we can follow up with these.
Core team review provided by Tina. Resolved afharo's concerns but he is out of office
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
|
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11898803830 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
|
8.x #200648 |
…199390) Closes elastic#199361 While investigating, I found that fetching DOM element with id `app-fixed-viewport` is a common pattern. I created the hook `useAppFixedViewport` to consolidate this logic into a single location. The hook only performs the DOM look-up on first render and then avoids the DOM look-up on each additional render. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 9f54503) # Conflicts: # .github/CODEOWNERS
…99390) (#200648) # Backport This will backport the following commits from `main` to `8.x`: - [fix dashboard grid item performs 2 DOM queries every render (#199390)](#199390) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2024-11-18T18:32:53Z","message":"fix dashboard grid item performs 2 DOM queries every render (#199390)\n\nCloses https://github.com/elastic/kibana/issues/199361\r\n\r\nWhile investigating, I found that fetching DOM element with id\r\n`app-fixed-viewport` is a common pattern. I created the hook\r\n`useAppFixedViewport` to consolidate this logic into a single location.\r\nThe hook only performs the DOM look-up on first render and then avoids\r\nthe DOM look-up on each additional render.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"9f545039ab42e95fd1d3d0518da4df6a8d040177","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","v9.0.0","ci:project-deploy-observability","Team:obs-ux-management","backport:version","v8.17.0"],"number":199390,"url":"https://github.com/elastic/kibana/pull/199390","mergeCommit":{"message":"fix dashboard grid item performs 2 DOM queries every render (#199390)\n\nCloses https://github.com/elastic/kibana/issues/199361\r\n\r\nWhile investigating, I found that fetching DOM element with id\r\n`app-fixed-viewport` is a common pattern. I created the hook\r\n`useAppFixedViewport` to consolidate this logic into a single location.\r\nThe hook only performs the DOM look-up on first render and then avoids\r\nthe DOM look-up on each additional render.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"9f545039ab42e95fd1d3d0518da4df6a8d040177"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199390","number":199390,"mergeCommit":{"message":"fix dashboard grid item performs 2 DOM queries every render (#199390)\n\nCloses https://github.com/elastic/kibana/issues/199361\r\n\r\nWhile investigating, I found that fetching DOM element with id\r\n`app-fixed-viewport` is a common pattern. I created the hook\r\n`useAppFixedViewport` to consolidate this logic into a single location.\r\nThe hook only performs the DOM look-up on first render and then avoids\r\nthe DOM look-up on each additional render.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"9f545039ab42e95fd1d3d0518da4df6a8d040177"}},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…199390) Closes elastic#199361 While investigating, I found that fetching DOM element with id `app-fixed-viewport` is a common pattern. I created the hook `useAppFixedViewport` to consolidate this logic into a single location. The hook only performs the DOM look-up on first render and then avoids the DOM look-up on each additional render. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Closes #199361
While investigating, I found that fetching DOM element with id
app-fixed-viewportis a common pattern. I created the hookuseAppFixedViewportto consolidate this logic into a single location. The hook only performs the DOM look-up on first render and then avoids the DOM look-up on each additional render.