With the upcoming 1.7 release, The Dojo Toolkit is beginning to introduce major structural and architectural changes in the toolkit, setting the path for their new major 2.0 release due in 2012.
These fundamental changes to the architecture and technologies underpinning the toolkit will dramatically change how we write Dojo applications in the future, bringing with it huge benefits in performance, cross-library compatibility and support for mobile platforms.
In this presentation, I'll be walking through these changes, explaining the benefits and how it'll impact developers. I'll also be providing migration tips to help you start taking advantage of these benefits in your application today, based upon my experience using Dojo 1.7 on the Watson project.
This talk will be technical in nature, aiming at developers and team leads who are using the toolkit in their products or on client engagements.
6. Lots has changed...
• AMD Module format • Touch events support
• New Loader • Gauges & Charting
• New Build system • Data Stores
• Better Mobile support • MVC support
• Feature detection • Slim-line widgets
• Improved Grid • Dojo Package Repo
• and much more... • and much more....
Wednesday, 7 December 2011
11. “Asynchronous Module Definition
(AMD) API specifies a mechanism for
defining modules such that the
module and its dependencies can be
asynchronously loaded”
Wednesday, 7 December 2011
13. “Asynchronous Module Definition
(AMD) API specifies a mechanism for
defining modules such that the
module and its dependencies can be
asynchronously loaded”
Wednesday, 7 December 2011
28. “Base-less” Dojo
Just the AMD loader by default....
only load what you need
http://www.flickr.com/photos/redux/4297873805/
< 4KB gzip+minified
Wednesday, 7 December 2011
44. From the AMD API Specification
define(id?, dependencies?, factory);
Wednesday, 7 December 2011
45. From the AMD API Specification
define(id?, dependencies?, factory);
(Optional) String used as module identifier
"org/widget/test"
Wednesday, 7 December 2011
46. From the AMD API Specification
define(id?, dependencies?, factory);
(Optional) String used as module identifier
"org/widget/test"
* - Ignore for anonymous modules
Wednesday, 7 December 2011
48. From the AMD API Specification
define(id?, dependencies?, factory);
(Optional) Array of module dependencies
["org/widget/base", "dojo/json"]
Resolved modules passed as factory arguments
Wednesday, 7 December 2011
50. From the AMD API Specification
“Loader plugins extend an AMD
implementation by allowing loading
of resources that are not traditional
JavaScript dependencies.”
Wednesday, 7 December 2011
51. What can we load?
Internationalisation bundles
“dojo/i18n!../nls/messages.json”
Wednesday, 7 December 2011
52. What can we load?
Text bundles
“dojo/text!../tmpl/widget.html”
Wednesday, 7 December 2011
53. What can we load?
Third-party plugins for CSS, Coffeescript,
LESS, Google Maps...
Wednesday, 7 December 2011
54. What can we load?
Third-party plugins for CSS, Coffeescript,
LESS, Google Maps...
...or just write your own!
Wednesday, 7 December 2011
56. From the AMD API Specification
define(id?, dependencies?, factory);
“ function that should be executed to
instantiate the module or an object...”
Wednesday, 7 December 2011
57. From the AMD API Specification
define(id?, dependencies?, factory);
“ function that should be executed to
instantiate the module or an object...”
* - Can also return an object
Wednesday, 7 December 2011
77. NOT in the AMD API Specification
require(dependencies?, callback);
Wednesday, 7 December 2011
78. NOT in the AMD API Specification
require(dependencies?, callback);
“... implementation-dependent API that will kick
off module loading.”
https://github.com/amdjs/amdjs-api/wiki/require
Wednesday, 7 December 2011
80. NOT in the AMD API Specification
require(dependencies?, callback);
(Optional) Array of module dependencies
["org/widget/base", "dojo/json"]
Resolved modules passed as factory arguments
Wednesday, 7 December 2011
82. NOT in the AMD API Specification
require(dependencies?, callback);
“...once all the modules are available,
the function callback is executed.”
Resolved modules passed as callback arguments
Wednesday, 7 December 2011
92. dGrid: Next
Generation Dojo Grid
Wednesday, 7 December 2011
93. Small, fast and light
• < 30KB minified, <80KB
with dependencies
• 6 - 10x faster that
DataGrid
• Pluggable modules
• Mobile device support
• Customisable with CSS
Wednesday, 7 December 2011
95. There’s lots more...
• AMD Module format • Touch events support
• New Loader • Gauges & Charting
• New Build system • Data Stores
• Better Mobile support • MVC support
• Feature detection • Slim-line widgets
• Improved Grid • Dojo Package Repo
• and much more... • and much more....
Wednesday, 7 December 2011
98. Dojo 1.7 provides early
access to 2.0 features...
Start “future proofing” your
application today
http://www.flickr.com/photos/9948354@N08/763399258
Wednesday, 7 December 2011