Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#54171 assigned enhancement

Twenty Twelve: 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:


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 Twelve - specifically the frontend, as for example in the Customizer jQuery is loaded anyway (and performance is a bit less of a concern there).

Change History (2)

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

4 months ago

  • Keywords has-patch added; needs-patch removed
  • Replace jQuery usage in Twenty Twelve 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/54171

#2 @SergeyBiryukov
4 months ago

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