davglass / yui-master-combo

YUI Master Combo Handler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YUI Master Combo Handler

Need to test YUI against master and need a combo handler?

Well, here's an example that pulls the JS & CSS from Github and combo's them.

The requests are cached in memory for 5 minutes to make sure we don't explode Github's rate limit.

I've hosted this over at http://nodester.com in case you wanted to give it a shot.

How it works

It's basically a caching proxy to https://raw.github.com/yui/yui3/*

It only supports js & css, no images.

It also supports ?filter=raw|debug|min on the seed file to allow fo debugging.

When the seed file is served a small chunk of JS is appended to it to dynamically configure the combo server for you:

YUI.applyConfig({
     root: "",
     filter: "min",
     comboBase: "http://yui-master-combo.nodester.com/combo?"
});
YUI.version = "yui-master-combo";

This tells the YUI seed to use http://yui-master-combo.nodester.com/combo? as it's combo base and set's the default filter to 'min' as well as modify the version stamp of the JS files.

All files that are passed through this 'proxy' will also have @VERSION@ replaced with the same stamp.

Usage

<script src="http://yui-master-combo.nodester.com/"></script>
<script src="http://yui-master-combo.nodester.com/?filter=debug"></script>
<script src="http://yui-master-combo.nodester.com/?filter=raw"></script>
YUI().use('node', function(Y) {
    //Good To Go!
});

About

YUI Master Combo Handler


Languages

Language:JavaScript 100.0%