Comments (27)
@Committing Thanks man, I changed link to search in packagist instead :)
from assetmanager.
This is also in the readme. None of those are included, you should add them yourself.
from assetmanager.
Can you provide an example cause I cannot get this to work. I cannot find neither \JSMin not \CssMin components
from assetmanager.
kriswallsmith/assetic#300
https://github.com/douglascrockford/JSMin
from assetmanager.
@RWOverdijk that's the old C version :)
Here's JSMin for PHP, while CssMin is here.
Anyway, I can personally suggest to use Yui Compressor for CSS, while Google Closures Compiler for JS. Those two are a dozen of magnitudes better, but have extra requirements.
from assetmanager.
Hmm, but why original library kriswallsmith/assetic uses these dependencies and don't include them in composer?
Isn't it what composer is used for?
from assetmanager.
@dVaffection you may do a PR on the respective packages and suggest that, I'm totally for it. That will allow usage of those via composer/packagist
from assetmanager.
I think they left it opt-in because you won't always use them.
from assetmanager.
Yeah, even in assetic, it would just be in the suggests
section of composer.json
from assetmanager.
Why opt-in?
kriswallsmith / assetic has no rgrove / jsmin-php, http://code.google.com/p/cssmin/ libraries in dependencies and at the same time \CssMin::minify()
is called in Assetic\Filter\CssMinFilter
and \JSMin::minify()
is called in Assetic\Filter\JSMinFilter
Probably I don't understand something?!
from assetmanager.
It's because those are extra classes that are needed for this functionality. This merely supplies the usage of them. If you wish to actually use them, you must include them yourself. They do not fit PSR0 (at least, JSMin doesn't) or any other PSR for that matter. Also, the size is rather large. I can understand why they didn't include the dependencies. Like this, you get to include whatever you wish to use. I hope this helps.
from assetmanager.
I understand they are extra classes not following PSR0 and probably large BUT their call is hard-coded in kriswallsmith / assetic. So you propose to change kriswallsmith / assetic package code in order to use different extra classes like Yui Compressor for CSS and Google Closures Compiler for JS?
I want to understand just one thing: why it's not working out of the box?
from assetmanager.
Yes, that's a possible solution. I can supply them, but that'd then be optional, and still manual work (adding them to your own composer.json). I can add that step, if you want. But those filters will still not work out of the box. It's a lot of maintenance if we have to keep updating those external assets. They're not following standards, but at least we're offering a way to use them (when implemented by you). I'm sorry. Would you prefer a guide explaining how to accomplish this?
from assetmanager.
@dVaffection that's because assetic is just an adapter for them.
Like (for example) Zend\Cache
provides caches based on Memcache, MongoDB, Redis, Apc, XCache, etc, Zend\Cache
is just a mere adapter.
That's what adapters do. If you try to instantiate a Zend\Cache
storage adapter for XCache on your system, and your system doesn't have XCache, you will just end up with a fatal.
Same happens with assetic.
from assetmanager.
@Ocramius Thanks for the nice explanation. I should have started with that...
from assetmanager.
Thanks @Ocramius Now it's more clear.
Then I expect this to be mentioned in wiki https://github.com/RWOverdijk/AssetManager/wiki/Filters Cause now I just see
It allows you to minify code, optimize images, use dynamic stylesheet languages, use stuff like coffeescript and so on.
and after reading it have no idea why it's not working!
from assetmanager.
@dVaffection edit the paragraph according to what you understand best then :)
from assetmanager.
Already done.
from assetmanager.
I suggest to do it for @RWOverdijk as initially this is his project.
And yea it would be great if it's started from "Adapter for ..."
It would make more sense otherwise it's misleading and people think it's independent ZF2 module
from assetmanager.
@RWOverdijk great! :)
@dVaffection that's not how github works ;)
from assetmanager.
@dVaffection I think you understand what it's like now. I've edited the wiki to reflect this and I think it's safe to assume that this issue can be closed. Once again, thank you for letting me know, it's been a great help and an addition to the wiki.
from assetmanager.
Hi guys... this topic seems to be a little old but im stuck right now.
I would like to ask: Which way its the best to include the JSMin library /or another library) in order to get the filter work?. I tried including "jsmin-php/jsmin.php":"*" dependency in my composer.json file, but doesn't work. May be i have to add this library somewhere manually but the question is where...
from assetmanager.
@javier22 Some dependencies require you to copy the source code. They might not have their dep in composer yet. If they do, it's now namespaced and the filter probably looks globally.
from assetmanager.
Thanks @RWOverdijk, i'll try to make them available with a namespace, probably i will need to modify the JSMinFilter class to use this new dependency with the correct namespace...
from assetmanager.
Perhaps. Or make the filter class configurable. You're allowed to set custom filters for the asset manager.
from assetmanager.
Thanks @RWOverdijk. For anyone using composer, linkorb/jsmin-php worked for me. https://packagist.org/search/?q=jsmin-php.
from assetmanager.
Cheers @jarrettj - Worked for me. The jsmin-php linked above is dead now.
from assetmanager.
Related Issues (20)
- Support for EventManager & ServiceManager 3.0 HOT 6
- Append last modified date to Asset View Helper even withoud cache HOT 5
- FilePathCache throws exceptions almost every release HOT 13
- AssetManager is not installable with new skeleton application HOT 8
- PHP Fatal error: Uncaught TypeError: Argument 2 passed to AssetManager\Service\AssetCacheManager::setCache() must implement interface Assetic\Asset\AssetInterface, null given HOT 8
- Bower components and image paths HOT 2
- Wrong MIME type when converting asset HOT 2
- Asset not loaded on latest ZendSkeletonFramework HOT 2
- How to create a resolver that remap extension? HOT 4
- Create Seperate "Core" repository and package HOT 8
- Caching/Processing assets without asset() view helper HOT 3
- node: Permission denied HOT 1
- How to add a response header - Last-Modified, E-Tag HOT 1
- unable to load AssetManager HOT 1
- Asset view helper not work with ZF3 with basic documentation configuration. ZF3 use his own Asset view helper. HOT 1
- asset view helper BC HOT 10
- Can't install via composer due to version locks HOT 18
- Composer Version 2x HOT 1
- packagist versions not auto updated HOT 3
- laminas/laminas-dependency-plugin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assetmanager.