✨ Add Symfony UX 3.x compatibility - #26
Merged
Merged
Conversation
Allow symfony/ux-icons and symfony/ux-twig-component ^2.30 or ^3.0. The cva Twig function was removed in TwigComponent 3.0. Our usage was a trivial static type-to-class mapping, so replace it with plain class string building instead of pulling in twig/html-extra for html_cva. The cva branches in widget and callout were dead code anyway: the 'cva is defined' guard tests a variable, never the function, so the manual fallback already ran everywhere. Rendered HTML is unchanged.
PHPStan 1.12 cannot parse symfony/http-foundation 8.1 sources and reports every Request/Response reference as an unknown class.
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.
What
symfony/ux-iconsandsymfony/ux-twig-componentconstraints to^2.30|^3.0cvaTwig function (removed in TwigComponent 3.0) with plain class string building inalert,widgetandcallouttemplatesWhy not
html_cva?The upgrade guide suggests
html_cvafromtwig/html-extra, but our usage is a trivial static type-to-class mapping. Manual concatenation avoids a new dependency and the extension registration requirement (twig/extra-bundle) in consuming apps. Thecvabranches inwidget/calloutwere dead code anyway (cva is definedtests a variable, not the function), so the manual fallback already ran everywhere. Rendered HTML is unchanged.Notes for consumers
twig_component.defaults(mandatory in 3.0) and need PHP >= 8.4 / Symfony >= 7.4Checks