Skip to content

Conversation

@legrego
Copy link
Member

@legrego legrego commented Aug 1, 2025

close #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: Removed the resize-observer-polyfill package from the dependencies.

Replacement with custom ResizeObserver implementation:

Updates to test cases:

Cleanup of polyfill usage in the main codebase:

@legrego legrego added chore Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// release_note:skip Skip the PR/issue when compiling release notes backport:prev-major labels Aug 1, 2025
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #10 / Fleet Endpoints fleet policy secrets fleet server version requirements "after each" hook for "should not store secrets if additional fleet server does not meet minimum version, but is inactive"
  • [job] [logs] FTR Configs #131 / Observability AI Assistant Functional tests knowledge_base_management/index.spec.ts Knowledge management tab User instruction management creates a new user instruction

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
kibanaUtils 161 160 -1

Page load bundle

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

id before after diff
kibanaUtils 55.8KB 48.3KB -7.4KB

@legrego legrego marked this pull request as ready for review August 1, 2025 21:17
@legrego legrego requested review from a team as code owners August 1, 2025 21:17
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

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.

Awesome! Thanks!

Copy link
Contributor

@csr csr left a comment

Choose a reason for hiding this comment

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

AppEx QA changes LGTM!

@legrego legrego merged commit 6bf697f into elastic:main Aug 5, 2025
16 checks passed
@legrego legrego added the dependency-reduction initiative to reduce the number of Kibana's third-party dependencies label Aug 5, 2025
@legrego legrego deleted the remove-resize-observer-polyfill branch August 5, 2025 19:17
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 8.19, 9.1

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 5, 2025
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 pushed a commit to kibanamachine/kibana that referenced this pull request Aug 5, 2025
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 pushed a commit to kibanamachine/kibana that referenced this pull request Aug 5, 2025
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 pushed a commit to kibanamachine/kibana that referenced this pull request Aug 5, 2025
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
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.17
8.18
8.19
9.1

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 5, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [Remove resize-observer-polyfill
(#230297)](#230297)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Larry
Gregory","email":"larry.gregory@elastic.co"},"sourceCommit":{"committedDate":"2025-08-05T19:17:43Z","message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Security","release_note:skip","backport:prev-minor","backport:prev-major","v9.2.0","dependency-reduction"],"title":"Remove
resize-observer-polyfill","number":230297,"url":"https://github.com/elastic/kibana/pull/230297","mergeCommit":{"message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/230297","number":230297,"mergeCommit":{"message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d"}}]}]
BACKPORT-->

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
kibanamachine added a commit that referenced this pull request Aug 5, 2025
# Backport

This will backport the following commits from `main` to `9.1`:
- [Remove resize-observer-polyfill
(#230297)](#230297)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Larry
Gregory","email":"larry.gregory@elastic.co"},"sourceCommit":{"committedDate":"2025-08-05T19:17:43Z","message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Security","release_note:skip","backport:prev-minor","backport:prev-major","v9.2.0","dependency-reduction"],"title":"Remove
resize-observer-polyfill","number":230297,"url":"https://github.com/elastic/kibana/pull/230297","mergeCommit":{"message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/230297","number":230297,"mergeCommit":{"message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d"}}]}]
BACKPORT-->

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
kibanamachine added a commit that referenced this pull request Aug 5, 2025
# Backport

This will backport the following commits from `main` to `8.17`:
- [Remove resize-observer-polyfill
(#230297)](#230297)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Larry
Gregory","email":"larry.gregory@elastic.co"},"sourceCommit":{"committedDate":"2025-08-05T19:17:43Z","message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Security","release_note:skip","backport:prev-minor","backport:prev-major","v9.2.0","dependency-reduction"],"title":"Remove
resize-observer-polyfill","number":230297,"url":"https://github.com/elastic/kibana/pull/230297","mergeCommit":{"message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/230297","number":230297,"mergeCommit":{"message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d"}}]}]
BACKPORT-->

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
kibanamachine added a commit that referenced this pull request Aug 5, 2025
# Backport

This will backport the following commits from `main` to `8.18`:
- [Remove resize-observer-polyfill
(#230297)](#230297)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Larry
Gregory","email":"larry.gregory@elastic.co"},"sourceCommit":{"committedDate":"2025-08-05T19:17:43Z","message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Security","release_note:skip","backport:prev-minor","backport:prev-major","v9.2.0","dependency-reduction"],"title":"Remove
resize-observer-polyfill","number":230297,"url":"https://github.com/elastic/kibana/pull/230297","mergeCommit":{"message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/230297","number":230297,"mergeCommit":{"message":"Remove
resize-observer-polyfill (#230297)\n\nclose
https://github.com/elastic/kibana/issues/121509\n\nThis pull request
removes the dependency on the\n`resize-observer-polyfill` package and
replaces its TEST usage with a\ncustom implementation of the
`ResizeObserver` class. The changes\nsimplify the codebase by
eliminating the need for the polyfill and\nupdating related test
cases.\n\n### Removal of `resize-observer-polyfill`
dependency:\n\n*\n[`package.json`](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1357):\nRemoved
the `resize-observer-polyfill` package from the dependencies.\n\n###
Replacement with custom `ResizeObserver`
implementation:\n\n*\n[`src/platform/packages/shared/kbn-test/src/jest/setup/polyfills.jsdom.js`](diffhunk://#diff-d20f940201d6ffb3751d4696a2502f77aebcd9cbbb71c38e65ac2bc76516ed57L34-R45):\nAdded
a custom implementation of the `ResizeObserver` class to replace\nthe
polyfill. The custom class uses event listeners for `resize`
events.\n\n### Updates to test
cases:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.test.ts`](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17):\nRemoved
the mock implementation of `resize-observer-polyfill` and
its\nassociated code, as it is no longer
needed.\n[[1]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL13-L17)\n[[2]](diffhunk://#diff-0aa7cb2b3833f42456fdf78b791624b2a2a503115a5762f3b9fc60fe9ec3269dL44-L53)\n\n###
Cleanup of polyfill usage in the main
codebase:\n\n*\n[`src/platform/plugins/shared/kibana_utils/public/resize_checker/resize_checker.ts`](diffhunk://#diff-c28fee2aa7f94e97473c034328cdc2d9e951627be00cc5978332993133d0a899L12):\nRemoved
the import of `resize-observer-polyfill` from the\n`ResizeChecker`
implementation.\n\n---------\n\nCo-authored-by: Anton Dosov
<anton.dosov@elastic.co>","sha":"6bf697f308628b6c894896a94276b5f43cc8dd3d"}}]}]
BACKPORT-->

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
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>
@wildemat wildemat mentioned this pull request Aug 7, 2025
10 tasks
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore dependency-reduction initiative to reduce the number of Kibana's third-party dependencies release_note:skip Skip the PR/issue when compiling release notes Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// v8.17.10 v8.18.5 v8.19.2 v9.1.2 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider removing resize-observer-polyfill

7 participants