Bug #86982

JS async not working

Added by Martin Weymayer almost 2 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2018-11-23
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

following setup is not working in 9.5

page {
        includeJS {
                jsFile = /Path/To/jsFile.js
                jsFile.async = 1
        }
}


Related issues

Related to TYPO3 Core - Bug #87444: 'config.concatenateJs = 1' async feature does not work Closed 2019-01-15
Related to TYPO3 Core - Bug #83476: Few attributes are missing when concatenating JS files Closed 2018-01-04

History

#1 Updated by Riccardo De Contardi almost 2 years ago

Confirmed, the async attribute is absent; it works on 8.7.20

#2 Updated by Georg Ringer almost 2 years ago

  • Status changed from New to Needs Feedback

sorry I can't reproduce it on current master

page {
        includeJS {
                jsFile = fileadmin/templates/file1.js
                jsFile.async = 1
        }
}

this leads to

<script src="/fileadmin/templates/file1.js?1529777566" type="text/javascript" async="async"></script>

#3 Updated by Stefanos Karasavvidis almost 2 years ago

works on 8, 9 and current master

#4 Updated by Riccardo De Contardi almost 2 years ago

I can confirm the findings of @Stefanos Karasavvidis , but I also found a coupe of behaviors:

1) If you write:

config.concatenateJs = 1

page {
        includeJS {
                jsFile = fileadmin/test.js
                jsFile.async = 1

                jsFile2 = fileadmin/testb.js
        }
}

the async attribute is absent (seems reasonable)

but

2) If you write:

config.concatenateJs = 1

page {
        includeJS {
                jsFile = fileadmin/test.js
                jsFile.async = 1
        }
}

The async attribute is still present only on TYPO3 9.5 while is absent on 8.7 and current master

Can someone confirm?

#5 Updated by Riccardo De Contardi almost 2 years ago

  • Related to Bug #87444: 'config.concatenateJs = 1' async feature does not work added

#6 Updated by Christian Eßl about 1 year ago

  • Category set to Frontend

#7 Updated by Susanne Moog 7 months ago

  • Related to Bug #83476: Few attributes are missing when concatenating JS files added

#8 Updated by Susanne Moog 7 months ago

  • Status changed from Needs Feedback to Closed

Riccardo De Contardi wrote:

2) If you write:

[...]

The async attribute is still present only on TYPO3 9.5 while is absent on 8.7 and current master

Can someone confirm?

No, for master and 9.5 the behaviour is the same for me since https://review.typo3.org/c/Packages/TYPO3.CMS/+/57130 - also have a look at the tests there for a documentation of the behaviour.

As this is working on both master and 9.5 as intended, and Riccardo confirmed for 9.5 I'm going to close this issue now.

Also available in: Atom PDF