https://github.com/aitoroses/meteor-famono
Adds require bundler to Meteor use with Famo.us
https://github.com/aitoroses/meteor-famono
Last synced: 12 months ago
JSON representation
Adds require bundler to Meteor use with Famo.us
- Host: GitHub
- URL: https://github.com/aitoroses/meteor-famono
- Owner: aitoroses
- Created: 2014-04-14T05:39:03.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-14T09:39:32.000Z (about 12 years ago)
- Last Synced: 2025-06-22T12:09:13.897Z (about 1 year ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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
```bash
$ 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:
```js
{
"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:
```js
// Make sure dom got a body...
Meteor.startup(function() {
var Engine = require("famous/core/Engine");
var Modifier = require("famous/core/Modifier");
var Surface = require("famous/core/Surface");
var RenderController = require("famous/views/RenderController");
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.
Kind regards Morten (aka raix)