Closed kasperisager closed 2 years ago
I ran a bundled version in a browser and encountered the following issues:
Hypercore
extends EventEmitter
.sodium-javascript
references global
. It should be globalThis
.hypercore-crypto
also uses Buffer
.sodium-javascript
lacks crypto_secretstream_xchacha20poly
and also uses Buffer
.streamx
uses EventEmitter
.noise-curve-ed
uses sodium-native
, not sodium-universal
.noise-handshake
uses bint8array
which uses string_decoder
which uses safe-buffer
which also uses Buffer
.@hyperswarm/secret-stream
also uses Buffer
.random-access-memory
uses process.nextTick
and also uses Buffer
.random-access-storage
uses process.nextTick
and EventEmitter
.With all of those patched in my local dependency tree, I can construct a Hypercore
in the browser, though it doesn't correctly open yet.
Nice, good to track.
Looks great, merging.
@kasperisager loving this, wondering how we could test this... maybe just manually bundling?