Releases: streamr-dev/streamr-client-javascript
Minor Release: v5.2.1 – Fixes critical memleak
This release fixes a subtle but serious memleak in all previous 5.x
versions. Upgrading immediately is highly recommended.
Bug Fixes
Minor Release: v5.1.0
New Features
- Added
withdrawToMainnet
option to DataUnions withdraw methods. Defaults totrue
. Set tofalse
to withdraw tokens to sidechain. See README for more info. #220.
Docs
- DataUnions Docs Rewrite in README. #222.
- Added auto-generated DataUnion Docs #219
- Added auto-generated API docs for rest of client. #221
- Various README Updates
Refactoring
- Centralized Ethereum address validation in Client Config. #223
Testing & CI
- Added new workflow to build docs in CI. #221
- Split CI jobs into code & build tests workflows. The build tests require a built client. Allows more granular rerunning of CI tasks.
Patch Release: v5.0.1
Changes
- Ensure readme & license are included in published npm package.
Major Release: v5.0.0
After 528 commits and the combined efforts of the Streamr team streamr-client
5.0.0 is here.
This is basically a new Streamr client with rebuilt internals. The external interface remains largely the same, with some notable changes listed below.
Improvements
- New subscription “pipeline” architecture.
- Many more tests, more edge cases covered.
- More robust/understandable/consistent connection/disconnection handling.
- No more event spaghetti & uncatchable errors.
- No more unavoidable console logging.
- More predictable behaviour around error handling & connection issues.
- Significant improvements to CI workflow, many more (52) test scenarios.
Breaking Changes
subscribe
/resend
methods are nowasync
.getAddress
is nowasync
- No more
subscribed
event. Thesubscribe()
promise now resolves when this would have fired. - No more
no_resend
event, nowresent
is fired whether there were messages or not. autoConnect
+autoDisconnect
options become forcibly disabled if you explicitly callconnect()
ordisconnect()
. You can reenable automatic behaviour without creating a new client or mutating options usingclient.enableAutoConnect()
/client.enableAutoDisconnect()
. This means if you explicitlyconnect()
you must explicitlydisconnect()
orenableAutoDisconnect()
to close the connection.connect()
&disconnect()
no longer error if already {dis}connecting/{dis}connected. This is basically whatensureConnected
/ensureDisconnected
provided before.- The
ensureConnected
/ensureDisconnected
methods still exist but are now just aliases ofconnect
&disconnect
. - Many DataUnion methods have been renamed and/or changed, see below.
DataUnion changes
DataUnion is now an object which we can operate on. To get an instance of DU object, call client.getDataUnion(contractAddress)
. As the object encapsulates the contract address, we don't need to specify it when we access the DU methods.
Some methods that need a member address were previously optional, and the default value for those was the currently authenticated user. Now we are more explicit about the parameter and the member address is always required. Also previously there was a dataUnion
client option which was a default value for some DU actions. That is no longer supported.
Some options of these methods have changed. Options for new StreamrClient(opts)
have moved to a separate dataUnion block, and some properties renamed.
Member join functions
- renamed
joinDataUnion()
->join(secret?)
, if secret is given this will wait until the automatic join request has been processed - added
isMember(memberAddress)
, returns true if the member is an active member - removed
hasJoined()
Withdraw functions renamed to have word "all" if the amount is not specified
withdrawAll(options?)
withdrawAllTo(recipient, options?)
signWithdrawAllTo(recipientAddress)
signWithdrawAmountTo(recipientAddress, amountTokenWei)
- admin:
withdrawFor()
->withdrawAllToMember(memberAddress, options?)
- admin:
withdrawAllToSigned(memberAddress, recipientAddress, signature, options?)
- removed methods that returned the raw withdraw transactions removed:
getWithdrawTx()
,getWithdrawTxTo()
,getWithdrawTxFor()
Public query functions
- renamed
getDataUnionStats()
->getStats()
, data format changed getMemberStats
data format changed- renamed
getBalance()
->getWithdrawableEarnings(memberAddress)
- removed
getMembers
(not currently supported)
Admin functions:
client.deployDataUnion(options)
waits until the deployment is ready- renamed
kick()
->removeMembers(memberAddressList, options?)
New Features
- Subscription objects are async iterable. You can access this interface if you don’t supply an
onMessage
handler tosubscribe
/resend
. Note the iteration producesStreamMessage
objects, rather than the message content, as passed as the first argument toonMessage
. To get the message content callstreamMessage.getParsedContent()
. - Added a
collect()
function to subscriptions that collects results into an array of messages and resolves when the subscription ends, mainly/only useful for resends. Won't work if you supply anonMessage
handler. Requires explicit ending of subscription. - Connection emits
done
when it's been disconnected and will not reconnect. - Connection emits
connected
only when it's connected and will not be immediately disconnecting.
Other Notable Changes
- Public interfaces are now typed with TypeScript. Internals are currently in the process of being converted.
- Random errors no longer disconnect the client.
- Reconnecting on unexpected disconnection should work reliably now, there's a hard distinction between user-initiated disconnects and those that happen by accident.
- Resends should work more reliably now.
- Cleaned up and improved logging. Logging is overall more verbose but it should be much clearer what’s going on. All logging goes through
Debug('StreamrClient*')
except errors emitted by client. - Subscribe, resend & subscribe with resend all use the same machinery now, so their behaviour should now be identical. Previously there were some small differences which led to confusion.
- Uses latest version of streamr-client-protocol
8.0.0
.
Bundling & Builds
- Removed regenerator babel transform.
- Node builds are no longer webpack bundles. Just normal JS files & requires.
- source-maps are now always on for web bundles.
- New BundleAnalyzerPlugin produces a bundle size report in
dist/report.html
. This is downloadable as an artifact in CI builds.
Testing
- Almost all functionality is now tested via integration tests, rather than implementation-coupled+heavily mocked unit tests.
- Encryption & signing is tested in the browser now
- Publishing & subscribing, with and without encryption/signing is tested against the Java client using streamr-client-testing
- Added Encryption & signing benchmarks
- Significant improvements to test reliability.
- Significant improvements to CI workflow.
v0.11.0-beta.1
(BETA) In this release also the Node.js version is transpiled with Webpack. That solves multiple issues when streamr-client
is used in some other Webpack project. Also gives compatibility with older Node.js versions.