#98927JS async option of includeJS broke by file in includeJSFooter
Description
To reproduce, have a Typoscript like:
page {
includeJS {
headerJSfile = EXT:example/Resources/Public/JavaScript/headerJSfile.js
headerJSfile.async = 1
}
includeJSFooter {
footerJSfile = EXT:example/Resources/Public/JavaScript/footerJSfile.js
}
}
Expected behavior it a HTML code like:
@<script src="/typo3temp/assets/compressed/merged-e942e6f0ca1ee79f54a389342a8850b9-78533bc4645ca634f7c62a6bbc42edef.js?1665838235" async="async"></script>async=“async”@ is not present because of the file configured in includeJSFooter.
Instead
Reviews 2
Related issues 1
History 45
-
Christian Toffolo commented <span data-processor="relativetime" data-value="2022-10-26T11:30:05+00:00" > 10/26/22, 11:30 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 79144 status
NewUnder Review <span data-processor="relativetime" data-value="2023-05-25T08:09:04+00:00" > 05/25/23, 08:09 </span> -
Christian Kuhn changed Related to #108055 <span data-processor="relativetime" data-value="2025-11-11T16:06:45+00:00" > 11/11/25, 16:06 </span>
-
Christian Kuhn commented <span data-processor="relativetime" data-value="2025-11-11T16:07:12+00:00" > 11/11/25, 16:07 </span>
needs investigation if this is still an issue with #108055 being done.
-
Benni Mack commented and changed status
Under ReviewClosed <span data-processor="relativetime" data-value="2026-07-29T13:24:53+00:00" > 07/29/26, 13:24 </span>I double-checked, this is not needed anymore, and can be closed now – not an issue in v13+
addJsFooterFile() adds files to $this->jsFiles with
'section' => self::PART_FOOTERBut then it seems to me that the ‘section’ value is not considered when deciding if to set async or not:
https://github.com/TYPO3/typo3/blob/60a666737b24a7247a59ecc7fe7b13f95c75be20/typo3/sysext/core/Classes/Resource/ResourceCompressor.php#L153
Also, $this->jsFooterFiles array seem to never be “filled”.
So, why not use this array instead of mixing header and footer files in the same array $this->jsFiles ?