mathiasbynens/jsperf.com

ajax.googleapis.com aliasing broken

Opened this issue · 4 comments

I really dislike the idea of relying on a third-party API just to get the latest available version number for a given library

Unfortunately version aliasing is currently broken for gooogleapis.com, since ajax.googleapis.../1/jquery.min.js has been stuck at v1.9.1 for over a year & a few missed releases.

jsDelivr's version redirects has been working well for me, & is actively maintained. Also, I've rarely seen the other files your library buttons have in other tests, so swapping those out for more popular jQuery v2, Lo-Dash & Underscore seems more convenient to me. So instead of a PR, I made a bookmarklet that you can demo on the live site.

Please let me know if you want a PR, want to remove those buttons, etc.

If you are OK with a fall back of a version aliasing string (/1, /2, /latest), or a literal /{version} reminder, an API call could simply replace existing text. So the API would only be a progressive enhancement, and an API failure will still give the current result of non-dynamic text insertion.

Please let me know if you'd like to see an example of this in action.

ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js has been outdated for a year

We (Google) worked together with jQuery on that. Neither of us want people to use /1/ in production and so it was deprecated and thus isn't updated anymore.

~ Paul Irish

👍 we should provide specific versions, floating versions that update under the test's feet is not good.

floating versions that update under the test's feet is not good

I agree; I was going by the prior precedence set.

I have on the back burner an idea to be able to build a URL for any public CDN. Similar to this CDN version checker, but wanting at least "let me see what you got" from @mathiasbynens since gave reservations about 3rd party scripts. I'm also hoping on a few v2 API features like easier searching across CDNs.