-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Conversation
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.
@attaradev
attaradev
left a comment
There was a problem hiding this 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.
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
I'm going to clean this up and get it released today
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.
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.
Conversion of the Gulp demo/example code from API 3 to 4.
var
toconst
forrequire()
calls.demo rendered