Better bundling#25
Open
sunify wants to merge 5 commits into
Open
Conversation
Since many app will have web3 as a dependency anyway, there is a big chance that web3 will be double bundled. That's the case with burner-wallet for example So will be much better to not include web3 into bundle (like react and react-dom)
Library shouldn't take care about polyfills for old browsers, apps should do that Imagine if any libary would do this, it will be a huge mess of unnecessary code
- Do not bundle node_modules. It makes bundling the app much harder. People could want to ignore some packages or smth like that. It's like to bundle all moment.js locales into moment.js itself - Create a separate bundles for each exported component It will allow people to import only one component (since tree shaking is not working) and do not drag entire library with all dependencies and polyfills
ethereum-ens package with all deps weights about 300 KB gzipped. It's the biggest dependency here and used for really minor thing
No need for http library here, fetch can handle it easily and we'll have -1 dep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes will reduce the size of apps drastically (-463.82 KB gzipped for burner-wallet).
Also, it will improve bundling performance
All commits have detailed description and reasoning. Some stuff questionable, e.g. ethereum-ens part, i understand that and will be happy to discuss it.