-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
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(') |
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.
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)
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.
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.
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.
At least the BC break should be documented in the CHANGELOG & UPGRADE files I'd say.
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.
what about doing the check at compile time? ie using $compiler->getEnvironment()->getRuntime()
?
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.
added the check at compile time
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.
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?
src/Symfony/Bridge/Twig/CHANGELOG.md
Outdated
3.4.0 | ||
----- | ||
|
||
* deprecated `Symfony\Bridge\Twig\Form\TwigRenderer` |
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.
there should be a space in front of the *
character
a7bfeaf
to
6138874
Compare
@@ -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. |
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.
a runtime deprecation notice is missing at the beginning of the file
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.
fixed
ping @Tobion |
6138874
to
6ea71cb
Compare
Thank you @Tobion. |
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