bn.js
bn.js copied to clipboard
Question: v4 or v5
The questions are for education purpose:
- What is the differences between versions for end user? I don't see any breaking changes here: https://github.com/indutny/bn.js/releases/tag/v5.0.0
- According to npm v4 is
latest. What does it mean? Is v5 still not ready for production? - There is also PR to upgrade bn.js in elliptic https://github.com/indutny/elliptic/pull/210
v5.0.0 introduced some renames, you can find full lines of changes in this PR: https://github.com/indutny/bn.js/pull/219
I think npm shows v4 as latest because they define the latest version by date. v4.12.0 was published after v5.2.0.
I think it is better to clarify for end users, because there is inconsistency: before v4.12.0 and v5.2.0 latest was v5, now it is v4. So npm install bn.js installs different version.
Yep, I think it is good idea to clarify it in the readme there are two version of library (master branch for v5 and v4.x for v4) with slightly different method names.
I fixed latest tag (thanks to npm support for npm dist-tag add <pkg>@<version> latest), now latest point to 5.2.0.
is it safe to automatically replace 4.x with 5.x ?
just share the same concerns, is that safe to migrate from v4 to v5? My webpack bundle has multiple bn.js, I'd like to add a resolution of v5 to solve the problem. however, some package depends on v4.
same questions as @twoKilo. Adding resolution might shave few KBs, but given that there is no clear explanation on difference between v5 and v4 it might cause more harm than benefit. @fanatid can you share some insights? Is it safe to add resolution so that v4 resolve to v5, or there are breaking changes not documented in the release?