SlideShare a Scribd company logo
Gulp.js
2
Agenda
• What is gulp.js?
• How can we use it?
• Helpful Examples
What is gulp.js?
4
Where We’ve Been
• Plain CSS
• SASS
• Compass
• Compass Watch
5
Where We Are Going Can Go
As always, is it the right tool for the job?
• “Gulp is a toolkit that helps you automate
painful or time-consuming tasks in your
development workflow.”
• Gulp allows you to control CLI tasks via
code/JS syntax.
• Gulp.js, that’s a javascript file right? How does
that work?
• Enter Node.js package manager.
• A familiar alternative: Grunt
6
Setup/Installation
• Install NPM, if you don’t already have it.
• https://nodejs.org/en/
• brew install node
• Install gulp
• npm install --global gulp-cli
• From anywhere.
• npm install --save-dev gulp
• Inside project root.
• https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md
How can we use it?
8
Automating the Front-end Workflow
Making “pipe” dreams a reality.
• Gulp-uglify
• Minify CSS/JS
• Gulp-sass
• SASS file compiler
• Gulp-compass
• Leverage the power of the compass SASS library.
• Don’t give up all your favorite mixins just yet!
• Gulp-autoprefixer
• Automatically post-process vendor prefixes.
• Developer preference on compass vs. autoprefixer
style prefixing.
9
Automating the Front-end Workflow
Making “pipe” dreams a reality.
• Gulp-sourcemaps
• Generate helpful JS/CSS sourcemaps.
• Gulp-livereload
• “LiveReload monitors changes in the file system. As soon as
you save a file, it is preprocessed as needed, and the browser
is refreshed.”
• Should only be used when drupal CSS/JS caches have been
turned off or piped with a drush cc.
• Gulp-plumber
• Graceful error handling during pipe operations.
• Avoid frustration.
• Gulp-notify
• When paired with plumber, send helpful messages
10
Automating the Front-end Workflow
Making “pipe” dreams a reality.
• Gulp-folders
• Work with folders and treat them as package
names.
• Usually a dependency for more complex plugins.
• Path
• Just as it says, retrieves file paths for other plugins
to read from.
• Usually a dependency for more complex plugins.
• Gulp-exec or gulp-shell
• Run CLI commands from gulp.
• Could useful if paired with drush cc.
• Might even be used to automate D8 drupal
console/composer commands.
11
Code Analysis
Setting up for complimenting presentations.
• Gulp-phplint
• Validate PHP.
• Gulp-csslint
• Validate CSS.
• Gulp-scss-lint
• Validate SASS.
• Gulp-jslint
• Validate strict JS.
• Gulp-jshint
• Validate more complex JS and jQuery.
Helpful Examples
13
Let’s Get Started – Scaffolding
Turn the vales and let the code flow through the pipes.
• First, create a file “package.json” in the root of
our theme folder.
• A few key things to add here.
• See the next slide.
• Now, let’s install our dependencies from our
CLI.
• npm install --save-dev gulp gulp-uglify gulp-sass
gulp-autoprefixer gulp-plumber gulp-notify gulp-
sourcemaps gulp-livereload gulp-concat path gulp-
folders
• Finally, create “gulpfile.js” next to our
package.json file or name it whatever was
specified in package.json.
14
Let’s Get Started
Turn the vales and let the code flow through the pipes.
15
Let’s Get Started
Turn the vales and let the code flow through the pipes.
16
Finish your tasks
Always good to have a default task.
17
Watch it all work
Run our tasks.
• Navigate to our project root in the CLI.
• Run “gulp”
• Specify individual tasks if you don’t have a “default”
task.
• Make changes/additions to your SASS files and
let gulp handle the rest.
18
References
• https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md
• Install instructions.
• https://github.com/gulpjs/gulp/tree/master/docs/recipes
• Handy outlines for common gulp related workflows.
• https://github.com/gulpjs/gulp/blob/master/docs/README.md#articl
es
• Ideas/workflows from other developers.
• https://github.com/gulpjs/gulp/blob/master/docs/API.md
• Become an expert with the built in Gulp library.
• http://gulpjs.com/plugins/
• Where to look for more handy gulp-friendly plugins.

More Related Content

What's hot

Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Michael Lihs
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
JBUG London
 
What is octohost?
What is octohost?What is octohost?
What is octohost?
Darron Froese
 
Headless approach and Acquia - Case study - Chris Ozog
Headless approach and Acquia - Case study - Chris OzogHeadless approach and Acquia - Case study - Chris Ozog
Headless approach and Acquia - Case study - Chris Ozog
DrupalCamp Kyiv
 
