react-redux icon indicating copy to clipboard operation
react-redux copied to clipboard

Add `size-limit` config

Open aryaemami59 opened this issue 1 year ago • 13 comments

This PR:

  • [X] Adds size-limit config to monitor bundle size changes in preparation for any potential changes we'll have to make to migrate to React 19.

aryaemami59 avatar May 15 '24 06:05 aryaemami59

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

codesandbox-ci[bot] avatar May 15 '24 06:05 codesandbox-ci[bot]

Honestly, I'm not a huge fan of these sorts of tools. They tend to be more annoying than helpful. Maybe we can limit it to just a react19 branch, so we don't have to tend to it after we complete that work?

Edit: Wait, don't we already have this? https://github.com/reduxjs/react-redux/blob/master/.github/workflows/size.yaml

timdorr avatar May 16 '24 01:05 timdorr

@timdorr

Honestly, I'm not a huge fan of these sorts of tools. They tend to be more annoying than helpful.

That's fair, but size-limit does give us an idea of how the changes that we make impact our bundle sizes. And with the way I setup the config, it can keep track of every single named export, in every single package entry point, in both development and production builds. And the config is simple enough that I hope we'd be able to insert into any one of the redux packages and it should just work.

Edit: Wait, don't we already have this? https://github.com/reduxjs/react-redux/blob/master/.github/workflows/size.yaml

While preactjs/compressed-size-action does give us some info about bundle size changes, it looks like it's only looking at dist/cjs/index.js and dist/react-redux.legacy-esm.js. It also doesn't look at named exports, or different environments.

The idea is to have this here so that if we were ever to make a set of changes, we could use it to keep an eye on bundle sizes, it doesn't necessarily have to put a "limit" on anything.

aryaemami59 avatar May 16 '24 08:05 aryaemami59

yeah, while I don't think the concept of a size "limit" is very useful, I do find it useful to have visibility on how a given set of changes affects final bundle size.

EskiMojo14 avatar May 16 '24 09:05 EskiMojo14

Could this supplant our usage of compressed-size-action? That one hasn't been updated in a long time and causes some warnings in CI that will eventually turn into errors, so it's been on my radar to replace it.

timdorr avatar May 17 '24 22:05 timdorr

I guess we could use https://github.com/EskiMojo14/size-limit-action, same thing we're doing with RTK.

aryaemami59 avatar May 18 '24 22:05 aryaemami59

Deploy Preview for react-redux-docs ready!

Name Link
Latest commit bdaffcd9e1630bf1274a713687bbde95f29817a4
Latest deploy log https://app.netlify.com/sites/react-redux-docs/deploys/66bfddc6a1b3d600086c804a
Deploy Preview https://deploy-preview-2173--react-redux-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Jun 17 '24 20:06 netlify[bot]

Yeah, I think we want to switch to the other size package for consistency.

markerikson avatar Aug 11 '24 15:08 markerikson

The other size package?

aryaemami59 avatar Aug 11 '24 15:08 aryaemami59

https://github.com/EskiMojo14/size-limit-action , per above

markerikson avatar Aug 11 '24 15:08 markerikson

Note: The action is failing because we don't have size-limit on master. Once this lands, that error goes away.

timdorr avatar Oct 03 '24 14:10 timdorr

Can we just merge this at this point? I don't need another resolution for 2025 😂

timdorr avatar Dec 31 '24 18:12 timdorr

@aryaemami59 same question as with the RTK PR - what does the actual output look like atm?

markerikson avatar Jan 03 '25 16:01 markerikson