Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to readable-stream@3 #17

Closed
billiegoose opened this issue Nov 6, 2018 · 7 comments · Fixed by #18
Closed

Update to readable-stream@3 #17

billiegoose opened this issue Nov 6, 2018 · 7 comments · Fixed by #18

Comments

@billiegoose
Copy link

It's holding webpack back at readable-stream@2.

Also, just genuinely curious... what is this module shimming that isn't provided by readable-stream?
I noticed this curiosity in node-libs-browser (Webpack's native Node shims):

exports.stream			= require.resolve('stream-browserify');
exports._stream_duplex		= require.resolve('readable-stream/duplex.js');
exports._stream_passthrough	= require.resolve('readable-stream/passthrough.js');
exports._stream_readable	= require.resolve('readable-stream/readable.js');
exports._stream_transform	= require.resolve('readable-stream/transform.js');
exports._stream_writable	= require.resolve('readable-stream/writable.js');

Why don't they just use

exports.stream			= require.resolve('readable-stream');
@billiegoose
Copy link
Author

(Genuinely wondering because this module is 3 years old.)

@goto-bus-stop
Copy link
Member

readable-stream is not quite the same as the 'stream' module in core. readable-stream does not provide the barebones streams1 API, only streams2+. stream-browserify includes that legacy API.

the _ exports are because you can technically do require('_stream_readable') in core. I don't know anything that relies on that, but usually it turns out that something somewhere does 😸

@goto-bus-stop
Copy link
Member

i'm working on this for browserify v17 btw, hopefully updating this module this week.

@billiegoose
Copy link
Author

@goto-bus-stop You're my hero by the way. You've been seriously 🚀 on closing the Gap List

@kkamalesh
Copy link

any update on this..im also facing the same issue.

@guimard
Copy link

guimard commented Dec 2, 2019

Hi,

here is a working patch:

--- a/index.js
+++ b/index.js
@@ -25,11 +25,11 @@
 var inherits = require('inherits');

 inherits(Stream, EE);
-Stream.Readable = require('readable-stream/readable.js');
-Stream.Writable = require('readable-stream/writable.js');
-Stream.Duplex = require('readable-stream/duplex.js');
-Stream.Transform = require('readable-stream/transform.js');
-Stream.PassThrough = require('readable-stream/passthrough.js');
+Stream.Readable = require('readable-stream/lib/_stream_readable.js');
+Stream.Writable = require('readable-stream/lib/_stream_writable.js');
+Stream.Duplex = require('readable-stream/lib/_stream_duplex.js');
+Stream.Transform = require('readable-stream/lib/_stream_transform.js');
+Stream.PassThrough = require('readable-stream/lib/_stream_passthrough.js');

 // Backwards-compat with node 0.4.x
 Stream.Stream = Stream;

@kumavis
Copy link

kumavis commented Dec 27, 2019

relevant browserify issue browserify/browserify#1880

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

Successfully merging a pull request may close this issue.

5 participants