JQuery and Dependency Management

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

JQuery and Dependency Management

Malcolm Edgar
Hi All,

I am looking at integrating some JQuery components into Click. Some things we have used at my workplace JQuery DesktopMenu by Bob and probably some form of datepicker (http://jqueryui.com/demos/datepicker/).

Probably in the package: org.apache.click.extras.jquery

There are a couple of things I would like to discuss, and get some opinions on:

#1 Dependency Management

These controls will have various JQuery JS dependencies and assets which we can package in the distribution, or let people declare explicitly in their HTML page template. Traditionally we have packages up all the JS dependencies with Click as we want to make it easy for people to use. However now with peoples extensive use of these libraries extensively in their applications, so we will have potential issues with different versions.  My thought on this is to include a properties file which declares the various controls dependencies. People can then potentially edit this properties file and override the default values:


# Desktop Menu components
jquery.desktopmenu.css=/click/jquery/desktopmenu/desktopmenu.css
jquery.desktopmenu.js=/click/jquery/desktopmenu/jquery.menu.js
jquery.desktopmenu.template=/click/jquery/desktopmenu/desktopmenu.template.js

The main problem I have with this, is that the properties file would be buried deep in the package structure: /org/apache/click/extras/jquery/jquery-control.properties.  Alternatively we could have this in the package root and call it something like:  click-jquery-control.properties

#2 Prototype and JQuery

Traditionally these libraries are not compatible, as prototype modifies the DOM.  In Click Extras we have a number of prototype controls, where were popular before JQuery came to dominate (showing our age here).  Not sure if this is fixed now, I have read about a JQuery.noConflict() function.

We have quite a few prototype controls, which I think should be moved into their own package so its clear they have a prototype dependency.  This change would require people to change their package imports, but other than that it would be a pretty painless change.


Keen to hear peoples thoughts on this.

regards

Reply | Threaded
Open this post in threaded view
|

Re: JQuery and Dependency Management

Emerson Castañeda
Hi Malcom

If my understanding of your proposal is correct,  a new funcionality of dependency management  and maintenance of previous prototype components would involve only 2 things:

1) the inclusion of a properties file (into one of the two packages you have mentioned, I vote for the package root) that it's much better than change the page templates.

2) the moving  into an own package all previous Prototype components that will make necessary to modify the package imports toward keep the compatibility

I think those "relatively important changes" would be most than justified if final result is the possibility of using both libraries (or even new JS libraries) in a easy and generic way, even giving the option to include new JQuery components  and Prototype components into future versions. This change will also be favorable to Click because it's giving a little maintenance in order to be friendly with those new technologies

The compatibility of JQuery with other libraries, as you have mentioned, it's easily handle following the steps in: http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Best Regards

EMERSON

On Mon, Jun 4, 2012 at 11:10 PM, Malcolm Edgar <[hidden email]> wrote:
Hi All,

I am looking at integrating some JQuery components into Click. Some things we have used at my workplace JQuery DesktopMenu by Bob and probably some form of datepicker (http://jqueryui.com/demos/datepicker/).

Probably in the package: org.apache.click.extras.jquery

There are a couple of things I would like to discuss, and get some opinions on:

#1 Dependency Management

These controls will have various JQuery JS dependencies and assets which we can package in the distribution, or let people declare explicitly in their HTML page template. Traditionally we have packages up all the JS dependencies with Click as we want to make it easy for people to use. However now with peoples extensive use of these libraries extensively in their applications, so we will have potential issues with different versions.  My thought on this is to include a properties file which declares the various controls dependencies. People can then potentially edit this properties file and override the default values:


# Desktop Menu components
jquery.desktopmenu.css=/click/jquery/desktopmenu/desktopmenu.css
jquery.desktopmenu.js=/click/jquery/desktopmenu/jquery.menu.js
jquery.desktopmenu.template=/click/jquery/desktopmenu/desktopmenu.template.js

The main problem I have with this, is that the properties file would be buried deep in the package structure: /org/apache/click/extras/jquery/jquery-control.properties.  Alternatively we could have this in the package root and call it something like:  click-jquery-control.properties

#2 Prototype and JQuery

Traditionally these libraries are not compatible, as prototype modifies the DOM.  In Click Extras we have a number of prototype controls, where were popular before JQuery came to dominate (showing our age here).  Not sure if this is fixed now, I have read about a JQuery.noConflict() function.

We have quite a few prototype controls, which I think should be moved into their own package so its clear they have a prototype dependency.  This change would require people to change their package imports, but other than that it would be a pretty painless change.


Keen to hear peoples thoughts on this.

regards


Reply | Threaded
Open this post in threaded view
|

Re: JQuery and Dependency Management

Bob Schellink
Administrator
In reply to this post by Malcolm Edgar
Hi Malcolm,

Your list is quite comprehensive, I don't have much to add.

How big is the jQuery UI datepicker if included? Do folks know of any
alternative datepickers for jQuery?


Kind regards

Bob

On 04/06/2012 23:10 PM, Malcolm Edgar wrote:

> Hi All,
> I am looking at integrating some JQuery components into Click. Some things we have used at my workplace JQuery DesktopMenu by Bob and probably some form of datepicker (http://jqueryui.com/demos/datepicker/).
> Probably in the package: org.apache.click.extras.jquery
> There are a couple of things I would like to discuss, and get some opinions on:
> #1 Dependency Management
> These controls will have various JQuery JS dependencies and assets which we can package in the distribution, or let people declare explicitly in their HTML page template. Traditionally we have packages up all the JS dependencies with Click as we want to make it easy for people to use. However now with peoples extensive use of these libraries extensively in their applications, so we will have potential issues with different versions.  My thought on this is to include a properties file which declares the various controls dependencies. People can then potentially edit this properties file and override the default values:
> jquery.core.js=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
> # Desktop Menu components
> jquery.desktopmenu.css=/click/jquery/desktopmenu/desktopmenu.css
> jquery.desktopmenu.js=/click/jquery/desktopmenu/jquery.menu.js
> jquery.desktopmenu.template=/click/jquery/desktopmenu/desktopmenu.template.js
> The main problem I have with this, is that the properties file would be buried deep in the package structure: /org/apache/click/extras/jquery/jquery-control.properties.  Alternatively we could have this in the package root and call it something like:  click-jquery-control.properties
> #2 Prototype and JQuery
> Traditionally these libraries are not compatible, as prototype modifies the DOM.  In Click Extras we have a number of prototype controls, where were popular before JQuery came to dominate (showing our age here).  Not sure if this is fixed now, I have read about a JQuery.noConflict() function.
> We have quite a few prototype controls, which I think should be moved into their own package so its clear they have a prototype dependency.  This change would require people to change their package imports, but other than that it would be a pretty painless change.
> Keen to hear peoples thoughts on this.
> regards
Reply | Threaded
Open this post in threaded view
|

Re: JQuery and Dependency Management

gilbertoca
Hi, I'm not working with ajax recently. But searching on google found
this[1] discussion.

Regards,

Gilberto

[1] http://stackoverflow.com/questions/2037011/jquery-datepicker-alternative


On Thu, Jun 7, 2012 at 6:13 AM, Bob Schellink <[hidden email]> wrote:

> Hi Malcolm,
>
> Your list is quite comprehensive, I don't have much to add.
>
> How big is the jQuery UI datepicker if included? Do folks know of any
> alternative datepickers for jQuery?
>
>
> Kind regards
>
> Bob
>
> On 04/06/2012 23:10 PM, Malcolm Edgar wrote:
>> Hi All,
>> I am looking at integrating some JQuery components into Click. Some things we have used at my workplace JQuery DesktopMenu by Bob and probably some form of datepicker (http://jqueryui.com/demos/datepicker/).
>> Probably in the package: org.apache.click.extras.jquery
>> There are a couple of things I would like to discuss, and get some opinions on:
>> #1 Dependency Management
>> These controls will have various JQuery JS dependencies and assets which we can package in the distribution, or let people declare explicitly in their HTML page template. Traditionally we have packages up all the JS dependencies with Click as we want to make it easy for people to use. However now with peoples extensive use of these libraries extensively in their applications, so we will have potential issues with different versions.  My thought on this is to include a properties file which declares the various controls dependencies. People can then potentially edit this properties file and override the default values:
>> jquery.core.js=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
>> # Desktop Menu components
>> jquery.desktopmenu.css=/click/jquery/desktopmenu/desktopmenu.css
>> jquery.desktopmenu.js=/click/jquery/desktopmenu/jquery.menu.js
>> jquery.desktopmenu.template=/click/jquery/desktopmenu/desktopmenu.template.js
>> The main problem I have with this, is that the properties file would be buried deep in the package structure: /org/apache/click/extras/jquery/jquery-control.properties.  Alternatively we could have this in the package root and call it something like:  click-jquery-control.properties
>> #2 Prototype and JQuery
>> Traditionally these libraries are not compatible, as prototype modifies the DOM.  In Click Extras we have a number of prototype controls, where were popular before JQuery came to dominate (showing our age here).  Not sure if this is fixed now, I have read about a JQuery.noConflict() function.
>> We have quite a few prototype controls, which I think should be moved into their own package so its clear they have a prototype dependency.  This change would require people to change their package imports, but other than that it would be a pretty painless change.
>> Keen to hear peoples thoughts on this.
>> regards
Reply | Threaded
Open this post in threaded view
|

Re: JQuery and Dependency Management

gilbertoca
In reply to this post by Malcolm Edgar
Malcolm Edgar wrote
#1 Dependency Management

These controls will have various JQuery JS dependencies and assets which we
can package in the distribution, or let people declare explicitly in their
HTML page template. Traditionally we have packages up all the JS
dependencies with Click as we want to make it easy for people to use.
However now with peoples extensive use of these libraries extensively in
their applications, so we will have potential issues with different
versions.  My thought on this is to include a properties file which
declares the various controls dependencies. People can then potentially
edit this properties file and override the default values:

jquery.core.js=
http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js

# Desktop Menu components
jquery.desktopmenu.css=/click/jquery/desktopmenu/desktopmenu.css
jquery.desktopmenu.js=/click/jquery/desktopmenu/jquery.menu.js
jquery.desktopmenu.template=/click/jquery/desktopmenu/desktopmenu.template.js
Wouldn't it be possible to package all the resources (js, img, css, template-velocity or freemaker) in one jar?
I think it would be more simple to maintain, isn't it?
See the struts2-jquery-plugin[1] for an organization example.

Regards,

Gilberto

[1] http://code.google.com/p/struts2-jquery/source/browse/#svn%2Ftrunk%2Fstruts2-jquery-plugin%2Fsrc%2Fmain%2Fresources%2Ftemplate
Reply | Threaded
Open this post in threaded view
|

Re: JQuery and Dependency Management

gilbertoca
gilbertoca wrote
Malcolm Edgar wrote
#1 Dependency Management

These controls will have various JQuery JS dependencies and assets which we
can package in the distribution, or let people declare explicitly in their
HTML page template. Traditionally we have packages up all the JS
dependencies with Click as we want to make it easy for people to use.
However now with peoples extensive use of these libraries extensively in
their applications, so we will have potential issues with different
versions.  My thought on this is to include a properties file which
declares the various controls dependencies. People can then potentially
edit this properties file and override the default values:

jquery.core.js=
http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js

# Desktop Menu components
jquery.desktopmenu.css=/click/jquery/desktopmenu/desktopmenu.css
jquery.desktopmenu.js=/click/jquery/desktopmenu/jquery.menu.js
jquery.desktopmenu.template=/click/jquery/desktopmenu/desktopmenu.template.js
Wouldn't it be possible to package all the resources (js, img, css, template-velocity or freemaker) in one jar?
I think it would be more simple to maintain, isn't it?
See the struts2-jquery-plugin[1] for an organization example.

Regards,

Gilberto

[1] http://code.google.com/p/struts2-jquery/source/browse/#svn%2Ftrunk%2Fstruts2-jquery-plugin%2Fsrc%2Fmain%2Fresources%2Ftemplate
One project that has gain some fuss recently is Wro4j[1]. I think it will help on packaging things. This[2] article explain a lot thing about it.

Hth,
Gilberto

[1] http://code.google.com/p/wro4j/
[2] http://www.dzone.com/links/r/wro4j_page_load_optimization_and_lessjs.html
Reply | Threaded
Open this post in threaded view
|

Re: JQuery and Dependency Management

rosenlu
This post has NOT been accepted by the mailing list yet.
In reply to this post by Malcolm Edgar
Twitter Bootstrap is become more and more popular now ,but I found that Apache Click is still not integrated with Twitter Bootstrap. I am wonder if your team have any plan to add bootstrap into this open source project? Thanks in advance!
Reply | Threaded
Open this post in threaded view
|

Re: JQuery and Dependency Management

mary
This post has NOT been accepted by the mailing list yet.
In reply to this post by Malcolm Edgar
i live it ! , Just because your beach bag is filled with magazines, your iPod, and your towel, doesnt mean you can leave the sunscreen behind. Friv 200  :  Kizi
cool math games