Serve YUI from Mojito Server #427

Closed
gvaish opened this Issue Aug 24, 2012 · 9 comments

4 participants

@gvaish

While traveling yesterday, I realized that Mojito can support an "Offline YUI Combo" URL.

By that what I mean is… when there's no internet connection (like travel, in transit or otherwise), one can configure a setting in application.json and let the YUI library be served from the local server rather than from the CDN.

It can be a simple "yui": { "serveMode": "local" } (default value being "cdn") setting.

So, as a dev, I can use this setting in a context and then start the server with that context.

@drewfish
Yahoo Inc. member

I think this is already addressed by "yui": { "base" } in application.json:
http://developer.yahoo.com/cocktails/mojito/docs/intro/mojito_configuring.html#yui-obj

@rwaldura

@gvaish go ahead and reopen issue if "base" isn't enough. Thanks!

@rwaldura rwaldura closed this Aug 24, 2012
@gvaish

@drewfish Well, what's the base to serve from the local server? It will be good to have it documented officially as well

@rwaldura The answer to above should decide whether or not to reopen.

@drewfish
Yahoo Inc. member

@gvaish The base value is limited, in that it can point to any file in an assets/ directory. The documentation on assets should have details no that.

However, the base isn't enough to handle combo URLs. Combo URLs are strongly desired, since they perform significantly better (and are what is used in production as well, for that very reason).

I'm renaming the ticket from "Offline YUI Serve" to "Serve YUI from Mojito Server".

@drewfish drewfish reopened this Aug 27, 2012
@drewfish
Yahoo Inc. member

(I have an experimental/hacky approach to this here:
drewfish@ca2f559
)

@gvaish

@drewfish Awesome buddy! Given a couple of remarks in the commit ca2f559

@rwaldura

see also related issue #544

@caridy

This is now fully supported in 0.5.x by using:

[{
    "settings": [ "master" ],
    "yui": {
        "config": {
            "base": "/static/yui/",
            "combine": false, /* or true, if you like */
            "comboBase": "/combo~",
            "comboSep": "~",
            "root": "/static/yui/"
        }
    }
}]

/cc @zhouyaoji @rwaldura @jenny this is potentially an important use-case for people creating corporate apps, should we add it to the documentation somewhere?

Closing this.

@caridy caridy closed this Jan 29, 2013
@gvaish

This is super awesome!
@caridy - Makes a definite case for documentation / hilite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment