Discussion:
Should the JQuery UI library be include with 5.4
Barry Books
2013-10-03 02:14:32 UTC
Permalink
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?
Thiago H de Paula Figueiredo
2013-10-03 02:30:11 UTC
Permalink
Post by Barry Books
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-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org
Lenny Primak
2013-10-03 02:40:52 UTC
Permalink
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.
Post by Barry Books
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-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org
Magnus Kvalheim
2013-10-03 07:17:51 UTC
Permalink
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..?
Post by Lenny Primak
I tried to do exactly what you are trying to do and that's what
precipitated the discussion about JQuery and Bootstrap from CDN.
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.
Post by Barry Books
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
Post by Barry Books
end up with their own version. Is there any reason this is not included?
---------------------------------------------------------------------
Lenny Primak
2013-10-03 17:33:57 UTC
Permalink
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.
Post by Magnus Kvalheim
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.
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..?
Post by Lenny Primak
I tried to do exactly what you are trying to do and that's what
precipitated the discussion about JQuery and Bootstrap from CDN.
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.
Post by Barry Books
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
Post by Barry Books
end up with their own version. Is there any reason this is not included?
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org

Bård Magnus Kvalheim
2013-10-03 07:22:31 UTC
Permalink
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?
Post by Lenny Primak
I tried to do exactly what you are trying to do and that's what
precipitated the discussion about JQuery and Bootstrap from CDN.
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.
Post by Barry Books
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
Post by Barry Books
end up with their own version. Is there any reason this is not included?
---------------------------------------------------------------------
Barry Books
2013-10-03 10:52:02 UTC
Permalink
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.
Post by Magnus Kvalheim
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.
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?
Post by Lenny Primak
I tried to do exactly what you are trying to do and that's what
precipitated the discussion about JQuery and Bootstrap from CDN.
https://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/META-INF/modules/flowlogix/HighlightEffect.js?name=tapestry-5.4
Post by Lenny Primak
It requires JQueryUI and I just load it from CDN and it works perfectly.
Post by Barry Books
When I created the datapicker I also needed the JQuery UI library but
it
Post by Lenny Primak
Post by Barry Books
does not appear to be an option in the Tapestry Core. I think many
jquery
Post by Lenny Primak
Post by Barry Books
components may need this and without it in the core many modules will
each
Post by Barry Books
end up with their own version. Is there any reason this is not
included?
Post by Lenny Primak
---------------------------------------------------------------------
Dmitry Gusev
2013-10-03 10:47:07 UTC
Permalink
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.
Post by Barry Books
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
Barry Books
2013-10-03 11:26:39 UTC
Permalink
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.
Post by Dmitry Gusev
Before Tapestry 5.4 I used tapestry-jquery as jQuery UI provider (I don't
use T5.4 yet in any of my projects).
@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.
Post by Barry Books
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
Post by Barry Books
end up with their own version. Is there any reason this is not included?
--
Dmitry Gusev
AnjLab Team
http://anjlab.com
Loading...