Releases: ethersphere/bee-js
v4.0.0
4.0.0 (2022-05-18)
This release brings several new features and one ad-hoc breaking fix that is passed on from the new Bee version 1.6.0, but affects only the BeeDebug.getReserveState()
method.
💮 ENS support
Bee supports ENS for resolution of ENS domains into Swarm references. bee-js
was until now refusing ENS domains with the input validation. Now we are bringing support for all the download*
methods and a few other ones as well.
🗂. Get Feed's specific update
The FeedReader.download()
function now accepts an option index
where you can specify which of the feed's updates you want to download.
❓ Is Feed Retrievable?
There is a new method Bee.isFeedRetrievable()
that helps you to check whether a given feed is available.
It operates in two modes. If you know the last index of the feed update then you can use it as an optional parameter and then be sure that this update is present in the network. If you won't specify the index
parameter, then it will check for the "latest" update by traversing all the known updates from the start. This does not guarantee though that the found "latest" update is indeed the latest one though and hence provides a weaker guarantee.
⚠ BREAKING CHANGES
- updated interface returned by
BeeDebug.getReserveState()
based on Bee 1.6.0 (#675)
Features
- ens support for download methods (#659) (e72c4b4)
- fetch specific feed index update (#629) (a4672dc)
- is feed retrievable support (#641) (e1071b0)
Bug Fixes
@ethersphere/bee-js v3.3.4
@ethersphere/bee-js v3.3.3
@ethersphere/bee-js v3.3.2
This is another small release that brings support for Bee 1.5.0 and a few small improvements.
🔌 Node endpoint
The Bee 1.5.0 introduced new mode called ultra-light mode. This mode has been added to the existing BeeModes
.
🧱 EcmaScript Modules
The bee-js v3.3.0 introduced support for ES Modules. In 3.3.2 we include several fixes to resolve some of the reported issues and broken builds.
Bug Fixes
@ethersphere/bee-js v3.3.1
This is a patching release that targets especially issues discovered thanks to the introduction of the ESM hybrid build. The main change is that if you want to use the function Utils.readableWebToNode()
in browser then you have to polyfill stream
package with your bundler.
Major changes of the last 3.3.0 release are:
🧱 EcmaScript Modules support
We plan to migrate our bee-js package to ES Modules (see the issue for more info) when Node v12 will reach its end-of-life (on 30th of April). With this release, we are starting a transition period by supporting both ES Modules and CommonJS builds. Please start migrating your applications to the ESM stack otherwise, you won't be able to upgrade bee-js after we drop support for CommonJS.
❓ Is supported version?
Since we are in a fast-paced environment where Bee's versions can be incompatible with each other, it is important that in your application you check whether the Bee that you connect to has the correct version that you expect and support (through bee-js
).
Untill now we had the isSupportedVersion()
function that indicated if the Bee node version is not matching the one that bee-js
was tested and built against. This implementation has its downside because it is very strict and if for example there is a small Bee's release that patches only something internal and does not touch the API, which means that the bee-js
should be compatible, you will still get a false
with this check.
Except for Bee's version itself, there are two other versions that version the Bee endpoint's API and the Bee Debug endpoint's API. We have decided to implement methods that do compatibility checks using these versions and hence should be more relaxed towards Bee's small patches but might pose some risk if some change will be unnoticed and API versions not bumped accordingly.
These methods are:
BeeDebug.isSupportedExactVersion()
- renamedisSupportedVersion
which is now deprecatedBeeDebug.isSupportedMainApiVersion()
which checks compatibility only for the main Bee endpointBeeDebug.isSupportedDebugApiVersion()
which checks compatibility only for the Bee Debug endpointBeeDebug.isSupportedApiVersion()
which checks compatibility for both endpoints
The compatibility is checked using the major versions of the API. If you would like to make your own assertions you can get all the versions (both from Bee itself and the one that bee-js should support) using the method BeeDebug.getVersions()
Bug Fixes
- add js suffix in imports for esm support with babel (#562) (62489aa)
- create minified browser bundle for release (#549) (b92fdb0)
- drop readable stream (#565) (3e36ccc)
- exposing ky options (#553) (085c565)
- making readable-stream optional (#556) (4983fdc)
- rename the browser bundle in order not to break unpkg.com (#552) (7076d94)
- use default import styles for esm compatibility (#550) (90aaf7b)
@ethersphere/bee-js v3.3.0
This is a smaller update with two main changes.
🧱 EcmaScript Modules support
We plan to migrate our bee-js package to ES Modules (see the issue for more info) when Node v12 will reach its end-of-life (on 30th of April). With this release, we are starting a transition period by supporting both ES Modules and CommonJS builds. Please start migrating your applications to the ESM stack otherwise, you won't be able to upgrade bee-js after we drop support for CommonJS.
❓ Is supported version?
Since we are in a fast-paced environment where Bee's versions can be incompatible with each other, it is important that in your application you check whether the Bee that you connect to has the correct version that you expect and support (through bee-js
).
Untill now we had the isSupportedVersion()
function that indicated if the Bee node version is not matching the one that bee-js
was tested and built against. This implementation has its downside because it is very strict and if for example there is a small Bee's release that patches only something internal and does not touch the API, which means that the bee-js
should be compatible, you will still get a false
with this check.
Except for Bee's version itself, there are two other versions that version the Bee endpoint's API and the Bee Debug endpoint's API. We have decided to implement methods that do compatibility checks using these versions and hence should be more relaxed towards Bee's small patches but might pose some risk if some change will be unnoticed and API versions not bumped accordingly.
These methods are:
BeeDebug.isSupportedExactVersion()
- renamedisSupportedVersion
which is now deprecatedBeeDebug.isSupportedMainApiVersion()
which checks compatibility only for the main Bee endpointBeeDebug.isSupportedDebugApiVersion()
which checks compatibility only for the Bee Debug endpointBeeDebug.isSupportedApiVersion()
which checks compatibility for both endpoints
The compatibility is checked using the major versions of the API. If you would like to make your own assertions you can get all the versions (both from Bee itself and the one that bee-js should support) using the method BeeDebug.getVersions()
Features
@ethersphere/bee-js v3.2.0
This is after some time a bigger update that brings some new goodies from Bee 1.4.1 version and improved error handling and support.
↔️ Direct upload support
Bee introduced direct upload mode, where Bee directly pushes the data to the network instead of the intermediate step of locally saving the data and then syncing it with the network. You can enable this behavior by passing deferred = false
into UploadOptions
interface. When you enable this mode the Promise
returned by the upload methods will resolve only once the data is uploaded and synchronized with the network so if you use timeouts you should adjust those base on the size of data you upload.
Currently, the direct upload mode is by default turned off, but it is a plan in the future to enable this behavior by default!
⁉️ Error handling
Now BeeResponseError
and BeeRequestError
instances contain information about the request (and if applicable also response) that triggered the Error. Also, it has improved for non-JSON responses that were causing unclear errors.
⚠️ Deprecations
In this release, there are two changes in Interface's names that are non-breaking as there are backward compatible aliases, but these aliases will be removed with the next breaking change.
- Interface
DebugPostageBatch
was renamed toPostageBatch
- Interface
NodesInfo
was renamed toNodeInfo
Features
- direct upload support (#504) (e05fae7)
- exposing request and response configuration on BeeResponseError (#517) (7448958)
- node 17 support (#507) (c9e727a)
Bug Fixes
@ethersphere/bee-js v3.1.0
This is another small release that brings support for Bee 1.4.1 and a few small improvements
🔌 Node endpoint support
The Bee 1.4.1 release brought a new endpoint on Debug API called /node
which provides information about in what mode the Bee node runs (such as dev mode, light mode, or full mode or information about gateway mode).
🔗 Chunk endpoint supports
We used chunk endpoints internally in bee-js but now we have decided to expose them for your usage as well.
∵ Stamp usage utility functions
In order to calculate the usage of a postage stamp (eq. percentage in form of a number between 0 and 1) we have added a small utility function that calculates it called getStampUsage()
.
Features
- exposing chunk functionality (#472) (b121dcb)
- node endpoint support (#479) (11731d3)
- stamp usage utility function (#470) (b53edd1)
Bug Fixes
@ethersphere/bee-js v3.0.0
This is a small release in size, but big on impact. It is a breaking release thanks to breaking changes introduced in Bee 1.4.
⚠ BREAKING CHANGES
- dropping postage stamps methods from
Bee
class (#458)
Features
- dropping bee class postage stamps methods (#458) (98afdcd)
- openapi versions in
/health
endpoint and methods (#459) (98afdcd)