SlideShare uma empresa Scribd logo
1 de 98
Baixar para ler offline
Moving to Dojo 1.7
                                                ...and the path to 2.0

http://www.flickr.com/photos/jenik/4836118314/
Wednesday, 7 December 2011
Me.




                             @thomasj

Wednesday, 7 December 2011
Dojo 1.7




http://www.flickr.com/photos/anythreewords/3197918781
Wednesday, 7 December 2011
Dojo 1.7




http://www.flickr.com/photos/anythreewords/3197918781
Wednesday, 7 December 2011
Wednesday, 7 December 2011
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
http://www.flickr.com/photos/trancemist/361935363/
Wednesday, 7 December 2011
Don’t




http://www.flickr.com/photos/trancemist/361935363/
Wednesday, 7 December 2011
API compatibility until
                           2.0*


         * - There may be some exceptions
Wednesday, 7 December 2011
What’s AMD?



Wednesday, 7 December 2011
“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
What’s new about that?



Wednesday, 7 December 2011
“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
“Dojo is slow....”
Wednesday, 7 December 2011
“Dojo is slow....”
Wednesday, 7 December 2011
AMD Support



Wednesday, 7 December 2011
AMD Support
             Toolkits:
                               JQuery 1.7+

                                Dojo 1.7+

                              MooTools 2.0+

Wednesday, 7 December 2011
AMD Support




                                                                      Firebug 1.8+
 http://www.flickr.com/photos/phil-jackson/3624102329/in/photostream

Wednesday, 7 December 2011
AMD Support




                                                              ...also seen in the BBC iPlayer
 http://www.flickr.com/photos/phil-jackson/3624102329/in/photostream

Wednesday, 7 December 2011
Dojo 1.7 - “Nano”




http://www.flickr.com/photos/argonne/4703475086
Wednesday, 7 December 2011
http://www.flickr.com/photos/obiwanjr/5313551313




          Dojo gives you lots of “blocks”
Wednesday, 7 December 2011
The Dojo Toolkit


                             Dojo         Dijit        DojoX




Wednesday, 7 December 2011
The Dojo Toolkit
                             Dojo
                             Core
                                          Dijit        DojoX

                             Base




Wednesday, 7 December 2011
The Dojo Toolkit
                             Dojo
                              Core
                                           Dijit        DojoX

                              Base




                             Base modules are always loaded
Wednesday, 7 December 2011
NodeList.js           array.js
                  connect.js            event.js
                  html.js               lang.js
                  query.js              xhr.js
                  Deferred.js           _loader
                  browser.js            declare.js
                  fx.js                 json.js
                  query-sizzle.js       window.js
                  Color.js

                             ~32KB gzip+minified
Wednesday, 7 December 2011
http://www.flickr.com/photos/obiwanjr/5313551313




                       Do we always need them?
Wednesday, 7 December 2011
http://www.flickr.com/photos/redux/4297873805/
Wednesday, 7 December 2011
“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
Turning on AMD
http://www.flickr.com/photos/reel-dreams/4893003699

Wednesday, 7 December 2011
Non-AMD loader
                             <script src="path/to/dojo.js"></script>




Wednesday, 7 December 2011
Configuration Flag


                     async: {true|false}




Wednesday, 7 December 2011
Enabling AMD loader
                             <script src="path/to/dojo.js"></script>




                                          "async:true"




 <script data-dojo-config="async:true" src="path/to/dojo.js"></script>




Wednesday, 7 December 2011
Enabling AMD loader
            <script>
            	 	 var dojoConfig = {
            	 	 	 async:true
              	 };
            </script>

            <script src="path/to/dojo.js"></script>




Wednesday, 7 December 2011
Writing AMD modules



Wednesday, 7 December 2011
Let’s take an example...



Wednesday, 7 December 2011
dojo.provide("org.test.widget");

       dojo.require("org.test.base");
       dojo.require("dijit._Widget");
       dojo.require("dijit._Templated");
       dojo.require("dojo.cache");

       dojo.declare("org.test.widget",
       [dijit._Widget, dijit._Templated, org.test.base], {
           templateString: dojo.cache("org.test.template", "Widget.html")
       });




Wednesday, 7 December 2011
dojo.provide("org.test.widget");

       dojo.require("org.test.base");
       dojo.require("dijit._Widget");
       dojo.require("dijit._Templated");
       dojo.require("dojo.cache");

       dojo.declare("org.test.widget",
       [dijit._Widget, dijit._Templated, org.test.base], {
           templateString: dojo.cache("org.test.template", "Widget.html")
       });




Wednesday, 7 December 2011
dojo.provide("org.test.widget");

       dojo.require("org.test.base");
       dojo.require("dijit._Widget");
       dojo.require("dijit._Templated");
       dojo.require("dojo.cache");

       dojo.declare("org.test.widget",
       [dijit._Widget, dijit._Templated, org.test.base], {
           templateString: dojo.cache("org.test.template", "Widget.html")
       });




Wednesday, 7 December 2011
dojo.provide("org.test.widget");

       dojo.require("org.test.base");
       dojo.require("dijit._Widget");
       dojo.require("dijit._Templated");
       dojo.require("dojo.cache");

       dojo.declare("org.test.widget",
       [dijit._Widget, dijit._Templated, org.test.base], {
           templateString: dojo.cache("org.test.template", "Widget.html")
       });




Wednesday, 7 December 2011
Let’s convert to AMD...



Wednesday, 7 December 2011
define([
       	 "org/test/base", "dijit/_Widget", "dijit/_Templated",
       	 "dojo/_base/declare", "dojo/text!../template/Widget.html"],
          function (base, _Widget, _Templated, declare, template) {

       	      	     return declare([base, _Widget, _Templated], {
                          templateString: template
                    	
                    });
                }
       );




Wednesday, 7 December 2011
Don’t




http://www.flickr.com/photos/trancemist/361935363/
Wednesday, 7 December 2011
define([
       	 "org/test/base", "dijit/_Widget", "dijit/_Templated",
       	 "dojo/_base/declare", "dojo/text!../template/Widget.html"],
          function (base, _Widget, _Templated, declare, template) {

       	      	     return declare([base, _Widget, _Templated], {
                          templateString: template
                    	
                    });
                }
       );




Wednesday, 7 December 2011
From the AMD API Specification




                 define(id?, dependencies?, factory);




Wednesday, 7 December 2011
From the AMD API Specification




                 define(id?, dependencies?, factory);



                     (Optional) String used as module identifier
                               "org/widget/test"




Wednesday, 7 December 2011
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
define([
       	 "org/test/base", "dijit/_Widget", "dijit/_Templated",
       	 "dojo/_base/declare", "dojo/text!../template/Widget.html"],
          function (base, _Widget, _Templated, declare, template) {

       	      	     return declare([base, _Widget, _Templated], {
                          templateString: template
                    	
                    });
                }
       );




Wednesday, 7 December 2011
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
define([
       	 "org/test/base", "dijit/_Widget", "dijit/_Templated",
       	 "dojo/_base/declare", "dojo/text!../template/Widget.html"],
          function (base, _Widget, _Templated, declare, template) {

       	      	     return declare([base, _Widget, _Templated], {
                          templateString: template
                    	
                    });
                }
       );




Wednesday, 7 December 2011
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
What can we load?

                              Internationalisation bundles
               “dojo/i18n!../nls/messages.json”




Wednesday, 7 December 2011
What can we load?

                                  Text bundles
                 “dojo/text!../tmpl/widget.html”




Wednesday, 7 December 2011
What can we load?

                Third-party plugins for CSS, Coffeescript,
                          LESS, Google Maps...




Wednesday, 7 December 2011
What can we load?

                Third-party plugins for CSS, Coffeescript,
                          LESS, Google Maps...

                               ...or just write your own!




Wednesday, 7 December 2011
define([
       	 "org/test/base", "dijit/_Widget", "dijit/_Templated",
       	 "dojo/_base/declare", "dojo/text!../template/Widget.html"],
          function (base, _Widget, _Templated, declare, template) {

       	      	     return declare([base, _Widget, _Templated], {
                          templateString: template
                    	
                    });
                }
       );




Wednesday, 7 December 2011
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
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
define([
       	 "org/test/base", "dijit/_Widget", "dijit/_Templated",
       	 "dojo/_base/declare", "dojo/text!../template/Widget.html"],
          function (base, _Widget, _Templated, declare, template) {

       	      	     return declare([base, _Widget, _Templated], {
                          templateString: template
                    	
                    });
                }
       );




Wednesday, 7 December 2011
Uses local arguments,
                     no need for globals


Wednesday, 7 December 2011
What about the
                               template?


Wednesday, 7 December 2011
Widget Template
               <div>
                   <label>First name</label>
                   <input dojoAttachPoint="first_name"
                         placeHolder="First name"
                         dojoType="dijit.form.TextBox">

                         <label>Second name</label>
                         <input dojoAttachPoint="second_name"
                               placeHolder="Second name"
                               dojoType="dijit.form.TextBox">

                   <button dojoAttachEvent="onClick:sendName"
                          dojoType="dijit.form.Button">
               </div>


Wednesday, 7 December 2011
Widget Template
               <div>
                   <label>First name</label>
                   <input dojoAttachPoint="first_name"
                         placeHolder="First name"
                         dojoType="dijit.form.TextBox">

                         <label>Second name</label>
                         <input dojoAttachPoint="second_name"
                               placeHolder="Second name"
                               dojoType="dijit.form.TextBox">

                   <button dojoAttachEvent="onClick:sendName"
                          dojoType="dijit.form.Button">
               </div>

                             Non-standard HTML attributes
Wednesday, 7 December 2011
HTML5 Data Attributes



Wednesday, 7 December 2011
HTML5 Data Attributes
           dojoAttachPoint    data-dojo-attach-point

           dojoAttachEvent    data-dojo-attach-event

                   dojoType      data-dojo-type

        custom widget attr       data-dojo-props

                 dojoConfig       data-dojo-config



Wednesday, 7 December 2011
Widget Template
               <div>
                   <label>First name</label>
                   <input data-dojo-attach-point="first_name"
                         data-dojo-props="placeHolder:First Name"
                         data-dojo-type="dijit.form.TextBox">

                         <label>Second name</label>
                         <input data-dojo-attach-point="first_name"
                               data-dojo-props="placeHolder:Second Name"
                               data-dojo-type="dijit.form.TextBox">

                   <button dojo-dojo-attach-point="onClick:sendName"
                          data-dojo-type="dijit.form.Button">
               </div>


Wednesday, 7 December 2011
What if I’m not defining
                      modules?


Wednesday, 7 December 2011
Let’s take an example...



Wednesday, 7 December 2011
<script src="dojo.js" dojoConfig="parseOnLoad: true"></script>

       <script>
       dojo.require("dijit.form.Form");
       dojo.require("dijit.form.TextBox");
       dojo.require("dijit.form.Button");

       dojo.ready({
           dojo.query("input").forEach(function () {...});
           dojo.connect(dojo.byId("send"), "onclick", function (){...});
       });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>



Wednesday, 7 December 2011
<script src="dojo.js" dojoConfig="parseOnLoad: true"></script>

       <script>
       dojo.require("dijit.form.Form");
       dojo.require("dijit.form.TextBox");
       dojo.require("dijit.form.Button");

       dojo.ready({
           dojo.query("input").forEach(function () {...});
           dojo.connect(dojo.byId("send"), "onclick", function (){...});
       });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>



Wednesday, 7 December 2011
<script src="dojo.js" dojoConfig="parseOnLoad: true"></script>

       <script>
       dojo.require("dijit.form.Form");
       dojo.require("dijit.form.TextBox");
       dojo.require("dijit.form.Button");

       dojo.ready({
           dojo.query("input").forEach(function () {...});
           dojo.connect(dojo.byId("send"), "onclick", function (){...});
       });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>



Wednesday, 7 December 2011
<script src="dojo.js" dojoConfig="parseOnLoad: true"></script>

       <script>
       dojo.require("dijit.form.Form");
       dojo.require("dijit.form.TextBox");
       dojo.require("dijit.form.Button");

       dojo.ready({
           dojo.query("input").forEach(function () {...});
           dojo.connect(dojo.byId("send"), "onclick", function (){...});
       });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>



Wednesday, 7 December 2011
<script src="dojo.js" dojoConfig="parseOnLoad: true"></script>

       <script>
       dojo.require("dijit.form.Form");
       dojo.require("dijit.form.TextBox");
       dojo.require("dijit.form.Button");

       dojo.ready({
           dojo.query("input").forEach(function () {...});
           dojo.connect(dojo.byId("send"), "onclick", function (){...});
       });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>



Wednesday, 7 December 2011
Let’s convert to AMD



Wednesday, 7 December 2011
<script src="dojo.js" dojoConfig="async: true, parseOnLoad: true">
       </script>

       <script>
       require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready",
       	 	      "dojo/parser", "dijit/form/Form", "dijit/form/TextBox",
       	 	      "dijit/form/Button"],

           function (query, on, dom, ready) {
               ready(function () {
                   query("input").forEach(function () {...});
                   on(dom.byId("send"), "click", function (){...});
               });
           });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>

Wednesday, 7 December 2011
<script src="dojo.js" dojoConfig="async: true, parseOnLoad: true">
       </script>

       <script>
       require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready",
       	 	      "dojo/parser", "dijit/form/Form", "dijit/form/TextBox",
       	 	      "dijit/form/Button"],

           function (query, on, dom, ready) {
               ready(function () {
                   query("input").forEach(function () {...});
                   on(dom.byId("send"), "click", function (){...});
               });
           });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>

Wednesday, 7 December 2011
<script src="dojo.js" dojoConfig="async: true, parseOnLoad: true">
       </script>

       <script>
       require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready",
       	 	      "dojo/parser", "dijit/form/Form", "dijit/form/TextBox",
       	 	      "dijit/form/Button"],

           function (query, on, dom, ready) {
               ready(function () {
                   query("input").forEach(function () {...});
                   on(dom.byId("send"), "click", function (){...});
               });
           });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>

Wednesday, 7 December 2011
NOT in the AMD API Specification




                      require(dependencies?, callback);




Wednesday, 7 December 2011
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
<script src="dojo.js" dojoConfig="async: true, parseOnLoad: true">
       </script>

       <script>
       require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready",
       	 	      "dojo/parser", "dijit/form/Form", "dijit/form/TextBox",
       	 	      "dijit/form/Button"],

           function (query, on, dom, ready) {
               ready(function () {
                   query("input").forEach(function () {...});
                   on(dom.byId("send"), "click", function (){...});
               });
           });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>

Wednesday, 7 December 2011
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
<script src="dojo.js" dojoConfig="async: true, parseOnLoad: true">
       </script>

       <script>
       require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready",
       	 	      "dojo/parser", "dijit/form/Form", "dijit/form/TextBox",
       	 	      "dijit/form/Button"],

           function (query, on, dom, ready) {
               ready(function () {
                   query("input").forEach(function () {...});
                   on(dom.byId("send"), "click", function (){...});
               });
           });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>

Wednesday, 7 December 2011
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
<script src="dojo.js" dojoConfig="async: true, parseOnLoad: true">
       </script>

       <script>
       require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready",
       	 	      "dojo/parser", "dijit/form/Form", "dijit/form/TextBox",
       	 	      "dijit/form/Button"],

           function (query, on, dom, ready) {
               ready(function () {
                   query("input").forEach(function () {...});
                   on(dom.byId("send"), "click", function (){...});
               });
           });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>

Wednesday, 7 December 2011
No global references...



Wednesday, 7 December 2011
<script src="dojo.js" dojoConfig="async: true, parseOnLoad: true">
       </script>

       <script>
       require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready",
       	 	      "dojo/parser", "dijit/form/Form", "dijit/form/TextBox",
       	 	      "dijit/form/Button"],

           function (query, on, dom, ready) {
               ready(function () {
                   query("input").forEach(function () {...});
                   on(dom.byId("send"), "click", function (){...});
               });
           });
       </script>

       <form dojoType="dijit.form.Form">
           <label>First Name:</label>
           <input dojoType="dijit.form.TextBox">
           ...
           <button dojoType="dijit.form.Button">
       </form>

Wednesday, 7 December 2011
...only load modules we
                       actually use


Wednesday, 7 December 2011
What about the new stuff?




http://www.flickr.com/photos/fcrippa/3401571934
Wednesday, 7 December 2011
Dojo Mobile




 http://www.flickr.com/photos/dominiksyka-photography/4334590250
Wednesday, 7 December 2011
Dojo Mobile




                             Lightweight set of Mobile UI widgets
Wednesday, 7 December 2011
Dojo Mobile




                       Blackberry        iPhone      Android



              Device-specific or device-neutral themes available
Wednesday, 7 December 2011
Dojo Mobile Showcase




Wednesday, 7 December 2011
dGrid: Next
                  Generation Dojo Grid




Wednesday, 7 December 2011
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
Wednesday, 7 December 2011
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
Before getting started...



Wednesday, 7 December 2011
Wednesday, 7 December 2011
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

Mais conteúdo relacionado

Mais procurados

How dojo works
How dojo worksHow dojo works
How dojo worksAmit Tyagi
 
Angularjs vs Dojo toolkit | SuperSpeaker@CodeCamp Iasi 2014
Angularjs vs Dojo toolkit | SuperSpeaker@CodeCamp Iasi 2014Angularjs vs Dojo toolkit | SuperSpeaker@CodeCamp Iasi 2014
Angularjs vs Dojo toolkit | SuperSpeaker@CodeCamp Iasi 2014Endava
 
Building Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsBuilding Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsAndrew Ferrier
 
Rich internet application development using the dojo toolkit
Rich internet application development using the dojo toolkitRich internet application development using the dojo toolkit
Rich internet application development using the dojo toolkitalexklaeser
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the CloudJames Thomas
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQueryAnil Kumar
 
jQuery Tips Tricks Trivia
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks TriviaCognizant
 
XPages Binary Output
XPages Binary OutputXPages Binary Output
XPages Binary OutputJohnFoldager
 
jQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and BlingjQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and BlingDoug Neiner
 
Dojo: Beautiful Web Apps, Fast
Dojo: Beautiful Web Apps, FastDojo: Beautiful Web Apps, Fast
Dojo: Beautiful Web Apps, FastGabriel Hamilton
 
Contextual jQuery
Contextual jQueryContextual jQuery
Contextual jQueryDoug Neiner
 
Understanding Webkit Rendering
Understanding Webkit RenderingUnderstanding Webkit Rendering
Understanding Webkit RenderingAriya Hidayat
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOMDaiwei Lu
 
Unobtrusive javascript with jQuery
Unobtrusive javascript with jQueryUnobtrusive javascript with jQuery
Unobtrusive javascript with jQueryAngel Ruiz
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterpriseDave Artz
 
Reactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSReactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSMartin Hochel
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoiddmethvin
 

Mais procurados (20)

Dojo toolkit
Dojo toolkitDojo toolkit
Dojo toolkit
 
How dojo works
How dojo worksHow dojo works
How dojo works
 
Angularjs vs Dojo toolkit | SuperSpeaker@CodeCamp Iasi 2014
Angularjs vs Dojo toolkit | SuperSpeaker@CodeCamp Iasi 2014Angularjs vs Dojo toolkit | SuperSpeaker@CodeCamp Iasi 2014
Angularjs vs Dojo toolkit | SuperSpeaker@CodeCamp Iasi 2014
 
Building Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsBuilding Real-World Dojo Web Applications
Building Real-World Dojo Web Applications
 
Rich internet application development using the dojo toolkit
Rich internet application development using the dojo toolkitRich internet application development using the dojo toolkit
Rich internet application development using the dojo toolkit
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the Cloud
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
 
jQuery Tips Tricks Trivia
jQuery Tips Tricks TriviajQuery Tips Tricks Trivia
jQuery Tips Tricks Trivia
 
The jQuery Library
The  jQuery LibraryThe  jQuery Library
The jQuery Library
 
XPages Binary Output
XPages Binary OutputXPages Binary Output
XPages Binary Output
 
jQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and BlingjQuery: Nuts, Bolts and Bling
jQuery: Nuts, Bolts and Bling
 
Dojo: Beautiful Web Apps, Fast
Dojo: Beautiful Web Apps, FastDojo: Beautiful Web Apps, Fast
Dojo: Beautiful Web Apps, Fast
 
dojo.Patterns
dojo.Patternsdojo.Patterns
dojo.Patterns
 
Contextual jQuery
Contextual jQueryContextual jQuery
Contextual jQuery
 
Understanding Webkit Rendering
Understanding Webkit RenderingUnderstanding Webkit Rendering
Understanding Webkit Rendering
 
Why and How to Use Virtual DOM
Why and How to Use Virtual DOMWhy and How to Use Virtual DOM
Why and How to Use Virtual DOM
 
Unobtrusive javascript with jQuery
Unobtrusive javascript with jQueryUnobtrusive javascript with jQuery
Unobtrusive javascript with jQuery
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
Reactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJSReactive Type safe Webcomponents with skateJS
Reactive Type safe Webcomponents with skateJS
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
 

Semelhante a Moving to Dojo 1.7 and the path to 2.0

Custom Android Code Templates
Custom Android Code TemplatesCustom Android Code Templates
Custom Android Code Templatesmurphonic
 
So, you think you know widgets.
So, you think you know widgets.So, you think you know widgets.
So, you think you know widgets.danielericlee
 
MongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema DesignMongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema DesignDATAVERSITY
 
Behat dpc12
Behat dpc12Behat dpc12
Behat dpc12benwaine
 
Flowdock's full-text search with MongoDB
Flowdock's full-text search with MongoDBFlowdock's full-text search with MongoDB
Flowdock's full-text search with MongoDBFlowdock
 
Frozen Rails Slides
Frozen Rails SlidesFrozen Rails Slides
Frozen Rails Slidescarllerche
 
Dojo: Getting Started Today
Dojo: Getting Started TodayDojo: Getting Started Today
Dojo: Getting Started TodayGabriel Hamilton
 
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPA
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPAIntegrate Spring MVC with RequireJS & Backbone.js & Spring Data JPA
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPACheng Ta Yeh
 
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneJavascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneDeepu S Nath
 
Deploying on the cutting edge
Deploying on the cutting edgeDeploying on the cutting edge
Deploying on the cutting edgeericholscher
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDBYnon Perek
 
Organized web app development using backbone.js
Organized web app development using backbone.jsOrganized web app development using backbone.js
Organized web app development using backbone.jsShakti Shrestha
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks ComparisonDeepu S Nath
 
Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Leonardo Borges
 
A Look at the Future of HTML5
A Look at the Future of HTML5A Look at the Future of HTML5
A Look at the Future of HTML5Tim Wright
 

Semelhante a Moving to Dojo 1.7 and the path to 2.0 (20)

Node at artsy
Node at artsyNode at artsy
Node at artsy
 
Custom Android Code Templates
Custom Android Code TemplatesCustom Android Code Templates
Custom Android Code Templates
 
So, you think you know widgets.
So, you think you know widgets.So, you think you know widgets.
So, you think you know widgets.
 
MongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema DesignMongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema Design
 
Test02
Test02Test02
Test02
 
Behat dpc12
Behat dpc12Behat dpc12
Behat dpc12
 
Flowdock's full-text search with MongoDB
Flowdock's full-text search with MongoDBFlowdock's full-text search with MongoDB
Flowdock's full-text search with MongoDB
 
Everyday - mongodb
Everyday - mongodbEveryday - mongodb
Everyday - mongodb
 
Frozen Rails Slides
Frozen Rails SlidesFrozen Rails Slides
Frozen Rails Slides
 
Dojo: Getting Started Today
Dojo: Getting Started TodayDojo: Getting Started Today
Dojo: Getting Started Today
 
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPA
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPAIntegrate Spring MVC with RequireJS & Backbone.js & Spring Data JPA
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPA
 
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneJavascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
 
Deploying on the cutting edge
Deploying on the cutting edgeDeploying on the cutting edge
Deploying on the cutting edge
 
HTML5 and Sencha Touch
HTML5 and Sencha TouchHTML5 and Sencha Touch
HTML5 and Sencha Touch
 
Pocket Knife JS
Pocket Knife JSPocket Knife JS
Pocket Knife JS
 
Introduction To MongoDB
Introduction To MongoDBIntroduction To MongoDB
Introduction To MongoDB
 
Organized web app development using backbone.js
Organized web app development using backbone.jsOrganized web app development using backbone.js
Organized web app development using backbone.js
 
Javascript Frameworks Comparison
Javascript Frameworks ComparisonJavascript Frameworks Comparison
Javascript Frameworks Comparison
 
Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011) Clouds against the Floods (RubyConfBR2011)
Clouds against the Floods (RubyConfBR2011)
 
A Look at the Future of HTML5
A Look at the Future of HTML5A Look at the Future of HTML5
A Look at the Future of HTML5
 

Último

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Último (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Moving to Dojo 1.7 and the path to 2.0

  • 1. Moving to Dojo 1.7 ...and the path to 2.0 http://www.flickr.com/photos/jenik/4836118314/ Wednesday, 7 December 2011
  • 2. Me. @thomasj Wednesday, 7 December 2011
  • 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
  • 9. API compatibility until 2.0* * - There may be some exceptions Wednesday, 7 December 2011
  • 10. What’s AMD? 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
  • 12. What’s new about that? 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
  • 16. AMD Support Wednesday, 7 December 2011
  • 17. AMD Support Toolkits: JQuery 1.7+ Dojo 1.7+ MooTools 2.0+ Wednesday, 7 December 2011
  • 18. AMD Support Firebug 1.8+ http://www.flickr.com/photos/phil-jackson/3624102329/in/photostream Wednesday, 7 December 2011
  • 19. AMD Support ...also seen in the BBC iPlayer http://www.flickr.com/photos/phil-jackson/3624102329/in/photostream Wednesday, 7 December 2011
  • 20. Dojo 1.7 - “Nano” http://www.flickr.com/photos/argonne/4703475086 Wednesday, 7 December 2011
  • 21. http://www.flickr.com/photos/obiwanjr/5313551313 Dojo gives you lots of “blocks” Wednesday, 7 December 2011
  • 22. The Dojo Toolkit Dojo Dijit DojoX Wednesday, 7 December 2011
  • 23. The Dojo Toolkit Dojo Core Dijit DojoX Base Wednesday, 7 December 2011
  • 24. The Dojo Toolkit Dojo Core Dijit DojoX Base Base modules are always loaded Wednesday, 7 December 2011
  • 25. NodeList.js array.js connect.js event.js html.js lang.js query.js xhr.js Deferred.js _loader browser.js declare.js fx.js json.js query-sizzle.js window.js Color.js ~32KB gzip+minified Wednesday, 7 December 2011
  • 26. http://www.flickr.com/photos/obiwanjr/5313551313 Do we always need them? 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
  • 30. Non-AMD loader <script src="path/to/dojo.js"></script> Wednesday, 7 December 2011
  • 31. Configuration Flag async: {true|false} Wednesday, 7 December 2011
  • 32. Enabling AMD loader <script src="path/to/dojo.js"></script> "async:true" <script data-dojo-config="async:true" src="path/to/dojo.js"></script> Wednesday, 7 December 2011
  • 33. Enabling AMD loader <script> var dojoConfig = { async:true }; </script> <script src="path/to/dojo.js"></script> Wednesday, 7 December 2011
  • 35. Let’s take an example... Wednesday, 7 December 2011
  • 36. dojo.provide("org.test.widget"); dojo.require("org.test.base"); dojo.require("dijit._Widget"); dojo.require("dijit._Templated"); dojo.require("dojo.cache"); dojo.declare("org.test.widget", [dijit._Widget, dijit._Templated, org.test.base], { templateString: dojo.cache("org.test.template", "Widget.html") }); Wednesday, 7 December 2011
  • 37. dojo.provide("org.test.widget"); dojo.require("org.test.base"); dojo.require("dijit._Widget"); dojo.require("dijit._Templated"); dojo.require("dojo.cache"); dojo.declare("org.test.widget", [dijit._Widget, dijit._Templated, org.test.base], { templateString: dojo.cache("org.test.template", "Widget.html") }); Wednesday, 7 December 2011
  • 38. dojo.provide("org.test.widget"); dojo.require("org.test.base"); dojo.require("dijit._Widget"); dojo.require("dijit._Templated"); dojo.require("dojo.cache"); dojo.declare("org.test.widget", [dijit._Widget, dijit._Templated, org.test.base], { templateString: dojo.cache("org.test.template", "Widget.html") }); Wednesday, 7 December 2011
  • 39. dojo.provide("org.test.widget"); dojo.require("org.test.base"); dojo.require("dijit._Widget"); dojo.require("dijit._Templated"); dojo.require("dojo.cache"); dojo.declare("org.test.widget", [dijit._Widget, dijit._Templated, org.test.base], { templateString: dojo.cache("org.test.template", "Widget.html") }); Wednesday, 7 December 2011
  • 40. Let’s convert to AMD... Wednesday, 7 December 2011
  • 41. define([ "org/test/base", "dijit/_Widget", "dijit/_Templated", "dojo/_base/declare", "dojo/text!../template/Widget.html"], function (base, _Widget, _Templated, declare, template) { return declare([base, _Widget, _Templated], { templateString: template }); } ); Wednesday, 7 December 2011
  • 43. define([ "org/test/base", "dijit/_Widget", "dijit/_Templated", "dojo/_base/declare", "dojo/text!../template/Widget.html"], function (base, _Widget, _Templated, declare, template) { return declare([base, _Widget, _Templated], { templateString: template }); } ); 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
  • 47. define([ "org/test/base", "dijit/_Widget", "dijit/_Templated", "dojo/_base/declare", "dojo/text!../template/Widget.html"], function (base, _Widget, _Templated, declare, template) { return declare([base, _Widget, _Templated], { templateString: template }); } ); 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
  • 49. define([ "org/test/base", "dijit/_Widget", "dijit/_Templated", "dojo/_base/declare", "dojo/text!../template/Widget.html"], function (base, _Widget, _Templated, declare, template) { return declare([base, _Widget, _Templated], { templateString: template }); } ); 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
  • 55. define([ "org/test/base", "dijit/_Widget", "dijit/_Templated", "dojo/_base/declare", "dojo/text!../template/Widget.html"], function (base, _Widget, _Templated, declare, template) { return declare([base, _Widget, _Templated], { templateString: template }); } ); 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
  • 58. define([ "org/test/base", "dijit/_Widget", "dijit/_Templated", "dojo/_base/declare", "dojo/text!../template/Widget.html"], function (base, _Widget, _Templated, declare, template) { return declare([base, _Widget, _Templated], { templateString: template }); } ); Wednesday, 7 December 2011
  • 59. Uses local arguments, no need for globals Wednesday, 7 December 2011
  • 60. What about the template? Wednesday, 7 December 2011
  • 61. Widget Template <div> <label>First name</label> <input dojoAttachPoint="first_name" placeHolder="First name" dojoType="dijit.form.TextBox"> <label>Second name</label> <input dojoAttachPoint="second_name" placeHolder="Second name" dojoType="dijit.form.TextBox"> <button dojoAttachEvent="onClick:sendName" dojoType="dijit.form.Button"> </div> Wednesday, 7 December 2011
  • 62. Widget Template <div> <label>First name</label> <input dojoAttachPoint="first_name" placeHolder="First name" dojoType="dijit.form.TextBox"> <label>Second name</label> <input dojoAttachPoint="second_name" placeHolder="Second name" dojoType="dijit.form.TextBox"> <button dojoAttachEvent="onClick:sendName" dojoType="dijit.form.Button"> </div> Non-standard HTML attributes Wednesday, 7 December 2011
  • 64. HTML5 Data Attributes dojoAttachPoint data-dojo-attach-point dojoAttachEvent data-dojo-attach-event dojoType data-dojo-type custom widget attr data-dojo-props dojoConfig data-dojo-config Wednesday, 7 December 2011
  • 65. Widget Template <div> <label>First name</label> <input data-dojo-attach-point="first_name" data-dojo-props="placeHolder:First Name" data-dojo-type="dijit.form.TextBox"> <label>Second name</label> <input data-dojo-attach-point="first_name" data-dojo-props="placeHolder:Second Name" data-dojo-type="dijit.form.TextBox"> <button dojo-dojo-attach-point="onClick:sendName" data-dojo-type="dijit.form.Button"> </div> Wednesday, 7 December 2011
  • 66. What if I’m not defining modules? Wednesday, 7 December 2011
  • 67. Let’s take an example... Wednesday, 7 December 2011
  • 68. <script src="dojo.js" dojoConfig="parseOnLoad: true"></script> <script> dojo.require("dijit.form.Form"); dojo.require("dijit.form.TextBox"); dojo.require("dijit.form.Button"); dojo.ready({ dojo.query("input").forEach(function () {...}); dojo.connect(dojo.byId("send"), "onclick", function (){...}); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> Wednesday, 7 December 2011
  • 69. <script src="dojo.js" dojoConfig="parseOnLoad: true"></script> <script> dojo.require("dijit.form.Form"); dojo.require("dijit.form.TextBox"); dojo.require("dijit.form.Button"); dojo.ready({ dojo.query("input").forEach(function () {...}); dojo.connect(dojo.byId("send"), "onclick", function (){...}); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> Wednesday, 7 December 2011
  • 70. <script src="dojo.js" dojoConfig="parseOnLoad: true"></script> <script> dojo.require("dijit.form.Form"); dojo.require("dijit.form.TextBox"); dojo.require("dijit.form.Button"); dojo.ready({ dojo.query("input").forEach(function () {...}); dojo.connect(dojo.byId("send"), "onclick", function (){...}); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> Wednesday, 7 December 2011
  • 71. <script src="dojo.js" dojoConfig="parseOnLoad: true"></script> <script> dojo.require("dijit.form.Form"); dojo.require("dijit.form.TextBox"); dojo.require("dijit.form.Button"); dojo.ready({ dojo.query("input").forEach(function () {...}); dojo.connect(dojo.byId("send"), "onclick", function (){...}); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> Wednesday, 7 December 2011
  • 72. <script src="dojo.js" dojoConfig="parseOnLoad: true"></script> <script> dojo.require("dijit.form.Form"); dojo.require("dijit.form.TextBox"); dojo.require("dijit.form.Button"); dojo.ready({ dojo.query("input").forEach(function () {...}); dojo.connect(dojo.byId("send"), "onclick", function (){...}); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> Wednesday, 7 December 2011
  • 73. Let’s convert to AMD Wednesday, 7 December 2011
  • 74. <script src="dojo.js" dojoConfig="async: true, parseOnLoad: true"> </script> <script> require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready", "dojo/parser", "dijit/form/Form", "dijit/form/TextBox", "dijit/form/Button"], function (query, on, dom, ready) { ready(function () { query("input").forEach(function () {...}); on(dom.byId("send"), "click", function (){...}); }); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> Wednesday, 7 December 2011
  • 75. <script src="dojo.js" dojoConfig="async: true, parseOnLoad: true"> </script> <script> require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready", "dojo/parser", "dijit/form/Form", "dijit/form/TextBox", "dijit/form/Button"], function (query, on, dom, ready) { ready(function () { query("input").forEach(function () {...}); on(dom.byId("send"), "click", function (){...}); }); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> Wednesday, 7 December 2011
  • 76. <script src="dojo.js" dojoConfig="async: true, parseOnLoad: true"> </script> <script> require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready", "dojo/parser", "dijit/form/Form", "dijit/form/TextBox", "dijit/form/Button"], function (query, on, dom, ready) { ready(function () { query("input").forEach(function () {...}); on(dom.byId("send"), "click", function (){...}); }); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> 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
  • 79. <script src="dojo.js" dojoConfig="async: true, parseOnLoad: true"> </script> <script> require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready", "dojo/parser", "dijit/form/Form", "dijit/form/TextBox", "dijit/form/Button"], function (query, on, dom, ready) { ready(function () { query("input").forEach(function () {...}); on(dom.byId("send"), "click", function (){...}); }); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> 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
  • 81. <script src="dojo.js" dojoConfig="async: true, parseOnLoad: true"> </script> <script> require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready", "dojo/parser", "dijit/form/Form", "dijit/form/TextBox", "dijit/form/Button"], function (query, on, dom, ready) { ready(function () { query("input").forEach(function () {...}); on(dom.byId("send"), "click", function (){...}); }); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> 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
  • 83. <script src="dojo.js" dojoConfig="async: true, parseOnLoad: true"> </script> <script> require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready", "dojo/parser", "dijit/form/Form", "dijit/form/TextBox", "dijit/form/Button"], function (query, on, dom, ready) { ready(function () { query("input").forEach(function () {...}); on(dom.byId("send"), "click", function (){...}); }); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> Wednesday, 7 December 2011
  • 85. <script src="dojo.js" dojoConfig="async: true, parseOnLoad: true"> </script> <script> require(["dojo/query", "dojo/on", "dojo/dom", "dojo/ready", "dojo/parser", "dijit/form/Form", "dijit/form/TextBox", "dijit/form/Button"], function (query, on, dom, ready) { ready(function () { query("input").forEach(function () {...}); on(dom.byId("send"), "click", function (){...}); }); }); </script> <form dojoType="dijit.form.Form"> <label>First Name:</label> <input dojoType="dijit.form.TextBox"> ... <button dojoType="dijit.form.Button"> </form> Wednesday, 7 December 2011
  • 86. ...only load modules we actually use Wednesday, 7 December 2011
  • 87. What about the new stuff? http://www.flickr.com/photos/fcrippa/3401571934 Wednesday, 7 December 2011
  • 89. Dojo Mobile Lightweight set of Mobile UI widgets Wednesday, 7 December 2011
  • 90. Dojo Mobile Blackberry iPhone Android Device-specific or device-neutral themes available 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