Closed passy closed 10 years ago
:+1: This looks great!
Hey, actually jsDelivr offers these files http://api.jsdelivr.com/packages.php JSON http://www.jsdelivr.com/hash.xml XML
@jimaek What we currently need for this to work is a single main file. For the jQuery package for example, there are three files and I don't know which one of them to use to replace the reference in the source with.
@passy Oh I see, if you want I can build a custom file for you to use.
@jimaek That would be wonderful.
@passy Actually as I can see http://api.jsdelivr.com/packages.php serves only the latest version. I wrote it a long time ago so kinda forgot.
@jimaek That's actually another problem. Ideally we would get something back like on cdnjs which includes all available versions and one main filename of the package.
@passy Ok, do you want it be JSON?
@jimaek Yes, JSON would be my favorite option. :)
@passy How about this http://api.jsdelivr.com/packagesmain.php ?
@jimaek Getting a 500 at the moment. :/
@jimaek Yay, I got the whole file now. Having all the version information is great already. I may just be looking at the wrong place, but where is the main property?
What do you main property? cdnjs doesn't have one either. I added "lastversion" plus to assets added a list of all versions+files. I thought that's what you needed.
@jimaek Oh, sorry. From the module's perspective I just know that there is a reference to a particular version of a module, let's say jquery 2.0.3. That's all I know. Without a "main" property, like CDNJS provides it, I don't know what to replace it with. It could be either jquery-2.0.3.js
, jquery-2.0.3.min.js
or jquery-2.0.3.min.map
. That's what I need some reference to a "main" file for.
I see what you mean. Unfortunately this is not possible. It needs too much manpower to do this. And jsDelivr community is not that big yet.
@jimaek That's totally understandable. If you provide this at some point or maybe even just for a handful of libraries, please let me know. :)
@btford Ping. :)
:+1:
Not trying to be rude, but it's been three months already and this PR is quite cool. Please merge and update package.
caugh @btford caugh
If you don't have time, I can test this again and release it next weekend or so.
Let's get this done so the default isn't Angular 1.0.7 any longer.
This change is awesome. Please pull it!
+1 for pulling this in! I chased around trying to determine why Angular wasn't getting swapped out properly for more of my afternoon than I should admit... Pointed the grunt-google-cdn
dependency in my package.json
to @passy's branch, npm up grunt-google-cdn
and all is well and working as expected. Thanks!
Thanks @passy! I have been using your fork because I need AngularJS 1.0.8.
It usually works, but occasionally I get this warning:
Warning: bower exited non-zero with 8 Use --force to continue.
I'm guessing that might be related to intermittent Bower registry availability?
@passy Its been a while but here you go https://github.com/jsdelivr/api Its in beta testing right now. Check it out and let me know if there is anything missing. The opinion of a developer would be very useful to us.
We also now support the loading of multiple libraries over a single HTTP request Plus version aliases
Let me know if this is enough for a jsDelivr integration :)
@jimaek @passy, cdnify using jsDelivr is now possible using jsdelivr-cdn-data (and google-cdn v0.3 which sadly is not supported yet by this repo)
To point the grunt-google-cdn
dependency in your package.json
to @passy's branch, like @randallagordon said, use:
"grunt-google-cdn": "git://github.com/passy/grunt-google-cdn.git#upgrade-0.2"
(Might save those of us just getting our feet wet w/ npm a few minutes. :)
+1 for pulling
I spent some hours this weekend adding support for different CDNs to
google-cdn
(which should definitely be renamed). I also got rid of the hard-coded main files and resolve them through bower, which required an API change to an asynchronous interface.Currently only CDNJS is supported, because JSdelivr does not expose any but the most recent version and doesn't have main file. I guess I could work around both those limitations, but wanted to get this out as a first step.
/cc @btford /fixes #30