SlideShare a Scribd company logo
The State of jQuery
                    Dave Methvin
     President, jQuery Foundation
                      March, 2013
How It All Started
Jan 2006: The birth of jQuery
Seven Years of Good Luck




Feb 2013: jQuery core is used by 64
  percent of the top 10,000 sites
The jQuery Foundation
• Created in March 2012
The jQuery Foundation
• Created in March 2012
The jQuery Foundation
• Created in March 2012
• Coordinates the work of jQuery team
  members and volunteers
The jQuery Foundation Is...
• A non-profit organization
  o Volunteer board of directors
  o Volunteer president (thats me)
  o A few paid staff, mainly devs/ops
• Funded by
  o Conferences
  o Donations – http://jquery.org/donate
  o Memberships
  o YOU or your company can be a member
     http://jquery.org/join
jQuery Foundation
• Founding Members
jQuery Foundation
• Gold Members
The jQuery Foundation's Work
• Organize/fund work on the projects
• Advocate for web developer needs
  o W3C web standards
  o ECMA TC39 JavaScript standards
• Run two US conferences annually
• License conferences worldwide
jQuery Foundation Projects
• http://github.com/jquery
 •   jQuery Core
 •   jQuery UI
 •   jQuery Mobile
 •   Sizzle selector engine
 •   QUnit unit test framework
 •   jQuery Migrate plugin
 •   TestSwarm CI testing
 •   Documentation sites
Join The Community
• It’s all on Github – not just the code
• File an issue when you see a problem
• Make pull requests against docs
• Join our forum and share knowledge
The jQuery Core Library Plan
• jQuery 1.9 vs. 2.0
  o jQuery 1.x still supports IE 6/7/8
  o jQuery 2.x supports modern browsers
  o The two versions stay in API sync
  o Both branches maintained by the team
• Heavily publicized changes during 2012
• Released several public betas
• Shipped jQuery 1.9 in January
What We Learned (the Hard Way)


Far too many people
are using "latest"
versions in live sites!

NEVER HOTLINK:

http://code.jquery.com/jquery-latest.js

http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js
jQuery 1.9: Users Love It!
jQuery Migrate Plugin
• Identifies things your code is doing that
  jQuery 1.9/2.0 don't support anymore
• Actually changes jQuery back to pre-1.9
  behavior so older code just works
• Lets you use jQuery 1.9/2.0 with code
  that hasn't been upgraded yet
• Documentation gives advice on how to
  remediate the issue
jQuery Migrate Example
jQuery Migrate Warnings
• Shown in the uncompressed version
• Problem and solutions documented
How Do I Fix This?
Shut-Up-and-Fix-It Mode
Include the minified version of the plugin
  and no warnings appear
What We Broke Fixed, and Why
• Removed $.browser
• Removed .live()
• Fixed $.parseJSON
Why $.browser Deserves To Go
• Usually the wrong inference
• Often assumes future browsers and
  versions will be broken the same way
• Horribly misused and misunderstood
Why You Don't Assume Browsers
Chrome added focusin/out two years ago!
Browser Name is Only a BRAND
Opera just announced their future
 products will be based on the WebKit
 engine, not their own Presto engine.
Internet Explorer's Disguises
• IE can emulate older versions via
  <meta name="X-UA-Compatible“ …>
• Can be accidentally lobotomized via that
  confounded Address Bar button
• Browser version in the UA string does not
  represent the real version


             The Enemy!
Who Else Used $.browser?
Who Else Used $.browser?
Please Don't Do This ...
... copy/pasta is bad!
Not fixing the problem, no code attribution
... copy/pasta is bad!
Use jQuery Migrate or (better) Modernizr!
What's Wrong With .live()?
• It's like global variables, but for events
• Every event that occurs must bubble to
  document before it can be processed
• Processing events can be expensive,
  especially on deep documents
• Still easy to process events globally:
  o   $(document).on("click", "a", linkyClicky);
What's Wrong With .live()?
• Doesn't work well on iPhone/iPad!
• iOS doesn't bubble touch events all the
  way to document
• Delegated touch events must be
  processed below the <body> element

  Letting all events bubble to document
  destroys the usefulness of the event
  propagation model
Optimize Your Selectors
Original line:
$(".dialog .close").live("click", ...

Direct replacement (poor):
$(document).on("click", ".dialog .close" ...

Optimized replacement:
$(".dialog").on("click", ".close", ...
JSON Should Be JSON
The Bug:
• Before 1.9, $.parseJSON("") returned
  null but it's not valid JSON

The Fix:
• In 1.9, $.parseJSON("") is an error
The Result: PANIC
• We called invalid JSON invalid.
• We're also out of coffee.
The Moral of the Story


In jQuery, every change is
   a breaking change for
   some poor developer.
The Other Moral of the Story


Nobody tries the jQuery
 alpha and beta builds.
Big News!
• How Big?
Big News!
• How Big?
Big News: jQuery 2.0 Beta 2
• Released yesterday -- please try it!
• Custom builds can shrink size
• Bare-bones selector engine option
  o Basically, just querySelectorAll
• How small?
  o Normal build: 28KB minified and gzipped
  o Blog example: 17KB
  o Tiniest build: 14KB
jQuery 2.0: README.NOW
    Making a public web site?
    You don't need 2.0 right now!

jQuery 2.0 is a good fit for:
• Chrome or Firefox plugins
• node.js apps (jsdom, Cheerio)
• Windows 8 Store ("Modern/Metro") apps
• PhoneGap (iPhone/Android/BlackBerry)
• Apps using UIWebKit or WebBrowser
jQuery 2.0 is Forward Looking
• The jQuery team supports both 1.9 and
    2.0; there isn't a problem of using an
    "unsupported version"
•   Since 1.x/2.x APIs are the same, there is
    no problem in using 1.x exclusively on a
    public web site -- it's recommended
•   You can detect platforms and include 1.9
    or 2.0, but beware of your code or
    plugins using undocumented semantics!
Old Android Browsers Lack ES5
EcmaScript 5 is was the 2.0 baseline


                    (-:



                   :-(
Old WebKit is the New Old IE
Questions?


Email: dave@jquery.com
Twitter: @davemethvin
GitHub: @dmethvin
IRC (Freenode): DaveMethvin #jquery-dev

More Related Content

What's hot

[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
Christopher Schmitt
 
New Perspectives on Performance
New Perspectives on PerformanceNew Perspectives on Performance
New Perspectives on Performance
mennovanslooten
 
Harness jQuery Templates and Data Link
Harness jQuery Templates and Data LinkHarness jQuery Templates and Data Link
Harness jQuery Templates and Data Link
BorisMoore
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery Plugins
Marc Grabanski
 
State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conference
dmethvin
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
Nicholas Zakas
 
Mobile Web Speed Bumps
Mobile Web Speed BumpsMobile Web Speed Bumps
Mobile Web Speed Bumps
Nicholas Zakas
 
Real World Windows 8 Apps in JavaScript
Real World Windows 8 Apps in JavaScriptReal World Windows 8 Apps in JavaScript
Real World Windows 8 Apps in JavaScript
Domenic Denicola
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
Ashlimarie
 
Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
Nicholas Zakas
 
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)
Nicholas Zakas
 
Get Hip with JHipster - Denver JUG 2015
Get Hip with JHipster - Denver JUG 2015Get Hip with JHipster - Denver JUG 2015
Get Hip with JHipster - Denver JUG 2015
Matt Raible
 
Christmas Trees Made with HTML CSS and JS
Christmas Trees Made with HTML CSS and JSChristmas Trees Made with HTML CSS and JS
Christmas Trees Made with HTML CSS and JS
Niamh Foley
 
CSS Lessons Learned the Hard Way (Generate Conf)
CSS Lessons Learned the Hard Way (Generate Conf)CSS Lessons Learned the Hard Way (Generate Conf)
CSS Lessons Learned the Hard Way (Generate Conf)
Zoe Gillenwater
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
Vitaly Friedman
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!
Raymond Camden
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
Susan Winters
 
The Art of AngularJS in 2015
The Art of AngularJS in 2015The Art of AngularJS in 2015
The Art of AngularJS in 2015
Matt Raible
 
Testing Angular 2 Applications - HTML5 Denver 2016
Testing Angular 2 Applications - HTML5 Denver 2016Testing Angular 2 Applications - HTML5 Denver 2016
Testing Angular 2 Applications - HTML5 Denver 2016
Matt Raible
 
The 5 Layers of Web Accessibility
The 5 Layers of Web AccessibilityThe 5 Layers of Web Accessibility
The 5 Layers of Web Accessibility
Dirk Ginader
 

What's hot (20)

[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
 
New Perspectives on Performance
New Perspectives on PerformanceNew Perspectives on Performance
New Perspectives on Performance
 
Harness jQuery Templates and Data Link
Harness jQuery Templates and Data LinkHarness jQuery Templates and Data Link
Harness jQuery Templates and Data Link
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery Plugins
 
State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conference
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
Mobile Web Speed Bumps
Mobile Web Speed BumpsMobile Web Speed Bumps
Mobile Web Speed Bumps
 
Real World Windows 8 Apps in JavaScript
Real World Windows 8 Apps in JavaScriptReal World Windows 8 Apps in JavaScript
Real World Windows 8 Apps in JavaScript
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
 
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)
 
Get Hip with JHipster - Denver JUG 2015
Get Hip with JHipster - Denver JUG 2015Get Hip with JHipster - Denver JUG 2015
Get Hip with JHipster - Denver JUG 2015
 
Christmas Trees Made with HTML CSS and JS
Christmas Trees Made with HTML CSS and JSChristmas Trees Made with HTML CSS and JS
Christmas Trees Made with HTML CSS and JS
 
CSS Lessons Learned the Hard Way (Generate Conf)
CSS Lessons Learned the Hard Way (Generate Conf)CSS Lessons Learned the Hard Way (Generate Conf)
CSS Lessons Learned the Hard Way (Generate Conf)
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!
 
What is HTML 5?
What is HTML 5?What is HTML 5?
What is HTML 5?
 
The Art of AngularJS in 2015
The Art of AngularJS in 2015The Art of AngularJS in 2015
The Art of AngularJS in 2015
 
Testing Angular 2 Applications - HTML5 Denver 2016
Testing Angular 2 Applications - HTML5 Denver 2016Testing Angular 2 Applications - HTML5 Denver 2016
Testing Angular 2 Applications - HTML5 Denver 2016
 
The 5 Layers of Web Accessibility
The 5 Layers of Web AccessibilityThe 5 Layers of Web Accessibility
The 5 Layers of Web Accessibility
 

Similar to jQueryTO: State of jQuery March 2013

State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portland
dmethvin
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynote
dmethvin
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013
dmethvin
 
jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPages
Teamstudio
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
Jia Mi
 
Beginning jQuery Mobile
Beginning jQuery MobileBeginning jQuery Mobile
Beginning jQuery Mobile
Troy Miles
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)
jeresig
 
State of jQuery '09
State of jQuery '09State of jQuery '09
State of jQuery '09
jeresig
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
Nicholas Jansma
 
JavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefoxJavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefox
Gennady Feldman
 
JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)
jeresig
 
Web app with j query &amp; javascript (5:4)
Web app with j query &amp; javascript (5:4)Web app with j query &amp; javascript (5:4)
Web app with j query &amp; javascript (5:4)
Thinkful
 
jQuery Comes to XPages
jQuery Comes to XPagesjQuery Comes to XPages
jQuery Comes to XPages
Teamstudio
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPress
GGDBologna
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPress
Danilo Ercoli
 
JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)
jeresig
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
DevelopmentArc LLC
 
JavaScript Libraries (@Media)
JavaScript Libraries (@Media)JavaScript Libraries (@Media)
JavaScript Libraries (@Media)
jeresig
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angular
Basarat Syed
 
Creating a Responsive Website From Scratch
Creating a Responsive Website From ScratchCreating a Responsive Website From Scratch
Creating a Responsive Website From Scratch
Corky Brown
 

Similar to jQueryTO: State of jQuery March 2013 (20)

State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portland
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynote
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013
 
jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPages
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
 
Beginning jQuery Mobile
Beginning jQuery MobileBeginning jQuery Mobile
Beginning jQuery Mobile
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)
 
State of jQuery '09
State of jQuery '09State of jQuery '09
State of jQuery '09
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
JavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefoxJavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefox
 
JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)JavaScript Libraries (Kings of Code)
JavaScript Libraries (Kings of Code)
 
Web app with j query &amp; javascript (5:4)
Web app with j query &amp; javascript (5:4)Web app with j query &amp; javascript (5:4)
Web app with j query &amp; javascript (5:4)
 
jQuery Comes to XPages
jQuery Comes to XPagesjQuery Comes to XPages
jQuery Comes to XPages
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPress
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPress
 
JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
JavaScript Libraries (@Media)
JavaScript Libraries (@Media)JavaScript Libraries (@Media)
JavaScript Libraries (@Media)
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angular
 
Creating a Responsive Website From Scratch
Creating a Responsive Website From ScratchCreating a Responsive Website From Scratch
Creating a Responsive Website From Scratch
 

jQueryTO: State of jQuery March 2013

  • 1. The State of jQuery Dave Methvin President, jQuery Foundation March, 2013
  • 2. How It All Started Jan 2006: The birth of jQuery
  • 3. Seven Years of Good Luck Feb 2013: jQuery core is used by 64 percent of the top 10,000 sites
  • 4. The jQuery Foundation • Created in March 2012
  • 5. The jQuery Foundation • Created in March 2012
  • 6. The jQuery Foundation • Created in March 2012 • Coordinates the work of jQuery team members and volunteers
  • 7. The jQuery Foundation Is... • A non-profit organization o Volunteer board of directors o Volunteer president (thats me) o A few paid staff, mainly devs/ops • Funded by o Conferences o Donations – http://jquery.org/donate o Memberships o YOU or your company can be a member  http://jquery.org/join
  • 10. The jQuery Foundation's Work • Organize/fund work on the projects • Advocate for web developer needs o W3C web standards o ECMA TC39 JavaScript standards • Run two US conferences annually • License conferences worldwide
  • 11. jQuery Foundation Projects • http://github.com/jquery • jQuery Core • jQuery UI • jQuery Mobile • Sizzle selector engine • QUnit unit test framework • jQuery Migrate plugin • TestSwarm CI testing • Documentation sites
  • 12. Join The Community • It’s all on Github – not just the code • File an issue when you see a problem • Make pull requests against docs • Join our forum and share knowledge
  • 13. The jQuery Core Library Plan • jQuery 1.9 vs. 2.0 o jQuery 1.x still supports IE 6/7/8 o jQuery 2.x supports modern browsers o The two versions stay in API sync o Both branches maintained by the team • Heavily publicized changes during 2012 • Released several public betas • Shipped jQuery 1.9 in January
  • 14. What We Learned (the Hard Way) Far too many people are using "latest" versions in live sites! NEVER HOTLINK: http://code.jquery.com/jquery-latest.js http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js
  • 15. jQuery 1.9: Users Love It!
  • 16. jQuery Migrate Plugin • Identifies things your code is doing that jQuery 1.9/2.0 don't support anymore • Actually changes jQuery back to pre-1.9 behavior so older code just works • Lets you use jQuery 1.9/2.0 with code that hasn't been upgraded yet • Documentation gives advice on how to remediate the issue
  • 18. jQuery Migrate Warnings • Shown in the uncompressed version • Problem and solutions documented
  • 19. How Do I Fix This?
  • 20. Shut-Up-and-Fix-It Mode Include the minified version of the plugin and no warnings appear
  • 21. What We Broke Fixed, and Why • Removed $.browser • Removed .live() • Fixed $.parseJSON
  • 22. Why $.browser Deserves To Go • Usually the wrong inference • Often assumes future browsers and versions will be broken the same way • Horribly misused and misunderstood
  • 23. Why You Don't Assume Browsers Chrome added focusin/out two years ago!
  • 24. Browser Name is Only a BRAND Opera just announced their future products will be based on the WebKit engine, not their own Presto engine.
  • 25. Internet Explorer's Disguises • IE can emulate older versions via <meta name="X-UA-Compatible“ …> • Can be accidentally lobotomized via that confounded Address Bar button • Browser version in the UA string does not represent the real version The Enemy!
  • 26. Who Else Used $.browser?
  • 27. Who Else Used $.browser?
  • 28. Please Don't Do This ...
  • 29. ... copy/pasta is bad! Not fixing the problem, no code attribution
  • 30. ... copy/pasta is bad! Use jQuery Migrate or (better) Modernizr!
  • 31. What's Wrong With .live()? • It's like global variables, but for events • Every event that occurs must bubble to document before it can be processed • Processing events can be expensive, especially on deep documents • Still easy to process events globally: o $(document).on("click", "a", linkyClicky);
  • 32. What's Wrong With .live()? • Doesn't work well on iPhone/iPad! • iOS doesn't bubble touch events all the way to document • Delegated touch events must be processed below the <body> element Letting all events bubble to document destroys the usefulness of the event propagation model
  • 33. Optimize Your Selectors Original line: $(".dialog .close").live("click", ... Direct replacement (poor): $(document).on("click", ".dialog .close" ... Optimized replacement: $(".dialog").on("click", ".close", ...
  • 34. JSON Should Be JSON The Bug: • Before 1.9, $.parseJSON("") returned null but it's not valid JSON The Fix: • In 1.9, $.parseJSON("") is an error
  • 35. The Result: PANIC • We called invalid JSON invalid. • We're also out of coffee.
  • 36. The Moral of the Story In jQuery, every change is a breaking change for some poor developer.
  • 37. The Other Moral of the Story Nobody tries the jQuery alpha and beta builds.
  • 40. Big News: jQuery 2.0 Beta 2 • Released yesterday -- please try it! • Custom builds can shrink size • Bare-bones selector engine option o Basically, just querySelectorAll • How small? o Normal build: 28KB minified and gzipped o Blog example: 17KB o Tiniest build: 14KB
  • 41. jQuery 2.0: README.NOW Making a public web site? You don't need 2.0 right now! jQuery 2.0 is a good fit for: • Chrome or Firefox plugins • node.js apps (jsdom, Cheerio) • Windows 8 Store ("Modern/Metro") apps • PhoneGap (iPhone/Android/BlackBerry) • Apps using UIWebKit or WebBrowser
  • 42. jQuery 2.0 is Forward Looking • The jQuery team supports both 1.9 and 2.0; there isn't a problem of using an "unsupported version" • Since 1.x/2.x APIs are the same, there is no problem in using 1.x exclusively on a public web site -- it's recommended • You can detect platforms and include 1.9 or 2.0, but beware of your code or plugins using undocumented semantics!
  • 43. Old Android Browsers Lack ES5 EcmaScript 5 is was the 2.0 baseline (-: :-(
  • 44. Old WebKit is the New Old IE
  • 45. Questions? Email: dave@jquery.com Twitter: @davemethvin GitHub: @dmethvin IRC (Freenode): DaveMethvin #jquery-dev