-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
AFX in Eel Expressions #28
Comments
Little late to the party ^^ ... btw should i even comment here since the repo is read only? However .... I stumbled on a similar thing but lately i found out about fusions afx path <a>
<Neos.Fusion:UriBuilder @path="attributes.href" action="someMethod"/>
Click me
</a> Demo: |
Yeah, a different feature though. |
I just some thoughts about this again:
... it will be kind of confusing why such magic is allowed in eel in AFX blocks but not in normal fusion code ... maybe eel could implement this on its own? - This would be more the JSX way. The big advantage of JSX is, that it is actually always JavaScript just with syntax sugar: writing |
I am not super in love with the idea just yet but find it intriguing for sure. Will be tricky to implement in a clean way as EEL and Fusion are separate worlds, but I think it could be done, although will probably require a lot of under the hood changes to how the whole parsing happens because so far the inside of an expression is basically ignored by the fusion parser and then parsed later on by the EEL parser when that expression result is actually needed, but for the above to work we would have to preparse them while parsing fusoin. Not impossible for sure and maybe that path of thought enables other things if we have early insights into used expressions. Things like analysis of used context variables for example.... Mmmm, I am starting to like the direction. |
i made a working prototype ^^So i tried to implement the idea once and failed while hacking a bit around in the AFX parser But a few days ago it just came to me that it is super easy to implement on the fusion site (when afx is transpiled, and eel expression are in paths.) That not only makes it possible to use MhsDesign.FusionAfxInEelThis is the experimental working and tested Fusion Preprocessor and Runtime extension to handle AFX inside of Eel. some examples:(more here https://github.com/mhsdesign/MhsDesign.FusionAfxInEel or https://github.com/mhsdesign/MhsDesign.FusionAfxInEel/blob/main/Tests/Experiments/MoreJsxLikeAfxTest.php or https://github.com/mhsdesign/MhsDesign.FusionAfxInEel/blob/main/Tests/Functional/EelAfxRuntimeTest.php)
or this:
or
let me know what you think ;) prototype using
|
It would be great to support AFX in expressions, inspired by JSX. Arbitrary AFX could be included in Eel wrapped by some special sequence. The syntactic sugar might not be worth the effort.
Before:
After:
This could then be used with a ternary operator, similar to JSX like this:
Before:
After:
This may result in a structure like this:
The text was updated successfully, but these errors were encountered: