Web development
tools
@_francois06
@hugomallet
@53JSdevDecember 2016
University of Nice Sophia Antipolis
{ starter pack }
Who we are
And we love gif !
#WhatDoWeNeed?
Web development tools
FAST
D.R.Y.
FLEXIBLE
Improve development
Localhost server
LiveReload
Package manager
Module bundler
SASS with sourcemap
...
to focus on the features of your own app
Prepare for deployment
Concatenate JS, CSS
Minify CSS, HTML, JS, images
Copy all the files in dist folder
Package your app for differents platforms
(apk, ipa, exe, html)
Must be done in one command line
Web development tools { starter pack }
Web development tools { starter pack }
> npm init
> npm install commander
> npm test
> npm publish
#!/usr/bin/env node
const program = require('commander');
const pkg = require('./package');
program.version(pkg.version)
.option('-n, --name [value]', 'Name')
.parse(process.argv);
console.log('Hello ' + program.name);
Automate and
enhance your
workflow
npm install -g gulp-cli
npm init
npm install gulp --save-dev
Task gulp
const gulp = require('gulp');
gulp.task('build', function() {
// do something...
});
gulp.task('default', 'build', function() {
console.log('default task');
});
# gulpfile.js
> gulp
Starting 'build'
Finished 'build'
Starting 'default'
Finished 'default'
> gulp build
Starting 'build'
Finished 'build'
Terminal
streams
gulp
.src('scripts/*.js')
.pipe(applySomething())
.pipe(gulp.dest('dist/scripts'));
gulp.task('sass', function() {
return gulp.src('app/styles/main.scss')
.pipe($.sourcemaps.init())
.pipe($.sass({
outputStyle: 'nested', // libsass doesn't support expanded yet
precision: 10,
includePaths: ['.'],
onError: console.error.bind(console, 'Sass error:')
}).on('error',$.sass.logError))
.pipe($.if(production,
$.replace('node_modules/bootstrap-sass/assets/fonts/bootstrap', 'fonts')))
.pipe($.autoprefixer({
browsers: ['last 1 version']
}))
.pipe($.if(production, $.sourcemaps.write('.', {
includeContent: false,
sourceRoot: './'
})))
.pipe(gulp.dest('dist/styles'));
});
WATCH & RELOAD
1. Start a server
2. Watch files
3. Reload files in browser
const connect = require('connect');
const connectLivereload =
require('connect-livereload');
const gulp = require('gulp');
const serveStatic = require('serve-static');
gulp.task('serve', function() {
var app = connect()
.use(connectLivereload({
port: 35729
}))
.use(serveStatic('app'))
.listen(9000);
});
const livereload = require('gulp-livereload');
gulp.task('watch', ['serve'], function() { livereload.listen();
gulp.watch([
'app/scripts/**/*.js',
'app/images/**/*',
'.tmp/styles/*'
]).on('change', livereload.changed);
gulp.watch(['styles/**/*.{css,scss}'], ['sass']);
});
gulp.task('default', ['watch']);
Serve files Watch files and reload
SCSS !
$color: blue;
li {
// menu links
a {
background: $color;
}
}
CSS
# dist/main.css
li a {
background: blue;
}
const gulp = require('gulp');
const sass = require('gulp-sass');
gulp.task('sass', function() {
return gulp.src('app/styles/main.scss')
.pipe(sass())
.pipe(gulp.dest('dist/styles'));
});
BE LAZY
“I choose a lazy person to do a hard job.
Because a lazy person will find an easy way
to do it.”
― Bill Gates
Be lazy : example
const gulp = require('gulp');
const sass = require('gulp-sass');
const debug = require('gulp-debug');
gulp.task('sass', function() {
return gulp.src('app/styles/main.scss')
.pipe(debug())
.pipe(sass())
.pipe(gulp.dest('dist/styles'));
});
const gulp = require('gulp');
const $ = require('gulp-load-plugins')(),
gulp.task('sass', function() {
return gulp.src('app/styles/main.scss')
.pipe($.debug())
.pipe($.sass())
.pipe(gulp.dest('dist/styles'));
});
npm i -D gulp-load-plugins
Debug
gulp-plumber
Prevent pipe breaking caused by errors
from gulp plugins
https://gist.github.com/floatdrop/8269868
gulp-debug
Debug vinyl file streams to see what files
are run through your gulp pipeline
Let’s require('modules')
in the browser
Require ?
# lib/module.js
exports.multiply = function multiply(a, b) {
return a * b;
}
exports.add = function add(a, b) {
return a + b;
}
# tests/module.js
const assert = require('assert');
const mymath = require('../lib/module');
const multiply = mymath.multiply;
describe('mymath', () => {
describe('#multiply(a, b)', () => {
it('should return 6 with 2 and 3', () => {
assert.equal(6, multiply(2, 3));
assert.equal(6, multiply(3, 2));
});
});
});
Browserify : require in the browser !
> npm install -g browserify
> npm install --save jquery
> browserify main.js -o dist/bundle.js
const $ = require('jquery');
const mult = require('./lib/module').multiply;
let $a = $('.num-a');
let $b = $('.num-b');
$('button').on('click', function onClick(event) {
mult($a.val(), $b.val());
});
Terminal # main.js
be prepared for
ES6 Modules
export function multiply(a, b) { … }
import { multiply } from './lib/module'
+≃
ESLint
Share style guides !
Avoid mistakes !
# .eslintrc
/*
* Extending the code style
* of the devs at Airbnb
*/
{
'extends': 'eslint-config-airbnb'
}
{ SOURCEMAPS }
> npm publish
This is just an overview ...
Build your own
gulpfile.js
adapted to your tools and
methods !
A sample we made for you :
https://github.com/53js/simple-webapp/
And now you need to
choose a good JavaScript
framework
http://todomvc.com/
Thank you !
https://www.53js.fr
Last important thing

More Related Content

PDF
Gulp: Your Build Process Will Thank You
PPTX
Introduction to Gulp
PPTX
Gulp: Task Runner
PPTX
Automated Development Workflow with Gulp
PPTX
JavaScript Task Runners - Gulp & Grunt
PDF
Intro to Gulp
ODP
GulpJs - An Introduction
Gulp: Your Build Process Will Thank You
Introduction to Gulp
Gulp: Task Runner
Automated Development Workflow with Gulp
JavaScript Task Runners - Gulp & Grunt
Intro to Gulp
GulpJs - An Introduction

What's hot (19)

PPTX
JavaScript code academy - introduction
PDF
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
PDF
Angular workflow with gulp.js
PDF
Automating your workflow with Gulp.js
PDF
Gulp - the streaming build system
PDF
Improving your workflow with gulp
PDF
Frontend JS workflow - Gulp 4 and the like
PDF
Gulp - The Streaming Build System
PDF
Screenshot as a service
PDF
Automating Large Applications on Modular and Structured Form with Gulp
DOCX
Manual google page speed
PPTX
Web development-workflow
PPTX
Writing data analysis pipeline as ruby gem
ZIP
Practical project automation
PDF
MLBlock
PDF
Monitoring at a SAAS Startup: Tradeoffs and Tools
PPTX
Toolbox of a Ruby Team
PDF
How to integrate front end tool via gruntjs
PDF
The Secrets of The FullStack Ninja - Part A - Session I
JavaScript code academy - introduction
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
Angular workflow with gulp.js
Automating your workflow with Gulp.js
Gulp - the streaming build system
Improving your workflow with gulp
Frontend JS workflow - Gulp 4 and the like
Gulp - The Streaming Build System
Screenshot as a service
Automating Large Applications on Modular and Structured Form with Gulp
Manual google page speed
Web development-workflow
Writing data analysis pipeline as ruby gem
Practical project automation
MLBlock
Monitoring at a SAAS Startup: Tradeoffs and Tools
Toolbox of a Ruby Team
How to integrate front end tool via gruntjs
The Secrets of The FullStack Ninja - Part A - Session I
Ad

Viewers also liked (7)

PDF
Get Pumped for the HTML 5 Gamepad API
PDF
1st npm
PDF
Designing Modules for the Browser and Node with Browserify
PDF
Lightning Talk: Making JS better with Browserify
PDF
Browserify
PDF
JavaScript Dependencies, Modules & Browserify
PDF
Building testable chrome extensions
Get Pumped for the HTML 5 Gamepad API
1st npm
Designing Modules for the Browser and Node with Browserify
Lightning Talk: Making JS better with Browserify
Browserify
JavaScript Dependencies, Modules & Browserify
Building testable chrome extensions
Ad

Similar to Web development tools { starter pack } (20)

PDF
Quest for the Perfect Workflow for McrFRED
PDF
Grunt & Front-end Workflow
PDF
Getting started with gulpjs
PDF
Npm scripts
PDF
Hitchhiker's guide to the front end development
PDF
May The Nodejs Be With You
PDF
Get Grulping with JavaScript Task Runners (Matt Gifford)
PDF
Plumbin Pipelines - A Gulp.js workshop
PDF
Javascript is your (Auto)mate
PPTX
2015 - Basta! 2015, DE: JavaScript und build
PDF
Automating Front-End Workflow
PDF
Devenez le plus heureux des Front-end avec Gulp.js
PDF
G*なクラウド ~雲のかなたに~
PDF
Forget Grunt and Gulp! Webpack and NPM rule them all!
PDF
JLPDevs - Optimization Tooling for Modern Web App Development
PDF
Workflow para desenvolvimento Web & Mobile usando grunt.js
PDF
Workflow automation for Front-end web applications
PPTX
Gulp and bower Implementation
PPTX
PSGI and Plack from first principles
PDF
Painless Deployment with Capistrano
Quest for the Perfect Workflow for McrFRED
Grunt & Front-end Workflow
Getting started with gulpjs
Npm scripts
Hitchhiker's guide to the front end development
May The Nodejs Be With You
Get Grulping with JavaScript Task Runners (Matt Gifford)
Plumbin Pipelines - A Gulp.js workshop
Javascript is your (Auto)mate
2015 - Basta! 2015, DE: JavaScript und build
Automating Front-End Workflow
Devenez le plus heureux des Front-end avec Gulp.js
G*なクラウド ~雲のかなたに~
Forget Grunt and Gulp! Webpack and NPM rule them all!
JLPDevs - Optimization Tooling for Modern Web App Development
Workflow para desenvolvimento Web & Mobile usando grunt.js
Workflow automation for Front-end web applications
Gulp and bower Implementation
PSGI and Plack from first principles
Painless Deployment with Capistrano

Recently uploaded (20)

PDF
AGENT SLOT TERPERCAYA INDONESIA – MAIN MUDAH, WD CEPAT, HANYA DI KANCA4D
PPTX
REE IN CARBONATITE EEPOSIT AND INCLUDE CASE STUDY ON AMBADUNGAR
PPTX
using the citation of Research to create a research
PDF
How Technology Shapes Our Information Age
PPTX
Digital Project Mastery using Autodesk Docs Workshops
PPTX
IoT Lecture IoT Lecture IoT Lecture IoT Lecture
PDF
The_Decisive_Battle_of_Yarmuk,battle of yarmuk
PPTX
Basic_of_Computer_System.pptx class-8 com
PPTX
Introduction to networking local area networking
PPTX
Introduction: Living in the IT ERA.pptx
PDF
B2B Marketing mba class material for study
PPTX
Data Flows presentation hubspot crm.pptx
PDF
healthwealthtech4all-blogspot-com-2025-08-top-5-tech-innovations-that-will-ht...
DOCX
MLS 113 Medical Parasitology (LECTURE).docx
PPTX
Slides World Games Great Redesign Eco Economic Epochs.pptx
PPSX
AI AppSec Threats and Defenses 20250822.ppsx
PPT
chapter 5: system unit computing essentials
PPTX
日本横滨国立大学毕业证书文凭定制YNU成绩单硕士文凭学历认证
PPTX
Going_to_Greece presentation Greek mythology
PDF
Lesson.-Reporting-and-Sharing-of-Findings.pdf
AGENT SLOT TERPERCAYA INDONESIA – MAIN MUDAH, WD CEPAT, HANYA DI KANCA4D
REE IN CARBONATITE EEPOSIT AND INCLUDE CASE STUDY ON AMBADUNGAR
using the citation of Research to create a research
How Technology Shapes Our Information Age
Digital Project Mastery using Autodesk Docs Workshops
IoT Lecture IoT Lecture IoT Lecture IoT Lecture
The_Decisive_Battle_of_Yarmuk,battle of yarmuk
Basic_of_Computer_System.pptx class-8 com
Introduction to networking local area networking
Introduction: Living in the IT ERA.pptx
B2B Marketing mba class material for study
Data Flows presentation hubspot crm.pptx
healthwealthtech4all-blogspot-com-2025-08-top-5-tech-innovations-that-will-ht...
MLS 113 Medical Parasitology (LECTURE).docx
Slides World Games Great Redesign Eco Economic Epochs.pptx
AI AppSec Threats and Defenses 20250822.ppsx
chapter 5: system unit computing essentials
日本横滨国立大学毕业证书文凭定制YNU成绩单硕士文凭学历认证
Going_to_Greece presentation Greek mythology
Lesson.-Reporting-and-Sharing-of-Findings.pdf

