9

As you know, in Symfony2.1 php bundles and packages are managed by composer, but would be maybe a good idea to hook up the managing of web assets as well? I would really love to update Twitter Bootstrap, jQuery, jQueryUi, Underscore.js and many other libraries using the same console command i use to update the php packages.

Are there any serious downsides of doing this?

1
  • UPDATE: I ended up using Bower in my sf2 projects and so far i'm happy with it :) Thx for suggestions!
    – Vlad
    Mar 2, 2014 at 16:20

1 Answer 1

4

Well, it sounds like a great idea, but I don't think it would be possible:

  1. Composer is created for handling PHP dependencies, not for handling front-end dependencies, the twitter team has created Bower for front-end dependencies.
  2. Combining those 2 great libraries is a huge task: You will need to create your own composer commands and configuration files.
  3. Bower puts everything in a components directory. This isn't the correct dir for web assets, you will need to change this. You can't change this in the Bower config, as far as I know about Bower, which is almost equal to zero. UPDATE As said by @xanido, you can configure the output directory with the directory option as of Bower 0.3.0.

So well, you can manage web assets in Symfony2, with Bower (and maybe other programs like that), but combining those 2 isn't a good practise. Use Bower and Composer seperately can be useful, although you get another web assets directory.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.