Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291641

[META] Where possible, refactor existing jQuery uses to vanillaJS to reduce jQuery footprint

$
0
0

Problem/Motivation

This is the next step that began with the new jQuery-checking lint rules added in #3191023: Add eslint rules to check for jQuery usage. These rules were added to core/.eslintrc.jquery.json. In this issue, we added a set of JS linting rules that check for various uses of Jquery. Currently, the majority of these rules are disabled. We plan to create issues for each of these disabled rules, where that specific rule is enabled, and in doing so exposes that specific use of jQuery.

The goal is - wherever possible - refactor these jQuery uses to Vanilla (native) JavaScript so Drupal core has less of an overall dependency on jQuery. While it may not be possible to fully eliminate jQuery, reducing the ways it is used will make maintainability far easier.

In the child issues where eslint is configured to look for a specific type of jQuery use - that type of jQuery use will effectively be forbidden in Drupal core from that point forward. For example, once eslint checks for "jquery/no-css" (by changing "jquery/no-css" : 0 to , "jquery/no-css" : 2 Drupal CI tests will no longer allow uses of jQuery's css() function in core.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 291641

Trending Articles