SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
dojo is bizarro jQuery
                                    john hann
                                  @unscriptable
                                 lifeIMAGE, Inc.



Thursday, August 26, 2010
“bizarro” video tutorial




Thursday, August 26, 2010
video lessons learned


                              what does “bizarro” mean?

                   what can we learn about “bizarro” from
                                 the video?

                                    (discussion)



Thursday, August 26, 2010
video lessons learned




Thursday, August 26, 2010
video lessons learned
              what makes something bizarro:
              • it’s similar at first glance but...
              • nearly opposite once you learn more




Thursday, August 26, 2010
video lessons learned
              what makes something bizarro:
              • it’s similar at first glance but...
              • nearly opposite once you learn more
              lessons learned:
              • “opposite” is ambiguous
              • neither is undeniably better / perfect
              • can’t co-exist (really?)
              • not all behavior is appropriate to both


Thursday, August 26, 2010
similar at first glance...
                              height

                               hair

                               style

                              order




Thursday, August 26, 2010
but not quite the same...




                Kevin Gene Feldman    Jerry George Kramer

                     neat & pressed        relaxed

                            plaid           spots

Thursday, August 26, 2010
...and quite nearly
                                   opposite!




                             friendly         aloof

                             generous        stingy

                            unforgiving     accepting

Thursday, August 26, 2010
similar at first glance...
                             selector engine

                            dom abstractions

                            dom manipulation

                               animations




Thursday, August 26, 2010
Dojo:Zoomer
                            (jQuery-ish app done in dojo)
            http://demos.dojotoolkit.org/demos/cropper/




Thursday, August 26, 2010
dijit.form
                            (progressive enhancement demo)




                                 image: http://modernmechanics.com/

Thursday, August 26, 2010
but not quite the same...




                        $(‘*’)    dojo.query(‘*’)
                  $.fn.css()       dojo.style()
                  $(‘<div>’)     dojo.create(‘div’)
          $.fn.animate()          dojo.animate()
       3rd-party plugins           ±100 “dijits”

Thursday, August 26, 2010
plugd
              “loosely based on my favorite bits of jQuery”
                                   -- Peter Higgins (@phiggins)
              http://github.com/phiggins42/plugd




Thursday, August 26, 2010
plugd
                     .wrap()
                     .show(), .hide(), .toggle()
                     .append(), .appendTo()
                     .create()
                     .grab()
                     .size()
                     .animate()
                     .destroy()
                     .selectable()
                     .hover(), .hoverClass()
                     .end()


Thursday, August 26, 2010
plugd
              $("div.baz")
                .appendTo("body")
                .addClass("bar")
                .onclick(function(e){ /* … */ })
              ;

              $("<a href='foo.html'>bar</a>")
                .appendTo("body")
                .addClass("baz")
                .onclick(function(e){ /* … */ })
              ;


Thursday, August 26, 2010
but don’t be fooled...
                            the similarity ends here.




Thursday, August 26, 2010
but don’t be fooled...
                            the similarity ends here.
                            the bizarro dojo universe!
                                 prepare to enter



Thursday, August 26, 2010
up is down
              unlike the comfy world of jQuery, in the
              bizarro world of dojo…




Thursday, August 26, 2010
up is down
              unlike the comfy world of jQuery, in the
              bizarro world of dojo…

              dijits inject tiny bits of html into the dom
              servers spew javascript & json, not html
              “progressive enhancement” is a dirty word
              seo and html validation are shunned


Thursday, August 26, 2010
up is down
              unlike the comfy world of jQuery, in the
              bizarro world of dojo…


          wut? are we
              dijits inject tiny bits of html into the dom
              servers spew javascript & json, not html


          whack?!?!
              “progressive enhancement” is a dirty word
              seo and html validation are shunned


Thursday, August 26, 2010
up is down
              nah... ‘cuz now we’ve got super powers!




                            image: http://www.supermanhomepage.com/

Thursday, August 26, 2010
up is down
              nah... ‘cuz now we’ve got super powers!

              modular widgets

              centralized ui logic

              html5 offline-ready*

              ipad & google-pad “native” html5 apps**
              * sheesh! you gotta do some of the work yourself, slacker!
              ** requires PhoneGap or equivalent

                            image: http://www.supermanhomepage.com/

Thursday, August 26, 2010
up is down
              progressive enhancement? pffffftt!
              that’s for lame-o blogs
              and marketing sites!
              no javascript?
              no admittance!
              ie mobile and wap phones can
              find another bizarro world
              where web 1.0 is still king!



                                             image: http://hildygottlieb.com/

Thursday, August 26, 2010
up is down
              screw validation!
              it adds no value* since
              dijit’s html snippets are
              already easy to grok
              and debug:
              •tiny & modular,
              •unit-testable
              * ok ok already! “resistance is futile”. we get it. we also get that validation
              helps future-proof your html. dojo 1.6 will be valid html5.

                               image: http://www.themindrobber.co.uk/

Thursday, August 26, 2010
down is up
              on the bizarro dojo seas...
              one script tag will
              conjure a salvo of .js
              downloads




                                       image: http://davelandweb.com/

Thursday, August 26, 2010
down is up
              on the bizarro dojo seas...
              one script tag will
              conjure a salvo of .js
              downloads
              or not.




                                       image: http://davelandweb.com/

Thursday, August 26, 2010
down is up
              on the bizarro dojo seas...
              one script tag will
              conjure a salvo of .js
              downloads
              or not.
              ‘cuz a dojo pirate shoots
              whatever size .js
              slugs he wishes!
                                          image: http://davelandweb.com/

Thursday, August 26, 2010
down is up
              dojo.require() imports dependencies

              dojo’s build system packages javascript
              and html

                             my.HawtCalndr                     dojo.date
                            dojo.require(‘dojo.date’);   dojo.provide(‘dojo.date’);




Thursday, August 26, 2010
down is up
                                  (show me the codez!)
                            (dojo.require() and dojo.provide())




                                    image: http://makezine.com/

Thursday, August 26, 2010
“hello” when he leaves

              dojo pirates can say
              anything they want –
              and in any language –
              and not get confused




                            image: http://www.savagechickens.com/

Thursday, August 26, 2010
“hello” when he leaves
              dijit’s html snippets are tokenized and
              are locale-aware
              <div class=“my-hawt-widget”>
              ! <button>${buttonLabel}</button>
              </div>

              dojo.requireLocalization();
              this.buttonLabel = dojo.i18n.getLocalization(
              ! ‘my.HawtWidget’, ‘strings’)[‘buttonLabel’];



Thursday, August 26, 2010
“hello” when he leaves
                                  (more coadz!)
                      (templates, tokens, and i18n. oh my!)




                             image: http://modernmechanix.com/
Thursday, August 26, 2010
“good bye” when he arrives
              dojo’s bizarro components are loose and
              ignorant of their own parents!


              but this is a good
              thing! you want
              your “babies” to be
              independent!



Thursday, August 26, 2010
“good bye” when he arrives
              dojo.connect() allows loose coupling
              dojo.publish() and dojo.subscribe()
              provide global app events

                     my.HawtWidget                my.HawtCalndr
              dojo.subscribe(‘timezone_chg’,   onChangeTz: function (e) {
                 function (tz, bool) {         dojo.publish(‘timezone_chg’,
                   /* do something! */         !   [‘PDT’, true]);
                 }                             }
              );




Thursday, August 26, 2010
“good bye” when he arrives
                                 (back to the javascript!)
                            (dojo.connect(), dojo.publish(), and
                                     dojo.subscribe())




                                    image: http://thedawgpound.com/
Thursday, August 26, 2010
and now for
              something completely
                               bizarro
                                 cujo.js
                            web app platform




Thursday, August 26, 2010
what is cujo.js?
              web app platform:

              •MVC-based framework
              •CSS-centric, object-oriented
              •based on dojo & dijit
              •templates, guidance, examples, training



Thursday, August 26, 2010
why is cujo.js bizarro?
              data flows magically between nodes & server
              template languages disappear
              (and so does the id attribute!)


              views invoke the holey web trinity, instilling
              powers to lesser browsers
              ancient browsers grok css2.1 and css3*
              *dude! not all of css3! I’ve got a life ya know.




