Skip to content
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

[TwigComponent] Remove $tag parameter from *Node, as it is now deprecated by twig/twig 3.12 #2114

Merged
merged 1 commit into from
Aug 31, 2024

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Aug 31, 2024

Q A
Bug fix? no
New feature? no
Issues Fix #...
License MIT

This PR fix the deprecations added in twig/twig 3.12, about the $tag parameter from Node class:

➜  TwigComponent git:(2.x) sf php vendor/bin/simple-phpunit
PHPUnit 9.6.20 by Sebastian Bergmann and contributors.

Testing 
...............................................................  63 / 249 ( 25%)
............................................................... 126 / 249 ( 50%)
............................................................... 189 / 249 ( 75%)
............................................................    249 / 249 (100%)

Time: 00:00.514, Memory: 38.00 MB

OK (249 tests, 632 assertions)

Remaining direct deprecation notices (39)

  28x: Since twig/twig 3.12: The "tag" constructor argument of the "Symfony\UX\TwigComponent\Twig\ComponentNode" class is deprecated and ignored (check which TokenParser class set it to "component"), the tag is now automatically set by the Parser when needed.
    5x in EmbeddedComponentTest::testPassingDownBlocksMultipleLevelsNeedsToBeDoneManually from Symfony\UX\TwigComponent\Tests\Integration
    3x in EmbeddedComponentTest::testDeepNesting from Symfony\UX\TwigComponent\Tests\Integration
    3x in EmbeddedComponentTest::testItCanHandleMissingOuterBlocks from Symfony\UX\TwigComponent\Tests\Integration
    3x in EmbeddedComponentTest::testBlockDefinitionCanAccessTheContextOfTheDestinationBlocks from Symfony\UX\TwigComponent\Tests\Integration
    2x in EmbeddedComponentTest::testABlockIsNotPassedIntoAnEmbeddedComponent from Symfony\UX\TwigComponent\Tests\Integration
    ...

  11x: Since twig/twig 3.12: The "tag" constructor argument of the "Symfony\UX\TwigComponent\Twig\PropsNode" class is deprecated and ignored (check which TokenParser class set it to "props"), the tag is now automatically set by the Parser when needed.
    10x in ComponentPropsParserTest::testPropsData from Symfony\UX\TwigComponent\Tests\Integration\Twig
    1x in TwigComponentDebugCommandTest::testWithAnonymousComponent from Symfony\UX\TwigComponent\Tests\Integration\Command

Legacy deprecation notices (4)
➜  TwigComponent git:(2.x) 

@kbond
Copy link
Member

kbond commented Aug 31, 2024

Thanks Hugo.

@kbond kbond merged commit cedf9c8 into symfony:2.x Aug 31, 2024
41 checks passed
@Kocal Kocal deleted the fix/twig-node-deprecation branch August 31, 2024 14:23
@pscheit
Copy link

pscheit commented Sep 4, 2024

hey @kbond would it be possible to do a patch release with this?

thanks @Kocal for the fix

@smnandre
Copy link
Member

smnandre commented Sep 5, 2024

I think we will release a 2.20 in a week or two..

Do we need to release a version directly when Twig releases one ?
I mean this is just a deprecation for now, and there is no planning for us to anticipate. But i'm ready to change my mind :)

In the meantime can you use the 2.x-dev ?

@pscheit
Copy link

pscheit commented Sep 6, 2024

Yeah right, it's just a choice in our CI pipeline to fail with deprecations and I could update to the dev version in the meantime.

Sorry for the stir up :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants