Giter Club home page Giter Club logo

meteor-famono's Introduction

FAMONO

What is it?

Well in short it's a Famo.us package system inside of the Meteor.js Package system - or is it requireJS? one could actually remove the standard-app-packages from the app and have a pure Famo.us app.

Install

$ mrt add famono

Requires: Meteor, Meteorite and ofcourse git all easy to install

Edit the library register

What? Well - you can add any library code you want to - even none Famo.us stuff.

How: When you install the package you will get a lib/smart.require in your main app folder, and it would look something like:

{
  "famous": {
    "git": "https://github.com/Famous/famous.git"
  },
  "famous-polyfills": {
    "git": "https://github.com/Famous/polyfills.git"
  }
}

you can mount any git repo on a namespace, oh and in Meteor editing this file will trigger either an add/download or removal of the changed namespace - LIVE.

This enables you to do:

  // Rig some famo.us deps
  require("famous-polyfills"); // Add polyfills
  require("famous/core/famous"); // Add the default css file

  // Basic deps
  var Engine           = require("famous/core/Engine");
  var Modifier         = require("famous/core/Modifier");
  var RenderController = require("famous/views/RenderController");

  // Make sure dom got a body...
  Meteor.startup(function() {
    var Surface = require("famous/core/Surface"); // This one needs document.body

    var mainContext = Engine.createContext();
    var renderController = new RenderController();
    var surfaces = [];
    var counter = 0;

    for (var i = 0; i < 10; i++) {
        surfaces.push(new Surface({
             content: "Surface: " + (i + 1),
             size: [200, 200],
             properties: {
                 backgroundColor: "hsl(" + (i * 360 / 10) + ", 100%, 50%)",
                 lineHeight: "200px",
                 textAlign: 'center'
             }
        }));
    }

    renderController.show(surfaces[0]);

    Engine.on("click", function() {
        var next = (counter++ + 1) % surfaces.length;
        this.show(surfaces[next]);
    }.bind(renderController));

    mainContext.add(new Modifier({origin: [.5, .5]})).add(renderController);

  });

Will all the stuff be loaded to the client??

Nope - the package scans your code and figure outs dependencies at your edit.

Force a reset of the dependency registry

Force clean dep registry:

  1. edit lib/smart.require set it to {} empty and save
  2. restore lib/smart.require with the deps you had in there and save

Setting branch or tags

Setting git references specific you can.

You can set either a branch or tag (if both is set only tag is used)

{
  "foo": {
    "git": "https://github.com/Foo/bar.git"
    "branch": "master",
    "tag": "v1.0.0",
    "recursive": false // default is true, true == load submodules
   }
}

Note: "git" can be set to local folders too if developing locally. But you may have to force reset if referenced code has changed.

Package creator?

You can create a repo and have the user add it to the project just like the Famo.us packages.

Kind regards Morten (aka raix)

meteor-famono's People

Contributors

aitoroses avatar

Watchers

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