SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Grunt, Gulp & fabs
Build-System and Development-Workflow
for modern Web-Applications
Philipp Burgmer
Software Engineer / Consultant / Trainer
Focus: Frontend, Web Technologies
WeigleWilczek GmbH
burgmer@w11k.com
ABOUT ME
WeigleWilczek / W11k
Software Design, Development & Maintenance
Consulting, Trainings & Project Kickoff
Web Applications with AngularJS
Native Rich Clients with Eclipse RCP
ABOUT US
HOW DO YOU START A NEW WEB-APP?
edit, switch, refresh, test, switch, edit, switch, refresh, test, switch,
edit, switch, refresh, test, switch, edit, switch, refresh, test, switch,
edit, switch, refresh, test, switch, edit, switch, refresh, test, switch,
edit, switch, refresh, test, switch, edit, switch, refresh, test, switch,
edit, switch, refresh, test, switch, edit, switch, refresh, test, switch,
edit, switch, refresh, test, switch, edit, switch, refresh, test, switch,
edit, switch, refresh, test, switch, edit, switch, refresh, test, switch,
edit, switch, refresh, test, switch, edit, switch, refresh, test, switch,
edit, switch, refresh, test, switch, edit, switch, refresh, test, switch,
...
AND HOW DOES IT LOOK LIKE
AFTER ONE NIGHT OF
and no structure in sight
A LOT OF FILES TO MANAGE
43 Dependencies to other Libraries
169 JavaScript Files
112 HTML Templates
...
AFTER 3 MONTHS
Manage Dependencies to 3th Party Libraries
(Versioning, Conflicts, Download and Inclusion)
Include Own JavaScript and CSS Files
Structure and Modularize Code
Too Much Overhead During Development
Find Even Simple Errors Only at Runtime
PROBLEMS
SOLUTION?
THE RIGHT TOOLS MAKE ALL THE DIFFERENCE!
(http://www.nodejs.org)
Runtime for
Dev Tools
(http://www.gruntjs.com)
Task Runner
Bower
(http://www.bower.io)
Dependency
Management
Command Line Tool
Node Package
Install Binary via npm install -g bower
No Project Specific Version
BOWER
A PACKAGE MANAGER FOR THE WEB
Define Dependencies in bower.json
{
"name": "fabs-presentation",
"dependencies": {
"angular": "1.2.16",
"twbs-bootstrap-sass": "3.1.1",
"w11k-slides": "0.4.1"
}
}
Download Dependencies via bower install
Half the Problem Remains: bower Does Not Manage Inclusion
Hint: Use Fixed Versions Within a Project and Variable Within a Library
BOWER
A PACKAGE MANAGER FOR THE WEB
Command Line Tool
Lets You Automate Almost Everything
Split into 2 Node Packages
Install Binary Globally via npm install -g grunt-cli
Define Dependency to Project Specific Version in package.json
Install Locally via npm install
GRUNT
THE JAVASCRIPT TASK RUNNER
Configure Your Tasks and Targets in Gruntfile.js
Everything Is a Plugin (via NPM and package.json )
Countless Plugins Available
Tasks and Configuration Are Pure JavaScript
Register Custom Tasks in Gruntfile.js ,
No Need to Write a Plugin
GRUNT
THE JAVASCRIPT TASK RUNNER
var grunt = require('grunt');
module.exports = function () {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('dev', ['watch', 'connect:dev']);
grunt.registerTask('default', ['dev']);
grunt.initConfig({
watch: { src: { files: ['js/**/*.js', '!js/**/*.test.js'] }},
connect: { dev: { options: { port: 9000 }}}});
};
SHORTEN DEV-LIFECYCLE
WITH LIVERELOAD
var indexHtmlTask = function () {
var jsFiles = utils.filterForJS(this.filesSrc);
grunt.file.copy('src/index.html', 'build-output/index.html', {
process: function (contents) {
return grunt.template.process(contents, { data: { scripts: jsFiles }});
}
});
};
grunt.registerMultiTask('indexHtml', 'Process index.html template', indexHtmlTask);
<% scripts.forEach(function ( file ) { %>
<script type="text/javascript" src="<%= file %>"></script>
<% }); %>
indexHtml: {
dev: { files: ['js/**.*.js', '!js/**/*.test.js'] }
}
INCLUDE JAVASCRIPT FILES
WITH CUSTOM TASK
Substitute for Compiler
Syntax Check
Coding Rules Validation
Static Code Analysis
watch: {
src: {
files: ['js/**/*.js', '!js/**/*.test.js'],
tasks: ['jshint:src']
}
}
A JAVASCRIPT CODE QUALITY TOOL
Testing
SASS and/or LESS Support
Using Mock-Data During Development
Running Frontend with Real Backend
BUT WHAT ABOUT
Karma & grunt-karma for Unit/Spec Tests
Protractor & grunt-protractor for End-2-End Tests
grunt-contrib-sass & grunt-contrib-less
NPM Packages starting with grunt-*
Plugin Overview at gruntjs.com/plugins (http://gruntjs.com/plugins)
More than 2800 Plugins, but a Lot of Duplicates
NO PROBLEM
THERE ARE PLUGINS FOR EVERYTHING
Concatenation
Minification
Cache Busting
Running Tests Against Minified Code
THERE IS STILL MORE TO DO
BEFORE WE CAN DEPLOY OUR APP
Project Specific Build
Huge Gruntfile.js
Task Dependencies
Hard to Do It Right
Same Problems as with Ant
THE REAL PROBLEMS
github.com/w11k/fabs (https://github.com/w11k/fabs)
Inspired by ng-boilerplate (https://github.com/ngbp/ngbp)
Based on Our Best Practices
Configurable
Extendable via Lifecycle-Hooks
Grunt Based
FABS
FABULOUS ANGULARJS BUILD SYSTEM
Manage Frontend Dependencies with Bower
Dev-Mode with Server, Proxies and LiveReload
SASS and LESS Support
Spec and End-2-End Tests
Mocks for Tests and Dev-Mode
Project- and Developer-Configuration
Build and Serve Distribution incl. Cache Busting
FEATURES
fabs-boilerplate (https://github.com/w11k/fabs-boilerplate)
This Presentation
Real World Project
fabs (https://github.com/w11k/fabs)
DEMO
Highly Interdependent Tasks
Hard to Maintain
Hard to Extend (Even With Hooks)
Grunt Is Slow (Slower than ...)
FABS & GRUNT PROBLEMS
gulpjs.com (http://gulpjs.com)
Uses Streams Instead fo Temp Files
Runs Independent Tasks 'Parallel'
Code Over Configuration
Node Package: Install with npm install -g gulp
Plugins Are Regular Node Packages
GULP.JS
var gulp = require('gulp'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');
gulp.task('process-scripts', function() {
return gulp.src('src/scripts/*.js')
.pipe(concat('1.0.1/main.js'))
.pipe(gulp.dest('dest/scripts/'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest('dest/scripts/'))
});
gulp.task('watch', function() {
gulp.watch('src/scripts/*.js', ['process-scripts'])
});
PROCESS JAVASCRIPT WITH GULP
A Lot of Small Tools / Plugins, Each for a Specific Task
Difficult to Keep Track of All These Tools / Plugins
No De-Facto Standard Build Tool like Maven for Java
Impossible to Write One for All Web-Apps
fabs for AngularJS Applications
Working on a Gulp Port of fabs
CONCLUSION
MEET THE SPEAKER
@ Speaker Lounge
Second Floor Directly About Reception
Philipp Burgmer
burgmer@w11k.com
www.w11k.com (http://www.w11k.com)
www.thecodecampus.de (http://www.thecodecampus.de)
Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-Applications

Weitere ähnliche Inhalte

Was ist angesagt?

Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumDev9Com
 
Pre-render Blazor WebAssembly on static web hosting at publishing time
Pre-render Blazor WebAssembly on static web hosting at publishing timePre-render Blazor WebAssembly on static web hosting at publishing time
Pre-render Blazor WebAssembly on static web hosting at publishing timeJun-ichi Sakamoto
 
Building Reliable Applications Using React, .NET & Azure
Building Reliable Applications Using React, .NET & AzureBuilding Reliable Applications Using React, .NET & Azure
Building Reliable Applications Using React, .NET & AzureMaurice De Beijer [MVP]
 
A Introduction to the World of Node, Javascript & Selenium
A Introduction to the World of Node, Javascript & SeleniumA Introduction to the World of Node, Javascript & Selenium
A Introduction to the World of Node, Javascript & SeleniumJames Eisenhauer
 
Griffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java TechnologyGriffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java TechnologyJames Williams
 
Testing your app with Selenium on Travis CI
Testing your app with Selenium on Travis CITesting your app with Selenium on Travis CI
Testing your app with Selenium on Travis CIYusuke Ando
 
From devOps to front end Ops, test first
From devOps to front end Ops, test firstFrom devOps to front end Ops, test first
From devOps to front end Ops, test firstCaesar Chi
 
Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Fwdays
 
Node & Express as Workflow Tools
Node & Express as Workflow ToolsNode & Express as Workflow Tools
Node & Express as Workflow ToolsFITC
 
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
 'MICROFRONTENDS WITH REACT' by Liliia Karpenko 'MICROFRONTENDS WITH REACT' by Liliia Karpenko
'MICROFRONTENDS WITH REACT' by Liliia KarpenkoOdessaJS Conf
 
Visual Studio: The best tool for web developers.
Visual Studio: The best tool for web developers.Visual Studio: The best tool for web developers.
Visual Studio: The best tool for web developers.Robert MacLean
 
Use groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projectsUse groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projectsFátima Casaú Pérez
 
Iam New And Noteworthy
Iam New And NoteworthyIam New And Noteworthy
Iam New And NoteworthyAbel Muíño
 
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia NecheporenkoOdessaJS Conf
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Adam Štipák
 
A Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftA Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftShekhar Gulati
 
Developing SPI applications using Grails and AngularJS
Developing SPI applications using Grails and AngularJSDeveloping SPI applications using Grails and AngularJS
Developing SPI applications using Grails and AngularJSAlvaro Sanchez-Mariscal
 

Was ist angesagt? (20)

Jquery react angular
Jquery react angularJquery react angular
Jquery react angular
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
 
Pre-render Blazor WebAssembly on static web hosting at publishing time
Pre-render Blazor WebAssembly on static web hosting at publishing timePre-render Blazor WebAssembly on static web hosting at publishing time
Pre-render Blazor WebAssembly on static web hosting at publishing time
 
Why gradle
Why gradle Why gradle
Why gradle
 
Building Reliable Applications Using React, .NET & Azure
Building Reliable Applications Using React, .NET & AzureBuilding Reliable Applications Using React, .NET & Azure
Building Reliable Applications Using React, .NET & Azure
 
A Introduction to the World of Node, Javascript & Selenium
A Introduction to the World of Node, Javascript & SeleniumA Introduction to the World of Node, Javascript & Selenium
A Introduction to the World of Node, Javascript & Selenium
 
Griffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java TechnologyGriffon: Re-imaging Desktop Java Technology
Griffon: Re-imaging Desktop Java Technology
 
Testing your app with Selenium on Travis CI
Testing your app with Selenium on Travis CITesting your app with Selenium on Travis CI
Testing your app with Selenium on Travis CI
 
From devOps to front end Ops, test first
From devOps to front end Ops, test firstFrom devOps to front end Ops, test first
From devOps to front end Ops, test first
 
Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"
 
Node & Express as Workflow Tools
Node & Express as Workflow ToolsNode & Express as Workflow Tools
Node & Express as Workflow Tools
 
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
 'MICROFRONTENDS WITH REACT' by Liliia Karpenko 'MICROFRONTENDS WITH REACT' by Liliia Karpenko
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
 
Visual Studio: The best tool for web developers.
Visual Studio: The best tool for web developers.Visual Studio: The best tool for web developers.
Visual Studio: The best tool for web developers.
 
Use groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projectsUse groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projects
 
Iam New And Noteworthy
Iam New And NoteworthyIam New And Noteworthy
Iam New And Noteworthy
 
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)
 
A Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShiftA Happy Cloud Friendly Java Developer with OpenShift
A Happy Cloud Friendly Java Developer with OpenShift
 
Single-page applications and Grails
Single-page applications and GrailsSingle-page applications and Grails
Single-page applications and Grails
 
Developing SPI applications using Grails and AngularJS
Developing SPI applications using Grails and AngularJSDeveloping SPI applications using Grails and AngularJS
Developing SPI applications using Grails and AngularJS
 

Ähnlich wie Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-Applications

Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed AssafAhmed Assaf
 
Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014Stéphane Bégaudeau
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
 
Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014Stéphane Bégaudeau
 
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...Evan Mullins
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaAmazon Web Services
 
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie..."How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...Fwdays
 
Node.js Build, Deploy and Scale Webinar
Node.js Build, Deploy and Scale WebinarNode.js Build, Deploy and Scale Webinar
Node.js Build, Deploy and Scale Webinarjguerrero999
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...NETWAYS
 
The path to a serverless-native era with Kubernetes
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetessparkfabrik
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular applicationSuresh Patidar
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xMariam Hakobyan
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xSascha Möllering
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopleffen
 
Can I Contain This?
Can I Contain This?Can I Contain This?
Can I Contain This?Eficode
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Edureka!
 
Scale your Magento app with Elastic Beanstalk
Scale your Magento app with Elastic BeanstalkScale your Magento app with Elastic Beanstalk
Scale your Magento app with Elastic BeanstalkCorley S.r.l.
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsRaul Leite
 

Ähnlich wie Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-Applications (20)

Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed Assaf
 
Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014Modern Web Application Development Workflow - web2day 2014
Modern Web Application Development Workflow - web2day 2014
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014
 
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...WordCamp Atlanta -  April 15 2018 - dev team workflow and processes with word...
WordCamp Atlanta - April 15 2018 - dev team workflow and processes with word...
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie..."How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
 
Node.js Build, Deploy and Scale Webinar
Node.js Build, Deploy and Scale WebinarNode.js Build, Deploy and Scale Webinar
Node.js Build, Deploy and Scale Webinar
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
 
The path to a serverless-native era with Kubernetes
The path to a serverless-native era with KubernetesThe path to a serverless-native era with Kubernetes
The path to a serverless-native era with Kubernetes
 
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
 
Frontend Build Tools - CC FE & UX
Frontend Build Tools - CC FE & UXFrontend Build Tools - CC FE & UX
Frontend Build Tools - CC FE & UX
 
Real World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.xReal World Enterprise Reactive Programming using Vert.x
Real World Enterprise Reactive Programming using Vert.x
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
Can I Contain This?
Can I Contain This?Can I Contain This?
Can I Contain This?
 
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
Chef vs Puppet vs Ansible vs SaltStack | Configuration Management Tools Compa...
 
Scale your Magento app with Elastic Beanstalk
Scale your Magento app with Elastic BeanstalkScale your Magento app with Elastic Beanstalk
Scale your Magento app with Elastic Beanstalk
 
Automação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOpsAutomação do físico ao NetSecDevOps
Automação do físico ao NetSecDevOps
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 

Mehr von Philipp Burgmer

Sicherheit in Single-Page-Web-Anwendungen
Sicherheit in Single-Page-Web-AnwendungenSicherheit in Single-Page-Web-Anwendungen
Sicherheit in Single-Page-Web-AnwendungenPhilipp Burgmer
 
EnterJS 2015 - JavaScript von Morgen schon heute
EnterJS 2015 - JavaScript von Morgen schon heuteEnterJS 2015 - JavaScript von Morgen schon heute
EnterJS 2015 - JavaScript von Morgen schon heutePhilipp Burgmer
 
Taugt AngularJS wirklich was? Erfahrungsbericht und Ausblick
Taugt AngularJS wirklich was? Erfahrungsbericht und AusblickTaugt AngularJS wirklich was? Erfahrungsbericht und Ausblick
Taugt AngularJS wirklich was? Erfahrungsbericht und AusblickPhilipp Burgmer
 
Legacy WebApps mit AngularJS pimpen
Legacy WebApps mit AngularJS pimpenLegacy WebApps mit AngularJS pimpen
Legacy WebApps mit AngularJS pimpenPhilipp Burgmer
 
WJAX 2012 - Web Apps With AngularJS
WJAX 2012 - Web Apps With AngularJSWJAX 2012 - Web Apps With AngularJS
WJAX 2012 - Web Apps With AngularJSPhilipp Burgmer
 
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSKarlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSPhilipp Burgmer
 
Web Applications with AngularJS
Web Applications with AngularJSWeb Applications with AngularJS
Web Applications with AngularJSPhilipp Burgmer
 

Mehr von Philipp Burgmer (8)

Sicherheit in Single-Page-Web-Anwendungen
Sicherheit in Single-Page-Web-AnwendungenSicherheit in Single-Page-Web-Anwendungen
Sicherheit in Single-Page-Web-Anwendungen
 
EnterJS 2015 - JavaScript von Morgen schon heute
EnterJS 2015 - JavaScript von Morgen schon heuteEnterJS 2015 - JavaScript von Morgen schon heute
EnterJS 2015 - JavaScript von Morgen schon heute
 
Taugt AngularJS wirklich was? Erfahrungsbericht und Ausblick
Taugt AngularJS wirklich was? Erfahrungsbericht und AusblickTaugt AngularJS wirklich was? Erfahrungsbericht und Ausblick
Taugt AngularJS wirklich was? Erfahrungsbericht und Ausblick
 
Legacy WebApps mit AngularJS pimpen
Legacy WebApps mit AngularJS pimpenLegacy WebApps mit AngularJS pimpen
Legacy WebApps mit AngularJS pimpen
 
WJAX 2012 - Web Apps With AngularJS
WJAX 2012 - Web Apps With AngularJSWJAX 2012 - Web Apps With AngularJS
WJAX 2012 - Web Apps With AngularJS
 
JavaMagazin - AngularJS
JavaMagazin - AngularJSJavaMagazin - AngularJS
JavaMagazin - AngularJS
 
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSKarlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
 
Web Applications with AngularJS
Web Applications with AngularJSWeb Applications with AngularJS
Web Applications with AngularJS
 

Kürzlich hochgeladen

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 

Kürzlich hochgeladen (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 

Grunt, Gulp & fabs: Build Systems and Development-Workflow for Modern Web-Applications

  • 1. Grunt, Gulp & fabs Build-System and Development-Workflow for modern Web-Applications
  • 2. Philipp Burgmer Software Engineer / Consultant / Trainer Focus: Frontend, Web Technologies WeigleWilczek GmbH burgmer@w11k.com ABOUT ME
  • 3. WeigleWilczek / W11k Software Design, Development & Maintenance Consulting, Trainings & Project Kickoff Web Applications with AngularJS Native Rich Clients with Eclipse RCP ABOUT US
  • 4. HOW DO YOU START A NEW WEB-APP?
  • 5. edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, edit, switch, refresh, test, switch, ... AND HOW DOES IT LOOK LIKE AFTER ONE NIGHT OF
  • 6. and no structure in sight A LOT OF FILES TO MANAGE
  • 7. 43 Dependencies to other Libraries 169 JavaScript Files 112 HTML Templates ... AFTER 3 MONTHS
  • 8. Manage Dependencies to 3th Party Libraries (Versioning, Conflicts, Download and Inclusion) Include Own JavaScript and CSS Files Structure and Modularize Code Too Much Overhead During Development Find Even Simple Errors Only at Runtime PROBLEMS
  • 9. SOLUTION? THE RIGHT TOOLS MAKE ALL THE DIFFERENCE! (http://www.nodejs.org) Runtime for Dev Tools (http://www.gruntjs.com) Task Runner Bower (http://www.bower.io) Dependency Management
  • 10. Command Line Tool Node Package Install Binary via npm install -g bower No Project Specific Version BOWER A PACKAGE MANAGER FOR THE WEB
  • 11. Define Dependencies in bower.json { "name": "fabs-presentation", "dependencies": { "angular": "1.2.16", "twbs-bootstrap-sass": "3.1.1", "w11k-slides": "0.4.1" } } Download Dependencies via bower install Half the Problem Remains: bower Does Not Manage Inclusion Hint: Use Fixed Versions Within a Project and Variable Within a Library BOWER A PACKAGE MANAGER FOR THE WEB
  • 12. Command Line Tool Lets You Automate Almost Everything Split into 2 Node Packages Install Binary Globally via npm install -g grunt-cli Define Dependency to Project Specific Version in package.json Install Locally via npm install GRUNT THE JAVASCRIPT TASK RUNNER
  • 13. Configure Your Tasks and Targets in Gruntfile.js Everything Is a Plugin (via NPM and package.json ) Countless Plugins Available Tasks and Configuration Are Pure JavaScript Register Custom Tasks in Gruntfile.js , No Need to Write a Plugin GRUNT THE JAVASCRIPT TASK RUNNER
  • 14. var grunt = require('grunt'); module.exports = function () { grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.registerTask('dev', ['watch', 'connect:dev']); grunt.registerTask('default', ['dev']); grunt.initConfig({ watch: { src: { files: ['js/**/*.js', '!js/**/*.test.js'] }}, connect: { dev: { options: { port: 9000 }}}}); }; SHORTEN DEV-LIFECYCLE WITH LIVERELOAD
  • 15. var indexHtmlTask = function () { var jsFiles = utils.filterForJS(this.filesSrc); grunt.file.copy('src/index.html', 'build-output/index.html', { process: function (contents) { return grunt.template.process(contents, { data: { scripts: jsFiles }}); } }); }; grunt.registerMultiTask('indexHtml', 'Process index.html template', indexHtmlTask); <% scripts.forEach(function ( file ) { %> <script type="text/javascript" src="<%= file %>"></script> <% }); %> indexHtml: { dev: { files: ['js/**.*.js', '!js/**/*.test.js'] } } INCLUDE JAVASCRIPT FILES WITH CUSTOM TASK
  • 16. Substitute for Compiler Syntax Check Coding Rules Validation Static Code Analysis watch: { src: { files: ['js/**/*.js', '!js/**/*.test.js'], tasks: ['jshint:src'] } } A JAVASCRIPT CODE QUALITY TOOL
  • 17. Testing SASS and/or LESS Support Using Mock-Data During Development Running Frontend with Real Backend BUT WHAT ABOUT
  • 18. Karma & grunt-karma for Unit/Spec Tests Protractor & grunt-protractor for End-2-End Tests grunt-contrib-sass & grunt-contrib-less NPM Packages starting with grunt-* Plugin Overview at gruntjs.com/plugins (http://gruntjs.com/plugins) More than 2800 Plugins, but a Lot of Duplicates NO PROBLEM THERE ARE PLUGINS FOR EVERYTHING
  • 19. Concatenation Minification Cache Busting Running Tests Against Minified Code THERE IS STILL MORE TO DO BEFORE WE CAN DEPLOY OUR APP
  • 20. Project Specific Build Huge Gruntfile.js Task Dependencies Hard to Do It Right Same Problems as with Ant THE REAL PROBLEMS
  • 21. github.com/w11k/fabs (https://github.com/w11k/fabs) Inspired by ng-boilerplate (https://github.com/ngbp/ngbp) Based on Our Best Practices Configurable Extendable via Lifecycle-Hooks Grunt Based FABS FABULOUS ANGULARJS BUILD SYSTEM
  • 22. Manage Frontend Dependencies with Bower Dev-Mode with Server, Proxies and LiveReload SASS and LESS Support Spec and End-2-End Tests Mocks for Tests and Dev-Mode Project- and Developer-Configuration Build and Serve Distribution incl. Cache Busting FEATURES
  • 23. fabs-boilerplate (https://github.com/w11k/fabs-boilerplate) This Presentation Real World Project fabs (https://github.com/w11k/fabs) DEMO
  • 24. Highly Interdependent Tasks Hard to Maintain Hard to Extend (Even With Hooks) Grunt Is Slow (Slower than ...) FABS & GRUNT PROBLEMS
  • 25. gulpjs.com (http://gulpjs.com) Uses Streams Instead fo Temp Files Runs Independent Tasks 'Parallel' Code Over Configuration Node Package: Install with npm install -g gulp Plugins Are Regular Node Packages GULP.JS
  • 26. var gulp = require('gulp'), rename = require('gulp-rename'), concat = require('gulp-concat'), uglify = require('gulp-uglify'); gulp.task('process-scripts', function() { return gulp.src('src/scripts/*.js') .pipe(concat('1.0.1/main.js')) .pipe(gulp.dest('dest/scripts/')) .pipe(rename({suffix: '.min'})) .pipe(uglify()) .pipe(gulp.dest('dest/scripts/')) }); gulp.task('watch', function() { gulp.watch('src/scripts/*.js', ['process-scripts']) }); PROCESS JAVASCRIPT WITH GULP
  • 27. A Lot of Small Tools / Plugins, Each for a Specific Task Difficult to Keep Track of All These Tools / Plugins No De-Facto Standard Build Tool like Maven for Java Impossible to Write One for All Web-Apps fabs for AngularJS Applications Working on a Gulp Port of fabs CONCLUSION
  • 28. MEET THE SPEAKER @ Speaker Lounge Second Floor Directly About Reception