Skip to content

Conversation

@TrevorBurnham
Copy link
Contributor

Description

Follow-up for #3986

This PR applies some minor code optimizations that take advantage of ES2019 features. These changes reduce measured bundle size by 833 bytes.

How has this been tested?

All unit tests are passing. No changes in behavior are expected.

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.

- Remove unused catch parameters in 3 files (optional catch binding)
- Replace array reduce patterns with flatMap in visible-content
- Replace Set iteration with Array.from in make-scaled-series
@TrevorBurnham TrevorBurnham requested a review from a team as a code owner November 14, 2025 00:35
@TrevorBurnham TrevorBurnham requested review from gethinwebster and removed request for a team November 14, 2025 00:35
// Consumers in the past have not always been able to support not specifiying the value so we keep and ignore
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
} catch {
Copy link
Member

@just-boris just-boris Nov 14, 2025

Choose a reason for hiding this comment

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

Not merge blocking but I would like to hear your thoughts – how do you debug such code?

I have got a few cases where I investigated an issue, I traced it down to such anonymous catch block, but there was no clue how I ended up there. Is there any debug trick to know the currently being thrown error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. In that case I think you'd want to add an error to the catch temporarily for debugging purposes. It does seem like a gap that dev tools don't provide a stack trace in that scenario. 😞

@just-boris just-boris enabled auto-merge November 14, 2025 16:26
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.99%. Comparing base (7af314d) to head (008c07c).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4036      +/-   ##
==========================================
- Coverage   96.99%   96.99%   -0.01%     
==========================================
  Files         861      861              
  Lines       25209    25207       -2     
  Branches     9093     9093              
==========================================
- Hits        24451    24449       -2     
  Misses        752      752              
  Partials        6        6              

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

@just-boris just-boris added this pull request to the merge queue Nov 14, 2025
Merged via the queue into cloudscape-design:main with commit ab08f66 Nov 14, 2025
47 of 48 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