datproject-discussions
datproject-discussions copied to clipboard
Avoid using synchronous file access in modules (eg. fs.readFileSync)
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!
Can you use a transform like https://github.com/substack/brfs in the build process?
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