Hacker News new | ask | show | jobs
by tomconroy 1725 days ago
Claiming "this is PHP" misses the point entirely, which is turning PHP-like templates into apps that can react to user input
2 comments

There has got to be a better way of achieving reactive templates than what is described in this project though.
I think Phoenix LiveView (posted recently on HN: https://fly.io/blog/how-we-got-to-liveview/) and Rails Hotwire (https://hotwired.dev/) are the main alternatives that have momentum right now.

The general idea being to abstract away the difference between client and server code, so that you can write code that handles both, in a single file.

> There has got to be a better way

What's offensive about the OP to you? Is it just that you don't like functional programming / Clojure (fair, that's ultimately a matter of taste / aesthetics at some level)? Or is there something about the technical implementation you think is suboptimal?

Thank you for posting those two, I wanted to post them but I don't comment often. Wanted to chip in another contemporary: edelvalle/reactor, which is inspired by LiveView[0].

[0]: https://github.com/edelvalle/reactor

I am using Hotwire for a project, and I'm learning Elixir and Phoenix on the side. Finding edelvalle/reactor was immediately helpful to me though, because I cut my teeth on Python/Django, so reading a Python reference implementation helps me learn nuts and bolts of libraries, faster. (so, I figure that this might help someone else grok how these approaches work.)

Thanks for sharing - I currently work with Django so I'm very happy to see an equivalent library in that ecosystem.

Have you found any issues with Reactor, areas where it's behind Hotwire, etc?

I mean sure but you can’t get over the need to have a two way pipe of some kind to pass events server <-> client. Like no matter what you’ve got two balls of state with bidirectional relationships between them.
What if we put a DOM API into php with a few state hooks? Does that solve it? Because the GP is right, this is PHP.