-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Are multiple packages still needed? #2109
Comments
Currently, most are using the web3.min.js file or they are bundling the dapp with webpack and the web3.js bundle will go up to 6.2Mb. I think the described coming changes above will be the first step to a new structure of web3 but our focus is currently on the stability and maintainability of the code. All bigger changes of this lib will be after the stable release. This doesn't mean that I agree with you.
But all changes like this have to be done after the stable release and also to be discussed with @frozeman. :-) |
Hi @nivida, I understand that the focus is currently somewhere else, and I agree with that. I just wanted to initiate this discussion before 1.0.0 is released because a change in the direction I described is somewhat in conflict with releasing stable individual packages. Maintaining the single-package and individual-packages versions at the same time would be a lot of work. |
So the idea is to go back to from lerna monorepo with multiple packages to one package? I think one should create a new issue stating this Todo in a clear manner with a QA section and then reference this new issue here and close this one here. I find that the lerna monorepo is not a good solution, only one package should be release ( |
Not important for 1.0. Too much work. |
I think if we do this after the stable release then we could combine it with my namespace idea which will improve the bundle size and will also give us some better ways to handle different providers with one web3 instance. Namespace idea: https://gist.github.com/nivida/c7c24723353c243e295dbff954d06b50 |
…updated. The update is depending on issue #2109.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions |
I'm getting up to date with the recent changes to this project, and read in @nivida's post that there will be different bundles of web3.js for different use-cases. This gave me some ideas that I'm sharing here.
My understanding is that web3 was modularized in many packages so users could pick the parts they need and avoid importing the entire lib, as it's really big. While node users also benefit from smaller packages, they are specially important for web development, and there's lots of tooling focused on that that could be leveraged.
Exporting an ESM-based version of web3 let users take advantage of bundlers' tree-shaking capabilities, resulting in small bundles (probably smaller than the current module-specific ones) without having to manage nor think about multiple packages. This may require some changes, but would also simplify the project, which could be once again a single package.
Note that this approach is becoming fairly standard in web development, and many of the most used libraries are adopting it. Some examples are: lodash, underscore and date-fns.
I haven't spent much time thinking about how big of a change this would be, or how much impact it would have on current users of the beta versions, but a quick look at web3 and web3-eth on npm reveals that the intermediate packages have very few direct users.
The text was updated successfully, but these errors were encountered: