You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Volker Lamp <vl...@apache.org> on 2022/07/12 21:27:52 UTC

Upgrading to jQuery 3.5.1

Hi guys

I've made some progress towards upgrading to jQuery 3.5.1 (
https://issues.apache.org/jira/browse/TAP5-2734). While this is not the 
latest version (3.6.0, actually), 3.5.1 is what the latest Bootstrap 4 
release (4.6.1) depends on (see (
https://issues.apache.org/jira/browse/TAP5-2733).

jQuery 3.0+ comes with the jQuery Migrate Plugin which simplifies 
migration of older code to version 3.0+ by restoring the APIs that were 
removed. It ships as a minified production build and a non-minified 
development build. The development build additionally shows warnings in 
the browser console when removed or deprecated APIs are used.

Here is what I've done so far (in the TAP5-2734 branch):

1. overwrote jQuery 1.12.1 sources with jQuery 3.5.1 sources;
2. added the non-minified jQuery Migrate Plugin as a JS module (only 
when Tapestry is running in development mode).
3. added a test case to verify theĀ  jquery-migrate module is loaded and 
works as advertised.

Keen to get your opinions if the jquery-migrate module should also be 
available in production mode?

Cheers

Volker


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


Re: Upgrading to jQuery 3.5.1

Posted by Ben Weidig <be...@netzgut.net>.
Peter has good point!
And I like Thiago's idea of different
tapestry.javascript-infrastructure-provider values better than my initial
one.

Maybe the Trait-system should be used to set the default correctly to
jQuery 3.6 if Trait.BOOTSTRAP4 is active.
This way, it will have the correct jquery version if a user chose to use
Bootstrap4, and the legacy jquery if not.
And if they need to mix BS4 with another jquery version, they can utilize
tapestry.javascript-infrastructure-provider

Cheers
Ben

On Fri, Jul 15, 2022 at 8:26 AM <pe...@ooom.at> wrote:

> Hi Guys,
>
> I would also strongly suggest to let the jQuery version selectable, as
> long as it is in expected range.
> jQuery is often a base dependency for other js libs used on the client
> side, which may behave little bit differently, depending on the jQuery
> version. jQueryUI does for instance.
>
> regards, Peter
>
> Am 14.07.2022 21:53, schrieb Volker Lamp:
> > Hi Thiago
> >
> >> My idea is similar, but not the same: having a separate
> >> tapestry.javascript-infrastructure-provider value for using latest
> >> jQuery.
> >
> > Like 'jquery-3'?
> >
> >> At my day job, we already had problems with our jQuery code
> >> when upgrading from 1.3 to 1.8 (or 1.12, I don't remember exactly),
> >> and I suppose it's going to be way worse going from 1.x to 3.x.
> >
> > I'm the first to admin I'm neither a jQuery nor a JavaScript expert.
> > Yet from the jQuery website [1] I understand that jQuery 3.x is
> > backwards compatible all the way back to jQuery 1.9+ (with the jQuery
> > Migrate Plugin activated). The jQuery Migrate GitHub page [2] states a
> > later version, namely jQuery 1.12.x, as a prerequisite.
> >
> > Anyway, Tapestry's dependency is for jQuery 1.12.1, so there should
> > not be any issues for anyone as long as we support enabling the jQuery
> > Migrate Plugin also for production.
> >
> >> Tapestry 5 has always been careful about backward compatibility, and I
> >> believe we should keep the existing 'jquery' infrastructure still
> >> using jQuery 1.x. As Ben said, and I agree 100%, "But it should
> >> require a conscious user decision to do so."
> >
> > I'm ok with the conscious user decision, but I don't like sticking to
> > jQuery 1.12.1 as the default. The default should not be a 6.5 year old
> > release. Setting the value to 'jquery-migrate' would still be a
> > conscious user decision - a decision to continue with the jQuery
> > 1.12.x compatible code.
> >
> > Likewise, delivering TAP5-2732 ("change the default value to 'jquery'
> > - something Tapestry users were 'warned' that would happen one day
> > years ago) will force those Tapestry users that want to stick with
> > Prototype to make an active change to that configuration setting. Not
> > asking for too much, in my opinion.
> >
> > I'll add my preferred solution to the TAP5-2734 branch so it can be
> > tested easily. Also, there is no rush. The whole thing is a
> > consequence of trying to tackle TAP5-2686 which could also be fixed
> > with making a small change in the Bootstrap 4.3.1 sources bundled with
> > Tapestry.
> >
> > [1] https://jquery.com/download/
> > [2] https://github.com/jquery/jquery-migrate/#readme
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

Re: Upgrading to jQuery 3.5.1

Posted by pe...@ooom.at.
Hi Guys,

I would also strongly suggest to let the jQuery version selectable, as 
long as it is in expected range.
jQuery is often a base dependency for other js libs used on the client 
side, which may behave little bit differently, depending on the jQuery 
version. jQueryUI does for instance.

regards, Peter

Am 14.07.2022 21:53, schrieb Volker Lamp:
> Hi Thiago
> 
>> My idea is similar, but not the same: having a separate
>> tapestry.javascript-infrastructure-provider value for using latest
>> jQuery.
> 
> Like 'jquery-3'?
> 
>> At my day job, we already had problems with our jQuery code
>> when upgrading from 1.3 to 1.8 (or 1.12, I don't remember exactly),
>> and I suppose it's going to be way worse going from 1.x to 3.x.
> 
> I'm the first to admin I'm neither a jQuery nor a JavaScript expert.
> Yet from the jQuery website [1] I understand that jQuery 3.x is
> backwards compatible all the way back to jQuery 1.9+ (with the jQuery
> Migrate Plugin activated). The jQuery Migrate GitHub page [2] states a
> later version, namely jQuery 1.12.x, as a prerequisite.
> 
> Anyway, Tapestry's dependency is for jQuery 1.12.1, so there should
> not be any issues for anyone as long as we support enabling the jQuery
> Migrate Plugin also for production.
> 
>> Tapestry 5 has always been careful about backward compatibility, and I
>> believe we should keep the existing 'jquery' infrastructure still
>> using jQuery 1.x. As Ben said, and I agree 100%, "But it should
>> require a conscious user decision to do so."
> 
> I'm ok with the conscious user decision, but I don't like sticking to
> jQuery 1.12.1 as the default. The default should not be a 6.5 year old
> release. Setting the value to 'jquery-migrate' would still be a
> conscious user decision - a decision to continue with the jQuery
> 1.12.x compatible code.
> 
> Likewise, delivering TAP5-2732 ("change the default value to 'jquery'
> - something Tapestry users were 'warned' that would happen one day
> years ago) will force those Tapestry users that want to stick with
> Prototype to make an active change to that configuration setting. Not
> asking for too much, in my opinion.
> 
> I'll add my preferred solution to the TAP5-2734 branch so it can be
> tested easily. Also, there is no rush. The whole thing is a
> consequence of trying to tackle TAP5-2686 which could also be fixed
> with making a small change in the Bootstrap 4.3.1 sources bundled with
> Tapestry.
> 
> [1] https://jquery.com/download/
> [2] https://github.com/jquery/jquery-migrate/#readme
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org

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


Re: Upgrading to jQuery 3.5.1

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, Jul 20, 2022 at 5:39 PM Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> Yes. And/or maybe have a new configuration symbol for jQuery file
> location with the default being the current location.

Somehow I overlooked Peter's great point above, so I'd say Tapestry
should definitely have a symbol so the user can choose any version of
jQuery they want or need. This would help implement his idea of
automatically using jQuery 3.6.1 when the Bootstrap 4 trait is used.
Or switch the default jQuery to be 3.6.1 and have a jquery-1
infrastructure or trait that automatically makes Tapestry use jQuery
1.12.x, plus documenting this in release notes and other pages
mentioning JavaScript and jQuery.

Regarding jquery-migrate, it's easy to add something to the core
JavaScript stack and have it automatically included everywhere JS is
used, so I think we should document that and we don't have to have
configurations for that.

>
> > I'm the first to admin I'm neither a jQuery nor a JavaScript expert. Yet from the jQuery website [1] I understand that jQuery 3.x is backwards compatible all the way back to jQuery 1.9+ (with the jQuery Migrate Plugin activated). The jQuery Migrate GitHub page [2] states a later version, namely jQuery 1.12.x, as a prerequisite.
> >
> > Anyway, Tapestry's dependency is for jQuery 1.12.1, so there should not be any issues for anyone as long as we support enabling the jQuery Migrate Plugin also for production.
>
> Agreed.
>
> > I'm ok with the conscious user decision, but I don't like sticking to jQuery 1.12.1 as the default. The default should not be a 6.5 year old release. Setting the value to 'jquery-migrate' would still be a conscious user decision - a decision to continue with the jQuery 1.12.x compatible code.
> >
> > Likewise, delivering TAP5-2732 ("change the default value to 'jquery' - something Tapestry users were 'warned' that would happen one day years ago) will force those Tapestry users that want to stick with Prototype to make an active change to that configuration setting. Not asking for too much, in my opinion.
>
> Agreed.
>
> >
> > I'll add my preferred solution to the TAP5-2734 branch so it can be tested easily. Also, there is no rush. The whole thing is a consequence of trying to tackle TAP5-2686 which could also be fixed with making a small change in the Bootstrap 4.3.1 sources bundled with Tapestry.
> >
> > [1] https://jquery.com/download/
> > [2] https://github.com/jquery/jquery-migrate/#readme
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
>
>
> --
> Thiago



-- 
Thiago

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


Re: Upgrading to jQuery 3.5.1

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, Jul 14, 2022 at 4:53 PM Volker Lamp <vl...@apache.org> wrote:

> Hi Thiago

Hi!

> > My idea is similar, but not the same: having a separate
> > tapestry.javascript-infrastructure-provider value for using latest
> > jQuery.
>
> Like 'jquery-3'?

Yes. And/or maybe have a new configuration symbol for jQuery file
location with the default being the current location.

> I'm the first to admin I'm neither a jQuery nor a JavaScript expert. Yet from the jQuery website [1] I understand that jQuery 3.x is backwards compatible all the way back to jQuery 1.9+ (with the jQuery Migrate Plugin activated). The jQuery Migrate GitHub page [2] states a later version, namely jQuery 1.12.x, as a prerequisite.
>
> Anyway, Tapestry's dependency is for jQuery 1.12.1, so there should not be any issues for anyone as long as we support enabling the jQuery Migrate Plugin also for production.

Agreed.

> I'm ok with the conscious user decision, but I don't like sticking to jQuery 1.12.1 as the default. The default should not be a 6.5 year old release. Setting the value to 'jquery-migrate' would still be a conscious user decision - a decision to continue with the jQuery 1.12.x compatible code.
>
> Likewise, delivering TAP5-2732 ("change the default value to 'jquery' - something Tapestry users were 'warned' that would happen one day years ago) will force those Tapestry users that want to stick with Prototype to make an active change to that configuration setting. Not asking for too much, in my opinion.

Agreed.

>
> I'll add my preferred solution to the TAP5-2734 branch so it can be tested easily. Also, there is no rush. The whole thing is a consequence of trying to tackle TAP5-2686 which could also be fixed with making a small change in the Bootstrap 4.3.1 sources bundled with Tapestry.
>
> [1] https://jquery.com/download/
> [2] https://github.com/jquery/jquery-migrate/#readme
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>


-- 
Thiago

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


Re: Upgrading to jQuery 3.5.1

Posted by Volker Lamp <vl...@apache.org>.
Hi Thiago

> My idea is similar, but not the same: having a separate
> tapestry.javascript-infrastructure-provider value for using latest
> jQuery.

Like 'jquery-3'? 

> At my day job, we already had problems with our jQuery code
> when upgrading from 1.3 to 1.8 (or 1.12, I don't remember exactly),
> and I suppose it's going to be way worse going from 1.x to 3.x.

I'm the first to admin I'm neither a jQuery nor a JavaScript expert. Yet from the jQuery website [1] I understand that jQuery 3.x is backwards compatible all the way back to jQuery 1.9+ (with the jQuery Migrate Plugin activated). The jQuery Migrate GitHub page [2] states a later version, namely jQuery 1.12.x, as a prerequisite.

Anyway, Tapestry's dependency is for jQuery 1.12.1, so there should not be any issues for anyone as long as we support enabling the jQuery Migrate Plugin also for production.

> Tapestry 5 has always been careful about backward compatibility, and I
> believe we should keep the existing 'jquery' infrastructure still
> using jQuery 1.x. As Ben said, and I agree 100%, "But it should
> require a conscious user decision to do so."

I'm ok with the conscious user decision, but I don't like sticking to jQuery 1.12.1 as the default. The default should not be a 6.5 year old release. Setting the value to 'jquery-migrate' would still be a conscious user decision - a decision to continue with the jQuery 1.12.x compatible code.

Likewise, delivering TAP5-2732 ("change the default value to 'jquery' - something Tapestry users were 'warned' that would happen one day years ago) will force those Tapestry users that want to stick with Prototype to make an active change to that configuration setting. Not asking for too much, in my opinion. 

I'll add my preferred solution to the TAP5-2734 branch so it can be tested easily. Also, there is no rush. The whole thing is a consequence of trying to tackle TAP5-2686 which could also be fixed with making a small change in the Bootstrap 4.3.1 sources bundled with Tapestry. 

[1] https://jquery.com/download/
[2] https://github.com/jquery/jquery-migrate/#readme

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


Re: Upgrading to jQuery 3.5.1

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Hello!

On Thu, Jul 14, 2022 at 2:17 PM Volker Lamp <vl...@apache.org> wrote:

> I agree. How about -- instead of creating a new configuration symbol -- re-using 'tapestry.javascript-infrastructure-provider'? The default value is still 'prototype', by the way, but I intend to change that (see TAP5-2732). Setting it to 'query-migrate' would enable the jQuery Migration Plugin, for both production or development mode.

My idea is similar, but not the same: having a separate
tapestry.javascript-infrastructure-provider value for using latest
jQuery. At my day job, we already had problems with our jQuery code
when upgrading from 1.3 to 1.8 (or 1.12, I don't remember exactly),
and I suppose it's going to be way worse going from 1.x to 3.x.
Tapestry 5 has always been careful about backward compatibility, and I
believe we should keep the existing 'jquery' infrastructure still
using jQuery 1.x. As Ben said, and I agree 100%, "But it should
require a conscious user decision to do so."

Thanks for investigating this!

>
> I'll give it a try and push it to the TAP5-2734 branch when ready.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>


-- 
Thiago

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


Re: Upgrading to jQuery 3.5.1

Posted by Volker Lamp <vl...@apache.org>.
Thank you for your response, Ben.

> IMO the jquery-migrate plugin shouldn't be included in production by
> default, but it could be activated with a symbol constant.

I agree. How about -- instead of creating a new configuration symbol -- re-using 'tapestry.javascript-infrastructure-provider'? The default value is still 'prototype', by the way, but I intend to change that (see TAP5-2732). Setting it to 'query-migrate' would enable the jQuery Migration Plugin, for both production or development mode.

I'll give it a try and push it to the TAP5-2734 branch when ready.

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


Re: Upgrading to jQuery 3.5.1

Posted by Ben Weidig <be...@netzgut.net>.
Hi Volker,

wow, I didn't realize that jQuery was so outdated because I totally forgot
that we internally replaced it with 3.3.1 a long time ago...

IMO the jquery-migrate plugin shouldn't be included in production by
default, but it could be activated with a symbol constant.

This way, Tapestry won't force code changes upon users who don't want or
can't update all their jQuery-related code, even though BS 4.6.1 actually
depends on it.
But it should require a conscious user decision to do so.

Cheers
Ben

On Tue, Jul 12, 2022 at 11:27 PM Volker Lamp <vl...@apache.org> wrote:

> Hi guys
>
> I've made some progress towards upgrading to jQuery 3.5.1 (
> https://issues.apache.org/jira/browse/TAP5-2734). While this is not the
> latest version (3.6.0, actually), 3.5.1 is what the latest Bootstrap 4
> release (4.6.1) depends on (see (
> https://issues.apache.org/jira/browse/TAP5-2733).
>
> jQuery 3.0+ comes with the jQuery Migrate Plugin which simplifies
> migration of older code to version 3.0+ by restoring the APIs that were
> removed. It ships as a minified production build and a non-minified
> development build. The development build additionally shows warnings in
> the browser console when removed or deprecated APIs are used.
>
> Here is what I've done so far (in the TAP5-2734 branch):
>
> 1. overwrote jQuery 1.12.1 sources with jQuery 3.5.1 sources;
> 2. added the non-minified jQuery Migrate Plugin as a JS module (only
> when Tapestry is running in development mode).
> 3. added a test case to verify the  jquery-migrate module is loaded and
> works as advertised.
>
> Keen to get your opinions if the jquery-migrate module should also be
> available in production mode?
>
> Cheers
>
> Volker
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>