SlideShare una empresa de Scribd logo
1 de 47
Building YUI 3 Custom Modules Caridy Patino Frontend Engineer at Yahoo! YUI Contributor Bubbling Library Creator
Overview ,[object Object],[object Object],[object Object],[object Object],[object Object]
What is a module in  YUI 3?
YUI 3 Modules
Using a module ,[object Object],[object Object],[object Object]
Using multiple modules ,[object Object],[object Object],[object Object],[object Object]
Sandboxing modules ,[object Object],[object Object],[object Object],[object Object],[object Object]
Sandboxing modules ,[object Object],[object Object],[object Object],[object Object]
Sandboxing modules
Different sets of modules YUI 3 Modules
Different sets of modules YUI 3 Modules Community modules gallery-*
Different sets of modules YUI 3 Modules Community modules gallery-* Project modules project-*
Community modules Time Picker Accordion / Node Accordion YQL
Project modules
How to use Custom Modules in YUI 3?
Custom Module Registration ,[object Object],[object Object],[object Object],[object Object],[object Object]
Registration by seed ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Registration by inclusion ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Registration by configuration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Organizing configuration ,[object Object],[object Object],[object Object]
Organizing configuration (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How to build a Custom Modules?
Defining a module ,[object Object],[object Object],[object Object],[object Object],[object Object]
Different types of  implementations Utilities Y .one Y .io Y .youtube.play
Different types of  implementations Utilities Y .Anim Y .App.Box Classes
Different types of  implementations Utilities Plugins Y .Plugin.NodeAccordion Classes
Different types of  implementations Utilities Plugins Mashups & Legacy Classes
Utilities ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Classes
Classes (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Classes (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object]
How to use and build plugins in YUI 3?
Plugins: YUI Node ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Plugins (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Plugins (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How to work with mashups and legacy code in YUI 3?
Mashups ,[object Object],[object Object],[object Object],[object Object]
Mashups ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Mashups (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Legacy - YUI 2.x Tabview - Custom Survey System
Legacy (cont.) ,[object Object],[object Object],[object Object],[object Object]
Legacy (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Legacy (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Legacy (cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Recommendations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Conclusions ,[object Object],[object Object],[object Object],[object Object]
Thanks! Caridy Patino http://caridy.name/ http://github.com/caridy http://twitter.com/caridy

Más contenido relacionado

Más de Caridy Patino

YUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI DevelopersYUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI DevelopersCaridy Patino
 
BayJax: Expanding Yahoo! Axis across 3 screens
BayJax: Expanding Yahoo! Axis across 3 screensBayJax: Expanding Yahoo! Axis across 3 screens
BayJax: Expanding Yahoo! Axis across 3 screensCaridy Patino
 
HTML5 summit - DevCon5 - Miami - Feb 2, 2012
HTML5 summit - DevCon5 - Miami - Feb 2, 2012HTML5 summit - DevCon5 - Miami - Feb 2, 2012
HTML5 summit - DevCon5 - Miami - Feb 2, 2012Caridy Patino
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JSConquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JSCaridy Patino
 
JS Loading strategies
JS Loading strategiesJS Loading strategies
JS Loading strategiesCaridy Patino
 
YUI 3 Loading Strategies - YUIConf2010
YUI 3 Loading Strategies - YUIConf2010YUI 3 Loading Strategies - YUIConf2010
YUI 3 Loading Strategies - YUIConf2010Caridy Patino
 

Más de Caridy Patino (6)

YUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI DevelopersYUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI Developers
 
BayJax: Expanding Yahoo! Axis across 3 screens
BayJax: Expanding Yahoo! Axis across 3 screensBayJax: Expanding Yahoo! Axis across 3 screens
BayJax: Expanding Yahoo! Axis across 3 screens
 
HTML5 summit - DevCon5 - Miami - Feb 2, 2012
HTML5 summit - DevCon5 - Miami - Feb 2, 2012HTML5 summit - DevCon5 - Miami - Feb 2, 2012
HTML5 summit - DevCon5 - Miami - Feb 2, 2012
 
Conquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JSConquistando el Servidor con Node.JS
Conquistando el Servidor con Node.JS
 
JS Loading strategies
JS Loading strategiesJS Loading strategies
JS Loading strategies
 
YUI 3 Loading Strategies - YUIConf2010
YUI 3 Loading Strategies - YUIConf2010YUI 3 Loading Strategies - YUIConf2010
YUI 3 Loading Strategies - YUIConf2010
 

Último

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Building YUI 3 Custom Modules

Notas del editor

  1. This talk will cover how to use YUI 3.x infrastructure to create individual pieces of code that can be injected in any page to carry on a certain functionality. Also how these mashups can combine YUI widgets and utilities with 3rd party codes and how to reuse them between different YUI instances.
  2. I will talk about modules as the basic structures in YUI 3 Modules that are not part of YUI 3.0 How to Use and extend modules Organization and granularity: From global to granular approaches (Wordpress, Drupal, to Y! Front Page, Y! Mail, Gmail, Mint.com, etc) And finally, we will see how to bring legacy code into a YUI 3 implementation, including yui 2 stuff
  3. Let’s start from the very beginning: Every piece of code, in yui 3, is a module, just like in yui 2 All the code in yui 3 was designed with the sandboxing capabilities in mind A module represent an individual piece of software that can work alone, or in conjunction with other modules. - YUI 3.0 was shipped with a limited set of modules
  4. As you can see, modules can represent a widget: something that you will see in the page, like an overlay. Or just a low level utility to parse an string, like json utility. - Let’s see how we can use these built-in modules in a page
  5. First of all, to use a module, we need a YUI instance, we call it sandbox. “ use” is the basic method to inject modules into a sandbox. RED elements represent a reference to the sandbox object “ use” includes the requirements in the page (in this case, just “node”) and then it calls the callback function
  6. In this example we have 2 different modules playing together in the same sandbox
  7. The origin of the new syntax in yui 3.x, and how sandbox works
  8. similar feature, different syntax
  9. you can call “use” at anytime. In this case the second callback receive a reference to a sandbox. Y2 === Y.
  10. Now, what about those modules that are not part of YUI 3.0? Those modules that we will like to use in the daily basics Or those specific modules that we will like to have for one particular project
  11. Now that we have the brand new YUI 3 Gallery, we will have custom modules created by YUI Contributors
  12. And Finally, those modules that you will create for your app, for an specific project or just a piece of code that you will use in your daily basics.
  13. Few example of modules from the gallery: YQL wrapper Time Picker Collapsible and Expandable elements
  14. Few more examples of project and legacy modules: YUI 2.x tabview Survey widget
  15. The module registration process represents the action of adding module’s metadata to YUI 3 Loader. It needs to know: what is the name of the module? where is located? what are the dependencies (requirements)? and few more settings at the module level
  16. There are 3 different ways to register a module in yui 3. - By Seed - By Inclusion - By Configuration Let’s see each of them in details:
  17. - Just keep an eye on the performance with this approach
  18. - Recommended implementation
  19. - You can organize your repository of modules at the top. - YUI_config is not ready yet, it will be ready in 3.1 - In the meantime, you can use MY_YUI_config object to pass it thru all the YUI instances in your page
  20. Let’s focus on the implementation part and how we can extend the sandbox object
  21. Let’s go deeper in these different types of implementations
  22. Before going into the classes definitions, I will like to cover a set of utilities provided by YUI 3 to facilitate the creation of new classes.
  23. Continuing with the counter example, this module can be build using a class implementation, defining the prototype for that class as a new member for the current sandbox.
  24. Using the counter class
  25. Plugin Definition
  26. project-layout-lhs is a Custom Module to wrap a mashup implementation based on the previous example this new module can be now easily re-used thru a project/site/app It can also support specific configurations
  27. Legacy code is a big pain, specially for FE, and YUI 3 is not an exception. As you know YUI 2 and YUI 3 can play nicely in the same page, but who should control who? And what about the code that we wrote on top of YUI 2.x? Or any other JS code? In this slide you can see a muckup using YUI 2.x tabview, and also a custom survey system How can we bring this to YUI 3?
  28. Again, there are two ways to handle this: - Building a sandbox to wrap the legacy code, to delegate the loading process of all JS files to YUI 3 - The second option is to build a Custom Module to wrap the legacy code, and using this new module in your pages.
  29. - Building a sandbox to wrap the legacy code, to delegate the loading process of all JS files to YUI 3
  30. - The second option is to build a Custom Module to wrap the legacy code, and using this new module in your pages.