subql
subql copied to clipboard
Look into dependency sizes for CLI and project
The polkadot start installs about 800MB of dependencies right now. This includes the CLI as a dependency. We should look at reducing this.
This file is the output of du -h -d 1 | sort -n
on node_modules
with the sorting fixed with the units
modules_size.txt
Starting with the larger dependencies I think there are a few easy wins, these changes will probably need to be made to common
and types
packages for each chain.
- [ ] Ensure dependencies are actual required dependencies, if not they should be moved to devDependencies (e.g prettier)
- [x] Update oclif and use correct sub packages. Currently we have
aws-cli
as a transient dependency which is 90MB - [x] Move ethereum codegen to
@subql/common-ethereum
. This will ensure versions of ethers remain the same between different packages - [ ] More specific imports. Do we need
@polkadot/api
as a dependency if we only use@polkadot/types
- [ ] Investigate a way to make the CLI more modular, currently it supports every chain which brings along the associated sdks for those chains. typechain could be a good example where you need to also install the target
- [ ] Look at bundling the CLI into a single js file (e.g webpack)
The linked PR doesn't relate to this?
This was incorrectly marked as fixed, reopened
Closing this as we've reduced the size from >300MB to <100MB. If this is picked up again looking into the dependencies of class-transformer would be the next place to look.