Re: The future of gitweb - part 2: JavaScript

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 14 Apr 2011, Micha? ?owicki wrote:

2011/4/14 Jakub Narebski <jnareb@xxxxxxxxx>:

Second issue is how to use it / how to include it:

* Use some external Content Delivery Network (CDN), like
 Google Libraries API
    http://code.google.com/apis/libraries/devguide.html
 e.g.:

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js";></script>
 <script src="http://code.jquery.com/jquery-1.5.2.min.js";></script>

 or

 <script src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.1/mootools-yui-compressed.js";></script>

 This is nice solution... if we don't need plugin / extension
 which usually are not available in CDN version of library.

 Also this makes gitweb dependent on third-party service, and require
 network connectivity to Internet to have access to JavaScript-based
 features.

* Mark appropriate JavaScript library as dependency in gitweb/INSTALL
 to be downloaded in appropriate place but do not provide sources.
 Perhaps add target in gitweb/Makefile that automatically downloads
 it.

 This would make installing gitweb correctly more complicated.
 JavaScript-based features would not work if somebody instals gitweb
 incorrectly.

 I think we can set up gitweb build so that one can configure at
 build stage whether to use CDN or download library, or use
 pre-downloaded (and perhaps instaled somewhere) version of framework
 (combining JavaScript on build in all but first case).

I'm not sure about pre-downloaded version of libs. Most of the time
it's not a big deal but sometimes it may introduce hard to detect
issues when someone use different version of the lib -
http://ejohn.org/blog/learning-from-twitter/ .But the idea with
options - CDN or download is very good. CDNs can improve the page
download speed by increasing simultaneous connections if files are
downloaded from many hostnames but for companies where instances of
gitweb are on the Intrantet the 2nd option could be better I think (at
least in my case). Additionaly CDNs can save some money when you pay
for data traffic :)

another advantage of using the library from a CDN is that the user may already have it cached in their browser and not have to download it at all.

as long as there is a build-time option to make a version that does not depend on being able to get to the Internet I think it's a good idea to make the default use the Internet.

David Lang

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]