-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Adapt Assetic cookbook to not suggest now-deprecated YUI Compressor #1841
Comments
I think it's a good idea to remove the Yui Compressor from the cookbooks as it is deprecated. ember.js for example doesn't work with the yui compressor anymore. That said, uglifyjs has dependencies on node.js, meaning it will get complicated and would not be a good choice for a cookbook which introduces people to how assetics work. I really like the way yui compressor can be used (download, place inside project, done). Regarding yuglify: If one is not compressing yui, there is no need to use the yuglify fork. uglify.js works well for most use cases. Maybe it would be good to make a more generic cookbook, describing how it works and let the user choose which filter to actually use. |
After some Twitter discussion with @kriswallsmith,@Seldaek and @stof, we came up with a few ideas. Firstly, nobody objected to installing npm-based modules in a Symfony project. Kris thought UglifyJS would be an OK thing to advocate for in the Cookbook. It would also require setting the Other discussion was a little more general, in how best to install npm modules to be packaged with a Symfony2 application. I'm looking for other feedback and discussion related to the install method: Install to the
|
@johnkary Actually, npm does not lock the dependencies at all. If your top-level dependency is on |
We should follow what the NPM authors suggest. My $.02… |
@kriswallsmith as I understand it here, the only thing installed via node are some build tools, as such they should be used in dev and in build, but not really for production, so I don't know if the suggestion of the FAQ applies. |
I'm also not sure if the way the npm modules should be installed is clear enough to mention in a cookbook. I for example have my vagrant box with uglifyjs installed globally, so no need to install it on a per-project basics. I am also against having tools inside the vcs, especially if they are not used for production (and I guess not many people will build their assets on a production system). |
I made a first draft https://github.com/Sgoettschkes/symfony-docs/commit/d2ed2179d5f678c018bdd4a95c619f9171b33346. Please have a look and give feedback. I chose to advocate installing the npm module globally and add a note about the local installation. I don't think we should go into details about npm and how to add it to composer, as it would complicate the issue. If this really is an issue worth discussing in a cookbook, I would opt for creating a new cookbook where issues with npm modules (uglifyjs, coffeescript) and ruby gems (e.g. sass) are discussed. |
Regarding #1099: If we move from yuicompressor to uglifyjs, there is no css involved anymore. I made some small changes in https://github.com/Sgoettschkes/symfony-docs/commit/10fa57b21485b1a128bedb2c07037383afe64601, but need some more feedback if the direction I'm going is ok. We should also think about how to minify/combine css because yui does this while uglify doesn't. I am always using sass, which can be used to minify and combine, so I don't have any idea what is used when working with vanilla css. |
I think it's good to have one article like this which gives people a great usecase of assetic. However, as stated here, we want to add a section with a list of all filters available. So, I don't think we need to worry much about which filters we are going to use in this article. |
…eguiluz) This PR was merged into the 2.3 branch. Discussion ---------- Added a note about the total deprecation of YUI | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes | Applies to | 2.3+ | Fixed tickets | - Maybe we could also close the related issue #1841? Commits ------- f5021d5 Fixed the official name of Node.js d027c80 Added a note about the total deprecation of YUI
Referring to this cookbook article: How to Minify JavaScripts and Stylesheets with YUI Compressor
YUI recently announced on their blog that YUI Compressor will soon be going through a deprecation phase and the YUI team will be switching to using custom-wrapped versions of UglifyJS and CSSMin, called yuglify and ycssmin respectively.
So now what tools should we advocate readers to use for minification? Do we follow their lead and tailor to existing Assetic filters UglifyJSFilter and CSSMinFilter? Or even wrap their custom versions?
Once decided we can adapt the existing cookbook article and probably rename it to
minify.rst
to not tie it to a product.The text was updated successfully, but these errors were encountered: