#43049 closed enhancement (maybelater)
jQuery-indipendent frontend
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.9.1 |
| Component: | Bundled Theme | Keywords: | |
| Focuses: | javascript, performance | Cc: |
Description
It would be great to have a jQuery-independent theme shipped by WordPress.
Removing jQuery and using native platform features can result in big improvements of loading and Time-To-Interactive times - see these examples:
https://github.com/woocommerce/woocommerce/issues/17877
https://github.com/woocommerce/storefront/issues/631
Looking at the twentyseventeen theme, only 3 files rely on jQuery:
- global.js
- navigation.js
- customize-preview.js
jQuery is mainly used to interact with the DOM. These interactions should be easy to replace with native DOM APIs, and eventually free the theme from the jQuery dependency.
Would you be interested in exploring this?
Change History (2)
#1
@
8 years ago
- Component changed from Themes to Bundled Theme
- Focuses ui removed
- Milestone Awaiting Review deleted
- Resolution set to maybelater
- Status changed from new to closed
#2
@
8 years ago
Hi @dd32 thanks for the feedback!
I agree, it's best to implement a new theme that is jQuery-independent. I wanted to share this as food for thought, and to see if WordPress would be interested in shipping such theme in the future, or if this can delegated to theme developers.
I'll keep an eye on https://make.wordpress.org/core/ as you suggested 👌
Cheers
Valdrin
Hey @valdrinkoshi and welcome to Trac.
While I see the benefit in not using jQuery, looking at
global.jsandnavigation.jsit looks like dropping jQuery is going to increase the maintenance burden with having to deal with cross-browser quirks which many of the jQuery methods we call already works around.Furthermore, if we were to change the default themes, it'd have a onward effect upon themes built on top of them, and due to the length of time that
twentyseventeen(or all of thetwenty*themes) has been out there, that's a lot of sites. It's not only sites which expect these files to have been written the way they are, but also sites who assume jQuery will be available as it's a dependancy of the theme.I don't think this is something we can change at this point in time, however, I'd urge you to bring it up for when the next default theme gets developed - I don't know when that will be, keep an eye on https://make.wordpress.org/core/ if you're interested in getting involved.
Unfortunately due to the above I don't think this is something we can work on right now for the existing bundled themes, but hopefully future themes will be able to take that into consideration.