You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2013/05/27 23:20:36 UTC

Dynamic decision which version of jQuery to contribute

Hi,

At https://issues.apache.org/jira/browse/WICKET-5208 you may see a simple
patch that makes JQueryResourceReference more dynamic.
With this change Wicket can deliver jQuery 2.x to modern browsers and
jQuery 1.x for IE 6/7/8.

Pros: smaller jQuery
Cons: dynamic calculation by using the user agent to make the decision.

Do you think this is useful/problematic ?

The user application still can set its own ResourceReference with jQuery
version that it prefers.

Re: Dynamic decision which version of jQuery to contribute

Posted by tetsuo <ro...@gmail.com>.
Just not by default, please.


On Mon, May 27, 2013 at 6:32 PM, Sebastien <se...@gmail.com> wrote:

> Hi Martin,
>
> About the dynamic calculation, can't it be made according to an
> IApplicationSettings or an IJavaScriptLibrarySettings flag? Maybe could
> this flag be false by default and the user may set it to true it if its
> application needs to be used by IE6/7/8?
>
> Thanks & best regards,
> Sebastien
>
>
> On Mon, May 27, 2013 at 11:20 PM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
>
> > Hi,
> >
> > At https://issues.apache.org/jira/browse/WICKET-5208 you may see a
> simple
> > patch that makes JQueryResourceReference more dynamic.
> > With this change Wicket can deliver jQuery 2.x to modern browsers and
> > jQuery 1.x for IE 6/7/8.
> >
> > Pros: smaller jQuery
> > Cons: dynamic calculation by using the user agent to make the decision.
> >
> > Do you think this is useful/problematic ?
> >
> > The user application still can set its own ResourceReference with jQuery
> > version that it prefers.
> >
>

Re: Dynamic decision which version of jQuery to contribute

Posted by Sven Meier <sv...@meiers.net>.
Good suggestion, Michael.

Sven

On 05/28/2013 08:21 AM, Martin Grigorov wrote:
> Hi,
>
> I've reworked it as Michael suggested - DynamicJQueryResourceReference.
> Additionally I added caching of the calculated name in the request cycle's
> metadata, so the name is calculated at most once per request.
> It will be added only to master branch (7.x) until someone asks to downport
> it to 6.x.
>
>
> On Tue, May 28, 2013 at 8:36 AM, Michael Haitz <mi...@1und1.de>wrote:
>
>> Hi,
>>
>> why not adding a second JQueryResourceReference? Then you can use the
>> dynamic one or not (without a new setting).
>>
>> getJavaScriptLibrarySettings().setJQueryReference(new
>> DynamicJQueryResourceReference());
>>
>> cheers,
>> Michael
>>
>> Am 27.05.2013 um 23:32 schrieb Sebastien <se...@gmail.com>
>> :
>>
>>> Hi Martin,
>>>
>>> About the dynamic calculation, can't it be made according to an
>>> IApplicationSettings or an IJavaScriptLibrarySettings flag? Maybe could
>>> this flag be false by default and the user may set it to true it if its
>>> application needs to be used by IE6/7/8?
>>>
>>> Thanks & best regards,
>>> Sebastien
>>>
>>>
>>> On Mon, May 27, 2013 at 11:20 PM, Martin Grigorov <mgrigorov@apache.org
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> At https://issues.apache.org/jira/browse/WICKET-5208 you may see a
>> simple
>>>> patch that makes JQueryResourceReference more dynamic.
>>>> With this change Wicket can deliver jQuery 2.x to modern browsers and
>>>> jQuery 1.x for IE 6/7/8.
>>>>
>>>> Pros: smaller jQuery
>>>> Cons: dynamic calculation by using the user agent to make the decision.
>>>>
>>>> Do you think this is useful/problematic ?
>>>>
>>>> The user application still can set its own ResourceReference with jQuery
>>>> version that it prefers.
>>>>
>>


Re: Dynamic decision which version of jQuery to contribute

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I've reworked it as Michael suggested - DynamicJQueryResourceReference.
Additionally I added caching of the calculated name in the request cycle's
metadata, so the name is calculated at most once per request.
It will be added only to master branch (7.x) until someone asks to downport
it to 6.x.


On Tue, May 28, 2013 at 8:36 AM, Michael Haitz <mi...@1und1.de>wrote:

> Hi,
>
> why not adding a second JQueryResourceReference? Then you can use the
> dynamic one or not (without a new setting).
>
> getJavaScriptLibrarySettings().setJQueryReference(new
> DynamicJQueryResourceReference());
>
> cheers,
> Michael
>
> Am 27.05.2013 um 23:32 schrieb Sebastien <se...@gmail.com>
> :
>
> > Hi Martin,
> >
> > About the dynamic calculation, can't it be made according to an
> > IApplicationSettings or an IJavaScriptLibrarySettings flag? Maybe could
> > this flag be false by default and the user may set it to true it if its
> > application needs to be used by IE6/7/8?
> >
> > Thanks & best regards,
> > Sebastien
> >
> >
> > On Mon, May 27, 2013 at 11:20 PM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
> >
> >> Hi,
> >>
> >> At https://issues.apache.org/jira/browse/WICKET-5208 you may see a
> simple
> >> patch that makes JQueryResourceReference more dynamic.
> >> With this change Wicket can deliver jQuery 2.x to modern browsers and
> >> jQuery 1.x for IE 6/7/8.
> >>
> >> Pros: smaller jQuery
> >> Cons: dynamic calculation by using the user agent to make the decision.
> >>
> >> Do you think this is useful/problematic ?
> >>
> >> The user application still can set its own ResourceReference with jQuery
> >> version that it prefers.
> >>
>
>

Re: Dynamic decision which version of jQuery to contribute

Posted by Michael Haitz <mi...@1und1.de>.
Hi,

why not adding a second JQueryResourceReference? Then you can use the dynamic one or not (without a new setting).

getJavaScriptLibrarySettings().setJQueryReference(new DynamicJQueryResourceReference());

cheers,
Michael

Am 27.05.2013 um 23:32 schrieb Sebastien <se...@gmail.com>
:

> Hi Martin,
> 
> About the dynamic calculation, can't it be made according to an
> IApplicationSettings or an IJavaScriptLibrarySettings flag? Maybe could
> this flag be false by default and the user may set it to true it if its
> application needs to be used by IE6/7/8?
> 
> Thanks & best regards,
> Sebastien
> 
> 
> On Mon, May 27, 2013 at 11:20 PM, Martin Grigorov <mg...@apache.org>wrote:
> 
>> Hi,
>> 
>> At https://issues.apache.org/jira/browse/WICKET-5208 you may see a simple
>> patch that makes JQueryResourceReference more dynamic.
>> With this change Wicket can deliver jQuery 2.x to modern browsers and
>> jQuery 1.x for IE 6/7/8.
>> 
>> Pros: smaller jQuery
>> Cons: dynamic calculation by using the user agent to make the decision.
>> 
>> Do you think this is useful/problematic ?
>> 
>> The user application still can set its own ResourceReference with jQuery
>> version that it prefers.
>> 


Re: Dynamic decision which version of jQuery to contribute

Posted by Sebastien <se...@gmail.com>.
Hi Martin,

About the dynamic calculation, can't it be made according to an
IApplicationSettings or an IJavaScriptLibrarySettings flag? Maybe could
this flag be false by default and the user may set it to true it if its
application needs to be used by IE6/7/8?

Thanks & best regards,
Sebastien


On Mon, May 27, 2013 at 11:20 PM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> At https://issues.apache.org/jira/browse/WICKET-5208 you may see a simple
> patch that makes JQueryResourceReference more dynamic.
> With this change Wicket can deliver jQuery 2.x to modern browsers and
> jQuery 1.x for IE 6/7/8.
>
> Pros: smaller jQuery
> Cons: dynamic calculation by using the user agent to make the decision.
>
> Do you think this is useful/problematic ?
>
> The user application still can set its own ResourceReference with jQuery
> version that it prefers.
>