Project

General

Profile

Actions

Bug #86982

closed

JS async not working

Added by Martin Weymayer over 5 years ago. Updated about 4 years ago.

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

0%

Estimated time:
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 2 (0 open2 closed)

Related to TYPO3 Core - Bug #87444: 'config.concatenateJs = 1' async feature does not workClosed2019-01-15

Actions
Related to TYPO3 Core - Bug #83476: Few attributes are missing when concatenating JS filesClosed2018-01-04

Actions
Actions #1

Updated by Riccardo De Contardi over 5 years ago

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

Actions #2

Updated by Georg Ringer over 5 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>

Actions #3

Updated by Stefanos Karasavvidis over 5 years ago

works on 8, 9 and current master

Actions #4

Updated by Riccardo De Contardi over 5 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?

Actions #5

Updated by Riccardo De Contardi about 5 years ago

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

Updated by Christian Eßl over 4 years ago

  • Category set to Frontend
Actions #7

Updated by Susanne Moog about 4 years ago

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

Updated by Susanne Moog about 4 years 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.

Actions

Also available in: Atom PDF