Would like to defer Javascript loading in Stucco Concrete5 theme

Permalink Browser Info Environment
I'd like to modify a theme PHP file(s) so that 'defer' is added to the script tags.
E.g.
<script
  src="jquery.js" defer></script>

The Concrete5 page is loading too slowly. (Over 6 seconds.)

Type: Discussion
Status: In Progress
facechomp
View Replies:
facechomp replied on at Permalink Reply
facechomp
(But it's not straightforward with this theme, because it looks like this:
public function registerAssets() {
        //$this->providesAsset('javascript', 'bootstrap/*');
      $this->providesAsset('css', 'bootstrap/*');
      $this->providesAsset('css', 'blocks/form');
      $this->providesAsset('css', 'core/frontend/*');
      $this->requireAsset('css', 'font-awesome');
      $this->requireAsset('javascript', 'jquery');
      $this->requireAsset('javascript', 'bootstrap/tooltip');
      $this->requireAsset('css', 'bootstrap/tooltip');
      $this->requireAsset('javascript', 'bootstrap/tooltip');
      $this->requireAsset('javascript', 'picturefill');
   }
)
jasteele12 replied on at Permalink Reply
jasteele12
Bump.

Has defer been discussed elsewhere as an option, something like:
$this->requireAsset('javascript', 'jquery', 'defer');  // or a boolean true maybe?

concrete5 Environment Information

# concrete5 Version
Core Version - 8.5.1
Version Installed - 8.5.1
Database Version - 20190301133300

# concrete5 Packages
Image Optimizer (3.2.9), Stucco (2.1.6), Use CDN (0.1.3)

# concrete5 Overrides
None

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
7.2.19

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imagick, imap, intl, ionCube Loader, json, libxml, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, pspell, readline, Reflection, session, SimpleXML, soap, sockets, SPL, sqlite3, standard, tidy, timezonedb, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 90
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 120
max_input_vars - 1000
memory_limit - 128M
post_max_size - 8M
upload_max_filesize - 100M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 4000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.