lukeed / taskr

A fast, concurrency-focused task automation tool.
MIT License
2.53k stars 74 forks source link

FileStream + Extract `fly.concat` to plugin? #215

Closed lukeed closed 7 years ago

lukeed commented 7 years ago

(This would be part of the 2.0 release)

Continuing with my weird metaphor in #207 (comment), fly.concat is really the only core API that doesn't fit the rest of the class.

All other methods are "A ➡️ B" handlers, relying on external functions in between, while fly.concat is the only method that manipulates files during the "A ➡️ B" process.

Doing this would require exposing an entryway that hooks in before the target() resolution.

This would also also be a fantastic time to consider opening the door to Streaming (like Gulp)?

Pro

lukeed commented 7 years ago

@jbucaran @hzlmn (others?) Thoughts? About to tackle this

hzlmn commented 7 years ago

@lukeed 👍 It would be nice to provide as simple API as we can,

we can extract useful plugins like fly-rename or fly-concat into something similar to presets in babel, that will regain core funcs of 1.* releases

hzlmn commented 7 years ago

@lukeed Also, I would like to start discussion of plugin's API changes as part of 2.* release. Current API, as we can see, does not alow us to handle exceptions, in a way it should be (as we bind each plugin directly to fly instance)

What do you think?

lukeed commented 7 years ago

I'm onboard with this, as I've already removed concat from my build so far.

What do you suggest? And what exceptions, specifically, are you talking about?

So far, I've dramatically improved the reliability of awaiting tasks & how those tasks' errors are thrown in both parallel and serial modes. This was a big motivation for rewriting a 2.0.

In essence, this gives any plugin the ability to throw new Error('msg') and it'll interrupt a serial chain with the appropriate logging & just log during a parallel sequence.

lukeed commented 7 years ago

Please see my comments here and here.

I will also update this comment with a link to fly-concat once it's available.

Updated: fly-concat