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

Pushing a stream to 'wrap' in the internal pipeline broke in 9.0.5 #1200

Closed
mantoni opened this issue Apr 7, 2015 · 9 comments
Closed

Pushing a stream to 'wrap' in the internal pipeline broke in 9.0.5 #1200

mantoni opened this issue Apr 7, 2015 · 9 comments

Comments

@mantoni
Copy link
Contributor

mantoni commented Apr 7, 2015

Making the output bundle readonly seems to break a feature that is very important to Mochify (See issue mantoni/mochify.js#80).

When I push a stream to b.pipeline.get('wrap'), the stream is not part of the browserify output. The pipeline modification is done before the call to bundle().

Please advice if there is anything I can do to work around the issue.

@pyrsmk
Copy link

pyrsmk commented Apr 7, 2015

Probably the same problem that I have with browserify >9.0.2 and merging streams in gulp.

@terinjokes
Copy link
Contributor

Making the output bundle read-only had no effect on b.pipeline, it is the same labeled-stream-splicer it's documented to be.

I tried creating a reproducible case (front the root directory of node-browserify), and was unable to reproduce your report, I got the expected amount of "hello world"s, and a single "hello, spawn".

See https://gist.github.com/terinjokes/0b198b330fabb52b6b5f

@mantoni
Copy link
Contributor Author

mantoni commented Apr 7, 2015

@terinjokes Thanks for looking into this. The only reproducible example that I know currently is the Mochify test suite (https://github.com/mantoni/mochify.js). I nailed browserify to v9.0.4 to make the tests pass. Upgrading browserify to any newer version causes half the test suite to fail. Since the only change seems to be the one that makes the pipeline readonly, I suspected it must have something to do with that.

@jokeyrhyme
Copy link

I had to update the way I use gulp after browserify 9.0.5. I used the following recipe for hints:
https://github.com/gulpjs/gulp/blob/master/docs/recipes/browserify-transforms.md

@erykpiast
Copy link

@jokeyrhyme, how do you do it now? I used to combine JSHint and Browserify in the way that doesn't work now because of read-only stream. Probably I should learn how streams work, but well... (lazy programmer mode on). Anyway, I do it like that:

gulp.src(files)
        .pipe(jshint())
        .pipe(bundler.bundle())
        .pipe(source(bundleName))
        .pipe(gulp.dest(bundleDir))

Seemed reasonable until that breaking change...

@mantoni
Copy link
Contributor Author

mantoni commented Apr 15, 2015

I worked around the issue by using the browserify pipeline directly: mantoni/mochify.js@efaf1b3

This is fine in my case since I'm extending the pipeline anyway. Still this feels wrong to me.

@jokeyrhyme
Copy link

@erykpiast oh, that recipe I linked is working perfectly for me now: https://github.com/gulpjs/gulp/blob/master/docs/recipes/browserify-transforms.md

The original version of that guide was what I started with ages ago, and that version of the guide no longer works after browserify 9.0.5: https://github.com/gulpjs/gulp/blob/064e2fceb96/docs/recipes/browserify-transforms.md

@erykpiast
Copy link

Ok, get it, thank you! I have a problem because of JSHint, so I guess I have to fix that in some other way.

@mantoni
Copy link
Contributor Author

mantoni commented Apr 20, 2015

For reasons that are beyond my understanding, this is not an issue anymore with 9.0.8. Closing.

@mantoni mantoni closed this as completed Apr 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants