Spea / SpBowerBundle

Symfony2 Bundle to handle asset dependencies with bower
231 stars 44 forks source link

Can this be a sf-composer for assets of a project? #77

Closed matheo closed 10 years ago

matheo commented 10 years ago

I mean, I'm new using this bundle but I already like it.

What I wonder is what's the concept to process the assets of the bundles and its dependencies. I would like to know if this bundle scan all the configured sp_bower.bundles first, then it resolves the dependencies and choose the versions that fits for all of them (kinda like composer does), and copies them to an asset_dir (which maybe a global one per project instead per bundle, or not?).

A great job is done in this bundle, kudos, and you got a big hit here, handling our assets with bower :) Thanks

Spea commented 10 years ago

This bundle install bower dependencies for every configured bundle individually, but the configured asset resources may conflict with each other. I never ran into this problem, so I have to check for myself what exactly happens then.

I'm glad this bundle helps you :)

matheo commented 10 years ago

I see your bundle with the potential to be the "frontend assets composer" by excellence for complete symfony applications :) a ton of bundles relying on SpBowerBundle to use the potential of bower a'la sf!

The only suggestion I could do ATM is to not process the bundles individually, but collect all their configurations so you can try to solve any conflict globally, and have a unique asset_dir and cache. Thanks again!

Spea commented 10 years ago

As nice as this feature may sound, it will be too complex and would introduce too much issues. For example: What do you do, when you have two bundles which require the same package in a different version?

This bundle is only meant to make it easier to implement bower dependencies into symfony with assetic. If I would implement such feature I have to take care of things which are currently handled by bower itself. I would also have to duplicate some logic from bower to make this work.

However, if you have any good suggestions - or even an already working implementation - let me know :)