You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Barry Books <tr...@gmail.com> on 2013/10/03 04:14:32 UTC

Should the JQuery UI library be include with 5.4

When I created the datapicker I also needed the JQuery UI library but it
does not appear to be an option in the Tapestry Core. I think many jquery
components may need this and without it in the core many modules will each
end up with their own version. Is there any reason this is not included?

Re: Should the JQuery UI library be include with 5.4

Posted by Barry Books <tr...@gmail.com>.
I'm not sure how it would break anything to just include it although I can
see issues with the themes.

My concern is to get the DateField component to work I created a custom
JQuery UI download and included it. If everyone that wants to add some
jQuery component does this there will be lots of duplicate code.

I created a mixin called ui/widget for the tapestry5-jquery library. Since
it included jQuery UI you could just extend it with your widget name, add
the javascript to your project and it just worked. No need for java code or
understanding how the tapestry javascript API works. With the data- api it
should be even better. Here is an example of a jquery slider mixin. All the
mixin needs to do is include the javascript.

@ImportJQueryUI(value = {"jquery.ui.widget", "jquery.ui.mouse",
"jquery.ui.slider"})
public class Slider extends Widget {}


Perhaps it's time for a tapestry-jqueryUI module.


On Thu, Oct 3, 2013 at 2:22 AM, Bård Magnus Kvalheim <ma...@kvalheim.eu>wrote:

> define(["t5/core/dom", "t5/core/events", "jquery", "//
> code.jquery.com/ui/1.10.3/jquery-ui.js"],
> ...
>
> That's interesting - loading of scripts directly within a define. Seems
> very useful and convenient.
>
> Thought I might use same approach in some scenarios.
> I tried to lookup on documentation of that to see use cases, but seems like
> requirejs officially describes the paths and shim configurations as ways to
> load non AMD modules.
> (In my still limited knowledge)
>
>
> A heads up though.
> Looks like requirejs does not guarantee execution order for non AMD
> scripts. So according to some sources there is a chance that jqueryui may
> execute before jquery in this case.
> Look at the "update" and comments in this post:
>
> http://iamnotmyself.com/2012/09/07/getting-started-managing-client-side-scripts-with-require-js/
>
> Also I wonder what would happen if there were more modules that depended on
> the same jqueryui script..? Would it load multiple times?
>
> thoughts?
>
> On Thu, Oct 3, 2013 at 4:40 AM, Lenny Primak <lp...@hope.nyc.ny.us>
> wrote:
>
> > I tried to do exactly what you are trying to do and that's what
> > precipitated the discussion about JQuery and Bootstrap from CDN.
> > I have brought back T5.4 zone highlight effect with this:
> >
> >
> https://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/META-INF/modules/flowlogix/HighlightEffect.js?name=tapestry-5.4
> > It requires JQueryUI and I just load it from CDN and it works perfectly.
> >
> > > On Oct 2, 2013, at 7:14 PM, Barry Books <tr...@gmail.com> wrote:
> > >
> > > When I created the datapicker I also needed the JQuery UI library but
> it
> > > does not appear to be an option in the Tapestry Core. I think many
> jquery
> > > components may need this and without it in the core many modules will
> > each
> > > end up with their own version. Is there any reason this is not
> included?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: Should the JQuery UI library be include with 5.4

Posted by Bård Magnus Kvalheim <ma...@kvalheim.eu>.
define(["t5/core/dom", "t5/core/events", "jquery", "//
code.jquery.com/ui/1.10.3/jquery-ui.js"],
...

That's interesting - loading of scripts directly within a define. Seems
very useful and convenient.

Thought I might use same approach in some scenarios.
I tried to lookup on documentation of that to see use cases, but seems like
requirejs officially describes the paths and shim configurations as ways to
load non AMD modules.
(In my still limited knowledge)


A heads up though.
Looks like requirejs does not guarantee execution order for non AMD
scripts. So according to some sources there is a chance that jqueryui may
execute before jquery in this case.
Look at the "update" and comments in this post:
http://iamnotmyself.com/2012/09/07/getting-started-managing-client-side-scripts-with-require-js/

Also I wonder what would happen if there were more modules that depended on
the same jqueryui script..? Would it load multiple times?

thoughts?

On Thu, Oct 3, 2013 at 4:40 AM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:

> I tried to do exactly what you are trying to do and that's what
> precipitated the discussion about JQuery and Bootstrap from CDN.
> I have brought back T5.4 zone highlight effect with this:
>
> https://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/META-INF/modules/flowlogix/HighlightEffect.js?name=tapestry-5.4
> It requires JQueryUI and I just load it from CDN and it works perfectly.
>
> > On Oct 2, 2013, at 7:14 PM, Barry Books <tr...@gmail.com> wrote:
> >
> > When I created the datapicker I also needed the JQuery UI library but it
> > does not appear to be an option in the Tapestry Core. I think many jquery
> > components may need this and without it in the core many modules will
> each
> > end up with their own version. Is there any reason this is not included?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Should the JQuery UI library be include with 5.4

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
I remember seeing requireJS handling this case correctly somewhere in its documentation. I don't see any other good way resolving this in T5.4 as of now. 

> On Oct 3, 2013, at 12:17 AM, Magnus Kvalheim <ma...@movellas.com> wrote:
> 
> define(["t5/core/dom", "t5/core/events", "jquery", "//
> code.jquery.com/ui/1.10.3/jquery-ui.js"],
> ...
> 
> That's interesting - loading of scripts directly within a define. Seems
> very useful and convenient.
> 
> Thought I might use same approach in some scenarios.
> I tried to lookup on documentation of that to see use cases, but seems like
> requirejs officially describes the paths and shim configurations as ways to
> load non AMD modules.
> (In my still limited knowledge)
> 
> 
> A heads up though.
> Looks like requirejs does not guarantee execution order for non AMD
> scripts. So according to some sources there is a chance that jqueryui may
> execute before jquery in this case.
> Look at the "update" and comments in this post:
> http://iamnotmyself.com/2012/09/07/getting-started-managing-client-side-scripts-with-require-js/
> 
> Also I wonder what would happen if there were more modules that depended on
> the same jqueryui script..?
> 
>> On Thu, Oct 3, 2013 at 4:40 AM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>> 
>> I tried to do exactly what you are trying to do and that's what
>> precipitated the discussion about JQuery and Bootstrap from CDN.
>> I have brought back T5.4 zone highlight effect with this:
>> 
>> https://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/META-INF/modules/flowlogix/HighlightEffect.js?name=tapestry-5.4
>> It requires JQueryUI and I just load it from CDN and it works perfectly.
>> 
>>> On Oct 2, 2013, at 7:14 PM, Barry Books <tr...@gmail.com> wrote:
>>> 
>>> When I created the datapicker I also needed the JQuery UI library but it
>>> does not appear to be an option in the Tapestry Core. I think many jquery
>>> components may need this and without it in the core many modules will
>> each
>>> end up with their own version. Is there any reason this is not included?
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Should the JQuery UI library be include with 5.4

Posted by Magnus Kvalheim <ma...@movellas.com>.
define(["t5/core/dom", "t5/core/events", "jquery", "//
code.jquery.com/ui/1.10.3/jquery-ui.js"],
...

That's interesting - loading of scripts directly within a define. Seems
very useful and convenient.

Thought I might use same approach in some scenarios.
I tried to lookup on documentation of that to see use cases, but seems like
requirejs officially describes the paths and shim configurations as ways to
load non AMD modules.
(In my still limited knowledge)


A heads up though.
Looks like requirejs does not guarantee execution order for non AMD
scripts. So according to some sources there is a chance that jqueryui may
execute before jquery in this case.
Look at the "update" and comments in this post:
http://iamnotmyself.com/2012/09/07/getting-started-managing-client-side-scripts-with-require-js/

Also I wonder what would happen if there were more modules that depended on
the same jqueryui script..?

On Thu, Oct 3, 2013 at 4:40 AM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:

> I tried to do exactly what you are trying to do and that's what
> precipitated the discussion about JQuery and Bootstrap from CDN.
> I have brought back T5.4 zone highlight effect with this:
>
> https://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/META-INF/modules/flowlogix/HighlightEffect.js?name=tapestry-5.4
> It requires JQueryUI and I just load it from CDN and it works perfectly.
>
> > On Oct 2, 2013, at 7:14 PM, Barry Books <tr...@gmail.com> wrote:
> >
> > When I created the datapicker I also needed the JQuery UI library but it
> > does not appear to be an option in the Tapestry Core. I think many jquery
> > components may need this and without it in the core many modules will
> each
> > end up with their own version. Is there any reason this is not included?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Should the JQuery UI library be include with 5.4

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
I tried to do exactly what you are trying to do and that's what precipitated the discussion about JQuery and Bootstrap from CDN. 
I have brought back T5.4 zone highlight effect with this: 
https://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/META-INF/modules/flowlogix/HighlightEffect.js?name=tapestry-5.4
It requires JQueryUI and I just load it from CDN and it works perfectly.  

> On Oct 2, 2013, at 7:14 PM, Barry Books <tr...@gmail.com> wrote:
> 
> When I created the datapicker I also needed the JQuery UI library but it
> does not appear to be an option in the Tapestry Core. I think many jquery
> components may need this and without it in the core many modules will each
> end up with their own version. Is there any reason this is not included?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Should the JQuery UI library be include with 5.4

Posted by Barry Books <tr...@gmail.com>.
I was not a big fan of breaking it up. jQuery UI is not that large and if
you use different parts on different pages one download seems better.


On Thu, Oct 3, 2013 at 5:47 AM, Dmitry Gusev <dm...@gmail.com> wrote:

> Before Tapestry 5.4 I used tapestry-jquery as jQuery UI provider (I don't
> use T5.4 yet in any of my projects).
>
> There is a @ImportJQueryUI annotation you can use to import jQuery UI parts
> you need:
>
> @ImportJQueryUI(value = { "jquery.ui.tabs" })
>
> Not sure how it will work in Tapestry 5.4 and what are the plans for
> tapestry-jquery and T5.4, but it sounds reasonable to me that if you're
> implementing jQuery integration for tapestry5, then you will add
> tapestry-jquery as a dependency to your integration and use this annotation
> (or any other approach that will be picked in tapestry-jquery for T5.4).
>
> This way you will contribute to this wonderful library and that will
> support its future development.
>
>
> On Thu, Oct 3, 2013 at 6:14 AM, Barry Books <tr...@gmail.com> wrote:
>
> > When I created the datapicker I also needed the JQuery UI library but it
> > does not appear to be an option in the Tapestry Core. I think many jquery
> > components may need this and without it in the core many modules will
> each
> > end up with their own version. Is there any reason this is not included?
> >
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>

Re: Should the JQuery UI library be include with 5.4

Posted by Dmitry Gusev <dm...@gmail.com>.
Before Tapestry 5.4 I used tapestry-jquery as jQuery UI provider (I don't
use T5.4 yet in any of my projects).

There is a @ImportJQueryUI annotation you can use to import jQuery UI parts
you need:

@ImportJQueryUI(value = { "jquery.ui.tabs" })

Not sure how it will work in Tapestry 5.4 and what are the plans for
tapestry-jquery and T5.4, but it sounds reasonable to me that if you're
implementing jQuery integration for tapestry5, then you will add
tapestry-jquery as a dependency to your integration and use this annotation
(or any other approach that will be picked in tapestry-jquery for T5.4).

This way you will contribute to this wonderful library and that will
support its future development.


On Thu, Oct 3, 2013 at 6:14 AM, Barry Books <tr...@gmail.com> wrote:

> When I created the datapicker I also needed the JQuery UI library but it
> does not appear to be an option in the Tapestry Core. I think many jquery
> components may need this and without it in the core many modules will each
> end up with their own version. Is there any reason this is not included?
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: Should the JQuery UI library be include with 5.4

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 02 Oct 2013 23:14:32 -0300, Barry Books <tr...@gmail.com> wrote:

> When I created the datapicker I also needed the JQuery UI library but it
> does not appear to be an option in the Tapestry Core. I think many jquery
> components may need this and without it in the core many modules will  
> each end up with their own version. Is there any reason this is not  
> included?

Tapestry 5.4 is now JS framework-agnostic, so using jQuery UI would break  
that badly. On the other hand, nothing prevents us to provide it as a  
separate drop-in package. That's part of what tapestry-jquery does. It  
would be nice to have a version of it that works in 5.4. I guess that's  
already being done.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org