Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't Google's Closure library hosted on their CDN?

Google hosts a number of JavaScript libraries such as jQuery and dojo on their CDN. For some reason, their own Google Closure library does not seem to be included. Is there a hosted version of the Closure library?

like image 595
mjs Avatar asked Feb 07 '10 21:02

mjs


People also ask

Why use Closure Library?

If you are developing a large or growing application, you may benefit from the Closure Library's breadth. A well-tested library can insulate you from cross-browser compatibility issues and the minutiae of client-side programming, letting you focus on the fun stuff.

What is Google CDN jQuery?

Projects In JavaScript & JQueryGoogle provides CDN support for jQuery via the googleapis.com domain. The latest version of Google CDN provides four different types of jQuery versions- normal (uncompressed), minified, slim, and slim & minified. Google CDN provides the jQuery via ajax.googleapis.com domain.


2 Answers

It's not included because Closure is intended to be used with the compiler; a hosted version would need to include the entire library and defeat the purpose of building minified libraries containing only the features you need.

like image 79
Wooble Avatar answered Sep 24 '22 12:09

Wooble


You can link to their repository:

<script src='https://cdn.rawgit.com/google/closure-library/master/closure/goog/base.js'></script>

good enough for demos or local development. As other answer suggested, production should use compiled code, it is well worth it.

like image 26
Paul Avatar answered Sep 21 '22 12:09

Paul