Skip to content

[8.17] Remove resize-observer-polyfill (#230297)#230663

Merged
kibanamachine merged 1 commit intoelastic:8.17from
kibanamachine:backport/8.17/pr-230297
Aug 5, 2025
Merged

[8.17] Remove resize-observer-polyfill (#230297)#230663
kibanamachine merged 1 commit intoelastic:8.17from
kibanamachine:backport/8.17/pr-230297

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.17:

Questions ?

Please refer to the Backport tool documentation

close elastic#121509

This pull request removes the dependency on the
`resize-observer-polyfill` package and replaces its TEST usage with a
custom implementation of the `ResizeObserver` class. The changes
simplify the codebase by eliminating the need for the polyfill and
updating related test cases.

### Removal of `resize-observer-polyfill` dependency:

*
[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):
Removed the `resize-observer-polyfill` package from the dependencies.

### Replacement with custom `ResizeObserver` implementation:

*
[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):
Added a custom implementation of the `ResizeObserver` class to replace
the polyfill. The custom class uses event listeners for `resize` events.

### Updates to test cases:

*
[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):
Removed the mock implementation of `resize-observer-polyfill` and its
associated code, as it is no longer needed.
[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)
[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)

### Cleanup of polyfill usage in the main codebase:

*
[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):
Removed the import of `resize-observer-polyfill` from the
`ResizeChecker` implementation.

---------

Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
(cherry picked from commit 6bf697f)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Aug 5, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) August 5, 2025 19:24
@kibanamachine kibanamachine merged commit 97c2e27 into elastic:8.17 Aug 5, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants