You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, browserify's streams implementation uses a fake Buffer object from browserify-buffer that behaves weirdly. We really want it to use bops so it uses the environment's native buffer type.
// defunctzombie: https://github.com/alexgorbatchev/node-browser-builtins/tree/master/builtin
// defunctzombie: take the stream files
// defunctzombie: stream.js
// defunctzombie: and the __stream shit
// defunctzombie: put them all into a repo
// defunctzombie: maybe called bops-stream I dunno
// defunctzombie: and update the uses of Buffer('foobar') or whatever to use bops
// defunctzombie: if the bops was API compatible you could just change require('buffer') to require('bops');
// feross: right
// defunctzombie: then in your module just require('bops-stream'); and you will be set
// feross: and use it in place of require('stream')?
// defunctzombie: this will be nice since others will be able to use your module too
// defunctzombie: yep
The text was updated successfully, but these errors were encountered:
This is not needed anymore. The approach I used instead was to write native-buffer-browserify which emulates the node Buffer API but is backed by a Uint8Array (native browser buffer). So now we can just use the existing browserify streams implementation and eliminate bops from all the modules that we use. native-buffer-browserify will be merged into browserify soon.
By default,
browserify
's streams implementation uses a fakeBuffer
object frombrowserify-buffer
that behaves weirdly. We really want it to usebops
so it uses the environment's native buffer type.I think @defunctzombie's approach will work:
The text was updated successfully, but these errors were encountered: