[wp-trac] [WordPress Trac] #37110: Update to jQuery 3.*

WordPress Trac noreply at wordpress.org
Sat Apr 25 00:06:12 UTC 2020


#37110: Update to jQuery 3.*
-------------------------------------------------+-------------------------
 Reporter:  jorbin                               |       Owner:  (none)
     Type:  task (blessed)                       |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  External Libraries                   |     Version:
 Severity:  critical                             |  Resolution:
 Keywords:  early has-patch needs-testing        |     Focuses:  javascript
  needs-dev-note needs-screenshots needs-        |
  refresh                                        |
-------------------------------------------------+-------------------------

Comment (by azaozz):

 > If jQuery is "mandatory", it should be moved as an selectionnable
 option...

 > with core functions for letting WordPress know that jQuery is not
 required at all (perhaps via add_theme_support( 'native-js' )
 > ...
 > Support for 'native-js' by the theme and all the registered plugins
 should cause WordPress to dequeue the old jQuery+Migrate (and remove them
 as dependencies?).

 This is not how dependencies work. WP lists all available scripts (added
 by default and added by themes and plugins). Then the enqueued scripts
 "declare" what dependencies they need. If none of the enqueued scripts
 depends on jQuery, it will not be loaded. In some cases, like on many wp-
 admin screens, jQuery may be enqueued directly when there are inline
 scripts that need it.

 > every major framework is dropping jQuery in favor of vanilla JS

 > perhaps we should first get a consensus on the direction, i.e. native JS
 or latest jQuery

 @jacklinkers @galbaras I hear you loud and clear :) but switching to
 native js has nothing to do with having to update the bundled jQuery to
 the latest version.

 If themes and plugins want to switch to native js, they can do that at any
 time and stop requiring jQuery as a dependency. This is fully backwards
 compatible with scripts that are dependent on jQiery.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/37110#comment:110>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list