This document introduces Yahoo! Cocktails and the Mojito framework. It discusses the challenges of developing web applications for complex devices and languages. Yahoo! Cocktails provides a solution through Mojito, which allows developing apps using a single JavaScript codebase that runs on both servers and clients. Mojito apps have a modular structure and provide features like unit testing and internationalization. The document demonstrates building a simple Mojito app and discusses its architecture.
Developers do not have a method for delivering high quality experiences to all popular consumer devices, without having to create applications specific to each device, which is slow and expensive.Current available technologies that try to solve for this problem are proprietary, locking developers to vendors.
A Mix of HTML5, CSS3, YUI and a lot of ingenious, creative mind-binding tricks from Yahoo!
With Mojito developers can create ONE app for several devices while lowering costs, increasing agility and maintaining a uniform aesthetic across screens (web, mobile, tablet). The Mojito code-base that has been open sourced accelerates the development of applications by giving developers the ability to maintain a single codebase for all the connected devices and optimize the application for each device. Because Mojito is built in one language, JavaScript, for client AND server environments, developers enjoy increased productivity - only one code-base to test and fix.an MVC framework to help developers share structured component-based JavaScript code that runs both on client and server.
Yahoo! open sourced Mojito on April 2nd, 2012
Yahoo ! AxisYahoo! Fantasy Finance – is a stock trading game that pits players against each other and their friends for the chance to win $50,000.Sportacular- Fantasy Premier League Football – is the first major fantasy game to allow Premier League fans to draft, manage and discuss their fantasy teams entirely on their smartphone or tablet. Users can also play the game on their laptops; it is the same game on all screens for all fans.Search Direct – Search Direct is a search feature delivering the same rich content from Yahoo!’s products, aggregated as answers, not links, to give people the option to immediately engage and bypass a traditional search results page.
one javascript frameworkruns on client and server100% JavaScript
Views for Different Devices
When you are supporting so many different runtimes, it is important your testing is done right. Mojito offers this built in using YUI 3 Test. YUI Internationalization utilityi18n and BCP 47 as language tags are the identifiers for languages used on the internetJSLint
Views for Different Devices
Analyzing Artifacts
A Mojit is an just an MVC component.Every controller has actions, which generally maps to a view.Views have binders. Can not run on the server, needs to access the view (DOM) for user interaction like click events etc…Binder lets you execute actions back on the controller, whether the controller is on the server or the client, via a Mojit proxy.