Skip to content

Instantly share code, notes, and snippets.

View ericf's full-sized avatar

Eric Ferraiuolo ericf

View GitHub Profile
@ericf
ericf / gist:1482001
Created December 15, 2011 17:35
12/15/2011 Open Hours notes

Performance Changes

We also want you to test the hell out of these!

  • Async Loader
  • Async Get (full re-write)

Loader

YUI().use('app', 'handlebars', 'jsonp', function (Y) {
var GithubSync,
Contributor, ContributorList, Repo, RepoList, User,
ContributorListView, RepoView, RepoListView, UserView,
HomePageView, UserPageView, RepoPageView,
ContributorsApp;
// -- GithubSync ---------------------------------------------------------------
@ericf
ericf / gist:1424518
Created December 2, 2011 19:31
I need an idea for a Y.App example

Y.App Example

I need to build an example app using the new Y.App class and need help coming up with a good idea.

Add your ideas in the comments…

"Requirements"

@ericf
ericf / gist:1421955
Created December 2, 2011 05:47
Super basic Y.App example
// Imagine that `Y.User`, `Y.UsersView`, and `Y.UserView` have been defined.
var app = new Y.App({
views: {
users: {
type : Y.UsersView,
preserve: true
},
user: {
type : Y.UserView,

App Framework URL Jazz

Gathered thoughts about URL woes at the various levels in our stack of components which deal with them. URLs are hard to get right, but it is important to do so.

Application-level URL Handling

Public methods that change the URL:

YUI().use('charts', 'app-base', function (Y) {
var ChartView, StatsView, app;
ChartView = Y.Base.create('chartView', Y.View, [], {
render: function () {
this.chart = new Y.Chart({
dataProvider: [],
render : this.get('container')
});

Preferential ordering of server and browser capabilities to determine if client- side routing should happen and enhance an application's user experience.

Format: (app has capable server) && (browser has pushState) => (should route)

  1. server && html5 //=> routes
  2. server && !html5 //=> !routes
  3. !server && html //=> routes
  4. !server && !html5 //=> routes
var comboServer = require('combohandler/lib/server'),
port = process.env.PORT || 3001,
app = comboServer({
roots: {
'/': __dirname + '/build'
}
});
app.listen(port, function () {
// For Y.Foo
// Class extensions that will be used in the base class
function ExtA() {}
...
Y.FooExtA = ExtA;
// Base Class definition
function FooBase() {}
...
YUI().use('model', 'model-list', function (Y) {
Y.Tag = Y.Base.create('tag', Y.Model, [], {}, {
ATTRS: {
name: {}
}
});
Y.Tags = Y.Base.create('tags', Y.ModelList, [], { model: Y.Tag });