From f4e50ddd1ad8fe4fa54fcac2c513bd630c650407 Mon Sep 17 00:00:00 2001 From: Ayumi Hamasaki Date: Sun, 16 Jun 2019 23:17:34 +0100 Subject: [PATCH] Add new Performance API's to October CMS (#4285) PR adds a new Priority Hints API, Preload API and async to the October CMS AJAX injected code and a new Priority Hints API to the loaded assets in the head section. Credit to @ayumihamsaki. Related #4277, #4030 --- modules/backend/layouts/_head.htm | 8 ++++---- modules/backend/layouts/auth.htm | 8 ++++---- modules/cms/twig/FrameworkNode.php | 28 +++++++++++++++++++--------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/modules/backend/layouts/_head.htm b/modules/backend/layouts/_head.htm index 5414360d7..0edbc4803 100644 --- a/modules/backend/layouts/_head.htm +++ b/modules/backend/layouts/_head.htm @@ -30,13 +30,13 @@ ?> - - + + - - + + makeAssets() ?> diff --git a/modules/backend/layouts/auth.htm b/modules/backend/layouts/auth.htm index 06915ba02..6f7bc0ec4 100644 --- a/modules/backend/layouts/auth.htm +++ b/modules/backend/layouts/auth.htm @@ -28,13 +28,13 @@ ?> - - + + - - + + makeAssets() ?> diff --git a/modules/cms/twig/FrameworkNode.php b/modules/cms/twig/FrameworkNode.php index e1af81a92..ae75e1817 100644 --- a/modules/cms/twig/FrameworkNode.php +++ b/modules/cms/twig/FrameworkNode.php @@ -35,25 +35,35 @@ class FrameworkNode extends TwigNode $compiler ->write("if (\$_minify) {" . PHP_EOL) ->indent() - ->write("echo ''.PHP_EOL;" . PHP_EOL) + ->write("echo ''.PHP_EOL;" . PHP_EOL) + ->write("echo ''.PHP_EOL;" . PHP_EOL) ->outdent() ->write("}" . PHP_EOL) ->write("else {" . PHP_EOL) ->indent() - ->write("echo ''.PHP_EOL;" . PHP_EOL) - ->write("echo ''.PHP_EOL;" . PHP_EOL) + ->write("echo ''.PHP_EOL;" . PHP_EOL) + ->write("echo ''.PHP_EOL;" . PHP_EOL) + ->write("echo ''.PHP_EOL;" . PHP_EOL) + ->write("echo ''.PHP_EOL;" . PHP_EOL) ->outdent() ->write("}" . PHP_EOL) ->write("echo ''.PHP_EOL;" . PHP_EOL) + .'/modules/system/assets/css/framework.extras'.(\$_minify ? '-min' : '').'.css\" importance=\"low\">'.PHP_EOL;" . PHP_EOL) + ->write("echo ''.PHP_EOL;" . PHP_EOL) ; } else { - $compiler->write("echo ''.PHP_EOL;" . PHP_EOL) + $compiler->write("echo ' + '.PHP_EOL;" . PHP_EOL) ; }