Automattic / Automattic/jetpack

Remove jQuery dependency

Open
#16,409 15 comments 1 reaction 1 assignee Assigned to @kraftbj View on GitHub
[Focus] Performance [Status] In Progress Enhancement Epic
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

What follows is a list of files that we have detected jQuery-like syntax in, listed in approximate priority order.

Prioritisation was based on the following(rough) criteria:

* is the asset enqueued on the front-end of a site, where performance is most critical?
* how often is the asset rendered, based on rough popularity and how it's implemented?

In eliminating these uses of jQuery, you may find this web site useful: http://youmightnotneedjquery.com/

## Files

The following list of files was generated using eslint. Don't forget, once you modify a file, to remove `jquery` as a dependency wherever that file was enqueued.

### Front-end

#### Carousel

- [x] modules/carousel/jetpack-carousel.js

#### Tiled Gallery

- [x] modules/tiled-gallery/tiled-gallery/tiled-gallery.js

#### Related Posts

- [x] modules/related-posts/related-posts.js

#### Sharing Buttons

- [ ] modules/sharedaddy/admin-sharing.js
- [x] modules/sharedaddy/sharing.js

#### Gutenberg

- [x] modules/calypsoify/mods-gutenberg.js
- [x] modules/calypsoify/mods.js

#### Contact Forms

- [x] modules/contact-form/js/editor-view.js
- [x] modules/contact-form/js/grunion-admin.js

#### Contact Info Widget

- [ ] modules/widgets/contact-info/contact-info-admin.js

#### EU Cookie Widget

- [ ] modules/widgets/eu-cookie-law/eu-cookie-law-admin.js

#### Likes

- [ ] modules/likes/post-count-jetpack.js
- [ ] modules/likes/post-count.js
- [x] modules/likes/queuehandler.js (ready for review #21726)
- [x] _inc/postmessage.js #17592

#### Masterbar

- [x] modules/masterbar/tracks-events.js

#### Post by Email
- [ ] modules/post-by-email/post-by-email.js

#### Misc Shortcodes (rarely used)

- [ ] modules/shortcodes/js/brightcove.js
- [x] modules/shortcodes/js/gist.js
- [ ] modules/shortcodes/js/jmpress.js
- [ ] modules/shortcodes/js/main.js
- [ ] modules/shortcodes/js/quiz.js
- [ ] modules/shortcodes/js/recipes-printthis.js
- [ ] modules/shortcodes/js/recipes.js
- [ ] modules/shortcodes/js/slideshow-shortcode.js
- [x] _inc/polldaddy-shortcode.js

#### Responsive Videos

- [x] modules/theme-tools/responsive-videos/responsive-videos.js

#### Site Logo Control

- [x] modules/theme-tools/site-logo/js/site-logo-control.js
- [ ] modules/theme-tools/site-logo/js/site-logo-header-text.js
- [x] modules/theme-tools/site-logo/js/site-logo.js

#### Widget Visibility

- [ ] modules/widget-visibility/widget-conditions/widget-conditions.js

- [ ] modules/widgets/gallery/js/admin.js
- [ ] modules/widgets/milestone/admin.js
- [ ] modules/widgets/social-icons/social-icons-admin.js
- [ ] modules/widgets/twitter-timeline-admin.js

#### Comics

- [ ] modules/custom-post-types/comics/comics.js
- [x] modules/custom-post-types/js/many-items.js
- [x] modules/custom-post-types/js/menu-checkboxes.js
- [ ] modules/custom-post-types/js/nova-drag-drop.js

#### VideoPress

- [ ] modules/videopress/js/editor-view.js
- [ ] modules/videopress/js/videopress-plupload.js

### Customizer

#### CSS Editor

- [ ] modules/custom-css/custom-css/js/css-editor.js
- [ ] modules/custom-css/custom-css/js/use-codemirror.js

#### Content Options

- [x] modules/theme-tools/content-options/customizer.js

#### Customizer Utils

- [ ] modules/widgets/customizer-utils.js

#### Simple Payments

- [ ] modules/widgets/simple-payments/customizer.js

#### Infinite Scroll

- [ ] modules/infinite-scroll/infinity-customizer.js

### WP-Admin

It might not be worth bothering removing jQuery from wp-admin, as on these pages performance is less of an issue, and they prrrrobably enqueue jQuery no matter what you do.

#### Comment Likes

- [ ] modules/comment-likes/comment-like-count.js

#### Just in Time Messages

- [ ] _inc/jetpack-jitm.js

#### Notices

- [ ] _inc/client/components/admin-notices/index.jsx

#### Jetpack Settings

- [ ] _inc/client/components/form/input-checkbox-multiple.jsx
- [ ] _inc/client/main.jsx
- [ ] _inc/jetpack-admin.js
- [ ] _inc/jetpack-modules.js
- [ ] _inc/jetpack-modules.views.js

#### Connection

- [ ] _inc/connect-button.js
- [ ] _inc/jetpack-connection-banner.js

### Deactivate warning

- [ ] _inc/jetpack-deactivate-dialog.js

#### "Identity Crisis"

- [ ] _inc/idc-notice.js

#### Gallery settings
- [ ] _inc/gallery-settings.js

#### Plugin Search (unused)
- [ ] modules/plugin-search/plugin-search.js

### MISC

I don't yet know the scope of these:

- [ ] _inc/jetpack-wizard-banner.js
- [x] _inc/jquery.jetpack-resize.js (deleted; ready for review #21726)
- [ ] _inc/lib/debugger/jetpack-debugger-site-health.js
- [ ] _inc/lib/tracks/tracks-ajax.js
- [ ] packages/debug-helper/modules/inc/js/xmlrpc-errors.js
- [ ] tools/jetpack-live-branches/jetpack-live-branches.user.js

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.