connect icon indicating copy to clipboard operation
connect copied to clipboard

Track the final bundle size

Open bpierre opened this issue 5 years ago • 4 comments

We should keep track of the final bundle size when the required modules are being imported in a web app.

We could have the following:

  • One bundle with only @aragon/connect.
  • One bundle with @aragon/connect + app connector, for every core app.
  • One bundle with @aragon/connect + all the core app connectors.

We could try to do this using https://bundlewatch.io/

bpierre avatar Jun 17 '20 15:06 bpierre

Hey @bpierre, just to make sure:

One bundle with @aragon/connect + app connector, for every core app.

That would be @aragon/connect + @aragon/connect-finance + @aragon/connect-tokens + @aragon/connect-voting right?

One bundle with @aragon/connect + all the core app connectors.

And this @aragon/connect + @aragon/connect-react + @aragon/connect-core + @aragon/connect-ethereum + @aragon/connect-thegraph?

eliobricenov avatar Feb 26 '21 15:02 eliobricenov

That would be @aragon/connect + @aragon/connect-finance + @aragon/connect-tokens + @aragon/connect-voting right?

No it would be separate bundles, one per app connector, to test realistic final bundle sizes independently:

  • One with @aragon/connect + @aragon/connect-finance
  • One with @aragon/connect + @aragon/connect-tokens
  • One with @aragon/connect + @aragon/connect-voting
  • One with @aragon/connect + @aragon/connect-disputable-voting
  • One with @aragon/connect + @aragon/connect-agreement

One bundle with @aragon/connect + all the core app connectors.

And this @aragon/connect + @aragon/connect-react + @aragon/connect-core + @aragon/connect-ethereum + @aragon/connect-thegraph?

It would be a single app using most of the app connectors, to keep track of a bundle size when using a lot of app connectors at once.

For example, the bundle could contain the following:

  • @aragon/connect
  • @aragon/connect-finance
  • @aragon/connect-tokens
  • @aragon/connect-voting
  • @aragon/connect-agreement

bpierre avatar Feb 26 '21 15:02 bpierre

Ok, that makes sense, thanks @bpierre

eliobricenov avatar Feb 26 '21 16:02 eliobricenov

I did some research and https://bundlewatch.io/ would be useful to track single file sizes (e.g React's final .js files) but in order to check different combinations of packages, we'd need to track directory sizes instead.

Maybe we can use their NodeJS API to implement a solution, either way, I can do further research on other options as well.

That being said, I think that given that this is an enhancement, bug's issues such as https://github.com/aragon/aragon-cli/issues/1082 have a higher priority and should be tackled first.

What do you think? @nivida

eliobricenov avatar Mar 01 '21 16:03 eliobricenov