diff --git a/core/COPYRIGHT.txt b/core/COPYRIGHT.txt index 6c6d0ad34e7f032..79980f7e23bc7d9 100644 --- a/core/COPYRIGHT.txt +++ b/core/COPYRIGHT.txt @@ -45,8 +45,6 @@ JavaScript jQuery Metadata - Copyright (c) 2006 John Resig, Yehuda Katz, Jörn Zaefferer, Paul McLanahan - jQuery Once - Copyright (c) 2009 Konstantin Käfer - jQuery UI - Copyright (c) 2015 by the authors and other contributors (http://jqueryui.com/about) diff --git a/core/assets/vendor/jquery-once/jquery.once.js b/core/assets/vendor/jquery-once/jquery.once.js deleted file mode 100644 index 88e088130267bec..000000000000000 --- a/core/assets/vendor/jquery-once/jquery.once.js +++ /dev/null @@ -1,177 +0,0 @@ -/*! - * jQuery Once v2.2.3 - http://github.com/robloach/jquery-once - * @license MIT, GPL-2.0 - * http://opensource.org/licenses/MIT - * http://opensource.org/licenses/GPL-2.0 - */ - -/** - * Universal Module Definition - * - * jQuery Once has a dependency on jQuery, so we wrap the code with a UMD - * pattern in order to allow loading jQuery and jQuery Once through a module - * definition like CommonJS, AMD, or through a global object. - * - * @see {@link http://github.com/umdjs/umd} - */ -(function (factory) { - 'use strict'; - - if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { - // CommonJS - factory(require('jquery')); - } else if (typeof define === 'function' && define.amd) { - // AMD - /* globals define */ - define(['jquery'], factory); - } else { - // Global object - /* globals jQuery */ - factory(jQuery); - } -})(function ($) { - 'use strict'; - - /** - * Ensures that the given ID is valid, returning 'once' if one is not given. - * - * @param {string} [id=once] - * A string representing the ID to check. Defaults to `'once'`. - * - * @returns {number} The valid ID name. - * - * @throws TypeError when an ID is provided, but not a string. - * @private - */ - var checkId = function (id) { - id = id || 'once'; - if (typeof id !== 'string') { - throw new TypeError('The jQuery Once id parameter must be a string'); - } - - return id; - }; - - /** - * Filter elements that have yet to be processed by the given data ID. - * - * @param {string} [id=once] - * The data ID used to determine whether the given elements have already - * been processed or not. Defaults to `'once'`. - * - * @returns {jQuery} jQuery collection of elements that have now run once by - * the given ID. - * - * @example - * ``` javascript - * // The following will change the color of each paragraph to red, just once - * // for the 'changecolor' key. - * $('p').once('changecolor').css('color', 'red'); - * - * // .once() will return a set of elements that yet to have the once ID - * // associated with them. You can return to the original collection set by - * // using .end(). - * $('p') - * .once('changecolorblue') - * .css('color', 'blue') - * .end() - * .css('color', 'red'); - * - * // To execute a function on the once set, you can use jQuery's each(). - * $('div.calendar').once().each(function () { - * // Since there is no once ID provided here, the key will be 'once'. - * }); - * ``` - * - * @see removeOnce - * @see findOnce - * @this jQuery - * - * @global - * @public - */ - $.fn.once = function (id) { - // Build the jQuery Once data name from the provided ID. - var name = 'jquery-once-' + checkId(id); - - // Find elements that don't have the jQuery Once data applied to them yet. - return this.filter(function () { - return $(this).data(name) !== true; - }).data(name, true); - }; - - /** - * Removes the once data from elements, based on the given ID. - * - * @param {string} [id=once] - * A string representing the name of the data ID which should be used when - * filtering the elements. This only filters elements that have already been - * processed by the once function. The ID should be the same ID that was - * originally passed to the once() function. Defaults to `'once'`. - * - * @returns {jQuery} jQuery collection of elements that were acted upon to remove their - * once data. - * - * @example - * ``` javascript - * // Remove once data with the 'changecolor' ID. The result set is the - * // elements that had their once data removed. - * $('p').removeOnce('changecolor').css('color', ''); - * - * // Any jQuery function can be performed on the result set. - * $('div.calendar').removeOnce().each(function () { - * // Remove the calendar behavior. - * }); - * ``` - * - * @see once - * @this jQuery - * - * @global - * @public - */ - $.fn.removeOnce = function (id) { - // Filter through the elements to find the once'd elements. - return this.findOnce(id).removeData('jquery-once-' + checkId(id)); - }; - - /** - * Filters elements that have already been processed once. - * - * @param {string} [id=once] - * A string representing the name of the data id which should be used when - * filtering the elements. This only filters elements that have already - * been processed by the once function. The id should be the same id that - * was originally passed to the once() function. Defaults to 'once'. - * - * @returns {jQuery} jQuery collection of elements that have been run once. - * - * @example - * ``` javascript - * // Find all elements that have been changecolor'ed once. - * $('p').findOnce('changecolor').each(function () { - * // This function is called for all elements that has already once'd. - * }); - * - * // Find all elements that have been acted on with the default 'once' key. - * $('p').findOnce().each(function () { - * // This function is called for all elements that have been acted on with - * // a 'once' action. - * }); - * ``` - * - * @see once - * @this jQuery - * - * @global - * @public - */ - $.fn.findOnce = function (id) { - // Filter the elements by which do have the data. - var name = 'jquery-once-' + checkId(id); - - return this.filter(function () { - return $(this).data(name) === true; - }); - }; -}); diff --git a/core/assets/vendor/jquery-once/jquery.once.min.js b/core/assets/vendor/jquery-once/jquery.once.min.js deleted file mode 100644 index 47a878053ee814d..000000000000000 --- a/core/assets/vendor/jquery-once/jquery.once.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * jQuery Once v2.2.3 - http://github.com/robloach/jquery-once - * @license MIT, GPL-2.0 - * http://opensource.org/licenses/MIT - * http://opensource.org/licenses/GPL-2.0 - */ -(function(e){"use strict";if(typeof exports==="object"&&typeof exports.nodeName!=="string"){e(require("jquery"))}else if(typeof define==="function"&&define.amd){define(["jquery"],e)}else{e(jQuery)}})(function(t){"use strict";var r=function(e){e=e||"once";if(typeof e!=="string"){throw new TypeError("The jQuery Once id parameter must be a string")}return e};t.fn.once=function(e){var n="jquery-once-"+r(e);return this.filter(function(){return t(this).data(n)!==true}).data(n,true)};t.fn.removeOnce=function(e){return this.findOnce(e).removeData("jquery-once-"+r(e))};t.fn.findOnce=function(e){var n="jquery-once-"+r(e);return this.filter(function(){return t(this).data(n)===true})}}); -//# sourceMappingURL=jquery.once.min.js.map \ No newline at end of file diff --git a/core/assets/vendor/jquery-once/jquery.once.min.js.map b/core/assets/vendor/jquery-once/jquery.once.min.js.map deleted file mode 100644 index a42313cc289f12a..000000000000000 --- a/core/assets/vendor/jquery-once/jquery.once.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["jquery.once.js"],"names":["factory","exports","nodeName","require","define","amd","jQuery","$","checkId","id","TypeError","fn","once","name","this","filter","data","removeOnce","findOnce","removeData"],"mappings":";;;;;;CAgBA,SAAWA,GACT,aAEA,UAAWC,UAAY,iBAAmBA,QAAQC,WAAa,SAAU,CAEvEF,EAAQG,QAAQ,gBACX,UAAWC,SAAW,YAAcA,OAAOC,IAAK,CAGrDD,OAAO,CAAC,UAAWJ,OACd,CAGLA,EAAQM,UAbZ,CAeG,SAAUC,GACX,aAaA,IAAIC,EAAU,SAAUC,GACtBA,EAAKA,GAAM,OACX,UAAWA,IAAO,SAAU,CAC1B,MAAM,IAAIC,UAAU,iDAGtB,OAAOD,GAyCTF,EAAEI,GAAGC,KAAO,SAAUH,GAEpB,IAAII,EAAO,eAAiBL,EAAQC,GAGpC,OAAOK,KAAKC,OAAO,WACjB,OAAOR,EAAEO,MAAME,KAAKH,KAAU,OAC7BG,KAAKH,EAAM,OAiChBN,EAAEI,GAAGM,WAAa,SAAUR,GAE1B,OAAOK,KAAKI,SAAST,GAAIU,WAAW,eAAiBX,EAAQC,KAkC/DF,EAAEI,GAAGO,SAAW,SAAUT,GAExB,IAAII,EAAO,eAAiBL,EAAQC,GAEpC,OAAOK,KAAKC,OAAO,WACjB,OAAOR,EAAEO,MAAME,KAAKH,KAAU","file":"jquery.once.min.js"} \ No newline at end of file diff --git a/core/core.libraries.yml b/core/core.libraries.yml index 5018d1f7d080023..f57d962fe3f4f20 100644 --- a/core/core.libraries.yml +++ b/core/core.libraries.yml @@ -357,7 +357,6 @@ drupal.ajax: - core/drupal.nodelist.foreach - core/drupal.progress - core/once - - core/jquery.once.bc - core/tabbable drupal.announce: @@ -442,7 +441,6 @@ drupal.batch: - core/drupal.ajax - core/drupal.progress - core/once - - core/jquery.once.bc drupal.checkbox: version: VERSION @@ -463,7 +461,6 @@ drupal.collapse: - core/drupal - core/drupal.form - core/once - - core/jquery.once.bc drupal.customevent: version: VERSION @@ -574,7 +571,6 @@ drupal.dropbutton: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc drupal.element.closest: version: VERSION @@ -604,7 +600,6 @@ drupal.form: - core/drupal - core/drupal.debounce - core/once - - core/jquery.once.bc drupal.machine-name: version: VERSION @@ -613,7 +608,6 @@ drupal.machine-name: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal - core/drupalSettings - core/drupal.form @@ -654,7 +648,6 @@ drupal.states: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc drupal.string.includes: version: VERSION @@ -679,7 +672,6 @@ drupal.tabledrag: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc drupal.tableheader: version: VERSION @@ -690,7 +682,6 @@ drupal.tableheader: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc - core/drupal.displace drupal.tableresponsive: @@ -701,7 +692,6 @@ drupal.tableresponsive: - core/jquery - core/drupal - core/once - - core/jquery.once.bc drupal.tableselect: version: VERSION @@ -712,7 +702,6 @@ drupal.tableselect: - core/drupal.checkbox - core/jquery - core/once - - core/jquery.once.bc drupal.timezone: version: VERSION @@ -722,7 +711,6 @@ drupal.timezone: - core/drupal.nodelist.foreach - core/jquery - core/once - - core/jquery.once.bc - core/drupal drupal.vertical-tabs: @@ -736,7 +724,6 @@ drupal.vertical-tabs: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal - core/drupalSettings - core/drupal.form @@ -808,33 +795,6 @@ shepherd: js: assets/vendor/shepherd/shepherd.min.js: { minified: true } -jquery.once: - remote: https://github.com/RobLoach/jquery-once - version: "2.2.3" - license: - name: GNU-GPL-2.0-or-later - url: https://raw.githubusercontent.com/RobLoach/jquery-once/2.2.3/LICENSE.md - gpl-compatible: true - js: - assets/vendor/jquery-once/jquery.once.min.js: { weight: -19, minified: true } - dependencies: - - core/jquery - - core/jquery.once.bc - deprecated: The %library_id% asset library is deprecated in Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the core/once library instead. See https://www.drupal.org/node/3158256 - -# Internal library, do not depend on it. -# The library will be removed in Drupal 10.0.0. -jquery.once.bc: - version: VERSION - js: - assets/vendor/jquery-once/jquery.once.min.js: { weight: -19, minified: true } - misc/jquery.once.bc.js: {} - dependencies: - - core/drupal - - core/jquery - - core/once - - core/drupal.object.assign - jquery.ui: version: &jquery_ui_version "1.13.1" license: &jquery_ui_license @@ -1144,7 +1104,6 @@ drupal.dialog.off_canvas: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal - core/drupal.ajax - core/drupal.announce diff --git a/core/misc/jquery.once.bc.es6.js b/core/misc/jquery.once.bc.es6.js deleted file mode 100644 index 0a25d7544e446d6..000000000000000 --- a/core/misc/jquery.once.bc.es6.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file - * This file allows calls to `once()` and `once.remove()` to also populate the - * jQuery.once registry. - * - * It allows contributed code still using jQuery.once to behave as expected: - * @example - * once('core-once-call', 'body'); - * - * // The following will work in a contrib module still using jQuery.once: - * $('body').once('core-once-call'); // => returns empty object - */ - -(($, once) => { - const deprecatedMessageSuffix = `is deprecated in Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the core/once library instead. See https://www.drupal.org/node/3158256`; - - // Trigger a deprecation error when using jQuery.once methods. - const originalJQOnce = $.fn.once; - const originalJQRemoveOnce = $.fn.removeOnce; - // Do not deprecate findOnce because it is used internally by jQuery.once(). - - $.fn.once = function jQueryOnce(id) { - Drupal.deprecationError({ - message: `jQuery.once() ${deprecatedMessageSuffix}`, - }); - return originalJQOnce.apply(this, [id]); - }; - $.fn.removeOnce = function jQueryRemoveOnce(id) { - Drupal.deprecationError({ - message: `jQuery.removeOnce() ${deprecatedMessageSuffix}`, - }); - return originalJQRemoveOnce.apply(this, [id]); - }; - - // We'll replace the whole library so keep a version in cache for later. - const drupalOnce = once; - - // When calling once(), also populate jQuery.once registry. - function augmentedOnce(id, selector, context) { - // Do not trigger deprecation warnings for the BC layer calls. - originalJQOnce.apply($(selector, context), [id]); - return drupalOnce(id, selector, context); - } - - // When calling once.remove(), also remove it from jQuery.once registry. - function remove(id, selector, context) { - // Do not trigger deprecation warnings for the BC layer calls. - originalJQRemoveOnce.apply($(selector, context), [id]); - return drupalOnce.remove(id, selector, context); - } - - // Expose the rest of @drupal/once API and replace @drupal/once library with - // the version augmented with jQuery.once calls. - window.once = Object.assign(augmentedOnce, drupalOnce, { remove }); -})(jQuery, once); diff --git a/core/misc/jquery.once.bc.js b/core/misc/jquery.once.bc.js deleted file mode 100644 index e41fe3df32fc8a4..000000000000000 --- a/core/misc/jquery.once.bc.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* DO NOT EDIT THIS FILE. -* See the following change record for more information, -* https://www.drupal.org/node/2815083 -* @preserve -**/ - -(($, once) => { - const deprecatedMessageSuffix = `is deprecated in Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the core/once library instead. See https://www.drupal.org/node/3158256`; - const originalJQOnce = $.fn.once; - const originalJQRemoveOnce = $.fn.removeOnce; - - $.fn.once = function jQueryOnce(id) { - Drupal.deprecationError({ - message: `jQuery.once() ${deprecatedMessageSuffix}` - }); - return originalJQOnce.apply(this, [id]); - }; - - $.fn.removeOnce = function jQueryRemoveOnce(id) { - Drupal.deprecationError({ - message: `jQuery.removeOnce() ${deprecatedMessageSuffix}` - }); - return originalJQRemoveOnce.apply(this, [id]); - }; - - const drupalOnce = once; - - function augmentedOnce(id, selector, context) { - originalJQOnce.apply($(selector, context), [id]); - return drupalOnce(id, selector, context); - } - - function remove(id, selector, context) { - originalJQRemoveOnce.apply($(selector, context), [id]); - return drupalOnce.remove(id, selector, context); - } - - window.once = Object.assign(augmentedOnce, drupalOnce, { - remove - }); -})(jQuery, once); \ No newline at end of file diff --git a/core/modules/block/block.libraries.yml b/core/modules/block/block.libraries.yml index b67d33870834bef..ad6f33b10567297 100644 --- a/core/modules/block/block.libraries.yml +++ b/core/modules/block/block.libraries.yml @@ -6,7 +6,6 @@ drupal.block: - core/jquery - core/drupal - core/once - - core/jquery.once.bc drupal.block.admin: version: VERSION @@ -23,4 +22,3 @@ drupal.block.admin: - core/drupal.dialog.ajax - core/drupal.string.includes - core/once - - core/jquery.once.bc diff --git a/core/modules/ckeditor/ckeditor.libraries.yml b/core/modules/ckeditor/ckeditor.libraries.yml index fc90f6a4babf255..48bb5e473576db3 100644 --- a/core/modules/ckeditor/ckeditor.libraries.yml +++ b/core/modules/ckeditor/ckeditor.libraries.yml @@ -50,7 +50,6 @@ drupal.ckeditor.admin: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc - core/backbone - core/drupal.dialog - core/drupal.announce @@ -68,7 +67,6 @@ drupal.ckeditor.drupalimage.admin: - core/jquery - core/drupal - core/once - - core/jquery.once.bc - core/drupal.vertical-tabs - core/drupalSettings diff --git a/core/modules/color/color.libraries.yml b/core/modules/color/color.libraries.yml index 6271193aead3c24..860c0c165253a19 100644 --- a/core/modules/color/color.libraries.yml +++ b/core/modules/color/color.libraries.yml @@ -6,7 +6,6 @@ drupal.color: - core/jquery - core/drupal - core/once - - core/jquery.once.bc - core/jquery.farbtastic - color/drupal.color.preview @@ -19,7 +18,6 @@ drupal.color.preview: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc admin: version: VERSION diff --git a/core/modules/comment/comment.libraries.yml b/core/modules/comment/comment.libraries.yml index 3ecdcf4cbdec5a7..25c815116197ccc 100644 --- a/core/modules/comment/comment.libraries.yml +++ b/core/modules/comment/comment.libraries.yml @@ -23,7 +23,6 @@ drupal.comment-new-indicator: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal - history/api - core/drupal.displace @@ -35,6 +34,5 @@ drupal.node-new-comments-link: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal - history/api diff --git a/core/modules/content_translation/content_translation.libraries.yml b/core/modules/content_translation/content_translation.libraries.yml index 96043efe63d2b85..3857be167e7e849 100644 --- a/core/modules/content_translation/content_translation.libraries.yml +++ b/core/modules/content_translation/content_translation.libraries.yml @@ -9,4 +9,3 @@ drupal.content_translation.admin: - core/jquery - core/drupal - core/once - - core/jquery.once.bc diff --git a/core/modules/contextual/contextual.libraries.yml b/core/modules/contextual/contextual.libraries.yml index 30961b1ed4af7b7..3a5918f7e15532f 100644 --- a/core/modules/contextual/contextual.libraries.yml +++ b/core/modules/contextual/contextual.libraries.yml @@ -25,7 +25,6 @@ drupal.contextual-links: - core/backbone - core/modernizr - core/once - - core/jquery.once.bc drupal.contextual-toolbar: version: VERSION @@ -44,6 +43,5 @@ drupal.contextual-toolbar: - core/drupal - core/backbone - core/once - - core/jquery.once.bc - core/drupal.tabbingmanager - core/drupal.announce diff --git a/core/modules/editor/editor.libraries.yml b/core/modules/editor/editor.libraries.yml index 0aaa04bc476a370..20678413309f93f 100644 --- a/core/modules/editor/editor.libraries.yml +++ b/core/modules/editor/editor.libraries.yml @@ -5,7 +5,6 @@ drupal.editor.admin: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal - core/underscore @@ -18,7 +17,6 @@ drupal.editor: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc - core/drupal.dialog drupal.editor.dialog: diff --git a/core/modules/field_ui/field_ui.libraries.yml b/core/modules/field_ui/field_ui.libraries.yml index 432a5d3788c7d6a..8db10f6e91de138 100644 --- a/core/modules/field_ui/field_ui.libraries.yml +++ b/core/modules/field_ui/field_ui.libraries.yml @@ -10,4 +10,3 @@ drupal.field_ui: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc diff --git a/core/modules/file/file.libraries.yml b/core/modules/file/file.libraries.yml index fcc594ae424ea1c..81c9324ea536626 100644 --- a/core/modules/file/file.libraries.yml +++ b/core/modules/file/file.libraries.yml @@ -5,6 +5,5 @@ drupal.file: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal - core/drupalSettings diff --git a/core/modules/filter/filter.libraries.yml b/core/modules/filter/filter.libraries.yml index 341189f8c754d27..f3ad11443411ae5 100644 --- a/core/modules/filter/filter.libraries.yml +++ b/core/modules/filter/filter.libraries.yml @@ -6,7 +6,6 @@ drupal.filter.admin: - core/jquery - core/drupal - core/once - - core/jquery.once.bc - core/drupal.form drupal.filter.filter_html.admin: @@ -16,7 +15,6 @@ drupal.filter.filter_html.admin: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/underscore drupal.filter: @@ -27,7 +25,6 @@ drupal.filter: - core/jquery - core/drupal - core/once - - core/jquery.once.bc caption: version: VERSION diff --git a/core/modules/language/language.libraries.yml b/core/modules/language/language.libraries.yml index c75a3e491989374..0e7ff2c3d0d6e6f 100644 --- a/core/modules/language/language.libraries.yml +++ b/core/modules/language/language.libraries.yml @@ -9,4 +9,3 @@ drupal.language.admin: - core/jquery - core/drupal - core/once - - core/jquery.once.bc diff --git a/core/modules/locale/locale.libraries.yml b/core/modules/locale/locale.libraries.yml index 6e5c0f30e131118..fb06e81ff6c72a1 100644 --- a/core/modules/locale/locale.libraries.yml +++ b/core/modules/locale/locale.libraries.yml @@ -10,7 +10,6 @@ drupal.locale.admin: - core/drupal - core/drupal.form - core/once - - core/jquery.once.bc translations: # No sensible version can be specified, since the translations may change at diff --git a/core/modules/media_library/media_library.libraries.yml b/core/modules/media_library/media_library.libraries.yml index 8c2f1b393a0af47..6fd4144e6cb8e61 100644 --- a/core/modules/media_library/media_library.libraries.yml +++ b/core/modules/media_library/media_library.libraries.yml @@ -34,7 +34,6 @@ ui: - core/drupal.announce - core/drupal.nodelist.foreach - core/once - - core/jquery.once.bc - core/jquery - media_library/view - core/tabbable diff --git a/core/modules/node/node.libraries.yml b/core/modules/node/node.libraries.yml index d599c2aa1816513..9af36335b41435f 100644 --- a/core/modules/node/node.libraries.yml +++ b/core/modules/node/node.libraries.yml @@ -19,7 +19,6 @@ drupal.node.preview: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal - core/drupal.dialog - core/drupal.form diff --git a/core/modules/quickedit/quickedit.libraries.yml b/core/modules/quickedit/quickedit.libraries.yml index 64c4908a312d29e..1169abbd300d3eb 100644 --- a/core/modules/quickedit/quickedit.libraries.yml +++ b/core/modules/quickedit/quickedit.libraries.yml @@ -29,7 +29,6 @@ quickedit: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/underscore - core/backbone - core/jquery.form diff --git a/core/modules/settings_tray/settings_tray.libraries.yml b/core/modules/settings_tray/settings_tray.libraries.yml index 0f6fed6b556f2c9..de1494c7f69821f 100644 --- a/core/modules/settings_tray/settings_tray.libraries.yml +++ b/core/modules/settings_tray/settings_tray.libraries.yml @@ -16,5 +16,4 @@ drupal.settings_tray: - core/jquery - core/drupal - core/once - - core/jquery.once.bc - core/drupal.ajax diff --git a/core/modules/system/system.libraries.yml b/core/modules/system/system.libraries.yml index 7ccd963b8ebc677..7f77a406f2892ca 100644 --- a/core/modules/system/system.libraries.yml +++ b/core/modules/system/system.libraries.yml @@ -52,7 +52,6 @@ drupal.system: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc drupal.system.modules: version: VERSION @@ -64,7 +63,6 @@ drupal.system.modules: - core/drupal.debounce - core/drupal.nodelist.foreach - core/once - - core/jquery.once.bc - core/drupal.announce diff: @@ -83,5 +81,4 @@ drupal.system.date: - core/drupal.nodelist.foreach - core/drupalSettings - core/once - - core/jquery.once.bc - core/drupal.form diff --git a/core/modules/system/tests/modules/js_once_test/js_once_test.routing.yml b/core/modules/system/tests/modules/js_once_test/js_once_test.routing.yml index c73a876b3ae6a7d..1045da862d8b89d 100644 --- a/core/modules/system/tests/modules/js_once_test/js_once_test.routing.yml +++ b/core/modules/system/tests/modules/js_once_test/js_once_test.routing.yml @@ -5,10 +5,3 @@ js_once_test: _title: 'OnceTest' requirements: _access: 'TRUE' -js_once_test.with_bc: - path: '/js_once_with_bc_test' - defaults: - _controller: '\Drupal\js_once_test\Controller\JsOnceTestController::onceBcTest' - _title: 'OnceBcTest' - requirements: - _access: 'TRUE' diff --git a/core/modules/system/tests/modules/js_once_test/src/Controller/JsOnceTestController.php b/core/modules/system/tests/modules/js_once_test/src/Controller/JsOnceTestController.php index c47505cd3bba5dc..f35a685695b52ba 100644 --- a/core/modules/system/tests/modules/js_once_test/src/Controller/JsOnceTestController.php +++ b/core/modules/system/tests/modules/js_once_test/src/Controller/JsOnceTestController.php @@ -32,27 +32,4 @@ class JsOnceTestController extends ControllerBase { return $output; } - /** - * Provides elements for testing jQuery Once BC support. - * - * @return array - * The render array. - */ - public function onceBcTest() { - $output = [ - '#attached' => ['library' => ['core/jquery.once']], - ]; - foreach (range(1, 5) as $item) { - $output['item' . $item] = [ - '#type' => 'html_tag', - '#tag' => 'div', - '#value' => 'Item ' . $item, - '#attributes' => [ - 'data-drupal-item' => $item, - ], - ]; - } - return $output; - } - } diff --git a/core/modules/text/text.libraries.yml b/core/modules/text/text.libraries.yml index 8e7d26f8e21421a..ebcfd3ab88b689f 100644 --- a/core/modules/text/text.libraries.yml +++ b/core/modules/text/text.libraries.yml @@ -5,5 +5,4 @@ drupal.text: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal diff --git a/core/modules/toolbar/toolbar.libraries.yml b/core/modules/toolbar/toolbar.libraries.yml index e4f7c2d156c93f8..d8140142d704365 100644 --- a/core/modules/toolbar/toolbar.libraries.yml +++ b/core/modules/toolbar/toolbar.libraries.yml @@ -26,7 +26,6 @@ toolbar: - core/drupal.announce - core/backbone - core/once - - core/jquery.once.bc - core/drupal.displace - toolbar/toolbar.menu @@ -41,7 +40,6 @@ toolbar.menu: - core/jquery - core/drupal - core/once - - core/jquery.once.bc toolbar.escapeAdmin: version: VERSION @@ -52,4 +50,3 @@ toolbar.escapeAdmin: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc diff --git a/core/modules/tour/tour.libraries.yml b/core/modules/tour/tour.libraries.yml index cef41779c9c804a..f8f717b019f3bf3 100644 --- a/core/modules/tour/tour.libraries.yml +++ b/core/modules/tour/tour.libraries.yml @@ -5,7 +5,6 @@ tour: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal - core/backbone - core/shepherd diff --git a/core/modules/user/user.libraries.yml b/core/modules/user/user.libraries.yml index e4971f98dab798e..0aecebe91648b91 100644 --- a/core/modules/user/user.libraries.yml +++ b/core/modules/user/user.libraries.yml @@ -10,7 +10,6 @@ drupal.user: - core/jquery - core/drupal - core/once - - core/jquery.once.bc drupal.user.admin: version: VERSION @@ -25,7 +24,6 @@ drupal.user.permissions: dependencies: - core/jquery - core/once - - core/jquery.once.bc - core/drupal - core/drupalSettings - user/drupal.user.admin diff --git a/core/modules/views/views.libraries.yml b/core/modules/views/views.libraries.yml index fe13adfc36aac3e..fe5827f2ee2a64c 100644 --- a/core/modules/views/views.libraries.yml +++ b/core/modules/views/views.libraries.yml @@ -14,6 +14,5 @@ views.ajax: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc - core/jquery.form - core/drupal.ajax diff --git a/core/modules/views_ui/views_ui.libraries.yml b/core/modules/views_ui/views_ui.libraries.yml index 086f6917302590d..6f812d07c60fc25 100644 --- a/core/modules/views_ui/views_ui.libraries.yml +++ b/core/modules/views_ui/views_ui.libraries.yml @@ -9,7 +9,6 @@ views_ui.admin: - core/drupal - core/drupalSettings - core/once - - core/jquery.once.bc - core/jquery.form - core/drupal.form - core/drupal.ajax @@ -27,7 +26,6 @@ views_ui.listing: - core/drupal - core/drupal.string.includes - core/once - - core/jquery.once.bc - views_ui/admin.styling admin.styling: diff --git a/core/package.json b/core/package.json index 43e9f43997e7c8d..e731df1a9198c5d 100644 --- a/core/package.json +++ b/core/package.json @@ -83,7 +83,6 @@ "glob": "^7.1.2", "jquery": "^3.6.0", "jquery-form": "^4.3.0", - "jquery-once": "^2.2.3", "jquery-ui": "~1.13.1", "js-cookie": "^3.0.1", "jsdom": "^18.0.1", diff --git a/core/scripts/js/vendor-update.js b/core/scripts/js/vendor-update.js index 19b0b660fb9c91e..e74473f166a155e 100644 --- a/core/scripts/js/vendor-update.js +++ b/core/scripts/js/vendor-update.js @@ -122,11 +122,6 @@ const assetsFolder = `${coreFolder}/assets/vendor`; { from: 'src/jquery.form.js', to: 'src/jquery.form.js' }, ], }, - { - pack: 'jquery-once', - library: 'jquery.once', - files: ['jquery.once.js', 'jquery.once.min.js', 'jquery.once.min.js.map'], - }, { pack: 'js-cookie', files: [{ from: 'dist/js.cookie.min.js', to: 'js.cookie.min.js' }], diff --git a/core/tests/Drupal/Nightwatch/Tests/jsOnceTest.js b/core/tests/Drupal/Nightwatch/Tests/jsOnceTest.js index b1f4a715352ddca..9e8a7476f3074de 100644 --- a/core/tests/Drupal/Nightwatch/Tests/jsOnceTest.js +++ b/core/tests/Drupal/Nightwatch/Tests/jsOnceTest.js @@ -132,79 +132,4 @@ module.exports = { ) .drupalLogAndEnd({ onlyOnError: false }); }, - 'Test BC layer with jQuery Once calls': (browser) => { - browser - .drupalRelativeURL('/js_once_with_bc_test') - .waitForElementVisible('[data-drupal-item]', 1000) - // prettier-ignore - .execute( - function () { - // A core script calls once on some elements. - once('js_once_test', '[data-drupal-item]'); - // A contrib module not yet using @drupal/once calls jQuery Once. - return jQuery('[data-drupal-item]').once('js_once_test'); - }, - (result) => { - browser.assert.strictEqual( - result.value.length, - 0, - 'Calls to once() are taken into account when using jQuery.once()', - ); - }, - ) - // Once calls don't take into account calls to jQuery.once by design. - .execute( - function () { - // Calling jQuery.once before @drupal/once will lead to duplicate - // processing. - jQuery('[data-drupal-item]').once('js_once_test_extra'); - // A core script calls once on some elements. - return once('js_once_test_extra', '[data-drupal-item]'); - }, - (result) => { - browser.assert.strictEqual( - result.value.length, - 5, - '5 items returned by once() after a call to jQuery.once()', - ); - }, - ) - .execute( - function () { - once('js_once_test_remove', '[data-drupal-item]'); - // A core script calls once on some elements. - once.remove('js_once_test_remove', '[data-drupal-item]'); - // A contrib module not yet using @drupal/once calls the jQuery Once - // remove() function. - return jQuery('[data-drupal-item]').removeOnce('js_once_test_remove'); - }, - (result) => { - browser.assert.strictEqual( - result.value.length, - 0, - 'Calls to once.remove() are taken into account when using jQuery.removeOnce()', - ); - }, - ) - // Once.remove calls don't take into account calls to jQuery.removeOnce by - // design. - .execute( - function () { - once('js_once_test_remove_fail', '[data-drupal-item]'); - // Calling jQuery.removeOnce before @drupal/once will lead to - // duplicate processing. - jQuery('[data-drupal-item]').removeOnce('js_once_test_remove_fail'); - // A core script calls once.remove on some elements. - return once.remove('js_once_test_remove_fail', '[data-drupal-item]'); - }, - (result) => { - browser.assert.strictEqual( - result.value.length, - 5, - '5 items returned by once.remove() after a call to jQuery.removeOnce()', - ); - }, - ) - .drupalLogAndEnd({ onlyOnError: false }); - }, }; diff --git a/core/yarn.lock b/core/yarn.lock index 249e9f5502a8bb5..a2aba13f6529336 100644 --- a/core/yarn.lock +++ b/core/yarn.lock @@ -5034,13 +5034,6 @@ jquery-form@^4.3.0: dependencies: jquery ">=1.7.2" -jquery-once@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/jquery-once/-/jquery-once-2.2.3.tgz#d5b266a1a7b47e5f86a5f25e83ee9467e13707a3" - integrity sha512-5gbkmxjbqA15KbrNxcDhdBN3EvakY5w/JdxdGgPGsO/kp6TdiqOr6nbnEZGeyF1/yLXVvA8i9lisgXguSiNV+g== - dependencies: - jquery "*" - jquery-ui@~1.13.1: version "1.13.1" resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.13.1.tgz#d0b7a42e73a04c31bb5706adf86f6f8942f64eaa" @@ -5048,7 +5041,7 @@ jquery-ui@~1.13.1: dependencies: jquery ">=1.8.0 <4.0.0" -jquery@*, jquery@>=1.7.2, "jquery@>=1.8.0 <4.0.0", jquery@^3.6.0: +jquery@>=1.7.2, "jquery@>=1.8.0 <4.0.0", jquery@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470" integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==