Deprecation: #98431 - Replace requireJsModules in FormEngine resultArray
See forge#98431
Description
Loading JavaScript modules via
$result
has been
deprecated in favor of a new generic key named
'java
.
The ability for custom
Form
components to load JavaScript modules
via instances of
\TYPO3\
is now
streamlined to use a new, generic
$result
key named
'java
. The behaviour is otherwise identical to the
functionality that has been available via
'require
,
but the new name reflects that not just RequireJS modules may be loaded,
but also newer, native ECMAScript v6 JavaScript modules.
Using
'java
is now the suggested to be used over
'require
, as this latter is deprecated from now on
and will be removed in TYPO3 v13.
The ability for custom
Form
components to load JavaScript modules
via instances of
\TYPO3\
is now
streamlined to use a new, generic
$result
key named
'java
. The behaviour is otherwise identical to the
functionality that has been available via
'require
,
but the new name reflects that not just RequireJS modules may be loaded,
but also newer, native ECMAScript v6 JavaScript modules.
The
'require
key is deprecated.
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 FormEngine components with JavaScript modules.
Migration
Use the key
'java
and assign an instance of
\TYPO3\
:
// use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction;
$resultArray['javaScriptModules'][] = JavaScriptModuleInstruction::create(
'@my/extension/my-element.js'
);