SlideShare una empresa de Scribd logo
1 de 11
jQCon
Condensed edition
Review
• Selector performance
  – ID
  – Tag name
  – Name, Class
• Use CSS classes to control state
• Specificity helps
  – Ex: $(‘div.ui-content’); instead of $(‘.ui-content’)
Performance
Visibility:                             Business:
    – Install Firebug & Yslow               – Performance is important for
    – Know what is slowing down               the product
      your page loads                       – Performance can be expensive
                                            – Optimize intelligently - weigh
                                              the LOE and the utility gained
Interactivity:
                                            – Performance is most important
    – Profile your $.ready                    to sites that get millions of hits
    – Minimize initialization on page
      load
                                        Tips:
                                            – Low hanging fruit first
Responsiveness:
                                            – Google Analytics to record data
    – throttle/debounce events                about your loads
                                            – 8-bit PNG's with alpha
Contextual jQuery
•   Handle initial state with CSS
•   Write reusable code
•   Delegate event handling
•   Anticipate user actions
    – Scrolling
    – Focus/blur
    – Typing
• .one()
Unit Testing
•   qUnit
•   qUnit
•   qUnit
•   And qUnit
Grunt
• Build tool for JS
• Included tasks
   – Creates scaffolding
   – Lint (JSHint)
   – Unit testing (qUnit)
   – Concat/Minify (UglifyJS)
PhantomJS
• Headless WebKit
  – Like the horseman? Why is this cool?
• Grunt + PhantomJS + qUnit = ?
DEMONSTRATION
Recap of Steps
•   brew install node
•   brew install phantomjs
•   npm install -g grunt
•   grunt -help (Optional)
•   grunt init (Optional)
•   grunt init:jquery
•   grunt qunit
Tools
•   YSlow, PageSpeed
•   JavaScript Errors Notifier Chrome Extension
•   iWebInspector
•   JSHint (for vim)
Resources
• Wiki pages
  – jQuery Conf 2012
  – Best Practices: jQuery
  – Web Dev Quirks
• Read more
  – Introducing Grunt
  – jQuery Plugins w/ Grunt & qUnit
  – https://github.com/cowboy/grunt
  – qUnit Intro

Más contenido relacionado

La actualidad más candente

Juju, LXC, OpenStack: Fun with Private Clouds
Juju, LXC, OpenStack: Fun with Private CloudsJuju, LXC, OpenStack: Fun with Private Clouds
Juju, LXC, OpenStack: Fun with Private CloudsSameer Verma
 
Frontend architecture design for large(r) team final
Frontend architecture design for large(r) team   finalFrontend architecture design for large(r) team   final
Frontend architecture design for large(r) team finalChadchapol Vittavutkarnvej
 
Unleashing WebGL & WebAudio with babylon.js
Unleashing WebGL & WebAudio with babylon.jsUnleashing WebGL & WebAudio with babylon.js
Unleashing WebGL & WebAudio with babylon.jsdavrous
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esdavrous
 
Modular & Event driven UI Architecture
Modular & Event driven UI ArchitectureModular & Event driven UI Architecture
Modular & Event driven UI ArchitectureVytautas Butkus
 
SharePoint Ribbon Deep Dive
SharePoint Ribbon Deep DiveSharePoint Ribbon Deep Dive
SharePoint Ribbon Deep DiveChris O'Brien
 
Tibco advantage
Tibco advantageTibco advantage
Tibco advantageAbhi Arya
 
Paperclip
PaperclipPaperclip
Papercliptreby
 
Phantom js quick start
Phantom js quick startPhantom js quick start
Phantom js quick startji guang
 
Decoupled drupal + vue.js
Decoupled drupal + vue.jsDecoupled drupal + vue.js
Decoupled drupal + vue.jsEugene Vozniuk
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datosphilogb
 
Concepts on Mean Stack Development
Concepts on Mean Stack DevelopmentConcepts on Mean Stack Development
Concepts on Mean Stack DevelopmentChristopher Sharkey
 
From HTML to pixels on the Screen
From HTML to pixels on the ScreenFrom HTML to pixels on the Screen
From HTML to pixels on the ScreenIgor Talic
 
Developing for the mobile web
Developing for the mobile webDeveloping for the mobile web
Developing for the mobile webjoeysim
 
Web xr:vr getting started
Web xr:vr getting startedWeb xr:vr getting started
Web xr:vr getting startedWajdi Ben Rabah
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to ReactYos Riady
 
Sfd hanoi2012 nguyen ha duong yang node.js-intro
Sfd hanoi2012 nguyen ha duong yang   node.js-introSfd hanoi2012 nguyen ha duong yang   node.js-intro
Sfd hanoi2012 nguyen ha duong yang node.js-introVu Hung Nguyen
 

La actualidad más candente (20)

Deploy like a pro!
Deploy like a pro!Deploy like a pro!
Deploy like a pro!
 
Juju, LXC, OpenStack: Fun with Private Clouds
Juju, LXC, OpenStack: Fun with Private CloudsJuju, LXC, OpenStack: Fun with Private Clouds
Juju, LXC, OpenStack: Fun with Private Clouds
 
Frontend architecture design for large(r) team final
Frontend architecture design for large(r) team   finalFrontend architecture design for large(r) team   final
Frontend architecture design for large(r) team final
 
Unleashing WebGL & WebAudio with babylon.js
Unleashing WebGL & WebAudio with babylon.jsUnleashing WebGL & WebAudio with babylon.js
Unleashing WebGL & WebAudio with babylon.js
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
 
Modular & Event driven UI Architecture
Modular & Event driven UI ArchitectureModular & Event driven UI Architecture
Modular & Event driven UI Architecture
 
SharePoint Ribbon Deep Dive
SharePoint Ribbon Deep DiveSharePoint Ribbon Deep Dive
SharePoint Ribbon Deep Dive
 
Tibco advantage
Tibco advantageTibco advantage
Tibco advantage
 
Paperclip
PaperclipPaperclip
Paperclip
 
Phantom js quick start
Phantom js quick startPhantom js quick start
Phantom js quick start
 
Banquet 46
Banquet 46Banquet 46
Banquet 46
 
Decoupled drupal + vue.js
Decoupled drupal + vue.jsDecoupled drupal + vue.js
Decoupled drupal + vue.js
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datos
 
Basics of VueJS
Basics of VueJSBasics of VueJS
Basics of VueJS
 
Concepts on Mean Stack Development
Concepts on Mean Stack DevelopmentConcepts on Mean Stack Development
Concepts on Mean Stack Development
 
From HTML to pixels on the Screen
From HTML to pixels on the ScreenFrom HTML to pixels on the Screen
From HTML to pixels on the Screen
 
Developing for the mobile web
Developing for the mobile webDeveloping for the mobile web
Developing for the mobile web
 
Web xr:vr getting started
Web xr:vr getting startedWeb xr:vr getting started
Web xr:vr getting started
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
Sfd hanoi2012 nguyen ha duong yang node.js-intro
Sfd hanoi2012 nguyen ha duong yang   node.js-introSfd hanoi2012 nguyen ha duong yang   node.js-intro
Sfd hanoi2012 nguyen ha duong yang node.js-intro
 

Similar a jQuery Conf 2012

Building assets on the fly with Node.js
Building assets on the fly with Node.jsBuilding assets on the fly with Node.js
Building assets on the fly with Node.jsAcquisio
 
Devfest09 Cschalk Gwt
Devfest09 Cschalk GwtDevfest09 Cschalk Gwt
Devfest09 Cschalk GwtChris Schalk
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
 
Behat Workshop at WeLovePHP
Behat Workshop at WeLovePHPBehat Workshop at WeLovePHP
Behat Workshop at WeLovePHPMarcos Quesada
 
Infrastructure Management in GCP
Infrastructure Management in GCPInfrastructure Management in GCP
Infrastructure Management in GCPDana Hoffman
 
Google Dev Fest Presentation
Google Dev Fest PresentationGoogle Dev Fest Presentation
Google Dev Fest PresentationAndrew Mackenzie
 
Developing TouchActive with GAE and GWT - Google DevFest Barcelona 2012
Developing TouchActive with GAE and GWT - Google DevFest Barcelona 2012Developing TouchActive with GAE and GWT - Google DevFest Barcelona 2012
Developing TouchActive with GAE and GWT - Google DevFest Barcelona 2012Andrew Mackenzie
 
Intuit Kubernetes Journey
Intuit Kubernetes JourneyIntuit Kubernetes Journey
Intuit Kubernetes JourneyRavi Hari
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with DjangoRoger Barnes
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQueryAlek Davis
 
NDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDDNDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDDjbandi
 
Building Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on AzureBuilding Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on AzureBrian Lyttle
 
Ignacy Kowalczyk
Ignacy KowalczykIgnacy Kowalczyk
Ignacy KowalczykCodeFest
 
Drupal 7 - The Top 40 Core Modules and What They Mean for You
Drupal 7 - The Top 40 Core Modules and What They Mean for YouDrupal 7 - The Top 40 Core Modules and What They Mean for You
Drupal 7 - The Top 40 Core Modules and What They Mean for YouAcquia
 
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCampHow to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCampJesus Manuel Olivas
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend PerformanceThomas Weinert
 

Similar a jQuery Conf 2012 (20)

Building assets on the fly with Node.js
Building assets on the fly with Node.jsBuilding assets on the fly with Node.js
Building assets on the fly with Node.js
 
Devfest09 Cschalk Gwt
Devfest09 Cschalk GwtDevfest09 Cschalk Gwt
Devfest09 Cschalk Gwt
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
Behat Workshop at WeLovePHP
Behat Workshop at WeLovePHPBehat Workshop at WeLovePHP
Behat Workshop at WeLovePHP
 
The Java alternative to Javascript
The Java alternative to JavascriptThe Java alternative to Javascript
The Java alternative to Javascript
 