Web development tools { starter pack }

  • 3. And we love gif !
  • 6. Improve development Localhost server LiveReload Package manager Module bundler SASS with sourcemap ... to focus on the features of your own app
  • 7. Prepare for deployment Concatenate JS, CSS Minify CSS, HTML, JS, images Copy all the files in dist folder Package your app for differents platforms (apk, ipa, exe, html) Must be done in one command line
  • 10. > npm init > npm install commander > npm test > npm publish #!/usr/bin/env node const program = require('commander'); const pkg = require('./package'); program.version(pkg.version) .option('-n, --name [value]', 'Name') .parse(process.argv); console.log('Hello ' + program.name);
  • 12. npm install -g gulp-cli npm init npm install gulp --save-dev
  • 13. Task gulp const gulp = require('gulp'); gulp.task('build', function() { // do something... }); gulp.task('default', 'build', function() { console.log('default task'); }); # gulpfile.js > gulp Starting 'build' Finished 'build' Starting 'default' Finished 'default' > gulp build Starting 'build' Finished 'build' Terminal
  • 15. gulp.task('sass', function() { return gulp.src('app/styles/main.scss') .pipe($.sourcemaps.init()) .pipe($.sass({ outputStyle: 'nested', // libsass doesn't support expanded yet precision: 10, includePaths: ['.'], onError: console.error.bind(console, 'Sass error:') }).on('error',$.sass.logError)) .pipe($.if(production, $.replace('node_modules/bootstrap-sass/assets/fonts/bootstrap', 'fonts'))) .pipe($.autoprefixer({ browsers: ['last 1 version'] })) .pipe($.if(production, $.sourcemaps.write('.', { includeContent: false, sourceRoot: './' }))) .pipe(gulp.dest('dist/styles')); });
  • 16. WATCH & RELOAD 1. Start a server 2. Watch files 3. Reload files in browser
  • 17. const connect = require('connect'); const connectLivereload = require('connect-livereload'); const gulp = require('gulp'); const serveStatic = require('serve-static'); gulp.task('serve', function() { var app = connect() .use(connectLivereload({ port: 35729 })) .use(serveStatic('app')) .listen(9000); }); const livereload = require('gulp-livereload'); gulp.task('watch', ['serve'], function() { livereload.listen(); gulp.watch([ 'app/scripts/**/*.js', 'app/images/**/*', '.tmp/styles/*' ]).on('change', livereload.changed); gulp.watch(['styles/**/*.{css,scss}'], ['sass']); }); gulp.task('default', ['watch']); Serve files Watch files and reload
  • 18. SCSS ! $color: blue; li { // menu links a { background: $color; } }
  • 19. CSS # dist/main.css li a { background: blue; } const gulp = require('gulp'); const sass = require('gulp-sass'); gulp.task('sass', function() { return gulp.src('app/styles/main.scss') .pipe(sass()) .pipe(gulp.dest('dist/styles')); });
  • 20. BE LAZY “I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.” ― Bill Gates
  • 21. Be lazy : example const gulp = require('gulp'); const sass = require('gulp-sass'); const debug = require('gulp-debug'); gulp.task('sass', function() { return gulp.src('app/styles/main.scss') .pipe(debug()) .pipe(sass()) .pipe(gulp.dest('dist/styles')); }); const gulp = require('gulp'); const $ = require('gulp-load-plugins')(), gulp.task('sass', function() { return gulp.src('app/styles/main.scss') .pipe($.debug()) .pipe($.sass()) .pipe(gulp.dest('dist/styles')); }); npm i -D gulp-load-plugins
  • 22. Debug gulp-plumber Prevent pipe breaking caused by errors from gulp plugins https://gist.github.com/floatdrop/8269868 gulp-debug Debug vinyl file streams to see what files are run through your gulp pipeline
  • 24. Require ? # lib/module.js exports.multiply = function multiply(a, b) { return a * b; } exports.add = function add(a, b) { return a + b; } # tests/module.js const assert = require('assert'); const mymath = require('../lib/module'); const multiply = mymath.multiply; describe('mymath', () => { describe('#multiply(a, b)', () => { it('should return 6 with 2 and 3', () => { assert.equal(6, multiply(2, 3)); assert.equal(6, multiply(3, 2)); }); }); });
  • 25. Browserify : require in the browser ! > npm install -g browserify > npm install --save jquery > browserify main.js -o dist/bundle.js const $ = require('jquery'); const mult = require('./lib/module').multiply; let $a = $('.num-a'); let $b = $('.num-b'); $('button').on('click', function onClick(event) { mult($a.val(), $b.val()); }); Terminal # main.js
  • 26. be prepared for ES6 Modules export function multiply(a, b) { … } import { multiply } from './lib/module'
  • 27. +≃
  • 28. ESLint Share style guides ! Avoid mistakes ! # .eslintrc /* * Extending the code style * of the devs at Airbnb */ { 'extends': 'eslint-config-airbnb' }
  • 31. This is just an overview ... Build your own gulpfile.js adapted to your tools and methods ! A sample we made for you : https://github.com/53js/simple-webapp/
  • 32. And now you need to choose a good JavaScript framework http://todomvc.com/