gulpjs / gulpjs.github.io

The gulp website
http://gulpjs.com
44 stars 44 forks source link

Convert demo to Gulp 4.0.0+ #99

Closed 13rac1 closed 5 years ago

13rac1 commented 5 years ago

Conversion of the Gulp demo/example code from API 3 to 4.

demo rendered

yocontra commented 5 years ago

This can be simplified a lot IMO - the demo is supposed to be as simple and readable as possible.

phated commented 5 years ago

I'm going to clean this up and get it released today

13rac1 commented 5 years ago

the demo is supposed to be as simple and readable as possible.

@contra I agree, but wanted to open this PR with the minimal line count changes. I'd have been happy to refactor further pre-merge. @phated merging works though!

Destructuring is a bit of a stretch here, would prefer just accessing off gulp Arrow functions on the tasks would be nice Export each task function

I thought it strange too. That is what the documentation shows, so I matched it. The docs should be updated for consistency if this example is changed to use arrow functions or direct gulp access.

Example:

const { src, dest } = require('gulp');

function streamTask() {
  return src('*.js')
    .pipe(dest('output'));
}

From https://gulpjs.com/docs/en/getting-started/async-completion#returning-a-stream and copied for posterity in case of change.

phated commented 5 years ago

As per the documentation rewrite:

Those changes have stayed in my merge but I cleaned up how they are displayed on desktop and mobile.