Codecoon - A technical Case Study
Codecoon - A technical Case StudyCodecoon - A technical Case Study
Codecoon - A technical Case Study
Michael Lihs
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
Michael Lange
 
Stop making, start composing - Using Composer for Drupal development
Stop making, start composing - Using Composer for Drupal developmentStop making, start composing - Using Composer for Drupal development
Stop making, start composing - Using Composer for Drupal development
kaspergarnaes
 
Package anything with fpm cookery
Package anything with fpm cookeryPackage anything with fpm cookery
Package anything with fpm cookery
Marcelo Pinheiro
 
Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015
Giorgio Cefaro
 
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....? Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet
 
S&T What I know about Node 110817
S&T What I know about Node 110817S&T What I know about Node 110817
S&T What I know about Node 110817
Dan Dineen
 
Dial up your flow
Dial up your flowDial up your flow
Dial up your flow
Wes Eklund
 
Rsyslog version naming (v8.6.0+)
Rsyslog version naming (v8.6.0+)Rsyslog version naming (v8.6.0+)
Rsyslog version naming (v8.6.0+)
Rainer Gerhards
 
Webpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsWebpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ Steps
Grgur Grisogono
 
Madison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsMadison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small Teams
Joe Ferguson
 
wp-cli and plugin development with future and past compatibility (Word Camp P...
wp-cli and plugin development with future and past compatibility (Word Camp P...wp-cli and plugin development with future and past compatibility (Word Camp P...
wp-cli and plugin development with future and past compatibility (Word Camp P...
Andreas - Creten
 
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
DrupalCamp Kyiv
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swposcon2007
 

What's hot (19)

Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
 
What is octohost?
What is octohost?What is octohost?
What is octohost?
 
Headless approach and Acquia - Case study - Chris Ozog
Headless approach and Acquia - Case study - Chris OzogHeadless approach and Acquia - Case study - Chris Ozog
Headless approach and Acquia - Case study - Chris Ozog
 
Git+jenkins+rex presentation
Git+jenkins+rex presentationGit+jenkins+rex presentation
Git+jenkins+rex presentation
 
Codecoon - A technical Case Study
Codecoon - A technical Case StudyCodecoon - A technical Case Study
Codecoon - A technical Case Study
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
 
Stop making, start composing - Using Composer for Drupal development
Stop making, start composing - Using Composer for Drupal developmentStop making, start composing - Using Composer for Drupal development
Stop making, start composing - Using Composer for Drupal development
 
Package anything with fpm cookery
Package anything with fpm cookeryPackage anything with fpm cookery
Package anything with fpm cookery
 
Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015
 
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....? Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
 
S&T What I know about Node 110817
S&T What I know about Node 110817S&T What I know about Node 110817
S&T What I know about Node 110817
 
Dial up your flow
Dial up your flowDial up your flow
Dial up your flow
 
Rsyslog version naming (v8.6.0+)
Rsyslog version naming (v8.6.0+)Rsyslog version naming (v8.6.0+)
Rsyslog version naming (v8.6.0+)
 
Webpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsWebpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ Steps
 
Madison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsMadison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small Teams
 
wp-cli and plugin development with future and past compatibility (Word Camp P...
wp-cli and plugin development with future and past compatibility (Word Camp P...wp-cli and plugin development with future and past compatibility (Word Camp P...
wp-cli and plugin development with future and past compatibility (Word Camp P...
 
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
Migration from Drupal 7 to Drupal 8 - How Docker can save our lives!
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swp
 

Similar to Gulp js

Make JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and CleanMake JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and CleanBlue Raster
 
Gulp - The Streaming Build System
Gulp - The Streaming Build SystemGulp - The Streaming Build System
Gulp - The Streaming Build System
TO THE NEW | Technology
 
Gulp: Your Build Process Will Thank You
Gulp: Your Build Process Will Thank YouGulp: Your Build Process Will Thank You
Gulp: Your Build Process Will Thank You
RadWorks
 
Gulp and bower Implementation
Gulp and bower Implementation Gulp and bower Implementation
Gulp and bower Implementation
Prashant Shrestha
 
Getting started with gulpjs
Getting started with gulpjsGetting started with gulpjs
Getting started with gulpjs
unmesh dusane
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
Modern web technologies
Modern web technologiesModern web technologies
Modern web technologies
Simeon Prusiyski
 
Gulp and Compass
Gulp and CompassGulp and Compass
Gulp and Compass
fatleaf
 
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
TDC2016SP -  Esqueça Grunt ou Gulp. Webpack and NPM rule them all!TDC2016SP -  Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
tdc-globalcode
 
Gulp: Task Runner
Gulp: Task RunnerGulp: Task Runner
Gulp: Task Runner
Christopher Bautista
 
Overview of Node JS
Overview of Node JSOverview of Node JS
Overview of Node JS
Jacob Nelson
 
Time's Important - Let Task Management Save Yours
Time's Important - Let Task Management Save YoursTime's Important - Let Task Management Save Yours
Time's Important - Let Task Management Save Yours
James Bundey
 
Pipeline 101 Lorelei Mccollum
Pipeline 101 Lorelei MccollumPipeline 101 Lorelei Mccollum
Pipeline 101 Lorelei Mccollum
Lorelei McCollum
 
Gulp overview
Gulp overviewGulp overview
Grunt and Bower
Grunt and BowerGrunt and Bower
Grunt and Bower
George Estebe
 
Hosting a Rails App
Hosting a Rails AppHosting a Rails App
Hosting a Rails App
Josh Schramm
 
GulpJs - An Introduction
GulpJs - An IntroductionGulpJs - An Introduction
GulpJs - An Introduction
Knoldus Inc.
 
Introduction to GulpJs
Introduction to GulpJsIntroduction to GulpJs
Introduction to GulpJs
Harish Gadiya
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
ice799
 
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
Alexander Dean
 

Similar to Gulp js (20)

Make JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and CleanMake JavaScript Lean, Mean, and Clean
Make JavaScript Lean, Mean, and Clean
 
Gulp - The Streaming Build System
Gulp - The Streaming Build SystemGulp - The Streaming Build System
Gulp - The Streaming Build System
 
Gulp: Your Build Process Will Thank You
Gulp: Your Build Process Will Thank YouGulp: Your Build Process Will Thank You
Gulp: Your Build Process Will Thank You
 
Gulp and bower Implementation
Gulp and bower Implementation Gulp and bower Implementation
Gulp and bower Implementation
 
Getting started with gulpjs
Getting started with gulpjsGetting started with gulpjs
Getting started with gulpjs
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
Modern web technologies
Modern web technologiesModern web technologies
Modern web technologies
 
Gulp and Compass
Gulp and CompassGulp and Compass
Gulp and Compass
 
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
TDC2016SP -  Esqueça Grunt ou Gulp. Webpack and NPM rule them all!TDC2016SP -  Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
 
Gulp: Task Runner
Gulp: Task RunnerGulp: Task Runner
Gulp: Task Runner
 
Overview of Node JS
Overview of Node JSOverview of Node JS
Overview of Node JS
 
Time's Important - Let Task Management Save Yours
Time's Important - Let Task Management Save YoursTime's Important - Let Task Management Save Yours
Time's Important - Let Task Management Save Yours
 
Pipeline 101 Lorelei Mccollum
Pipeline 101 Lorelei MccollumPipeline 101 Lorelei Mccollum
Pipeline 101 Lorelei Mccollum
 
Gulp overview
Gulp overviewGulp overview
Gulp overview
 
Grunt and Bower
Grunt and BowerGrunt and Bower
Grunt and Bower
 
Hosting a Rails App
Hosting a Rails AppHosting a Rails App
Hosting a Rails App
 
GulpJs - An Introduction
GulpJs - An IntroductionGulpJs - An Introduction
GulpJs - An Introduction
 
Introduction to GulpJs
Introduction to GulpJsIntroduction to GulpJs
Introduction to GulpJs
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
 
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
 

Recently uploaded

GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 

Recently uploaded (20)

GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 

Gulp js

  • 2. 2 Agenda • What is gulp.js? • How can we use it? • Helpful Examples
  • 4. 4 Where We’ve Been • Plain CSS • SASS • Compass • Compass Watch
  • 5. 5 Where We Are Going Can Go As always, is it the right tool for the job? • “Gulp is a toolkit that helps you automate painful or time-consuming tasks in your development workflow.” • Gulp allows you to control CLI tasks via code/JS syntax. • Gulp.js, that’s a javascript file right? How does that work? • Enter Node.js package manager. • A familiar alternative: Grunt
  • 6. 6 Setup/Installation • Install NPM, if you don’t already have it. • https://nodejs.org/en/ • brew install node • Install gulp • npm install --global gulp-cli • From anywhere. • npm install --save-dev gulp • Inside project root. • https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md
  • 7. How can we use it?
  • 8. 8 Automating the Front-end Workflow Making “pipe” dreams a reality. • Gulp-uglify • Minify CSS/JS • Gulp-sass • SASS file compiler • Gulp-compass • Leverage the power of the compass SASS library. • Don’t give up all your favorite mixins just yet! • Gulp-autoprefixer • Automatically post-process vendor prefixes. • Developer preference on compass vs. autoprefixer style prefixing.
  • 9. 9 Automating the Front-end Workflow Making “pipe” dreams a reality. • Gulp-sourcemaps • Generate helpful JS/CSS sourcemaps. • Gulp-livereload • “LiveReload monitors changes in the file system. As soon as you save a file, it is preprocessed as needed, and the browser is refreshed.” • Should only be used when drupal CSS/JS caches have been turned off or piped with a drush cc. • Gulp-plumber • Graceful error handling during pipe operations. • Avoid frustration. • Gulp-notify • When paired with plumber, send helpful messages
  • 10. 10 Automating the Front-end Workflow Making “pipe” dreams a reality. • Gulp-folders • Work with folders and treat them as package names. • Usually a dependency for more complex plugins. • Path • Just as it says, retrieves file paths for other plugins to read from. • Usually a dependency for more complex plugins. • Gulp-exec or gulp-shell • Run CLI commands from gulp. • Could useful if paired with drush cc. • Might even be used to automate D8 drupal console/composer commands.
  • 11. 11 Code Analysis Setting up for complimenting presentations. • Gulp-phplint • Validate PHP. • Gulp-csslint • Validate CSS. • Gulp-scss-lint • Validate SASS. • Gulp-jslint • Validate strict JS. • Gulp-jshint • Validate more complex JS and jQuery.
  • 13. 13 Let’s Get Started – Scaffolding Turn the vales and let the code flow through the pipes. • First, create a file “package.json” in the root of our theme folder. • A few key things to add here. • See the next slide. • Now, let’s install our dependencies from our CLI. • npm install --save-dev gulp gulp-uglify gulp-sass gulp-autoprefixer gulp-plumber gulp-notify gulp- sourcemaps gulp-livereload gulp-concat path gulp- folders • Finally, create “gulpfile.js” next to our package.json file or name it whatever was specified in package.json.
  • 14. 14 Let’s Get Started Turn the vales and let the code flow through the pipes.
  • 15. 15 Let’s Get Started Turn the vales and let the code flow through the pipes.
  • 16. 16 Finish your tasks Always good to have a default task.
  • 17. 17 Watch it all work Run our tasks. • Navigate to our project root in the CLI. • Run “gulp” • Specify individual tasks if you don’t have a “default” task. • Make changes/additions to your SASS files and let gulp handle the rest.
  • 18. 18 References • https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md • Install instructions. • https://github.com/gulpjs/gulp/tree/master/docs/recipes • Handy outlines for common gulp related workflows. • https://github.com/gulpjs/gulp/blob/master/docs/README.md#articl es • Ideas/workflows from other developers. • https://github.com/gulpjs/gulp/blob/master/docs/API.md • Become an expert with the built in Gulp library. • http://gulpjs.com/plugins/ • Where to look for more handy gulp-friendly plugins.

Editor's Notes

  1. Achieve
  2. Where does every website start? HTML, CSS and JS. For the purpose of this presentation we’ll focus on front-end workflows and how we can simplify daily tasks. Background: First there was SASS which provided a developer friendly syntax for nesting selectors and mixins. Then there was compass which provided us a large library of useful mixins. When paired with compass watch our SASS files automatically compile into CSS.
  3. Gulp means automation. Since gulp is javascript based, we can use code to control our workflow. Gulp is similar to grunt, without having to learn the grunt task runner syntax. Is gulp a direct replacement for compass? Absolutely not. In fact, gulp has a plugin that allows compass to be used in conjunction with it. Gulp is a task runner. That means we can run “gulp” in the root directory of our projects and let the gulpfile.js handle repetitive tasks from our CLIs. What’s the main benefit to gulp vs. something like just running compass watch? Extensibility. Gulp can be used for more than just front-end workflows. NPM background: Single threaded asynchronous event loop that entirely runs off of javascript.
  4. Gulp means automation. Since gulp is javascript based, we can use code to control our workflow. Gulp is similar to grunt, without having to learn the grunt task runner syntax. Is gulp a direct replacement for compass? Absolutely not. In fact, gulp has a plugin that allows compass to be used in conjunction with it. Gulp is a task runner. That means we can run “gulp” in the root directory of our projects and let the gulpfile.js handle repetitive tasks from our CLIs. What’s the main benefit to gulp vs. something like just running compass watch? Extensibility. Gulp can be used for more than just front-end workflows. NPM background: Single threaded asynchronous event loop that entirely runs off of javascript.
  5. Achieve
  6. Achieve
  7. Achieve
  8. Achieve
  9. Achieve
  10. Achieve
  11. Achieve
  12. Achieve
  13. Achieve
  14. Achieve