-
-
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
gulp.src and gulp.dest logic should be a separate package #28
Comments
I'm thinking that
and I've been looking for a good API to read files from multiple directories, and process them before copying to a destination for a long time. This might be the one, since it allows piping multiple transforms in a easy way. |
Rambling a bit here... @millermedeiros I can merge the file format into the output of glob-stream (the path info, not contents). The filestats streams takes this and attaches the stats object. The filereader stream takes this and based on X args (buffer: true, read: false, etc.) and the file.stats creates file.contents. The fileread needs filestats to be executed on the file object otherwise it won't know how to read directories correctly. Is this what you're suggesting? Thoughts? |
It was just an idea, did not put too much thought into that. In fact not |
Gulp isn't too big, and the file streams could be used without the task management. I see no reason for the decouple. |
@phated the problem is not the "size" of gulp, but that at the moment this tool have 4 different responsibilities which are not necessarily closely related:
since responsibilities 1, 2 and 3 are handled by external tools, I think this should also be part of an external package and gulp would just glue the external tools together and provide an unified API (maybe not even necessary). - I don't need that many unrelated dependencies (arguments parser, file watcher and task runner) just to process files. this is not a problem of file size, but just that smaller tools with single responsibilities are easier to grok and can evolve independently (size of the README would reduce considerably). I would really like to see a future where we can reuse modules without having to code yet another plugin for a different runner... and Streams are a good abstraction for some file operations because they can be piped and doesn't require whole file to be in memory (even tho most examples I saw doesn't benefit from that). |
Instead, you are advocating for yet another file streaming style. This
|
@phated I'm advocating a standalone file stream standard (same as what you guys currently have), in the hopes of it becoming widely used in different contexts, and that users understands the benefits of Streams over regular callbacks for some tasks... I'll elaborate better about plugins on a separate issue. - xkcd on standards |
Okay so I broke the file object out into https://github.com/wearefractal/vinyl and I'm breaking the read/write for the FS into vinyl out into https://github.com/wearefractal/vinyl-fs |
+1. |
Closing this - vinyl-fs is coming in the next release |
I believe this functionality deserves it's own package, the same way as you guys are reusing
orchestrator
,event-stream
,glob-stream
, etc.Even tho this feature is the core of
gulp
, it could be used outside the task runner context. It could even become the de-facto standard for file manipulation. (so you would have file stream modifiers coded by more people).I agree that there are benefits of bundling all the features into the same package (so you can simply do
npm install --save-dev gulp
) but for me it feels like this tool is doing too much (too many responsibilities).Cheers.
The text was updated successfully, but these errors were encountered: