Skip to content

Bundle optimizations for react components#5459

Merged
edisile merged 2 commits intomainfrom
bundle-optimizations-react-components
Nov 18, 2025
Merged

Bundle optimizations for react components#5459
edisile merged 2 commits intomainfrom
bundle-optimizations-react-components

Conversation

@edisile
Copy link
Copy Markdown
Contributor

@edisile edisile commented Nov 17, 2025

This PR reduces the size of JS bundles by addressing some issues with "@canonical/react-components" and "@canonical/store-components".

  • @canonical/react-components: Make sure we consume the ESM build rather than the CJS build which is the default and can't be tree shaken. Using the ESM build leads to saving about 200 kB worth of JS in production
  • @canonical/store-components: Update to version 0.55.0 which depends on the same version of @canonical/react-components as this project does, so we don't have to ship two separate versions of the library. This saves another 150 kB

Done

  • added a Vite resolve alias for "@canonical/react-components"
  • updated "@canonical/store-components"
  • linting in vite.config.js

How to QA

no need for QA

Testing

  • This PR has tests
  • No testing required (explain why): this removes dead code for components we don't use in our app

Issue / Card

WD-31270

@webteam-app
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@steverydz steverydz left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@edisile edisile merged commit 418d49f into main Nov 18, 2025
13 checks passed
@edisile edisile deleted the bundle-optimizations-react-components branch November 18, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants