Open jkone27 opened 1 year ago
Thanks for your comment @jkone27! In principle Fable.Lit components should be able to integrate with Astro as they're just LitElement
s under the hood. Though looking at the documentation you linked, it seems you need direct access to the class implementing the render function, and currently Fable.Lit LitElement
attribute creates (and hides) a class expression on the fly to wrap the render function. So we may need a work around for that.
I haven't played with Astro yet, but it looks promising and I'm always happy to help integrate Fable with any interesting framework. If you just want to play with it and Fable, maybe for now you can just use the react integration using Feliz. I think something like this should work:
open Feliz
[<ReactComponent>]
let SayHello (name: string) =
Html.p $"Hello {name}"
In your .astro file:
---
import { SayHello } from '../components/SayHello.fs.js';
---
<html>
<body>
<SayHello name="jkone27" />
</body>
</html>
It could also be done with the lit class bindings I was working on but I don't remember what I was waiting for in that branch
would fable lit produce google lit components and be able to integrate with astro somehow?
https://docs.astro.build/en/guides/integrations-guide/lit/
as i suspect that might become quite a dominant framework soon? or would it be possible to already integrate today? :) cheers..
what do you think about this framework for frameworks :)?