emscripten-core / emscripten-core/emscripten
[WasmFS] FS.readFile on main thread
Open
wasmfs
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
When exporting and sharing files, we need to move the file into a File or a Blob object.
` const blob = new Blob( [FS.readFile( path )], { 'type': type } );`
With an asynchronous wasmfs file system (OPFS, IndexedDB), `FS.readFile( path )` appears to cause Safari browsers to freeze. Chrome and Firefox seem to work, but with a warning about blocking on the main thread. Perhaps there could be a way to access an OPFS file directly as a blob without using FS.readFile and not asynchronously?
Contributor guide
Assessment
This issue has not been assessed yet.