-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] Fix upgrade/changelog notes #21022
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
50acc02
to
d2d59f1
Compare
@@ -134,7 +134,10 @@ TwigBridge | |||
---------- | |||
|
|||
* Deprecated the possibility to inject the Form Twig Renderer into the form | |||
extension. Inject it into the `TwigRendererEngine` instead. | |||
extension. Inject the Twig Environment into the `TwigRendererEngine` and load | |||
the Twig Renderer using the Twig FactoryRuntimeLoader 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.
I would use the class name here. And we should probably also mention that you need Twig 1.30 for it.
b765377
to
455f105
Compare
Added a before/after 8000 in upgrade files, flagged the change as BC break in the changelog and fixed @xabbuh's line note |
@@ -186,8 +186,36 @@ Translation | |||
TwigBridge | |||
---------- | |||
|
|||
* The possibility to inject the Form Twig Renderer into the form extension | |||
has been removed. Inject it into the `TwigRendererEngine` instead. | |||
* Removed the possibility to inject the Form `TwigRenderer` into the form extension. |
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.
Missing space before *
?
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.
oops, fixed
455f105
to
cfd2e44
Compare
@@ -5,8 +5,10 @@ CHANGELOG | |||
----- | |||
|
|||
* added `AppVariable::getToken()` | |||
* Deprecated the possibility to inject the Form Twig Renderer into the form | |||
extension. Inject it on TwigRendererEngine instead. | |||
* [BC BREAK] Deprecated the possibility to inject the Form `TwigRenderer` into the form extension. |
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 deprecation is not a BC break. This is the whole point of deprecation: the old way still works.
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 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.
@chalasr : Thus, maybe don't mention it anymore as a deprecated possibility? 😅
[BC BREAK] Injecting the Form
TwigRenderer
into theFormExtension
does not work anymore.
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.
Passing the argument still works until 4.0, the deprecation is technically valid on the method scope as calling it won't break, hence the keep of the mention. What breaks is the behavior around it, and only when using the extension outside of the full stack framework.
Updated:
[BC BREAK] Injecting the Form
TwigRenderer
into theFormExtension
is deprecated and has no more effect.
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.
Well, the BC break is that you have to configure a runtime loader for the 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.
I would also add the code example to the changelog. In fact, you will probably only need the example if you are not using the full-stack framework. But then, you will also not have the upgrade files, but read the changelog 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.
Indeed, I moved the BC break to its own line and added the example
cfd2e44
to
5934b8b
Compare
$twig->addExtension(new FormExtension()); | ||
``` | ||
|
||
* Deprecated the `TwigRendererEngineInterface` interface, will be removed in 4.0. |
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.
it will be removed [...]
```php | ||
$rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig); | ||
$twig->addRuntimeLoader(new Twig_FactoryRuntimeLoader(array( | ||
Renderer::class => function () use ($rendererEngine, $csrfTokenManager) { |
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.
TwigRenderer::class
```php | ||
$rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig); | ||
$twig->addRuntimeLoader(new Twig_FactoryRuntimeLoader(array( | ||
Renderer::class => function () use ($rendererEngine, $csrfTokenManager) { |
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.
TwigRenderer::class
a34a899
to
dd6c21e
Compare
|
||
```php | ||
$rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig); | ||
$twig->addRuntimeLoader(new Twig_FactoryRuntimeLoader(array( |
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.
\Twig_FactoryRuntimeLoader
|
||
```php | ||
$rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig); | ||
$twig->addRuntimeLoader(new Twig_FactoryRuntimeLoader(array( |
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.
\Twig_FactoryRuntimeLoader
// ... | ||
$rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig); | ||
// require Twig 1.30+ | ||
$twig->addRuntimeLoader(new Twig_FactoryRuntimeLoader(array( |
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.
\Twig_FactoryRuntimeLoader
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
dd6c21e
to
a7ebe9c
Compare
👍 Status: Reviewed |
Thank you for your reviews @xabbuh |
This PR was merged into the 3.2 branch. Discussion ---------- [TwigBridge] Fix upgrade/changelog notes | Q | A | ------------- | --- | Branch? | 3.2 The current upgrade note is wrong, the renderer cannot be injected in the `TwigRendererEngine`, only the Twig Environment can be. Also added a missing note about the deprecated `TwigRendererEngineInterface`. Commits ------- a7ebe9c [TwigBridge] Fix upgrade/changelog notes
The current upgrade note is wrong, the renderer cannot be injected in the
TwigRendererEngine
, only the Twig Environment can be.Also added a missing note about the deprecated
TwigRendererEngineInterface
.