indutny / bn.js

BigNum in pure javascript
MIT License
1.19k stars 150 forks source link

Question: v4 or v5 #273

Open mahnunchik opened 3 years ago

mahnunchik commented 3 years ago

The questions are for education purpose:

fanatid commented 3 years ago

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.

mahnunchik commented 3 years ago

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.

mahnunchik commented 3 years ago

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.

fanatid commented 3 years ago

I fixed latest tag (thanks to npm support for npm dist-tag add <pkg>@<version> latest), now latest point to 5.2.0.

fleksin commented 2 years ago

is it safe to automatically replace 4.x with 5.x ?

twoKilo commented 1 year ago

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.

ssbarbee commented 1 year ago

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?