Feature #28382

Epic #55575: Streamline JavaScript Code in the TYPO3 Backend

Allow asynchronous JavaScript files

Added by Xavier Perseguers over 8 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-07-22
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Instead of evaluating Google Analytics code right away, the official snippet allows asynchronous evaluation, if browser supports it:

<script type="text/javascript">
  // code stripped
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>

Add new option 'async' to PAGE.includeJS.<array>


Related issues

Related to TYPO3 Core - Feature #62023: Allow script tags to have custom attributes Closed 2014-10-03
Related to TYPO3 Core - Feature #75858: Async-option for config.concatenateJs Rejected 2016-04-22

Associated revisions

Revision e6e9b531 (diff)
Added by Arnd Messer almost 5 years ago

[FEATURE] Add async property to JavaScript files

Add a property 'async="async"' to JavaScript files via TypoScript
page.includeJSlibs.<array>.async = 1

This patch affects the TypoScript PAGE properties
  • includeJSlibs
  • includeJSFooterlibs
  • includeJS
  • includeJSFooter

Resolves: #28382
Releases: master
Change-Id: I9a86edaba118370d4df9f11216998d808276b634
Reviewed-on: http://review.typo3.org/34000
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Frank Nägler <>
Tested-by: Frank Nägler <>

History

#1 Updated by Xavier Perseguers over 8 years ago

  • Subject changed from Allow asynchronously JavaScript files to Allow asynchronous JavaScript files

#2 Updated by Xavier Perseguers over 8 years ago

  • Priority changed from Should have to Could have

#3 Updated by Xavier Perseguers about 8 years ago

  • Target version deleted (4.6.0-beta1)

#4 Updated by Daniel Siepmann over 5 years ago

  • Parent task set to #55575

#5 Updated by Mario Colombo over 5 years ago

Come on guys... it should be possible. Google Page Speed complains about the current way page.includeJS includes javascript.

#6 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33984

#7 Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34000

#8 Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34259

#9 Updated by Gerrit Code Review almost 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34000

#10 Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34263

#11 Updated by Gerrit Code Review almost 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34263

#12 Updated by Gerrit Code Review almost 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34000

#13 Updated by Gerrit Code Review almost 5 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34000

#14 Updated by Gerrit Code Review almost 5 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34000

#15 Updated by Gerrit Code Review almost 5 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34000

#16 Updated by Arnd Messer almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#17 Updated by Clemens Riccabona over 4 years ago

great, but as it seems to me, completely useless ATM if you use concatenation feature AFAICS.

and concatenation is also recommended by google.
just mention the latter to prevent anoying "concat-minify-compress" debate on principles.

#18 Updated by Sebastian Schmal over 3 years ago

how can I load the compress (minify) files async in TYPO3?

the normal way:

includeJSFooterlibs {
jquery = fileadmin/JS/jquery.min.js
jquery {
    async = 1
}
}

then i Compression all File. How can i load the Compression-FILE in async Modus?

Thanks

#19 Updated by Christoph Werner over 2 years ago

Any news to "how can I load the compress (minify) files async in TYPO3?"?
Best
Chris

#20 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF