this post was submitted on 19 Sep 2024
1 points (60.0% liked)

JavaScript

1982 readers
1 users here now

founded 1 year ago
MODERATORS
 

https://positive-intentions.com/blog/dim-functional-webcomponents/

im investigating an idea i have about functional webcomponents after some experience with Lit.

Lit is a nice lightweight UI framework, but i didnt like that it was using class-based components.

Vue has a nice approach but i like working with the syntax that React used and i wondered if with webcomponents i could create a functional UI framework that didnt need to be transpiled.

i think the article is already quite long, so i think i will create a separate one as a tutorial for it.

note: im not trying to push "yet another ui framework", this is an investigation to see what is possible. this article is intended as educational.

top 3 comments
sorted by: hot top controversial new old
[–] demesisx@infosec.pub 12 points 1 month ago* (last edited 1 month ago) (1 children)

Perhaps it is irrelevant to your question since it does require transpilation (Purescript Module), but I have recently fallen in love with the Deku UI framework in Purescript. It works in an FRP style and draws direct influence from React. Purescript is SUPER obscure, but in this context, FRP is really elegant. It even has a mechanism to type-check raw chunks of html at compile time.

The Documentation: https://deku-documentation.vercel.app/

the part most relevant to your question: https://deku-documentation.vercel.app/functional-reactive-programming/events

[–] xoron@programming.dev 3 points 1 month ago* (last edited 1 month ago) (1 children)

thanks for the info. i'll take a look later, it sounds like an interesting idea.

[–] demesisx@infosec.pub 12 points 1 month ago

No problem. I hope others can be more helpful. I’m most often interested in working with a virtual condom over top of JavaSvript. 😜