jquery conference 2012 keynote

29

Upload: dmethvin

Post on 08-May-2015

43.690 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: jQuery Conference 2012 keynote
Page 2: jQuery Conference 2012 keynote

jQuery Conference 2012San Francisco

Dave MethvinPresident, jQuery FoundationLead Developer, jQuery Core

Page 3: jQuery Conference 2012 keynote

Just a few things going on…

• jQuery Foundation– Gives us a way to organize support for the jQuery

project and community efforts• Software development• Documentation and training• Conferences

– Tomorrow morning's keynote by Richard Worth• jQuery Core, UI, Mobile

Page 4: jQuery Conference 2012 keynote

jQuery Core Timeline

• jQuery 1.0: January 2006• jQuery 1.1: January 2007• jQuery 1.2: September 2007• jQuery 1.3: January 2009• jQuery 1.4: January 2010• jQuery 1.5: January 2011• jQuery 1.6: May 2011• jQuery 1.7: November 2011

Page 5: jQuery Conference 2012 keynote

jQuery Core Timeline

• jQuery 1.0: January 2006• jQuery 1.1: January 2007• jQuery 1.2: September 2007• jQuery 1.3: January 2009• jQuery 1.4: January 2010• jQuery 1.5: January 2011• jQuery 1.6: May 2011• jQuery 1.7: November 2011

Page 6: jQuery Conference 2012 keynote

jQuery 1.8: July 2012

• Only major release this year• Fix bugs, make things faster (of course!)• Add some nice things (CSS vendor prefixes)• Dump unneeded code (Safari 2 for example)• Deprecate "trip hazards"– E.g. $.browser

• Set the stage for future work

Page 7: jQuery Conference 2012 keynote

jQuery 1.8: Modularity

• New grunt build system (yay @cowboy!)• Intended for advanced users in 1.8– You must understand your project dependencies

• Exclude parts you don't need– ajax, css, dimensions, effects, offset, deprecated

• Simple option in the jQuery build– Documented in the README file– Blog post to come

Page 8: jQuery Conference 2012 keynote

jQuery 1.8: Modularity

• Theoretical example: Small mobile app – Uses classes for CSS styling and animations– No third-party plugin dependencies– Only needs JSONP, using jaubourg's jsonp.js– jQuery 1.7.2: 32.8KB min-gz (full jQuery)– jQuery 1.8: ~24KB min-gz (including jsonp.js!)

Page 9: jQuery Conference 2012 keynote

THIS is why it can't be simple

Page 10: jQuery Conference 2012 keynote

jQuery 1.8: Closure Compiler

• Experimental branch, not yet available• Supports CC's ADVANCED_OPTIMIZATIONS– Renames variables and property names– Eliminates dead (uncalled) functions– Inlines function calls

• Intended for really advanced users– obj.name vs. obj["name"] confuses optimizer– Code annotations act as optimizer hints– All your code needs to be CC AO safe– Difficult to debug

Page 11: jQuery Conference 2012 keynote

The Future of jQuery

Page 12: jQuery Conference 2012 keynote

The Future of jQuery

Page 13: jQuery Conference 2012 keynote

jQuery 1.9: Early 2013

• Continued API cleanup– Better modularity and speed, smaller size– Remove some deprecated APIs

• Compatibility plugin– Includes most of the APIs we remove– For the times you just want to "make it work"

• Support and unit tests for all major market-share browsers (including IE7/8)

• IE6 serious-regressions-only policy

Page 14: jQuery Conference 2012 keynote

This is the exciting part

Page 15: jQuery Conference 2012 keynote

jQuery 2.0: Early 2013

• Same API as jQuery 1.9• No major feature additions

Page 16: jQuery Conference 2012 keynote

jQuery 2.0: Early 2013

• Same API as jQuery 1.9• No major feature additions

Page 17: jQuery Conference 2012 keynote

jQuery 2.0: Early 2013

NO SUPPORT FOR IE6, IE7,

NOT EVEN IE8

Page 18: jQuery Conference 2012 keynote

Why This Approach?

• OldIE workarounds permeate jQuery– Refactoring to a plugin isn't practical

• We have a solution for oldIE – version 1.9– Remember, it's the same API

Page 19: jQuery Conference 2012 keynote

Shunning oldIE: Advantages• Jettison all the oldIE hacks

– "Attroperties"– DOM-vs-JavaScript memory leaks– innerHTML serialization quirks– HTML5 shimming– Spontaneous tbody in empty tables– Opacity via filters, causes grainy text– Incorrect case sensitivity on attributes– Non-W3C attachEvent model– Can't change type property of inputs– Link href attribute returns absolute URL– No bubbling on change and submit events– Unreliable offsetHeight on table elements– Thrᵒws exceptions on invalid CSS values– Appended checkboxes lose their chec√s– Broken try/finally – there's G0T to be a catch– Host objects, please NOT hosT objects– It comes it cOmes cannot fi ght it comWeXs, Y– �U hoZly n� code destro҉ying all enl ghteni ����� ment, – JScript lea\k g frXom Wyo ^ur eye_ lYik e liq uid i �n� s� pain, – ALL IS LoS���S���S���S���S���S���S���S���S���S���S���S���S���S���S������

T ALL I S LOST

– MY CODE MY CODE ᵒh no NO NOOಠoಠ

Page 20: jQuery Conference 2012 keynote

Simplify, Simplify, Simplify

• Removing oldIE improves the code base– Faster • Fewer feature detects required at load time• Fewer tests needed at run time

– Smaller• Especially when combined with modularity!

– Revisit design decisions warped by oldIE• E.g., attach data directly to DOM elements

Page 21: jQuery Conference 2012 keynote

Not Just Mobile – Modern

• Yes, oldIE is just a "desktop" concern• But "mobile" is not just iOS/Webkit– Poster boy: Microsoft Surface Tablet• Not just one screen size; not Webkit• Mouse, touch, stylus, maybe even Kinect?

– Responsive design to the rescue?• jQuery 2.0 will support modern browsers– Not just a Webkit subset of browsers– We don't want to break the web

Page 22: jQuery Conference 2012 keynote

"IE8 can't use my site?"

Page 23: jQuery Conference 2012 keynote

Breaking the Web?

• jQuery Core team will support two versions– Version 1.9 works with IE 6/7/8– Version 2.0 does not

"But Dave, my web site still needs to support IE 6/7/8 but I want to use jQuery 2.0!"

Page 24: jQuery Conference 2012 keynote
Page 25: jQuery Conference 2012 keynote

jQuery 2.0: "Tears of Joy" Policy

• Include jQuery 1.9 only for oldIE:

!--[if lt IE 9]> <script src="jquery-1.9.0.js"></script><![endif]--><!--[if gte IE 9]><!--> <script src="jquery-2.0.0.js"></script><!--<![endif]-->

Page 26: jQuery Conference 2012 keynote

jQuery Core Future Growth

Page 27: jQuery Conference 2012 keynote

jQuery Core Future Growth

• Improve browser features or solve issues that exist everywhere (e.g. CSS vendor prefixes)

• Beyond that, emphasis on plugins– Don't make everyone pay for platform-specific

features and needs• You can still use a CDN jQuery but compress all

your plugins and site code!

Page 28: jQuery Conference 2012 keynote

Why We Plugin: Touch Events

• Two non-standard implementations– Webkit touch events– Microsoft MSPointer– No sign of a W3C standard (Apple patents)

• Can we normalize like we did with oldIE?– Maybe … but to which implementation?– Webkit: de facto; MSPointer: flexible, unproven

• Should we include this in core?– Way too early for that. Plugin for now!

Page 29: jQuery Conference 2012 keynote

Timmy Willison!

Good News, Everyone!

Changes to the Sizzle Selector Engine