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

Add ResizeObserver polyfill globally in Jest tests #173772

Merged

Conversation

markov00
Copy link
Member

@markov00 markov00 commented Dec 20, 2023

Summary

This PR adds the ResizeObserver polyfill in Jest Tests reusing a polyfill already used in Kibana.
The PR also removes all the mocks for the ResizeObserver used in tests.
The polyfill is no longer needed in code running on a browser as the ResizeObserver API is already available in every Kibana supported browser.

There is still one last polyfill to remove @juggle/resize-observer but this is used internally by the use-resize-observer hook. A following PR could probably replace that hook with a different hook that doesn't require that polyfill to cleanup a bit our dependencies

@markov00 markov00 added release_note:skip Skip the PR/issue when compiling release notes dependencies Pull requests that update a dependency file labels Dec 20, 2023
@markov00 markov00 force-pushed the 2023_12_20-remove_resize_observer_mocks branch from 5b45013 to 9b34fc3 Compare December 20, 2023 18:00
@markov00 markov00 marked this pull request as ready for review January 9, 2024 13:26
@markov00 markov00 requested review from a team as code owners January 9, 2024 13:26
Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@botelastic botelastic bot added the Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team label Jan 9, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

Copy link
Contributor

@smith smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synthetics changes look good. Thanks!

Copy link
Contributor

@maxcold maxcold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloud_defend and session_viewer changes lgtm

@markov00
Copy link
Member Author

@elasticmachine merge upstream

@markov00 markov00 enabled auto-merge (squash) January 26, 2024 14:37
@kibana-ci
Copy link
Collaborator

💛 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
kibanaUtils 60.8KB 60.8KB +1.0B
securitySolution 11.2MB 11.2MB -33.0B
total -32.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kibanaUtils 73.3KB 72.9KB -407.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@markov00 markov00 merged commit dade4f1 into elastic:main Jan 26, 2024
40 checks passed
@kibanamachine kibanamachine added v8.13.0 backport:skip This commit does not require backporting labels Jan 26, 2024
@markov00 markov00 deleted the 2023_12_20-remove_resize_observer_mocks branch January 26, 2024 17:27
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
## Summary

This PR adds the ResizeObserver polyfill in Jest Tests reusing a
polyfill already used in Kibana.
The PR also removes all the mocks for the ResizeObserver used in tests.
The polyfill is no longer needed in code running on a browser as the
[ResizeObserver API is already
available](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#browser_compatibility)
in every Kibana-supported browser.


There is still one last polyfill to remove `@juggle/resize-observer` but
this is used internally by the `use-resize-observer` hook. A following
PR could probably replace that hook with a different hook that doesn't
require that polyfill to cleanup a bit our dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting dependencies Pull requests that update a dependency file release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants