3 ms·
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 ma
by dgb23 5y 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.
- slim 5y agoBut are you sure propagating changes is desirable ? It looks like a different architecture than the web to me
- dgb23 5y agoThe 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.
- tored 5y agoYou can use SSE with PHP to propagate changes.
- dgb23 5y agoThat 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.
- tored 5y agoYou can avoid that just using SSE to notify (no data) the frontend to rerender, you can still render everything in the backend.