Skip to content

Convert demo to Gulp 4.0.0+ #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2019
Merged

Convert demo to Gulp 4.0.0+ #99

merged 1 commit into from
Jan 2, 2019

Conversation

13rac1
Copy link
Contributor

@13rac1 13rac1 commented Dec 28, 2018

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

  • HighlightJS automatically and manually applied.
  • Switched from var to const for require() calls.

demo rendered

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

* HighlightJS automatically and manually applied.
* Switched from `var` to `const` for `require()` calls.
Copy link

@attaradev attaradev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, I was about to do the same and saw this PR. Kindly merge it to reflect the current state of gulp. Because the current demo is breaking and frustrating a lot of developers thereby affecting the developer experience.

@yocontra
Copy link
Member

yocontra commented Jan 2, 2019

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

  • 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

@phated
Copy link
Member

phated commented Jan 2, 2019

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

@phated phated merged commit 28738ef into gulpjs:source Jan 2, 2019
@13rac1 13rac1 deleted the upgrade-demo branch January 2, 2019 21:29
@13rac1
Copy link
Contributor Author

13rac1 commented Jan 2, 2019

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
Copy link
Member

phated commented Jan 2, 2019

As per the documentation rewrite:

  • Named functions are preferred over arrow functions
  • Destructuring is preferred over using gulp namespace

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants