Open cmeeren opened 5 years ago
This is now implemented, though currently undocumented (except for doc comments in code) and unpublished. Interested parties can, for now, check out the code in the fairly simple Feliz.Generator
and particularly how it's used and extended in the more complicated Feliz.Generator.MaterialUI
(an example of a 3rd party client making use of Feliz.Generator):
Thanks for this cmeeren, I've made plotly.js bindings for Feliz by butchering the code you wrote for the generator. https://github.com/Shmew/Feliz.Plotly I'd love some advice on how I can improve things, I'm pretty sure it creates a rather large bundle at the moment.
The generator is in a good state as of now, but it's not yet published to NuGet or documented. If anybody needs it, please let me know and I'll try to prioritize publishing and adding docs. I have a lot on my place and probably won't prioritize it until anyone actually needs it.
(Regardless of this, anyone is of course free to simply clone this repo and experiment using a simple project reference to see if the generator fits their needs.)
I'm rewriting the generator to something more solid.
In order to simplify creation of other Feliz bindings, I plan on publishing a NuGet with the generator domain model (containing information about components and props) and writer (essentially converts the API model to strings for a component file and props file).
Binding authors can then just instantiate the domain model (either manually or by parsing docs or TS types however they want) and use the model data to generate standard Feliz bindings, which will automatically fix stuff such as erasing types with only inline members etc.
This also makes it easier to change Feliz implementations, e.g. for the new inheritance syntax suggested in #20.