-
Notifications
You must be signed in to change notification settings - Fork 9.4k
matthiasmullie/minify - replacing JS & CSS libraries with a better one #40049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @jakwinkler. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
…e, removing tubalmartin/cssmin
…2 into matthiasmullie_minify
@magento run all tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request replaces the legacy JShrink and CSSmin libraries with the maintained matthiasmullie/minify
package for JavaScript and CSS minification.
- JS adapter updated to use
MatthiasMullie\Minify\JS
- CSS adapter simplified to use
MatthiasMullie\Minify\CSS
- Added
matthiasmullie/minify
tocomposer.json
and reordered dependencies
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
lib/internal/Magento/Framework/Code/Minifier/Adapter/Js/JShrink.php | Switched import and implementation to use Minify\JS |
lib/internal/Magento/Framework/Code/Minifier/Adapter/Css/CSSmin.php | Removed legacy CSSmin code and used Minify\CSS |
composer.json | Added matthiasmullie/minify and reorganized dependencies |
Comments suppressed due to low confidence (1)
lib/internal/Magento/Framework/Code/Minifier/Adapter/Css/CSSmin.php:22
- [nitpick] Add unit tests for this new CSS minifier adapter to verify it handles various CSS inputs correctly.
public function minify($content): string
* @throws \Exception | ||
* @return bool|string | ||
*/ | ||
public function minify($content) | ||
public function minify($content): bool|string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type includes bool
but the implementation always returns a string. Change the signature to : string
for accuracy.
public function minify($content): bool|string | |
public function minify($content): string |
Copilot uses AI. Check for mistakes.
@@ -6,7 +6,7 @@ | |||
|
|||
namespace Magento\Framework\Code\Minifier\Adapter\Js; | |||
|
|||
use JShrink\Minifier; | |||
use MatthiasMullie\Minify; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Import the JS-specific class directly with use MatthiasMullie\Minify\JS;
and instantiate new JS()
to improve clarity.
use MatthiasMullie\Minify; | |
use MatthiasMullie\Minify\JS; |
Copilot uses AI. Check for mistakes.
"magento/zend-cache": "^1.16", | ||
"magento/zend-db": "^1.16", | ||
"magento/zend-pdf": "^1.16", | ||
"matthiasmullie/minify": "^1.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Dependencies in composer.json
appear out of alphabetical order; consider sorting entries to improve readability.
Copilot uses AI. Check for mistakes.
@jakwinkler, please review the comments from Copilot and let us know if you would like anything to be fixed based on them. If no, I'll review the pull request |
@magento run all tests |
Description (*)
I've replaced old CSS / JS minification libraries with https://github.com/matthiasmullie/minify - which is maintained, up to date and covered with tests.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)