Grunt, Gulp & fabs. Build-System and Development-Workflow for modern Web-Applications



Similar documents
MODERN WEB APPLICATION DEVELOPMENT WORKFLOW

Continuous Integration and Delivery. manage development build deploy / release

IBM Digital Experience. Using Modern Web Development Tools and Technology with IBM Digital Experience

ICON UK 2015 node.js for Domino developers. Presenter: Matt White Company: LDC Via

Copyright by Object Computing, Inc. (OCI). All rights reserved. AngularJS Testing

Drupal CMS for marketing sites

Meister Going Beyond Maven

Multi-touch app development with modern web tools. David Reagan, Advanced Visualization Lab

Mobile development with Apache OFBiz. Ean Schuessler, Brainfood

Muzikayise Flynn Buthelezi

Rich Internet Applications

MASTERTAG DEVELOPER GUIDE

MarkLogic Server. Reference Application Architecture Guide. MarkLogic 8 February, Copyright 2015 MarkLogic Corporation. All rights reserved.

Build Automation for Mobile. or How to Deliver Quality Apps Continuously. Angelo Rüggeberg

Hudson configuration manual

AngularJS for the enterprise

NoSQL web apps. w/ MongoDB, Node.js, AngularJS. Dr. Gerd Jungbluth, NoSQL UG Cologne,

Write Modern Web Apps with the MEAN Stack

Getting Started Developing JavaScript Web Apps. this = that. VT Geospatial Forum 2015

Drupal Performance Tuning

Maven or how to automate java builds, tests and version management with open source tools

Mobile Performance Management Tools Prasanna Gawade, Infosys April 2014

CoffeeScript and Drupal. Mark Horgan

Web Developer Toolkit for IBM Digital Experience

JUG Münster. Modern Java web development. Thomas Kruse

Build management & Continuous integration. with Maven & Hudson

MEAN/Full Stack Web Development - Training Course Package

GlassFish v3. Building an ex tensible modular Java EE application server. Jerome Dochez and Ludovic Champenois Sun Microsystems, Inc.

NXTware Remote. Advanced Development and Maintenance Environment for OpenVMS and other Strategic Platforms

Setup The package simply needs to be installed and configured for the desired CDN s distribution server.

Lessons learned from a large scale OSGi web app. Jago de Vreede Paul Bakker

Connect Web Experience. Basel. Modular Front-End in AEM. Namics. Michael Kreis. Software Engineer. René Bach. Senior Frontend Engineer.

AJAX Toolkit Framework

Mobile apps development for Joomla

Operational Decision Manager Worklight Integration

Developing Web Services with Eclipse and Open Source. Claire Rogers Developer Resources and Partner Enablement, HP February, 2004

What about MongoDB? can req.body.input 0; var date = new Date(); do {curdate = new Date();} while(curdate-date<10000)

How-To: Submitting PDF forms to SharePoint from custom websites

Maven2. Configuration and Build Management. Robert Reiz

Sonatype CLM Enforcement Points - Continuous Integration (CI) Sonatype CLM Enforcement Points - Continuous Integration (CI)

A Baseline for Web Performance

ekomimeetsmage Manual for version 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0

Table of Contents. Overview Supported Platforms Demos/Downloads Known Issues Note Included Files...

Google Web Toolkit. Introduction to GWT Development. Ilkka Rinne & Sampo Savolainen / Spatineo Oy

Introduction to Mobile Performance Testing

Spectrum Technology Platform

Developing a highly dynamic web application for a large bank using rules-based technology

Performance Testing for Ajax Applications

HP ALM Masters 2014 Connected, collaborative mobile application development for the enterprise HP Anywhere

Web application Architecture

Art of Code Front-end Web Development Training Program

Workshop for WebLogic introduces new tools in support of Java EE 5.0 standards. The support for Java EE5 includes the following technologies:

Web Dashboard User Guide

Node.JS Appliances on Embedded Linux Devices. Mehmet Fatih Karagöz & Cevahir Turgut

Enabling Cordova (aka PhoneGap) on Tizen. René Pourtier / Luc Yriarte

Hybrid Mobile Application Development

Security Tools - Hands On

Web Performance. Sergey Chernyshev. March '09 New York Web Standards Meetup. New York, NY. March 19 th, 2009

Visualizing a Neo4j Graph Database with KeyLines

1 Building, Deploying and Testing DPES application

JavaScript Programming

Practicing Continuous Delivery using Hudson. Winston Prakash Oracle Corporation

soapui Product Comparison

Streaming Media System Requirements and Troubleshooting Assistance

ASP.NET 5 SOMEONE MOVED YOUR CHEESE. J. Tower

