News for hackers. Stuff that matters.
Re:Reactive Clojure: A web language by dgb23 on Thursday September 23, 2021 @01:14PM (#28632095)
PHP doesn't reactively and selectively propagate changes between client and server, nor would it be feasible to write such a library in PHP itself. You could maybe achieve something similar with code generation of PHP and JS.
Re:Reactive Clojure: A web language by slim on Thursday September 23, 2021 @05:09PM (#28635441)
But are you sure propagating changes is desirable ? It looks like a different architecture than the web to me
Re:Reactive Clojure: A web language by dgb23 on Friday September 24, 2021 @07:48AM (#28641121)
The use-case here is that the interface is highly interactive and coordinated. The suggested approach and library tries to blur the line between the logical components of client, server and database. Whether that is desirable depends entirely on what the assumptions of your web application are.
Re:Reactive Clojure: A web language by tored on Friday September 24, 2021 @04:04AM (#28639757)
You can use SSE with PHP to propagate changes.
Re:Reactive Clojure: A web language by dgb23 on Friday September 24, 2021 @07:53AM (#28641158)
That would be a building block to achieve something similar.

Implementing this would however smear your logic all over your client and server and require careful plumbing. SSE doesn't come without caveats either.

The suggested approach here is to abstract away from that plumbing and move to a more declarative, composable expression. Whether you want that or not really depends. I see this as a specialized paradigm to solve a specific category of problems.

Re:Reactive Clojure: A web language by tored on Friday September 24, 2021 @08:55PM (#28649407)
You can avoid that just using SSE to notify (no data) the frontend to rerender, you can still render everything in the backend.