Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Use JS module loader instead of requirejs when available #2193

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public function requireColumnPositionJavaScript() : void
{
/** @var PageRenderer $pageRenderer */
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Flux/FluxColPosAssignment');
if (method_exists($pageRenderer, 'loadJavaScriptModule')) {
$pageRenderer->loadJavaScriptModule('@fluidtypo3/flux/FluxColPosAssignment.js');
} else {
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Flux/FluxColPosAssignment');
}
}
}
6 changes: 5 additions & 1 deletion Classes/Integration/PreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ protected function attachAssets(): void
{
if (!static::$assetsIncluded) {
$this->pageRenderer->addCssFile('EXT:flux/Resources/Public/css/flux.css');
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Flux/FluxCollapse');
if (method_exists($this->pageRenderer, 'loadJavaScriptModule')) {
$this->pageRenderer->loadJavaScriptModule('@fluidtypo3/flux/FluxCollapse.js');
} else {
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Flux/FluxCollapse');
}

static::$assetsIncluded = true;
}
Expand Down
8 changes: 8 additions & 0 deletions Configuration/JavaScriptModules.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

return [
'dependencies' => ['core', 'backend'],
'imports' => [
'@fluidtypo3/flux/' => 'EXT:flux/Resources/Public/JavaScript/',
]
];
Loading