State of jQuery June 2013 - Portland


Published on

Keynote for jQuery Portland Conference, June 13 2013

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

State of jQuery June 2013 - Portland

  1. 1. The State of jQueryDave MethvinPresident, jQuery FoundationJune, 2013
  2. 2. Good Morning!
  3. 3. • Created in March 2012• Coordinates jQuery team worko Codeo Documentationo Infrastructureo EventsThe jQuery Foundation
  4. 4. • A non-profit organization• Funded byo Conferenceso Donationso Membershipso YOU or your company can be a member jQuery Foundation Is...
  5. 5. jQuery Foundation - Founding Members
  6. 6. jQuery Foundation Gold Members
  7. 7. •• jQuery Core, UI, Mobile• Sizzle selector engine• QUnit unit test framework• jQuery Migrate plugin• TestSwarm CI testing• Documentation sitesjQuery Foundation Projects
  8. 8. • jQuery 1.x vs. 2.xo jQuery 1.x still supports IE 6/7/8o jQuery 2.x supports modern browserso The two versions stay in API synco Both are maintained by the team• Heavily publicized changes in 2012• Several public betasThe jQuery Core Plan
  9. 9. • Released jQuery 1.9 in January• Released jQuery 2.0 in AprilAll good? Great!
  10. 10. • Released jQuery 1.9 in January• Released jQuery 2.0 in AprilAll good? Great!
  11. 11. Far too many peopleare using "latest"versions in live sites!NEVER HOTLINK: We Learned (the HardWay)
  12. 12. jQuery 1.9: Users Loved It!
  13. 13. • Identifies things your code is doing thatjQuery 1.9+ dont support anymore• Actually makes older code work• Lets you use jQuery 1.9+ with code thathasnt been upgraded yetjQuery Migrate Plugin
  14. 14. jQuery Migrate Example
  15. 15. • Shown in the uncompressed version• Problem and solutions documentedjQuery Migrate Warnings
  16. 16. How Do I Fix This?
  17. 17. Include the minified version of the pluginand no warnings appearShut-Up-and-Fix-It Mode
  18. 18. • Removed $.browser• Removed .live()What We Broke Fixed, and Why
  19. 19. • Usually not the best inference• Often assumes future browsers andversions will be broken the same way• Horribly misused and misunderstoodWhy $.browser Deserves To Go
  20. 20. Opera has announced their futureproducts will be based on the WebKitengine, not their own Presto engine.Browser Name is Only a BRAND
  21. 21. • IE can emulate older versions via<metaname="X-UA-Compatible">• IE11 betas dont even have "MSIE" in theiruser agent string!Internet Explorers DisguisesThe Enemy!
  22. 22. • Its like global variables, but for events• Every event that occurs must bubble todocument 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);Whats Wrong With .live()?
  23. 23. • Doesnt work well on iPhone/iPad!• iOS doesnt bubble touch events all theway to document• Delegated touch events must beprocessed below the <body> elementLetting all events bubble to documentdestroys the usefulness of the eventpropagation modelWhats Wrong With .live()?
  24. 24. Original line:$(".dialog .close").live("click", ...Direct replacement (poor):$(document).on("click", ".dialog .close" ...Optimized replacement:$(".dialog").on("click", ".close", ...Optimize Your Selectors
  25. 25. The Bug:• Before 1.9, $.parseJSON("") returnednull but its not valid JSONThe Fix:• In 1.9, $.parseJSON("") is an errorFixing bugs is dangerousbusiness
  26. 26. • We called invalid JSON invalid.• Were also out of coffee.The Result: PANIC
  27. 27. In jQuery, every change isa breaking change forsome poor developer.The Moral of the Story
  28. 28. • Several modules can be excluded• Bare-bones selector engine optiono Basically, just querySelectorAll• How small?o Normal build: 28KBo Tiniest build: 14KB• Smaller builds to comeo Option to exclude more codeo Finer granularityCustom builds for smaller size
  29. 29. jQuery 1.10
  30. 30. jQuery 1.10
  31. 31. • Relatively minor changes from 1.9• Brings 1.x into alignment with 2.x line• Simplifies cross-version comparisonso 1.10 --> 2.0o 1.11 --> 2.1o 1.12 --> 2.2• Patch versions not always the sameo e.g. 1.10.1 and 2.0.2jQuery 1.10
  32. 32. • The jQuery team supports both 1.x and2.x; there isnt a problem of using an"unsupported version"• Since 1.x/2.x APIs are the same, there isno problem in using 1.x exclusively on apublic web site -- its recommendedWhich version to use?
  33. 33. • Chrome or Firefox plugins• node.js apps (jsdom, Cheerio)• Windows 8 Store ("Modern/Metro") apps• PhoneGap (iPhone/Android/BlackBerry)• Apps using UIWebKit or WebBrowserjQuery 2.0 is a good fit for
  34. 34. • Perhaps sooner than you thinkWhen can jQuery 1.x die?
  35. 35. Chrome/Firefox updates quickly
  36. 36. IE not so much
  37. 37. IE not so much, but theres hopeXP
  38. 38. EcmaScript 5 is was the 2.0 baselineOld Android browsers, ugh:-((-:
  39. 39. Old WebKit is the New Old IE
  40. 40. Twitter: @davemethvinGitHub: @dmethvinIRC (Freenode): DaveMethvin #jquery-devEmail: dave@jquery.comQuestions?