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

Rewrite generator / make generator library #22

Open
cmeeren opened this issue Oct 6, 2019 · 3 comments
Open

Rewrite generator / make generator library #22

cmeeren opened this issue Oct 6, 2019 · 3 comments

Comments

@cmeeren
Copy link
Collaborator

cmeeren commented Oct 6, 2019

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.

@cmeeren
Copy link
Collaborator Author

cmeeren commented Oct 7, 2019

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):

https://github.com/cmeeren/Feliz.MaterialUI/blob/e54e57cce525039b2a2dc818bf43465dcaee8663/src/Feliz.Generator.MaterialUI/Domain.fs#L1-L23

https://github.com/cmeeren/Feliz.MaterialUI/blob/e54e57cce525039b2a2dc818bf43465dcaee8663/src/Feliz.Generator.MaterialUI/ApiParser.fs#L670-L706

https://github.com/cmeeren/Feliz.MaterialUI/blob/e54e57cce525039b2a2dc818bf43465dcaee8663/src/Feliz.Generator.MaterialUI/Program.fs#L16-L21

@Shmew
Copy link
Owner

Shmew commented Oct 16, 2019

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.

@cmeeren
Copy link
Collaborator Author

cmeeren commented Feb 9, 2020

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants