Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I think I got an Aria Templates "CDN" working.
Instead of relying on the old XDR + crossdomain.xml approach, I am using CORS. With XDR, I managed to have something "working", but it was really unreliable.
The CDN itself is running on Google APP Engine (http://ariatemplatestcdn.appspot.com/). More details about that below.
How to use it
Load aria templates from the CDN :
Load the skin from the CDN (if you want to use widgets) :
Declare a root map :
Then you can load both aria templates classes and your own classes.
Aria Templates impacts
On aria templates side, I am serving a slightly custom version, which is using aria.core.transport.XHR instead of aria.core.transport.XDR, even for cross-domain requests.
In aria.core.IO, line 215 was changed to :
Other than that the CDN itself is a simple google appengine application, which allows GET and OPTIONS requests from any origin. (code below)
I just tried an alternative : https://github.com/jpillora/xdomain . Purely client side, no need to set anything on the server. You only have to drop a simple html file on your CDN and that's it.
I did this on my atcdn repository (https://github.com/juliandescottes/atcdn/tree/gh-pages) , and it's working !
Below is the basic HTML file you need to use this new approach :
And here it is running on plunker : http://plnkr.co/edit/Hs7Q7mqBm6148Yb4Cewa?p=preview
This lib is just pure awesomeness! Super simple, but what a clever trick !!