vNext 0.2.0
See original GitHub issueThe current / 1.x version of FuncUI is basically a proof of concept that escalated a bit. I started using it for my projects and a lot of my assumptions on “how to do x” were right, but some were wrong. The main issues that will be addressed with the next version are:
Domain Specific Language for Views
FuncUI 1.x has a pretty readable DSL for defining views in a type checked manner. But there are a few downsides that need to be addressed:
Reflection
Reflection is used everywhere. This has several downsides (Performance, AOT Limitations, …). The vNext will not use reflection AT ALL.
Definition and Naming changes
The DSL currently uses Statically Resolved Type Constraints. This does not scale well (ask for details). The new DSL will use a different and in my opinion overall better approach. Static E extension methods (or other members) that are attached to the control type. This also leads to a better browsable DSL.
TextBox.create [
TextBox.text state.Name
TextBox.onTextChanged (fun text -> dispatch ..)
]
Type Safety
Currently there is no way of knowing what control a View will create. This is no problem in most cases, but makes it harder to provide a good API in some cases. For example when a control takes another control of a certain type as an attribute (Popup / Tooltip / …).
v1.x
let btn : View = Views.button [ ... ]
vNext
let btn : IView<Button> = Views.button [ ... ]
let btn : IView = Views.button [ ... ]
Virtual Dom
The current virtual Dom implementation is super primitive. This was good in the beginning but there are some thing that need to change.
New Event Handling
In Avalonia all Properties, RoutedEvents and Events are (with a bit of work) Observable. They will be treated all the same and you will finally be able to subscribe to text changed notifications.
Custom Equality implementations for Avalonia Types
This is needed because for example the Grid
Control throws an error if the ColumnDefinitions are set more than one time and ColumnDefinitons
don’t implement value equality.
This will also bring some performance improvements because currently bitmaps are also created on each state change.
Configurable
It will also be possible to configure the LazyViewCache and stuff like that.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (10 by maintainers)
Top GitHub Comments
added one more example project.
Data Templates are done!
Code Example