SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Mojito and Cocktails
@ddsakura
I am…
—  ddsakura   / 賽拉維.柯南




                          2
Outline




          3
Cocktails is
—  an
     alcoholic mixed drink that contains
  two or more ingredients — at least one
  of the ingredients must be a spirit.




                                           4
Cocktails is also
—  amix of HTML5, NodeJS, CSS3,YUI and a
   lot of ingenious, creative mind-bending
   tricks from Yahoo!




                                         5
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




                                                6
Eating your own dog food
—  like Yahoo!   Livestand.




                               7
Mojito is
—  Mojito   (/moʊˈhiːtoʊ/)
  ◦  It is a kind of cocktail




                                8
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
The idea is




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




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




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




                                            13
Mojits




         14
16
17
19
Mojito application concept




                             20
Mojito application directory
structure




                               21
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
                                                   22
Configuration
—  Application
  Configuration
  ◦  The application is
     configured in the
     application.json file in the
     application directory.
  ◦  http://
     developer.yahoo.com/
     cocktails/mojito/docs/
     intro/
     mojito_configuring.html
                                    23
Configuration
—  Routing                         [
                                        {
  ◦  In Mojito, routing is the              "settings": [ "master" ],
     mapping of URLs to                     "foo index": {
     specific mojit actions. This             "verbs": ["get"],
                                              "path": "/",
     section will describe the                "call": ”@myMojit.index"
     routing configuration file             }
     routes.json                        }
  ◦  http://                        ]
     developer.yahoo.com/
     cocktails/mojito/docs/
     intro/
     mojito_configuring.html
                                                                         24
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                25
Template Engine
—  Currently, theonly template system
    allowed is Mustache, so the name of view
    templates always contains mu
—  http://mustache.github.com/




                                               26
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.




                                                                                             27
The tools for Multi-Device
—    CSS3 Media Queries




—    Mojito view template

                             28
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


                                                    29
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
                                                  30
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_framework_mojits.html
                                                           31
DEMO – HTMLFrameMojit & API




                              32
DEMO – LazyLoad



                  33
Deployment
—  Mojito   on Heroku




                         34
Mojito Shaker
—  Shaker  is a static asset rollup manager for
    Mojito applications.
—  https://github.com/yahoo/mojito-shaker
—  http://developer.yahoo.com/cocktails/
    shaker/



                                               35
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
                                                     36
Contact info
—  @ddsakura
—  Demo sample code
 https://github.com/ddsakura/
 mojitoHelloworld




                                37

Contenu connexe

Similaire à Mojito@nodejstw

FEDM Meetup: Introducing Mojito
FEDM Meetup: Introducing MojitoFEDM Meetup: Introducing Mojito
FEDM Meetup: Introducing MojitoCaridy Patino
 
Yahoo! 釀的酒 - 淺嚐 Cocktails
Yahoo! 釀的酒 - 淺嚐 CocktailsYahoo! 釀的酒 - 淺嚐 Cocktails
Yahoo! 釀的酒 - 淺嚐 CocktailsYing-Hsiang Liao
 
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
 
Building for multiple devices using a single language and framework
Building for multiple devices using a single language and frameworkBuilding for multiple devices using a single language and framework
Building for multiple devices using a single language and frameworkFabian Frank
 
Mojito: Building for multiple devices using a single language and framework
Mojito: Building for multiple devices using a single language and frameworkMojito: Building for multiple devices using a single language and framework
Mojito: Building for multiple devices using a single language and frameworkDiego Ferreiro Val
 
YUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI DevelopersYUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI DevelopersCaridy Patino
 
How to integrate portlet as widget in liferay to any website application
How to integrate portlet as widget in liferay to any website applicationHow to integrate portlet as widget in liferay to any website application
How to integrate portlet as widget in liferay to any website applicationAzilen Technologies Pvt. Ltd.
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development Mage Guru
 
jQueryMobile Jump Start
jQueryMobile Jump StartjQueryMobile Jump Start
jQueryMobile Jump StartHaim Michael
 
Html5 mobile develop tools
Html5 mobile develop toolsHtml5 mobile develop tools
Html5 mobile develop toolsLey Liu
 
Yahoo! scale Node.js
Yahoo! scale Node.jsYahoo! scale Node.js
Yahoo! scale Node.jsFabian Frank
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with JoomlaAnand Sharma
 
Schemaorg cmsplugins
Schemaorg cmspluginsSchemaorg cmsplugins
Schemaorg cmspluginsSTIinnsbruck
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureZachary Klein
 
Going Mobile
Going MobileGoing Mobile
Going MobileStephen G
 
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3Doris Chen
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoAhmed Salama
 

Similaire à Mojito@nodejstw (20)

FEDM Meetup: Introducing Mojito
FEDM Meetup: Introducing MojitoFEDM Meetup: Introducing Mojito
FEDM Meetup: Introducing Mojito
 
Mojito
MojitoMojito
Mojito
 
Yahoo! 釀的酒 - 淺嚐 Cocktails
Yahoo! 釀的酒 - 淺嚐 CocktailsYahoo! 釀的酒 - 淺嚐 Cocktails
Yahoo! 釀的酒 - 淺嚐 Cocktails
 
淺談 NodeJS 與框架
淺談 NodeJS 與框架淺談 NodeJS 與框架
淺談 NodeJS 與框架
 
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
 
Building for multiple devices using a single language and framework
Building for multiple devices using a single language and frameworkBuilding for multiple devices using a single language and framework
Building for multiple devices using a single language and framework
 
Mojito: Building for multiple devices using a single language and framework
Mojito: Building for multiple devices using a single language and frameworkMojito: Building for multiple devices using a single language and framework
Mojito: Building for multiple devices using a single language and framework
 
YUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI DevelopersYUIConf2012: Mojito for YUI Developers
YUIConf2012: Mojito for YUI Developers
 
How to integrate portlet as widget in liferay to any website application
How to integrate portlet as widget in liferay to any website applicationHow to integrate portlet as widget in liferay to any website application
How to integrate portlet as widget in liferay to any website application
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
jQueryMobile Jump Start
jQueryMobile Jump StartjQueryMobile Jump Start
jQueryMobile Jump Start
 
Html5 mobile develop tools
Html5 mobile develop toolsHtml5 mobile develop tools
Html5 mobile develop tools
 
Yahoo! scale Node.js
Yahoo! scale Node.jsYahoo! scale Node.js
Yahoo! scale Node.js
 
Integrate Shindig with Joomla
Integrate Shindig with JoomlaIntegrate Shindig with Joomla
Integrate Shindig with Joomla
 
Schemaorg cmsplugins
Schemaorg cmspluginsSchemaorg cmsplugins
Schemaorg cmsplugins
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro Future
 
Going Mobile
Going MobileGoing Mobile
Going Mobile
 
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Windows 8 apps with JavaScript, HTML5 & CSS3
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 

Dernier

Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideStefan Dietze
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimaginedpanagenda
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 

Dernier (20)

Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 

Mojito@nodejstw

  • 2. I am… —  ddsakura / 賽拉維.柯南 2
  • 4. Cocktails is —  an alcoholic mixed drink that contains two or more ingredients — at least one of the ingredients must be a spirit. 4
  • 5. Cocktails is also —  amix of HTML5, NodeJS, CSS3,YUI and a lot of ingenious, creative mind-bending tricks from Yahoo! 5
  • 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 6
  • 7. Eating your own dog food —  like Yahoo! Livestand. 7
  • 8. Mojito is —  Mojito (/moʊˈhiːtoʊ/) ◦  It is a kind of cocktail 8
  • 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
  • 10. The idea is From Matt Taylor http://www.slideshare.net/rhyolight/mojito-sl-2011 10
  • 11. The idea is From Matt Taylor http://www.slideshare.net/rhyolight/mojito-sl-2011 11
  • 12. The idea is From Matt Taylor http://www.slideshare.net/rhyolight/mojito-sl-2011 12
  • 13. Mojito is open! —  http://developer.yahoo.com/cocktails/ mojito/ —  https://github.com/yahoo/mojito/ 13
  • 14. Mojits 14
  • 15.
  • 16. 16
  • 17. 17
  • 18.
  • 19. 19
  • 22. 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 22
  • 23. Configuration —  Application Configuration ◦  The application is configured in the application.json file in the application directory. ◦  http:// developer.yahoo.com/ cocktails/mojito/docs/ intro/ mojito_configuring.html 23
  • 24. Configuration —  Routing [ { ◦  In Mojito, routing is the "settings": [ "master" ], mapping of URLs to "foo index": { specific mojit actions. This "verbs": ["get"], "path": "/", section will describe the "call": ”@myMojit.index" routing configuration file } routes.json } ◦  http:// ] developer.yahoo.com/ cocktails/mojito/docs/ intro/ mojito_configuring.html 24
  • 25. 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 25
  • 26. Template Engine —  Currently, theonly template system allowed is Mustache, so the name of view templates always contains mu —  http://mustache.github.com/ 26
  • 27. 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. 27
  • 28. The tools for Multi-Device —  CSS3 Media Queries —  Mojito view template 28
  • 29. 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 29
  • 30. 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 30
  • 31. 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_framework_mojits.html 31
  • 35. Mojito Shaker —  Shaker is a static asset rollup manager for Mojito applications. —  https://github.com/yahoo/mojito-shaker —  http://developer.yahoo.com/cocktails/ shaker/ 35
  • 36. 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 36
  • 37. Contact info —  @ddsakura —  Demo sample code https://github.com/ddsakura/ mojitoHelloworld 37