Why did you use exact versions of common dependencies such us BN.js
serjout opened this issue · 6 comments
In package.json for all dependencies defined exact version. It is actuall for all ethjs-* libs and produce unoptimized code in client bundle.
What is reason for this?
Every stable and production ready lib should follows semver convention. If you wary about unexpected bugs, you can write tests for critical code parts.
In current situation my client bundle contains >3 different copy of BN.js. And this copies are compatible via semver convention. It is not good, cause increase bundle size and time to parse and execute code.
But thank you for your answer.
@serjout any idea on what modules we can clean that up pretty easily.
Now I tell you cool story, folks. There is one different reason. bn.js@4.11.6 has misspelling at line 53 - "require('buf' + 'fer')" instead of "require('buffer')". It is not a quite big problem, but not in my case. ethjs-abi is in dependencies tree of my project. But it runs on react-native, which use babel for resolving dependencies. And babel can not resolve dynamic require strings. So, I received error. And I need greater version of bn.js