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.

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
@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
Copy link

codecov bot commented Aug 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.06%. Comparing base (4d187c3) to head (ee026e7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3790      +/-   ##
==========================================
- Coverage   97.06%   97.06%   -0.01%     
==========================================
  Files         836      836              
  Lines       24219    24219              
  Branches     8500     8500              
==========================================
- Hits        23509    23507       -2     
- Misses        662      663       +1     
- Partials       48       49       +1     

☔ 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.

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.

1 participant