Feature #39622
closed
include RequireJS in the core
Added by Daniel Sattler over 12 years ago.
Updated about 6 years ago.
Description
RequierJS (http://requirejs.org) is a JavaScript file and model loader.
It can be used to load JS file and handle dependencies between those files in the backend and in extensions. Also multiple jQuery versions can be loaded and used.
Files
here is a little example extension to see RequireJS in action
Adds the JS loader "RequireJS" to the TYPO3 core, accessible
for the TYPO3 Frontend and Backend in the PageRenderer
class.
Additionally, defined AMD modules can be loaded
by RequireJS on page load. This way, the whole JS code
in the core can be moved to standard AMD modules
with dependencies.
The shipped jQuery version already puts itself in a AMD
module named "jquery", so it can be used in all AMD
modules.
All created AMD modules should be named
"TYPO3.CMS.[PackageName].[ModuleName]" so the
file name is resolved automatically as
"EXT:PackageName/Resources/Public/JavaScript/ModuleName.js"
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF