SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Cocktails – Shaken, Not Stirred
            Product engineering, APAC
                   F2E & Mobile Team

                         Eric Chuang
I am…
 Eric Chuang/ ddsakura / 賽拉維.柯南
 YAHOO! Product engineering, APAC, F2E & Mobile Team
 We built




                               2                        4/14/2012
Outline




Yahoo! Presentation, Confidential   3   4/14/2012
Cocktails is
 an alcoholic mixed drink that contains two or more ingredients — at
  least one of the ingredients must be a spirit.




                                   4                          4/14/2012
Cocktails is also
 a mix of HTML5, NodeJS, CSS3, YUI and a lot of ingenious, creative
  mind-bending tricks from Yahoo!




                                  5                         4/14/2012
Cocktails and YUI
 YUI is a free, open source JavaScript and CSS framework for building
  richly interactive web applications
    ›   http://developer.yahoo.com/yui/
    ›   https://github.com/yui
   YUI3 is a foundation for Cocktails
   Mojito built using YUI3
    ›   Mostly subset of Mojito : YUI App Framework




                                             6               4/14/2012
Eating your own dog food
 We’ve been working with Cocktails for a while internally
  ›   building hybrid apps like Yahoo! Livestand. http://itunes.apple.com/us/app/livestand-
      from-yahoo!/id469314404?mt=8
  ›   Fantasy Finance, a Web site. http://finance.yahoo.com/fantasy-finance
  ›   Fantasy Premier League Football, a mobile Web app.
      http://uk.premierleague.fantasysports.yahoo.com/




                                             7                                  4/14/2012
Mojito is
 Mojito (/moʊˈhiˈto/)
                   ʊ
 ›   It is a kind of cocktail




                                8   4/14/2012
Mojito is
 Mojito is a MVC application framework built on YUI 3.
 One Language
  ›   Mojito allows developers to write client and server components in the same language
      - JavaScript, using the same framework.
 Two Runtimes
  ›   Mojito can run on the client (in the browser) and on the server (with Node.js).
 In addition, Mojito has built-in support for internationalization and
  testing




                                              9                                   4/14/2012
The idea is




From Matt Taylor http://www.slideshare.net/rhyolight/mojito-sl-2011   10   4/14/2012
The idea is




From Matt Taylor http://www.slideshare.net/rhyolight/mojito-sl-2011   11   4/14/2012
The idea is




From Matt Taylor http://www.slideshare.net/rhyolight/mojito-sl-2011   12   4/14/2012
Mojito is open!
 http://developer.yahoo.com/cocktails/mojito/
 https://github.com/yahoo/mojito/




                                   13            4/14/2012
Mojito application concept




                    14       4/14/2012
Mojito application directory structure




                    15               4/14/2012
DEMO - Hello World
 Install nodejs and npm
 Get mojito from npm registry
  ›   npm install mojito -g
 Create a mojito application
  ›   mojito create app helloworld
 Create a mojit in application
  ›   mojito create mojit myMojit
 Modify the controller.server.js
  ›   vi mojits/myMojit/controller.server.js
 Run the mojito application
  ›   mojito start
 Go to http://localhost:8666/@myMojit/index


                                               16   4/14/2012
Mojito application concept




                    17       4/14/2012
Configuration
 Application Configuration
  ›   The application is configured in the
      application.json file in the application
      directory.
  ›   http://developer.yahoo.com/cocktails/moj
      ito/docs/intro/mojito_configuring.html




                                                 18   4/14/2012
Configuration
 Routing
                                                    [
 ›   In Mojito, routing is the mapping of URLs          {
     to specific mojit actions. This section will
                                                            "settings": [ "master" ],
     describe the routing configuration file
     routes.json                                            "foo index": {
                                                              "verbs": ["get"],
 ›   http://developer.yahoo.com/cocktails/moj
     ito/docs/intro/mojito_configuring.html
                                                              "path": "/",
                                                              "call": ”@myMojit.index"
                                                            }
                                                        }
                                                    ]




                                              19                                4/14/2012
DEMO - Routing
 Create the file routes.json with the following
      [
          {
              "settings": ["master"],
              "index_route": {
                "verbs": ["get"],
                "path": "/index",
                "call": "@myMojit.index"
              }
          }
      ]
 Run the mojito application
  ›       mojito start
 Go to http://localhost:8666/index

                                           20      4/14/2012
Views in Mojito
 The views are HTML files that can include template tags, such as
  Mustache tags, and are located in the views directory
 We call these files view templates
 Naming Convention for view templates
  ›   {controller_function}.[{device}].{rendering_engine}.html
 Example
  ›   greeting.mu.html - This view template gets data from the greeting function of the
      controller and the calling device is determined to be a Web browser.
  ›   get_photos.iphone.mu.html - This view template gets data from the get_photos
      function of the controller and the calling device is an iPhone.
  ›   find_friend.android.mu.html - This view template gets data from the find_friend
      function of the controller and the calling device is Android based.



                                             21                                 4/14/2012
Template Engine
 Currently, the only template system allowed is Mustache, so the name
  of view templates always contains mu
 http://mustache.github.com/




                                  22                         4/14/2012
The tools for Multi-Device
 CSS3 Media Queries




 Mojito view template

                         23   4/14/2012
DEMO – Views for different Devices
 Create index.iphone.mu.html
  ›   cp index.mu.html index.iphone.mu.html
  ›   vi mojits/myMojit/views/index.iphone.mu.html
 Run the mojito application
  ›   mojito start
 Go to http://localhost:8666/index




                                            24       4/14/2012
Mojito API
 Mojito has an API that includes addons and methods for handling
  parameters, cookies, URLs, assets, REST
  calls, globalization/localization, and more.
 http://developer.yahoo.com/cocktails/mojito/docs/api_overview/
 http://developer.yahoo.com/cocktails/mojito/api/index.html




                                  25                         4/14/2012
Built-in Mojits
 Mojito comes with the built-in utility mojits that make developing
  applications easier.
 HTMLFrameMojit
  ›   The HTMLFrameMojit builds the HTML skeleton of a Web page.
 LazyLoadMojit
  ›   This allows Mojito application to load the page quickly and then lazily load parts of
      the page.
 http://developer.yahoo.com/cocktails/mojito/docs/topics/mojito_frame
  work_mojits.html




                                              26                                  4/14/2012
DEMO – HTMLFrameMojit & API
   Edit application.json file
   Edit routes.json
   Edit controller file
