SlideShare a Scribd company logo
1 of 98
Download to read offline
Become 
a 
Frontend 
Developer 
Ninja 
using 
HTML5, 
JavaScript 
and 
CSS3 
Marco Casario 
CTO Comtaste - m.casario@comtaste.com 
Wednesday, December 3, 14
Chi 
sono 
Www.Marcocasario.Com 2 
Marco Casario 
CTO Comtaste 
www.linkedin.com/in/marcocasario 
Wednesday, December 3, 14
I 
miei 
ulCmi 
libri 
Www.Marcocasario.Com 3 
Wednesday, December 3, 14
I 
miei 
corsi 
training.codemotion.it 
Www.Marcocasario.Com 3 
Wednesday, December 3, 14
AGENDA 
Wednesday, December 3, 14
Agenda 
OpCmizaCons 
Best 
PracCces 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
WHAT 
MAKES 
YOU 
A 
FRONTEND 
NINJA 
DEVELOPER 
Wednesday, December 3, 14
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Velocity 
What are the the ingredients of 
a Frontend Developer Ninja ? 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Languages 
+ 
Libraries 
+ 
Frameworks 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Page 
weight 
grows 
http://httparchive.org/trends.php?s=Top1000&minlabel=Nov 
+15+2010&maxlabel=Apr+1+2014#bytesTotal&reqTotal 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Mobile 
Devices 
& 
Large 
Screens 
https://www.flickr.com/photos/lukew 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Velocity 
Desktop users are more or less 
satisfied with the status quo 
(but pages are going bigger) 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Measuring 
the 
load 
Cme 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Velocity 
DISCLAIMER. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
OPTIMIZATIONS 
Wednesday, December 3, 14
Why 
is 
it 
important 
? 
Start from Page Insights 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Why 
is 
it 
important 
? 
You can’t optimize 
what you can’t measure 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Why 
is 
it 
important 
? 
Learning how the browsers 
load your web pages, helps you: 
make better decisions, 
justify the approaches and the 
development best practices. 
-- Paul Irish 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Browser’s 
rendering 
flow 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Browser’s 
rendering 
flow 
It’s not a linear flow. 
Each time a resource needs to 
be downloaded, it blocks the 
rendering. 
http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/ 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
In order to optimize you: 
1. identify & mesure a scenario 
2. define what the fastest you 
can get is 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
The Speed Index 
https://sites.google.com/a/webpagetest.org/docs/ 
using-webpagetest/metrics/speed-index 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
The Speed Index is the average time at 
which visible parts of the page are 
displayed. It is expressed in 
milliseconds and dependent on size of 
the view port. 
It measures when pixels are shown on 
screen. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
The Speed Index is the "area above the 
curve" calculated in ms and using 0.0-1.0 
for the range of visually complete. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
The Speed Index is the "area above the 
curve" calculated in ms and using 0.0-1.0 
for the range of visually complete. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Identify the Load Time & the 
End of Activity 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Get a visual representation of 
the user’s perception of what’s 
happening 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
http://www.webpagetest.org/video/compare.php?tests=140410_4Y_KVY-r:1-c:0 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Focus on: 
the speed index value 
the total load time 
the render time 
the bandwidth 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Is the bandwidth so important 
for faster pages ? 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
For getting fast pages, what is 
the right number of requests 
and optimal page size ? 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Measuring performance by the KB is 
like measuring effectiveness of your 
diet by the pound. 
Measuring performance by the number 
of requests is like measuring your diet 
by number of things you ate - in both 
cases, who cares about what you 
actually ate, right ? 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Moreover, not all requests are 
made equal. 
Where are they initiated? 
What part of the UX do they 
block ? 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Moreover, not all the bytes are 
made equal. 
Bytes of different content-types 
have different impact on 
performance. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
What's the critical path on 
loading a page ? 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Bandwidth + Latency = 
Performance 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
BEST 
PRACTICES 
Wednesday, December 3, 14
Velocity 
Take your time to code. 
When you invest time you can 
get closer to a core of a 
problem. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
600 ms of time has already been used up by 
network overhead: a DNS lookup to resolve the 
hostname (e.g. google.com) to an IP address, a 
network roundtrip to perform the TCP handshake, 
and finally a full network roundtrip to send the 
HTTP request. This leaves us with just 400 ms! 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
OUR GOAL 
To give the Perception of page 
loading in 200ms 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
You need to understand the 
components of an HTTP 
request 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
1. DNS lookup to resolve the hostname 
to IP address 
2. New TCP connection requires a 
handshake roundtrip to the server 
3. HTTP request requires minimum of a 
one roundtrip to the server plus server 
processing time 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
http://www.webpagetest.org/result/ 
140410_XJ_CHT/1/details/ 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Focus on: 
DNS Lookup 
TCP connection 
HTTP requests 
Bandwidth used 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
What does it happen when 
there is a gap in the bandwidth 
chart ? 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
http://chimera.labs.oreilly.com/books/1230000000545/ 
ch10.html#LATENCY_BOTTLENECK 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Latency is the performance 
bottleneck for HTTP as well as 
all the web. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Focus on how resources that 
are requested from a different 
origin consume network time 
http://www.webpagetest.org/video/compare.php? 
tests=140410_AT_DST-r:1-c:0 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
What will your gain be if you 
load zeptojs instead of Jquery ? 
What if you reduce the blocking 
resources and make parallel 
loading ? 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
How can you write better code 
to render the page faster ? 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Stop Spamming 
http://idontwantyourfuckingapp.tumblr.com/ 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Eliminate render-blocking JS 
Load JS asynch 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
<script src="file.js" defer></script> 
<script src="file.js" async></script> 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Use a library like RequireJS 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Pay Attention to Media Queries 
They block the rendering of the 
page 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Pay Attention to Media Queries 
1. Load Media Queries CSS 
async (inject <LINK> after rendering) 
2.Mix server-side detection with 
RWD (WURLF or DeviceAtlas) 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Web Fonts are render blocking 
Defer loading after first 
rendering 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Cache content 
Use Application Cache for 
critical content 
IndexedDB on iOS 8 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Double check the size of the 
Cookies 
(Resources Tab of the Dev Tools) 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Serve the content in the initial 
part of html 
Avoid redirects for html 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Use Gzip. 
http://www.gidnetwork.com/tools/gzip-test. 
php 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
No really, Use Gzip. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Don't F*#k Around, use gzip. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Have a look at SPDY: An 
experimental protocol for a 
faster web 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Minimize your JavaScript and 
CSS files. 
It's easy and it can be 
automated. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Minimize render-blocking CSS: 
separate critical from non 
critical CSS if your CSS payload 
is larger that 15kb 
Avoid including large data URIs 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Talking about rendering, how 
you can write better CSS to 
render the page faster ? 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
External CSS stylesheets are 
render-blocking, meaning the 
browser won’t paint content to 
the screen until all of your CSS 
– specifically, media=’screen’ 
CSS – arrives. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
The solution to this is inlining 
the initially needed (above-the-fold) 
CSS for your page and 
loading the rest of your CSS 
when the page is ready. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Inline CSS 
Ready and available for the 
page. 
Single HTTP request to view 
content. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Inline CSS 
Shave 500-700 ms off start 
rendering the 
DOMContentReady 
Use only for the critical CSS 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
How can you define your critical 
content? 
What the user expects to first 
see on the page when it’s 
loaded. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Loss Of Caching 
Inlining the content makes the code not 
cacheable and the resources are re-downloaded 
every time. 
The first page load on a new site may be 
faster, but subsequent pages or return 
visitors would experience a slower page load. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
First Visit Inlining 
On the first visit, inline the critical CSS and set a 
cookie 
Once the page loads, download all the resources 
as individual files, or store the data into a 
Scriptable Cache (http://www.blaze.io/technical/browser-cache- 
2-0-scriptable-cache/) 
If a user visits the page and has the cookie, 
assume it has the files in the cache, and don’t 
inline the data. 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Load CSS from local storage 
http://addyosmani.github.io/ 
basket.js/ 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Remove 
orphan 
CSS 
statements. 
www.sitepoint.com/dustmeselectors/ 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Op9mize 
images 
Use 
the 
Sprite 
technique. 
h>p://alistapart.com/ar9cle/sprites 
h>p://spriteme.org/ 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Use 
the 
icon 
fonts 
h>p://icomoon.io/ 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Compress images 
http://imageoptim.pornel.net/ 
http://developer.yahoo.com/yslow/smushit/ 
http://pmt.sourceforge.net/pngcrush/ 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
How 
to 
opCmize 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
AUTOMATING 
& 
TESTING 
Wednesday, December 3, 14
Author, 
TesCng, 
Automate 
Use the right tool to author, 
testing and automate 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Yeoman 
It’s a tool to help optimize your workflow 
when developing web applications 
http://www.yeoman.io 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Yeoman 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Yeoman 
Before Yeoman 
Make a list of libraries to use in your 
project (es. Bootstrap, HTML5 
Boilerplate, Backbone etc) 
Download the libraries 
Organize the folders 
Include the libraries to the project 
Write the code 
Maintain and update the libraries 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Yeoman 
With Yeoman 
yo webapp 
HTML5 Boilerplate 
Twitter Bootstrap 
Project Structure 
RequireJS (optional) 
Modernizr (optional) 
Build process 
... 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Yeoman 
yo webapp 
# scaffold out a skeleton web app 
project 
bower install underscore 
# install a dependency for your project 
from Bower 
grunt 
# build the application for deployment 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Yeoman 
One of the sub-tsk that Grunt executes 
is the -usemin that makes the following: 
<!-- build:js scripts/main.js --> 
<script src="bower_components/jquery/jquery.js"></script> 
<script src="scripts/main.js"></script> 
<!-- endbuild --> 
After your grunt build task completes, 
you will end up with this: 
<script src="scripts/c155266f.main.js"></script> 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Yeoman 
Bower is a package manager 
for web application 
www.bower.io 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Yeoman 
bower.json 
{ 
"name": "yowebapp", 
"version": "0.1.0", 
"dependencies": { 
"sass-bootstrap": "~3.0", 
"requirejs": "~2.1.4", 
"jquery": "~1.9.1", 
"angular":"1.0.7" 
}, 
"devDependencies": {} 
} 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Chrome 
Dev 
Tools 
Chrome Developer Tools 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Chrome 
Dev 
Tools 
Remote Debugging 
Www.Marcocasario.Com 28 
Wednesday, December 3, 14
Become 
a 
Frontend 
Developer 
Ninja 
using 
HTML5, 
JavaScript 
and 
CSS3 
Marco Casario 
CTO Comtaste - m.casario@comtaste.com 
Wednesday, December 3, 14

More Related Content

Similar to Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - Marco Casario - Codemotion Milan 2014

Web security at Meteor (Pivotal Labs)
Web security at Meteor (Pivotal Labs)Web security at Meteor (Pivotal Labs)
Web security at Meteor (Pivotal Labs)
Emily Stark
 
Consideration for Building a Private Cloud
Consideration for Building a Private CloudConsideration for Building a Private Cloud
Consideration for Building a Private Cloud
OpenStack Foundation
 
Basic Drupal Recipes - BADCamp 2009
Basic Drupal Recipes - BADCamp 2009Basic Drupal Recipes - BADCamp 2009
Basic Drupal Recipes - BADCamp 2009
c4rl
 

Similar to Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - Marco Casario - Codemotion Milan 2014 (20)

Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - Casario
Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - CasarioBecome a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - Casario
Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - Casario
 
Web Performance Optimization @Develer
Web Performance Optimization @DevelerWeb Performance Optimization @Develer
Web Performance Optimization @Develer
 
Making the Switch, Part 1: Top 5 Things to Consider When Evaluating Drupal
Making the Switch, Part 1: Top 5 Things to Consider When Evaluating DrupalMaking the Switch, Part 1: Top 5 Things to Consider When Evaluating Drupal
Making the Switch, Part 1: Top 5 Things to Consider When Evaluating Drupal
 
Web performance optimization
Web performance optimizationWeb performance optimization
Web performance optimization
 
Web security at Meteor (Pivotal Labs)
Web security at Meteor (Pivotal Labs)Web security at Meteor (Pivotal Labs)
Web security at Meteor (Pivotal Labs)
 
Consideration for Building a Private Cloud
Consideration for Building a Private CloudConsideration for Building a Private Cloud
Consideration for Building a Private Cloud
 
Continuous Delivery at Netflix
Continuous Delivery at NetflixContinuous Delivery at Netflix
Continuous Delivery at Netflix
 
Web Server SEO: Making your TTFB faster!
Web Server SEO: Making your TTFB faster!Web Server SEO: Making your TTFB faster!
Web Server SEO: Making your TTFB faster!
 
Performance and optimization
Performance and optimizationPerformance and optimization
Performance and optimization
 
Measuring Web Performance (HighEdWeb FL Edition)
Measuring Web Performance (HighEdWeb FL Edition)Measuring Web Performance (HighEdWeb FL Edition)
Measuring Web Performance (HighEdWeb FL Edition)
 
Super speed around the globe - SearchLeeds 2018
Super speed around the globe - SearchLeeds 2018Super speed around the globe - SearchLeeds 2018
Super speed around the globe - SearchLeeds 2018
 
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
SearchLeeds 2018 - Bastian Grimm - Peak Ace - International site speed: Going...
 
Basic Drupal Recipes - BADCamp 2009
Basic Drupal Recipes - BADCamp 2009Basic Drupal Recipes - BADCamp 2009
Basic Drupal Recipes - BADCamp 2009
 
Getting a Grip on CDN Performance - Why and How
Getting a Grip on CDN Performance - Why and HowGetting a Grip on CDN Performance - Why and How
Getting a Grip on CDN Performance - Why and How
 
Green Shoots in the Brownest Field: Being a Startup in Government
Green Shoots in the Brownest Field: Being a Startup in GovernmentGreen Shoots in the Brownest Field: Being a Startup in Government
Green Shoots in the Brownest Field: Being a Startup in Government
 
Demystifying web performance tooling and metrics
Demystifying web performance tooling and metricsDemystifying web performance tooling and metrics
Demystifying web performance tooling and metrics
 
Full Stack & Full Circle: What the Heck Happens In an HTTP Request-Response C...
Full Stack & Full Circle: What the Heck Happens In an HTTP Request-Response C...Full Stack & Full Circle: What the Heck Happens In an HTTP Request-Response C...
Full Stack & Full Circle: What the Heck Happens In an HTTP Request-Response C...
 
Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?) Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)
 
Velocity NYC: Metrics, metrics everywhere (but where the heck do you start?)
Velocity NYC: Metrics, metrics everywhere (but where the heck do you start?)Velocity NYC: Metrics, metrics everywhere (but where the heck do you start?)
Velocity NYC: Metrics, metrics everywhere (but where the heck do you start?)
 
Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)
 

More from Codemotion

