-
-
Notifications
You must be signed in to change notification settings - Fork 342
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
[LiveComponent] Make live_action
compatible with Twig components
#2586
Comments
This helper is a quick dedicated helper that has no objective to replace the stimulus attributes. Why don't you use stimulus_action here ? |
Yes, it is clear to me that the helper is not meant to replace the one from Stimulus 😄 but forgive me for asking: it uses the There is something I'm missing: is |
The first and end goal is to render in html
.. as any Twig function would do :) The internal implementation is internal, as we want to keep the possibility to changes StimulusAttributes. Again, what is the problem you have with the |
Nothing special prevents me from doing it 😄 Clearly, I can use If we want to be precise, using Mine was just an observation and a suggestion to make everything more usable and improve the "DX". If you think this change is unnecessary, thank you, and feel free to close this issue. |
I understand the question and i'd be happy to discuss the future implementation / DX (I really do!). Now we cannot change it either way, as it's released like this. Or any code expecting a string would break. |
Right now, you cannot directly use the
live_action
helper to render live attributes because it returns a string. This means the following will not work:On the other hand, some helpers like
stimulus_controller
andstimulus_action
work because they return an iterable that can be used with the Twig spread operator....
.I don't if why this returns a string instead of the
StimulusAttributes
instance? What I'm missing?This would be a great DX addition 👍
I changed
LiveComponentRuntime
to return theStimulusAttributes
instance and the following will work without any problem:The text was updated successfully, but these errors were encountered: