-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Add blob support to fetch and expo-file-system/next #33152
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
Conversation
The Pull Request introduced fingerprint changes against the base commit: 6e5ad8a Fingerprint diff[
{
"op": "changed",
"beforeSource": {
"type": "dir",
"filePath": "../../node_modules/expo",
"reasons": [
"rncoreAutolinkingAndroid",
"rncoreAutolinkingIos"
],
"hash": "ada6b5d2cba3410ae54d4f85d2689c3a3b1bb5df"
},
"afterSource": {
"type": "dir",
"filePath": "../../node_modules/expo",
"reasons": [
"rncoreAutolinkingAndroid",
"rncoreAutolinkingIos"
],
"hash": "b6c69888227b0d6a85184cbd39fb652469cd4b9c"
}
},
{
"op": "changed",
"beforeSource": {
"type": "dir",
"filePath": "../../packages/expo",
"reasons": [
"expoAutolinkingIos",
"expoAutolinkingAndroid",
"expoConfigPlugins",
"expoConfigPlugins"
],
"hash": "6c65f85f5e738cfcb8164aa052bb105e6f559bef"
},
"afterSource": {
"type": "dir",
"filePath": "../../packages/expo",
"reasons": [
"expoAutolinkingIos",
"expoAutolinkingAndroid",
"expoConfigPlugins",
"expoConfigPlugins"
],
"hash": "0ea4158d71d27ee22601f55e5b8bd8d559bd9118"
}
},
{
"op": "changed",
"beforeSource": {
"type": "dir",
"filePath": "../../packages/expo-file-system/android",
"reasons": [
"expoAutolinkingAndroid"
],
"hash": "4d66a24190dbbed8cbeb6fbfb46ac97c36ad4be7"
},
"afterSource": {
"type": "dir",
"filePath": "../../packages/expo-file-system/android",
"reasons": [
"expoAutolinkingAndroid"
],
"hash": "62bcd9d9f167b587fa977cd2f9e6ced468dcd513"
}
},
{
"op": "changed",
"beforeSource": {
"type": "dir",
"filePath": "../../packages/expo-file-system/ios",
"reasons": [
"expoAutolinkingIos"
],
"hash": "aa7b2b32eaf0555b0af606eaf229095d3be94423"
},
"afterSource": {
"type": "dir",
"filePath": "../../packages/expo-file-system/ios",
"reasons": [
"expoAutolinkingIos"
],
"hash": "36ad27889e56b6530c5306f62fa4f10a6215f3af"
}
}
] Generated by PR labeler 🤖 |
Subscribed to pull request
Generated by CodeMention |
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.
I like this API; functions like .blob
are pretty nice to use. Ideally, I prefer to avoid converting one object into another, but since we cannot do so here without changing the current API.
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.
that's fantastic! didn't expect the api and implementation would be as clean as in this way. thanks for the great work.
i just left some nit comments and it overall looks great.
Co-authored-by: Tomasz Sapeta <[email protected]>
Co-authored-by: Tomasz Sapeta <[email protected]>
Co-authored-by: Tomasz Sapeta <[email protected]> (cherry picked from commit dee32cc)
Writing a more detailed description on this one – as @brentvatne mentioned support for blobs has been a topic that has been ongoing for a while so it justifies some of discussion.
Why
I'm working on the new filesystem package, which also includes network capabilities for file upload/download.
While we need dedicated functions for downloads, uploads, resumability, ect., I still feel that supporting web APIs is critical to ensure 3rd party libraries and general JS patterns work for what is ultimately a basic usecase.
In detail, this PR allows the following code to work:
Directly passing a blob in also works:
We can also consider moving blob to core, but since it's a pretty well defined interface I think it works if we just implement it – I don't think there's much to gain from passing the entire blob to native, instead we can pass a TypedArray.
Test Plan
Test suite tests. I've also tested them with a docker container that correctly saves an image file.
Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).