-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBundle] Add "use_yield" option to allow opting in for this new rendering mode and skip a deprecation #53805
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
34b8556
to
7fcc042
Compare
echo $data; | ||
} | ||
} else { | ||
$this->template->displayBlock($blockName, $context, $this->resources[$cacheKey]); |
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 looks like we're using an internal API here 🙈
7fcc042
to
3c1492c
Compare
…endering mode and skip a deprecation
3c1492c
to
439e0d6
Compare
// By contract,This method can only be called after getting the resource | ||
// (which is passed to the method). Getting a resource for the first time | ||
// (with an empty cache) is guaranteed to invoke loadResourcesFromTheme(), | ||
// where the property $template is initialized. | ||
|
||
if ($this->template instanceof YieldingTemplate) { |
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.
Do we actually still need to use the internal class Template
in $this->template
, forcing us to use more internal classes there ?
Couldn't we instead rely on the public API of TemplateWrapper
, which has a renderBlock
method (and btw, meging globals would also be useless as Twig would be doing it in its public entry points)
…deprecation notice in CI (evertharmeling) This PR was merged into the 2.x branch. Discussion ---------- [StimulusBundle/TwigComponent] Fix "use_yield" to "true" deprecation notice in CI | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Issues | | License | MIT Only this one remains (in StimulusBundle), but I can't find a direct implementation related to the `Environment` in that test. Maybe also related to symfony/symfony#53805 or thoughts anyone? ``` 1x: Since twig/twig 3.9.0: Not setting "use_yield" to "true" is deprecated. 1x in StimulusControllerLoaderFunctionalTest::testFullApplicationLoad from Symfony\UX\StimulusBundle\Tests\AssetMapper ``` Commits ------- 1dbb7e0 [StimulusBundle] Set "use_yield" option to fix deprecation message
…deprecation notice in CI (evertharmeling) This PR was merged into the 2.x branch. Discussion ---------- [StimulusBundle/TwigComponent] Fix "use_yield" to "true" deprecation notice in CI | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Issues | | License | MIT Only this one remains (in StimulusBundle), but I can't find a direct implementation related to the `Environment` in that test. Maybe also related to symfony/symfony#53805 or thoughts anyone? ``` 1x: Since twig/twig 3.9.0: Not setting "use_yield" to "true" is deprecated. 1x in StimulusControllerLoaderFunctionalTest::testFullApplicationLoad from Symfony\UX\StimulusBundle\Tests\AssetMapper ``` Commits ------- 1dbb7e0f [StimulusBundle] Set "use_yield" option to fix deprecation message
Closing in favor of #53913 |
Adapting to upcoming changes in twig 3.9.
This will need a corresponding recipe update so that new projects don't start with a deprecation.