You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The changelog of TwigComponents mentions that cva is deprecated in favor of html_cva of twig/html-extra. The deprecation message also mentions this.
However, html_cva is not a drop-in replacement for which you can do a search-and-replace and be done with it. The signature of the function is different as html_cva has 4 (named) arguments instead of a single argument receiving an associative array with a shape with 4 keys.
the migration path between cva and html_cva needs to be documented clearly to avoid getting support requests from confused users complaining that things don't work anymore after they change function (which is already happening on Slack and triggered me to open this issue)
The text was updated successfully, but these errors were encountered:
Agree here. The change was presented as indolor but after some (legit) changes during Twig review process, the interfaces of the two functions differ a lot indeed.
@stof would you advise us to mimic/allow html_cva signature ? :|
I would naively think this should be the contrary, as we won't be able to follow Twig releases and changes, and have no "reason" to do so, but I'm sure it's more complex than that.. what do you think ?
I think this migration from a single argument containing an associative array to named arguments should be mentioned explicitly in the upgrade documentation, yes (basically, you need to remove the { and } so that array keys become argument names instead, as the names are the same)
The changelog of TwigComponents mentions that
cva
is deprecated in favor ofhtml_cva
oftwig/html-extra
. The deprecation message also mentions this.However,
html_cva
is not a drop-in replacement for which you can do a search-and-replace and be done with it. The signature of the function is different ashtml_cva
has 4 (named) arguments instead of a single argument receiving an associative array with a shape with 4 keys.the migration path between
cva
andhtml_cva
needs to be documented clearly to avoid getting support requests from confused users complaining that things don't work anymore after they change function (which is already happening on Slack and triggered me to open this issue)The text was updated successfully, but these errors were encountered: