-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump @types/bn.js dependency to 5.1.1 #5640
Conversation
Pull Request Test Coverage Report for Build 3500685412Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
The error is a timeout in connecting to Infura, and I don't (on this project) have privileges to force a re-run of a job with the same code, nor do I have a high opinion of adding extraneous commits to PRs that make it less focused. |
This PR has been automatically marked as stale beacause it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
Again, it's only stale because I don't have permissions on this project to retrigger a job that failed due to an Infura timeout. |
merged #5885 into 1.x for these changes |
Description
This PR sets a higher minimum version for the @types/bn.js dependency. In version 5.1.1, a new divmod function was added which is a breaking change on a patch version number release: a type defined from an import of @types/bn.js@v5.1.1 is not compatible with the BN type if defined from an import of @types/bn.js@v5.1.0.
Because the current loose specification allows either version to be used, sometimes NPM picks different versions for different web3 package or even for the same package directly vs. when included in another web3 package. This incompatibility causes code that previously worked fine due to type consistency to now fail compilation. Pinning all to .0 exactly would be less likely to cause breaking changes elsewhere or in the future, as maintainers of the typing package seem to not recognize this breaking change as such and could do something similar in the future. However, pinning to .0 would likely cause greater incompatibilities unless all projects which use web3 and have type interaction with the BN type also pin to .0 specifically, and the
^
notation is more common. As long as everything is consistent, it works, and failing forward makes a little more sense.Type of change
Checklist for 1.x:
npm run dtslint
with success and extended the tests and types if necessary.npm run test:cov
and my test cases cover all the lines and branches of the added code. [n/a and ERROR: The filename, directory name, or volume label syntax is incorrect.]npm run build
with success.dist/web3.min.js
in a browser.CHANGELOG.md
file in the root folder.