Responding to KnpRadBundle feedback

Published on

Mar 1, 2012

technical

Mar 2, 2012 − So, it has been two weeks since we released our biggest experiment with Symfony2 to date - KnpRadBundle. We've been listening to your awesome feedback and we think that it's about time to respond ;-)

So, it has been two weeks since we released our biggest experiment with Symfony2 to date - KnpRadBundle. We've been listening to your awesome feedback and we think that it's about time to respond ;-)

What is KnpRadBundle? - you might ask. KnpRadBundle is the central and single custom piece of the Symfony2 RAD edition. It adds a custom autoloadable kernel and application bundle knowledge into Symfony2, and some other neat features which you can read about on the official site.

But first, let us explain why this project was started in the first place. The simple answer is: just because it's a fun experiment and a chance to make something better in a technology that we love and use everyday. You see, we are strong believers in the idea that if you want to really make something better, sometimes you need to break things that already work and learn from the feedback. And the feedback was amazing. Because of this experiment we know that there are ways to make our beloved framework even more awesome. And that's exactly what we've started to do thanks to your support!

Resources folder removal

The Resources folder removal was the most controversial change in our edition. And we knew about that even before releasing it. We released the bundle that way because we were not sure about how optimal the application structure was. And your feedback has shown that in some cases, it is not optimal. And actually, this comment describes our exact feelings about the Resources folder.

And today, we're reverting it back. Why? Because there are some cases where the compatibility and stability of a project is more important than workflow optimizations. And that's exactly the case here. In the current implementation, Symfony2 has hardcoded paths to bundle resources almost everywhere. It means, that in order to change the folders structure, we would need to override all those Symfony2 commands, extensions and compiler passes. It created a divide in our codebases and introduced BC breaks with some bundles.

So, we're reverting simply because the new folder structure is not possible with the current Symfony2 codebase. But we are also, sending a PR to the Symfony2 core in order to make this change possible in future versions. Which will make the original framework core cleaner and more extendible.

config vs app

Another interesting thing that we did with our edition was the renaming of the app folder to config. Because in the Rad edition it's mostly about configs now - but not only configs. You are still able to put the Resources folder into your config and redefine some bundle resources. And yeah, config/Resources does look strange! It also possibly leads to problems for newcomers, since all the documentation states that configs are inside the app/config folder and the kernel is inside app/AppKernel.php. So we're moving this back by renaming config to app and config/bundles to app/config. The kernel configuration now lives inside app/kernel.yml. This was not a big change and didn't really introduce more RAD into your project, so we hope nobody will regret this change.

Symfony2 Console

We strongly believe that the tools you use most often should live in the nearest possible places. That's why we moved the console script into the root. But why did we rename it to sf ? Because we don't like to use a lot of keystrokes when calling the most used tool in the project. And when you have both console and config - autocompletion doesn't help as much as it could. Since we've renamed config back to app - it's not a problem anymore and now, you'll have console and tconsole scripts in your project root instead of the cryptic sf and sft.

Assetic Pipeline

Some have stated that it was the biggest change in KnpRadBundle. It wasn't ;-) But it was surely the most fun one. And now that I'm (everzet) a core Assetic team member, I'm working currently on bringing this awesomeness to all Symfony2 users out there by moving the Pipeline stuff into Assetic core!

Thank you for the Feedback!

So, thank you for taking the time to share your thoughts on the KnpRadBundle, we've enjoyed reading them and using them to grow and improve what we feel is an awesome bundle.

Written by

KNP Labs
KNP Labs

Comments