Hacker News new | ask | show | jobs
by dgb23 1724 days ago
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.
2 comments

But are you sure propagating changes is desirable ? It looks like a different architecture than the web to me
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.
You can use SSE with PHP to propagate changes.
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.

You can avoid that just using SSE to notify (no data) the frontend to rerender, you can still render everything in the backend.