Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large bundle size #47

Open
mfolnovic opened this issue May 8, 2022 · 2 comments
Open

Large bundle size #47

mfolnovic opened this issue May 8, 2022 · 2 comments

Comments

@mfolnovic
Copy link

Having import Web3Quorum from "web3js-quorum"; increases bundle size by a lot.

In my project, before importing it, bundle size was 396.68 KiB / gzip: 115.09 KiB.
After importing it, bundle size increased to 1649.67 KiB / gzip: 472.42 KiB.

System information

Client type: Besu
Bundler: Rollup

Expected behaviour

Bundle size shouldn't increase that much.

Actual behaviour

Bundle size increases by ~1.2MB uncompressed.

Steps to reproduce the behaviour

In any example project, try building it with and without importing web3-quorum.

@mfolnovic
Copy link
Author

I assume the issue is that you are publishing raw source, instead of bundling it (cjs/umd/esm)?

If that's true, I guess this is also why I'm having issues with using web3js-quorum after bundling everything:

Uncaught TypeError: Object prototype may only be an Object or null: undefined
    at Function.create (<anonymous>)
    at privateSubscription.js:234:40
    at index.fed4010a.js:1:637
    at main.tsx:10:1

image

@mfolnovic
Copy link
Author

I've managed to make it work by adding build step in web3js-quorum and using bundled library.

Would you be interested in PR that adds this, modeled on how web3.js does it: https://github.com/ChainSafe/web3.js/blob/1.x/webpack.config.js ?

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

No branches or pull requests

1 participant