SlideShare une entreprise Scribd logo
1  sur  56
“HTML5, CSS3 y JavaScript”
MercadoLibre.com – Julio 2010




                                        Julio de 2010
Agenda


                                 • HTML5 Rápido

                                     • Revisión

                                     • Experimentos

                                 • Ingeniería de Front End

                                     • Pila de tecnologías

                                     • Crossbrowsing

                                     • Mejora Progresiva

                                     • Reglas para optimizar
MercadoLibre.com – Julio 2010




                                 • Recursos




                                                               2
http://slides.html5rocks.com/




                                                                          HT
MercadoLibre.com – Julio 2010




                                      http://slides.html5rocks.com/
                                                                      3
http://slides.html5rocks.com/




                                         Media Queries
MercadoLibre.com – Julio 2010




                                              http://www.w3.org/TR/css3-mediaqueries/


                                      http://slides.html5rocks.com/
                                                                                        4
Media Queries


                                <link rel="stylesheet" type="text/css"
                                  media="screen"
                                  href="core.css" />
MercadoLibre.com – Julio 2010




                                                                         5
Media Queries


                                <link rel="stylesheet" type="text/css"
                                  media="screen"
                                  href="core.css" />




                                <link rel="stylesheet" type="text/css"
                                  media="screen and (max-device-width: 480px)"
                                  href="iphone.css" />
MercadoLibre.com – Julio 2010




                                                                                 6
Media Queries


                                <link rel="stylesheet" type="text/css"
                                  media="screen"
                                  href="core.css" />




                                <link rel="stylesheet" type="text/css"
                                  media="screen and (max-device-width: 480px)"
                                  href="iphone.css" />
MercadoLibre.com – Julio 2010




                                                                                 7
MercadoLibre.com – Julio 2010




Experiments
8
Experimentos


                                 • Google http://mrdoob.com/projects/chromeexperiments/
                                   google_gravity/
                                 • Mario Kart http://www.nihilogic.dk/labs/mariokart/
                                 • Trail http://www.hakim.se/experiments/html5/trail/03/
                                 • Bakemono http://www.hakim.se/experiments/html5/
                                   bakemono/01/
                                 • Ball Pool http://mrdoob.com/projects/chromeexperiments/
                                   ball_pool/
                                 • Canvas Experiment http://9elements.com/io/projects/html5/
                                   canvas/ 
MercadoLibre.com – Julio 2010




                                                                                             9
The Front End Engineers Playground




                                                                          HT
MercadoLibre.com – Julio 2010




                                                                     10
The Front End Engineers Playground




                                                                          HT
                                                ¿De que se trata?
MercadoLibre.com – Julio 2010




                                                                     11
The Front End Engineers Playground




                                                                          HT
                                                          Peligro
MercadoLibre.com – Julio 2010




                                                                     12
The Front End Engineers Playground




                                                                          HT
                                                      Adrenalina
MercadoLibre.com – Julio 2010




                                                                     13
The Front End Engineers Playground




                                                                          HT
                                                        Aventura
MercadoLibre.com – Julio 2010




                                                                     14
The Front End Engineers Playground




                                           "A long time ago, in a galaxy far far away"
MercadoLibre.com – Julio 2010




                                                                                         15
The Front End Engineers Playground




                                                ¿Frontend Engineer?
MercadoLibre.com – Julio 2010




                                                                      16
¿Frontend Engineer?


                                 • “Frontend engineers focused at the
                                   intersection of design and development is a
                                   best practice.”
                                 • “We write software in JavaScript, CSS and
                                   HTML, & more...”
                                 • “We tell browsers what to do.”
                                 • “We’re responsible for view source.”
MercadoLibre.com – Julio 2010




                                                                                 17
¿Frontend Engineer?


                                 • “Frontend engineers focused at the
                                   intersection of design and development is a
                                   best practice.”
                                 • “We write software in JavaScript, CSS and
                                                      Nate Koechley
                                   HTML, & more...”
                                    http://video.yahoo.com/watch/4671445/12486762
                                 • “We tell browsers what to do.”
                                Professional Frontend Engineering
                                • “We’re responsible for view source.”
MercadoLibre.com – Julio 2010




                                                                                    18
¿Frontend Engineer?




                                         Los responsables del -view source-
MercadoLibre.com – Julio 2010




                                                                              19
MercadoLibre.com – Julio 2010
                                     Pila de tecnologías




