SlideShare uma empresa Scribd logo
1 de 43
The State of jQuery
Dave Methvin
President, jQuery Foundation
jQuery Conference Austin
September, 2013
• Created in March 2012
• Coordinates jQuery team work
o Code
o Documentation
o Infrastructure
o Events
The jQuery Foundation
• A non-profit organization
• Funded by
o Conferences
o Donations
o Memberships
o YOU or your company can be a member
 http://jquery.org/join
The jQuery Foundation Is...
Founding Members
Platinum Member
Gold Members
• http://github.com/jquery
• jQuery Core, UI, Mobile
• Sizzle selector engine
• QUnit unit test framework
• jQuery Migrate plugin
• TestSwarm CI testing
• Documentation sites
jQuery Foundation Projects
● Support jQuery projects
● Support web developers
● Support web standards
● Advocate for developer needs
● Participate in standards process
○ W3C
○ ECMA 262 (JavaScript)
jQuery Foundation Initiatives
Important Incoming News
• jQuery 1.x vs. 2.x
o jQuery 1.x still supports IE 6/7/8
o jQuery 2.x supports modern browsers
o Both are maintained by the team
The jQuery Core Plan
• Released jQuery 1.9 in January
• Released jQuery 2.0 in April
• Released jQuery 1.10 in June
• API version sync
o 1.10.0 2.0.0
o 1.11.0 2.1.0
o etc.
o Patch versions may be on just one branch
1.x/2.x APIs Stay in Sync
• Identifies things your code is doing that
jQuery 1.9+ doesn't support anymore
• Actually makes older code work
• Lets you use jQuery 1.9+ with code that
hasn't been upgraded yet
jQuery Migrate Plugin
jQuery Migrate Example
• Shown in the uncompressed version
• Problem and solutions documented
jQuery Migrate Warnings
In jQuery, every change is
a breaking change for
some poor developer.
The Moral of the Story
Coming This Fall: jQuery
1.11/2.1
Coming This Fall: jQuery
1.11/2.1
● jQuery team will publish to Bower
● jQuery team will publish to npm
● You can manage dependencies
○ bower install jquery
○ bower install jquery#1.11.0
○ npm install jquery
● Use a component.json file for Bower
● Use a package.json file for npm
1.11/2.1: Dependency
Management
• Asynchronous Module Definition
• AMD takes care of internal dependencies
• You can choose the modules to load
• Load just what you need
• Use r.js to build a single file
• More flexible and granular than previous
custom grunt build process
1.11/2.1: Uses AMD internally
● Previously: jQuery runs feature detects
all at once, on jquery.js/page load
○ Impacts page load performance
● Now: Individual feature detect runs the
first time the feature is used
○ Defers the impact until needed
○ Doesn't run detects for sub-modules that
aren't used/called by your code!
1.11/2.1: Just-In-Time Detects
• You don't have to use Bower
• You don't have to use npm
• You don't have to use AMD
• Just include from a <script> tag
• You'll still get the performance boost
1.11/2.1: Still can use a CDN!
• Beta coming out within a month
• Give it a try
• Tell us when you think it's ready
o Which means you have to try it
1.11/2.1: When?
Let's Shut This Guy Up, Forever
● Dimensional changes make the browser
recalculate/redraw the page
○ Changing element sizes
○ Adding/removing classes or IDs
○ Adding new content
● We've reduced these where possible
○ Ex: .removeClass() when nothing changes
● A lot still depends on jQuery developers
1.11/2.1 Goal: Fewer Forced
Layouts
"A poor workman blames his tools."
Know How Your Tools Work
"Плохому танцору яйца мешают."
Know How Your Tools Work
"A poor dancer blames his balls."
Know How Your Tools Work
● jQuery simplifies/shortens code
● It doesn't try to hide the browser model
● You still need to Know the Browser
● Especially the layout engine
Understand the Browser
● A.K.A. Reflow
● Whenever you change the HTML or CSS
on a page, the browser must re-apply
any applicable CSS rules, and must
recalculate the layout whenever
dimensions of elements change.
● May affect all or just part of the page.
What is a Layout?
● Make a change to the document that
(potentially) affects dimensions
● Immediately ask the browser about the
new dimensions
○ "Immediately" meaning, "Before control
returns to the browser from your script."
What is a Forced Layout?
● Slow page load time
○ Often a result of .ready() abuse
● "Janky" page behavior when scrolling or
during animations
Impact of Too Many Layouts
http://jsfiddle.net/qjncp/show/
$(".box").on("mouseover mouseout", function(e) {
$(this).toggleClass("highlight", e.type === "mouseover");
var size = $(this).width();
$("#heart").width(size);
});
Simple Forced Layout Example
http://jsfiddle.net/qjncp/show/
$(".box").on("mouseover mouseout", function(e) {
$(this).toggleClass("highlight", e.type === "mouseover");
var size = $(this).width();
$("#heart").width(size);
});
Simple Forced Layout Example
FORCED LAYOUT
http://jsfiddle.net/qjncp/show/
● Google Chrome
● Internet Explorer 11
Demo: Finding Forced Layouts
● Scroll event occurs
● Inside the scroll event handler
a. Add a little bit of content
b. Ask the browser, "Did I fill it enough?"
c. If not, go back to (a)
d. Several times through...exit
Patterns To Avoid: Infinite Scroll
● Scroll event occurs
● Inside the scroll event handler
a. Add a little bit of content
b. Ask the browser, "Did I fill it enough?"
c. If not, go back to (a)
d. Several times through...exit
Patterns To Avoid: Infinite Scroll
FULL-PAGE FORCED
LAYOUT ON EVERY
SCROLL EVENT!
FULL-PAGE FORCED
LAYOUT ON EVERY
SCROLL EVENT!
(cough, Facebook)
● Use the regularity of grid layouts to
simplify your calculations, instead of
asking the browser to calculate!
● E.g., each row is 200px high, the page
has scrolled down 740px, we need to add
4 more rows of content
Infinite Scroll Strategy
Don't ask the browser a
question that is hard for it
to figure out but easy for
you to know (or track).
$(":hidden") vs $(".hidden")
Avoiding Forced Layout
● jQuery selector extension
● Can't use fast native DOM selector code
● ":hidden" elements defined as "don't take
up space in the document"
● Selecting these elements forces layout if
anything has changed in the DOM
$(":hidden")
● Standard CSS selector (by class)
● Uses fast DOM selector code
● Just needs to look at the DOM tree
○ Not CSS, even if CSS has recently changed
● Won't force a layout
● Can be combined with CSS transitions
● Fast and battery efficient
$(".hidden")
Throttle high frequency
events like mousemove or
scroll; handle with
requestAnimationFrame
www.html5rocks.com/en/tutorials/speed/rendering/
Avoiding Forced Layout
Modern browsers have the tools to find
these issues and make you look like a
web development star!
Know Your Tools
Twitter: @davemethvin
GitHub: @dmethvin
IRC (Freenode): DaveMethvin #jquery-dev
Email: dave@jquery.com
Questions?

Mais conteúdo relacionado

Mais procurados

Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceAutomated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceMatthew Lancaster
 
JsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery TemplatesJsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery TemplatesBorisMoore
 
Transforming Front-End Disaster Code™ Into A Maintainable Masterpiece
Transforming Front-End Disaster Code™ Into A Maintainable MasterpieceTransforming Front-End Disaster Code™ Into A Maintainable Masterpiece
Transforming Front-End Disaster Code™ Into A Maintainable MasterpieceDan Gribbin
 
Going Node.js at Netflix
Going Node.js at NetflixGoing Node.js at Netflix
Going Node.js at Netflixmicahr
 
jQueryTO: State of jQuery March 2013
jQueryTO: State of jQuery March 2013jQueryTO: State of jQuery March 2013
jQueryTO: State of jQuery March 2013dmethvin
 
HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015dmethvin
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MITjeresig
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slowdmethvin
 
Rapid Testing, Rapid Development
Rapid Testing, Rapid DevelopmentRapid Testing, Rapid Development
Rapid Testing, Rapid Developmentmennovanslooten
 
Smooth Animations for Web & Hybrid
Smooth Animations for Web & HybridSmooth Animations for Web & Hybrid
Smooth Animations for Web & HybridFITC
 
AngularJS for Legacy Apps
AngularJS for Legacy AppsAngularJS for Legacy Apps
AngularJS for Legacy AppsPeter Drinnan
 
How to Use WebVR to Enhance the Web Experience
How to Use WebVR to Enhance the Web ExperienceHow to Use WebVR to Enhance the Web Experience
How to Use WebVR to Enhance the Web ExperienceFITC
 
Open-source Mic Talks at AOL
Open-source Mic Talks at AOLOpen-source Mic Talks at AOL
Open-source Mic Talks at AOLAddy Osmani
 
Flexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldFlexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldKevin Ball
 
React Fundamentals - Jakarta JS, Apr 2016
React Fundamentals - Jakarta JS, Apr 2016React Fundamentals - Jakarta JS, Apr 2016
React Fundamentals - Jakarta JS, Apr 2016Simon Sturmer
 
The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015Matt Raible
 
jQuery and the W3C
jQuery and the W3CjQuery and the W3C
jQuery and the W3Cjeresig
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsAviran Cohen
 

Mais procurados (20)

Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceAutomated perf optimization - jQuery Conference
Automated perf optimization - jQuery Conference
 
JsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery TemplatesJsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery Templates
 
Transforming Front-End Disaster Code™ Into A Maintainable Masterpiece
Transforming Front-End Disaster Code™ Into A Maintainable MasterpieceTransforming Front-End Disaster Code™ Into A Maintainable Masterpiece
Transforming Front-End Disaster Code™ Into A Maintainable Masterpiece
 
Going Node.js at Netflix
Going Node.js at NetflixGoing Node.js at Netflix
Going Node.js at Netflix
 
jQueryTO: State of jQuery March 2013
jQueryTO: State of jQuery March 2013jQueryTO: State of jQuery March 2013
jQueryTO: State of jQuery March 2013
 
HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MIT
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slow
 
Rapid Testing, Rapid Development
Rapid Testing, Rapid DevelopmentRapid Testing, Rapid Development
Rapid Testing, Rapid Development
 
Smooth Animations for Web & Hybrid
Smooth Animations for Web & HybridSmooth Animations for Web & Hybrid
Smooth Animations for Web & Hybrid
 
AngularJS for Legacy Apps
AngularJS for Legacy AppsAngularJS for Legacy Apps
AngularJS for Legacy Apps
 
How to Use WebVR to Enhance the Web Experience
How to Use WebVR to Enhance the Web ExperienceHow to Use WebVR to Enhance the Web Experience
How to Use WebVR to Enhance the Web Experience
 
Open-source Mic Talks at AOL
Open-source Mic Talks at AOLOpen-source Mic Talks at AOL
Open-source Mic Talks at AOL
 
Flexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldFlexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework World
 
React Fundamentals - Jakarta JS, Apr 2016
React Fundamentals - Jakarta JS, Apr 2016React Fundamentals - Jakarta JS, Apr 2016
React Fundamentals - Jakarta JS, Apr 2016
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015
 
Angular - Beginner
Angular - BeginnerAngular - Beginner
Angular - Beginner
 
jQuery and the W3C
jQuery and the W3CjQuery and the W3C
jQuery and the W3C
 
ME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS FundamentalsME vs WEB - AngularJS Fundamentals
ME vs WEB - AngularJS Fundamentals
 

Destaque

Question 7
Question 7Question 7
Question 7AA60871
 
The Well-Grounded Nuby
The Well-Grounded NubyThe Well-Grounded Nuby
The Well-Grounded NubyDavid Black
 
Beyond DOM Manipulations: Building Stateful Modules with Events and Promises
Beyond DOM Manipulations: Building Stateful Modules with Events and PromisesBeyond DOM Manipulations: Building Stateful Modules with Events and Promises
Beyond DOM Manipulations: Building Stateful Modules with Events and PromisesCrashlytics
 
Building Backbone.js Apps for Scale
Building Backbone.js Apps for ScaleBuilding Backbone.js Apps for Scale
Building Backbone.js Apps for ScaleCrashlytics
 
Backbone testing
Backbone testingBackbone testing
Backbone testingCrashlytics
 
Scaling Crashlytics: Building Analytics on Redis 2.6
Scaling Crashlytics: Building Analytics on Redis 2.6Scaling Crashlytics: Building Analytics on Redis 2.6
Scaling Crashlytics: Building Analytics on Redis 2.6Crashlytics
 

Destaque (7)

Question 7
Question 7Question 7
Question 7
 
The Well-Grounded Nuby
The Well-Grounded NubyThe Well-Grounded Nuby
The Well-Grounded Nuby
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
 
Beyond DOM Manipulations: Building Stateful Modules with Events and Promises
Beyond DOM Manipulations: Building Stateful Modules with Events and PromisesBeyond DOM Manipulations: Building Stateful Modules with Events and Promises
Beyond DOM Manipulations: Building Stateful Modules with Events and Promises
 
Building Backbone.js Apps for Scale
Building Backbone.js Apps for ScaleBuilding Backbone.js Apps for Scale
Building Backbone.js Apps for Scale
 
Backbone testing
Backbone testingBackbone testing
Backbone testing
 
Scaling Crashlytics: Building Analytics on Redis 2.6
Scaling Crashlytics: Building Analytics on Redis 2.6Scaling Crashlytics: Building Analytics on Redis 2.6
Scaling Crashlytics: Building Analytics on Redis 2.6
 

Semelhante a jQuery Conference Austin Sept 2013

State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conferencedmethvin
 
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 XPagesTeamstudio
 
Making cross browser tests beautiful
Making cross browser tests beautifulMaking cross browser tests beautiful
Making cross browser tests beautifulMeaghan Lewis
 
State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portlanddmethvin
 
Discover the power of browser developer tools
Discover the power of browser developer toolsDiscover the power of browser developer tools
Discover the power of browser developer toolsylefebvre
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkAlive Kuo
 
Architektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan KrausArchitektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan KrausWomen in Technology Poland
 
9 Useful Things that Every Web Developer Needs to Know
9 Useful Things that Every Web Developer Needs to Know9 Useful Things that Every Web Developer Needs to Know
9 Useful Things that Every Web Developer Needs to KnowSimobo
 
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 - Chapter 1 - Introduction
 jQuery - Chapter 1 - Introduction jQuery - Chapter 1 - Introduction
jQuery - Chapter 1 - IntroductionWebStackAcademy
 
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
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesVolkan Özçelik
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Volkan Özçelik
 
Getting started with dev tools (atl)
Getting started with dev tools (atl)Getting started with dev tools (atl)
Getting started with dev tools (atl)Thinkful
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) Volkan Özçelik
 
Flexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldFlexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldFITC
 
State of jQuery '09
State of jQuery '09State of jQuery '09
State of jQuery '09jeresig
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesMark Roden
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)Igalia
 

Semelhante a jQuery Conference Austin Sept 2013 (20)

State of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront ConferenceState of jQuery - AspDotNetStorefront Conference
State of jQuery - AspDotNetStorefront Conference
 
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
 
Making cross browser tests beautiful
Making cross browser tests beautifulMaking cross browser tests beautiful
Making cross browser tests beautiful
 
State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portland
 
Discover the power of browser developer tools
Discover the power of browser developer toolsDiscover the power of browser developer tools
Discover the power of browser developer tools
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
 
Architektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan KrausArchitektura html, css i javascript - Jan Kraus
Architektura html, css i javascript - Jan Kraus
 
9 Useful Things that Every Web Developer Needs to Know
9 Useful Things that Every Web Developer Needs to Know9 Useful Things that Every Web Developer Needs to Know
9 Useful Things that Every Web Developer Needs to Know
 
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 - Chapter 1 - Introduction
 jQuery - Chapter 1 - Introduction jQuery - Chapter 1 - Introduction
jQuery - Chapter 1 - Introduction
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best Practices
 
Presentation
PresentationPresentation
Presentation
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012
 
Getting started with dev tools (atl)
Getting started with dev tools (atl)Getting started with dev tools (atl)
Getting started with dev tools (atl)
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1)
 
Flexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework WorldFlexible UI Components for a Multi-Framework World
Flexible UI Components for a Multi-Framework World
 
State of jQuery '09
State of jQuery '09State of jQuery '09
State of jQuery '09
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)
 

Mais de dmethvin

jQuery Foot-Gun Features
jQuery Foot-Gun FeaturesjQuery Foot-Gun Features
jQuery Foot-Gun Featuresdmethvin
 
jQuery Conference Chicago - September 2014
jQuery Conference Chicago - September 2014jQuery Conference Chicago - September 2014
jQuery Conference Chicago - September 2014dmethvin
 
jQuery Conference Toronto
jQuery Conference TorontojQuery Conference Toronto
jQuery Conference Torontodmethvin
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoiddmethvin
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynotedmethvin
 
jQuery 1.7 Events
jQuery 1.7 EventsjQuery 1.7 Events
jQuery 1.7 Eventsdmethvin
 

Mais de dmethvin (6)

jQuery Foot-Gun Features
jQuery Foot-Gun FeaturesjQuery Foot-Gun Features
jQuery Foot-Gun Features
 
jQuery Conference Chicago - September 2014
jQuery Conference Chicago - September 2014jQuery Conference Chicago - September 2014
jQuery Conference Chicago - September 2014
 
jQuery Conference Toronto
jQuery Conference TorontojQuery Conference Toronto
jQuery Conference Toronto
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynote
 
jQuery 1.7 Events
jQuery 1.7 EventsjQuery 1.7 Events
jQuery 1.7 Events
 

Último

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe 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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Último (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

jQuery Conference Austin Sept 2013

  • 1. The State of jQuery Dave Methvin President, jQuery Foundation jQuery Conference Austin September, 2013
  • 2.
  • 3. • Created in March 2012 • Coordinates jQuery team work o Code o Documentation o Infrastructure o Events The jQuery Foundation
  • 4. • A non-profit organization • Funded by o Conferences o Donations o Memberships o YOU or your company can be a member  http://jquery.org/join The jQuery Foundation Is...
  • 7. • http://github.com/jquery • jQuery Core, UI, Mobile • Sizzle selector engine • QUnit unit test framework • jQuery Migrate plugin • TestSwarm CI testing • Documentation sites jQuery Foundation Projects
  • 8. ● Support jQuery projects ● Support web developers ● Support web standards ● Advocate for developer needs ● Participate in standards process ○ W3C ○ ECMA 262 (JavaScript) jQuery Foundation Initiatives
  • 10. • jQuery 1.x vs. 2.x o jQuery 1.x still supports IE 6/7/8 o jQuery 2.x supports modern browsers o Both are maintained by the team The jQuery Core Plan
  • 11. • Released jQuery 1.9 in January • Released jQuery 2.0 in April • Released jQuery 1.10 in June • API version sync o 1.10.0 2.0.0 o 1.11.0 2.1.0 o etc. o Patch versions may be on just one branch 1.x/2.x APIs Stay in Sync
  • 12. • Identifies things your code is doing that jQuery 1.9+ doesn't support anymore • Actually makes older code work • Lets you use jQuery 1.9+ with code that hasn't been upgraded yet jQuery Migrate Plugin
  • 14. • Shown in the uncompressed version • Problem and solutions documented jQuery Migrate Warnings
  • 15. In jQuery, every change is a breaking change for some poor developer. The Moral of the Story
  • 16. Coming This Fall: jQuery 1.11/2.1
  • 17. Coming This Fall: jQuery 1.11/2.1
  • 18. ● jQuery team will publish to Bower ● jQuery team will publish to npm ● You can manage dependencies ○ bower install jquery ○ bower install jquery#1.11.0 ○ npm install jquery ● Use a component.json file for Bower ● Use a package.json file for npm 1.11/2.1: Dependency Management
  • 19. • Asynchronous Module Definition • AMD takes care of internal dependencies • You can choose the modules to load • Load just what you need • Use r.js to build a single file • More flexible and granular than previous custom grunt build process 1.11/2.1: Uses AMD internally
  • 20. ● Previously: jQuery runs feature detects all at once, on jquery.js/page load ○ Impacts page load performance ● Now: Individual feature detect runs the first time the feature is used ○ Defers the impact until needed ○ Doesn't run detects for sub-modules that aren't used/called by your code! 1.11/2.1: Just-In-Time Detects
  • 21. • You don't have to use Bower • You don't have to use npm • You don't have to use AMD • Just include from a <script> tag • You'll still get the performance boost 1.11/2.1: Still can use a CDN!
  • 22. • Beta coming out within a month • Give it a try • Tell us when you think it's ready o Which means you have to try it 1.11/2.1: When?
  • 23. Let's Shut This Guy Up, Forever
  • 24. ● Dimensional changes make the browser recalculate/redraw the page ○ Changing element sizes ○ Adding/removing classes or IDs ○ Adding new content ● We've reduced these where possible ○ Ex: .removeClass() when nothing changes ● A lot still depends on jQuery developers 1.11/2.1 Goal: Fewer Forced Layouts
  • 25. "A poor workman blames his tools." Know How Your Tools Work
  • 26. "Плохому танцору яйца мешают." Know How Your Tools Work
  • 27. "A poor dancer blames his balls." Know How Your Tools Work
  • 28. ● jQuery simplifies/shortens code ● It doesn't try to hide the browser model ● You still need to Know the Browser ● Especially the layout engine Understand the Browser
  • 29. ● A.K.A. Reflow ● Whenever you change the HTML or CSS on a page, the browser must re-apply any applicable CSS rules, and must recalculate the layout whenever dimensions of elements change. ● May affect all or just part of the page. What is a Layout?
  • 30. ● Make a change to the document that (potentially) affects dimensions ● Immediately ask the browser about the new dimensions ○ "Immediately" meaning, "Before control returns to the browser from your script." What is a Forced Layout?
  • 31. ● Slow page load time ○ Often a result of .ready() abuse ● "Janky" page behavior when scrolling or during animations Impact of Too Many Layouts
  • 32. http://jsfiddle.net/qjncp/show/ $(".box").on("mouseover mouseout", function(e) { $(this).toggleClass("highlight", e.type === "mouseover"); var size = $(this).width(); $("#heart").width(size); }); Simple Forced Layout Example
  • 33. http://jsfiddle.net/qjncp/show/ $(".box").on("mouseover mouseout", function(e) { $(this).toggleClass("highlight", e.type === "mouseover"); var size = $(this).width(); $("#heart").width(size); }); Simple Forced Layout Example FORCED LAYOUT
  • 34. http://jsfiddle.net/qjncp/show/ ● Google Chrome ● Internet Explorer 11 Demo: Finding Forced Layouts
  • 35. ● Scroll event occurs ● Inside the scroll event handler a. Add a little bit of content b. Ask the browser, "Did I fill it enough?" c. If not, go back to (a) d. Several times through...exit Patterns To Avoid: Infinite Scroll
  • 36. ● Scroll event occurs ● Inside the scroll event handler a. Add a little bit of content b. Ask the browser, "Did I fill it enough?" c. If not, go back to (a) d. Several times through...exit Patterns To Avoid: Infinite Scroll FULL-PAGE FORCED LAYOUT ON EVERY SCROLL EVENT! FULL-PAGE FORCED LAYOUT ON EVERY SCROLL EVENT! (cough, Facebook)
  • 37. ● Use the regularity of grid layouts to simplify your calculations, instead of asking the browser to calculate! ● E.g., each row is 200px high, the page has scrolled down 740px, we need to add 4 more rows of content Infinite Scroll Strategy
  • 38. Don't ask the browser a question that is hard for it to figure out but easy for you to know (or track). $(":hidden") vs $(".hidden") Avoiding Forced Layout
  • 39. ● jQuery selector extension ● Can't use fast native DOM selector code ● ":hidden" elements defined as "don't take up space in the document" ● Selecting these elements forces layout if anything has changed in the DOM $(":hidden")
  • 40. ● Standard CSS selector (by class) ● Uses fast DOM selector code ● Just needs to look at the DOM tree ○ Not CSS, even if CSS has recently changed ● Won't force a layout ● Can be combined with CSS transitions ● Fast and battery efficient $(".hidden")
  • 41. Throttle high frequency events like mousemove or scroll; handle with requestAnimationFrame www.html5rocks.com/en/tutorials/speed/rendering/ Avoiding Forced Layout
  • 42. Modern browsers have the tools to find these issues and make you look like a web development star! Know Your Tools
  • 43. Twitter: @davemethvin GitHub: @dmethvin IRC (Freenode): DaveMethvin #jquery-dev Email: dave@jquery.com Questions?