Skip to content

Conversation

@TrevorBurnham
Copy link
Contributor

@TrevorBurnham TrevorBurnham commented Aug 24, 2025

All target browsers now support the native ResizeObserver API, making the polyfill unnecessary: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#browser_compatibility.

This change reduces bundle size and simplifies the codebase.

Changes:

  • Remove @juggle/resize-observer from package.json dependencies
  • Update sticky scrollbar hook to use native ResizeObserver
  • Add global ResizeObserver mock in Jest setup for JSDOM compatibility
  • Update mock file to use native ResizeObserver types with JSDOM-compatible implementations

Note that the mock file can be removed once the polyfill is also removed from @cloudscape-design/component-toolkit: cloudscape-design/component-toolkit#154

How has this been tested?

✅ All unit tests pass.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@TrevorBurnham TrevorBurnham requested a review from a team as a code owner August 24, 2025 18:17
@TrevorBurnham TrevorBurnham requested review from teodoranemes and removed request for a team August 24, 2025 18:17
@just-boris just-boris requested review from avinashbot and removed request for teodoranemes August 25, 2025 09:48
@codecov
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.12%. Comparing base (f2d96fb) to head (ff64b1e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3790      +/-   ##
==========================================
- Coverage   97.12%   97.12%   -0.01%     
==========================================
  Files         844      844              
  Lines       24553    24553              
  Branches     8660     8659       -1     
==========================================
- Hits        23848    23846       -2     
- Misses        656      700      +44     
+ Partials       49        7      -42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

avinashbot added a commit that referenced this pull request Sep 2, 2025
@TrevorBurnham TrevorBurnham changed the title perf: Remove ResizeObserver polyfill chore: Remove ResizeObserver polyfill Sep 2, 2025
@TrevorBurnham TrevorBurnham force-pushed the remove-juggle-resize-observer branch from ee026e7 to 3ad1968 Compare September 2, 2025 19:12
avinashbot added a commit that referenced this pull request Sep 3, 2025
@just-boris just-boris force-pushed the remove-juggle-resize-observer branch from 3ad1968 to db6049a Compare September 10, 2025 13:51
@just-boris just-boris force-pushed the remove-juggle-resize-observer branch from db6049a to 0f03851 Compare September 10, 2025 15:36
@TrevorBurnham TrevorBurnham changed the title chore: Remove ResizeObserver polyfill refactor: Remove ResizeObserver polyfill Sep 10, 2025
@just-boris just-boris changed the title refactor: Remove ResizeObserver polyfill chore: Remove ResizeObserver polyfill Sep 10, 2025
just-boris
just-boris previously approved these changes Sep 10, 2025
Copy link
Member

@just-boris just-boris left a comment

Choose a reason for hiding this comment

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

This change is good and passed all our internal tests. Ready to merge

TrevorBurnham and others added 4 commits September 11, 2025 11:29
All target browsers now support the native ResizeObserver API, making
the polyfill unnecessary.

This change reduces bundle size and simplifies the codebase.

Changes:
- Remove @juggle/resize-observer from package.json dependencies
- Update sticky scrollbar hook to use native ResizeObserver
- Add global ResizeObserver mock in Jest setup for JSDOM compatibility
- Update mock file to use native ResizeObserver types with JSDOM-compatible implementations

Note that the mock file can be removed once the polyfill is also removed
from @cloudscape-design/component-toolkit:
cloudscape-design/component-toolkit#154
@just-boris just-boris added this pull request to the merge queue Sep 11, 2025
Merged via the queue into cloudscape-design:main with commit 1fee55a Sep 11, 2025
36 of 38 checks passed
at-susie pushed a commit that referenced this pull request Sep 17, 2025
at-susie pushed a commit that referenced this pull request Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants