Some information about
Including:
Examples live in a Github repository:
david.dave.clark@gmail.com - @davidtheclark
davidtheclark.com
Without task-automation, you are causing needless suffering.
If it's not automatic people will let it slide!
Happily do all those things you would not want to do manually, every time.
We'll elaborate on these with an example ...
Github repository:
Basic usage:
Basic usage:
Non-streams
Source File → Transformation A → Output File #1
Output File #1 → Transformation B → Output File #2
Output File #2 → Transformation C → Output File #3
Streams
Source File → Transformation A
↓
Transformation B
↓
Transformation C → Output File #1
Basic usage:
("middleman" = runner + plugin)
Directly use a Node module's JS API. No middle-man plugin and you can throw in arbitrary JS.
Write a script wherever
Asynchronous or synchronous, whatever you write
Allow for CLI-style arguments, if that fits you needs
To do it:
Author JS in multiple ES6 modules
Output a single linted, uglified, ES5 file
Development: re-compile on save & refresh browser with BrowserSync
Pros
For JS beginners: Not really code
No async-related confusions
Cons
Non-stream style can make sequential tasks confusing (plugins overreach to compensate)
Non-stream + sync + overhead = relatively slow
Not flexible or customizable (unless you start writing your own plugins)
>> Missing anything? <<
Pros
Streams end up making more sense, more often than Grunt's isolated tasks
Streams + async = fast
Cons
Async can cause some confusion, some getting-used-to
Plugin and runner intermediary
>> Missing anything? <<
Pros
No intermediary between the module and you
Sync or async, stream or non-stream
Learn how to use the tools themselves, and some bash
Simple simple simple (usually)
Cons
Complex commands can become harder to read than JS
Cannot insert arbitrary JS
Sometimes its harder to find help and examples
>> Missing anything? <<
Pros
No intermediary between the module and you
Sync or async, stream or non-stream
Arbitrary JS = ultimate control, if customization is priority
Learn how to use the tools themselves
Be a real Node programmer, not just a pre-packaged workflow consumer
Cons
Might end up reimplementing patterns built into gulp/Grunt, running into problems they make it easy to avoid
>> Missing anything? <<
Author a React component in multiple ES6 modules using JSX syntax
Output a single linted, uglified, ES5 file that expects React as a global and exposes its own global
Also output linted, ES5 module files that can be consumed via CommonJS by other Browserify/Webpack users
Development: webpack-dev-server
david.dave.clark@gmail.com - @davidtheclark
davidtheclark.com