-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Blob constructor is not spec compliant #44125
Comments
|
Hi @shamilovtim, I'm looking into this. Blob on RN is String based and does not provide any stream/binary API. Could you describe your usage/need? So we can find out what else we should do to make Blob more usable. |
The problem is that everyone on web builds on the Blob specification which is available on other platforms and browsers but RN's Blob does not meet these specifications. Then when libraries are used in RN they break because they rely on broken / incomplete Blob. To describe what I need
|
Somewhat related to this, and specifically related to this part:
I guess that this is the reason that |
Just to forestall any duplicate efforts to fix I think @grabbou is working on a real Blob implementation |
Yeah, thanks for mentioning me. I am indeed working (releasing this week - I hope) a spec complaint Blob with both steam and array buffer and a bunch of other improvements. Please reach out to me grabbou@gmail.com and we will coordinate to make sure it does fix your issues. It's not something I'll be sending as a PR to RN Core since it's based on Nitro. However, as a short term hot fix, I think you can polyfill missing methods. In case of arrayBuffer, just create one by using text encoder and string value of Blob. |
Description
The constructor for React Native's Blob has a comment:
BlobManager confirms this:
This API is not spec compliant, since this is what the Blob specification specifies:
Steps to reproduce
See that RN doesn't support Blobs composed of anything but Blobs or strings.
React Native Version
0.73.6
Affected Platforms
Runtime - Android, Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
N/A
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: