Problem/Motivation

As mentioned in the parent issue #3238306: [META] Where possible, refactor existing jQuery uses to vanillaJS to reduce jQuery footprint, we are working towards reducing our jQuery footprint. One of the ways to accomplish this is to reduce the number of jQuery features used in Drupal core. We have added eslint rules that identify specific features and fail tests when those features are in use.

There are (or will be) individual issues for each jQuery-use eslint rule. This one is specific to jquery/no-map, which targets the jQuery.map function and map function

Steps to reproduce

Proposed resolution

Remaining tasks

  • In core/.eslintrc.jquery.json Change "jquery/no-map": 0, to "jquery/no-map": 2, to enable eslint checks for uses of jQuery map(). With this change, you'll be able to see uses of the undesirable jQuery feature by running yarn lint:core-js-passing from the core directory
  • If it's determined to be feasible, refactor those uses of jQuery map() to use Vanilla (native) JavaScript instead.

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3238860

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hooroomoo created an issue. See original summary.

hooroomoo’s picture

Title: Refactor use of jquery map to use vanillaJS » Refactor (if feasible) use of jquery map to use vanillaJS
Issue summary: View changes
hooroomoo’s picture

Issue summary: View changes

Theresa.Grannum made their first commit to this issue’s fork.

mstrelan made their first commit to this issue’s fork.

mstrelan’s picture

Status: Active » Needs review
larowlan’s picture

left a review

bnjmnm made their first commit to this issue’s fork.

bnjmnm’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

A single JS change that was vetted by a JS maintainer seems like a pretty safe RTBC.

  • lauriii committed 926b484 on 9.4.x
    Issue #3238860 by mstrelan, Theresa.Grannum, hooroomoo, bnjmnm, larowlan...
lauriii’s picture

Version: 9.3.x-dev » 9.4.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 926b484 and pushed to 9.4.x. Thanks!

Not backporting this to 9.3.x. since based on https://www.drupal.org/about/core/policies/core-change-policies/allowed-... this isn't eligible for backport.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.