Skip to content

[Twig][Live] Skip Twig 3.9 🚒 (do not set use_yield = true for now) #1486

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

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/LiveComponent/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"php": ">=8.1",
"symfony/property-access": "^5.4.5|^6.0|^7.0",
"symfony/ux-twig-component": "^2.8",
"twig/twig": "^2.14.7|^3.0.4"
"twig/twig": "^2.14.7|~3.8.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor - but technically we are still ok if you’re using 3.0.4. We just want to not allow 3.9. Perhaps we should write it to still allow the lower twig 3 versions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you write this ? If we use <= it will allow twig 1.0 no ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I see you've just matched what Symfony core is doing. Ok for me then!

},
"require-dev": {
"doctrine/annotations": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/StimulusBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
"symfony/finder": "^5.4|^6.0|^7.0",
"symfony/http-kernel": "^5.4|^6.0|^7.0",
"twig/twig": "^2.15.3|^3.4.3",
"twig/twig": "^2.15.3|~3.8.0",
"symfony/deprecation-contracts": "^2.0|^3.0"
},
"require-dev": {
Expand Down
4 changes: 1 addition & 3 deletions src/StimulusBundle/src/Helper/StimulusHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ final class StimulusHelper
public function __construct(?Environment $twig)
{
// Twig needed just for its escaping mechanism
$this->twig = $twig ?? new Environment(new ArrayLoader(), [
'use_yield' => true,
]);
$this->twig = $twig ?? new Environment(new ArrayLoader());
}

public function createStimulusAttributes(): StimulusAttributes
Expand Down
4 changes: 1 addition & 3 deletions src/StimulusBundle/tests/Dto/StimulusAttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ final class StimulusAttributesTest extends TestCase

protected function setUp(): void
{
$this->stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader(), [
'use_yield' => true,
]));
$this->stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader()));
}

public function testAddAction(): void
Expand Down
2 changes: 1 addition & 1 deletion src/TwigComponent/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"symfony/deprecation-contracts": "^2.2|^3.0",
"symfony/event-dispatcher": "^5.4|^6.0|^7.0",
"symfony/property-access": "^5.4|^6.0|^7.0",
"twig/twig": "^2.14.7|^3.0.4"
"twig/twig": "^2.14.7|~3.8.0"
},
"require-dev": {
"symfony/console": "^5.4|^6.0|^7.0",
Expand Down
8 changes: 2 additions & 6 deletions src/TwigComponent/tests/Unit/ComponentAttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ public function testCanAddStimulusControllerViaStimulusAttributes(): void
'data-live-data-value' => '{}',
]);

$stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader(), [
'use_yield' => true,
]));
$stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader()));
$stimulusAttributes->addController('foo', ['name' => 'ryan', 'some_array' => ['a', 'b']]);
$attributes = $attributes->defaults($stimulusAttributes);

Expand All @@ -160,9 +158,7 @@ public function testCanAddStimulusActionViaStimulusAttributes(): void
'data-action' => 'live#foo',
]);

$stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader(), [
'use_yield' => true,
]));
$stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader()));
$stimulusAttributes->addAction('foo', 'barMethod');
$attributes = $attributes->defaults([...$stimulusAttributes]);

Expand Down