WordPress.org

Make WordPress Core

Opened 5 weeks ago

Last modified 5 weeks ago

#54172 assigned enhancement

Twenty Fifteen: Replace frontend jQuery usage with vanilla JS

Reported by: flixos90 Owned by: flixos90
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: javascript Cc:

Description

Using jQuery for a few simple JS interactions in WordPress themes is a common performance problem, which is in most cases relatively straightforward to address: Vanilla JavaScript has for the better part of a decade included enough APIs that work across all popular browsers so that the remaining benefits of jQuery are around a few utility functions, that could be re-implemented in a few lines of code. Using jQuery for such simple use-cases results in around 80% more JS code being loaded in the frontend.

This ticket focuses on removing jQuery as a frontend dependency for Twenty Fifteen - specifically the frontend, as for example in the Customizer jQuery is loaded anyway (and performance is a bit less of a concern there).

Also see #54171, which does the same for Twenty Twelve.

Change History (2)

This ticket was mentioned in PR #1682 on WordPress/wordpress-develop by adamsilverstein.


5 weeks ago

  • Keywords has-patch added; needs-patch removed
  • Replace jQuery usage in Twenty Fifteen frontend scripts with vanilla JS.
  • Don't require jQuery to be loaded in the frontend as a result of the above.

Trac ticket: https://core.trac.wordpress.org/ticket/54172

#2 @SergeyBiryukov
5 weeks ago

  • Summary changed from Replace frontend jQuery usage with vanilla JS in Twenty Fifteen to Twenty Fifteen: Replace frontend jQuery usage with vanilla JS
Note: See TracTickets for help on using tickets.