Why should not a Symfony2 bundle embed third-party libraries

Bundle Structure and Best Practices:

A bundle should not embed third-party libraries written in JavaScript, CSS, or any other language.

Why shouldn't i create for example a bootstrap, or jQuery bundle?

I think it would be easier to maintain if all third-party CSS and JavaScript libraries live in their own bundle.

Answers


Well, for one, It's counter-intuitive. Symfony Bundles are for packages of PHP functionality and you're talking about bundling up front-end libraries.

Secondly - why would it be easier? Things like bootstrap and jQuery are public resources to begin with - they don't need a distributable bundle to achieve high re-use. PHP resources are not public and therefore benefit from this type of system.


The chaos comes when two or more bundles uses the same 3rd party library but different versions. A user of your bundle won't be able to choose which library to include and therefore can't use both bundles at the time.

It's fine to store them in a bundle folder if your bundle is a standalone application, i.e. your application's main bundle. For example, SonataAdminBundle includes 3rd party libraries: bootstrap.css, qtip, famfamfam icons.


look at MopaBootstrapBundle https://github.com/phiamo/MopaBootstrapBundle it integrates TwitterBootstrap & jQuery lib for you, also HTML5BoilerPlate if you enable initializr addon.


Need Your Help

What is the right approach to checksumming UDP packets

.net mono cross-platform network-programming udp

I'm building UDP server application in C#. I've come across a packet checksum problem.