index: function(ac) {
  ac.assets.addBlob('<meta name = "viewport" content = "width=device-
width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">', 'top');
  ….
     }


   Run the mojito application
   Go to http://localhost:8666/index



                                         27                                4/14/2012
DEMO – LazyLoad
   Edit application.json file
   Create and Edit container mojit
   Edit myMojit Controller
   Run the mojito application
   Go to http://localhost:8666/index




                                        28   4/14/2012
Conclusion
 Cocktails is an ecosystem mix of HTML5, NodeJS, CSS3, YUI and
  relative technology
 Mojito is a MVC application framework
  ›   One language
  ›   Two Runtimes
 Mojito is available under a BSD license
 A lot of docs are available, we can start from
  http://developer.yahoo.com/cocktails/mojito/
 We also have forum to discuss this:
  http://developer.yahoo.com/forum/Yahoo-Mojito




                                  29                     4/14/2012
Contact info
 @ddsakura
 Demo sample code https://github.com/ddsakura/mojitoHelloworld




                                30                         4/14/2012

Weitere ähnliche Inhalte

Andere mochten auch

The art of the classic cocktail 3
The art of the classic cocktail 3The art of the classic cocktail 3
The art of the classic cocktail 3Elayne Duff
 
Host Edmonton 23 May 2014 Classic Cocktails
Host Edmonton 23 May 2014 Classic CocktailsHost Edmonton 23 May 2014 Classic Cocktails
Host Edmonton 23 May 2014 Classic CocktailsPhilip Duff
 
40 international alcoholic cocktails
40 international  alcoholic cocktails40 international  alcoholic cocktails
40 international alcoholic cocktailsRaymar Baquilar
 
Cocktail and mocktail
Cocktail and mocktailCocktail and mocktail
Cocktail and mocktailVarun Rathore
 
25 international cocktails
25 international cocktails25 international cocktails
25 international cocktailsSteven Asis
 
The Process of Making Wine and Champagne
The Process of Making Wine and ChampagneThe Process of Making Wine and Champagne
The Process of Making Wine and ChampagneEmily Stellfox
 
The wine making process
The wine making processThe wine making process
The wine making processpaolamarti55
 
Android N multi window
Android N multi windowAndroid N multi window
Android N multi windowYu-Wei Chuang
 

Andere mochten auch (10)

The art of the classic cocktail 3
The art of the classic cocktail 3The art of the classic cocktail 3
The art of the classic cocktail 3
 
Host Edmonton 23 May 2014 Classic Cocktails
Host Edmonton 23 May 2014 Classic CocktailsHost Edmonton 23 May 2014 Classic Cocktails
Host Edmonton 23 May 2014 Classic Cocktails
 
40 international alcoholic cocktails
40 international  alcoholic cocktails40 international  alcoholic cocktails
40 international alcoholic cocktails
 
Cocktail and mocktail
Cocktail and mocktailCocktail and mocktail
Cocktail and mocktail
 
25 international cocktails
25 international cocktails25 international cocktails
25 international cocktails
 
The Process of Making Wine and Champagne
The Process of Making Wine and ChampagneThe Process of Making Wine and Champagne
The Process of Making Wine and Champagne
 
Cocktail
CocktailCocktail
Cocktail
 
Alcoholic Beverages
Alcoholic BeveragesAlcoholic Beverages
Alcoholic Beverages
 
The wine making process
The wine making processThe wine making process
The wine making process
 
Android N multi window
Android N multi windowAndroid N multi window
Android N multi window
 

Ähnlich wie Cocktails – Shaken, Not Stirred @osdc.tw

FEDM Meetup: Introducing Mojito
FEDM Meetup: Introducing MojitoFEDM Meetup: Introducing Mojito
FEDM Meetup: Introducing MojitoCaridy Patino
 
Introduction to the Yahoo! Mojito Node.js MVC
Introduction to the Yahoo! Mojito Node.js MVCIntroduction to the Yahoo! Mojito Node.js MVC
Introduction to the Yahoo! Mojito Node.js MVCAvinash Chukka
 
Yahoo! Hack India: Hyderabad | Introduction to the Yahoo! Mojito Node.js MVC
Yahoo! Hack India: Hyderabad | Introduction to the Yahoo! Mojito Node.js MVCYahoo! Hack India: Hyderabad | Introduction to the Yahoo! Mojito Node.js MVC
Yahoo! Hack India: Hyderabad | Introduction to the Yahoo! Mojito Node.js MVCYahoo Developer Network
 
Open Hack Taiwan 2012 - Mojito intro
Open Hack Taiwan 2012 - Mojito introOpen Hack Taiwan 2012 - Mojito intro
Open Hack Taiwan 2012 - Mojito introsriramiyer2007
 
Dojo mobile web5-2013
Dojo mobile web5-2013Dojo mobile web5-2013
Dojo mobile web5-2013cjolif
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with JoomlaAnand Sharma
 
Yahoo! Mojito talk on Agency Hackday
Yahoo! Mojito talk on Agency HackdayYahoo! Mojito talk on Agency Hackday
Yahoo! Mojito talk on Agency HackdayGaurav Vaish
 
Y! Open Hack 2013 (London)
Y! Open Hack 2013 (London)Y! Open Hack 2013 (London)
Y! Open Hack 2013 (London)Gaurav Vaish
 
Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...
Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...
Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...Carlos Tomas
 
Movable Type Seminar 2011
Movable Type Seminar 2011Movable Type Seminar 2011
Movable Type Seminar 2011Six Apart KK
 
YUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI DevelopersYUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI DevelopersCaridy Patino
 
Movable Type 5 Smartphone Option
Movable Type 5 Smartphone OptionMovable Type 5 Smartphone Option
Movable Type 5 Smartphone OptionSix Apart KK
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development Mage Guru
 
Yahoo! 釀的酒 - 淺嚐 Cocktails
Yahoo! 釀的酒 - 淺嚐 CocktailsYahoo! 釀的酒 - 淺嚐 Cocktails
Yahoo! 釀的酒 - 淺嚐 CocktailsYing-Hsiang Liao
 
Mobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileMobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileTerry Ryan
 
Best Practices in Mobile Development: Building Your First jQuery Mobile App
Best Practices in Mobile Development: Building Your First jQuery Mobile AppBest Practices in Mobile Development: Building Your First jQuery Mobile App
Best Practices in Mobile Development: Building Your First jQuery Mobile AppSt. Petersburg College
 
IBM Connect2014 JMP106
IBM Connect2014 JMP106IBM Connect2014 JMP106
IBM Connect2014 JMP106Thomas Evans
 

Ähnlich wie Cocktails – Shaken, Not Stirred @osdc.tw (20)

FEDM Meetup: Introducing Mojito
FEDM Meetup: Introducing MojitoFEDM Meetup: Introducing Mojito
FEDM Meetup: Introducing Mojito
 
Yahoo! Mojito
Yahoo! MojitoYahoo! Mojito
Yahoo! Mojito
 
Introduction to the Yahoo! Mojito Node.js MVC
Introduction to the Yahoo! Mojito Node.js MVCIntroduction to the Yahoo! Mojito Node.js MVC
Introduction to the Yahoo! Mojito Node.js MVC
 
Yahoo! Hack India: Hyderabad | Introduction to the Yahoo! Mojito Node.js MVC
Yahoo! Hack India: Hyderabad | Introduction to the Yahoo! Mojito Node.js MVCYahoo! Hack India: Hyderabad | Introduction to the Yahoo! Mojito Node.js MVC
Yahoo! Hack India: Hyderabad | Introduction to the Yahoo! Mojito Node.js MVC
 
Open Hack Taiwan 2012 - Mojito intro
Open Hack Taiwan 2012 - Mojito introOpen Hack Taiwan 2012 - Mojito intro
Open Hack Taiwan 2012 - Mojito intro
 
Complete Dojo
Complete DojoComplete Dojo
Complete Dojo
 
Dojo mobile web5-2013
Dojo mobile web5-2013Dojo mobile web5-2013
Dojo mobile web5-2013
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with Joomla
 
Yahoo! Mojito talk on Agency Hackday
Yahoo! Mojito talk on Agency HackdayYahoo! Mojito talk on Agency Hackday
Yahoo! Mojito talk on Agency Hackday
 
Y! Open Hack 2013 (London)
Y! Open Hack 2013 (London)Y! Open Hack 2013 (London)
Y! Open Hack 2013 (London)
 
Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...
Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...
Build a notepad application with PHP, MongoDB, and IBM Bluemix - by Vikram Va...
 
Movable Type Seminar 2011
Movable Type Seminar 2011Movable Type Seminar 2011
Movable Type Seminar 2011
 
YUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI DevelopersYUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI Developers
 
Movable Type 5 Smartphone Option
Movable Type 5 Smartphone OptionMovable Type 5 Smartphone Option
Movable Type 5 Smartphone Option
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
Yahoo! 釀的酒 - 淺嚐 Cocktails
Yahoo! 釀的酒 - 淺嚐 CocktailsYahoo! 釀的酒 - 淺嚐 Cocktails
Yahoo! 釀的酒 - 淺嚐 Cocktails
 
Mobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery MobileMobile Apps with PhoneGap and jQuery Mobile
Mobile Apps with PhoneGap and jQuery Mobile
 
Best Practices in Mobile Development: Building Your First jQuery Mobile App
Best Practices in Mobile Development: Building Your First jQuery Mobile AppBest Practices in Mobile Development: Building Your First jQuery Mobile App
Best Practices in Mobile Development: Building Your First jQuery Mobile App
 
Dojo tutorial
Dojo tutorialDojo tutorial
Dojo tutorial
 
IBM Connect2014 JMP106
IBM Connect2014 JMP106IBM Connect2014 JMP106
IBM Connect2014 JMP106
 

Kürzlich hochgeladen

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Kürzlich hochgeladen (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Cocktails – Shaken, Not Stirred @osdc.tw

  • 1. Cocktails – Shaken, Not Stirred Product engineering, APAC F2E & Mobile Team Eric Chuang
  • 2. I am…  Eric Chuang/ ddsakura / 賽拉維.柯南  YAHOO! Product engineering, APAC, F2E & Mobile Team  We built 2 4/14/2012
  • 4. Cocktails is  an alcoholic mixed drink that contains two or more ingredients — at least one of the ingredients must be a spirit. 4 4/14/2012
  • 5. Cocktails is also  a mix of HTML5, NodeJS, CSS3, YUI and a lot of ingenious, creative mind-bending tricks from Yahoo! 5 4/14/2012
  • 6. Cocktails and YUI  YUI is a free, open source JavaScript and CSS framework for building richly interactive web applications › http://developer.yahoo.com/yui/ › https://github.com/yui  YUI3 is a foundation for Cocktails  Mojito built using YUI3 › Mostly subset of Mojito : YUI App Framework 6 4/14/2012
  • 7. Eating your own dog food  We’ve been working with Cocktails for a while internally › building hybrid apps like Yahoo! Livestand. http://itunes.apple.com/us/app/livestand- from-yahoo!/id469314404?mt=8 › Fantasy Finance, a Web site. http://finance.yahoo.com/fantasy-finance › Fantasy Premier League Football, a mobile Web app. http://uk.premierleague.fantasysports.yahoo.com/ 7 4/14/2012
  • 8. Mojito is  Mojito (/moʊˈhiˈto/) ʊ › It is a kind of cocktail 8 4/14/2012
  • 9. Mojito is  Mojito is a MVC application framework built on YUI 3.  One Language › Mojito allows developers to write client and server components in the same language - JavaScript, using the same framework.  Two Runtimes › Mojito can run on the client (in the browser) and on the server (with Node.js).  In addition, Mojito has built-in support for internationalization and testing 9 4/14/2012
  • 10. The idea is From Matt Taylor http://www.slideshare.net/rhyolight/mojito-sl-2011 10 4/14/2012
  • 11. The idea is From Matt Taylor http://www.slideshare.net/rhyolight/mojito-sl-2011 11 4/14/2012
  • 12. The idea is From Matt Taylor http://www.slideshare.net/rhyolight/mojito-sl-2011 12 4/14/2012
  • 13. Mojito is open!  http://developer.yahoo.com/cocktails/mojito/  https://github.com/yahoo/mojito/ 13 4/14/2012
  • 15. Mojito application directory structure 15 4/14/2012
  • 16. DEMO - Hello World  Install nodejs and npm  Get mojito from npm registry › npm install mojito -g  Create a mojito application › mojito create app helloworld  Create a mojit in application › mojito create mojit myMojit  Modify the controller.server.js › vi mojits/myMojit/controller.server.js  Run the mojito application › mojito start  Go to http://localhost:8666/@myMojit/index 16 4/14/2012
  • 18. Configuration  Application Configuration › The application is configured in the application.json file in the application directory. › http://developer.yahoo.com/cocktails/moj ito/docs/intro/mojito_configuring.html 18 4/14/2012
  • 19. Configuration  Routing [ › In Mojito, routing is the mapping of URLs { to specific mojit actions. This section will "settings": [ "master" ], describe the routing configuration file routes.json "foo index": { "verbs": ["get"], › http://developer.yahoo.com/cocktails/moj ito/docs/intro/mojito_configuring.html "path": "/", "call": ”@myMojit.index" } } ] 19 4/14/2012
  • 20. DEMO - Routing  Create the file routes.json with the following [ { "settings": ["master"], "index_route": { "verbs": ["get"], "path": "/index", "call": "@myMojit.index" } } ]  Run the mojito application › mojito start  Go to http://localhost:8666/index 20 4/14/2012
  • 21. Views in Mojito  The views are HTML files that can include template tags, such as Mustache tags, and are located in the views directory  We call these files view templates  Naming Convention for view templates › {controller_function}.[{device}].{rendering_engine}.html  Example › greeting.mu.html - This view template gets data from the greeting function of the controller and the calling device is determined to be a Web browser. › get_photos.iphone.mu.html - This view template gets data from the get_photos function of the controller and the calling device is an iPhone. › find_friend.android.mu.html - This view template gets data from the find_friend function of the controller and the calling device is Android based. 21 4/14/2012
  • 22. Template Engine  Currently, the only template system allowed is Mustache, so the name of view templates always contains mu  http://mustache.github.com/ 22 4/14/2012
  • 23. The tools for Multi-Device  CSS3 Media Queries  Mojito view template 23 4/14/2012
  • 24. DEMO – Views for different Devices  Create index.iphone.mu.html › cp index.mu.html index.iphone.mu.html › vi mojits/myMojit/views/index.iphone.mu.html  Run the mojito application › mojito start  Go to http://localhost:8666/index 24 4/14/2012
  • 25. Mojito API  Mojito has an API that includes addons and methods for handling parameters, cookies, URLs, assets, REST calls, globalization/localization, and more.  http://developer.yahoo.com/cocktails/mojito/docs/api_overview/  http://developer.yahoo.com/cocktails/mojito/api/index.html 25 4/14/2012
  • 26. Built-in Mojits  Mojito comes with the built-in utility mojits that make developing applications easier.  HTMLFrameMojit › The HTMLFrameMojit builds the HTML skeleton of a Web page.  LazyLoadMojit › This allows Mojito application to load the page quickly and then lazily load parts of the page.  http://developer.yahoo.com/cocktails/mojito/docs/topics/mojito_frame work_mojits.html 26 4/14/2012
  • 27. DEMO – HTMLFrameMojit & API  Edit application.json file  Edit routes.json  Edit controller file index: function(ac) { ac.assets.addBlob('<meta name = "viewport" content = "width=device- width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">', 'top'); …. }  Run the mojito application  Go to http://localhost:8666/index 27 4/14/2012
  • 28. DEMO – LazyLoad  Edit application.json file  Create and Edit container mojit  Edit myMojit Controller  Run the mojito application  Go to http://localhost:8666/index 28 4/14/2012
  • 29. Conclusion  Cocktails is an ecosystem mix of HTML5, NodeJS, CSS3, YUI and relative technology  Mojito is a MVC application framework › One language › Two Runtimes  Mojito is available under a BSD license  A lot of docs are available, we can start from http://developer.yahoo.com/cocktails/mojito/  We also have forum to discuss this: http://developer.yahoo.com/forum/Yahoo-Mojito 29 4/14/2012
  • 30. Contact info  @ddsakura  Demo sample code https://github.com/ddsakura/mojitoHelloworld 30 4/14/2012