Deprecation: #97057 - Deprecate RequireJS support
See forge#97057
Description
The RequireJS project has been discontinued and was therefore replaced by native ECMAScript v6/v11 modules in TYPO3 in forge#96510.
The infrastructure for configuration and loading of RequireJS modules is now deprecated and will be removed in TYPO3 v13.
Impact
Registering modules via
'require
will still work.
These modules will be loaded after modules registered via
'java
. Extensions that
use
'require
will work as before but trigger a PHP
E_
error.
Affected installations
Installations that register custom JavaScript modules for the TYPO3 backend.
Migration
Migrate your JavaScript from the AMD module format to native ES6 modules and register your configuration in
Configuration/
, also see forge#96510 for more information:
# Configuration/JavaScriptModules.php
<?php
return [
'dependencies' => ['core', 'backend'],
'imports' => [
'@vendor/my-extension/' => 'EXT:my_extension/Resources/Public/JavaScript/',
],
];
Then use
TYPO3\
instead of
TYPO3\
to load the ES6 module:
// via PageRenderer
$this->packageRenderer->loadJavaScriptModule('@vendor/my-extension/example.js');
In Fluid templates include
is to be used instead of include
:
In Fluid template the include
property of the
<f:
ViewHelper may be used:
<f:be.pageRenderer
includeJavaScriptModules="{
0: '@vendor/my-extension/example.js'
}"
/>