-
Notifications
You must be signed in to change notification settings - Fork 27
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
chore: release 2.0.0 #405
chore: release 2.0.0 #405
Conversation
🚀 Release checklistBefore release
After release
|
Release notes:2.0.0 (2021-09-20)This is our first major version bump as we did a big revamp of 🤖 HTTP client swap (timeout and retries support)In the JS browser ecosystem, there are two main HTTP clients: old XMLHttpRequest (XHR) API and new modern We originally used We have therefore decided to use This change, unfortunately, does not come without a cost and that is support for tracking upload progress, that This change unfortunately is breaking as we originally exposed 🎏 Streaming revampAs part of the HTTP client revamp, we had a deeper look at how we handle streams. In the JS land, there are two main types of streams the NodeJS For stream inputs, we accept both types of streams and convert them internally. ⏎ Upload results refactorOne of our short-coming was dropping the returned object from upload methods in favor of the simple string 🫓 Utility namespace flatting and filteringWe have merged all the 🗾
|
14ba5b7
to
c222acf
Compare
ee5df4a
to
3765004
Compare
3765004
to
75bc8cb
Compare
The https://github.com/ethersphere/examples-js/tree/master/upload-progress link is a 404 for me |
I welcome the possibility to add retries to failed requests, but I am wondering if this can cause double spends, when a costly request succeeds partially but returns non 2xx HTTP status code. Not sure if there should be an action about this, and even a warning at most. |
BTW I think it is extremely well-written. On my first read I was not sure if we should link other open issues in release notes, but it is really thorough this way, so I am fine with it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice description of the changes
Yeah the links are not working, because they are yet to be merged (your case) or some of the API Docs are still not released.
Damn, I forgot to write about that. Thanks! The thing is that the retries work only for some methods and does not work for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great description of the release, thanks for your work @AuHau !
The browser-upload with axios-fetch
by the examples-js
upload example crashed my computer at trying to upload with 1GB data. I think either here or in the examples we should put a notice about do not upload big files from browser - because as you wrote it does not support streaming at uploads.
🤖 Release is at https://github.com/ethersphere/bee-js/releases/tag/v2.0.0 🌻 |
🤖 I have created a release *beep* *boop*
2.0.0 (2021-09-20)
This is our first major version bump as we did a big revamp of
bee-js
internals and fixed a few things and shortcomings that required breaking changes.🤖 HTTP client swap (timeout and retries support)
In the JS browser ecosystem, there are two main HTTP clients: old XMLHttpRequest (XHR) API and new modern
fetch
API.We originally used
axios
library that employs the XHR client, but XHR is old and will not get any new features as it is superseded withfetch
API that is actively developed by the WHATWG group, and hence it has its limitations. Many limitations can be overcome using polyfills etc. but a hard stop is networking that only browsers decide what to allow (usually based on the specification). In the case of XHR the limitation is streaming support.We have therefore decided to use
fetch
based libraryky
that supports streaming downloads and hopefully in close future will support also streaming uploads (see whatwg/fetch#966, there is also already functional experiment that enables this in Chrome).fetch
is also more future-proof.This change, unfortunately, does not come without a cost and that is support for tracking upload progress, that
fetch
still does not have (if interested please comment on the relevant whatwg/fetch#607 issue to raise importance).If this feature is crucial for you, we have devised a workaround thanks to @mattiaz9, which is demonstrated in our example
upload-progress
.This change unfortunately is breaking as we originally exposed
AxiosOptions
on our API. We have refactored this into more generic HTTP options that should be more future-proof. Thanks toky
we also now have support for retries of failed requests (only for non-POST
requests, defaults are seen here) and timeouts. Both are possible to set generally for theBee
instance and/or override it for each method call.🎏 Streaming revamp
As part of the HTTP client revamp, we had a deeper look at how we handle streams. In the JS land, there are two main types of streams the NodeJS
Readable
and the browser WHATWGReadableStream
. As our design mindset is browser-first and polyfill the rest in NodeJs, we have unified all returned streams into the WHATWGReadableStream
no matter what platform you are on. Most probably you will want to use NodeJsReadable
on NodeJs platform, so we have included utility functionreadableWebToNode
that converts WHATWG stream into NodeJs. There are also more stream-related utility functions that you can check out.For stream inputs, we accept both types of streams and convert them internally.
⏎ Upload results refactor
One of our short-coming was dropping the returned object from upload methods in favor of the simple string
Reference
. Later on, we discovered that there is actually a need to return more information from upload operations because Bee automatically creates a Tag for each upload that we could return. Hence we have introduced backUploadResult
interface that all the upload methods will now return.🫓 Utility namespace flatting and filtering
We have merged all the
Utils.*
namespaces directly intoUtils
and we have filtered out the functions only to those that make sense to expose in order to minimize the public API and possible future breaking changes.🗾
uploadCollection()
methodWe have introduced new
uploadCollection
method that is more flexible in uploading collection if you do not want to use our convenience methods likeuploadFilesFromDirectory()
oruploadFiles
. This new method accepts theCollection<Uint8Array | Readable>
interface.⚠ BREAKING CHANGES
bee-js
are now reported withUser-Agent: bee-js/<<bee-js's version>>
(refactor!: ky replaces axios #390)Utils.setDefaultHeaders()
was removed in favor ofBee
/BeeDebug
instance's optiondefaultHeaders
(refactor!: ky replaces axios #390)Utils.hooks.*
was removed in favor ofBee
/BeeDebug
instance's optionsonRequest
andonResponse
WHATWG ReadableStream
. If you need NodeJS's Readable you can useUtils.readableWebToNode()
utility function. (refactor!: ky replaces axios #390)axiosOptions
were removed from those methods that supported it (for examplebee.downloadReadableData()
,bee.reuploadPinnedData()
,UploadOptions
does not haveaxiosOptions
property anymore) (refactor!: ky replaces axios #390)fetch
does not support tracking of upload progress (like XHR/axios supported with theonUploadProgress
). Please see our exampleupload-progress
for work-around. (refactor!: ky replaces axios #390)UploadResult
interface (feat!: return tags for uploads #408)bee.pssSend()
now throws error if the specified target exceeds maximal value. UseUtils.makeMaxTarget()
that will give you the max target that Bee accepts. (fix!: pss target length verification #384)Utils
namespace is flattened and limited on the functions (refactor!: utility module flatting and limiting #395)Other changes:
Features
UploadResult
for upload methods (#408) (e58b8e8)Bug Fixes
Code Refactoring
This PR was generated with Release Please. See documentation.