Skip to content

Conversation

@janopae
Copy link

@janopae janopae commented Dec 4, 2025

Q A
Bug fix? yes
New feature? no
Deprecations? no
Documentation? no
Issues Fix #3210
License MIT

Alternative to #3211 which should be more cache-friendly. Has the limitation that it requires components to allow the outerScope variable in blocks they define.

…e is limited as long as `outerScope` is included

This is more cache-friendly than to inline the content of the block into the Twig template. But it requires Twig component authors to allow the `outerScope` variable in their blocks.
@carsonbot carsonbot added Bug Bug Fix Status: Needs Review Needs to be reviewed labels Dec 4, 2025
@carsonbot carsonbot changed the title Fix 3210 cache friendly Fix 3210 cache friendly Dec 4, 2025
@janopae janopae changed the title Fix 3210 cache friendly Fix InteractsWithTwigComponents not being able to render blocks when variable scope is limited (cache friendlier solution with limitations) Dec 4, 2025
@smnandre
Copy link
Member

smnandre commented Dec 5, 2025

This is problematic to me, as using outerScope really does change the runtime code and makes it in my eyes too different of what would happen in production. Also at best it would not bring added value for most users.. at worst it could be causing problems with outerScope or any change we do around its implementation.

I'm pretty sure we can find a way to help you in that very specific need without impacting every other tests out there ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug Fix Status: Needs Review Needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TwigComponent] Test helper can't render blocks when limiting scope using {% with … only%}

3 participants