-
Notifications
You must be signed in to change notification settings - Fork 892
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
getBytes #4973
getBytes #4973
Conversation
|
Binary Size ReportAffected SDKs
Test Logs |
Size Analysis Report |
4dd2790
to
261f5d1
Compare
Changeset File Check
|
ca48914
to
2e29beb
Compare
ee67537
to
ad2374e
Compare
This adds a Node and a Browser specific build so we can have getStream() in Node and getBlob() in browsers
a2a58f6
to
4d58d30
Compare
df4bb83
to
9c7e6b9
Compare
return super | ||
.send(url, method, body, headers) | ||
.then(() => (this.xhr_.response as Blob).arrayBuffer()) | ||
.then(data => { |
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.
Need to ensure this never throws
Adds
getBytes
,getBlob
andgetStream
APIs which allows file downloads without a public download URL. These bytes can then be used directly as an image source.This PR contains a bunch of refactors to make this possible:
Connection<string>
,Connection<ArrayBuffer>
andConnection<ReadableStream>
.ConnectionPool
.ConnectionPool
mostly seemed to be used to facilitate dependency injection for unit tests and never re-used connections. Instead, I added manual global overrides that provide the same functionality. This is not as elegant as before, but it allows the unused connections to be tree-shaken.Fixes #76