Loading composer.lock +52 −1 Original line number Diff line number Diff line Loading @@ -443,7 +443,7 @@ "dist": { "type": "path", "url": "core", "reference": "938187e9cd9745789a97efca65f1515cd4aed57f" "reference": "03111049ab167a24a06da256ed9e8fbb44effcf2" }, "require": { "asm89/stack-cors": "^2.1", Loading @@ -467,6 +467,7 @@ "guzzlehttp/guzzle": "^7.5", "guzzlehttp/psr7": "^2.4", "masterminds/html5": "^2.7", "mck89/peast": "^1.14", "pear/archive_tar": "^1.4.14", "php": ">=8.1.0", "psr/log": "^3.0", Loading Loading @@ -1123,6 +1124,56 @@ }, "time": "2022-08-18T16:18:26+00:00" }, { "name": "mck89/peast", "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/mck89/peast.git", "reference": "733cd8f62dcb8239094688063a92766bbfcbf523" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/mck89/peast/zipball/733cd8f62dcb8239094688063a92766bbfcbf523", "reference": "733cd8f62dcb8239094688063a92766bbfcbf523", "shasum": "" }, "require": { "ext-mbstring": "*", "php": ">=5.4.0" }, "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.15.0-dev" } }, "autoload": { "psr-4": { "Peast\\": "lib/Peast/", "Peast\\test\\": "test/Peast/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Marco Marchiò", "email": "marco.mm89@gmail.com" } ], "description": "Peast is PHP library that generates AST for JavaScript code", "support": { "issues": "https://github.com/mck89/peast/issues", "source": "https://github.com/mck89/peast/tree/v1.15.0" }, "time": "2022-09-13T15:56:53+00:00" }, { "name": "pear/archive_tar", "version": "1.4.14", Loading composer/Metapackage/CoreRecommended/composer.json +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ "guzzlehttp/promises": "~1.5.2", "guzzlehttp/psr7": "~2.4.3", "masterminds/html5": "~2.7.6", "mck89/peast": "~v1.15.0", "pear/archive_tar": "~1.4.14", "pear/console_getopt": "~v1.4.3", "pear/pear-core-minimal": "~v1.10.11", Loading core/composer.json +2 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ "composer/semver": "^3.3", "asm89/stack-cors": "^2.1", "pear/archive_tar": "^1.4.14", "psr/log": "^3.0" "psr/log": "^3.0", "mck89/peast": "^1.14" }, "conflict": { "drush/drush": "<8.1.10" Loading core/lib/Drupal/Core/Asset/JsOptimizer.php +8 −3 Original line number Diff line number Diff line Loading @@ -3,6 +3,9 @@ namespace Drupal\Core\Asset; use Drupal\Component\Utility\Unicode; use Peast\Formatter\Compact as CompactFormatter; use Peast\Peast; use Peast\Renderer; /** * Optimizes a JavaScript asset. Loading Loading @@ -30,9 +33,11 @@ public function optimize(array $js_asset) { elseif (isset($js_asset['attributes']['charset'])) { $data = Unicode::convertToUtf8($data, $js_asset['attributes']['charset']); } // No-op optimizer: no optimizations are applied to JavaScript assets. return $data; // Remove comments, whitespace, and optional braces. $ast = Peast::latest($data)->parse(); $renderer = new Renderer(); $renderer->setFormatter(new CompactFormatter()); return $renderer->render($ast); } /** Loading core/misc/cspell/dictionary.txt +1 −0 Original line number Diff line number Diff line Loading @@ -893,6 +893,7 @@ pathnames pcre pcss pdma peast percona permissionless persistable Loading Loading
composer.lock +52 −1 Original line number Diff line number Diff line Loading @@ -443,7 +443,7 @@ "dist": { "type": "path", "url": "core", "reference": "938187e9cd9745789a97efca65f1515cd4aed57f" "reference": "03111049ab167a24a06da256ed9e8fbb44effcf2" }, "require": { "asm89/stack-cors": "^2.1", Loading @@ -467,6 +467,7 @@ "guzzlehttp/guzzle": "^7.5", "guzzlehttp/psr7": "^2.4", "masterminds/html5": "^2.7", "mck89/peast": "^1.14", "pear/archive_tar": "^1.4.14", "php": ">=8.1.0", "psr/log": "^3.0", Loading Loading @@ -1123,6 +1124,56 @@ }, "time": "2022-08-18T16:18:26+00:00" }, { "name": "mck89/peast", "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/mck89/peast.git", "reference": "733cd8f62dcb8239094688063a92766bbfcbf523" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/mck89/peast/zipball/733cd8f62dcb8239094688063a92766bbfcbf523", "reference": "733cd8f62dcb8239094688063a92766bbfcbf523", "shasum": "" }, "require": { "ext-mbstring": "*", "php": ">=5.4.0" }, "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.15.0-dev" } }, "autoload": { "psr-4": { "Peast\\": "lib/Peast/", "Peast\\test\\": "test/Peast/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Marco Marchiò", "email": "marco.mm89@gmail.com" } ], "description": "Peast is PHP library that generates AST for JavaScript code", "support": { "issues": "https://github.com/mck89/peast/issues", "source": "https://github.com/mck89/peast/tree/v1.15.0" }, "time": "2022-09-13T15:56:53+00:00" }, { "name": "pear/archive_tar", "version": "1.4.14", Loading
composer/Metapackage/CoreRecommended/composer.json +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ "guzzlehttp/promises": "~1.5.2", "guzzlehttp/psr7": "~2.4.3", "masterminds/html5": "~2.7.6", "mck89/peast": "~v1.15.0", "pear/archive_tar": "~1.4.14", "pear/console_getopt": "~v1.4.3", "pear/pear-core-minimal": "~v1.10.11", Loading
core/composer.json +2 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ "composer/semver": "^3.3", "asm89/stack-cors": "^2.1", "pear/archive_tar": "^1.4.14", "psr/log": "^3.0" "psr/log": "^3.0", "mck89/peast": "^1.14" }, "conflict": { "drush/drush": "<8.1.10" Loading
core/lib/Drupal/Core/Asset/JsOptimizer.php +8 −3 Original line number Diff line number Diff line Loading @@ -3,6 +3,9 @@ namespace Drupal\Core\Asset; use Drupal\Component\Utility\Unicode; use Peast\Formatter\Compact as CompactFormatter; use Peast\Peast; use Peast\Renderer; /** * Optimizes a JavaScript asset. Loading Loading @@ -30,9 +33,11 @@ public function optimize(array $js_asset) { elseif (isset($js_asset['attributes']['charset'])) { $data = Unicode::convertToUtf8($data, $js_asset['attributes']['charset']); } // No-op optimizer: no optimizations are applied to JavaScript assets. return $data; // Remove comments, whitespace, and optional braces. $ast = Peast::latest($data)->parse(); $renderer = new Renderer(); $renderer->setFormatter(new CompactFormatter()); return $renderer->render($ast); } /** Loading
core/misc/cspell/dictionary.txt +1 −0 Original line number Diff line number Diff line Loading @@ -893,6 +893,7 @@ pathnames pcre pcss pdma peast percona permissionless persistable Loading