Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The jquery-once assets were retained for BC. There's also misc/jquery.once.bc.js
file and jquery.once.bc
library definition. These can be now removed in Drupal 10.
Proposed resolution
Remove jquery.once.bc
library definition, misc/jquery.once.bc.js
file, and all references to these.
Issue fork drupal-3268550
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:
- 3268550-remove-deprecated-jquery-once changes, plain diff MR !1952
Comments
Comment #3
longwaveComment #5
Spokje- MR does what it says on the tin: Remove
jquery.once
andjquery.once.bc
and all references- Applied MR diff locally and found no more references to jquery.once, neither programmatically nor in documentation. (Even removed from
core/COPYRIGHT.txt
)- TestBot returns green.
RTBC for me.
Comment #8
lauriii👋 jquery-once 💀🪦😢
Committed 7362987 and pushed to 10.0.x. Thanks!
Comment #10
jweowu CreditAttribution: jweowu at Catalyst IT commentedWhy was this done?
The non-jquery 'once' is not a drop-in replacement; code has to be modified to use it.
Just because core wants to use less jquery doesn't mean that people's Drupal sites have suddenly stopped using jquery; and that's fine. If people want to use jquery, and also keep using jquery.once(), I see no problem with that whatsoever.
The presence of the jquery.once.js file has no ill effects on sites which do not use jquery and never load that file.
Conversely, the removal of jquery.once has a significant effect on virtually every site which does use jquery.
I think this introduces a significant pain point for essentially no reason.