fable-compiler / Fable.Lit

Write Fable Elmish apps with Lit
https://fable.io/Fable.Lit/
MIT License
91 stars 13 forks source link

Experimental class bindings #41

Open AngelMunoz opened 2 years ago

AngelMunoz commented 2 years ago

This is the class bindings PR

these are the first bits but I want to iterate over this and see if there's a way we can also apply some of these concepts to the LitElement decorated functions

I'm still missing some bindings like Directives and AsyncDirectives (they just have what they need now, but ideally they should be fully typed)

AngelMunoz commented 1 year ago

Hey @alfonsogarciacaro I don't really have more to add to this PR I think it has been idle for a while but the important bits are there.

I added the useController so users that are using function based lit elements can also grab controllers that may already exist in the wild but ideally the controllers match better with the class based API which mirrors what actual lit users do and might be simpler for some to copy or port existing components I will be adding docs for these today and then feel free to review

goswinr commented 8 months ago

@alfonsogarciacaro thanks you for making Fable .Lit 🙏 I am just learning Lit and wondered why I can't do this example in Fable.Lit: https://lit.dev/docs/composition/controllers/#example:-mousemovecontroller I found the answer here in this pull request. Thanks, @AngelMunoz. Any reason not to merge this ? At least to have the official samples working in Fable.Lit too?

AngelMunoz commented 8 months ago

No particular reason I never got to finish this as I got distracted.

I'd like more feedback on this as well if you want to try these bits we could revisit the work and make the appropriate updates if needed

Cc: @JordanMarr , @OnurGumus

Sorry to bother I've seen you are using this as on Twitter as well I guess this could be of interest

OnurGumus commented 8 months ago

I think the current approach is fine. One can just use the controllers the way you do. So far I haven't seen any need for this PR.

JordanMarr commented 8 months ago

Sorry, all my free coding time has been consumed with the Elmish.Avalonia project (and my Fable.Lit project got iced). TBH, I don't even know what this PR is about as there are no pretty pictures of code look at. Based on Onur's comment, I'm assuming that you created bindings for Lit Controllers?