You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by Malcolm Edgar <me...@apache.org> on 2012/06/03 13:35:05 UTC

JQuery and Dependency Management

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

Re: JQuery and Dependency Management

Posted by gilbertoca <gi...@gmail.com>.
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



--
View this message in context: http://click.1134972.n2.nabble.com/JQuery-and-Dependency-Management-tp7578125p7578308.html
Sent from the click-user mailing list archive at Nabble.com.

Re: JQuery and Dependency Management

Posted by gilbertoca <gi...@gmail.com>.
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


--
View this message in context: http://click.1134972.n2.nabble.com/JQuery-and-Dependency-Management-tp7578125p7578150.html
Sent from the click-user mailing list archive at Nabble.com.

Re: JQuery and Dependency Management

Posted by Emerson CastaƱeda <em...@gmail.com>.
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 <me...@apache.org> 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
>
>

JQuery and Dependency Management

Posted by Malcolm Edgar <me...@apache.org>.
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