Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 2 commits intosymfony:masterfromdunglas:deprecate_templating_fwb
Mar 19, 2019

Conversation

@dunglas
Copy link
Member

@dunglasdunglas commentedDec 23, 2016
edited by nicolas-grekas
Loading

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/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.

jvasseur, nesl247, linaori, teohhanhui, derrabus, dmaicher, and TomasVotruba reacted with thumbs up emojiHeahDude, sstok, ro0NL, chalasr, jvasseur, apfelbox, Koc, and andreybolonin reacted with hooray emoji
@stof
Copy link
Member

you also need to deprecate the TwigEngine (in the bridge and the bundle), as they are about integrating Twig in this component.

@stof
Copy link
Member

And this requires deprecating theAppBundle:foo:bar.html.twig syntax too, as it comes from the Templating system (and this one is used)

@dunglas
Copy link
MemberAuthor

Do we want to deprecate this syntax or not?

@stof
Copy link
Member

Well, if we don't want to deprecate it, you need to undeprecate the TemplateNameParser system in your PR.

@mvrhov
Copy link

The@AppBundle/foo/bar.html.twig syntax is recommended since 2.5 or something like that.
But deprecating the symfony specific syntax might show some resistance :P

@dunglas
Copy link
MemberAuthor

So let's deprecate this notation.

@javiereguiluz
Copy link
Member

@dunglas last time we tried to deprecate that syntax (in June 2014) they almost killed us 😁 See#11051

By the way, in#20130 we discussed about a big inconsistency in the Twig syntax. Maybe we should take care of that too?

dunglas and sstok reacted with laugh emoji

@dunglas
Copy link
MemberAuthor

@javiereguiluz but we have an advantage this time, people already using Twig alone (without the templating bridge) can only use the@AppBundle syntax. We're deprecating the Templating component, other syntaxes - not supported by the Twig Bundle - will be deprecated with it. Does it looks reasonable?

javiereguiluz reacted with thumbs up emoji

@fabpot
Copy link
Member

Indeed,#11051 is very different. Here we are deprecatingeverything 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.

javiereguiluz reacted with thumbs up emoji

@xabbuh
Copy link
Member

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.

@nicolas-grekasnicolas-grekas added this to the3.3 milestoneDec 26, 2016
@xabbuh
Copy link
Member

One even more important thing: The native Twig namespace syntax as it is currently integrated in the framework fails on bundle inheritance (see#6919). Please take a look at#19586 which provides a fix.

@dunglasdunglasforce-pushed thedeprecate_templating_fwb branch from84512fd to942e80bCompareJanuary 10, 2017 22:35
@chalasr
Copy link
Member

chalasr commentedJan 13, 2017
edited
Loading

Should the TemplatingPass be deprecated?
Maybe should it trigger deprecations for each service in the loop too (i.e. taggedtemplating.*)?

@dunglas
Copy link
MemberAuthor

@chalasr good catch, done.

@dunglasdunglasforce-pushed thedeprecate_templating_fwb branch fromac6ec3b to3320f5fCompareFebruary 3, 2017 20:13
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);
Copy link
Member

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 likeThe "templating.helper" tag is deprecated as of 3.3... here instead?

@dunglasdunglasforce-pushed thedeprecate_templating_fwb branch fromc03495c to1086047CompareFebruary 5, 2017 18:59
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated The TwigEngine class will be removed in Symfony 4.0. You should use \Twig_Environment directly instead.

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)

@dunglasdunglasforce-pushed thedeprecate_templating_fwb branch 2 times, most recently fromb0ef3c6 to245ffd0CompareFebruary 13, 2017 13:12
@adrienrn
Copy link

One question remains on my end : templating was giving a layer of abstraction to twig and if@templating goes away, do we need to inject@twig directly or some other component will provide an abstraction ?

@nicolas-grekas
Copy link
Member

Status: needs work

@fabpotfabpotforce-pushed thedeprecate_templating_fwb branch 5 times, most recently from248a9c0 to71683bdCompareMarch 19, 2019 17:10
@fabpotfabpotforce-pushed thedeprecate_templating_fwb branch 3 times, most recently from9c96d27 to715b7d9CompareMarch 19, 2019 17:48
@fabpotfabpotforce-pushed thedeprecate_templating_fwb branch from715b7d9 to7169f4dCompareMarch 19, 2019 17:58
@fabpot
Copy link
Member

Thank you@dunglas.

sstok and Taluu reacted with hooray emoji

@fabpotfabpot merged commit7169f4d intosymfony:masterMar 19, 2019
fabpot added a commit that referenced this pull requestMar 19, 2019
…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/aThis 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 deprecation224c891 [FrameworkBundle] Deprecate the Templating component integration
@dunglas
Copy link
MemberAuthor

Thanks for finishing this!

@javiereguiluz
Copy link
Member

I'm trying to make the doc changes for this. I have two questions:

  1. Is using PHP templates (normal templates, form themes, etc) deprecated in 4.3 and will be removed in 5.0? If not, which are the steps needed to render PHP templates in 5.0?

  2. What will happen with config like this? Is deprecated too? Is there an alternative?

# config/packages/framework.yamlframework:# ...templating:hinclude_default_template:hinclude.html.twig

Thanks!

QuentinCurtet reacted with thumbs up emoji

@fabpot
Copy link
Member

@javiereguiluz

To answer your questions (and this is just my point of view):

  1. Yes, we will remove support for the PHP form themes and other PHP template support in 5.0. If people want to keep using them, we will need to find volunteers to create a new PHPTemplateBundle that bundles all deprecated classes and support files.

  2. We need to fix those and see where they belongs to now.

javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestApr 9, 2019
…javiereguiluz)This PR was squashed before being merged into the master branch (closes#11231).Discussion----------Documented the deprecation of the Templating componentDocumentssymfony/symfony#21035 but there are some things I'm not sure about. Please, review.Commits-------57fadaf Documented the deprecation of the Templating component
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
fabpot added a commit that referenced this pull requestJun 3, 2019
… 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 and7169f4dCommits-------61613d0 Add missing deprecations for PHP templating layer
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull requestJun 3, 2019
… 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 ofsymfony/symfony#21035 andsymfony/symfony@7169f4dCommits-------61613d0bf0 Add missing deprecations for PHP templating layer
fabpot added a commit that referenced this pull requestJun 4, 2019
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 and7169f4d**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@dunglasCommits-------d5be373 Removed support for PHP templating everywhere
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@xabbuhxabbuhxabbuh requested changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@chalasrchalasrchalasr approved these changes

+3 more reviewers

@TobionTobionTobion approved these changes

@ogizanagiogizanagiogizanagi approved these changes

@KronhyxKronhyxKronhyx approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

17 participants

@dunglas@stof@mvrhov@javiereguiluz@fabpot@xabbuh@chalasr@adrienrn@nicolas-grekas@robfrawley@Tobion@ro0NL@QuentinCurtet@kbond@ogizanagi@Kronhyx@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp