Skip to content

[TwigBridge] deprecate TwigRenderer #23437

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

Merged
merged 1 commit into from
Jul 17, 2017
Merged

Conversation

Tobion
Copy link
Contributor

@Tobion Tobion commented Jul 6, 2017

Q A
Branch? 3.4
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #22783 (comment)
License MIT
Doc PR

@@ -28,7 +28,7 @@ public function compile(Compiler $compiler)
{
$compiler
->addDebugInfo($this)
->write('$this->env->getRuntime(\'Symfony\Bridge\Twig\Form\TwigRenderer\')->setTheme(')
->write('$this->env->getRuntime(\'Symfony\Component\Form\FormRenderer\')->setTheme(')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break if the registered runtime still is Symfony\Bridge\Twig\Form\TwigRenderer, right? (by only using the bridge, not the bundle, i.e not in a symfony full stack app)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly. Not sure if that needs to be handled. The only solution I see is to catch the Twig_Error_Runtime and then retry with the old TwigRenderer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least the BC break should be documented in the CHANGELOG & UPGRADE files I'd say.

Copy link
Member

@nicolas-grekas nicolas-grekas Jul 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about doing the check at compile time? ie using $compiler->getEnvironment()->getRuntime()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the check at compile time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I added the check to the FormThemeNode. But doesn't the same apply to all nodes? E.g. RenderBlockNode and even the FormExtension using new TwigFunction('csrf_token', array('Symfony\Component\Form\FormRenderer', 'renderCsrfToken')), that wouldn't work if the user manually used the TwigRenderer?

@xabbuh xabbuh added this to the 3.4 milestone Jul 7, 2017
3.4.0
-----

* deprecated `Symfony\Bridge\Twig\Form\TwigRenderer`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be a space in front of the * character

@Tobion Tobion force-pushed the deprecate-twigrenderer branch from a7bfeaf to 6138874 Compare July 7, 2017 10:07
@@ -17,6 +17,8 @@

/**
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @deprecated since version 3.4, to be removed in 4.0. Use Symfony\Component\Form\FormRenderer instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a runtime deprecation notice is missing at the beginning of the file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@nicolas-grekas
Copy link
Member

ping @Tobion

@Tobion Tobion force-pushed the deprecate-twigrenderer branch from 6138874 to 6ea71cb Compare July 17, 2017 12:03
@fabpot
Copy link
Member

fabpot commented Jul 17, 2017

Thank you @Tobion.

@fabpot fabpot merged commit 6ea71cb into symfony:3.4 Jul 17, 2017
fabpot added a commit that referenced this pull request Jul 17, 2017
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] deprecate TwigRenderer

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #22783 (comment)
| License       | MIT
| Doc PR        |

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the 3.4,
  legacy code removals go to the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

6ea71cb [TwigBridge] deprecate TwigRenderer
@Tobion Tobion deleted the deprecate-twigrenderer branch July 17, 2017 12:51
This was referenced Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants