[LiveComponent][TwigComponent] Define requirement to the twig bundle for UX Component and UX Live Components
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | no |
| Tickets | Fix #... |
| License | MIT |
Define requirement to the twig bundle for UX Component and UX Live Components. Currently installing ux component and live component fails. Both have a direct requirement to the TwigBundle as both require a service named twig.
Without defining this requirement the installation of the package will fail when not already have twig-bundle installed: https://github.com/schranz-php-recipes/symfony-recipes-php/actions/runs/3567748595/jobs/5995813798
Related PR: #313
Thanks for looking into this!
I can't remember exactly how it is related but the failing CI is what I ran into when iterating on #313: the form component not being available. Does manually enabling the form component in the test kernel help?
@kbond I did found out it its an issue in the Symfony core here a little inconsistent is between TwigExtension.php and ExtensionPass.php: https://github.com/symfony/symfony/issues/48373#issuecomment-1329736501 I'm not sure if we should add the $container::willBeAvailable to the compilerpass or even remove it from the TwigExtension.
So the issue is there's no way to enable the twig form extension if symfony/form isn't in composer.json's require?
I think that was the nuance that #313 solved: adding twig-bundle and form to require-dev allowed it to be enabled.
Agree that this is a problem - I remember it took me some time to figure out what was going on.
I think that was the nuance that https://github.com/symfony/ux/pull/313 solved: adding twig-bundle and form to require-dev allowed it to be enabled.
Yes that is the case as then also the form.extension is not installed and so that is not failing in that case, but it does sadly so not define all require dependencies and fails if twig-bundle is not already installed. I stumble it over it in the recipes CI testing as the recipe update of symfony/ux components failed as it did not define this requirement.
I think I will target a pull request in symfony/symfony so that issue is fixed in the core that it can not appear again.