Giter Club home page Giter Club logo

Comments (27)

jarrettj avatar jarrettj commented on July 26, 2024 1

@Committing Thanks man, I changed link to search in packagist instead :)

from assetmanager.

RWOverdijk avatar RWOverdijk commented on July 26, 2024

This is also in the readme. None of those are included, you should add them yourself.

from assetmanager.

DmitryVarennikov avatar DmitryVarennikov commented on July 26, 2024

Can you provide an example cause I cannot get this to work. I cannot find neither \JSMin not \CssMin components

from assetmanager.

RWOverdijk avatar RWOverdijk commented on July 26, 2024

kriswallsmith/assetic#300
https://github.com/douglascrockford/JSMin

from assetmanager.

Ocramius avatar Ocramius commented on July 26, 2024

@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.

DmitryVarennikov avatar DmitryVarennikov commented on July 26, 2024

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.

Ocramius avatar Ocramius commented on July 26, 2024

@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.

RWOverdijk avatar RWOverdijk commented on July 26, 2024

I think they left it opt-in because you won't always use them.

from assetmanager.

Ocramius avatar Ocramius commented on July 26, 2024

Yeah, even in assetic, it would just be in the suggests section of composer.json

from assetmanager.

DmitryVarennikov avatar DmitryVarennikov commented on July 26, 2024

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.

RWOverdijk avatar RWOverdijk commented on July 26, 2024

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.

DmitryVarennikov avatar DmitryVarennikov commented on July 26, 2024

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.

RWOverdijk avatar RWOverdijk commented on July 26, 2024

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.

Ocramius avatar Ocramius commented on July 26, 2024

@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.

RWOverdijk avatar RWOverdijk commented on July 26, 2024

@Ocramius Thanks for the nice explanation. I should have started with that...

from assetmanager.

DmitryVarennikov avatar DmitryVarennikov commented on July 26, 2024

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.

Ocramius avatar Ocramius commented on July 26, 2024

@dVaffection edit the paragraph according to what you understand best then :)

from assetmanager.

RWOverdijk avatar RWOverdijk commented on July 26, 2024

Already done.

from assetmanager.

DmitryVarennikov avatar DmitryVarennikov commented on July 26, 2024

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.

Ocramius avatar Ocramius commented on July 26, 2024

@RWOverdijk great! :)

@dVaffection that's not how github works ;)

from assetmanager.

RWOverdijk avatar RWOverdijk commented on July 26, 2024

@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.

javier22 avatar javier22 commented on July 26, 2024

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.

RWOverdijk avatar RWOverdijk commented on July 26, 2024

@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.

javier22 avatar javier22 commented on July 26, 2024

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.

RWOverdijk avatar RWOverdijk commented on July 26, 2024

Perhaps. Or make the filter class configurable. You're allowed to set custom filters for the asset manager.

from assetmanager.

jarrettj avatar jarrettj commented on July 26, 2024

Thanks @RWOverdijk. For anyone using composer, linkorb/jsmin-php worked for me. https://packagist.org/search/?q=jsmin-php.

from assetmanager.

Committing avatar Committing commented on July 26, 2024

Cheers @jarrettj - Worked for me. The jsmin-php linked above is dead now.

from assetmanager.

Related Issues (20)

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.