Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

Avoid using synchronous file access in modules (eg. fs.readFileSync) #65

Open
aschrijver opened this issue Jul 21, 2017 · 2 comments
Open

Comments

@aschrijver
Copy link

I tried porting hypercore to React Native and try it on Android, but got stuck by the use of synchronous file access in various dat modules, like fs.readFileSync in hypercore-protocol (messages.js, line 5)

(already discussed about this with @mafintosh and @Karissa )

A full description of my issue can be found at stackoverflow:

General advice:

If future mobile support is in any way interesting to Dat, then use of incompatible Node objects methods should be avoided as much as possible!

@bcomnes
Copy link

bcomnes commented Jul 21, 2017

Can you use a transform like https://github.com/substack/brfs in the build process?

@aschrijver
Copy link
Author

Yes I intend to try, but right now I don't know how to integrate it without browserify.

And even then I wonder if it is smart to handle synchronous fs on android / ios

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants