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
Track: react native support #2813
Comments
|
I appreciate you adding the label |
|
The latest update on my efforts related to this: Back to using the GitHub fetch polyfill which is bundled in React Native (rather than
|
I think this is true on a longer timescale, but I'm not sure if we have a good chance of getting this through on a short timescale. So I think it's worth patching here in the meantime. @achingbrain what do you think? |
We could use an approach like you all did with // TODO remove this when upstream fix for ky-universal is merged
// https://github.com/sindresorhus/ky-universal/issues/9
// also this should only be necessary when nodeIntegration is false in electron renderer
if (isElectronRenderer) {
exports.toFormData = require('./form-data.browser').toFormData
} |
|
Here is the tracking issue on the React Native repo facebook/react-native#27741 |
|
Reading that and the related issues, it doesn't sound like something they'll take on unless it becomes a priority for them, but it does sound like they are open to other people contributing a fix. Want to take a stab at PRing support in? |
|
Exactly these issues about half baked spec implementations need to be patch directly in rn or in a external package. |
|
Based on the latest comments on that issue, they're open to creating a fork of Here's the original discussion about the changes to be made to I added a related comment here about where these changes should land from the IPFS org's perspective #2847 (comment) |
|
https://www.npmjs.com/package/cross-fetch works in RN already...why not just use that? |
|
cross-fetch is just a wrapper problems the issue is much deeper in the stack |
|
@pcowgill @hugomrdias What's the status of this? I've got some spare cycles that I'd like to throw at it. |
|
@RobertFischer cycles? who wants to fund this? I'll take care of it. |
|
@x5engine If you're asking what @RobertFischer means by cycles, he means time to work on this. @RobertFischer @x5engine My comment on Mar 10 reflects the latest status on this as far as I know. My funding to work on this problem disappeared along with the pandemic, but I'd be happy to hop on a call to do a full debrief of the current state of things! |
|
@pcowgill I have no issues on this if you want to have a call and do a full debrief on how to get this working I would be very glad to be there and we can live stream it too! set a time |
|
I am currently working on using IPFS on react-native. On React-native: When I add a buffered string(i.e. Buffer(str) ) to IPFS using ipfs.add, the buffered string is added successfully and IPFS returns the hash. When I try to retrieve the buffered string via ipfs.cat and the hash, ipfs.cat returns [Error: XHR error]. So the returned variable is undefined. On Node.jS and ReactJs: I do not have this problem. Both ipfs.add and ipfs.cat works. Is this a problem with react native? is it related to fetching ? would changing the ipfs-http-client version in packag.json help? btw, i am using ipfs-http-client 27.0.0 Any suggestions would be highly appreciated |
|
@ZTECH10 nice show us a repo or something on how you did that? did you use an ipfs node or just the http api? |
|
Here is react-native sandbox with working get requests https://github.com/qalqi/react-native-ipfs-http-client/tree/primary/rn-nodeify |
|
@ZTECH10 Hi, I have started a project that is based on IPFS, have you found a fix or a workaround to this problem, any help would be appreciated, please provide an update on this. Thanks. |
|
actually, the easier way to do this is running ipfs in an invisible web view using react-native-webview and communicate with each other by using injectJavascript. but this solution has a weakness. i couldn't read data anymore after the app had been killed. when you need to read some data on schedule task in background, it would failed. |
|
also, i think the 'right' way to do this is implement the libp2p by swift and java. then ipfs, finally bring them into react native. but it's a difficult task |
|
I've been working on the side to get IPFS on React Native. As a part of that, I've created an implementation of Node's |
can you share how you get ipfs working on react-native? I still cant |
|
@RobertFischer thanks for doing the research into what needs patching for it to work. If you could share a demo repo that runs an app under React Native with IPFS I'm sure we could fix up up those modules (e.g. |
|
@achingbrain +1 |
|
I've been running some experiments with the HTTP client on RN (iOS simulator currently) for about two weeks now and I was already able to get
I've tested All of the above are just short-term hacks, of course. If we can get away with patching up RN's JS core here and there just to get things running quickly, we may have a short-term solution for app developers. At the same time, we are uncovering and documenting the issues within the platform. Later on, we must sit down with the RN team to discuss these issues and plan how they should be addressed, eventually generating contributions to up level the ecosystem. Next week, I'm going to have a look at other HTTP client's methods, such as A few RN issues I found related to this endeavour:
|
|
I've got Subscriptions operate on the basis of a long-running HTTP responses, i.e., an endless stream. As React Native does not support returning a To make pubsub subscriptions work, I have have polyfilled The patched |
|
Patches and polyfills are now available as a module: https://github.com/acostalima/react-native-polyfill-globals. |
|
This is epic |
|
Roadmap of work ahead:
Technical discussion takes place at react-native-community/fetch#4.
In general, there is evidence that the RN team is not interested in polyfilling or implementing standard web APIs and bundle them within RN's core due to bundle size concerns. Such concerns, as far as I know, are motivated by the Lean Core efforts. Past discussions related to the above:
Example APIs include: |
|
I've ran into a possible issue with the |
|
Found an issue in RN about the usage of |
|
Hi, has anyone managed to polyfill crypto? I use https://github.com/webview-crypto/webview-crypto but fails to serialize large files when I add(). EDIT: Managed to fix with webview-crypto/webview-crypto#8. |
|
@chrisdukakis I'm sorry, I have no clue as to why you're getting that error in libp2p. I'm not familiar with libp2p's codebase. |
|
I've also got a library that's a pure implementation of `randomBytes`:
https://github.com/RobertFischer/randombytes-pure
…On Sun, Jun 13, 2021 at 4:15 PM André Costa Lima ***@***.***> wrote:
@chrisdukakis <https://github.com/chrisdukakis> I'm sorry, I have no clue
as to why you're getting that error in libp2p. I'm not familiar with
libp2p's codebase.
I did polyfill window.crypto before, but I used
react-native-get-random-values
<https://github.com/LinusU/react-native-get-random-values>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2813 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAE5V7BSFBFR2MWQ2QBPL3TSUGWDANCNFSM4LASJE7A>
.
|
hugomrdias commentedMar 3, 2020
•
edited
Tracking:
Related
ipfs-http-client
https://github.com/ipfs/js-ipfs-http-client/issues/1117#issuecomment-589011968ipfs-inactive/js-ipfs-http-client#1224 (comment)this needs to be patched in react-native not herehttps://github.com/ipfs/js-ipfs-http-client/issues/1219#issuecomment-582846315close after proper fix for arrayBufferipfs-inactive/js-ipfs-http-client#1224
ipfs
#1254 nodejs-mobile, nodejs-mobile-react-native
#2768 nodejs-mobile-react-native
The text was updated successfully, but these errors were encountered: