The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Angular Automation: Gulp Tasks

Angular Automation: Gulp Tasks

3:45
In this lesson, we will learn how tasks work in Gulp. We will talk about how to define a task and what each parameter in the definition does. We will see how task dependencies work and talk about how to handle asynchronous issues using `run-sequence`.
Watch this lesson now
Avatar
egghead.io

In this lesson, we will learn how tasks work in Gulp. We will talk about how to define a task and what each parameter in the definition does. We will see how task dependencies work and talk about how to handle asynchronous issues using run-sequence.

Avatar
Hedge

Why not using the built-in piping mechanism?

Avatar
Lukas

Good question! Gulp does a pretty good job synchronizing asynchronous dependent tasks when you provide the enough async tasks hints. Things get wonky when the tasks are non-dependent and so this is where run-sequence comes in. You can read more about here https://www.npmjs.com/package/run-sequence.

In reply to Hedge
Avatar
Hedge

Thanks. Found out many developers use this 'run-sequence' module. Though I'm still not sure how it's different from the gulp recipe described here:
running-tasks-in-series.md
I mean - what situation does it solve?

In reply to Lukas
Avatar
Lukas

In recipe above, all the tasks are dependent on each other. You would use run-sequence to orchestrate non-dependent tasks.

In reply to Hedge
Avatar
Hedge

Found it:

The built-in task dependency functionality does not solve this scenario. Dependent tasks are always run: there's no built in way to run two tasks in a row some of the time, but not every time. run-sequence solves a critical piece of missing functionality in gulp.
by the dev of run-sequence himself

In reply to Hedge
Avatar
Scott

Does the latest run-sequence not require a callback? Request: could you perhaps make an angular2 gulp tutorial?

Avatar
Lukas

@Ryan, I believe that run-sequence still requires a callback (https://www.npmjs.com/package/run-sequence). Also, bear in mind that once Gulp 4.0 hits, there should no longer be a need for run-sequence (as stated by the authors themselves in the above link). As for a Gulp-Angular2 tutorial, that is a great suggestion that we will be adding to the queue!

In reply to Scott
Avatar
Paul

Your tutorials are fantastic Lukas. Not rushed and step by step. Keep up the good work. With some of the other trainers, I feel there's a rush to cram as much information as possible in as little time as possible. It would be interesting to know your WPM vs other trainers. They should aspire to you and John Lindquist. Actually, Ken Dodds is pretty good too.

In reply to Lukas
Avatar
Lukas

Thanks, Paul! Appreciate the kind words!

In reply to Paul
Avatar

Please pause after typing a command. The video cuts over quickly after you type a command and I find myself going back and pausing the video to see what the command was. I have been doing jQuery web 2.0 work for years and this new super heavy IDE platform set up is taking me a while to get used to. Your videos help but it seems there are assumptions of having prior knowledge about tools like npm and I am copying down the commands and the gulp scripting for reference. Is there any way to get a sample app or a text of the commands used in this course? I would rather have a static reference document and focus on listening than to constantly go back and pause and type my own notes. Thanks

Avatar
Lukas

Great feedback! I will try to be more mindful of my timing. As for the sample app, everything is in the Github repo. Hope that helps!

In reply to
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?