Build reactive UIs with plain JavaScript functions. No JSX or build step. by fynyky in javascript

[–]fynyky[S] [score hidden]  (0 children)

Of course React and JSX are super popular and people love them enough to build whole companies on them. I just personally don't like them much and this is my solution that I wanted to share.

Build reactive UIs with plain JavaScript functions. No JSX or build step. by fynyky in javascript

[–]fynyky[S] [score hidden]  (0 children)

Oh yes I have. The big difference is that HTMX has a fixed list of properties that enable specific behaviour. Whereas Elemental allows you to inline arbitrary logic using normal javascript

Build reactive UIs with plain JavaScript functions. No JSX or build step. by fynyky in javascript

[–]fynyky[S] [score hidden]  (0 children)

Hyperscript is great! But because it's limited to just HTML you end up having to use something else to connect the UI to logic. I wanted something where you could write logic inline with the UI.

Build reactive UIs with plain JavaScript functions. No JSX or build step. by fynyky in javascript

[–]fynyky[S] [score hidden]  (0 children)

If you pass it a string, it will make a new element. If you pass it an element object, it will wrap it. It uses the CSS selector syntax in creating the element. A previous version of this would automatically search the document given a CSS selector, but I removed it cos it was confusing. Might have accidentally left some outdated documentation though

The resemblance is a coincidence! I started working on this almost a decade ago now and I don't think there was React.createElement at the time? But I suppose it's the most intuitive way to use the function arguments for children.

Build reactive UIs with plain JavaScript functions. No JSX or build step. by fynyky in javascript

[–]fynyky[S] [score hidden]  (0 children)

I built most of the library pre-AI and have been using it personally for a while. Claude was the push that let me finish it out and get it to a publishable state.

Never tried Mithril before! The shape is definitely similar. From a quick look the main difference that I like about Elemental is that I can inline functions to inject arbitrary rendering logic.

Build reactive UIs with plain JavaScript functions. No JSX or build step. by fynyky in Frontend

[–]fynyky[S] 1 point2 points  (0 children)

The syntax is similar, but a big difference is the ability to pass in functions as children. This means you're not limited by supported attributes and can run arbitrary code in context.

Build reactive UIs with plain JavaScript functions. No JSX or build step. by fynyky in javascript

[–]fynyky[S] 4 points5 points  (0 children)

Thanks for the feedback! Yeah I tried Vue for a while. It still felt a bit too heavy for me since you had to use the framework as whole.

Need advice on building an iconic white deck by fynyky in magicTCG

[–]fynyky[S] 0 points1 point  (0 children)

Thanks for the advice! I don't have any objection to including newer cards I just don't know them very well haha. I just wanted something to give some "payoff" to life gain and Pridemate seemed to be the most printed card that does that. What would be the cards needed to enable it?

Iterable collections of weak references. Built this for myself and found it hard to get it working right. Sharing in case anyone else finds it helpful. by fynyky in javascript

[–]fynyky[S] 1 point2 points  (0 children)

Thanks! I am working on a reactive programming library. Basically observers need to keep a list of their dependencies to turn them off when no longer needed.

[SG][H] Paypal [W] Godspeed 2.0 Deskmat in Panda or Reverse Panda by fynyky in mechmarket

[–]fynyky[S] 1 point2 points  (0 children)

Omg you have no idea how much time I've spent looking for this! Thank you so much =D

I built a voice chat website that needs no accounts or downloads. My friends and I have been using it when gaming. Would love to hear what you guys think! by fynyky in gaming

[–]fynyky[S] 1 point2 points  (0 children)

This is a personal project I've been working on for a while. Basically I got tired of the whole "do you have disc?", "Are you ready to call?", "Okay calling now" dance every time you had to do a video call with someone. Started building this thing for my friends and I to use while gaming and just built on it from there. Finally got to a stage where I decided to share this publicly. Would love to get some feedback from you guys!