SlideShare a Scribd company logo
1 of 35
Download to read offline
Faster 
Web 
Development 
Bower, Grunt, Yeoman 
dev-to-dev 
talk 
Dmitry Ivashutin at :iTechArt, Oct 2014
Presenter 
Dmitry Ivashutin 
Software Engineer
Let’s imagine that you need to make a ... 
web site!
Old-school way ... 
1) type everything from scratch ... 
2) search & download resources ...
Lazy way ... 
1) copy paste from other projects ... 
2) use resources from local ...
Easy way ... 
1) use templates and boilerplates ... 
2) use resource package managers ...
Let’s start from the very beginning ...
body & engine
toolkit
parts shop ...
A package 
manager 
for web 
Reduce the weight!
Easy as “One, Two, Three” 
npm install -g bower 
bower search <name> 
bower init 
bower install <package> --save
bower.json config 
{ 
"name": "PimpYourDev", 
"version": "0.0.1", 
"license": "", 
"private": true, 
"ignore": [ 
"**/.*", 
"node_modules", 
"bower_components", 
"test", 
"tests" 
], 
"dependencies": { 
"angular": "~1.2.16", 
"jquery": "~2.0.3", 
"bootstrap": "~3.1.1", 
"modernizr": "~2.8.2", 
"moment": "~2.6.0", 
"underscore": "~1.7.0" 
} 
} 
bower install
The Web’s 
Scaffolding 
Tool for 
Modern 
WebApps 
Let’s add nitrous oxide!
First steps 
npm install -g yo 
npm install -g <generator> 
yo 
run generator and follow Yeoman steps ...
and that is only 
the beginning...
Yeoman ... 
can serve 
your web 
app ... 
allows testing 
with Karma and 
Jasmine ... 
helps generating 
files by 
templates ...
The 
JavaScript 
Task 
Runner 
performance parts ...
Start Slow to go Fast 
npm install -g grunt-cli 
check your package.json* 
and then prepare the Gruntfile ...
package.json 
{ 
"name": "PimpYourDev", 
"version": "0.0.2", 
"devDependencies": { 
"grunt": "~0.4.5", 
"grunt-contrib-jshint": "~0.10.0", 
"grunt-contrib-nodeunit": "~0.4.1", 
"grunt-contrib-uglify": "~0.5.0" 
} 
}
the Gruntfile 
● The "wrapper" function 
● Project and task configuration 
● Loading Grunt plugins and tasks 
● Register Custom tasks
Wrapper function 
module.exports = function (grunt) { 
// Do grunt-related things in here 
};
Configuration 
grunt.initConfig({ 
pkg: grunt.file.readJSON('package.json'), 
jshint: { 
all: ['Gruntfile.js', '<%= userPath %>/**/*.js'], 
// On errors with parsing config please ensure 
// it's saved in regular UTF-8 encoding (without BOM). 
options: { 
jshintrc: '.jshintrc' 
} 
} 
});
Configuration (with options) 
grunt.initConfig({ 
less: { 
options: { sourceMap: true }, 
debug: { 
files: { 'build/css/base.css': 'dev/less/base.less' } 
}, 
release: { 
options: { cleancss: true }, 
files: { 'build/css/all.min.css': ['dev/less/base.less'] } 
} 
} 
});
Loading plugins and tasks 
grunt.loadNpmTasks('grunt-contrib-jshint'); 
grunt.loadNpmTasks('grunt-contrib-clean'); 
grunt.loadNpmTasks('grunt-contrib-copy'); 
grunt.loadNpmTasks('grunt-contrib-less'); 
grunt.loadNpmTasks('grunt-contrib-concat');
Register Custom tasks 
var debug = [ 
'jshint', 
'clean:build', 
'copy:debug', 
'less:debug' 
]; 
grunt.registerTask('debug', debug); 
grunt.registerTask('Debug', debug);
Usage 
> grunt debug 
Running "jshint:all" (jshint) task 
>> 100 files lint free. 
Running "clean:build" (clean) task 
Cleaning ../build/ui/static...OK 
Running "copy:debug" (copy) task 
Created 4 directories, copied 157 files 
Running "less:debug" (less) task 
File ../build/css/base.css created.
Over 3K plugins
Remember Your Dev 
before?
Rather sad ...
Your Dev after
looks much better!
and that is still 
only the 
beginning...
Questions?

More Related Content

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Recently uploaded (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Dev2Dev - Faster Web Development using Bower, Grunt, Yeoman!

  • 1. Faster Web Development Bower, Grunt, Yeoman dev-to-dev talk Dmitry Ivashutin at :iTechArt, Oct 2014
  • 2. Presenter Dmitry Ivashutin Software Engineer
  • 3. Let’s imagine that you need to make a ... web site!
  • 4. Old-school way ... 1) type everything from scratch ... 2) search & download resources ...
  • 5. Lazy way ... 1) copy paste from other projects ... 2) use resources from local ...
  • 6. Easy way ... 1) use templates and boilerplates ... 2) use resource package managers ...
  • 7. Let’s start from the very beginning ...
  • 11.
  • 12. A package manager for web Reduce the weight!
  • 13. Easy as “One, Two, Three” npm install -g bower bower search <name> bower init bower install <package> --save
  • 14. bower.json config { "name": "PimpYourDev", "version": "0.0.1", "license": "", "private": true, "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "angular": "~1.2.16", "jquery": "~2.0.3", "bootstrap": "~3.1.1", "modernizr": "~2.8.2", "moment": "~2.6.0", "underscore": "~1.7.0" } } bower install
  • 15. The Web’s Scaffolding Tool for Modern WebApps Let’s add nitrous oxide!
  • 16. First steps npm install -g yo npm install -g <generator> yo run generator and follow Yeoman steps ...
  • 17. and that is only the beginning...
  • 18. Yeoman ... can serve your web app ... allows testing with Karma and Jasmine ... helps generating files by templates ...
  • 19. The JavaScript Task Runner performance parts ...
  • 20. Start Slow to go Fast npm install -g grunt-cli check your package.json* and then prepare the Gruntfile ...
  • 21. package.json { "name": "PimpYourDev", "version": "0.0.2", "devDependencies": { "grunt": "~0.4.5", "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-nodeunit": "~0.4.1", "grunt-contrib-uglify": "~0.5.0" } }
  • 22. the Gruntfile ● The "wrapper" function ● Project and task configuration ● Loading Grunt plugins and tasks ● Register Custom tasks
  • 23. Wrapper function module.exports = function (grunt) { // Do grunt-related things in here };
  • 24. Configuration grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), jshint: { all: ['Gruntfile.js', '<%= userPath %>/**/*.js'], // On errors with parsing config please ensure // it's saved in regular UTF-8 encoding (without BOM). options: { jshintrc: '.jshintrc' } } });
  • 25. Configuration (with options) grunt.initConfig({ less: { options: { sourceMap: true }, debug: { files: { 'build/css/base.css': 'dev/less/base.less' } }, release: { options: { cleancss: true }, files: { 'build/css/all.min.css': ['dev/less/base.less'] } } } });
  • 26. Loading plugins and tasks grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-contrib-concat');
  • 27. Register Custom tasks var debug = [ 'jshint', 'clean:build', 'copy:debug', 'less:debug' ]; grunt.registerTask('debug', debug); grunt.registerTask('Debug', debug);
  • 28. Usage > grunt debug Running "jshint:all" (jshint) task >> 100 files lint free. Running "clean:build" (clean) task Cleaning ../build/ui/static...OK Running "copy:debug" (copy) task Created 4 directories, copied 157 files Running "less:debug" (less) task File ../build/css/base.css created.
  • 30. Remember Your Dev before?
  • 34. and that is still only the beginning...