bn.js icon indicating copy to clipboard operation
bn.js copied to clipboard

Question: v4 or v5

Open mahnunchik opened this issue 4 years ago • 9 comments

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

mahnunchik avatar Mar 04 '21 08:03 mahnunchik

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.

fanatid avatar Mar 04 '21 08:03 fanatid

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 avatar Mar 04 '21 08:03 mahnunchik

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.

mahnunchik avatar Mar 04 '21 16:03 mahnunchik

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

fanatid avatar Mar 04 '21 16:03 fanatid

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

fleksin avatar Sep 05 '22 04:09 fleksin

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.

twoKilo avatar Sep 27 '22 06:09 twoKilo

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?

ssbarbee avatar Dec 03 '22 22:12 ssbarbee