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

Fixing issue where plugin was still writing to stream when closed off #351

Closed
wants to merge 1 commit into from

Conversation

jjgonecrypto
Copy link
Contributor

This is incomplete (missing the options.banner prepend, and broken tests) but I did find the culprit of #350.

Basically, instead of using the bundle callback, we need to pipe instead (see here), as the latter ensures that the entire pipeline is complete before piping. In this case - that all the files in the pipeline have completed. (You can see factor-bundle here is adding the files to the browserify pipeline).

That said, I'm not using the grunt writer - I'm not that familiar with grunt - is that a concern?

This is obviously a significant change, and hence I wanted to run it by you first @tleunen. (Also, I changed the self to bind(this) as I went along, as I loathe the self = this pattern. It's not a deal-breaker though by any means)

@jjgonecrypto
Copy link
Contributor Author

Ugh - this doesn't seem to be working. I'm still getting intermittent failures

@jjgonecrypto
Copy link
Contributor Author

As mentioned in issue, it is due to this reality: browserify/factor-bundle#61

@tleunen
Copy link
Collaborator

tleunen commented Aug 21, 2015

Nice find. Hopefully you'll find a way to solve this

@jjgonecrypto
Copy link
Contributor Author

This is one solution, but requires modifying both factor-bundle to return the output streams and having grunt-browserify listen for them specifically (sub-optimal). browserify/factor-bundle#61 (comment)

What I'd prefer is to have factor-bundle inject the streams it has into the wrap part of the browserify pipeline, such that b.end would only emit when the common and ALL the factor-bundles are complete, but as I mentioned there, I'm struggling to understand how do do that.

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 this pull request may close these issues.

2 participants