-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Added a new AppBundle to comply with Symfony Best Practices #728
Conversation
@@ -23,3 +23,6 @@ monolog: | |||
level: debug | |||
console: | |||
type: console | |||
|
|||
assetic: | |||
use_controller: false |
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 is useless, as it is already the default
Fixes issue #671 |
@gnugat updated PR description. Thanks! |
@javiereguiluz fix the filename actually |
@stof thanks! I feel really stupid right now for having made this mistake :( |
@@ -0,0 +1 @@ | |||
Homepage. |
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.
Wouldn't it make sense to extend the base template since that is also shipped with the standard edition?
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.
agreed. It would be better to make it HTML rather than returning plain text in an HTML response
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.
@xabbuh it truly makes A LOT of sense! Thanks for suggesting this improvement.
So the standard edition is going into the direction of RAD? Pretty unusable for medium to large projects. |
@Tobion what would you suggest? |
@Tobion this will be the last significant PR related to best practices for the standard edition. The only changes that we've made are:
|
I thought that's what the "editions" are for. So why not introduce a RAD edition? If the RAD version is the standard-edition then, most advanced people will just be busy deleting the AppBundle again. Just as it was for the DemoBundle. |
This PR also conflicts with #723 |
@Tobion I think we have different opinions about what is a RAD edition: you think that this PR may turn the standard edition into a RAD edition. I think that a RAD edition should be much more heavily modified, like the one developed by KnpLabs (rad.knplabs.com). The other point where we don't agree is where you say that this AppBundle is unusable for medium to large projects. And finally, I think that there is a big difference between AcmeDemoBundle and AppBundle. The demo bundle is useful to almost nobody (only some newcomers) and the AppBundle can be useful for lots of people (newcomers, small projects, medium projects, people following the best practices, etc.) |
@@ -0,0 +1,3 @@ | |||
app: | |||
resource: @AppBundle/Controller/ |
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.
should be "@AppBundle/Controller/"
I would propose to merge this into 2.3 actually. The best practices are for everyone, not people living on the edge. We'll also have a problem in the documentation when only 2.6+ has the AppBundle. We should assume one consistent state of new projects, currently we can't do that. That'll result in either confusing docs or many extra doc maintaining hours. |
symfony 2.6 just released, I think it need to be merge then to support symfony best practice that said : "If you are using Symfony 2.6 or a newer version, the AppBundle bundle is already generated for you". |
Thank you @javiereguiluz. |
@fabpot it is need to be included in tag with 2.6.0, isn't it ? |
👍 |
…ces (javiereguiluz) This PR was squashed before being merged into the 3.0-dev branch (closes #728). Discussion ---------- Added a new AppBundle to comply with Symfony Best Practices | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #671 | License | MIT | Doc PR | - Symfony Best Practices recommend to start developing your applications with a single AppBundle bundle. This PR allows to include that AppBundle in the Symfony Standard Edition, to make it easier for developers. I used the same skeleton as for the `generate:bundle` command, but I thought that it would be better to simplify it and remove the `$name` route parameter and use just a static template without parameters. Commits ------- 45da0d0 Added a new AppBundle to comply with Symfony Best Practices
* 2.3: feature #728 Added a new AppBundle to comply with Symfony Best Practices (javiereguiluz)
* 2.5: feature #728 Added a new AppBundle to comply with Symfony Best Practices (javiereguiluz)
* 2.6: feature #728 Added a new AppBundle to comply with Symfony Best Practices (javiereguiluz) fixed Symfony version dep updated VENDORS for 2.6.0-BETA2 Conflicts: composer.json
* 2.7: feature #728 Added a new AppBundle to comply with Symfony Best Practices (javiereguiluz) fixed Symfony version dep updated VENDORS for 2.6.0-BETA2
👎 but the wiping out the AppBundle is annoying experience in new projects if you want to create your own bundle(s) I don't think that anyone prefer to rename bundle dir, route, class, the include in AppKernel rather than just generate new bundle in empty environment that's my position I hope it will be wiped cleanly out in 2.7 and sure in 3.0 there's too much attention for bundle generation in docs to leave it as it was all time So, my proposition is to ask user for creation of AppBundle (without vendor namespace and so on) just as like as asking about AcmeHelloBundle you know… thank you all |
Could you please explain your vote, @velikanov? |
@velikanov the goal is to update the doc to remove the need of generating a bundle, to make things easier to create new projects. It is just that the doc updates are still in progress |
@stof, maybe I don't get the full idea |
@velikanov a bundle generator means that newcomers have an extra step to do before being able to start. And given that the best practices are saying to call it AppBundle anyway, the command would be the same for everyone |
@velikanov we add a pre-generated In any case, we are always careful about adding new things or pre-configuring things. We don't want to be "too clever" or to "outsmart our users", because most of the times, when you try to do that, you fail. So thanks for your comment and please, don't hesitate to point to us whenever you think we are doing unnecessary things. |
@stof, @javiereguiluz, I didn't ever create an AppBundle :( |
Although i'm +1 for the app bundle, imho situations like this one could be solved by giving the posibility to customize the name of the first bundle via an install interaction that defaults to "AppBundle" right? |
@velikanov well, instead of naming it CoreBundle, it's AppBundle :) The thing is, now we have the best practices and people have accepted it, an AppBundle will be used a lot. It's not "just for beginners", it's for everyone (even complex apps benefit a lot of having 1 not decoupled bundle instead of 10). I don't think adding yet another question to the installation process is the solution. I believe this is just another point where people have to realize that it's just the SE. There is nothing that makes you bind to this edition, except that it's the one used in the docs. If you don't like something, create a fork and start your own edition. |
@wouterj, I know that my voice will completely not turn the decision, but I will never agree this) |
but, my words is like old man grumbling, don't take it serious) |
but anyway 👎, sorry |
@velikanov I suggest you to read http://knpuniversity.com/blog/AppBundle where @weaverryan explains the reasonning about the AppBundle (watching him talk about this at the SymfonyCon would be even better, but the videos are not yet online) |
@stof, yep I did and can't agree with this whole thing :( |
I was a bit skeptical about AppBundle when I saw this new "feature", but in fact, the AppBundle would have been something I may have needed when I started Symfony 2 years ago. After reading @weaverryan's article you posted @stof, I'm starting to think that the AppBundle is really a GREAT thing ! In fact, any new app can or cannot use it, and like the AcmeDemoBundle, it's simply a matter of personal judgement. @velikanov you can also see the documentation about When you know Symfony, and when you need a "bigger" app, then just use the classical Bundle structure, remove the AppBundle like you would have removed the AcmeDemoBundle before. As you can create a PHP app from-scratch without framework, you can create a Symfony app without any bundle, that's why AppBundle is great : it allows you to start doing messy stuff by putting everything in the same directory, for you to learn really better how to have a good architecture. I hope I understood well how the AppBundle was born 😄 |
👍 |
Symfony Best Practices recommend to start developing your applications with a single AppBundle bundle. This PR allows to include that AppBundle in the Symfony Standard Edition, to make it easier for developers.
I used the same skeleton as for the
generate:bundle
command, but I thought that it would be better to simplify it and remove the$name
route parameter and use just a static template without parameters.