From: Thomas W. <tho...@gm...> - 2010-01-25 12:39:21
|
It seams we are going to use more and more JavaScript libraries and I would like to propose a way to organise the code that has been used in many places and is proven as a good practise. There are two main challenges: 1. Libraries do change and evolve frequently and in general the code that worked before, with the next version may not work at all. 2. When a lot of people are contributing to a project, there is a strong believe that whatever is used in one application (or page) will be definitely used by many applications (or pages) later and as a result a lot of library code are places in a generic directory with the intention to be used later. In our case 'scripts' directory. This type of problems are very ofter when jQuery + jQuery plugins (my favorite JS library) are used. Some of the plugins require jQuery version 1.3, some other 1.2 and on the top of that every plugin have its own versions are not necessarily compatible with each other. My proposal is: 1. Keep Javascript libraries in a subdirectory for the application until other application uses it. This way every application can have matching versions.Another advantage is - the application is self contained and by deleting / coping the directory we can easily inslall/uninslatll an application. I do believe this is in the most cases the simplest and easiest way. 2. If we really have to share JavaScript libraries (more then one application uses it), then the libraries should be located in directories that have version number of the library is part of the directory name. 3. When jQuery plugins (or other small libraries that depend on main libraries) are used, then the name of the file should contain the version number. 4. The minimised version of every JS file will have '.min.js' suffix. In a long run the best solution will be to have a Static Resources Manger module that receives the name and the version of a file and returns a relative or an absolute URL. I hope this will help. Thomas ------ Thomas White Mobile:+44 7711 922 966 Skype: thomaswhite gTalk: thomas.0007 Linked-In:http://www.linkedin.com/in/thomaswhite0007 facebook: http://www.facebook.com/thomas.0007 |
From: Adam R. <ad...@ex...> - 2010-01-25 12:55:27
|
Can we standardise on one implementation and version? 2010/1/25 Thomas White <tho...@gm...>: > It seams we are going to use more and more JavaScript libraries and I > would like to propose a way to organise the code that has been used in > many places and is proven as a good practise. > > There are two main challenges: > > 1. Libraries do change and evolve frequently and in general the code > that worked before, with the next version may not work at all. > 2. When a lot of people are contributing to a project, there is a > strong believe that whatever is used in one application (or page) will > be definitely used by many applications (or pages) later and as a > result a lot of library code are places in a generic directory with > the intention to be used later. In our case 'scripts' directory. > > This type of problems are very ofter when jQuery + jQuery plugins (my > favorite JS library) are used. Some of the plugins require jQuery > version 1.3, some other 1.2 and on the top of that every plugin have > its own versions are not necessarily compatible with each other. > > My proposal is: > 1. Keep Javascript libraries in a subdirectory for the application > until other application uses it. This way every application can have > matching versions.Another advantage is - the application is self > contained and by deleting / coping the directory we can easily > inslall/uninslatll an application. I do believe this is in the most > cases the simplest and easiest way. > 2. If we really have to share JavaScript libraries (more then one > application uses it), then the libraries should be located in > directories that have version number of the library is part of the > directory name. > 3. When jQuery plugins (or other small libraries that depend on main > libraries) are used, then the name of the file should contain the > version number. > 4. The minimised version of every JS file will have '.min.js' suffix. > > > In a long run the best solution will be to have a Static Resources > Manger module that receives the name and the version of a file and > returns a relative or an absolute URL. > > I hope this will help. > Thomas > > > > > > ------ > > Thomas White > > Mobile:+44 7711 922 966 > Skype: thomaswhite > gTalk: thomas.0007 > Linked-In:http://www.linkedin.com/in/thomaswhite0007 > facebook: http://www.facebook.com/thomas.0007 > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Exist-development mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-development > -- Adam Retter eXist Developer { United Kingdom } ad...@ex... irc://irc.freenode.net/existdb |
From: Dannes W. <di...@ex...> - 2010-01-25 13:57:40
|
Hi, On Mon, Jan 25, 2010 at 1:54 PM, Adam Retter <ad...@ex...> wrote: > Can we standardise on one implementation and version? > > +1 for me. In the context of exist, that is, what is deployed by the exist installer/war file, just one version of a library should be deployed. Applications can bring it's own versions, for sure, and we can discuss about direcotiy structures, but let's keep exist-db simple... and small :-) D. -- eXist-db Native XML Database - http://exist-db.org Join us on linked-in: http://www.linkedin.com/groups?gid=35624 |
From: Thomas W. <tho...@gm...> - 2010-01-25 14:10:57
|
Yes we can keep only one version per library but ir is still good idea to have the version included in the file name. Both jQuery library and jQuery plugins file's names already follow this practice. About the the single implementation - it is like asking Nikon users to use Canon :-). jQuery and Yahoo and many other JS libraries will have their followers for many good reasons. jQuery is 118kb and 56kb minfielded, Yahoo JS is about 1Mb. These file sizes are much smaller then most of the other files in the installation. I do not think sizes of the JS files will be ever an issue. Thomas ------ Thomas White Mobile:+44 7711 922 966 Skype: thomaswhite gTalk: thomas.0007 Linked-In:http://www.linkedin.com/in/thomaswhite0007 facebook: http://www.facebook.com/thomas.0007 2010/1/25 Dannes Wessels <di...@ex...>: > Hi, > > On Mon, Jan 25, 2010 at 1:54 PM, Adam Retter <ad...@ex...> wrote: >> >> Can we standardise on one implementation and version? >> > > +1 for me. > > > In the context of exist, that is, what is deployed by the exist > installer/war file, just one version of a library should be deployed. > Applications can bring it's own versions, for sure, and we can discuss about > direcotiy structures, but let's keep exist-db simple... and small :-) > > D. > > -- > eXist-db Native XML Database - http://exist-db.org > Join us on linked-in: http://www.linkedin.com/groups?gid=35624 > |
From: Dmitriy S. <sha...@gm...> - 2010-01-25 14:31:47
Attachments:
smime.p7s
|
I agree with Thomas. It's not a question "how many", it's - "how". We need "standard" pluggable mechanism for web applications. -- Cheers, Dmitriy Shabanov PS I working under proposal, but I do need first order functions ... On Mon, 2010-01-25 at 14:10 +0000, Thomas White wrote: > Yes we can keep only one version per library but ir is still good idea > to have the version included in the file name. Both jQuery library and > jQuery plugins file's names already follow this practice. > > About the the single implementation - it is like asking Nikon users to > use Canon :-). jQuery and Yahoo and many other JS libraries will have > their followers for many good reasons. jQuery is 118kb and 56kb > minfielded, Yahoo JS is about 1Mb. These file sizes are much smaller > then most of the other files in the installation. I do not think sizes > of the JS files will be ever an issue. > > Thomas > > > > ------ > > Thomas White > > Mobile:+44 7711 922 966 > Skype: thomaswhite > gTalk: thomas.0007 > Linked-In:http://www.linkedin.com/in/thomaswhite0007 > facebook: http://www.facebook.com/thomas.0007 > > > > > 2010/1/25 Dannes Wessels <di...@ex...>: > > Hi, > > > > On Mon, Jan 25, 2010 at 1:54 PM, Adam Retter <ad...@ex...> wrote: > >> > >> Can we standardise on one implementation and version? > >> > > > > +1 for me. > > > > > > In the context of exist, that is, what is deployed by the exist > > installer/war file, just one version of a library should be deployed. > > Applications can bring it's own versions, for sure, and we can discuss about > > direcotiy structures, but let's keep exist-db simple... and small :-) > > > > D. > > > > -- > > eXist-db Native XML Database - http://exist-db.org > > Join us on linked-in: http://www.linkedin.com/groups?gid=35624 > > > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Exist-development mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-development |