:information_source: View this commit on Github
:busts_in_silhouette: Authored by Benjamin Franzke ben@bnf.dev
:heavy_check_mark: Merged by Benjamin Franzke ben@bnf.dev
Commit message
[!!!][TASK] Remove RequireJS
RequireJS has been replaced by ECMAScript v6/v11
modules and is now removed.
Support for RequireJS in FormEngine has already been
partially removed in #101067.
This patch removes the backing infrastructure from PageRenderer
and adapts RSTs to document all removed methods
(like PageRenderer->loadRequireJsModule) from both patches.
13.0/Breaking-101266-RemoveRequireJS.rst
```rst
.. include:: /Includes.rst.txt
.. _breaking-101266-1688654482:
====================================
Breaking: #101266 - Remove RequireJS
====================================
See :issue:`101266`
Description
===========
The RequireJS project has been discontinued_ and was therefore
deprecated in TYPO3 v12 with :issue:`96510` in favor of native ECMAScript
v6/v11 modules (added in :issue:`96510`).
The infrastructure for configuration and loading of RequireJS
modules is now removed.
Impact
======
Registering FormEngine JavaScript modules via :php:`'requireJsModules'` will
have no effect. The PageRenderer endpoints
:php:`TYPO3\CMS\Core\Page\PageRenderer::loadRequireJs()` and
:php:`TYPO3\CMS\Core\Page\PageRenderer::loadRequireJsModule()`
have been removed and must no longer be called.
The respective `includeJavaScriptModules` property of the ViewHelper
:html:`` ViewHelper has also been removed.
Affected installations
======================
TYPO3 installations using RequireJS modules to provide JavaScript in the TYPO3
backend, or – less common – use PageRenderer RequireJS infrastructure for
frontend JavaScript module loading.
Migration
=========
Migrate your JavaScript from the AMD module format to native ES6 modules and
register your configuration in :php:`Configuration/JavaScriptModules.php`,
also see :issue:`96510` and :ref:`t3coreapi:backend-javascript-es6`
for more information:
.. code-block:: php
# Configuration/JavaScriptModules.php
['core', 'backend'],
'imports' => [
'@vendor/my-extension/' => 'EXT:my_extension/Resources/Public/JavaScript/',
],
];
Then use :php:`TYPO3\CMS\Core\Page\PageRenderer::loadJavaScriptModules()` instead
of :php:`TYPO3\CMS\Core\Page\PageRenderer::loadRequireJsModule()` to load the ES6 module:
.. code-block:: php
// via PageRenderer
$this->packageRenderer->loadJavaScriptModule('@vendor/my-extension/example.js');
In Fluid templates `includeJavaScriptModules` is to be used instead of
`includeRequireJsModules`:
In Fluid template the `includeJavaScriptModules` property of the
:html:`` ViewHelper may be used:
.. code-block:: xml
.. seealso::
:ref:`t3coreapi:backend-javascript-es6` for more info about JavaScript in TYPO3 Backend.
.. _discontinued: https://github.com/requirejs/requirejs/issues/1816
.. index:: Backend, JavaScript, PHP-API, PartiallyScanned, ext:core
```
:heavy_division_sign: Modified files
13.0/Breaking-100963-DeprecatedFunctionalityRemoved.rst
```diff
@@ -143,6 +143,7 @@ The following PHP class methods that have previously been marked as deprecated w
- :php:`\TYPO3\CMS\Core\Localization\Locales->getIsoMapping`
- :php:`\TYPO3\CMS\Core\Localization\LanguageService->getLL`
- :php:`\TYPO3\CMS\Core\Page\JavaScriptModuleInstruction->shallLoadRequireJs`
+- :php:`\TYPO3\CMS\Core\Page\PageRenderer->loadRequireJs`
- :php:`\TYPO3\CMS\Core\Page\PageRenderer->loadRequireJsModule`
- :php:`\TYPO3\CMS\Core\Page\PageRenderer->setRenderXhtml`
- :php:`\TYPO3\CMS\Core\Page\PageRenderer->getRenderXhtml`
@@ -415,6 +416,7 @@ The following global variables have been removed:
The following hooks have been removed:
- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']`
+- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules']`
- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag']`
- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass']`
- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing']`
```
:information_source: View this commit on Github :busts_in_silhouette: Authored by Benjamin Franzke ben@bnf.dev :heavy_check_mark: Merged by Benjamin Franzke ben@bnf.dev
Commit message
[!!!][TASK] Remove RequireJS
RequireJS has been replaced by ECMAScript v6/v11 modules and is now removed.
Support for RequireJS in FormEngine has already been partially removed in #101067. This patch removes the backing infrastructure from PageRenderer and adapts RSTs to document all removed methods (like PageRenderer->loadRequireJsModule) from both patches.
Executed commands:
npm remove requirejs @types/requirejs grunt build
Releases: main Resolves: #101266 Related: #101067 Related: #100963 Related: #97057 Related: #96323 Change-Id: If89bb3ccd86eab3681258c1cb9d2d130a09902da Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79809 Tested-by: Oliver Bartsch bo@cedev.de Reviewed-by: Benjamin Franzke ben@bnf.dev Tested-by: core-ci typo3@b13.com Reviewed-by: Andreas Fernandez a.fernandez@scripting-base.de Tested-by: Andreas Fernandez a.fernandez@scripting-base.de Reviewed-by: Oliver Bartsch bo@cedev.de Tested-by: Benjamin Franzke ben@bnf.dev
:heavy_plus_sign: Added files
13.0/Breaking-101266-RemoveRequireJS.rst
```rst .. include:: /Includes.rst.txt .. _breaking-101266-1688654482: ==================================== Breaking: #101266 - Remove RequireJS ==================================== See :issue:`101266` Description =========== The RequireJS project has been discontinued_ and was therefore deprecated in TYPO3 v12 with :issue:`96510` in favor of native ECMAScript v6/v11 modules (added in :issue:`96510`). The infrastructure for configuration and loading of RequireJS modules is now removed. Impact ====== Registering FormEngine JavaScript modules via :php:`'requireJsModules'` will have no effect. The PageRenderer endpoints :php:`TYPO3\CMS\Core\Page\PageRenderer::loadRequireJs()` and :php:`TYPO3\CMS\Core\Page\PageRenderer::loadRequireJsModule()` have been removed and must no longer be called. The respective `includeJavaScriptModules` property of the ViewHelper :html:`:heavy_division_sign: Modified files
13.0/Breaking-100963-DeprecatedFunctionalityRemoved.rst
```diff @@ -143,6 +143,7 @@ The following PHP class methods that have previously been marked as deprecated w - :php:`\TYPO3\CMS\Core\Localization\Locales->getIsoMapping` - :php:`\TYPO3\CMS\Core\Localization\LanguageService->getLL` - :php:`\TYPO3\CMS\Core\Page\JavaScriptModuleInstruction->shallLoadRequireJs` +- :php:`\TYPO3\CMS\Core\Page\PageRenderer->loadRequireJs` - :php:`\TYPO3\CMS\Core\Page\PageRenderer->loadRequireJsModule` - :php:`\TYPO3\CMS\Core\Page\PageRenderer->setRenderXhtml` - :php:`\TYPO3\CMS\Core\Page\PageRenderer->getRenderXhtml` @@ -415,6 +416,7 @@ The following global variables have been removed: The following hooks have been removed: - :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']` +- :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['RequireJS']['postInitializationModules']` - :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag']` - :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass']` - :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing']` ```