Skip to content

Conversation

@TrevorBurnham
Copy link
Contributor

Description of changes:

This started as an attempted follow-up for #169 to take advantage of new optimizations available in ES2019. Unfortunately, I couldn't many in this codebase. There are a couple of modernization tweaks in this branch (changing .indexOf(...) > -1 to .includes(...) and replacing .apply with a spread), but the main change I wound up making was just getting rid of unused catch variables:

// Before
try { ... } catch (ex) { ... }

// After
try { ... } catch { ... }

That shaves off a few bytes from the bundle, and it's also a code style improvement IMO, as it makes it clearer that the caught exception is unused. I've configured the no-unused-vars rule to catch that pattern in the future.

If this is approved, I'll submit the same change for cloudscape-design/components, where I expect the bundle size improvement to be more significant.


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 October 31, 2025 18:16
@TrevorBurnham TrevorBurnham requested review from YueyingLu and removed request for a team October 31, 2025 18:16
@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #170   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files          36       36           
  Lines         904      904           
  Branches      255      256    +1     
=======================================
  Hits          893      893           
+ Misses         11       10    -1     
- Partials        0        1    +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.

@YueyingLu YueyingLu added this pull request to the merge queue Nov 4, 2025
Merged via the queue into cloudscape-design:main with commit aebb97f Nov 4, 2025
78 of 79 checks passed
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.

2 participants