- First commit to issue fork.
- Merge request !5791Issue #3239161: Refactor (if feasible) uses of the jQuery attr function to use Vanilla/native. โ (Open) created by rahulrasgon
- Issue was unassigned.
- Assigned to rahulrasgon
- ๐ฎ๐ณIndia rahulrasgon
Below replacement needs to be done more.
/core/misc/machine-name.js 157:11 error Prefer getAttribute to $.attr jquery/no-attr /core/misc/tableresponsive.js 40:28 error Prefer Function#bind to $.proxy jquery/no-proxy /core/misc/tableselect.js 72:16 error Prefer setAttribute to $.attr jquery/no-attr /core/modules/block/js/block.admin.js 26:24 error Prefer getAttribute to $.attr jquery/no-attr /core/modules/comment/js/comment-new-indicator.js 24:9 error Prefer getAttribute to $.attr jquery/no-attr 28:22 error Prefer getAttribute to $.attr jquery/no-attr 79:11 error Prefer getAttribute to $.attr jquery/no-attr 82:24 error Prefer getAttribute to $.attr jquery/no-attr /core/modules/comment/js/node-new-comments-link.js 80:9 error Prefer getAttribute to $.attr jquery/no-attr 83:19 error Prefer getAttribute to $.attr jquery/no-attr 84:22 error Prefer getAttribute to $.attr jquery/no-attr 125:11 error Prefer setAttribute to $.attr jquery/no-attr 167:11 error Prefer getAttribute to $.attr jquery/no-attr 170:24 error Prefer getAttribute to $.attr jquery/no-attr /core/modules/contextual/js/views/AuralView.js 43:9 error Prefer setAttribute to $.attr jquery/no-attr /core/modules/editor/js/editor.admin.js 1022:31 error Prefer getAttribute to $.attr jquery/no-attr /core/modules/editor/js/editor.js 17:21 error Prefer getAttribute to $.attr jquery/no-attr /core/modules/file/file.js 258:30 error Prefer getAttribute to $.attr jquery/no-attr 261:9 error Prefer setAttribute to $.attr jquery/no-attr 268:11 error Prefer setAttribute to $.attr jquery/no-attr 291:7 error Prefer setAttribute to $.attr jquery/no-attr /core/modules/layout_builder/js/layout-builder.js 65:11 error Prefer setAttribute to $.attr jquery/no-attr 70:11 error Prefer setAttribute to $.attr jquery/no-attr 209:7 error Prefer setAttribute to $.attr jquery/no-attr 238:18 error Prefer getAttribute to $.attr jquery/no-attr 258:41 error Prefer getAttribute to $.attr jquery/no-attr 374:51 error Prefer getAttribute to $.attr jquery/no-attr 434:9 error Prefer setAttribute to $.attr jquery/no-attr /core/modules/menu_ui/menu_ui.admin.js 63:9 error Prefer setAttribute to $.attr jquery/no-attr /core/modules/settings_tray/js/settings_tray.js 168:76 error Prefer getAttribute to $.attr jquery/no-attr /core/modules/system/js/system.modules.js 66:11 error Prefer setAttribute to $.attr jquery/no-attr 72:11 error Prefer setAttribute to $.attr jquery/no-attr 86:11 error Prefer setAttribute to $.attr jquery/no-attr /core/modules/system/tests/modules/js_message_test/js/js_message_test.js 44:24 error Prefer getAttribute to $.attr jquery/no-attr 46:13 error Prefer getAttribute to $.attr jquery/no-attr 50:26 error Prefer getAttribute to $.attr jquery/no-attr /core/modules/toolbar/js/views/ToolbarVisualView.js 315:9 error Prefer setAttribute to $.attr jquery/no-attr 319:9 error Prefer setAttribute to $.attr jquery/no-attr
Meanwhile can someone please review the MR :- https://git.drupalcode.org/project/drupal/-/merge_requests/5791#note_242353
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 11:40pm 14 December 2023 - Status changed to Needs work
about 1 year ago 3:31pm 19 December 2023 - ๐บ๐ธUnited States smustgrave
The remaining task around the code-committ still seems needed.
- ๐ซ๐ทFrance nod_ Lille
There are several places that create a jquery object just to get the original dom element after. We can get rid of the creation of the jQuery object and use the dom directly
- First commit to issue fork.
- Status changed to Needs review
12 months ago 4:22am 9 January 2024 - ๐ฎ๐ณIndia gauravvvv Delhi, India
Addressed all feedbacks in MR. please review
- Status changed to Needs work
12 months ago 5:28pm 10 January 2024 - First commit to issue fork.
- ๐ฎ๐ณIndia ahsannazir
In the above raised MR, the Funtional Javascript test cases are failing and there are console errors as well
- Status changed to Needs review
10 months ago 10:44am 26 February 2024 - Status changed to Needs work
10 months ago 12:12pm 5 March 2024 The 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.
- Status changed to Needs review
10 months ago 4:48am 6 March 2024 - ๐บ๐ธUnited States smustgrave
Will leave for sub-maintainer to review but personally find adding
[0]
makes the readability go down. - Status changed to Needs work
8 months ago 10:24am 18 April 2024 The 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 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.
- Status changed to Needs review
8 months ago 11:29am 19 April 2024 - Status changed to Needs work
8 months ago 1:28pm 24 April 2024 Sam Phillemon โ made their first commit to this issueโs fork.
- Status changed to Needs review
8 months ago 8:05am 26 April 2024 - Status changed to Needs work
8 months ago 3:18pm 15 May 2024 - ๐บ๐ธUnited States smustgrave
For good practice can the MRs be cleanup/hidden. There are currently 4 branche
- ๐ฎ๐ณIndia shubh511
shubh_ โ changed the visibility of the branch 3239161-refactor-if-feasible to hidden.
- ๐ฎ๐ณIndia shubh511
shubh_ โ changed the visibility of the branch 3239161-10.1.x to hidden.
- ๐ฎ๐ณIndia shubh511
shubh_ โ changed the visibility of the branch 9.3.x to hidden.
- Status changed to Needs review
8 months ago 5:21pm 15 May 2024 - Status changed to Needs work
7 months ago 11:37pm 19 May 2024 The 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.
- Status changed to Needs review
7 months ago 7:10am 20 May 2024 - Status changed to Needs work
7 months ago 3:37pm 20 May 2024 - Status changed to Needs review
7 months ago 6:05am 21 May 2024 - Status changed to Needs work
7 months ago 8:59pm 21 May 2024 - Status changed to Needs review
7 months ago 9:30am 22 May 2024 - Status changed to Needs work
6 months ago 4:24pm 25 June 2024 - Status changed to Needs review
6 months ago 5:35am 26 June 2024 - Status changed to Closed: won't fix
5 months ago 2:35pm 30 July 2024 - ๐ซ๐ทFrance nod_ Lille
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:
- This MR is big, it impact a very big number of subsystems and make the code more brittle. jQuery is good at dealing with undefined elements, empty sets and so on, the DOM isn't. We already had regressions from a previous patch with undefined elements
- The MR is too big to review and make sure there are no regressions (even with the tests we already have), it would create unstability that we don't have to endure
- Every time I review this MR, I find a new bug
- Sometimes the jQuery code is simply more readable, I do not think this change is a net positive:
$details .filter('[data-drupal-system-state="forced-open"]') .removeAttr('data-drupal-system-state') .attr('open', false); $details.forEach((detail) => { if ( detail.getAttribute('data-drupal-system-state') === 'forced-open' ) { detail.removeAttribute('data-drupal-system-state'); detail.setAttribute('open', 'false'); } });
There is one line to change and just noticed a bug (jQuery doesn't have a forEach method)
I ported the credits to ๐ Credit for work on the reduce jQuery issues Active , which I will mark as fixed as soon as I go through all the others impacted jQuery issues.