[TwigBundle] Add "use_yield" option to allow opting in for this new rendering mode and skip a deprecation#53805
Closed
nicolas-grekas wants to merge 1 commit intosymfony:5.4from
Closed
[TwigBundle] Add "use_yield" option to allow opting in for this new rendering mode and skip a deprecation#53805nicolas-grekas wants to merge 1 commit intosymfony:5.4from
nicolas-grekas wants to merge 1 commit intosymfony:5.4from
Conversation
34b8556 to
7fcc042
Compare
nicolas-grekas
commented
Feb 6, 2024
| echo $data; | ||
| } | ||
| } else { | ||
| $this->template->displayBlock($blockName, $context, $this->resources[$cacheKey]); |
Member
Author
There was a problem hiding this comment.
it looks like we're using an internal API here 🙈
7fcc042 to
3c1492c
Compare
…endering mode and skip a deprecation
3c1492c to
439e0d6
Compare
yceruto
approved these changes
Feb 6, 2024
stof
reviewed
Feb 6, 2024
| // (with an empty cache) is guaranteed to invoke loadResourcesFromTheme(), | ||
| // where the property $template is initialized. | ||
|
|
||
| if ($this->template instanceof YieldingTemplate) { |
Member
There was a problem hiding this comment.
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)
weaverryan
added a commit
to symfony/ux
that referenced
this pull request
Feb 9, 2024
…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
symfony-splitter
pushed a commit
to symfony/ux-twig-component
that referenced
this pull request
Feb 9, 2024
…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
Member
Author
|
Closing in favor of #53913 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.