Infrastructure Management in GCP
Infrastructure Management in GCPInfrastructure Management in GCP
Infrastructure Management in GCP
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
Droidcon Paris 2015
Droidcon Paris 2015Droidcon Paris 2015
Droidcon Paris 2015
 
Google Dev Fest Presentation
Google Dev Fest PresentationGoogle Dev Fest Presentation
Google Dev Fest Presentation
 
Google DevFest 2012 Presentation
Google DevFest 2012 PresentationGoogle DevFest 2012 Presentation
Google DevFest 2012 Presentation
 
Developing TouchActive with GAE and GWT - Google DevFest Barcelona 2012
Developing TouchActive with GAE and GWT - Google DevFest Barcelona 2012Developing TouchActive with GAE and GWT - Google DevFest Barcelona 2012
Developing TouchActive with GAE and GWT - Google DevFest Barcelona 2012
 
Intuit Kubernetes Journey
Intuit Kubernetes JourneyIntuit Kubernetes Journey
Intuit Kubernetes Journey
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with Django
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
NDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDDNDC 2011 - Building .NET Applications with BDD
NDC 2011 - Building .NET Applications with BDD
 
Building Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on AzureBuilding Mobile Web Apps with jQM and Cordova on Azure
Building Mobile Web Apps with jQM and Cordova on Azure
 
Ignacy Kowalczyk
Ignacy KowalczykIgnacy Kowalczyk
Ignacy Kowalczyk
 
Drupal 7 - The Top 40 Core Modules and What They Mean for You
Drupal 7 - The Top 40 Core Modules and What They Mean for YouDrupal 7 - The Top 40 Core Modules and What They Mean for You
Drupal 7 - The Top 40 Core Modules and What They Mean for You
 
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCampHow to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
How to keep Drupal relevant in the Git-based and API-driven CMS era - BADCamp
 
Optimizing Your Frontend Performance
Optimizing Your Frontend PerformanceOptimizing Your Frontend Performance
Optimizing Your Frontend Performance
 

Último

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

jQuery Conf 2012

  • 2. Review • Selector performance – ID – Tag name – Name, Class • Use CSS classes to control state • Specificity helps – Ex: $(‘div.ui-content’); instead of $(‘.ui-content’)
  • 3. Performance Visibility: Business: – Install Firebug & Yslow – Performance is important for – Know what is slowing down the product your page loads – Performance can be expensive – Optimize intelligently - weigh the LOE and the utility gained Interactivity: – Performance is most important – Profile your $.ready to sites that get millions of hits – Minimize initialization on page load Tips: – Low hanging fruit first Responsiveness: – Google Analytics to record data – throttle/debounce events about your loads – 8-bit PNG's with alpha
  • 4. Contextual jQuery • Handle initial state with CSS • Write reusable code • Delegate event handling • Anticipate user actions – Scrolling – Focus/blur – Typing • .one()
  • 5. Unit Testing • qUnit • qUnit • qUnit • And qUnit
  • 6. Grunt • Build tool for JS • Included tasks – Creates scaffolding – Lint (JSHint) – Unit testing (qUnit) – Concat/Minify (UglifyJS)
  • 7. PhantomJS • Headless WebKit – Like the horseman? Why is this cool? • Grunt + PhantomJS + qUnit = ?
  • 9. Recap of Steps • brew install node • brew install phantomjs • npm install -g grunt • grunt -help (Optional) • grunt init (Optional) • grunt init:jquery • grunt qunit
  • 10. Tools • YSlow, PageSpeed • JavaScript Errors Notifier Chrome Extension • iWebInspector • JSHint (for vim)
  • 11. Resources • Wiki pages – jQuery Conf 2012 – Best Practices: jQuery – Web Dev Quirks • Read more – Introducing Grunt – jQuery Plugins w/ Grunt & qUnit – https://github.com/cowboy/grunt – qUnit Intro

Notas del editor

  1. Explain the format, # of attendees, the general vibeBreakout sessions
  2. Explain why the selector performance orderExplain why the specificity helps
  3. If it takes you more than a day to implement 1 increase in performance, it is probably not worthwhile. Gauge the effort with the importanceYslow - Initialization after page loadProfilingThrottle/debounce
  4. Initial state with CSS goes against jQuery Mobile, that may mean a change for UIE.Delegating event handling - CPU saved on initial binding: 1 container vs multiple child elementsExamples: - Scrolling – FB Like/audio/images - Focus/blur – form validation/autocomplete - Typing – load next pages in a multi-step process
  5. It seems that the jQuery community has chosen a unit testing framework unanimously.A unit testing framework is only a unit testing framework.qUnit has thrived because of Grunt & PhantomJS
  6. This was created by Ben Alman of Bocoup.He created this to solve many problems, but the biggest problem he solved was eliminating the configuration/setup phase of a project to use Linting, unit testing, and Concat/Minify.
  7. PhantomJS is cool because it runs like a phantom.Typical qUnit opens an actual browser, this runs on the command line.
  8. JSHint has plugins for other editors as well.
  9. Slides and notes from the conferencecan be found in the wikiBest PracticesWeb dev quirks – this may or may not be useful to you