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-prop, which targets the jQuery prop function.
Steps to reproduce
In core/.eslintrc.jquery.json Change "jquery/no-prop": 0, to "jquery/no-prop": 2, to enable eslint checks for uses of jQuery prop(). 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.
Proposed resolution
Replace usage of jQuery.prop with vanilla js alternatives.
Remaining tasks
- Review MR !4266
- Close MR !1252
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | 3238882-nr-bot.txt | 90 bytes | needs-review-queue-bot |
| #18 | 3238882-nr-bot.txt | 4.87 KB | needs-review-queue-bot |
| #11 | 3238882-nr-bot.txt | 90 bytes | needs-review-queue-bot |
Issue fork drupal-3238882
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:
- 3238882-no-prop
changes, plain diff MR !4266
- 3238882-refactor-if-feasible
changes, plain diff MR !1252
Comments
Comment #9
mstrelan commentedComment #10
smustgrave commentedRefactor LGTM. Applied locally and didn't notice anything that broke.
Comment #11
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #12
mstrelan commentedBack to RTBC as per #10.
Comment #13
quietone commentedI'm triaging RTBC issues. I read the IS which has no proposed resolution (although it is obvious by the title) but has remaining tasks.
I followed the steps in the first item of the remaining tasks and found that there are
✖ 42 problems (42 errors, 0 warnings). Based on that, this is not fixing all the usages of prop. I looked at the Meta to see if this is part of a set of issues to fix prop but found that this is the only issue. I presume then, that this is to fix all usages?Setting to needs work for an issue summary update and for the work on the other instances of prop in core. Although, if there is some reason they cannot be changed, then that should be documented in the IS.
Thanks
Comment #14
mstrelan commented@quietone which MR did you check? Should be all fixed up in !4266. We should close !1252 as it's against 9.3.x when we still compiled es6 files.
I've updated the issue summary to clarify the status.
Comment #15
smustgrave commentedRestoring status.
Verified locally MR 4266 still applies cleanly to 11.x
Comment #17
quietone commented@mstrelan, I don't recall which MR I used. However, I repeated the steps with !4266 and didn't get any errors. I also closed the other MR. Thanks for the help.
Comment #18
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #19
mstrelan commentedComment #20
smustgrave commentedRebase seems good, reran nightwatch but was random failure.
Comment #21
longwaveAdded some comments/suggestions to the MR.
Comment #22
ahsannazir commentedWill work on suggestions
Comment #23
ahsannazir commentedComment #24
nod_There are a couple of things to fix. I'm worried about some of the replacement that could lead to regression (aria-pressed, autofocus)
Having a bunch of .each all over the place is not ideal but there are no better way to deal with this.
Comment #25
shubh_ commentedComment #26
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #27
shubh_ commentedComment #28
smustgrave commentedRe-ran javascript test failure twice and it failed both. So seems to be related to the change.
Comment #30
utkarsh_33 commentedFixed the test.
Comment #31
smustgrave commentedLeft some comments on the MR.
@nod_ I tagged you in one if there's a change we want to keep?
Saved credit for ahsannazir and Utkarsh_33 for keeping this moving.
Comment #32
nod_First of all thank you all for the hard work on this one, I've had to push a number of patches like this and I know how hard it is to keep up.
I'm going to try and refocus the jQuery removal work and to do that I need to take a few decisions. I'm going to close this issue for a few reasons:
I ported the credits to #3464044: Credit for work on the reduce jQuery issues, which I will mark as fixed as soon as I go through all the others impacted jQuery issues.