SlideShare a Scribd company logo
1 of 21
GRUNT 
Continuous Development 
of the Front End Tier, 
based on node.js 
Prepared by: Erick Brito 
August 2014
Agenda 
Goal: To show a Continuous development process of 
the front end tier using Grunt 
 HL overview of Grunt 
 HL overview of process using the plugins 
 Unit testing with Jasmine 
 CoffeeScript 
 Demo 
 Lessons learned & Next Steps
Benefits 
 Improves the quality, 
 Using the best practices 
 allowing to have metrics 
 Static analysis on: 
 CSS, Html & JS 
 Unit tests (BDT) & code coverage of the JavaScript code 
 Boost productivity. 
 Allows to have
Development Process 
1. Developer changes the code and save the file 
2. The files are compiled or processed 
A. Stylus -> css files 
B. CoffeScript -> JS Files 
3. The validation tools are launched 
A. Jshint, 
B. csslint, 
C. lint5 
4. Unit tests are launched 
5. Files are copied to Development Web Server 
6. Browser reloads the changes.
Development Process
Continuous delivery process 
 Same as the development process 
 + 
 Minify 
 Js 
 Css 
 Html 
 Remove from js the console.log lines (or any regex 
expression could be changed. 
Dev. Process Minify 
Remove/change any 
regex expressiion
Used Grunt Plugins 
 CSS 
 Stylus (http://learnboost.github.io/stylus/) 
 CSS Lint (static code quality analysis) 
 JavaScript 
 Coffee script 
 Jshint (static code quality analysis) 
 Jasmine (unit tests) 
 grunt-template-jasmine-istanbul (code coverage) 
 HTML 
 Lint5 (static code quality analysis))
Used Grunt Plugins 
 Process 
 Watch 
 Connect (enables a webserver) 
 Proxy-Connect (enables a proxy to invoke remote ajax 
calls) 
 Delivery process: 
 htmlmin 
 Copy 
 Cssmin 
 Regex-replace 
 uglify
Unit testing? 
 Much more better 
 Behavior-Driven development 
 Platform: 
 Jasmine 
 Simple to configure 
 Run on top of phantomjs browser engine 
 Code coverage:
Grunt 
 Defined as a Javascript task runner. 
 It needs npm (the Node.js package manager) 
 Configured throw 2 files 
 Gruntfile.js 
 package.json (as it us npm)
Grunt: reduce complexity and 
adds flexibility!
Grunt references 
 http://gruntjs.com 
 http://www.sitepoint.com/writing-awesome-build-script- 
grunt/ 
 http://davidtucker.net/articles/automating-with-grunt/ 
 http://whyjava.wordpress.com/2013/11/02/day-5- 
gruntjs-let-someone-else-do-my-tedious-repetitive-tasks/
Coding JavaScript? 
 Much more better 
 Coding with CoffeeScript 
 Benefits: 
 Better code quality 
 Boost productivity 
 Using the good parts of javascript 
 Ref: 
http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrr 
ldwideweb 
 100% jslint clean code. 
 Improves readiblity 
 Code needs to be compiled (guarantee the code is free of 
syntax , typos errors)
CoffeeScript references 
 http://coffeescript.org 
 http://coffeescriptcookbook.com 
 http://arcturo.github.io/library/coffeescript/index.html 
 http://valve.github.io/blog/2013/07/13/existential-operator-in-coffeescript/ 
 http://openmymind.net/2012/5/16/Ten-Features-I-Like-About- 
CoffeeScript/ 
 http://www.jimmycuadra.com/posts/coffeescript-classes-under-the- 
hood 
 http://www.cs8.my/2012/09/coffeescript-classes-and-their-variables/ 
 http://blog.carbonfive.com/2011/07/06/pragmatic-javascript- 
testing-with-jasmine/
Project 
 Client 
 Automotive Industry 
 Project 
 Service Recall
Demo the development process 
 Only we need to open 2 consoles and execute: 
 $ grunt configureProxies:testWithSoapUi 
connect:livereloadX 
 $ grunt watch 
 Open the browser 
 Modify the code and see how the browser reloads with the 
latest changes 
 Run SoapUi Mock server to answer the ajax request that 
the proxy redirect to our Mock answers. 
 Time to see CoffeeScript. 
 4 files (55+137+39+260 = 491 lines compiles into 582 
lines). Around 18% less code
Lessons learned 
 Never again code directly on JavaScript, 
 use CoffeeScript: 
 “CoffeeScript is less a new language than it is a shorhand 
for easily expressing the best practices of JavaScipt.”
Lessons learned 
 Start always with a BDD: 
 Testing with Jasmine & the code coverage was introduced 
at the end of the project. 
 If I would started with Jasmine, I will be improved much 
more the quality of the code. 
 Ensured the testability of the code. 
 Ensured the best practices MVC on the frontend.
Lessons learned 
 CSSLint provided a great feedback to improve the 
quality of the css. 
 Testing with Jasmine & the code coverage was 
introduced at the end of the project. Start always with 
a BDD: 
 That will be improved much more the quality of the code. 
Ensured the testability of the code. 
 Don’t reinvent the wheel: Scalfolding, Dependency 
management with Bower: Use Yeoman
Next steps 
 Integrate GRUNT in a CI server (Jenkins) 
 Existing plugin from Jenkins: NodeJS plugin 
 Ref: https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin 
 Step by step guide on : http://sideroad.secret.jp/articles/grunt-on- 
jenkins/ 
 Integrate Grunt reports metrics on SonarQube 
 Some grunt plugins already exists: 
 https://www.npmjs.org/package/grunt-karma-sonar 
 Replicate projects using Yeoman 
 I18N 
 Code based on internationalization. (use of resource boundless 
…
Q & A 
Now it is time to ask questions! 
Contact: 
Erick Brito 
http://blog.erickbrito.ca 
http://ca.linkedin.com/in/erickbrito 
Erick.Brito@lochbridge.com 
erbrito@gmail.com 
by Erick Brito

More Related Content

What's hot

JSDC 2015 - TDD 的開發哲學,以 Node.js 為例
JSDC 2015 - TDD 的開發哲學,以 Node.js 為例JSDC 2015 - TDD 的開發哲學,以 Node.js 為例
JSDC 2015 - TDD 的開發哲學,以 Node.js 為例謝 宗穎
 
Creating a continuous delivery pipeline with docker
Creating a continuous delivery pipeline with dockerCreating a continuous delivery pipeline with docker
Creating a continuous delivery pipeline with dockercontainershipio
 
Docker and Selenoid - Make Autotests Great Again
Docker and Selenoid - Make Autotests Great Again Docker and Selenoid - Make Autotests Great Again
Docker and Selenoid - Make Autotests Great Again COMAQA.BY
 
Meetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React TestingMeetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React TestingAugusto Lazaro
 
Grunt training deck
Grunt training deckGrunt training deck
Grunt training deckJames Ford
 
Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Володимир Дубенко "Node.js for desktop development (based on Electron library)"Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Володимир Дубенко "Node.js for desktop development (based on Electron library)"Fwdays
 
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測謝 宗穎
 
[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze
[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze
[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurzeFuture Processing
 
Евгений Жарков "React Native: Hurdle Race"
Евгений Жарков "React Native: Hurdle Race"Евгений Жарков "React Native: Hurdle Race"
Евгений Жарков "React Native: Hurdle Race"Fwdays
 
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLEAN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLEGavin Pickin
 
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsGDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsDominik Prokop
 
Cypress report
Cypress reportCypress report
Cypress reportAdarsh
 
Ondřej Procházka - Deployment podle Devel.cz
Ondřej Procházka - Deployment podle Devel.czOndřej Procházka - Deployment podle Devel.cz
Ondřej Procházka - Deployment podle Devel.czDevelcz
 
Cypress e2e automation testing - day1 intor by: Hassan Hameed
Cypress e2e automation testing -  day1 intor by: Hassan HameedCypress e2e automation testing -  day1 intor by: Hassan Hameed
Cypress e2e automation testing - day1 intor by: Hassan HameedHassan Muhammad
 
Gulp and bower Implementation
Gulp and bower Implementation Gulp and bower Implementation
Gulp and bower Implementation Prashant Shrestha
 
10 tips for continuous integration
10 tips for continuous integration10 tips for continuous integration
10 tips for continuous integrationVladimir Roudakov
 
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e DroneTDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Dronetdc-globalcode
 
Continuous Development Pipeline
Continuous Development PipelineContinuous Development Pipeline
Continuous Development PipelineIzzet Mustafaiev
 
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
 

What's hot (20)

JSDC 2015 - TDD 的開發哲學,以 Node.js 為例
JSDC 2015 - TDD 的開發哲學,以 Node.js 為例JSDC 2015 - TDD 的開發哲學,以 Node.js 為例
JSDC 2015 - TDD 的開發哲學,以 Node.js 為例
 
Creating a continuous delivery pipeline with docker
Creating a continuous delivery pipeline with dockerCreating a continuous delivery pipeline with docker
Creating a continuous delivery pipeline with docker
 
Docker and Selenoid - Make Autotests Great Again
Docker and Selenoid - Make Autotests Great Again Docker and Selenoid - Make Autotests Great Again
Docker and Selenoid - Make Autotests Great Again
 
Meetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React TestingMeetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React Testing
 
Grunt training deck
Grunt training deckGrunt training deck
Grunt training deck
 
Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Володимир Дубенко "Node.js for desktop development (based on Electron library)"Володимир Дубенко "Node.js for desktop development (based on Electron library)"
Володимир Дубенко "Node.js for desktop development (based on Electron library)"
 
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
為 Node.js 專案打造專屬管家進行開發流程整合及健康檢測
 
[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze
[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze
[Quality Meetup #20] Michał Górski - Continuous Deployment w chmurze
 
Евгений Жарков "React Native: Hurdle Race"
Евгений Жарков "React Native: Hurdle Race"Евгений Жарков "React Native: Hurdle Race"
Евгений Жарков "React Native: Hurdle Race"
 
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLEAN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
 
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsGDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
 
Cypress report
Cypress reportCypress report
Cypress report
 
Ondřej Procházka - Deployment podle Devel.cz
Ondřej Procházka - Deployment podle Devel.czOndřej Procházka - Deployment podle Devel.cz
Ondřej Procházka - Deployment podle Devel.cz
 
Cypress e2e automation testing - day1 intor by: Hassan Hameed
Cypress e2e automation testing -  day1 intor by: Hassan HameedCypress e2e automation testing -  day1 intor by: Hassan Hameed
Cypress e2e automation testing - day1 intor by: Hassan Hameed
 
Cypress Automation
Cypress  AutomationCypress  Automation
Cypress Automation
 
Gulp and bower Implementation
Gulp and bower Implementation Gulp and bower Implementation
Gulp and bower Implementation
 
10 tips for continuous integration
10 tips for continuous integration10 tips for continuous integration
10 tips for continuous integration
 
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e DroneTDC2018SP | Trilha Containers - CI/CD com Docker e Drone
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
 
Continuous Development Pipeline
Continuous Development PipelineContinuous Development Pipeline
Continuous Development Pipeline
 
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
 

Viewers also liked

Preprocessor Workflow with Grunt
Preprocessor Workflow with GruntPreprocessor Workflow with Grunt
Preprocessor Workflow with GruntVlad Filippov
 
Základní nástroje pro automatizaci
Základní nástroje pro automatizaciZákladní nástroje pro automatizaci
Základní nástroje pro automatizaciTomáš Musiol
 
Frontend Development - Supercharge your frontend development with little lang...
Frontend Development - Supercharge your frontend development with little lang...Frontend Development - Supercharge your frontend development with little lang...
Frontend Development - Supercharge your frontend development with little lang...Dave Jeffery
 
GruntJs Installation and popular plugins. MoscowJS
GruntJs Installation and popular plugins. MoscowJSGruntJs Installation and popular plugins. MoscowJS
GruntJs Installation and popular plugins. MoscowJSDmitri Kunin
 

Viewers also liked (8)

Preprocessor Workflow with Grunt
Preprocessor Workflow with GruntPreprocessor Workflow with Grunt
Preprocessor Workflow with Grunt
 
Základní nástroje pro automatizaci
Základní nástroje pro automatizaciZákladní nástroje pro automatizaci
Základní nástroje pro automatizaci
 
Davky jsou-proste-super
Davky jsou-proste-superDavky jsou-proste-super
Davky jsou-proste-super
 
Frontend Development - Supercharge your frontend development with little lang...
Frontend Development - Supercharge your frontend development with little lang...Frontend Development - Supercharge your frontend development with little lang...
Frontend Development - Supercharge your frontend development with little lang...
 
Coffee script throwdown
Coffee script throwdownCoffee script throwdown
Coffee script throwdown
 
Uk norway ib directory
Uk norway ib directoryUk norway ib directory
Uk norway ib directory
 
Mac interval tree
Mac interval treeMac interval tree
Mac interval tree
 
GruntJs Installation and popular plugins. MoscowJS
GruntJs Installation and popular plugins. MoscowJSGruntJs Installation and popular plugins. MoscowJS
GruntJs Installation and popular plugins. MoscowJS
 

Similar to Grunt Continuous Development Front End Node.js

Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
 
Continuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsContinuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsEvgeniy Kuzmin
 
Continuous integration / continuous delivery
Continuous integration / continuous deliveryContinuous integration / continuous delivery
Continuous integration / continuous deliveryEatDog
 
Continuous integration / continuous delivery of web applications, Eugen Kuzmi...
Continuous integration / continuous delivery of web applications, Eugen Kuzmi...Continuous integration / continuous delivery of web applications, Eugen Kuzmi...
Continuous integration / continuous delivery of web applications, Eugen Kuzmi...Evgeniy Kuzmin
 
WordPress automation and CI
WordPress automation and CIWordPress automation and CI
WordPress automation and CIRan Bar-Zik
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by ExampleNalin Goonawardana
 
Real-time Code Sharing Service for one-to-many coding classes
Real-time Code Sharing Service for one-to-many coding classesReal-time Code Sharing Service for one-to-many coding classes
Real-time Code Sharing Service for one-to-many coding classesa2tt
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IOded Sagir
 
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
 
VueJs Workshop
VueJs WorkshopVueJs Workshop
VueJs WorkshopUnfold UI
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development WorkflowVũ Nguyễn
 
High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014Oliver N
 
The "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsThe "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsErik Osterman
 
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016Amazon Web Services
 
Let's make it flow ... one way
Let's make it flow ... one wayLet's make it flow ... one way
Let's make it flow ... one wayRoberto Ciatti
 
CSS Regression Tests
CSS Regression TestsCSS Regression Tests
CSS Regression TestsKaloyan Kosev
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13Fred Sauer
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesAndy Pemberton
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
 

Similar to Grunt Continuous Development Front End Node.js (20)

Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
Continuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsContinuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applications
 
Continuous integration / continuous delivery
Continuous integration / continuous deliveryContinuous integration / continuous delivery
Continuous integration / continuous delivery
 
Continuous integration / continuous delivery of web applications, Eugen Kuzmi...
Continuous integration / continuous delivery of web applications, Eugen Kuzmi...Continuous integration / continuous delivery of web applications, Eugen Kuzmi...
Continuous integration / continuous delivery of web applications, Eugen Kuzmi...
 
WordPress automation and CI
WordPress automation and CIWordPress automation and CI
WordPress automation and CI
 
Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
AWS Code Services
AWS Code ServicesAWS Code Services
AWS Code Services
 
Real-time Code Sharing Service for one-to-many coding classes
Real-time Code Sharing Service for one-to-many coding classesReal-time Code Sharing Service for one-to-many coding classes
Real-time Code Sharing Service for one-to-many coding classes
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
 
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
 
VueJs Workshop
VueJs WorkshopVueJs Workshop
VueJs Workshop
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development Workflow
 
High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014
 
The "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsThe "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/Ops
 
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
 
Let's make it flow ... one way
Let's make it flow ... one wayLet's make it flow ... one way
Let's make it flow ... one way
 
CSS Regression Tests
CSS Regression TestsCSS Regression Tests
CSS Regression Tests
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los AngelesJenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
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?
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Grunt Continuous Development Front End Node.js

  • 1. GRUNT Continuous Development of the Front End Tier, based on node.js Prepared by: Erick Brito August 2014
  • 2. Agenda Goal: To show a Continuous development process of the front end tier using Grunt  HL overview of Grunt  HL overview of process using the plugins  Unit testing with Jasmine  CoffeeScript  Demo  Lessons learned & Next Steps
  • 3. Benefits  Improves the quality,  Using the best practices  allowing to have metrics  Static analysis on:  CSS, Html & JS  Unit tests (BDT) & code coverage of the JavaScript code  Boost productivity.  Allows to have
  • 4. Development Process 1. Developer changes the code and save the file 2. The files are compiled or processed A. Stylus -> css files B. CoffeScript -> JS Files 3. The validation tools are launched A. Jshint, B. csslint, C. lint5 4. Unit tests are launched 5. Files are copied to Development Web Server 6. Browser reloads the changes.
  • 6. Continuous delivery process  Same as the development process  +  Minify  Js  Css  Html  Remove from js the console.log lines (or any regex expression could be changed. Dev. Process Minify Remove/change any regex expressiion
  • 7. Used Grunt Plugins  CSS  Stylus (http://learnboost.github.io/stylus/)  CSS Lint (static code quality analysis)  JavaScript  Coffee script  Jshint (static code quality analysis)  Jasmine (unit tests)  grunt-template-jasmine-istanbul (code coverage)  HTML  Lint5 (static code quality analysis))
  • 8. Used Grunt Plugins  Process  Watch  Connect (enables a webserver)  Proxy-Connect (enables a proxy to invoke remote ajax calls)  Delivery process:  htmlmin  Copy  Cssmin  Regex-replace  uglify
  • 9. Unit testing?  Much more better  Behavior-Driven development  Platform:  Jasmine  Simple to configure  Run on top of phantomjs browser engine  Code coverage:
  • 10. Grunt  Defined as a Javascript task runner.  It needs npm (the Node.js package manager)  Configured throw 2 files  Gruntfile.js  package.json (as it us npm)
  • 11. Grunt: reduce complexity and adds flexibility!
  • 12. Grunt references  http://gruntjs.com  http://www.sitepoint.com/writing-awesome-build-script- grunt/  http://davidtucker.net/articles/automating-with-grunt/  http://whyjava.wordpress.com/2013/11/02/day-5- gruntjs-let-someone-else-do-my-tedious-repetitive-tasks/
  • 13. Coding JavaScript?  Much more better  Coding with CoffeeScript  Benefits:  Better code quality  Boost productivity  Using the good parts of javascript  Ref: http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrr ldwideweb  100% jslint clean code.  Improves readiblity  Code needs to be compiled (guarantee the code is free of syntax , typos errors)
  • 14. CoffeeScript references  http://coffeescript.org  http://coffeescriptcookbook.com  http://arcturo.github.io/library/coffeescript/index.html  http://valve.github.io/blog/2013/07/13/existential-operator-in-coffeescript/  http://openmymind.net/2012/5/16/Ten-Features-I-Like-About- CoffeeScript/  http://www.jimmycuadra.com/posts/coffeescript-classes-under-the- hood  http://www.cs8.my/2012/09/coffeescript-classes-and-their-variables/  http://blog.carbonfive.com/2011/07/06/pragmatic-javascript- testing-with-jasmine/
  • 15. Project  Client  Automotive Industry  Project  Service Recall
  • 16. Demo the development process  Only we need to open 2 consoles and execute:  $ grunt configureProxies:testWithSoapUi connect:livereloadX  $ grunt watch  Open the browser  Modify the code and see how the browser reloads with the latest changes  Run SoapUi Mock server to answer the ajax request that the proxy redirect to our Mock answers.  Time to see CoffeeScript.  4 files (55+137+39+260 = 491 lines compiles into 582 lines). Around 18% less code
  • 17. Lessons learned  Never again code directly on JavaScript,  use CoffeeScript:  “CoffeeScript is less a new language than it is a shorhand for easily expressing the best practices of JavaScipt.”
  • 18. Lessons learned  Start always with a BDD:  Testing with Jasmine & the code coverage was introduced at the end of the project.  If I would started with Jasmine, I will be improved much more the quality of the code.  Ensured the testability of the code.  Ensured the best practices MVC on the frontend.
  • 19. Lessons learned  CSSLint provided a great feedback to improve the quality of the css.  Testing with Jasmine & the code coverage was introduced at the end of the project. Start always with a BDD:  That will be improved much more the quality of the code. Ensured the testability of the code.  Don’t reinvent the wheel: Scalfolding, Dependency management with Bower: Use Yeoman
  • 20. Next steps  Integrate GRUNT in a CI server (Jenkins)  Existing plugin from Jenkins: NodeJS plugin  Ref: https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin  Step by step guide on : http://sideroad.secret.jp/articles/grunt-on- jenkins/  Integrate Grunt reports metrics on SonarQube  Some grunt plugins already exists:  https://www.npmjs.org/package/grunt-karma-sonar  Replicate projects using Yeoman  I18N  Code based on internationalization. (use of resource boundless …
  • 21. Q & A Now it is time to ask questions! Contact: Erick Brito http://blog.erickbrito.ca http://ca.linkedin.com/in/erickbrito Erick.Brito@lochbridge.com erbrito@gmail.com by Erick Brito

Editor's Notes

  1. - preprocesor tools       - validators      - packaging tools      - Process           * Development           * Delivering