Breaking: #109998 - Removed jQuery 

See forge#109998

Description 

The jQuery JavaScript library is no longer shipped with TYPO3. All remaining usages in the TYPO3 backend have been migrated to native DOM APIs.

In detail, the following pieces have been removed:

  • The bundled library file EXT:core/Resources/Public/JavaScript/Contrib/jquery.js
  • The import map entries jquery and jquery/ provided by EXT:core
  • The JavaScript module @typo3/backend/multi-step-wizard.js together with its global TYPO3.MultiStepWizard object

Note that @typo3/backend/multi-step-wizard.js has been removed without a prior deprecation phase. It was the recommended migration target when @typo3/backend/wizard.js was deprecated with TYPO3 v13.1 (Deprecation entry). The module is unused within TYPO3 itself since v14.2, when the form and translation wizards switched to the internal typo3-backend-wizard web component.

Furthermore, a couple of JavaScript API signatures changed because they returned or received jQuery objects before:

  • FormEngine.getFieldElement() now returns a native HTMLElement or null instead of a jQuery collection
  • The callbacks of the preview, new, duplicate and delete doc header actions of @typo3/backend/form-engine.js (for example FormEngine.showPreviewModal()) now receive a native HTMLInputElement or HTMLAnchorElement instead of a jQuery object
  • The @typo3/backend/modal.js API no longer accepts jQuery objects as modal content

Impact 

Extensions that import jquery in their backend JavaScript modules will fail to load those modules in the browser because the bare module specifier can no longer be resolved.

Extensions using @typo3/backend/multi-step-wizard.js or the TYPO3.MultiStepWizard global will fail accordingly.

Extensions calling the changed FormEngine and Modal methods with jQuery semantics will trigger JavaScript errors.

Affected installations 

All installations with extensions that load jQuery via the TYPO3 core import map, use the multi step wizard module, or rely on the jQuery based FormEngine and Modal API signatures in their backend JavaScript.

Migration 

jQuery 

Extensions that still depend on jQuery need to ship their own copy of the library and register it in their import map configuration:

EXT:my_extension/Configuration/JavaScriptModules.php
return [
    'dependencies' => ['core'],
    'imports' => [
        'jquery' => 'EXT:my_extension/Resources/Public/JavaScript/Contrib/jquery.js',
    ],
];
Copied!

Consider migrating extension JavaScript to native DOM APIs instead.

Multi step wizard 

There is no direct replacement for the removed @typo3/backend/multi-step-wizard.js module. TYPO3 itself uses the typo3-backend-wizard web component, which is currently internal and provides no API stability guarantees yet. Extensions should either bring their own wizard implementation, or copy the removed module into their own codebase together with a bundled jQuery.

FormEngine 

Adapt callers of the changed FormEngine methods to the native return types:

-const field = FormEngine.getFieldElement(fieldName).get(0);
+const field = FormEngine.getFieldElement(fieldName);
Copied!