Skip to content

Conversation

@TrevorBurnham
Copy link
Contributor

This PR updates the build target from ES2015 to ES2021, the newest ECMAScript version supported by all target browsers. This reduces the bundle size by 3.7%, with the potential for further improvement if code is updated to take advantage of newly-supported language features, including:

  • async/await
  • Object.assign, Array.includes, String.startsWith/endsWith
  • const/let block scoping
  • arrow functions
  • template literals
  • Optional chaining (?.)
  • Nullish coalescing (??)
  • Logical assignment operators** (&&=, ||=, ??=)

Here's the corresponding PR to bump the ECMAScript target in the components repo: cloudscape-design/components#3801


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 September 11, 2025 00:33
@TrevorBurnham TrevorBurnham requested review from just-boris and removed request for a team September 11, 2025 00:33
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.

Looks good overall, but it will require an internal sanity check as well.

Let's finish the resize observer story first and then get on this one

@codecov
Copy link

codecov bot commented Sep 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.78%. Comparing base (193e04b) to head (d4f69c4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #163   +/-   ##
=======================================
  Coverage   98.78%   98.78%           
=======================================
  Files          36       36           
  Lines         904      904           
  Branches      243      255   +12     
=======================================
  Hits          893      893           
  Misses         11       11           

☔ 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
Copy link
Member

Time to come back to this PR.

Pushed it internally and did a dry-run: 7572079946

There are too many consumer packages unable to understand optional chaining. I opened a follow up CR to try raising at least up to 2019

#169

@just-boris just-boris closed this Oct 24, 2025
@TrevorBurnham
Copy link
Contributor Author

There are too many consumer packages unable to understand optional chaining.

Oof. Webpack 4 just won't die. 😩

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