Skip to content
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

Elmish pattern support #1803

Closed
xperiandri opened this issue Aug 9, 2018 · 8 comments
Closed

Elmish pattern support #1803

xperiandri opened this issue Aug 9, 2018 · 8 comments

Comments

@xperiandri
Copy link

It would be nice to be able to develop Elm architecture apps with Avalonia like Elmish.XamarinForms

@jmacato
Copy link
Member

jmacato commented Aug 10, 2018

It's a great architecture to play with (upon my cursory look at least) but this is something that the community will provide for themselves. I also dont see any technical challenges for Avalonia with regards to Elm/Model-View-Update architecture so i guess someone can take a shot at this? :)

@ma3yta
Copy link

ma3yta commented Apr 12, 2019

@cmeeren
Copy link

cmeeren commented Apr 13, 2019

That will likely be a bigger undertaking than I can commit to at the moment.

For a static view solution, it would probably be fairly easy - perhaps even trivial - to port Elmish.WPF, since Avalonia is similar to WPF. Anyone is welcome to have a go. If it turns out that the Binding and ViewModel code could be reused 100% (and if it's likely that it would continue to be the case in further development), I could consider extracting that to its own library. In any case, just as a start and proof of concept, a fork of Elmish.WPF could be made and adjusted to Avalonia. Refactoring can come later.

However, I don't really like Elmish with static views because of its significant limitations compared to dynamic views. Dynamic views, on the other hand, require a lot more work to implement. There are important performance considerations in order to ensure the view creation and reconciliation/updating is as efficient as possible (Fabulous still struggles with a few things in this regard), there must be a way to support 3rd party controls, and a code generator might be needed to make the dynamic view code maintanable (similar to Fabulous).

@Lleutch
Copy link

Lleutch commented Apr 13, 2019

I completely agree with @cmeeren on each point raised.
Static views have their own limitations compared to dynamic ones. So I would go for implementing a dynamic DSL instead.
In addition a simple PoC might be a good starting point to show others the benefit of it (no need to worry about diff algorithm on tree for the moment, and things like that...)
And same as @cmeeren, I won't be able to undertake such a task for the moment.
However, you can contact me anytime, and I might be able to help out.

@cmeeren
Copy link

cmeeren commented Apr 13, 2019

Regarding a DSL for dynamic views - there are several directions to take:

Aside from the syntax difference, when you delve deep enough into it, I'm sure all come with their own pros and cons regarding technical limitations.


In addition a simple PoC might be a good starting point to show others the benefit of it (no need to worry about diff algorithm on tree for the moment, and things like that...)

I agree, a PoC might be a good starting point. I just want to note that sooner or later, performance will become a concern if it is ever supposed to be a viable way of creating real-life complex apps. It might therefore be prudent to have performance at the back of the mind even in the PoC stage, to ensure one doesn't end up with an implementation that is fundamentally inefficient and difficult to optimize.


And same as @cmeeren, I won't be able to undertake such a task for the moment.
However, you can contact me anytime, and I might be able to help out.

I second that. While I can't commit to being a primus motor or maintainer, feel free to cc me for input.

@ma3yta
Copy link

ma3yta commented Jun 21, 2019

https://github.com/JaggerJo/Avalonia.FuncUI

@xperiandri
Copy link
Author

@ma3yta looks amazing!

@kekekeks
Copy link
Member

kekekeks commented Jul 3, 2023

This doesn't belong to the core avalonia repo, feel free to implement your own wrapper

@kekekeks kekekeks closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants