SlideShare ist ein Scribd-Unternehmen logo
1 von 165
Solving Problems: AutoComplete
                  Isaac Z. Schlueter
               isaacs@yahoo-inc.com @izs
YUICONF 2009     http://github.com/isaacs
hi.
“real world”
“solving”
“not very much effort”
      = he’s lazy.
The Problem
Shopping List
Shopping List
• a way to find out when the user types
  something into the form element
Shopping List
• a way to find out when the user types
  something into the form element
• a generic way to get data from a server, or
  from anywhere
Shopping List
• a way to find out when the user types
  something into the form element
• a generic way to get data from a server, or
  from anywhere
• a way to display the list of items
Shopping List
• a way to find out when the user types
  something into the form element
• a generic way to get data from a server, or
  from anywhere
• a way to display the list of items
• a simple thing to wire it all together
invention is harder
  than assembly
Like the man said,
    very lazy.
The Requirements
small
accessible
these ones?
these ones?
omg, this all sounds
    like work!
you can solve your
problems like this, too

              (and get props for it)
A brief survey
 of our tools
Node: The API
 that the DOM
Should Have Been
Browser DOM API
Browser DOM API
// If you're LUCKY!
var f = document.getElementsByClassName("foo")
for (
    var i = 0, l = f.length;
    i < l;
    i ++ ) {
	 f[i].addEventListener("click", fn);
}
// If you're LUCKY!
var f = document.getElementsByClassName("foo")
for (
    var i = 0, l = f.length;
    i < l;
    i ++ ) {
	 f[i].addEventListener("click", fn);
}

// oh wait, that doesn't work in ie... fml.
Node API
Y.all(".foo")
 .on("click", fn);
Node

developer.yahoo.com
     /yui/3/node
Shopping List
• a way to find out when the user types
  something into the form element
• a generic way to get data from a server, or
  from anywhere
• a way to display the list of items
• a simple thing to wire it all together
Data Source:
because data is weird
Data Source:
because data is weird
Caching, data normalization, and this
      thing is TINY in YUI 3!
Data Source

developer.yahoo.com
  /yui/3/datasource
Shopping List
• a way to find out when the user types
  something into the form element
• a generic way to get data from a server, or
  from anywhere
• a way to display the list of items
• a simple thing to wire it all together
Not so similar…
Not so similar…
Not so similar…
Not so similar…
Not so similar…
Not so similar…
Not so similar…
Display
Display
• Bounding box - need to manage position,
  even when the window changes height
Display
• Bounding box - need to manage position,
  even when the window changes height
• Must support many different looks
Display
• Bounding box - need to manage position,
  even when the window changes height
• Must support many different looks
• Overlapping anything (iframes, scrollbars,
  select elements, other nasty creatures)
Display
• Bounding box - need to manage position,
  even when the window changes height
• Must support many different looks
• Overlapping anything (iframes, scrollbars,
  select elements, other nasty creatures)
• Keyboard navigation
Widget
Widget

developer.yahoo.com
    /yui/3/widget
with Widget you can:
with Widget you can:
• Fix the position of the box
with Widget you can:
• Fix the position of the box
• Skin it and change the contents easily
with Widget you can:
• Fix the position of the box
• Skin it and change the contents easily
• Overlap iframes and select elements
  without any hassles
with Widget you can:
• Fix the position of the box
• Skin it and change the contents easily
• Overlap iframes and select elements
  without any hassles
• Easily extend to support keyboard and
  focus events.
Shopping List
• a way to find out when the user types
  something into the form element
• a generic way to get data from a server, or
  from anywhere
• a way to display the list of items
• a simple thing to wire it all together
Plugins:
Form like Voltron
Plugins:
Form like Voltron
Decorator Pattern
Decorator Pattern


               GoF FTW!
Y.one("#foo")
 .plug(Y.Plugins.Foo)
 .foo.doSomeFoo();
Y.one("#foo")
 .plug(Y.Plugins.Foo)
 .foo.doSomeFoo();


     so, not quite Voltron, but still, pretty cool.
Plugin

developer.yahoo.com
    /yui/3/plugin
Shopping List
• a way to find out when the user types
  something into the form element
• a generic way to get data from a server, or
  from anywhere
• a way to display the list of items
• a simple thing to wire it all together
Loose Coupling
What is a duck?
What is a duck?
• Water Bird
What is a duck?
• Water Bird
• Bird
What is a duck?
• Water Bird
• Bird
• Vertebrate
What is a duck?
• Water Bird
• Bird
• Vertebrate
• Animal
What is a duck?
• Water Bird
• Bird
• Vertebrate
• Animal
• Organism
What is a duck?
• Water Bird
• Bird
• Vertebrate
• Animal
• Organism
• Thing
What is a duck?
What is a duck?

• Swims
What is a duck?

• Swims
• Flies
What is a duck?

• Swims
• Flies
• Quacks
What is a duck?

• Swims
• Flies
• Quacks
• Sits on eggs
What is a duck?

• Swims
• Flies
• Quacks
• Sits on eggs
• Mixes
  metaphors
Loose Coupling
Loose Coupling
• Pieces should provide enough value to be
  used alone or in other contexts
Loose Coupling
• Pieces should provide enough value to be
  used alone or in other contexts
• Pieces should work with any other piece
  that exposes the expected API
Loose Coupling
• Pieces should provide enough value to be
  used alone or in other contexts
• Pieces should work with any other piece
  that exposes the expected API
• “Don’t call me, I’ll call you”
  events > method calls
That’s nice and all,
 but how do you
make it reusable?
YUI.add()
YUI.add("my-module", function (Y) {


  // your code here.
}, "1.0.2", {
  requires : [
    "node", "plugin", "widget"
  ]
});
YUI.add()
YUI.add()

• Call add() on the YUI global
  YUI.add(), not YUI().add()
YUI.add()

• Call add() on the YUI global
  YUI.add(), not YUI().add()

• This adds your module to the list of
  things that can be loaded with use()
YUI.add()
YUI.add()
and then later:
YUI.add()
and then later:
YUI().use("my-module",
   function (Y) {
     // do something with it
   }
);
So... AutoComplete,
 remember? You were
gonna talk about that?
AutoComplete:
               AutoComplete    AutoComplete
                Node Plugin   Renderer Widget
DOM YUI Node
node Wrapper

                Data Source
Oh, wait, there’s a
    problem.
“user presses a key”
         !==
  “data has been
      entered”
onchange is too late
 for our purposes
DOM
Events
keydown   DOM
          Events
keydown    DOM
   keyup   Events
keydown          DOM
   keyup         Events
      keypress
keydown            DOM
   keyup           Events
      keypress
          change
keydown            DOM
   keyup           Events
      keypress
          change


 something is missing!
Custom Events:
Implement the
   Missing
myThing.on("click",
  function (e) {
    doSomething();
    e.stopPropagation();
    e.preventDefault()
    // etc.
  }
)
myThing.on("myEvent",
  function (e) {
    doSomething();
    e.stopPropagation();
    e.preventDefault()
    // etc.
  }
)
Making a New
  Node Event:
it’s like creating
your own DOM
Try not to let the
power go to your head.
myEvent = {
   on : function () { ... },
   detach : function () { ... }
};
Y.Env.evt.plugins.myEvent = myEvent;
Y.Node.DOM_EVENTS.myEvent = myEvent;

// function bodies removed, but
// that really is the whole thing.
Signs you should add a
   new Node event:
Signs you should add a
   new Node event:
• Generic need related to a single element
Signs you should add a
   new Node event:
• Generic need related to a single element
• DOM has something like what you want,
  but not quite
Signs you should add a
   new Node event:
• Generic need related to a single element
• DOM has something like what you want,
  but not quite
• It “fills a hole” in the DOM API
Signs you should add a
   new Node event:
• Generic need related to a single element
• DOM has something like what you want,
  but not quite
• It “fills a hole” in the DOM API
• In other words, please don’t create your
  own “click” event.
AutoComplete:
               AutoComplete    AutoComplete
                Node Plugin   Renderer Widget
DOM YUI Node
node Wrapper

                Data Source
AutoComplete:
                      AutoComplete    AutoComplete
        valueChange
                       Node Plugin   Renderer Widget
DOM YUI Node
node Wrapper

                       Data Source
AutoComplete:
 valueChange
AutoComplete:
           valueChange


Listen to key events
AutoComplete:
           valueChange


Listen to key events
Use Y.later() to defer value check.
AutoComplete:
           valueChange


Listen to key events
Use Y.later() to defer value check.
See if the value has changed
AutoComplete:
            valueChange


Listen to key events
Use Y.later() to defer value check.
See if the value has changed
If the value is different than last time, fire “valueChange”
AutoComplete:
     AutoComplete
      Node Plugin
AutoComplete:
               AutoComplete
                Node Plugin


Plug into a Node object
AutoComplete:
               AutoComplete
                Node Plugin


Plug into a Node object
It gets some settings
AutoComplete:
               AutoComplete
                Node Plugin


Plug into a Node object
It gets some settings
Listens to the valueChange event
AutoComplete:
               AutoComplete
                Node Plugin


Plug into a Node object
It gets some settings
Listens to the valueChange event
Fires “ac:query” event when appropriate
AutoComplete:
     AutoComplete
      Node Plugin




      Data Source
AutoComplete:
                   AutoComplete
                    Node Plugin
“ac:query” has
default behavior
                    Data Source
AutoComplete:
                   AutoComplete
                    Node Plugin
                                    If not canceled, it
“ac:query” has
                                  tells the data source
default behavior
                                     to get some data.
                    Data Source
AutoComplete:
                     AutoComplete
                      Node Plugin
                                      If not canceled, it
“ac:query” has
                                    tells the data source
default behavior
                                       to get some data.
                      Data Source


             When/if the data returns,
             it fires the “ac:load” event.
AutoComplete:
            AutoComplete
           Renderer Widget
AutoComplete:
  Extends the Widget class
                              AutoComplete
                             Renderer Widget
AutoComplete:
          Extends the Widget class
                                         AutoComplete
When the user clicks on an item, call   Renderer Widget
myNode.ac.set("queryValue",
                 selection)
AutoComplete:
 Widget gives it a bounding      AutoComplete
  box, an easy way to mange     Renderer Widget

    position, and a render()
 function to make it visible.
AutoComplete:
                      AutoComplete    AutoComplete
        valueChange
                       Node Plugin   Renderer Widget
DOM YUI Node
node Wrapper

                       Data Source
AutoComplete:
AutoComplete:
              Preview
What you are about to see is not even beta yet.
     This is a slide deck, not an API doc.
 Stay tuned at http://yuilibrary.com/yui3/ and
      http://developer.yahoo.com/yui/3/
AutoComplete:
YUI().use("ac-plugin", function (Y) {
	 var myAC = Y.one("#ac"),
	 	   myDS = new Y.DataSource(...);
	 myAC.plug(Y.Plugins.ACPlugin, {
	 	   dataSource : myDS
	 }).ac.on("ac:load", function (results) {
	 	   doSomething(results);
	 });
});
AutoComplete:
YUI().use("ac-plugin", function (Y) {
	 var myAC = Y.one("#ac"),
	 	   myDS = new Y.DataSource(...);
	 myAC.plug(Y.Plugins.ACPlugin, {
	 	   dataSource : myDS
	 }).ac.on("ac:load", function (results) {
	 	   doSomething(results);
	 });
});          // wow, that’s a mouthful
defaults === win
Roll-up
Roll-up
Roll-up

• YUI 2 was a modular system, but each
  module is all or nothing
Roll-up

• YUI 2 was a modular system, but each
  module is all or nothing
• YUI 3 is sub-modular — more granular
Roll-up

• YUI 2 was a modular system, but each
  module is all or nothing
• YUI 3 is sub-modular — more granular
• Roll-ups provide an easy way to trade the
  customizability for the convenience
Just take the bits you like,
  leave the rest behind.
AutoComplete:
                      AutoComplete    AutoComplete
        valueChange
                       Node Plugin   Renderer Widget
DOM YUI Node
node Wrapper

                       Data Source
AutoComplete:
                        AutoComplete          AutoComplete
        valueChange
                         Node Plugin         Renderer Widget
DOM YUI Node          AutoComplete roll-up
node Wrapper

                         Data Source
AutoComplete:
AutoComplete:
              Preview
What you are about to see is not even beta yet.
     This is a slide deck, not an API doc.
 Stay tuned at http://yuilibrary.com/yui3/ and
      http://developer.yahoo.com/yui/3/
AutoComplete:
YUI().use("autocomplete", function (Y) {
	 var myAC = new Y.AutoComplete({
	 	 node : "#ac",
	 	 dataSource : new Y.DataSource(...)
	 });
});
In the final tally...
In the final tally...

• Less than 4kb of new code, mostly for the
  custom DOM event. (< 2kb over the wire)
In the final tally...

• Less than 4kb of new code, mostly for the
  custom DOM event. (< 2kb over the wire)
• Most of the work consisted of arranging
  and assembling
In the final tally...

• Less than 4kb of new code, mostly for the
  custom DOM event. (< 2kb over the wire)
• Most of the work consisted of arranging
  and assembling
• Good solutions don’t have to be hard
AutoComplete:
 Coming soon to a
  YUI Library
  NEAR YOU!
AutoComplete:

 http://github.com/yui/yui3
http://github.com/isaacs/yui3
fin
( questions )

Weitere ähnliche Inhalte

Was ist angesagt?

Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KThomas Fuchs
 
Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)James Titcumb
 
Best practices for crafting high quality PHP apps (Bulgaria 2019)
Best practices for crafting high quality PHP apps (Bulgaria 2019)Best practices for crafting high quality PHP apps (Bulgaria 2019)
Best practices for crafting high quality PHP apps (Bulgaria 2019)James Titcumb
 
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)Peter Lehto
 
jQuery for Sharepoint Dev
jQuery for Sharepoint DevjQuery for Sharepoint Dev
jQuery for Sharepoint DevZeddy Iskandar
 
Testing web APIs
Testing web APIsTesting web APIs
Testing web APIsFDConf
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009Ralph Whitbeck
 
Prairie DevCon 2015 - Crafting Evolvable API Responses
Prairie DevCon 2015 - Crafting Evolvable API ResponsesPrairie DevCon 2015 - Crafting Evolvable API Responses
Prairie DevCon 2015 - Crafting Evolvable API Responsesdarrelmiller71
 
Lesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ayLesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ayCodecademy Ren
 
Crafting Quality PHP Applications (PHP Benelux 2018)
Crafting Quality PHP Applications (PHP Benelux 2018)Crafting Quality PHP Applications (PHP Benelux 2018)
Crafting Quality PHP Applications (PHP Benelux 2018)James Titcumb
 
Symfony 4 Workshop - Limenius
Symfony 4 Workshop - LimeniusSymfony 4 Workshop - Limenius
Symfony 4 Workshop - LimeniusIgnacio Martín
 
Bcblackpool jquery tips
Bcblackpool jquery tipsBcblackpool jquery tips
Bcblackpool jquery tipsJack Franklin
 
Crafting Quality PHP Applications (ConFoo YVR 2017)
Crafting Quality PHP Applications (ConFoo YVR 2017)Crafting Quality PHP Applications (ConFoo YVR 2017)
Crafting Quality PHP Applications (ConFoo YVR 2017)James Titcumb
 
Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)
Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)
Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)James Titcumb
 
jQuery Events
jQuery EventsjQuery Events
jQuery Eventsnek4life
 
Turn your spaghetti code into ravioli with JavaScript modules
Turn your spaghetti code into ravioli with JavaScript modulesTurn your spaghetti code into ravioli with JavaScript modules
Turn your spaghetti code into ravioli with JavaScript modulesjerryorr
 

Was ist angesagt? (20)

Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
 
Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)
 
JavaScript Needn't Hurt!
JavaScript Needn't Hurt!JavaScript Needn't Hurt!
JavaScript Needn't Hurt!
 
Best practices for crafting high quality PHP apps (Bulgaria 2019)
Best practices for crafting high quality PHP apps (Bulgaria 2019)Best practices for crafting high quality PHP apps (Bulgaria 2019)
Best practices for crafting high quality PHP apps (Bulgaria 2019)
 
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
 
jQuery for Sharepoint Dev
jQuery for Sharepoint DevjQuery for Sharepoint Dev
jQuery for Sharepoint Dev
 
Jquery tutorial
Jquery tutorialJquery tutorial
Jquery tutorial
 
Testing web APIs
Testing web APIsTesting web APIs
Testing web APIs
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009jQuery For Beginners - jQuery Conference 2009
jQuery For Beginners - jQuery Conference 2009
 
Prairie DevCon 2015 - Crafting Evolvable API Responses
Prairie DevCon 2015 - Crafting Evolvable API ResponsesPrairie DevCon 2015 - Crafting Evolvable API Responses
Prairie DevCon 2015 - Crafting Evolvable API Responses
 
Lesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ayLesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ay
 
Crafting Quality PHP Applications (PHP Benelux 2018)
Crafting Quality PHP Applications (PHP Benelux 2018)Crafting Quality PHP Applications (PHP Benelux 2018)
Crafting Quality PHP Applications (PHP Benelux 2018)
 
Symfony 4 Workshop - Limenius
Symfony 4 Workshop - LimeniusSymfony 4 Workshop - Limenius
Symfony 4 Workshop - Limenius
 
Bcblackpool jquery tips
Bcblackpool jquery tipsBcblackpool jquery tips
Bcblackpool jquery tips
 
Cucumber
CucumberCucumber
Cucumber
 
Crafting Quality PHP Applications (ConFoo YVR 2017)
Crafting Quality PHP Applications (ConFoo YVR 2017)Crafting Quality PHP Applications (ConFoo YVR 2017)
Crafting Quality PHP Applications (ConFoo YVR 2017)
 
Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)
Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)
Best practices for crafting high quality PHP apps (PHP Yorkshire 2018)
 
jQuery Events
jQuery EventsjQuery Events
jQuery Events
 
Turn your spaghetti code into ravioli with JavaScript modules
Turn your spaghetti code into ravioli with JavaScript modulesTurn your spaghetti code into ravioli with JavaScript modules
Turn your spaghetti code into ravioli with JavaScript modules
 

Andere mochten auch

Axiodis infographic es
Axiodis infographic esAxiodis infographic es
Axiodis infographic esMyrian Legrini
 
Ecuaciones2
Ecuaciones2Ecuaciones2
Ecuaciones2Sole
 
Windows 7 (modified to fit training)
Windows 7 (modified to fit training)Windows 7 (modified to fit training)
Windows 7 (modified to fit training)Kenneth Endfinger
 
Seo and the Inner Workings of Google Autocomplete
Seo and the Inner Workings of Google AutocompleteSeo and the Inner Workings of Google Autocomplete
Seo and the Inner Workings of Google AutocompleteContent Equals Money
 
DoubleClick - Rich Media Fundamentals
DoubleClick - Rich Media FundamentalsDoubleClick - Rich Media Fundamentals
DoubleClick - Rich Media FundamentalsChris Chilton
 
#Stackoverflow útravaló haladóknak
#Stackoverflow útravaló haladóknak#Stackoverflow útravaló haladóknak
#Stackoverflow útravaló haladóknakMárton Kodok
 
Press & Blogger Outreach for Link Building
Press & Blogger Outreach for Link BuildingPress & Blogger Outreach for Link Building
Press & Blogger Outreach for Link BuildingRhea Drysdale
 
Why UI developers love GraphQL
Why UI developers love GraphQLWhy UI developers love GraphQL
Why UI developers love GraphQLSashko Stubailo
 
GDD Brazil 2010 - Google Storage, Bigquery and Prediction APIs
GDD Brazil 2010 - Google Storage, Bigquery and Prediction APIsGDD Brazil 2010 - Google Storage, Bigquery and Prediction APIs
GDD Brazil 2010 - Google Storage, Bigquery and Prediction APIsPatrick Chanezon
 
Google BigQuery for Everyday Developer
Google BigQuery for Everyday DeveloperGoogle BigQuery for Everyday Developer
Google BigQuery for Everyday DeveloperMárton Kodok
 
Complex realtime event analytics using BigQuery @Crunch Warmup
Complex realtime event analytics using BigQuery @Crunch WarmupComplex realtime event analytics using BigQuery @Crunch Warmup
Complex realtime event analytics using BigQuery @Crunch WarmupMárton Kodok
 
DoubleClick Dynamic Remarketing Case Study
DoubleClick Dynamic Remarketing Case StudyDoubleClick Dynamic Remarketing Case Study
DoubleClick Dynamic Remarketing Case StudyPromodo
 
How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014James Chittenden
 
An indepth look at Google BigQuery Architecture by Felipe Hoffa of Google
An indepth look at Google BigQuery Architecture by Felipe Hoffa of GoogleAn indepth look at Google BigQuery Architecture by Felipe Hoffa of Google
An indepth look at Google BigQuery Architecture by Felipe Hoffa of GoogleData Con LA
 
Double Click for Advertisers
Double Click for AdvertisersDouble Click for Advertisers
Double Click for AdvertisersKranthi Shaik
 
AWS Athena vs. Google BigQuery for interactive SQL Queries
AWS Athena vs. Google BigQuery for interactive SQL QueriesAWS Athena vs. Google BigQuery for interactive SQL Queries
AWS Athena vs. Google BigQuery for interactive SQL QueriesDoiT International
 
Web Forms The Right Way
Web Forms The Right WayWeb Forms The Right Way
Web Forms The Right WayIdo Green
 
Big Query Basics
Big Query BasicsBig Query Basics
Big Query BasicsIdo Green
 

Andere mochten auch (19)

Axiodis infographic es
Axiodis infographic esAxiodis infographic es
Axiodis infographic es
 
Google_case_study_TIL_2014
Google_case_study_TIL_2014Google_case_study_TIL_2014
Google_case_study_TIL_2014
 
Ecuaciones2
Ecuaciones2Ecuaciones2
Ecuaciones2
 
Windows 7 (modified to fit training)
Windows 7 (modified to fit training)Windows 7 (modified to fit training)
Windows 7 (modified to fit training)
 
Seo and the Inner Workings of Google Autocomplete
Seo and the Inner Workings of Google AutocompleteSeo and the Inner Workings of Google Autocomplete
Seo and the Inner Workings of Google Autocomplete
 
DoubleClick - Rich Media Fundamentals
DoubleClick - Rich Media FundamentalsDoubleClick - Rich Media Fundamentals
DoubleClick - Rich Media Fundamentals
 
#Stackoverflow útravaló haladóknak
#Stackoverflow útravaló haladóknak#Stackoverflow útravaló haladóknak
#Stackoverflow útravaló haladóknak
 
Press & Blogger Outreach for Link Building
Press & Blogger Outreach for Link BuildingPress & Blogger Outreach for Link Building
Press & Blogger Outreach for Link Building
 
Why UI developers love GraphQL
Why UI developers love GraphQLWhy UI developers love GraphQL
Why UI developers love GraphQL
 
GDD Brazil 2010 - Google Storage, Bigquery and Prediction APIs
GDD Brazil 2010 - Google Storage, Bigquery and Prediction APIsGDD Brazil 2010 - Google Storage, Bigquery and Prediction APIs
GDD Brazil 2010 - Google Storage, Bigquery and Prediction APIs
 
Google BigQuery for Everyday Developer
Google BigQuery for Everyday DeveloperGoogle BigQuery for Everyday Developer
Google BigQuery for Everyday Developer
 
Complex realtime event analytics using BigQuery @Crunch Warmup
Complex realtime event analytics using BigQuery @Crunch WarmupComplex realtime event analytics using BigQuery @Crunch Warmup
Complex realtime event analytics using BigQuery @Crunch Warmup
 
DoubleClick Dynamic Remarketing Case Study
DoubleClick Dynamic Remarketing Case StudyDoubleClick Dynamic Remarketing Case Study
DoubleClick Dynamic Remarketing Case Study
 
How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014How Google Does Big Data - DevNexus 2014
How Google Does Big Data - DevNexus 2014
 
An indepth look at Google BigQuery Architecture by Felipe Hoffa of Google
An indepth look at Google BigQuery Architecture by Felipe Hoffa of GoogleAn indepth look at Google BigQuery Architecture by Felipe Hoffa of Google
An indepth look at Google BigQuery Architecture by Felipe Hoffa of Google
 
Double Click for Advertisers
Double Click for AdvertisersDouble Click for Advertisers
Double Click for Advertisers
 
AWS Athena vs. Google BigQuery for interactive SQL Queries
AWS Athena vs. Google BigQuery for interactive SQL QueriesAWS Athena vs. Google BigQuery for interactive SQL Queries
AWS Athena vs. Google BigQuery for interactive SQL Queries
 
Web Forms The Right Way
Web Forms The Right WayWeb Forms The Right Way
Web Forms The Right Way
 
Big Query Basics
Big Query BasicsBig Query Basics
Big Query Basics
 

Ähnlich wie Solving Problems with YUI3: AutoComplete

Cross-platform logging and analytics
Cross-platform logging and analyticsCross-platform logging and analytics
Cross-platform logging and analyticsDrew Crawford
 
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptjQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptPhilipp Bosch
 
fuser interface-development-using-jquery
fuser interface-development-using-jqueryfuser interface-development-using-jquery
fuser interface-development-using-jqueryKostas Mavridis
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuerycolinbdclark
 
The Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQueryThe Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQuerycolinbdclark
 
Getting started with jQuery
Getting started with jQueryGetting started with jQuery
Getting started with jQueryGill Cleeren
 
Creating Hybrid mobile apps with YUI
Creating Hybrid mobile apps with YUICreating Hybrid mobile apps with YUI
Creating Hybrid mobile apps with YUIGonzalo Cordero
 
NinjaScript and Mizugumo 2011-02-05
NinjaScript and Mizugumo 2011-02-05NinjaScript and Mizugumo 2011-02-05
NinjaScript and Mizugumo 2011-02-05lrdesign
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationSean Burgess
 
jQuery Recommendations to the W3C (2011)
jQuery Recommendations to the W3C (2011)jQuery Recommendations to the W3C (2011)
jQuery Recommendations to the W3C (2011)jeresig
 
jQuery and the W3C
jQuery and the W3CjQuery and the W3C
jQuery and the W3Cjeresig
 
Mistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhoneMistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhonekentbrew
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without InterferenceTony Tam
 
Concurrent Programming Using the Disruptor
Concurrent Programming Using the DisruptorConcurrent Programming Using the Disruptor
Concurrent Programming Using the DisruptorTrisha Gee
 
Google I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb HighlightsGoogle I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb HighlightsRomain Guy
 
Lecture 03 - JQuery.pdf
Lecture 03 - JQuery.pdfLecture 03 - JQuery.pdf
Lecture 03 - JQuery.pdfLê Thưởng
 
Control all the Things with Node-JS
Control all the Things with Node-JSControl all the Things with Node-JS
Control all the Things with Node-JSDavid Janes
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashNiels Frydenholm
 

Ähnlich wie Solving Problems with YUI3: AutoComplete (20)

Cross-platform logging and analytics
Cross-platform logging and analyticsCross-platform logging and analytics
Cross-platform logging and analytics
 
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScriptjQTouch – Mobile Web Apps with HTML, CSS and JavaScript
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
 
fuser interface-development-using-jquery
fuser interface-development-using-jqueryfuser interface-development-using-jquery
fuser interface-development-using-jquery
 
User Interface Development with jQuery
User Interface Development with jQueryUser Interface Development with jQuery
User Interface Development with jQuery
 
The Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQueryThe Inclusive Web: hands-on with HTML5 and jQuery
The Inclusive Web: hands-on with HTML5 and jQuery
 
Getting started with jQuery
Getting started with jQueryGetting started with jQuery
Getting started with jQuery
 
Creating Hybrid mobile apps with YUI
Creating Hybrid mobile apps with YUICreating Hybrid mobile apps with YUI
Creating Hybrid mobile apps with YUI
 
NinjaScript and Mizugumo 2011-02-05
NinjaScript and Mizugumo 2011-02-05NinjaScript and Mizugumo 2011-02-05
NinjaScript and Mizugumo 2011-02-05
 
Titanium Alloy Tutorial
Titanium Alloy TutorialTitanium Alloy Tutorial
Titanium Alloy Tutorial
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
 
jQuery Recommendations to the W3C (2011)
jQuery Recommendations to the W3C (2011)jQuery Recommendations to the W3C (2011)
jQuery Recommendations to the W3C (2011)
 
jQuery and the W3C
jQuery and the W3CjQuery and the W3C
jQuery and the W3C
 
Mistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhoneMistakes I Made Building Netflix for the iPhone
Mistakes I Made Building Netflix for the iPhone
 
Ui path
Ui pathUi path
Ui path
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
 
Concurrent Programming Using the Disruptor
Concurrent Programming Using the DisruptorConcurrent Programming Using the Disruptor
Concurrent Programming Using the Disruptor
 
Google I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb HighlightsGoogle I/O 2011, Android Honeycomb Highlights
Google I/O 2011, Android Honeycomb Highlights
 
Lecture 03 - JQuery.pdf
Lecture 03 - JQuery.pdfLecture 03 - JQuery.pdf
Lecture 03 - JQuery.pdf
 
Control all the Things with Node-JS
Control all the Things with Node-JSControl all the Things with Node-JS
Control all the Things with Node-JS
 
Automated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/CalabashAutomated UI test on mobile - with Cucumber/Calabash
Automated UI test on mobile - with Cucumber/Calabash
 

Kürzlich hochgeladen

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
 
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
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
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
 
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
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
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
 

Kürzlich hochgeladen (20)

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
 
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
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
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
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
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...
 
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
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
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
 

Solving Problems with YUI3: AutoComplete

Hinweis der Redaktion

  1. I&amp;#x2019;m Isaac Schlueter, from the YUI team. I&amp;#x2019;m here to talk to you today about something I&amp;#x2019;m working on for YUI3, an Autocomplete module, and what goes into solving real world problems with YUI 3.
  2. When I say &quot;real-world&quot; problem, I mean something that&apos;s an actual use case, something that real users are going to use. This talk isn&apos;t about a quick hack, or a proof of concept. Those things are great, and important, and there&amp;#x2019;s a place for them. This is about getting something done.
  3. When I say &quot;solve&quot;, I mean, I shouldn&apos;t ever have to deal with this problem again, and if anyone else uses YUI, they shouldn&amp;#x2019;t either. I&apos;m going to show that YUI 3 gives you the tools to do things in a way that is flexible, extensible, and extremely reusable, with not very much effort on your part.
  4. So, yeah, I AM pretty lazy. But that&apos;s why I don&apos;t want to write the same thing over and over again. Cost matters, and that&apos;s the real value proposition with YUI.
  5. You all know what an autocomplete widget does. You start typing, and some suggestions show up. You type some more, and they get further filtered, or something different shows up. When might not be so obvious until you sit down to create one, though, is that there are like a million different UI paradigms for these things. Also, some of them are hitting a web service, and others are just looking in a local blob of data, so we&apos;ll need a way to abstract that stuff all out.
  6. You all know what an autocomplete widget does. You start typing, and some suggestions show up. You type some more, and they get further filtered, or something different shows up. When might not be so obvious until you sit down to create one, though, is that there are like a million different UI paradigms for these things. Also, some of them are hitting a web service, and others are just looking in a local blob of data, so we&apos;ll need a way to abstract that stuff all out.
  7. You all know what an autocomplete widget does. You start typing, and some suggestions show up. You type some more, and they get further filtered, or something different shows up. When might not be so obvious until you sit down to create one, though, is that there are like a million different UI paradigms for these things. Also, some of them are hitting a web service, and others are just looking in a local blob of data, so we&apos;ll need a way to abstract that stuff all out.
  8. You all know what an autocomplete widget does. You start typing, and some suggestions show up. You type some more, and they get further filtered, or something different shows up. When might not be so obvious until you sit down to create one, though, is that there are like a million different UI paradigms for these things. Also, some of them are hitting a web service, and others are just looking in a local blob of data, so we&apos;ll need a way to abstract that stuff all out.
  9. You all know what an autocomplete widget does. You start typing, and some suggestions show up. You type some more, and they get further filtered, or something different shows up. When might not be so obvious until you sit down to create one, though, is that there are like a million different UI paradigms for these things. Also, some of them are hitting a web service, and others are just looking in a local blob of data, so we&apos;ll need a way to abstract that stuff all out.
  10. You all know what an autocomplete widget does. You start typing, and some suggestions show up. You type some more, and they get further filtered, or something different shows up. When might not be so obvious until you sit down to create one, though, is that there are like a million different UI paradigms for these things. Also, some of them are hitting a web service, and others are just looking in a local blob of data, so we&apos;ll need a way to abstract that stuff all out.
  11. So, yeah, I really don&apos;t want to worry about all that stuff. I just want to make this thing work.
  12. So, yeah, I really don&apos;t want to worry about all that stuff. I just want to make this thing work.
  13. So, yeah, I really don&apos;t want to worry about all that stuff. I just want to make this thing work.
  14. So, yeah, I really don&apos;t want to worry about all that stuff. I just want to make this thing work.
  15. Doing things the first time, or creating a whole new way of doing things, that&amp;#x2019;s pretty hard. I mean, it&amp;#x2019;s hard if you want to do a good job of it. In this case, when we do things with the grain of YUI, we&amp;#x2019;ll spend a lot less effort for a better result.
  16. This is definitely a case of good laziness. That is, cost matters, so doing things with the grain is cheaper.
  17. So, did I mention the site that this module is going on? It&apos;s fairly popular, maybe you&apos;ve seen it before.
  18. This is going on the yahoo home page, and in the search page, and the header that sits at the top of all Yahoo sites. Between these three modules, about 7 trillion people view these pages every 4 seconds, so it has to work reliably, it has to load fast, it has to put almost no extra code on the page.
  19. At this scale, every byte matters. By reusing as much off-the-shelf components from YUI as we can, we&amp;#x2019;re going to save a lot of bytes.
  20. But accessibility isn&amp;#x2019;t just about blind people and devices. It has to work in all languages everywhere, because this is Yahoo, so just supporting America is not really an option. remember those examples I showed before?
  21. yeah, those So, if you look closely, you&apos;ll notice that sometimes it&apos;s a list of selections, and sometimes it&apos;s a list of other sorts of things, like a picture and a title, and sometimes, like in the search assist case, it&apos;s something completely ridiculous. This little widget has to accommodate all of those.
  22. yeah, those So, if you look closely, you&apos;ll notice that sometimes it&apos;s a list of selections, and sometimes it&apos;s a list of other sorts of things, like a picture and a title, and sometimes, like in the search assist case, it&apos;s something completely ridiculous. This little widget has to accommodate all of those.
  23. yeah, those So, if you look closely, you&apos;ll notice that sometimes it&apos;s a list of selections, and sometimes it&apos;s a list of other sorts of things, like a picture and a title, and sometimes, like in the search assist case, it&apos;s something completely ridiculous. This little widget has to accommodate all of those.
  24. yeah, those So, if you look closely, you&apos;ll notice that sometimes it&apos;s a list of selections, and sometimes it&apos;s a list of other sorts of things, like a picture and a title, and sometimes, like in the search assist case, it&apos;s something completely ridiculous. This little widget has to accommodate all of those.
  25. yeah, those So, if you look closely, you&apos;ll notice that sometimes it&apos;s a list of selections, and sometimes it&apos;s a list of other sorts of things, like a picture and a title, and sometimes, like in the search assist case, it&apos;s something completely ridiculous. This little widget has to accommodate all of those.
  26. yeah, those So, if you look closely, you&apos;ll notice that sometimes it&apos;s a list of selections, and sometimes it&apos;s a list of other sorts of things, like a picture and a title, and sometimes, like in the search assist case, it&apos;s something completely ridiculous. This little widget has to accommodate all of those.
  27. Thankfully, most of the hard stuff is already done. The main task here is figuring out how to use what YUI offers to assemble the thing we want. The other advantage is that, by doing it this way, the little bit of code that we do end up having to write can be submitted back to the library.
  28. The big message at this conference, the thing that I&amp;#x2019;m personally really excited about, is the new YUI gallery. Eric talked about it yesterday, and Dav&amp;#x2019;ll be talking about it later on. Don&amp;#x2019;t miss Dav&amp;#x2019;s talk later to find out how you can get your code into the gallery.
  29. Getting feedback from people using your stuff is addictive. Definitely watch for more collaborative features from YUI in the near future.
  30. A lot of you have probably heard about some of these things already, and if not, I recommend going onto YUI Theater and watching the other talks, because most people who talk about YUI are way smarter than me. But just in case, I&amp;#x2019;ll go over some of the pieces that are relevant in this case.
  31. Node is like candy for the DOM. It does everything you think it should do, and it does it in consistent and predictable ways.
  32. This is the browser DOM API. Generally friendly, tries to do the right thing, but... a bit slow, mild stuttering problem, and... well... he&amp;#x2019;s got no pants. And, if you&amp;#x2019;re in the unlucky majority that gets to support MSIE...
  33. I&amp;#x2019;m guessing everyone in the room has written this garbage at least once.
  34. By contrast, the node API gets in there, does the dirty work that has to be done, and you never have to worry about it.
  35. Surprisingly straightforward. Use selectors to get things, then do stuff to the things, and it all just works.
  36. Well, I don&apos;t really want to worry about having to interface with a jillion different kinds of web services, and I *definitely* don&apos;t want to have to worry about caching and all that craziness. Data is strange, and I don&amp;#x2019;t want to have to deal with it.
  37. (yui 2 ds vs yui3)
  38. So, some of these have more than just a bit of text showing up. In fact, almost all of them have some other stuff in there.
  39. So, some of these have more than just a bit of text showing up. In fact, almost all of them have some other stuff in there.
  40. So, some of these have more than just a bit of text showing up. In fact, almost all of them have some other stuff in there.
  41. So, some of these have more than just a bit of text showing up. In fact, almost all of them have some other stuff in there.
  42. So, some of these have more than just a bit of text showing up. In fact, almost all of them have some other stuff in there.
  43. So, some of these have more than just a bit of text showing up. In fact, almost all of them have some other stuff in there.
  44. A widget is just a box. You put stuff in the box, and you can easily move it around, or put it somewhere, or whatever you like. You don&amp;#x2019;t have to worry about what it&amp;#x2019;s sitting on top of, because it&amp;#x2019;s all tidied up for you.
  45. The thing about putting stuff in a box is that it makes it a lot easier to manage, and a lot easier to move around.
  46. The thing about putting stuff in a box is that it makes it a lot easier to manage, and a lot easier to move around.
  47. The thing about putting stuff in a box is that it makes it a lot easier to manage, and a lot easier to move around.
  48. The thing about putting stuff in a box is that it makes it a lot easier to manage, and a lot easier to move around.
  49. Plugins in YUI 3 let you add almost any functionality you can think of to almost any object in the library. You can set up functions that get called when the plugin is attached, and the another function for when it&apos;s detached, and in between there, you can add whatever you want.
  50. If you want to take an existing API, and extend it with some additional functionality, you can use a plugin to do that. Specifically, plugins are useful when you want to add on the features in a way that lets them be taken off again later. Creating a plugin is easy. You expose one function that gets called when it&amp;#x2019;s plugged into something, and another that&amp;#x2019;s called when it gets unplugged (in case you have to do any cleanup)
  51. Here&amp;#x2019;s what it looks like when you&amp;#x2019;re done.
  52. I want to take a moment to talk about one more concept that you&amp;#x2019;ll see all throughout the YUI library: Loose coupling. In general, it means that things fit together, but they&amp;#x2019;re not tightly attached to one another, like these train pieces.
  53. Now I&amp;#x2019;m gonna mix metaphors pretty badly here, and talk about ducks, because it&amp;#x2019;s kind of related, and this picture of a duck is really nice. So, what is a duck? (follow points)
  54. Now I&amp;#x2019;m gonna mix metaphors pretty badly here, and talk about ducks, because it&amp;#x2019;s kind of related, and this picture of a duck is really nice. So, what is a duck? (follow points)
  55. Now I&amp;#x2019;m gonna mix metaphors pretty badly here, and talk about ducks, because it&amp;#x2019;s kind of related, and this picture of a duck is really nice. So, what is a duck? (follow points)
  56. Now I&amp;#x2019;m gonna mix metaphors pretty badly here, and talk about ducks, because it&amp;#x2019;s kind of related, and this picture of a duck is really nice. So, what is a duck? (follow points)
  57. Now I&amp;#x2019;m gonna mix metaphors pretty badly here, and talk about ducks, because it&amp;#x2019;s kind of related, and this picture of a duck is really nice. So, what is a duck? (follow points)
  58. Now I&amp;#x2019;m gonna mix metaphors pretty badly here, and talk about ducks, because it&amp;#x2019;s kind of related, and this picture of a duck is really nice. So, what is a duck? (follow points)
  59. That works great in some cases, but most of the time, we don&amp;#x2019;t really care what something is deep down, we just care that it gives us what we want. Another way to look at it is like this:
  60. That works great in some cases, but most of the time, we don&amp;#x2019;t really care what something is deep down, we just care that it gives us what we want. Another way to look at it is like this:
  61. That works great in some cases, but most of the time, we don&amp;#x2019;t really care what something is deep down, we just care that it gives us what we want. Another way to look at it is like this:
  62. That works great in some cases, but most of the time, we don&amp;#x2019;t really care what something is deep down, we just care that it gives us what we want. Another way to look at it is like this:
  63. That works great in some cases, but most of the time, we don&amp;#x2019;t really care what something is deep down, we just care that it gives us what we want. Another way to look at it is like this:
  64. what youer&amp;#x2019; really doing is registering a module, not instantiating it. You&amp;#x2019;re saying &amp;#x201C;you can use this thing&amp;#x201D;, and telling YUI how to attach it.
  65. what youer&amp;#x2019; really doing is registering a module, not instantiating it. You&amp;#x2019;re saying &amp;#x201C;you can use this thing&amp;#x201D;, and telling YUI how to attach it.
  66. Right. So, here&apos;s a pretty picture of the AC architecture. So, as you can see, it&apos;s very extremely straightforward, with no problems whatsoever. When the plugin gets plugged into a node, it attaches to the keydown event, and when the user presses a key, we know that something has been entered, so
  67. In some languages, a single keypress event is not the same as a single character being entered. Unfortunately, there isn&amp;#x2019;t any DOM event for &amp;#x201C;onCharacterEntered&amp;#x201D; Also, if you&amp;#x2019;ve ever tried to do much of anything on keydown or keypress, you quickly find that it&amp;#x2019;s easy to bog down the UI and users get annoyed because they type and this thing freezes up as they&amp;#x2019;re doing it. What about onchange?
  68. well, onchange doesn&amp;#x2019;t happen until the user blurs the field.
  69. Wouldn&apos;t it be nice if the DOM had some kind of event that would tell you that the data has changed, and did so asynchronously so that it didn&apos;t get all laggy and awful? Thankfully, YUI gives us a facility for filling in the missing holes in the DOM.
  70. Wouldn&apos;t it be nice if the DOM had some kind of event that would tell you that the data has changed, and did so asynchronously so that it didn&apos;t get all laggy and awful? Thankfully, YUI gives us a facility for filling in the missing holes in the DOM.
  71. Wouldn&apos;t it be nice if the DOM had some kind of event that would tell you that the data has changed, and did so asynchronously so that it didn&apos;t get all laggy and awful? Thankfully, YUI gives us a facility for filling in the missing holes in the DOM.
  72. Wouldn&apos;t it be nice if the DOM had some kind of event that would tell you that the data has changed, and did so asynchronously so that it didn&apos;t get all laggy and awful? Thankfully, YUI gives us a facility for filling in the missing holes in the DOM.
  73. Wouldn&apos;t it be nice if the DOM had some kind of event that would tell you that the data has changed, and did so asynchronously so that it didn&apos;t get all laggy and awful? Thankfully, YUI gives us a facility for filling in the missing holes in the DOM.
  74. In fact, if you use the focusIn and focusOut events exposed by the Node API, you&amp;#x2019;re already using custom events. The really nice thing is that, when an event can be done natively, you can do it that way, and when it&amp;#x2019;s not available, you can sort of roll your own based on other events that do exist.
  75. There&amp;#x2019;s just a very slight change that you have to make to your code if you&amp;#x2019;re using a custom event vs a regular DOM event. Here we see a click handler being attached to a YUI Node object. Notice the stopPropagation and preventDefault that you know and love from the DOM.
  76. And, here&amp;#x2019;s the same Node object listening to a custom event.
  77. Talk about : namespaced events vs node/dom events
  78. Talk about : namespaced events vs node/dom events
  79. Talk about : namespaced events vs node/dom events
  80. Talk about : namespaced events vs node/dom events
  81. Oh, I can see the blog posts going out now &amp;#x201C;Much Hyped AutoComplete Module Doesn&amp;#x2019;t Even Work&amp;#x201D;. So, I put this scary warning here for a reason. There&amp;#x2019;s a good chance that this is pretty close to what the final code will look like, but this is a slide deck, not an API doc. You can be sure that, this being YUI, there&amp;#x2019;ll be more documentation than you can shake a stick at once it&amp;#x2019;s done.
  82. So, if we just pull in the AutoComplete node plugin, and attach it to a dataSource, we&amp;#x2019;ve got a way to very explicitly decide what happens at each point. Of course, the &amp;#x201C;doSomething&amp;#x201D; function here would be connecting up to our ACWidget. But while it&amp;#x2019;s good to be able to use AC however you want, it&amp;#x2019;s also a bit of a pain to have to do all this for just the simple/common use cases.
  83. What if there was a way to take the common use cases, and make them simple? Set some defaults, package it up nice, and then when I just want the basic/common autocomplete, I can instantiate it without all the hassle. That means that you don&amp;#x2019;t need to know how autocomplete works in order to have it work for you.
  84. yui2 was a modular system, which of course is better than a single monolithic library. However, if you want any part of a module, you have to get the whole thing. YUI3 is sub-modular, breaking up modules into even smaller pieces, even more granularity
  85. yui2 was a modular system, which of course is better than a single monolithic library. However, if you want any part of a module, you have to get the whole thing. YUI3 is sub-modular, breaking up modules into even smaller pieces, even more granularity
  86. yui2 was a modular system, which of course is better than a single monolithic library. However, if you want any part of a module, you have to get the whole thing. YUI3 is sub-modular, breaking up modules into even smaller pieces, even more granularity
  87. Remember when I talked about how DataSource is so much smaller in YUI3? This is why. YUI3 gives you very fine-grained control over which pieces of functionality you wish to pull in, giving you a lot of control over the balance between convenience and customization.
  88. Chances are that this will be part of the YUI 3.1 which if I&amp;#x2019;m not mistaken will be out in Q1 of 2010.
  89. If you really can&amp;#x2019;t wait, then you can always fork yui3 and follow the progress there. Also, YUI 2 has a great AutoComplete widget that works, and is in use all over the place. I highly recommend it.