20
Pila de tecnologías


                                 • Device x plataform x tech x api
                                 • Touch screen, Motion capture, Acelerometer
                                 • Demand of a better experience
MercadoLibre.com – Julio 2010




                                                                                21
MercadoLibre.com – Julio 2010
                                Pila de tecnologías
Pila de tecnologías




                                                  + la transferencia
                                                       de datos
MercadoLibre.com – Julio 2010
Frontend vs Backend


                                 • No compila
                                 • No se puede confiar
                                 • No se puede predecir
                                 • No se puede esconder!
MercadoLibre.com – Julio 2010




                                                           24
MercadoLibre.com – Julio 2010




25
“The most hostile software development
                                      environment imaginable.”
MercadoLibre.com – Julio 2010




                                                     Douglas Crockford
                                                                 from Yahoo!



                                                                   26
Pila de tecnologías




                                              Si tu negocio es online... la diferenciación
                                              depende de la ingeniería de frontend.
MercadoLibre.com – Julio 2010




                                                                                             27
Crossbrowsing




                                   "Web browsers should render
                                  the same markup"
                                                      from IEBlog
MercadoLibre.com – Julio 2010




                                                http://blogs.msdn.com/b/ie/



                                                                              28
Crossbrowsing




                                 “Get your browsers close,
                                   but your apis closer.”
MercadoLibre.com – Julio 2010




                                                             29
Crossbrowsing




                                 “Get your browsers close,
                                   but your apis closer.”
MercadoLibre.com – Julio 2010




                                                Vito Corleone
                                                                30
Crossbrowsing


                                 • Graded Browser Support   http://developer.yahoo.com/yui/articles/gbs/

                                    • A- Grade
                                     • C- Grade
                                     • X- Grade
                                 • Browser detection
                                 •
MercadoLibre.com – Julio 2010




                                                                                                  31
Crossbrowsing


                                 • Graded Browser Support   http://developer.yahoo.com/yui/articles/gbs/

                                    • A- Grade
                                     • C- Grade
                                     • X- Grade
                                 • Browser detection Feature Detection
                                 •
MercadoLibre.com – Julio 2010




                                                                                                  32
Crossbrowsing
                                 Browser Detection Snippet
                                 • Graded Browser Support http://developer.yahoo.com/yui/articles/gbs/
                                 if((userAgent.indexOf('webtv') < 0) &&
                                     (userAgent.indexOf('hotjava') < 0)){
                                    • A- Grade
                                   if(userAgent.indexOf('Opera') >= 0){
                                    var ind = (userAgent.indexOf('Opera')+6);
                                    • C- Grade
                                    if(((ind+1) < userAgent.length)&&(ind >= 6)){
                                    •isOpera = true;
                                       X- Grade
                                     var bsVersion =
                                 • Browser detection Feature Detection
                                 parseInt(userAgent.substring(ind, ind+1));
                                 • if(!isNaN(bsVersion)){
                                       operaVersion = bsVersion;
                                       if(operaVersion >= 6){
                                         isOpera6p = true;
MercadoLibre.com – Julio 2010




                                       }else if(operaVersion >= 5){
                                         isOpera5 = true;
                                       }
                                     }
                                    }
                                   }else if(appName.indexOf('Microsoft Internet
                                 Explorer') >= 0){                                                33
Crossbrowsing
                                 Browser Detection Snippet
                                 • Graded Browser Support http://developer.yahoo.com/yui/articles/gbs/
                                 if((userAgent.indexOf('webtv') < 0) &&




                                          NO
                                     (userAgent.indexOf('hotjava') < 0)){
                                    • A- Grade
                                   if(userAgent.indexOf('Opera') >= 0){
                                    var ind = (userAgent.indexOf('Opera')+6);
                                    • C- Grade
                                    if(((ind+1) < userAgent.length)&&(ind >= 6)){
                                    •isOpera = true;
                                       X- Grade
                                     var bsVersion =
                                 • Browser detection Feature Detection
                                 parseInt(userAgent.substring(ind, ind+1));
                                 • if(!isNaN(bsVersion)){
                                       operaVersion = bsVersion;
                                       if(operaVersion >= 6){
                                         isOpera6p = true;
MercadoLibre.com – Julio 2010




                                       }else if(operaVersion >= 5){
                                         isOpera5 = true;
                                       }
                                     }
                                    }
                                   }else if(appName.indexOf('Microsoft Internet
                                 Explorer') >= 0){                                                34
Crossbrowsing
                                 Feature Detection Snippet
                                 • Graded Browser Support http://developer.yahoo.com/yui/articles/gbs/
                                    • A- Grade
                                 if (document.addEventListener) {
                                 ...
                                     • C- Grade
                                 } else if (document.attachEvent) {
                                 ...
                                 } • X- Grade
                                 • Browser detection Feature Detection
                                 •
                                 if   (navigator.geolocation) {

                                 navigator.geolocation.getCurrentPosition(function(position
                                 ) {
MercadoLibre.com – Julio 2010




                                     var lat = position.coords.latitude;
                                     var lng = position.coords.longitude;
                                     var options = { position: new google.maps.LatLng(lat,
                                 lng) }
                                     var marker = new google.maps.Marker(options);
                                     marker.setMap(map);
                                   });
                                 }                                                       35
Crossbrowsing


                                 • Graded Browser Support    http://developer.yahoo.com/yui/articles/gbs/

                                    • A- Grade
                                     • C- Grade
                                     • X- Grade
                                 • Browser detection Feature Detection
                                 • Support !== Identical Design
MercadoLibre.com – Julio 2010




                                                                                                   36
Crossbrowsing


                                 • Graded Browser Support   http://developer.yahoo.com/yui/articles/gbs/

                                    • A- Grade
                                     • C- Grade



                                CrossDevice
                                     • X- Grade
                                 • Browser detection Feature Detection
                                 • Suppor !== Identical Design
MercadoLibre.com – Julio 2010




                                                                                                  37
MercadoLibre.com – Julio 2010




38
                                     Progressive Enhancement
Progressive Enhancement

                                 •   Concepto
MercadoLibre.com – Julio 2010




                                                          39
Progressive Enhancement




                                 Funcionalidad principal solo con HTML


                                 • El contenido es lo principal
                                 • + mejoras con CSS
                                 • + mejoras con JavaScript
MercadoLibre.com – Julio 2010




                                                                         40
MercadoLibre.com – Julio 2010
                                     Optimización




41
MercadoLibre.com – Julio 2010
                                     Optimización




42
MercadoLibre.com – Julio 2010
                                Optimización




                                               ¿Porque necesitamos
                                                    optimizar?       43
MercadoLibre.com – Julio 2010
                                Progressive Enhancement




                                             ¿Porque necesitamos
                                                  optimizar?       44
Optimización



                                 From Velocity 2009

                                 • The major search engines measured how much
                                   web site slowdowns hurt their business
                                   metrics:
                                     • Bing -2 seconds slower = 4.3% drop in revenue/user.
                                     • Google 400 millisecond delay = 0.59% drop in searches/user.
                                     • Yahoo! 400 milliseconds slowdown = 5-9% drop in full-page
                                       traffic.
MercadoLibre.com – Julio 2010




                                   http://www.stevesouders.com/blog/2010/05/07/wpo-web-performance-optimization/   45
Optimización



                                 From Velocity 2009

                                 • On the faster side, companies from a variety of
                                   vertical markets had praise for the benefits
                                   gained from improving performance:
                                     • Shopzilla – Speeding up their site by 5 seconds increased the
                                       conversion rate 7-12%, doubled the number of sessions from
                                       search engine marketing, and cut the number of required
                                       servers in half.
                                     • Mozilla – Shaving 2.2 seconds off their landing pages increased
MercadoLibre.com – Julio 2010




                                       download conversions by 15.4%, which they estimate will
                                       result in 60 million more Firefox downloads per year.
                                     • Netflix – Adopting a single optimization, gzip compression,
                                       resulted in a 13-25% speedup and cut their outbound network
                                       traffic by 50%.

                                   http://www.stevesouders.com/blog/2010/05/07/wpo-web-performance-optimization/   46
Optimización



                                 Reglas para optimizar

                                 •   Evita el DNS Lookup y cualquier tipo de re-dirección.
                                 •   Reduce la cantidad de peticiones al servidor al mínimo.
                                 •   Utiliza dominios que no transmitan cookies en sus cabeceras.
                                 •   Utiliza nombres de dominios amigables en especial para recursos
                                     estáticos como imágenes.
                                 •   Enlaza las hojas de estilo en el <head> y los scripts al fondo de
                                     la página.
                                 •   Utiliza compresión GZip y un control de caché para los recursos.
                                 •   No mezcles código HTML con CSS o con JavaScript, separalo en
MercadoLibre.com – Julio 2010




                                     distintos capas.
                                 •   Reduce la cantidad de elementos y accesos al DOM.
                                 •   No cambies el tamaño de las imágenes con HTML.
                                 •   ¡Utilizar CDN! 

                                                                                                   47
Optimización



                                 Reglas para optimizar

                                 •   Especifica siempre un doctype! <!doctype html>
                                 •   Valida tu código generado contra la w3c
                                 •   Utiliza la menor cantidad de elementos HTML
                                 •   Hacé valer la semántica
                                 •   Puedes obviar cerrar algunos elementos <br> <img> <input>
                                 •   Todos los atributos en minúsculas con comillas dobles
                                 •   Ninguna declaración CSS en tags
                                 •   Ninguna declaración JS en tags
MercadoLibre.com – Julio 2010




                                 •   Separa el CSS en capas, typo, layout, color, reset...
                                 •   Utiliza un mismo criterio para la nomenclatura de clases
                                 •   Saca provecho de la cascada
                                 •   Especifica solo cuando es necesario
                                 •   Ordena alfabéticamente las propiedades
                                 •   Utiliza sprites para los UI assets                          48
Optimización



                                 Por sobre todo...
MercadoLibre.com – Julio 2010




                                                     49
Optimización



                                 ¡No rompas la web!



                                  <a href=”#”>
                                  <a href=”javascript:alert();”>
                                  <div onclick=”dosomething();”>
MercadoLibre.com – Julio 2010




                                                                   50
Optimización



                                 Herramientas para optimizar

                                 • http://developer.yahoo.com/yslow/
                                 • http://code.google.com/intl/es-ES/speed/page-speed/
MercadoLibre.com – Julio 2010




                                                                                         51
Recursos




                                 • http://www.html5rocks.com/
                                 • http://html5readiness.com/
                                 • http://www.focus.com/images/view/11905/
                                 • http://diveintohtml5.org/
                                 • http://www.modernizr.com/
                                 • http://code.google.com/p/html5shiv/
MercadoLibre.com – Julio 2010




                                                                             52
Créditos


                                 • Nate Koechley http://video.yahoo.com/watch/
                                   4671445/12486762
                                 • Victoria spinning http://www.flickr.com/photos/phitar/
                                   400727610/
                                 • ¡Arréglate Matungo! http://www.flickr.com/photos/bombeador/
                                   3184725934/in/photostream/
                                 • Urban zen http://www.flickr.com/photos/sigikolbe/
                                    3795014021/
                                 • Hippie Bus http://www.flickr.com/photos/alories/3378756332/
MercadoLibre.com – Julio 2010




                                 • Microbia III, Crustaceapods http://www.flickr.com/photos/
                                   connett/2948230658/
                                 • The Godfather by Kurre
                                 • Peanuts illustration by Dave Stuart

                                                                                               53
MercadoLibre.com – Julio 2010




54
MercadoLibre.com – Julio 2010




Gracias!
55
Charla en UBA FrontEnd Engineering

Contenu connexe

En vedette

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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

En vedette (20)

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...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Charla en UBA FrontEnd Engineering

  • 1. “HTML5, CSS3 y JavaScript” MercadoLibre.com – Julio 2010 Julio de 2010
  • 2. Agenda • HTML5 Rápido • Revisión • Experimentos • Ingeniería de Front End • Pila de tecnologías • Crossbrowsing • Mejora Progresiva • Reglas para optimizar MercadoLibre.com – Julio 2010 • Recursos 2
  • 3. http://slides.html5rocks.com/ HT MercadoLibre.com – Julio 2010 http://slides.html5rocks.com/ 3
  • 4. http://slides.html5rocks.com/ Media Queries MercadoLibre.com – Julio 2010 http://www.w3.org/TR/css3-mediaqueries/ http://slides.html5rocks.com/ 4
  • 5. Media Queries <link rel="stylesheet" type="text/css" media="screen" href="core.css" /> MercadoLibre.com – Julio 2010 5
  • 6. Media Queries <link rel="stylesheet" type="text/css" media="screen" href="core.css" /> <link rel="stylesheet" type="text/css" media="screen and (max-device-width: 480px)" href="iphone.css" /> MercadoLibre.com – Julio 2010 6
  • 7. Media Queries <link rel="stylesheet" type="text/css" media="screen" href="core.css" /> <link rel="stylesheet" type="text/css" media="screen and (max-device-width: 480px)" href="iphone.css" /> MercadoLibre.com – Julio 2010 7
  • 8. MercadoLibre.com – Julio 2010 Experiments 8
  • 9. Experimentos • Google http://mrdoob.com/projects/chromeexperiments/ google_gravity/ • Mario Kart http://www.nihilogic.dk/labs/mariokart/ • Trail http://www.hakim.se/experiments/html5/trail/03/ • Bakemono http://www.hakim.se/experiments/html5/ bakemono/01/ • Ball Pool http://mrdoob.com/projects/chromeexperiments/ ball_pool/ • Canvas Experiment http://9elements.com/io/projects/html5/ canvas/  MercadoLibre.com – Julio 2010 9
  • 10. The Front End Engineers Playground HT MercadoLibre.com – Julio 2010 10
  • 11. The Front End Engineers Playground HT ¿De que se trata? MercadoLibre.com – Julio 2010 11
  • 12. The Front End Engineers Playground HT Peligro MercadoLibre.com – Julio 2010 12
  • 13. The Front End Engineers Playground HT Adrenalina MercadoLibre.com – Julio 2010 13
  • 14. The Front End Engineers Playground HT Aventura MercadoLibre.com – Julio 2010 14
  • 15. The Front End Engineers Playground "A long time ago, in a galaxy far far away" MercadoLibre.com – Julio 2010 15
  • 16. The Front End Engineers Playground ¿Frontend Engineer? MercadoLibre.com – Julio 2010 16
  • 17. ¿Frontend Engineer? • “Frontend engineers focused at the intersection of design and development is a best practice.” • “We write software in JavaScript, CSS and HTML, & more...” • “We tell browsers what to do.” • “We’re responsible for view source.” MercadoLibre.com – Julio 2010 17
  • 18. ¿Frontend Engineer? • “Frontend engineers focused at the intersection of design and development is a best practice.” • “We write software in JavaScript, CSS and Nate Koechley HTML, & more...” http://video.yahoo.com/watch/4671445/12486762 • “We tell browsers what to do.” Professional Frontend Engineering • “We’re responsible for view source.” MercadoLibre.com – Julio 2010 18
  • 19. ¿Frontend Engineer? Los responsables del -view source- MercadoLibre.com – Julio 2010 19
  • 20. MercadoLibre.com – Julio 2010 Pila de tecnologías 20
  • 21. Pila de tecnologías • Device x plataform x tech x api • Touch screen, Motion capture, Acelerometer • Demand of a better experience MercadoLibre.com – Julio 2010 21
  • 22. MercadoLibre.com – Julio 2010 Pila de tecnologías
  • 23. Pila de tecnologías + la transferencia de datos MercadoLibre.com – Julio 2010
  • 24. Frontend vs Backend • No compila • No se puede confiar • No se puede predecir • No se puede esconder! MercadoLibre.com – Julio 2010 24
  • 26. “The most hostile software development environment imaginable.” MercadoLibre.com – Julio 2010 Douglas Crockford from Yahoo! 26
  • 27. Pila de tecnologías Si tu negocio es online... la diferenciación depende de la ingeniería de frontend. MercadoLibre.com – Julio 2010 27
  • 28. Crossbrowsing "Web browsers should render the same markup" from IEBlog MercadoLibre.com – Julio 2010 http://blogs.msdn.com/b/ie/ 28
  • 29. Crossbrowsing “Get your browsers close, but your apis closer.” MercadoLibre.com – Julio 2010 29
  • 30. Crossbrowsing “Get your browsers close, but your apis closer.” MercadoLibre.com – Julio 2010 Vito Corleone 30
  • 31. Crossbrowsing • Graded Browser Support http://developer.yahoo.com/yui/articles/gbs/ • A- Grade • C- Grade • X- Grade • Browser detection • MercadoLibre.com – Julio 2010 31
  • 32. Crossbrowsing • Graded Browser Support http://developer.yahoo.com/yui/articles/gbs/ • A- Grade • C- Grade • X- Grade • Browser detection Feature Detection • MercadoLibre.com – Julio 2010 32
  • 33. Crossbrowsing Browser Detection Snippet • Graded Browser Support http://developer.yahoo.com/yui/articles/gbs/ if((userAgent.indexOf('webtv') < 0) && (userAgent.indexOf('hotjava') < 0)){ • A- Grade if(userAgent.indexOf('Opera') >= 0){ var ind = (userAgent.indexOf('Opera')+6); • C- Grade if(((ind+1) < userAgent.length)&&(ind >= 6)){ •isOpera = true; X- Grade var bsVersion = • Browser detection Feature Detection parseInt(userAgent.substring(ind, ind+1)); • if(!isNaN(bsVersion)){ operaVersion = bsVersion; if(operaVersion >= 6){ isOpera6p = true; MercadoLibre.com – Julio 2010 }else if(operaVersion >= 5){ isOpera5 = true; } } } }else if(appName.indexOf('Microsoft Internet Explorer') >= 0){ 33
  • 34. Crossbrowsing Browser Detection Snippet • Graded Browser Support http://developer.yahoo.com/yui/articles/gbs/ if((userAgent.indexOf('webtv') < 0) && NO (userAgent.indexOf('hotjava') < 0)){ • A- Grade if(userAgent.indexOf('Opera') >= 0){ var ind = (userAgent.indexOf('Opera')+6); • C- Grade if(((ind+1) < userAgent.length)&&(ind >= 6)){ •isOpera = true; X- Grade var bsVersion = • Browser detection Feature Detection parseInt(userAgent.substring(ind, ind+1)); • if(!isNaN(bsVersion)){ operaVersion = bsVersion; if(operaVersion >= 6){ isOpera6p = true; MercadoLibre.com – Julio 2010 }else if(operaVersion >= 5){ isOpera5 = true; } } } }else if(appName.indexOf('Microsoft Internet Explorer') >= 0){ 34
  • 35. Crossbrowsing Feature Detection Snippet • Graded Browser Support http://developer.yahoo.com/yui/articles/gbs/ • A- Grade if (document.addEventListener) { ... • C- Grade } else if (document.attachEvent) { ... } • X- Grade • Browser detection Feature Detection • if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position ) { MercadoLibre.com – Julio 2010 var lat = position.coords.latitude; var lng = position.coords.longitude; var options = { position: new google.maps.LatLng(lat, lng) } var marker = new google.maps.Marker(options); marker.setMap(map); }); } 35
  • 36. Crossbrowsing • Graded Browser Support http://developer.yahoo.com/yui/articles/gbs/ • A- Grade • C- Grade • X- Grade • Browser detection Feature Detection • Support !== Identical Design MercadoLibre.com – Julio 2010 36
  • 37. Crossbrowsing • Graded Browser Support http://developer.yahoo.com/yui/articles/gbs/ • A- Grade • C- Grade CrossDevice • X- Grade • Browser detection Feature Detection • Suppor !== Identical Design MercadoLibre.com – Julio 2010 37
  • 38. MercadoLibre.com – Julio 2010 38 Progressive Enhancement
  • 39. Progressive Enhancement • Concepto MercadoLibre.com – Julio 2010 39
  • 40. Progressive Enhancement Funcionalidad principal solo con HTML • El contenido es lo principal • + mejoras con CSS • + mejoras con JavaScript MercadoLibre.com – Julio 2010 40
  • 41. MercadoLibre.com – Julio 2010 Optimización 41
  • 42. MercadoLibre.com – Julio 2010 Optimización 42
  • 43. MercadoLibre.com – Julio 2010 Optimización ¿Porque necesitamos optimizar? 43
  • 44. MercadoLibre.com – Julio 2010 Progressive Enhancement ¿Porque necesitamos optimizar? 44
  • 45. Optimización From Velocity 2009 • The major search engines measured how much web site slowdowns hurt their business metrics: • Bing -2 seconds slower = 4.3% drop in revenue/user. • Google 400 millisecond delay = 0.59% drop in searches/user. • Yahoo! 400 milliseconds slowdown = 5-9% drop in full-page traffic. MercadoLibre.com – Julio 2010 http://www.stevesouders.com/blog/2010/05/07/wpo-web-performance-optimization/ 45
  • 46. Optimización From Velocity 2009 • On the faster side, companies from a variety of vertical markets had praise for the benefits gained from improving performance: • Shopzilla – Speeding up their site by 5 seconds increased the conversion rate 7-12%, doubled the number of sessions from search engine marketing, and cut the number of required servers in half. • Mozilla – Shaving 2.2 seconds off their landing pages increased MercadoLibre.com – Julio 2010 download conversions by 15.4%, which they estimate will result in 60 million more Firefox downloads per year. • Netflix – Adopting a single optimization, gzip compression, resulted in a 13-25% speedup and cut their outbound network traffic by 50%. http://www.stevesouders.com/blog/2010/05/07/wpo-web-performance-optimization/ 46
  • 47. Optimización Reglas para optimizar • Evita el DNS Lookup y cualquier tipo de re-dirección. • Reduce la cantidad de peticiones al servidor al mínimo. • Utiliza dominios que no transmitan cookies en sus cabeceras. • Utiliza nombres de dominios amigables en especial para recursos estáticos como imágenes. • Enlaza las hojas de estilo en el <head> y los scripts al fondo de la página. • Utiliza compresión GZip y un control de caché para los recursos. • No mezcles código HTML con CSS o con JavaScript, separalo en MercadoLibre.com – Julio 2010 distintos capas. • Reduce la cantidad de elementos y accesos al DOM. • No cambies el tamaño de las imágenes con HTML. • ¡Utilizar CDN!  47
  • 48. Optimización Reglas para optimizar • Especifica siempre un doctype! <!doctype html> • Valida tu código generado contra la w3c • Utiliza la menor cantidad de elementos HTML • Hacé valer la semántica • Puedes obviar cerrar algunos elementos <br> <img> <input> • Todos los atributos en minúsculas con comillas dobles • Ninguna declaración CSS en tags • Ninguna declaración JS en tags MercadoLibre.com – Julio 2010 • Separa el CSS en capas, typo, layout, color, reset... • Utiliza un mismo criterio para la nomenclatura de clases • Saca provecho de la cascada • Especifica solo cuando es necesario • Ordena alfabéticamente las propiedades • Utiliza sprites para los UI assets 48
  • 49. Optimización Por sobre todo... MercadoLibre.com – Julio 2010 49
  • 50. Optimización ¡No rompas la web! <a href=”#”> <a href=”javascript:alert();”> <div onclick=”dosomething();”> MercadoLibre.com – Julio 2010 50
  • 51. Optimización Herramientas para optimizar • http://developer.yahoo.com/yslow/ • http://code.google.com/intl/es-ES/speed/page-speed/ MercadoLibre.com – Julio 2010 51
  • 52. Recursos • http://www.html5rocks.com/ • http://html5readiness.com/ • http://www.focus.com/images/view/11905/ • http://diveintohtml5.org/ • http://www.modernizr.com/ • http://code.google.com/p/html5shiv/ MercadoLibre.com – Julio 2010 52
  • 53. Créditos • Nate Koechley http://video.yahoo.com/watch/ 4671445/12486762 • Victoria spinning http://www.flickr.com/photos/phitar/ 400727610/ • ¡Arréglate Matungo! http://www.flickr.com/photos/bombeador/ 3184725934/in/photostream/ • Urban zen http://www.flickr.com/photos/sigikolbe/ 3795014021/ • Hippie Bus http://www.flickr.com/photos/alories/3378756332/ MercadoLibre.com – Julio 2010 • Microbia III, Crustaceapods http://www.flickr.com/photos/ connett/2948230658/ • The Godfather by Kurre • Peanuts illustration by Dave Stuart 53
  • 55. MercadoLibre.com – Julio 2010 Gracias! 55

Notes de l'éditeur

  1. To the next level: L&amp;#xED;nea de tiempo, APIs, HTML, CSS, Algunos experimentos
  2. Muy interesante!
  3. To the next level: L&amp;#xED;nea de tiempo, APIs, HTML, CSS, Algunos experimentos
  4. To the next level: L&amp;#xED;nea de tiempo, APIs, HTML, CSS, Algunos experimentos
  5. To the next level: L&amp;#xED;nea de tiempo, APIs, HTML, CSS, Algunos experimentos
  6. To the next level: L&amp;#xED;nea de tiempo, APIs, HTML, CSS, Algunos experimentos
  7. To the next level: L&amp;#xED;nea de tiempo, APIs, HTML, CSS, Algunos experimentos
  8. To the next level: L&amp;#xED;nea de tiempo, APIs, HTML, CSS, Algunos experimentos
  9. To the next level: L&amp;#xED;nea de tiempo, APIs, HTML, CSS, Algunos experimentos
  10. EJEMPLO