question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggested alternative to gulp.series and gulp.parallel

See original GitHub issue

I think that the following syntax would be much cleaner and much more intuitive way of running tasks in series or in parallel. It makes the composition of tasks much more fluid, with less boilerplate

gulp.task('default',
    ['parallel1', 'parallel2'],
    'series1',
    'series2',
    ['parallel3', 'parallel4'],
    function () {
        //do some work here after all dependencies have been run
    }
);

Here is how it would process:

  1. run parallel1 and parallel2 in parallel
  2. Run series1
  3. Run series2
  4. Run parallel3 and parallel4 in parallel.
  5. run the function now that all required tasks have been run.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yocontracommented, Apr 7, 2017

Yeah, you could do this yourself with a 1 line module

const sugar = (...a) =>
  gulp.series(...a.map((i) => Array.isArray(i) ? gulp.parallel(...i) : i)

gulp.task('default', sugar(
    ['parallel1', 'parallel2'],
    'series1',
    'series2',
    ['parallel3', 'parallel4'],
    function () {
        //do some work here after all dependencies have been run
    }
));
0reactions
phatedcommented, Apr 7, 2017

Again, no. This goes into userland.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The new task execution system - gulp.parallel and gulp.series
In this article, I want to show you what's new and how you can migrate the best. Task execution chains in Gulp 3...
Read more >
Is there any other way to write the Watch function in Gulp, I ...
gulp.task("compress ", gulp.series("clean", function () {. series and parallel do not take an array as an argument.
Read more >
Construct Gulp Series Tasks Dynamically - Medium
In this article, I just share a simple solution to construct gulp series/parallel tasks dynamically. However, you can still improve it more like ......
Read more >
Moving from gulp 3 to 4 | Web Development - UConn Blogs
As part of the boilerplates, we typically use gulp js. Gulp is a javascript task runner. That means it lets you automate common...
Read more >
Webpack or Browserify & Gulp: Which Is Better? - Toptal
In this article, Toptal Freelance Software Engineer Eric Grosse shows us how various combinations of the popular tools Webpack, Browserify, Gulp and Npm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found