-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Templating] Deprecate the component #21036
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
Conversation
@dunglas are you sure ? The Templating component is still useful. I remember the core team wanted to remove it from framework, this didn't mean remove it from organization or deprecate it: am I wrong ? |
@mickaelandrieu twig is first-level citizen for about two years already. I think the purpose is to remove unneccessary abstraction layer from templating to twig in the future for 4.0 http://symfony.com/blog/new-in-symfony-2-7-twig-as-a-first-class-citizen |
I agree to remove abstraction from full edition, but I don't think we should deprecate the component as a component: there is life outside of full edition! And regarding the download stats we can already say that the components are more used outside the full edition :) |
Do we want to deprecate the PHP templating system or the Templating component? Those are 2 very different things. Imo, the templating component/abstraction still makes sense. The PHP templating might be deprecated though, as the general opinion in the community seems to be in favor of removing it. |
@wouterj 👍 yes, as we didn't use PHP templating anymore, it makes sense to remove every PHP template from FrameworkBundle. I have a use case in favor of keeping Templating component: actually, PrestaShop project is using both Smarty and Twig engines. For now, integrators can "only" use Smarty to make their own themes and plugins, but the idea is to migrate everything to Twig, if we can do it smoothly, ie without break all the things again. Note we are still using Symfony2, but this kind of deprecation can stop a future migration to Symfony3. I guess PHPBB team may have the same needs too. To sum up what I suggest:
Wdyt ? |
I think keeping it alive (like it was done with |
Note that even deprecated, the component will be maintained until the end of 3.4LTS support, that means another 4 years from now. |
1f6e0e4
to
ac7c877
Compare
Just a +1 from a "bystander" for keeping general support for alternative templating engines, i'm currently working on bringing TYPO3's Fluid templating engine to Symfony :) |
@symfony/deciders Should we keep this component indefinitely even if it isn't integrated in FrameworkBundle anymore or should we deprecate it? |
Components have a life outside the framework :) Regarding the download statistics, the framework only represent 10℅ of the Symfony ecosystem. Also, I've never seen such big effort to maintain this component: so why do you want to deprecate it? We don't ask new features from Core team, only to keep up to date and report security issues if any :/ |
As pointed out by @nicolas-grekas, this component will still be supported 4 years. If even Symfony itself doesn't use it, and if it doesn't allow anymore to integrate other template engines with Symfony ; I don't get the point of using this component in a third party project. |
If I correctly understand the intent of this PR, it is removing the ability to easily integrate other templating engines with Symfony. If that is the case, this PR is a firm 👎 from me. As I understand it, this component doesn't require a huge amount of overhead in terms of maintenance, so what exactly is the intention or motivation for removal of the component @dunglas? |
@dunglas it will be up to component' users to make the bridge with Symfony framework if they want to use it in a "framework context" if the core team doesn't want to support this feature anymore. But if the component is deprecated, the right answer for "can we use PHP/Smarty/Blade/xXx in Symfony (framework)" will become "no" instead of "yes but need some work". This is a really big difference from technical & business point of view! Also, deprecate a component because it's not used in framework may be seen as a very bad news: should we expect a deprecation of every dependency removed from FrameworkBundle? |
@mickaelandrieu Stop the FUD :) |
really ? o_O meh do what you want, I'm done. |
I like the idea of Symfony supporting only Twig out-of-the-box ... and I agree with deprecating this component. However, just to know how to update the Symfony Docs, could you please tell me if it will be possible to use PHP/Smarty/Blade/... with Symfony after this change and a general overview of how to achieve that? Thanks! |
Well, as Symfony is 100% DIC based: Create a When this component is not deprecated, you would create a |
/** | ||
* DelegatingEngine selects an engine for a given template. | ||
* | ||
* @author Fabien Potencier <fabien@symfony.com> | ||
* | ||
* @deprecated The DelegatingEngine class will be removed in Symfony 4.0. You should use Twig instead. |
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.
the annotations should be rewritten as
@deprecated since version 3.3, to be removed in 4.0. You should use Twig instead.
this will make notices raised by DebugClassLoader a bit better/consistent.
Status: needs work |
@fabpot can you share some hints about the direction you'd like this to take? |
This PR was merged into the 3.4 branch. Discussion ---------- Remove templating layer from standard edition Also works without it as `\Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait::render` will just use twig directly then. Whether we deprecate or not deprecate the templating layer (symfony/symfony#21036) we should still promote not to use it by default. Commits ------- c243457 Remove templating layer from standard edition
I'm closing this one as I don't think there is a need to deprecate this component, just the integration with framework bundle, which is done in another PR. |
Follows #21035.