NEAR Dev Tools
September 10, 2022
Since Consensus, the Pagoda team has been heads down working on NEAR-API-JS. We’d like to thank the NEAR community for providing valuable feedback on the repository. We have taken your feedback and have been working hard making many improvements to NEAR-API-JS.
Immediate Actions Since Consensus
Right after Consensus, the product and engineering team reviewed all open issues in the Github repository and added these issues into our scrum process. We’ve refocused a number of engineers on improving the NEAR-API-JS.
1) Creating an On-Call Process
We’ve removed a stalebot that was causing trouble on the repository, and established a support response process that triages incoming issues and requests. These incoming issues are assigned to current sprints or added to the backlog based on severity and priority. Issues submitted in Github are directly connected to our internal ticketing system.
2) Automated the Process for PR and PR Template More
As always, we welcome contributors to help us to improve NEAR-API-JS. We have created Github actions and a CI/CD pipeline which will run tests against new PRs. With a more automated process, your PRs can now be tested automatically and reviewed by the maintainers. To encourage contribution, we’ve created a PR template for contributors linked here. For additional information on how to contribute to NEAR-API-JS, please check out our contributing.md.
3) Releases using Changesets
We have enabled a changesets workflow that is centered around “changeset” files. An human authored file containing both the version bump and the changelog entry. These files are committed and included in PR’s along with the code change itself (See example).
When planning a release, changeset files are combined to create a full changelog and determine required version bumps. After reviewing the result, a publish can be triggered. This process is automated with a Github action which tracks changesets merged to master and writes the result to a PR, and once this PR is merged, packages will be published. We hope this release process enables the team to publish releases more efficiently.
4) Looking Back and Ahead
We have now 62 open issues, down from 106 issues that we saw after Consensus. We are happy to report that we have merged many PRs contributed by the community. In the latest NEAR-API-JS v1.0.0 release, a new era begins for NEAR-API-JS.
Highlights in this Update:
These are some of the most critical updates coming to NEAR-API-js:
near-api-js v1.0.0 marks the beginning of proper semver versioning for near-api-js! From now on, breaking changes will be correctly represented by major version bumps, new features or added functionality will be represented as minor version bumps, and bug fixes will be represented by patch version bumps! See https://semver.org/ for more info.
You can now provide blockQuery as an argument to viewFunction and viewState calls (#863)
Lots of deprecated code has been removed, which simplifies TypeDoc descriptions for many commonly used functions
Account.viewFunction() now accepts its arguments as an object instead of positional arguments, making it consistent with other methods that have already undergone this migration such as Account.functionCall(), Account.signAndSendTransaction(). Using positional arguments for this function has been deprecated. (#918)
You can now await until sign in process is completely finished; this avoids a possible race condition where previously you could try to read a key from the keystore before it has been moved from 'temporary' to finalized state during initialization. (#842)
Attempting to use WalletConnection or WalletConnectedAccount objects outside of the browser context will now generate a user-friendly error message instead of throwing when trying to access local storage or the window object. (#896)
near-api-js now supports the latest version of Typescript (4.7)
Fixed a bug in JsonRpcProvider.txStatusReceipts() - providing txHash as a string rather than Uint8Array now works as expected (#866)
Account.findAccessKey() now throws a typed error if no key exists in keystore for the current account (#904)
Internal / Project Changes 🔍
We've also dedicated some time to improve the workflow and structure of the repository:
near-api-js is now a mono-repo! We are working towards modularization of the functionality that near-api-js provides, to allow more explicit dependency handling for code that runs in different environments (browser, node, react-native, etc.), better discoverability and documentation.
We are moving to a CI based development flow! Expect a more rapid cadence of releases as we get the CI pipeline fully configured and automate things like changelog generation.
Pull Request Deep-dive 🤿
From docs, to features and house-cleanup, here are all the PR's in this update:
PRs - Internal:
#940 - build(deps-dev): bump danger from 11.1.1 to 11.1.2 - 9c8d5d2
#934 - build(deps-dev): bump lerna from 5.3.0 to 5.4.3 - ae77e1b
#909 - Applied engines property on package.json - d4344ed
3. Marketing - Public roadmap, Blog Post, and Community calls
4. Documentation Enhancements
For the NEAR-API-JS future initiatives, we will be modularizing NEAR-API-JS into multiple new packages to support browser, node, react-native, and other environments. The first milestone will be to create modularization which allows each package to evolve to have explicit dependencies, improved tests, and better documentation. Each package will contain its own package.json. As a part of separating into new packages with each separately installable under the same org (e.g. npm install @near-js/browser-keystore, npm install @near-js/filesystem-keystore, etc.), we will be moving the near-api-js under a new namespace @near-js. The second milestone is to enhance each package to support different APIs specific to the environment. In addition, we will also be providing support for ES6 modules in addition to CommonJS modules. Finally, we will create a set of composable APIs and remove unnecessary coupling between classes.
To keep you – the community – up to date on what’s happening, we are releasing a public roadmap for NEAR-API-JS.
Contribute & Stay Up to Date
Want to stay up to date on what's happening in NEAR-API-JS? Please join us in the monthly NEAR Tools Community Meeting and register here https://near.ai/tooling-meetings. We have been sharing updates to NEAR-API-JS in community calls in July, August, and will continue to share what we are working on in future community meetings.
As always, if you have feature enhancements or bugfix requests, please open a Github ticket here. If you’d like to contribute, we are looking for contributions for the following issues: https://github.com/near/near-api-js/contribute.md. If you have any questions, please feel free to reach out to the Developers Relations Team at the office hours. We look forward to continued collaboration with you on NEAR-API-JS.