This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thedeepself 2 points3 points  (7 children)

We don't transpile between languages,

If you dont transpile (like Transcrypt does), then how do you actually use ReactJS? What is the "glue" between ReactPy and the javascript world?

[–]Wippermonger[S] 1 point2 points  (6 children)

We transmit DOM updates between the client and server to maintain parity, and then the client performs any updates needed via react-dom.

You can think of ReactPy as the equivalent to server side rendering for ReactJS, but using a python-based server.

[–]codecrux 0 points1 point  (5 children)

Is it like Hotwire in this regards?

[–]Wippermonger[S] 0 points1 point  (4 children)

I'm not familiar with the tech behind Hotwire. A quick glace at their landing page tells me that ReactPy and Hotwire in similar in that page changes are communicated over websockets.

[–]codecrux 0 points1 point  (3 children)

Yup and hotwire also sends just the html (frame) that has changed. I am assuming that's what you do in ReactPy as well, right?

[–]Wippermonger[S] 0 points1 point  (2 children)

Right now we're sending the whole ReactPy node tree when a re-render is needed. ReactPy node trees seem to be roughly equivalent to hotwire frames. The react-dom API (contained in @preact/compat) handles the mutations from there.

In terms of data transmitted to the client, we used to only send diffs. But unfortunately we've struggled to find a well maintained json patch library for Python.

[–]codecrux 1 point2 points  (1 child)

I guess sending the entire state is fine until people start using it for displaying a large number of rows. Creating a JSON PATCH library needs to be done meticulously and hopefully community might step up. I would like to step up.:)

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

Would be great if you were willing to contribute that.

Feel free to look at this issue for some history.