Skip to content
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

Remove enable_yui_compressor #18

Merged
merged 1 commit into from
Feb 21, 2014
Merged

Remove enable_yui_compressor #18

merged 1 commit into from
Feb 21, 2014

Conversation

boekkooi
Copy link
Contributor

Remove enable_yui_compressor as a option since this can be handled by using assetic configuration like:

assetic:
    # java: "/usr/bin/java"
    filters:
        yui_css:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar"
            apply_to: "\.css$"
        yui_js:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar"
            apply_to: "\.js$"

This should be a better way and reduce some template and configuration code.

@janxin
Copy link
Member

janxin commented Feb 14, 2014

Would you like to take care of fixing this issue?

@janxin janxin self-assigned this Feb 18, 2014
@janxin
Copy link
Member

janxin commented Feb 18, 2014

@boekkooi I've started to look at this issue. I've removed the stylesheets assetic declaration and I've replaced it as follows:

{% stylesheets filter='cssrewrite' 'components/redkitecms/twitter-bootstrap/3.x/css/bootstrap.min.css'
                                            'components/redkitecms/font-awesome/css/font-awesome.min.css'
                                            'bundles/redkitecms/css/skins/bootstrap/skin.css'
                                            'bundles/redkitecms/css/skins/bootstrap/skin_3.x.css'
                                            'components/redkitecms/jquery-ui/themes/smoothness/*'   
                                            'bundles/redkitelabselfinder/vendor/ElFinder/vendor/jquery-ui.css'
                                            'bundles/redkitelabselfinder/vendor/ElFinder/css/elfinder.min.css'
                                            'bundles/redkitelabselfinder/vendor/ElFinder/css/theme.css'
%} 
<link href="{{ asset_url }}" rel="stylesheet" type="text/css" media="all" />
{% endstylesheets %}

then I've changed the config_rkcms.yml as follows:

assetic:
debug: %kernel.debug%
use_controller: false
bundles: [RedKiteCmsBundle]
filters:
cssrewrite: ~
yui_css:
jar: %kernel.root_dir%/Resources/java/yuicompressor.jar
apply_to: ".css$"
yui_js:
jar: %kernel.root_dir%/Resources/java/yuicompressor.jar
apply_to: ".js$"

but I've noticed it takes a long time (5 mins) to compile assets when I run assetic:dump: what I'm doing wrong?

@boekkooi
Copy link
Contributor Author

Mhh probably a problem with YUI it self. I'm using:

assetic:
    debug:          %kernel.debug%
    use_controller: false
    bundles:        [ RedKiteCmsBundle ]
    node_paths:     [/usr/lib/node_modules/]
    filters:
        cssrewrite: ~
        less:
          apply_to: "\.less$"
        uglifyjs2:
          apply_to: "\.js$"
        uglifycss:
          apply_to: "\.css$"

And it works like a charm.

What maybe a reason is that when using apply_to all js and css files that use stylesheets and javascripts (within a twig template) are compressed and this takes longer?

@boekkooi
Copy link
Contributor Author

Also are you using the latest version (https://github.com/yui/yuicompressor/releases) ?

@boekkooi
Copy link
Contributor Author

Are you currently working on this? If not I will pick it!

@janxin
Copy link
Member

janxin commented Feb 20, 2014

Yes I started to inspect it, but I will gladly let it go.

Thanks

@janxin janxin removed their assignment Feb 20, 2014
@boekkooi
Copy link
Contributor Author

Ok then I will pick it up because YUI totally destroyed my capifony deploy

This commit removes the `enable_yui_compressor` option and all related assetic yui filters.
@janxin
Copy link
Member

janxin commented Feb 21, 2014

This patch assumes to remove the yuicompressor from RedKIteCmsSandbox and let the user to choose a compressor, don't it?

janxin pushed a commit that referenced this pull request Feb 21, 2014
Remove enable_yui_compressor
@janxin janxin merged commit 4f235be into redkite-labs:master Feb 21, 2014
@boekkooi
Copy link
Contributor Author

Correct, i also added a pull for the ThemeEngineBundle (see redkite-labs/ThemeEngineBundle#1)

janxin pushed a commit that referenced this pull request Mar 11, 2014
Remove enable_yui_compressor
@boekkooi boekkooi self-assigned this Apr 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants