This is a prototype for the low-level api to serialize express routes into the client side.
npm install
node simple.js
node complex.js
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
This gist was updated based on the discussion here : https://groups.google.com/forum/?fromgroups=#!topic/yui-contrib/cUpVvtoUBa8
With the ability to precompile templates into javascript and the abtraction layer provided by Y.Template to normalize the api to render those templates, we got one step closer to create applications that can be template language agnostic.
The premise here is to create a YUI Application that references templates by name and call for render when needed without having to know what engine to use, or what file generated the compiled template, or what api should be used for a particular template.
In order to facilitate this, we should have a centralized registration mechanism used by the application to register any template that is provisioned, in which case we can decouple the provisioning process from the actual rendering process.
<!doctype html> | |
<html> | |
<head> | |
<title>IO with transports and promises</title> | |
</head> | |
<body> | |
<script src="http://yui.yahooapis.com/3.9.1/build/yui/yui.js"></script> | |
<script> | |
// sm-io is an alias for sm-io-core and sm-io-xhr. The two modules don't require one another. | |
YUI({ filter: 'raw' }).use('sm-io', function (Y) { |
/*jslint node:true*/ | |
'use strict'; | |
var express = require('express'), | |
mojito = require('mojito-server'), | |
locator = require('./locator.js'), | |
config = require('./conf/config'), | |
middleware = require('./lib/middleware'), |
Locater is a filesystem abstraction that is meant to provide access to configurations and resources that describes a YUI App.
The responsibilities of the Locater are:
This is a brain dump of my experience trying to get something going with Ember.js. My goal was to get to know the ins and outs of the framework by completing a pretty well defined task that I had lots of domain knowledge about. In this case reproducing a simple Yammer feed. As of this time, I have not been able to complete that task. So this is a subjective rundown of the things I think make it difficult to get a handle on Ember. NOTE: My comments are addressing the Ember team and giving suggestions on what they could do to improve the situation.
The new guides have pretty good explanation of the various parts of the framework; routers, models, templates, views. But it's not clear how they all get strapped together to make something that works. There are snippets of examples all over the place like:
App.Router.map(function() {
match('/home').to('home');
});
var microtime = require('microtime'), | |
i, | |
t, | |
obj, | |
max = 10000000; | |
function run1(obj) { | |
t = microtime.now(); | |
for (i = 0; i < max; i += 1) { | |
if (obj.foo) obj.foo(); |