-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
fix dashboard grid item performs 2 DOM queries every render #199390
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> Co-authored-by: Elastic Machine <[email protected]> (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":"[email protected]"},"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 <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","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 <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","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 <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","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 <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Closes #199361
While investigating, I found that fetching DOM element with id
app-fixed-viewport
is a common pattern. I created the hookuseAppFixedViewport
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.