Building a Continuous Integration Pipeline with Docker

MyMoney Documentation

Ajax Performance Tuning and Best Practice

Rich Internet Applications

Application Template Deployment Guide

Citrix StoreFront. Customizing the Receiver for Web User Interface Citrix. All rights reserved.

IBM InfoSphere MDM Server v9.0. Version: Demo. Page <<1/11>>

PHP vs. Java. In this paper, I am not discussing following two issues since each is currently hotly debated in various communities:

FUNCTIONAL OVERVIEW VERSION: 1.0

Front-End Performance Testing and Optimization

JavaScript Applications for the Enterprise: From Empty Folders to Managed Deployments. George Bochenek Randy Jones

Web Performance. Lab. Bases de Dados e Aplicações Web MIEIC, FEUP 2014/15. Sérgio Nunes

Integrating your Maven Build and Tomcat Deployment

Developing Native JavaScript Mobile Apps Using Apache Cordova. Hazem Saleh

Exam Name: IBM InfoSphere MDM Server v9.0

Installation, Configuration, and Usage

Predictive Analytics Client

603: Enhancing mobile device experience with NetScaler MobileStream Hands-on Lab Exercise Guide

Triple-E class Continuous Delivery

Best Practices for Building Mobile Web

BEST WEB PROGRAMMING LANGUAGES TO LEARN ON YOUR OWN TIME

Accelerating Wordpress for Pagerank and Profit

SAP BusinessObjects Design Studio Deep Dive. Ian Mayor and David Stocker SAP Session 0112

Configuring Microsoft IIS 5.0 With Pramati Server

Java Development for the Cloud, present and future. Scott Rich Distinguished Engineer, IBM Rational

Unlocking the Java EE Platform with HTML 5

Winning the Battle against Automated Testing. Elena Laskavaia March 2016

IBM WebSphere Application Server V8.5 lab Basic Liberty profile administration using the job manager

OpenMake Dynamic DevOps Suite 7.5 Road Map. Feature review for Mojo, Meister, CloudBuilder and Deploy+

Criteo Tags & Feed Extension for Magento

Consuming and Producing Web Services with WST and JST. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Transcription:

Grunt, Gulp & fabs Build-System and Development-Workflow for modern Web-Applications

ABOUT ME Philipp Burgmer Software Engineer / Consultant / Trainer Focus: Frontend, Web Technologies WeigleWilczek GmbH burgmer@w11k.com

ABOUT US WeigleWilczek / W11k Software Design, Development & Maintenance Consulting, Trainings & Project Kickoff Web Applications with AngularJS Native Rich Clients with Eclipse RCP

HOW DO YOU START A NEW WEB-APP?

AND HOW DOES IT LOOK LIKE AFTER ONE NIGHT OF 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,...

A LOT OF FILES TO MANAGE and no structure in sight

AFTER 3 MONTHS 43 Dependencies to other Libraries 169 JavaScript Files 112 HTML Templates...

PROBLEMS 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

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

BOWER A PACKAGE MANAGER FOR THE WEB 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

GRUNT THE JAVASCRIPT TASK RUNNER 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

SHORTEN DEV-LIFECYCLE WITH LIVERELOAD 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 }}}}); };

INCLUDE JAVASCRIPT FILES WITH CUSTOM TASK 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'] } }

A JAVASCRIPT CODE QUALITY TOOL Substitute for Compiler Syntax Check Coding Rules Validation Static Code Analysis watch: { src: { files: ['js/**/*.js', '!js/**/*.test.js'], tasks: ['jshint:src'] } }

BUT WHAT ABOUT Testing SASS and/or LESS Support Using Mock-Data During Development Running Frontend with Real Backend

NO PROBLEM THERE ARE PLUGINS FOR EVERYTHING 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

THERE IS STILL MORE TO DO BEFORE WE CAN DEPLOY OUR APP Concatenation Minification Cache Busting Running Tests Against Minified Code

THE REAL PROBLEMS Project Specific Build Huge Gruntfile.js Task Dependencies Hard to Do It Right Same Problems as with Ant

FABS FABULOUS ANGULARJS BUILD SYSTEM 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

FEATURES 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

DEMO fabs-boilerplate (https://github.com/w11k/fabs-boilerplate) This Presentation Real World Project fabs (https://github.com/w11k/fabs)

FABS & GRUNT PROBLEMS Highly Interdependent Tasks Hard to Maintain Hard to Extend (Even With Hooks) Grunt Is Slow (Slower than...)

GULP.JS 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

PROCESS JAVASCRIPT WITH GULP 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']) });

CONCLUSION 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

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)