Giter Club home page Giter Club logo

mojito-shaker's Introduction

Shaker

Shake it!

Shaker is a static asset rollup manager for Mojito applications.

A rollup consists of one or more input files that are combined (rolled up) to produce a single output file. Rollups can be as simple as a single file, a single mojit binder and its dependencies, or any combination thereof. Rollups are used to reduce the number of HTTP requests, which helps improve the performance of web sites and web applications.

Shaker allows you to create rollups regarding different combination of dimensions, for example you may wanna serve different assets when people are connected from different devices, different countries, etc.

For more information, please see the online documentation.

Installation

Shaker can be installed either locally or globally (using -g option), but we encourage you to install it locally, since the reference to the inner mojits will be relative to the app.

  1. Get the mojito-shaker npm package and install it:

     $ cd myMojitoApp
     $ npm install mojito-shaker [-g]
    
  2. If you installed it locally you will have to link it:

     $ cd ./node_modules/mojito-shaker/ && sudo npm link 
    
  3. Confirm that Shaker has been installed correctly by running:

     $ mojito-shake
    
  4. If you got some error, check if you have correctly configured the Node environment. You can try to set the right $NODE_PATH to the modules using:

     $ export NODE_PATH=:$NODE_PATH:`npm root -g`
    

Quick Start

Within a Mojito application root folder:

Edit application.json to configure the mojitDirs and the HTMLFrame so that it looks like:

[
    {
        "settings": [ "master" ],
        "mojitsDirs": ["mojits","node_modules/shaker/mojits"]
        "specs": {
            "htmlframe": {
                "type": "ShakerHTMLFrameMojit"
            }
        }
    }
]

Note: If you installed mojito-shaker globally you will have to point to the absolute path instead.

Execute Shaker and Start the server:

$ mojito-shake [--context "environment:{value}"] [--run]
$ mojito-start [--context "environment:{value}"]

Go to URL:

http://localhost:8666/

Documentation

You can access the documentation here: http://developer.yahoo.com/cocktails/shaker

If you want to build and contribute to the documentation, you will have to install Sphinx and under /docs run:

$ make html

Licensing and Contributions

Shaker is licensed under a BSD license.

To contribute to the Shaker project, please review the Mojito Contributor License Agreement.

Dependencies (Third-party libraries)

buildy, async, mkdirp, mime, and optionally knox to use the S3 task.

Credits

The following image is used in accordance with the Creative Commons 2.0 License:

http://www.flickr.com/photos/breatheindigital/4623226056/

mojito-shaker's People

Contributors

diervo avatar jlecomte avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.