-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Deprecate the Templating component integration #21035
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
you also need to deprecate the TwigEngine (in the bridge and the bundle), as they are about integrating Twig in this component. |
And this requires deprecating the |
Do we want to deprecate this syntax or not? |
Well, if we don't want to deprecate it, you need to undeprecate the TemplateNameParser system in your PR. |
The |
So let's deprecate this notation. |
@javiereguiluz but we have an advantage this time, people already using Twig alone (without the templating bridge) can only use the |
Indeed, #11051 is very different. Here we are deprecating everything related to the Templating component, including the way we reference templates. There is no need to discuss how to reference templates as we are just using "pure" Twig, nothing more. |
But I think we should indeed look into #20130 and try to find a way to resolve the inconsistency if we force everyone to use the Twig schema to reference templates. |
84512fd
to
942e80b
Compare
Should the TemplatingPass be deprecated? |
942e80b
to
b4c2b91
Compare
@chalasr good catch, done. |
ac6ec3b
to
3320f5f
Compare
@@ -33,6 +36,8 @@ public function process(ContainerBuilder $container) | |||
if ($container->hasDefinition('templating.engine.php')) { | |||
$helpers = array(); | |||
foreach ($container->findTaggedServiceIds('templating.helper') as $id => $attributes) { | |||
@trigger_error('The '.self::class.' class is deprecated since version 3.3 and will be removed in 4.0. Use Twig instead.', E_USER_DEPRECATED); |
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 be even better to have this deprecation only when using the class itself and trigger something like The "templating.helper" tag is deprecated as of 3.3...
here instead?
c03495c
to
1086047
Compare
@@ -20,6 +22,8 @@ | |||
* This engine knows how to render Twig templates. | |||
* | |||
* @author Fabien Potencier <fabien@symfony.com> | |||
* | |||
* @deprecated The TwigEngine class will be removed in Symfony 4.0. You should use \Twig_Environment directly 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.
@deprecated since version 3.3, to be removed in 4.0. Use Twig instead.
(same below)
b0ef3c6
to
245ffd0
Compare
One question remains on my end : templating was giving a layer of abstraction to twig and if |
Status: needs work |
248a9c0
to
71683bd
Compare
9c96d27
to
715b7d9
Compare
715b7d9
to
7169f4d
Compare
Thank you @dunglas. |
…ntegration (dunglas, fabpot) This PR was merged into the 4.3-dev branch. Discussion ---------- [FrameworkBundle] Deprecate the Templating component integration | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a This PR deprecates the Templating component integration in FrameworkBundle. Only a few people use it because almost everybody use Twig or the serializer to output data. Removing this component will facilitate the maintenance. Commits ------- 7169f4d [Templating] added more deprecation 224c891 [FrameworkBundle] Deprecate the Templating component integration
Thanks for finishing this! |
I'm trying to make the doc changes for this. I have two questions:
# config/packages/framework.yaml
framework:
# ...
templating:
hinclude_default_template: hinclude.html.twig Thanks! |
To answer your questions (and this is just my point of view):
|
…javiereguiluz) This PR was squashed before being merged into the master branch (closes #11231). Discussion ---------- Documented the deprecation of the Templating component Documents symfony/symfony#21035 but there are some things I'm not sure about. Please, review. Commits ------- 57fadaf Documented the deprecation of the Templating component
… for PHP templating layer (yceruto) This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle][TwigBundle] Add missing deprecations for PHP templating layer | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As part of #21035 and 7169f4d Commits ------- 61613d0 Add missing deprecations for PHP templating layer
… for PHP templating layer (yceruto) This PR was merged into the 4.4 branch. Discussion ---------- [FrameworkBundle][TwigBundle] Add missing deprecations for PHP templating layer | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As part of symfony/symfony#21035 and symfony/symfony@7169f4d Commits ------- 61613d0bf0 Add missing deprecations for PHP templating layer
This PR was merged into the 5.0-dev branch. Discussion ---------- Removed support for PHP templating everywhere | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Ref: #21035 and 7169f4d **TODO:** Missing deprecations in 4.4 (#31800): - [x] `Symfony\Bundle\FrameworkBundle\Controller\TemplateController` 2nd argument. - [x] `Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer` class and service. **Labels:** `FrameworkBundle`, `TwigBundle`, `TwigBridge`, `SecurityBundle`, `Form`, `HttpKernel` Friendly ping @fabpot and @dunglas Commits ------- d5be373 Removed support for PHP templating everywhere
This PR deprecates the Templating component integration in FrameworkBundle. Only a few people use it because almost everybody use Twig or the serializer to output data. Removing this component will facilitate the maintenance.