-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Assetic fixes #1991
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
Assetic fixes #1991
Conversation
It is empty by default on new Symfony installations, which prevents all the @AsseticFooBundle examples from working.
For the above example to work, you must either add your bundle to the list | ||
of bundles that Assetic is allowed to handle (which is *none* in a default | ||
Symfony installation), or remove the bundle list from the configuration | ||
altogether: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't advocate removing the list entirely, as it mean AsseticBundle would scan all bundles for assetic tags, which is slow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I didn’t know. Will fix.
|
||
# app/config/config.yml | ||
assetic: | ||
debug: "%kernel.debug%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%kernel.debug%
is the default value for the assetic.debug
setting, so I think this line isn't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in the config like this in the standard distribution though so its in keeping with that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small detail either way, but what I'd love the most is to use the # ...
in this spot:
assetic:
# ...
bundles: [ AcmeFooBundle ]
filters:
# ...
Also, is this new note actually correct yet? My impression is that you don't need to add your bundle to the bundles
configuration until you place a stylesheets
or javascripts
tag into a template that lives inside that bundle. If your stylesheets
or javascripts
tags are only in a template in app/Resources/views
(even if you're referencing CSS/JS files that are in some bundle), then you don't need to add the bundle to the bundles
key.
If I'm wrong, some please shout at me! :) I just wanted to make sure we were clear on that before merging.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My impression is that you don't need to add your bundle to the bundles configuration until you place a stylesheets or javascripts tag into a template that lives inside that bundle.
I strongly suspect that you are correct. It makes a lot more sense to me now. I’ll make some tests next week and rewrite accordingly.
ping! @oscherler :) |
assetic: | ||
debug: "%kernel.debug%" | ||
use_controller: false | ||
bundles: [ AcmeFooBundle ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be [AcmeFooBundle]
ping again! @oscherler :) |
@weaverryan Hi. I’m super-busy right now, but if everything goes well I should be able to deal with this (and hopefully tackle a couple more things, since I’ve been using Symfony a lot lately) during February. |
@weaverryan And I totally missed your previous ping. Sorry. |
(By the way, to avoid confusion, I’m both oscherler and gm-olivier: silly me pushed the commits with the wrong git config). |
Hi @oscherler! Ok! A few notes:
So, here's what we're going to do :). I've opened a new PR - #2263 - against the 2.0 branch which includes your commit about the Let me know if that works for you - the 2 things you've added here are indeed very important notes to have, so I appreciate you putting this together! Thanks! |
@weaverryan note that |
@weaverryan Sounds good to me. :) So in the future, when I make a pull request, I target the 2.0 branch if it also applies to Symfony 2.0, and the 2.1 branch otherwise? |
@oscherler when you are documenting a new feature, you choose the branch in which the feature was added (2.0 for Sf2.0.x, 2.1 for Sf2.1.x, master for Sf2.2.x (a 2.2 branch will be created in the coming weeks)). Otherwise, you choose the 2.0 branch. Once in a week, all branches will be merged into each other which means that a bug fixed in the 2.0 branch will also be fixed in 2.1 and master. |
Two additions to hopefully help newcomers:
bundles
option in the Assetic configuration defaults to[]
, it must be changed, one way or another;cssrewrite
filter does not work with the@AsseticFooBundle
syntax, so a workaround is proposed.I have not included the other formats besides YAML for the config file because I’m not comfortable enough with them and the AsseticBundle Configuration Reference only includes YAML. I have not tested the PHP version of the example for the output parameter.
Of course, I will gladly update this based on suggestions.