30. Features
• Handle prerequisies without duplication
• Manage order dependency
• Per-module exibility
• Fast toggling between avors
• Continue fetching onDemand
• Minimize HTTP requests
and not block rendering
35. Loader Get Combo
The “seed” le. Parses request.
Creates new
nodes & src’s.
Meta data. Concats modules
if rst.
Non-blocking.
Con g options.
Edge-caches.
Cross-domain.
Helpers/Sugar.
GET not POST.
36. Loads anything:
• Library les
• Your own les
• JS, CSS, JSON, ...
• Urchin.js, badges, includes, ...
38. // one or more external modules
// that can be loaded along side of YUI
modules: {
json_org: {
fullpath: quot;http://www.json.org/json.jsquot;
},
json2_org: {
fullpath: quot;http://www.json.org/json2.jsquot;
}
}
48. Bene ts
• Easy to use.
• No typos. Less to manage.
• Much faster performance.
• Extensive exibility.
• Nice support for lazy-loading.
• Library agnostic.
58. function waitForButton() {
// do some work
// create our notifier
var notifier = new EventNotifier();
// attach our notifier to the button
document.getElementById(quot;myButtonquot;).onclick = notifier;
// wait for the button to be clicked
notifier.wait->();
// do more work
}
117. Analyzing Performance
Optimizing performance is a huge
!
concern: Faster code = happy users!
Measure execution time
!
Loop the code a few times
!
Measure the di!erence:
!
! quot;new Date#.getTimequot;#;
118. Stack Pro$ling
jQuery Stack Pro$ler
!
Look for problematic methods and plugins
!
http://ejohn.org/blog/deep%pro$ling%
!
jquery%apps/
120. Accuracy of
JavaScript Time
We’re measuring the performance of
JavaScript from within JavaScript!
http://ejohn.org/blog/accuracy-of-javascript-time/
125. Performance Tools
How can we get good numbers?
!
We have to go straight to the source: Use
!
the tools the browsers provide.
Tools:
!
! Firebug Pro$ler
! Safari Pro$ler
! quot;Part of Safari 4#
! IE 8 Pro$ler
141. Browser Support Grid
IE Firefox Safari Opera Chrome
Previous 6.0 2.0 3.0 9.5
Current 7.0 3.0 3.2 9.6 1.0
Next 8.0 3.1 4.0 10.0 2.0
jQuery Browser Support
142. Browser Support Grid
IE Firefox Safari Opera Chrome
Previous 3.0 9.5
6.0 2.0
Current 7.0 3.0 3.2 9.6 1.0
Next 8.0 3.1 4.0 2.0
10.0
jQuery 1.3 Browser Support
143. The Scaling Problem
The Problem:
!
! jQuery has 6 test suites
! Run in 11 browsers
! quot;Not even including multiple platforms!#
All need to be run for every commit,
!
patch, and plugin.
JavaScript testing doesn&t scale well.
!
144. Distributed Testing
Hub server
!
Clients connect and help run tests
!
A simple JavaScript client that can be run
!
in all browsers
! Including mobile browsers!
! TestSwarm
145. FF 3.5 FF 3.5 FF 3.5
IE 6
IE 6
FF 3 IE 6
Op 9
FF 3
IE 7
TestSwarm
IE 7
Test Suite Test Suite Test Suite
146. Manual Testing
Push tests to users who follow pre%de$ned
!
steps
Answer 'Yes&/&No& questions which are
!
pushed back to the server.
An e!ective way to distribute manual test
!
load to dozens of clients.
147. TestSwarm.com
Incentives for top testers quot;t%shirts, books#
!
Will be opening for testing at the end of
!
the month
Help your favorite JavaScript library
!
become better tested!
http://testswarm.com
!