Thursday, August 26, 2010
data flows magically
              dojo data stores are hawt!
                                            json-rest
              data stores are data models   couchdb
                                              flickr
              most handle client-server       google
              communication so you don’t        csv
              data binding provides the        xml
              “last mile”                      atom
                                               etc...
              the end result: “live” data

Thursday, August 26, 2010
template languages
                                disappear
              why do we even need a {{template language}}?
              html5 data-* attrs ftw!

              inheritance: data-cujo-override

              loops: data-cujo-iter

              conditionals: data-cujo-if
              “oohtml”, anyone?


                                           image: http://thedawgpound.com/

Thursday, August 26, 2010
views invoke the
                            holey web trinity
              oojs + oohtml + oocss => cujo.mvc.View
              complete module, yet still overridable
              my/HawtWidget.js:
              dojo.provide(‘my.HawtWidget’);
              cujo.requireCss(‘my.HawtWidget’);
              cujo.requireHtml(‘my.HawtWidget’);
              ...


Thursday, August 26, 2010
ancient browsers grok
                         css2.1 and css3
              once you take control of the stylesheets,
              the sky is the limit!
              ever wish this worked in IE6?
              ! .myWidget.selected {}
              or this?
              ! .myMenu > .myMenuItem[href=”#”] {}
              or this?
              ! transition: left 0.5s bounce 0.25s;

Thursday, August 26, 2010
ancient browsers grok
                         css2.1 and css3
              once you take control of the stylesheets,
              the sky is the limit!
              ever wish this worked in IE6?
              ! .myWidget.selected {}
              or this?
              ! .myMenu > .myMenuItem[href=”#”] {}
              or this?
              ! transition: left 0.5s bounce 0.25s;

Thursday, August 26, 2010
cujo.js in action
                              (demo and codez!)




Thursday, August 26, 2010
even more bizarro
              all things dojo:
              http://dojotoolkit.org/
              http://twitter.com/dojo
              #dojo channel on freenode
              keep up to date with cujo.js:
              http://cujojs.com/
              http://twitter.com/cujojs
              http://twitter.com/unscriptable (me)
                             image: http://modernmechanics.com/

Thursday, August 26, 2010

Contenu connexe

Tendances

Groovy Introduction at Javaforum 2010
Groovy Introduction at Javaforum 2010Groovy Introduction at Javaforum 2010
Groovy Introduction at Javaforum 2010Leonard Axelsson
 
Getting Started with Dojo Toolkit
Getting Started with Dojo ToolkitGetting Started with Dojo Toolkit
Getting Started with Dojo ToolkitThomas Koch
 
Clojure Reducers / clj-syd Aug 2012
Clojure Reducers / clj-syd Aug 2012Clojure Reducers / clj-syd Aug 2012
Clojure Reducers / clj-syd Aug 2012Leonardo Borges
 
HTML5 Apps - Cross platform
HTML5 Apps - Cross platformHTML5 Apps - Cross platform
HTML5 Apps - Cross platformwolframkriesing
 
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
 

Tendances (6)

Groovy Introduction at Javaforum 2010
Groovy Introduction at Javaforum 2010Groovy Introduction at Javaforum 2010
Groovy Introduction at Javaforum 2010
 
issue1
issue1issue1
issue1
 
Getting Started with Dojo Toolkit
Getting Started with Dojo ToolkitGetting Started with Dojo Toolkit
Getting Started with Dojo Toolkit
 
Clojure Reducers / clj-syd Aug 2012
Clojure Reducers / clj-syd Aug 2012Clojure Reducers / clj-syd Aug 2012
Clojure Reducers / clj-syd Aug 2012
 
HTML5 Apps - Cross platform
HTML5 Apps - Cross platformHTML5 Apps - Cross platform
HTML5 Apps - Cross platform
 
So, you think you know widgets.
So, you think you know widgets.So, you think you know widgets.
So, you think you know widgets.
 

En vedette

Corporate Real Estate at the Crossroads - Cost vs. Value: Australian CRE tren...
Corporate Real Estate at the Crossroads - Cost vs. Value: Australian CRE tren...Corporate Real Estate at the Crossroads - Cost vs. Value: Australian CRE tren...
Corporate Real Estate at the Crossroads - Cost vs. Value: Australian CRE tren...JLL
 
U.S. Lodging Sector 2014 Wellness Check
U.S. Lodging Sector 2014 Wellness CheckU.S. Lodging Sector 2014 Wellness Check
U.S. Lodging Sector 2014 Wellness CheckJLL
 
JLL’s Mid-Year Skyline Update: A Closer Look at OH, MI & PA
JLL’s Mid-Year Skyline Update: A Closer Look at OH, MI & PAJLL’s Mid-Year Skyline Update: A Closer Look at OH, MI & PA
JLL’s Mid-Year Skyline Update: A Closer Look at OH, MI & PAJLL
 
Risks Ahead: Global Corporate Real Estate Trends 2013
Risks Ahead: Global Corporate Real Estate Trends 2013Risks Ahead: Global Corporate Real Estate Trends 2013
Risks Ahead: Global Corporate Real Estate Trends 2013JLL
 
The Future of Work - 2001 Presentation
The Future of Work - 2001 PresentationThe Future of Work - 2001 Presentation
The Future of Work - 2001 PresentationJon Husband
 
Seven key commercial real estate investment themes for 2016
Seven key commercial real estate investment themes for 2016Seven key commercial real estate investment themes for 2016
Seven key commercial real estate investment themes for 2016JLL
 
January 2016 U.S. employment update and outlook
January 2016 U.S. employment update and outlookJanuary 2016 U.S. employment update and outlook
January 2016 U.S. employment update and outlookJLL
 
[Spanish translation] Global CRE Trends Infographic 2013
[Spanish translation] Global CRE Trends Infographic 2013[Spanish translation] Global CRE Trends Infographic 2013
[Spanish translation] Global CRE Trends Infographic 2013JLL
 
Re-engineering the workplace for the next generation
Re-engineering the workplace for the next generationRe-engineering the workplace for the next generation
Re-engineering the workplace for the next generationTransmute
 
Japan CRE Index 2013
Japan CRE Index 2013Japan CRE Index 2013
Japan CRE Index 2013JLL
 
Changing Winds Ahead: Japan Corporate Real Estate Survey Overview
Changing Winds Ahead: Japan Corporate Real Estate Survey OverviewChanging Winds Ahead: Japan Corporate Real Estate Survey Overview
Changing Winds Ahead: Japan Corporate Real Estate Survey OverviewJLL
 
4 data center trends to watch
4 data center trends to watch 4 data center trends to watch
4 data center trends to watch JLL
 
Grocery stores compete for attention | JLL Retail
Grocery stores compete for attention | JLL RetailGrocery stores compete for attention | JLL Retail
Grocery stores compete for attention | JLL RetailJLL
 
RECon Latin America 2016 – Retailers on the move
RECon Latin America 2016 – Retailers on the moveRECon Latin America 2016 – Retailers on the move
RECon Latin America 2016 – Retailers on the moveJLL
 
U.S. employment rate data and trends June 2014
U.S. employment rate data and trends June 2014U.S. employment rate data and trends June 2014
U.S. employment rate data and trends June 2014JLL
 
EMEA Corporate Occupier Conditions – Autumn 2015 [Infographic]
EMEA Corporate Occupier Conditions – Autumn 2015 [Infographic]EMEA Corporate Occupier Conditions – Autumn 2015 [Infographic]
EMEA Corporate Occupier Conditions – Autumn 2015 [Infographic]JLL
 
Reducing greenhouse gas emissions one building at a time
Reducing greenhouse gas emissions one building at a timeReducing greenhouse gas emissions one building at a time
Reducing greenhouse gas emissions one building at a timeJLL
 
Implications For The Next Generation Office
Implications For The Next Generation OfficeImplications For The Next Generation Office
Implications For The Next Generation OfficeCheryl McKinnon
 

En vedette (19)

Corporate Real Estate at the Crossroads - Cost vs. Value: Australian CRE tren...
Corporate Real Estate at the Crossroads - Cost vs. Value: Australian CRE tren...Corporate Real Estate at the Crossroads - Cost vs. Value: Australian CRE tren...
Corporate Real Estate at the Crossroads - Cost vs. Value: Australian CRE tren...
 
U.S. Lodging Sector 2014 Wellness Check
U.S. Lodging Sector 2014 Wellness CheckU.S. Lodging Sector 2014 Wellness Check
U.S. Lodging Sector 2014 Wellness Check
 
JLL’s Mid-Year Skyline Update: A Closer Look at OH, MI & PA
JLL’s Mid-Year Skyline Update: A Closer Look at OH, MI & PAJLL’s Mid-Year Skyline Update: A Closer Look at OH, MI & PA
JLL’s Mid-Year Skyline Update: A Closer Look at OH, MI & PA
 
Risks Ahead: Global Corporate Real Estate Trends 2013
Risks Ahead: Global Corporate Real Estate Trends 2013Risks Ahead: Global Corporate Real Estate Trends 2013
Risks Ahead: Global Corporate Real Estate Trends 2013
 
The Future of Work - 2001 Presentation
The Future of Work - 2001 PresentationThe Future of Work - 2001 Presentation
The Future of Work - 2001 Presentation
 
Seven key commercial real estate investment themes for 2016
Seven key commercial real estate investment themes for 2016Seven key commercial real estate investment themes for 2016
Seven key commercial real estate investment themes for 2016
 
January 2016 U.S. employment update and outlook
January 2016 U.S. employment update and outlookJanuary 2016 U.S. employment update and outlook
January 2016 U.S. employment update and outlook
 
Sistema operativo
Sistema operativoSistema operativo
Sistema operativo
 
[Spanish translation] Global CRE Trends Infographic 2013
[Spanish translation] Global CRE Trends Infographic 2013[Spanish translation] Global CRE Trends Infographic 2013
[Spanish translation] Global CRE Trends Infographic 2013
 
Re-engineering the workplace for the next generation
Re-engineering the workplace for the next generationRe-engineering the workplace for the next generation
Re-engineering the workplace for the next generation
 
Japan CRE Index 2013
Japan CRE Index 2013Japan CRE Index 2013
Japan CRE Index 2013
 
Changing Winds Ahead: Japan Corporate Real Estate Survey Overview
Changing Winds Ahead: Japan Corporate Real Estate Survey OverviewChanging Winds Ahead: Japan Corporate Real Estate Survey Overview
Changing Winds Ahead: Japan Corporate Real Estate Survey Overview
 
4 data center trends to watch
4 data center trends to watch 4 data center trends to watch
4 data center trends to watch
 
Grocery stores compete for attention | JLL Retail
Grocery stores compete for attention | JLL RetailGrocery stores compete for attention | JLL Retail
Grocery stores compete for attention | JLL Retail
 
RECon Latin America 2016 – Retailers on the move
RECon Latin America 2016 – Retailers on the moveRECon Latin America 2016 – Retailers on the move
RECon Latin America 2016 – Retailers on the move
 
U.S. employment rate data and trends June 2014
U.S. employment rate data and trends June 2014U.S. employment rate data and trends June 2014
U.S. employment rate data and trends June 2014
 
EMEA Corporate Occupier Conditions – Autumn 2015 [Infographic]
EMEA Corporate Occupier Conditions – Autumn 2015 [Infographic]EMEA Corporate Occupier Conditions – Autumn 2015 [Infographic]
EMEA Corporate Occupier Conditions – Autumn 2015 [Infographic]
 
Reducing greenhouse gas emissions one building at a time
Reducing greenhouse gas emissions one building at a timeReducing greenhouse gas emissions one building at a time
Reducing greenhouse gas emissions one building at a time
 
Implications For The Next Generation Office
Implications For The Next Generation OfficeImplications For The Next Generation Office
Implications For The Next Generation Office
 

Similaire à Dojo is Bizarro jQuery: Exploring the Bizarro World of Dojo

Introduction to jQuery :: CharlotteJS
Introduction to jQuery :: CharlotteJSIntroduction to jQuery :: CharlotteJS
Introduction to jQuery :: CharlotteJSgjj391
 
Dojo Basics Js UserGroup Chicago
Dojo Basics Js UserGroup ChicagoDojo Basics Js UserGroup Chicago
Dojo Basics Js UserGroup Chicagowolframkriesing
 
Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Zi Bin Cheah
 
CSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonCSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonJen Simmons
 
Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Adam Baldwin
 
Advanced android
Advanced androidAdvanced android
Advanced androiddonnfelker
 
Mongodb on Ruby And Rails (froscon 2010)
Mongodb on Ruby And Rails (froscon 2010)Mongodb on Ruby And Rails (froscon 2010)
Mongodb on Ruby And Rails (froscon 2010)jan_mindmatters
 
HTML5/CSS3 @ Baidu
HTML5/CSS3 @ BaiduHTML5/CSS3 @ Baidu
HTML5/CSS3 @ BaiduZi Bin Cheah
 
Jquery Introduction
Jquery IntroductionJquery Introduction
Jquery Introductioncabbiepete
 
The IT Philharmonic - OSCON 2010
The IT Philharmonic - OSCON 2010 The IT Philharmonic - OSCON 2010
The IT Philharmonic - OSCON 2010 Chef Software, Inc.
 

Similaire à Dojo is Bizarro jQuery: Exploring the Bizarro World of Dojo (16)

Introduction to jQuery :: CharlotteJS
Introduction to jQuery :: CharlotteJSIntroduction to jQuery :: CharlotteJS
Introduction to jQuery :: CharlotteJS
 
Rejectkaigi 2010
Rejectkaigi 2010Rejectkaigi 2010
Rejectkaigi 2010
 
Dojo Basics Js UserGroup Chicago
Dojo Basics Js UserGroup ChicagoDojo Basics Js UserGroup Chicago
Dojo Basics Js UserGroup Chicago
 
CSS3 now
CSS3 nowCSS3 now
CSS3 now
 
Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010
 
CSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp BostonCSS3: The Future is Now at Drupal Design Camp Boston
CSS3: The Future is Now at Drupal Design Camp Boston
 
Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010Pony Pwning Djangocon 2010
Pony Pwning Djangocon 2010
 
Advanced android
Advanced androidAdvanced android
Advanced android
 
Mongodb on Ruby And Rails (froscon 2010)
Mongodb on Ruby And Rails (froscon 2010)Mongodb on Ruby And Rails (froscon 2010)
Mongodb on Ruby And Rails (froscon 2010)
 
HTML5/CSS3 @ Baidu
HTML5/CSS3 @ BaiduHTML5/CSS3 @ Baidu
HTML5/CSS3 @ Baidu
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid Prototyping
 
Geekup Leeds - Why the YUI?
Geekup Leeds - Why the YUI?Geekup Leeds - Why the YUI?
Geekup Leeds - Why the YUI?
 
The jQuery Divide
The jQuery DivideThe jQuery Divide
The jQuery Divide
 
Github flow
Github flowGithub flow
Github flow
 
Jquery Introduction
Jquery IntroductionJquery Introduction
Jquery Introduction
 
The IT Philharmonic - OSCON 2010
The IT Philharmonic - OSCON 2010 The IT Philharmonic - OSCON 2010
The IT Philharmonic - OSCON 2010
 

Dernier

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Dernier (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

Dojo is Bizarro jQuery: Exploring the Bizarro World of Dojo

  • 1. dojo is bizarro jQuery john hann @unscriptable lifeIMAGE, Inc. Thursday, August 26, 2010
  • 3. video lessons learned what does “bizarro” mean? what can we learn about “bizarro” from the video? (discussion) Thursday, August 26, 2010
  • 5. video lessons learned what makes something bizarro: • it’s similar at first glance but... • nearly opposite once you learn more Thursday, August 26, 2010
  • 6. video lessons learned what makes something bizarro: • it’s similar at first glance but... • nearly opposite once you learn more lessons learned: • “opposite” is ambiguous • neither is undeniably better / perfect • can’t co-exist (really?) • not all behavior is appropriate to both Thursday, August 26, 2010
  • 7. similar at first glance... height hair style order Thursday, August 26, 2010
  • 8. but not quite the same... Kevin Gene Feldman Jerry George Kramer neat & pressed relaxed plaid spots Thursday, August 26, 2010
  • 9. ...and quite nearly opposite! friendly aloof generous stingy unforgiving accepting Thursday, August 26, 2010
  • 10. similar at first glance... selector engine dom abstractions dom manipulation animations Thursday, August 26, 2010
  • 11. Dojo:Zoomer (jQuery-ish app done in dojo) http://demos.dojotoolkit.org/demos/cropper/ Thursday, August 26, 2010
  • 12. dijit.form (progressive enhancement demo) image: http://modernmechanics.com/ Thursday, August 26, 2010
  • 13. but not quite the same... $(‘*’) dojo.query(‘*’) $.fn.css() dojo.style() $(‘<div>’) dojo.create(‘div’) $.fn.animate() dojo.animate() 3rd-party plugins ±100 “dijits” Thursday, August 26, 2010
  • 14. plugd “loosely based on my favorite bits of jQuery” -- Peter Higgins (@phiggins) http://github.com/phiggins42/plugd Thursday, August 26, 2010
  • 15. plugd .wrap() .show(), .hide(), .toggle() .append(), .appendTo() .create() .grab() .size() .animate() .destroy() .selectable() .hover(), .hoverClass() .end() Thursday, August 26, 2010
  • 16. plugd $("div.baz") .appendTo("body") .addClass("bar") .onclick(function(e){ /* … */ }) ; $("<a href='foo.html'>bar</a>") .appendTo("body") .addClass("baz") .onclick(function(e){ /* … */ }) ; Thursday, August 26, 2010
  • 17. but don’t be fooled... the similarity ends here. Thursday, August 26, 2010
  • 18. but don’t be fooled... the similarity ends here. the bizarro dojo universe! prepare to enter Thursday, August 26, 2010
  • 19. up is down unlike the comfy world of jQuery, in the bizarro world of dojo… Thursday, August 26, 2010
  • 20. up is down unlike the comfy world of jQuery, in the bizarro world of dojo… dijits inject tiny bits of html into the dom servers spew javascript & json, not html “progressive enhancement” is a dirty word seo and html validation are shunned Thursday, August 26, 2010
  • 21. up is down unlike the comfy world of jQuery, in the bizarro world of dojo… wut? are we dijits inject tiny bits of html into the dom servers spew javascript & json, not html whack?!?! “progressive enhancement” is a dirty word seo and html validation are shunned Thursday, August 26, 2010
  • 22. up is down nah... ‘cuz now we’ve got super powers! image: http://www.supermanhomepage.com/ Thursday, August 26, 2010
  • 23. up is down nah... ‘cuz now we’ve got super powers! modular widgets centralized ui logic html5 offline-ready* ipad & google-pad “native” html5 apps** * sheesh! you gotta do some of the work yourself, slacker! ** requires PhoneGap or equivalent image: http://www.supermanhomepage.com/ Thursday, August 26, 2010
  • 24. up is down progressive enhancement? pffffftt! that’s for lame-o blogs and marketing sites! no javascript? no admittance! ie mobile and wap phones can find another bizarro world where web 1.0 is still king! image: http://hildygottlieb.com/ Thursday, August 26, 2010
  • 25. up is down screw validation! it adds no value* since dijit’s html snippets are already easy to grok and debug: •tiny & modular, •unit-testable * ok ok already! “resistance is futile”. we get it. we also get that validation helps future-proof your html. dojo 1.6 will be valid html5. image: http://www.themindrobber.co.uk/ Thursday, August 26, 2010
  • 26. down is up on the bizarro dojo seas... one script tag will conjure a salvo of .js downloads image: http://davelandweb.com/ Thursday, August 26, 2010
  • 27. down is up on the bizarro dojo seas... one script tag will conjure a salvo of .js downloads or not. image: http://davelandweb.com/ Thursday, August 26, 2010
  • 28. down is up on the bizarro dojo seas... one script tag will conjure a salvo of .js downloads or not. ‘cuz a dojo pirate shoots whatever size .js slugs he wishes! image: http://davelandweb.com/ Thursday, August 26, 2010
  • 29. down is up dojo.require() imports dependencies dojo’s build system packages javascript and html my.HawtCalndr dojo.date dojo.require(‘dojo.date’); dojo.provide(‘dojo.date’); Thursday, August 26, 2010
  • 30. down is up (show me the codez!) (dojo.require() and dojo.provide()) image: http://makezine.com/ Thursday, August 26, 2010
  • 31. “hello” when he leaves dojo pirates can say anything they want – and in any language – and not get confused image: http://www.savagechickens.com/ Thursday, August 26, 2010
  • 32. “hello” when he leaves dijit’s html snippets are tokenized and are locale-aware <div class=“my-hawt-widget”> ! <button>${buttonLabel}</button> </div> dojo.requireLocalization(); this.buttonLabel = dojo.i18n.getLocalization( ! ‘my.HawtWidget’, ‘strings’)[‘buttonLabel’]; Thursday, August 26, 2010
  • 33. “hello” when he leaves (more coadz!) (templates, tokens, and i18n. oh my!) image: http://modernmechanix.com/ Thursday, August 26, 2010
  • 34. “good bye” when he arrives dojo’s bizarro components are loose and ignorant of their own parents! but this is a good thing! you want your “babies” to be independent! Thursday, August 26, 2010
  • 35. “good bye” when he arrives dojo.connect() allows loose coupling dojo.publish() and dojo.subscribe() provide global app events my.HawtWidget my.HawtCalndr dojo.subscribe(‘timezone_chg’, onChangeTz: function (e) { function (tz, bool) { dojo.publish(‘timezone_chg’, /* do something! */ ! [‘PDT’, true]); } } ); Thursday, August 26, 2010
  • 36. “good bye” when he arrives (back to the javascript!) (dojo.connect(), dojo.publish(), and dojo.subscribe()) image: http://thedawgpound.com/ Thursday, August 26, 2010
  • 37. and now for something completely bizarro cujo.js web app platform Thursday, August 26, 2010
  • 38. what is cujo.js? web app platform: •MVC-based framework •CSS-centric, object-oriented •based on dojo & dijit •templates, guidance, examples, training Thursday, August 26, 2010
  • 39. why is cujo.js bizarro? data flows magically between nodes & server template languages disappear (and so does the id attribute!) views invoke the holey web trinity, instilling powers to lesser browsers ancient browsers grok css2.1 and css3* *dude! not all of css3! I’ve got a life ya know. Thursday, August 26, 2010
  • 40. data flows magically dojo data stores are hawt! json-rest data stores are data models couchdb flickr most handle client-server google communication so you don’t csv data binding provides the xml “last mile” atom etc... the end result: “live” data Thursday, August 26, 2010
  • 41. template languages disappear why do we even need a {{template language}}? html5 data-* attrs ftw! inheritance: data-cujo-override loops: data-cujo-iter conditionals: data-cujo-if “oohtml”, anyone? image: http://thedawgpound.com/ Thursday, August 26, 2010
  • 42. views invoke the holey web trinity oojs + oohtml + oocss => cujo.mvc.View complete module, yet still overridable my/HawtWidget.js: dojo.provide(‘my.HawtWidget’); cujo.requireCss(‘my.HawtWidget’); cujo.requireHtml(‘my.HawtWidget’); ... Thursday, August 26, 2010
  • 43. ancient browsers grok css2.1 and css3 once you take control of the stylesheets, the sky is the limit! ever wish this worked in IE6? ! .myWidget.selected {} or this? ! .myMenu > .myMenuItem[href=”#”] {} or this? ! transition: left 0.5s bounce 0.25s; Thursday, August 26, 2010
  • 44. ancient browsers grok css2.1 and css3 once you take control of the stylesheets, the sky is the limit! ever wish this worked in IE6? ! .myWidget.selected {} or this? ! .myMenu > .myMenuItem[href=”#”] {} or this? ! transition: left 0.5s bounce 0.25s; Thursday, August 26, 2010
  • 45. cujo.js in action (demo and codez!) Thursday, August 26, 2010
  • 46. even more bizarro all things dojo: http://dojotoolkit.org/ http://twitter.com/dojo #dojo channel on freenode keep up to date with cujo.js: http://cujojs.com/ http://twitter.com/cujojs http://twitter.com/unscriptable (me) image: http://modernmechanics.com/ Thursday, August 26, 2010