More from Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 - Marco Casario - Codemotion Milan 2014

  • 1. Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 Marco Casario CTO Comtaste - m.casario@comtaste.com Wednesday, December 3, 14
  • 2. Chi sono Www.Marcocasario.Com 2 Marco Casario CTO Comtaste www.linkedin.com/in/marcocasario Wednesday, December 3, 14
  • 3. I miei ulCmi libri Www.Marcocasario.Com 3 Wednesday, December 3, 14
  • 4. I miei corsi training.codemotion.it Www.Marcocasario.Com 3 Wednesday, December 3, 14
  • 6. Agenda OpCmizaCons Best PracCces Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 7. WHAT MAKES YOU A FRONTEND NINJA DEVELOPER Wednesday, December 3, 14
  • 9. Velocity What are the the ingredients of a Frontend Developer Ninja ? Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 10. Languages + Libraries + Frameworks Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 11. Page weight grows http://httparchive.org/trends.php?s=Top1000&minlabel=Nov +15+2010&maxlabel=Apr+1+2014#bytesTotal&reqTotal Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 12. Mobile Devices & Large Screens https://www.flickr.com/photos/lukew Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 13. Velocity Desktop users are more or less satisfied with the status quo (but pages are going bigger) Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 14. Measuring the load Cme Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 15. Velocity DISCLAIMER. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 17. Why is it important ? Start from Page Insights Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 18. Why is it important ? You can’t optimize what you can’t measure Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 19. Why is it important ? Learning how the browsers load your web pages, helps you: make better decisions, justify the approaches and the development best practices. -- Paul Irish Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 20. Browser’s rendering flow Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 21. Browser’s rendering flow It’s not a linear flow. Each time a resource needs to be downloaded, it blocks the rendering. http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/ Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 22. How to opCmize In order to optimize you: 1. identify & mesure a scenario 2. define what the fastest you can get is Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 23. How to opCmize The Speed Index https://sites.google.com/a/webpagetest.org/docs/ using-webpagetest/metrics/speed-index Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 24. How to opCmize The Speed Index is the average time at which visible parts of the page are displayed. It is expressed in milliseconds and dependent on size of the view port. It measures when pixels are shown on screen. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 25. How to opCmize The Speed Index is the "area above the curve" calculated in ms and using 0.0-1.0 for the range of visually complete. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 26. How to opCmize The Speed Index is the "area above the curve" calculated in ms and using 0.0-1.0 for the range of visually complete. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 27. How to opCmize Identify the Load Time & the End of Activity Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 28. How to opCmize Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 29. How to opCmize Get a visual representation of the user’s perception of what’s happening Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 30. How to opCmize http://www.webpagetest.org/video/compare.php?tests=140410_4Y_KVY-r:1-c:0 Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 31. How to opCmize Focus on: the speed index value the total load time the render time the bandwidth Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 32. How to opCmize Is the bandwidth so important for faster pages ? Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 33. How to opCmize For getting fast pages, what is the right number of requests and optimal page size ? Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 34. How to opCmize Measuring performance by the KB is like measuring effectiveness of your diet by the pound. Measuring performance by the number of requests is like measuring your diet by number of things you ate - in both cases, who cares about what you actually ate, right ? Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 35. How to opCmize Moreover, not all requests are made equal. Where are they initiated? What part of the UX do they block ? Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 36. How to opCmize Moreover, not all the bytes are made equal. Bytes of different content-types have different impact on performance. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 37. How to opCmize What's the critical path on loading a page ? Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 38. How to opCmize Bandwidth + Latency = Performance Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 39. BEST PRACTICES Wednesday, December 3, 14
  • 40. Velocity Take your time to code. When you invest time you can get closer to a core of a problem. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 41. How to opCmize 600 ms of time has already been used up by network overhead: a DNS lookup to resolve the hostname (e.g. google.com) to an IP address, a network roundtrip to perform the TCP handshake, and finally a full network roundtrip to send the HTTP request. This leaves us with just 400 ms! Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 42. How to opCmize OUR GOAL To give the Perception of page loading in 200ms Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 43. How to opCmize Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 44. How to opCmize You need to understand the components of an HTTP request Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 45. How to opCmize 1. DNS lookup to resolve the hostname to IP address 2. New TCP connection requires a handshake roundtrip to the server 3. HTTP request requires minimum of a one roundtrip to the server plus server processing time Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 46. How to opCmize http://www.webpagetest.org/result/ 140410_XJ_CHT/1/details/ Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 47. How to opCmize Focus on: DNS Lookup TCP connection HTTP requests Bandwidth used Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 48. How to opCmize What does it happen when there is a gap in the bandwidth chart ? Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 49. How to opCmize http://chimera.labs.oreilly.com/books/1230000000545/ ch10.html#LATENCY_BOTTLENECK Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 50. How to opCmize Latency is the performance bottleneck for HTTP as well as all the web. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 51. How to opCmize Focus on how resources that are requested from a different origin consume network time http://www.webpagetest.org/video/compare.php? tests=140410_AT_DST-r:1-c:0 Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 52. How to opCmize What will your gain be if you load zeptojs instead of Jquery ? What if you reduce the blocking resources and make parallel loading ? Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 53. How to opCmize How can you write better code to render the page faster ? Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 54. How to opCmize Stop Spamming http://idontwantyourfuckingapp.tumblr.com/ Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 55. How to opCmize Eliminate render-blocking JS Load JS asynch Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 56. How to opCmize <script src="file.js" defer></script> <script src="file.js" async></script> Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 57. How to opCmize Use a library like RequireJS Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 58. How to opCmize Pay Attention to Media Queries They block the rendering of the page Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 59. How to opCmize Pay Attention to Media Queries 1. Load Media Queries CSS async (inject <LINK> after rendering) 2.Mix server-side detection with RWD (WURLF or DeviceAtlas) Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 60. How to opCmize Web Fonts are render blocking Defer loading after first rendering Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 61. How to opCmize Cache content Use Application Cache for critical content IndexedDB on iOS 8 Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 62. How to opCmize Double check the size of the Cookies (Resources Tab of the Dev Tools) Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 63. How to opCmize Serve the content in the initial part of html Avoid redirects for html Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 64. How to opCmize Use Gzip. http://www.gidnetwork.com/tools/gzip-test. php Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 65. How to opCmize No really, Use Gzip. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 66. How to opCmize Don't F*#k Around, use gzip. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 67. How to opCmize Have a look at SPDY: An experimental protocol for a faster web Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 68. How to opCmize Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 69. How to opCmize Minimize your JavaScript and CSS files. It's easy and it can be automated. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 70. How to opCmize Minimize render-blocking CSS: separate critical from non critical CSS if your CSS payload is larger that 15kb Avoid including large data URIs Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 71. How to opCmize Talking about rendering, how you can write better CSS to render the page faster ? Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 72. How to opCmize External CSS stylesheets are render-blocking, meaning the browser won’t paint content to the screen until all of your CSS – specifically, media=’screen’ CSS – arrives. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 73. How to opCmize The solution to this is inlining the initially needed (above-the-fold) CSS for your page and loading the rest of your CSS when the page is ready. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 74. How to opCmize Inline CSS Ready and available for the page. Single HTTP request to view content. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 75. How to opCmize Inline CSS Shave 500-700 ms off start rendering the DOMContentReady Use only for the critical CSS Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 76. How to opCmize How can you define your critical content? What the user expects to first see on the page when it’s loaded. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 77. How to opCmize Loss Of Caching Inlining the content makes the code not cacheable and the resources are re-downloaded every time. The first page load on a new site may be faster, but subsequent pages or return visitors would experience a slower page load. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 78. How to opCmize First Visit Inlining On the first visit, inline the critical CSS and set a cookie Once the page loads, download all the resources as individual files, or store the data into a Scriptable Cache (http://www.blaze.io/technical/browser-cache- 2-0-scriptable-cache/) If a user visits the page and has the cookie, assume it has the files in the cache, and don’t inline the data. Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 79. How to opCmize Load CSS from local storage http://addyosmani.github.io/ basket.js/ Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 80. How to opCmize Remove orphan CSS statements. www.sitepoint.com/dustmeselectors/ Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 81. How to opCmize Op9mize images Use the Sprite technique. h>p://alistapart.com/ar9cle/sprites h>p://spriteme.org/ Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 82. How to opCmize Use the icon fonts h>p://icomoon.io/ Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 83. How to opCmize Compress images http://imageoptim.pornel.net/ http://developer.yahoo.com/yslow/smushit/ http://pmt.sourceforge.net/pngcrush/ Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 84. How to opCmize Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 85. How to opCmize Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 86. AUTOMATING & TESTING Wednesday, December 3, 14
  • 87. Author, TesCng, Automate Use the right tool to author, testing and automate Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 88. Yeoman It’s a tool to help optimize your workflow when developing web applications http://www.yeoman.io Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 89. Yeoman Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 90. Yeoman Before Yeoman Make a list of libraries to use in your project (es. Bootstrap, HTML5 Boilerplate, Backbone etc) Download the libraries Organize the folders Include the libraries to the project Write the code Maintain and update the libraries Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 91. Yeoman With Yeoman yo webapp HTML5 Boilerplate Twitter Bootstrap Project Structure RequireJS (optional) Modernizr (optional) Build process ... Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 92. Yeoman yo webapp # scaffold out a skeleton web app project bower install underscore # install a dependency for your project from Bower grunt # build the application for deployment Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 93. Yeoman One of the sub-tsk that Grunt executes is the -usemin that makes the following: <!-- build:js scripts/main.js --> <script src="bower_components/jquery/jquery.js"></script> <script src="scripts/main.js"></script> <!-- endbuild --> After your grunt build task completes, you will end up with this: <script src="scripts/c155266f.main.js"></script> Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 94. Yeoman Bower is a package manager for web application www.bower.io Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 95. Yeoman bower.json { "name": "yowebapp", "version": "0.1.0", "dependencies": { "sass-bootstrap": "~3.0", "requirejs": "~2.1.4", "jquery": "~1.9.1", "angular":"1.0.7" }, "devDependencies": {} } Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 96. Chrome Dev Tools Chrome Developer Tools Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 97. Chrome Dev Tools Remote Debugging Www.Marcocasario.Com 28 Wednesday, December 3, 14
  • 98. Become a Frontend Developer Ninja using HTML5, JavaScript and CSS3 Marco Casario CTO Comtaste - m.casario@comtaste.com Wednesday, December 3, 14