-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Stripping down framework-bundle #15748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Well if it bothers you so much, then I recommend, that you build your app from empty composer.json. |
@mvrhov The problem is, that if you need the framework bundle you will get all those dependencies that you don't necessarily need. |
@mvrhov: I will. But it will require me to create and test a bundle that integrates only the minimal component and use it place of framework-bundle. Which is a bit of a shame. I'd much rather have this gets solved 'the official way'. |
+1 for making those dependencies optionals, most of them are completely useless when building a REST API application for example. @dunglas any opinion about this regarding ApiPlatform? |
@kleijnweb I was thinking about something similar recently, here's my conclusion on the matter. Generally choices are made to make Symfony easier for new comers (e.g. Standard Edition including all Symfony components). If you have specific need, you can strip down the dependencies. I'd be glad if the two solutions would be provided (e.g. a full-stack edition and a micro-edition) but I guess it makes things harder to maintain. On the other hand we, as a community, can provide our own editions. Which led me to the same issue you're exposing: the FrameworkBundle itself is in the same position (embeds as much dependencies as possible to be more appealing to new comers). I've played a bit with the idea of creating a MicroFrameworkBundle that would do the strict minimum (HTTP, routing, events and caching), but community bundles usually set The alternative would be to extract the extra dependencies of FrameworkBundle into separate bundles, but that would be a big BC break (I guess). I'm really looking forward to @weaverryan's talk at the up coming SymfonyCon to see if they're a solution for this. |
I'll take a crack at stripping it down myself when I find the time. From the looks of it, there really wouldn't be much "own code" left once you strip all the "niceties". Leaving "Open" for anyone else's 2 cents. |
I don't think stripping dependencies is a big problem for newcomers because they will most likely require the full stack symfony package (because it is what the standard edition do) and get them anyway. |
I agree, and as I suggested, you can keep the deps for framework-bundle intact by making it depends on a new, optional deps free, Composer package. No dependents would break. |
+1 for this.
|
@jvasseur the issue is the BC break for third-party bundles. currently, they can all rely on the fact that FrameworkBundle provides the |
@stof So what are your thoughts on splitting it, keeping deps for framework-bundle intact but by way of a parent package? |
I like the idea of a Symfony edition with minimal dependencies. @stof If BC is the problem, would stripping down the dependencies be an option for the master (aka 3.0) branch? The upgrade path for such applications would be very easy as they would simply need to add the dependencies they're missing. |
@derrabus but this would mean that we would have to create a ton of bundles providing the different core services you would remove from the core, to allow bundles to depend on them (while still having a single service, and not one per bundle needing the feature). This would not be a good developer experience IMO. |
@stof as suggested above, we could use |
@stof I don't want to remove anything from core and neither would I create individual bundles for core components. I just think that it's pointless to have the e.g. Templating component pulled as a dependency of FrameworkBundle if I can disable templating completely. |
+1 for different new Symfony editions. 👍 |
Been a while, anyone want to weigh in on this or should I consider it a lost cause? |
I've created a POC to see what it would look like: MicroFrameworkBundle |
I'm working on this one. First PR that goes this way is #20067 |
That's good news :) |
…cy on FrameworkBundle (fabpot) This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] removed the Asset component dependency on FrameworkBundle | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no (except for people using FrameworkBundle without requiring symfony/symfony which should be pretty rare; and fixing this is easy by adding symfony/asset explicitly) | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15748 partially | License | MIT | Doc PR | n/a Trying to reduce the number of required dependencies on FrameworkBundle. This PR removes the Asset component from the list. Commits ------- 1dd4e21 [FrameworkBundle] removed the Asset component dependency on FrameworkBundle
…pendency on FrameworkBundle (fabpot) This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] removed the Translation component dependency on FrameworkBundle | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no (except for people using FrameworkBundle without requiring symfony/symfony which should be pretty rare; and fixing this is easy by adding symfony/translation explicitly) | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15748 partially | License | MIT | Doc PR | n/a Another PR to reduce the number of required dependencies on FrameworkBundle. This PR removes the Translation component from the list. Commits ------- a496a2a [FrameworkBundle] removed the Translation component dependency on FrameworkBundle
…endency on FrameworkBundle (fabpot) This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] removed the Templating component dependency on FrameworkBundle | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no (except for people using FrameworkBundle without requiring symfony/symfony which should be pretty rare; and fixing this is easy by adding symfony/templating explicitly) | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15748 partially | License | MIT | Doc PR | n/a Another PR to reduce the number of required dependencies on FrameworkBundle. This PR removes the Templating component from the list. I made most of the work in previous version, so this change is really just about adding a good error message when templating is not enabled. For the record, this is also in the path of making possible to use Symfony with Twig without using the Templating component indirection (I think that this is in fact the last step). Commits ------- b3de62f [FrameworkBundle] removed the Templating component dependency on FrameworkBundle
…ty CSRF component dependencies on FrameworkBundle (fabpot) This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] removed the Security Core and Security CSRF component dependencies on FrameworkBundle | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no (except for people using FrameworkBundle without requiring symfony/symfony which should be pretty rare; and fixing this is easy by adding symfony/security-core and symfony/security-csrf explicitly) | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15748 partially | License | MIT | Doc PR | n/a Another PR to reduce the number of required dependencies on FrameworkBundle. This PR removes the Security Core and CSRF components from the list. Commits ------- d703784 [FrameworkBundle] removed the Security Core and Security CSRF component dependencies on FrameworkBundle
… dependency on FrameworkBundle (fabpot) This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] removed the Doctrine Annotations lib dependency on FrameworkBundle | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | yes (fixing this is easy by adding doctrine/annotations explicitly) | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15748 partially | License | MIT | Doc PR | n/a Another PR to reduce the number of required dependencies on FrameworkBundle. This PR removes the Doctrine annotations library from the list. Commits ------- c2d8356 [FrameworkBundle] removed the Doctrine Annotations lib dependency on FrameworkBundle
There are quite a number of dependencies in symfony/framework-bundle that should be optional.
Don't need it when building an app without GUI.
Don't need when I don't want to include any sort of access control
Don't need it unless I have forms. Which is an optional requirement in the form (pardon the pun) of symfony/form. Even if you keep security-core, this should go unless you have symfony-form.
I may not want to use annotations.
I might not care about translations
Why is this not in require-dev?
Again, without a GUI I don't really need this.
Anyone sharing this opinion or should I create my own symfony-minimal-framework-bundle if I want something less 'standard distribution'-like?
Possible solution would be extracting the other deps into something like symfony/core-framework-bundle and have symfony/framework-bundle depend on that. Then packages depending on framework-bundle would not suddenly have to deal with missing deps.
The text was updated successfully, but these errors were encountered: