Coder Social home page Coder Social logo

min's People

Contributors

a-r-m-i-n avatar benjamingries avatar brotkrueml avatar can0199 avatar jokumer avatar mai-space avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

min's Issues

Option to disable compression for single asset

If possible, it would be great if an option/argument for the asset.script viewhelper could be implemented that disables compression of a single asset.

E.g.: <f:asset.script identifier="myScript" src="EXT:sitepackage/Resources/Public/JavaScript/myScript.min.js" compress="false" />

why: some js plugins like "tablefilter js" need a relative "base_path" to their additional resources, which could be wrong if compression is enabled.

Old versions no longer downloadable

Hi,

it seems that during the migration from Bitbucket to GitHub the references in packagist have not been updated. When trying to install 1.7.0 for example I get this error:

The TYPO3 extension package "t3/min", does not define an extension key in its composer.json. Please report this to the author of this package. Specifying the extension key will be mandatory in future versions of TYPO3 (see: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/ComposerJson/Index.html#extra)
  - Installing t3/min (1.7.0): Downloading    Failed to download t3/min from dist: Could not authenticate against bitbucket.org
    Now trying to download from source
  - Installing t3/min (1.7.0):     No bitbucket authentication configured. Falling back to ssh.
Cloning fd6f290b05
    No bitbucket authentication configured. Falling back to ssh.

                                                                                                                                                                                                                                                                                                                                                                                                                                            
  [RuntimeException]                                                                                                                                                                                                                                                                                                                                                                                                                        
  Failed to execute git clone --no-checkout '[email protected]:t--3/min.git' 'redacted/typo3conf/ext/min' && cd 'redacted/typo3conf/ext/min' && git remote add composer '[email protected]:t--3/min.git' && git fetch composer && git remote set-url origin '[email protected]:t--3/min.git' && git remote set-url composer '[email protected]:t--3/min.git'  
                                                                                                                                                                                                                                                                                                                                                                                                                                            
  Cloning into 'redacted/typo3conf/ext/min'...                                                                                                                                                                                                                                                                                                                                                       
  The requested repository either does not exist or you do not have access. If you believe this repository exists and you have access, make sure you're authenticated.                                                                                                                                                                                                                                                                      
  fatal: Could not read from remote repository.                                                                                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                                                                            
  Please make sure you have the correct access rights                                                                                                                                                                                                                                                                                                                                                                                       
  and the repository exists.                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                            

While trying to install 1.8.0 works, as it downloads the package from GitHub.

Is this something you can fix? That'd be very appreciated!

Regards
Mattia

why use ext_typoscript_setup.txt for enable = 1

Hi,
the setting is surely meant to be object of configuration. But the ext_typoscript_setup.txt is hard to override. So why not drop the statement at that place to only be set elsewhere or position it in EXT:/min/Configuration/TypoScript/.. ?

Hint: All TS is loaded by EXT:sitepackage/ext_localconf.php or sitepackage/Configuration/TCA/Overrides/sys_template.php

[BUG] CSS compression filename conflict

Hello,

I found a bug, when two modules have the same CSS filename there is a conflict with the assetCollector.compressCss

Exemple:

  • vendor_module1 as main.css
  • vendor_module2 as main.css

the vendor_module2 CSS will be not rendered with this configuration:

plugin.tx_min.assetCollector {
    compressCss = 1
}

when compressCss = 0, it will work.

In my case I had to change the filename from main.css to card.css to avoid this hidden conflict, and have the min-compressed file:

2024-04-23_11-44

2024-04-23_11-45

This impact CSS, I didn't check for JS files.

Best,

Do not override global `config.compress*` and `config.concatenate*`

The current version (v2.1) overwrites global configuration config.compress* and config.concatenate* which might often be against the interest of the user, as today's assets are mostly bundled, minified and prepared for long-term caching strategies by other tools.

The documentation already contains the hint to add these yourself: https://docs.typo3.org/p/t3/min/2.1/en-us/Configuration.html#asset-compression-css-js

Including modifications to global config { ... } together with other, plugin-specific configuration makes it cumbersome to handle complex configuration trees, where global config is, among other basic settings, configured before extension configuration is included.

I would propose either removing the config section from the extension TypoScript configuration entirely, or splitting it off into a separate, includable static TypoScript file.

PS: As website author / extension user, not including the provided TypoScript configuration is not a good option either: This raises the maintenance burden, as all relevant non-config settings need to manually be kept in sync when extension updates introduce new or change existing settings.

Relative CSS paths are wrong

This issue did already exist in the forge and bitbucket tracker, but was never fixed.
Now I changed to the recent version and had to adapt my patch.

Example:
in the CSS file generated by TYPO3 there's path like ../../../typo3conf/ext/my_ext/Resources/Public/fonts/myfont.xxx and the problem is that your extension passes the content of the file to the $minifier->add method, which results in appending another ../../.. in front of the already correct relative paths (because the source is missing).
The solution is to write the output of compressCss to a file and pass the file name to $minifier->add, then the source path is correctly determined by minifier and not changed.

Here's my local patch:

+++ Classes/Minifier.php
@@ -121,7 +121,8 @@
             $minifier = new $minifierClassName();
             if ($type === self::TYPE_STYLESHEET) {
                 $minifier->setImportExtensions([]);
-                $minifier->add($this->compressCss(file_get_contents($config['file'])));
+                file_put_contents($pathSite . 'tmp' . $targetFilename, $this->compressCss(file_get_contents($config['file'])));
+                $minifier->add($targetFilename);
             } else {
                 $minifier->add($config['file']);
             }

New Tag for TS fix

Hello,
could you create a new tag so that we get this fix: 4966c4c
and prevent deprecation warnings?

Thank you very much!

Loading error by using email mailto

All sites with a "mailto" can't load any more after activating the plugin. They are loading endless with a white site. No error will be generated in logs.

This same happens if a form is used on a site.

We have t3 v11.5.32 running with php 8.0 and min v. 2.1.3

[Bug] Asset compression (CSS/JS) is generated with every page view

Hello,

on a website that is larger and where an external crawler monitors the site, I analyzed the crawler logs last week and saw that a lot of merged-*-min.css.gz are collected there. During a test, I then saw that the minify files are created with every page view.

First load - 07.07.2024 - 11:47:57:
/typo3temp/assets/compressed/merged-1e691d4e2026e04f3027483bb0cd5cf8-min.css.gz?1720345677

Second load - 07.07.2024 - 11:48:38:
/typo3temp/assets/compressed/merged-1e691d4e2026e04f3027483bb0cd5cf8-min.css.gz?1720345718

In this commit, the check if the file has already been created was removed:
7fd9953#diff-0121e1183a0acdd190c5bbfdb63e3a197f72ee7e89c4c6407cd2a27589c0877dL129

Subject version: 3.0.1 (12 LTS) and 2.1.3 (11 LTS/10 LTS)

Solution idea:

            // File already created for this ext
            if (file_exists($targetFilename)) {
                $config['file'] = $targetFilename;
                $filesAfterCompression[$targetFilename] = $config;
                continue;
            }

Bye
Björn

PHP Warning: Undefined array key "debug"

This happens if the default TS template is loaded.

/min/Configuration/TypoScript/setup.typoscript

Please change

[getTSFE() && getTSFE().isBackendUserLoggedIn() && request.getQueryParams()['debug'] > 0]

to

[getTSFE() && getTSFE().isBackendUserLoggedIn() && traverse(request.getQueryParams(), 'debug') > 0]

Thanks

Compression of AssetCollector Assets

Thanks armin for version 2 of this must have extension!
In the commit logs i saw a roadmap v2.1 task to provide optional CSS/JS compression for the "new" asset viewhelper. Is that still on your roadmap? That would be really cool, because the core still does not provide such a feature. https://forge.typo3.org/issues/91312

Undefined array key "priority"

PHP Warning: Undefined array key "priority" in /var/www/html/public/typo3conf/ext/min/Classes/EventListener/AssetRendererEventListener.php line 115

TYPO3 11.5.16
PHP 8.0.x
EXT:min 2.1.0
composer-mode

TYPO3 12

Hello, are there any plans for TYPO3 12 support?

Possible error in ext_localconf.php?

I got several Log Entries:
"Core: Exception handler (CLI): Uncaught TYPO3 Exception: syntax error, unexpected '=' | ParseError thrown in file .../typo3temp/var/cache/code/core/ext_localconf_ccd1fa08068a0a0f1060a754943cb44d743d8f59.php in line 2028"

I could figured out, that the error point to line 18 in the EXT:min/ext_localconf.php.

I use php 7.4.28

AssetCollector compression not working anymore

TYPO3 11.5.27
PHP 8.1.18
min 2.1.2
composer installers v4

Since v2.1.2 the compression of assetcollector assets (css and js) does not work anymore. The assets are just ignored.
It seems that commit 2c92ec0 introduced a regression.

With v2.1.1

<link media="all" href="/typo3temp/assets/compressed/femanager-min.css.1685534495.gzip" rel="stylesheet">
<script src="/typo3temp/assets/compressed/Femanager.min-min.js.1685534495.gzip"></script>

With v2.1.2

<link media="all" href="/_assets/c1c23d805658c7c8c9054ca1396e79a3/Css/Extensions/femanager.1685107140.css" rel="stylesheet">
<script src="/_assets/f038457a108ded7ca0b077b63bfae195/JavaScript/Femanager.min.1682508541.js"></script>

Downgraded to v2.1.1 as temp workaround.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.