[wp-hackers] i love wordpress support for php functions, but this what happens with every upgrade of jquery...

Marko Heijnen mailing at markoheijnen.nl
Wed Oct 9 10:40:47 UTC 2013


Looking at the jQuery documentation I don't  see what you mean. selected() still seems to be fine.
That said. As a developer it's also your task to make sure that all jQuery scripts are updated. Even if a plugin using deprecated functions it doesn't mean you should not update it.

In general I don't think a lot of sites break during a jQuery update. The current one is a more tricky one because of a lot of deprecated functions. Because of the WordPress does load jQuery migrate.
So my feeling saids that the upgrade to jQuery 1.10 was maybe the most tricky upgrade we ever did. And that is not wrong. It just means another step forward. And to me that was needed.

Marko


Op 9 okt. 2013, om 12:20 heeft Konrad Karpieszuk <kkarpieszuk at gmail.com> het volgende geschreven:

> Nikola, i know how to register own version of jquery, but as you wrote:
> 
> "Keep in mind that this might break other plugins that depend
> on the latest version of jQuery."
> 
> exactly: registering own version o jQ looks like waiting for troubles. i
> hate when i see that some plugin developers do this and i see that beacouse
> of that wordpress is linking to some cdn with quite old version.
> 
> i think wordpress core developers really shouldnt bring cutting edge of
> jquery with every minor upgrade of this cms. in php functions support for
> old and deprecated is very good, but in javascript looks like horror for
> front end developers
> 
> 
> --
> (en) regards / (pl) pozdrawiam
> Konrad Karpieszuk
> http://tradematik.pl wtyczka do WordPressa do tworzenia sklepów dla
> klientów z Polski
> 
> 
> 
> On Wed, Oct 9, 2013 at 11:42 AM, Nikola Nikolov <nikolov.tmw at gmail.com>wrote:
> 
>> Well a simple solution is to simply register your own version of jQuery and
>> stick to it. Keep in mind that this might break other plugins that depend
>> on the latest version of jQuery.
>> 
>> Here's a sample code:
>> 
>> function my_enqueue_scripts() {
>>    // De-register the core version of jQuery
>>    wp_deregister_script( 'jquery' );
>> 
>>    // Register our version of jQuery and our script that depends on that
>> version of jQuery
>>    wp_register_script( 'jquery', get_bloginfo( 'template_directory' ) .
>> '/js/jquery.js' );
>>    wp_register_script( 'my-jquery-dependent-script', get_bloginfo(
>> 'template_directory' ) . '/js/script.js', array( 'jquery' ) );
>> 
>>    // Enqueue the custom script
>>    wp_enqueue_script( 'my-jquery-dependent-script' );
>> }
>> add_action( 'wp_enqueue_scripts', 'my_enqueue_scripts', 10 );
>> 
>> 
>> Now, please keep in mind the following: someone else might come after you
>> and make changes on the theme, or poke around it. Please leave a note as to
>> why exactly you're using the exact version of jQuery that you're using, so
>> that the next person doesn't suffer too much :) And I assume that the
>> syntax that comes with jQuery 1.10 will stick around for longer, so at
>> least update your themes to use 1.10 and then use local version of 1.10
>> 
>> Nikola
>> 
>> 
>> On Wed, Oct 9, 2013 at 12:31 PM, Konrad Karpieszuk <kkarpieszuk at gmail.com
>>> wrote:
>> 
>>> Hi people
>>> 
>>> I think one of most important thing in wordpress is that it supports even
>>> old wordpress api functions (just throwing notice that this is depracated
>>> and you should consider to use new way of doing this thing). This very
>>> important argument when you propose to your customer to build website on
>>> wordpress: you can tell him that website will work for years, and he/she
>>> don't have to be affraid of making wordpress core upgrades.
>>> 
>>> But this what happens after every upgrade of wordpress which delivers new
>>> version of jQuery i can comment only in three letters: WTF?! :)
>>> 
>>> Today i upgraded one website of my customer to wp 3.6.1 which brings
>> jquery
>>> 1.10. And after that all sliders based on jquery tabs stopped to work.
>>> 
>>> I found reason: in my sliders i heavily use method 'selected' which in
>> new
>>> version of jQuery is called 'active' and i use 'fx' - now i should use
>>> 'show' option.
>>> 
>>> I changed that, but what with other websites? I developed tens of them
>>> where i am sure problem will be the same after wordpress upgrade.
>>> 
>>> And also few months ago i sam that jquery tabs method 'rotate' also was
>>> castrated. Then i found some plugin which brought it back.
>>> 
>>> 
>>> But this is silly! I include jquery and jquery-ui-tabs using
>>> wp_enqueue_script every time - in the way how codex.wordpress suggest to
>> do
>>> this. Now it looks that because of wp upgrades you cannot depend on this.
>>> 
>>> I cannot tell my customers not to upgrade wordpress, because of that
>>> animations will stop to work. Also i cannot charge thetm for my
>> additional
>>> work after every wordpress upgarde - this is not the way how i cooperate
>>> with customers.
>>> 
>>> I know that the problem is in jQuery way of development, not in
>> wordpress,
>>> but maybe you - wordpress core developers - have some idea how to deal
>> with
>>> it?
>>> 
>>> --
>>> (en) regards / (pl) pozdrawiam
>>> Konrad Karpieszuk
>>> http://tradematik.pl wtyczka do WordPressa do tworzenia sklepów dla
>>> klientów z Polski
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>> 
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list