-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Provide function for building a pipeline #1433
Comments
Somewhat related to #1269 - we don't bring things into core that already exist in userland and don't fit our very narrow scope. For the 4.0 release, I'd love to have some docs contributed that list common and recommended userland modules, like https://www.npmjs.com/package/mississippi. If you'd like to contribute the beginnings of that documentation, that would be awesome. |
Indeed, mississippi or its components pump or pumpify seem to solve the same problem my code snippet addresses, albeit with apparently larger overhead due to additional functionality not needed here. When adjusting the docs, I'd personally suggest using this functionality everywhere Comparing |
@gagern We're pretty dedicated on sticking to the normal stream usage - the idea is that if you know node, you know gulp. We don't like to invent any of our own stuff, which is why we stick with core streams and simple async functions for everything. |
@contra I know and appreciate that idea. One thing I like about gulp is that I can understand its mechanics pretty easily. But the fact remains that the |
@contra, while #358 is certainly interesting to read, and I did add my $0.02 to it, it's focus is the unpipe event associated with an error. Here I'm not worried about unpiping, but about error events ending up at the default stream error handler instead of some place where gulp will know that the task in question failed. These are in my opinion distinct problems, and while some solutions address both of them, it is far from obvious to me that they should be addressed together. Anyway, in #358 (comment) I described how my suggestion here (of providing a |
Stream pipelines are a nice elementary building block. However, errors don't usually propagate down the stream. I wonder whether it would make sense to have gulp export a function like this:
Then you could change the documentation to suggest that users use this function instead of manually building up the pipeline. One example from the docs would now read
I think that dropping the calls to
.pipe
adds clarity to this formulation. And the fact that gulp has ultimate control over how the pipeline gets built means that it can be more flexible in how to handle these things, e.g. in terms of error propagation. In doing so it might take attributes of the individual streams into account, which might avoid some of the monkey-patching we see today.Has this been discussed before?
How do you feel about this idea? Should I write a pull request for this?
Are there any specific issues affected by this which should be investigated further?
The text was updated successfully, but these errors were encountered: