News for hackers. Stuff that matters.
Re:Pynecone – Performant, customizable web apps in pure Python by thunky on Thursday May 04, 2023 @03:48PM (#35821135)
I followed the link to try the increment/decrement example/demo from the landing page (https://pynecone.io/docs/getting-started/introduction). There is probably almost a full one second delay between the time I click the "increment" button and the updated count being rendered.

Not seeing any network requests so I can't imagine why it would be so laggy.

Re:Pynecone – Performant, customizable web apps in pure Python by tymonPartyLate on Thursday May 04, 2023 @03:54PM (#35821198)
Clicking sends a websocket message to the backend. Which then responds with a state update message which updates the frontend react components. rhe round trip would probably take the same time with rest APIs, but you would have the ability to add some loading indicators or hints, because you'd have full control over client side rendering. You don't have that when using pynecone. It's a tradeof
Re:Pynecone – Performant, customizable web apps in pure Python by thunky on Thursday May 04, 2023 @04:15PM (#35821464)
Ah thanks, I see that now under the State -> Overview docs page:

All user state is stored on the server. Behind the scenes, events are sent as API calls to update the state on the server. The state delta is then sent to the frontend, which updates the UI to reflect the new state.

Re:Pynecone – Performant, customizable web apps in pure Python by slmjkdbtl on Thursday May 04, 2023 @05:16PM (#35822191)
So it doesn't really have any client side interactivity? Thought it does from the example and wondering what magic they pulled to achieve that, they really should write this in big text up front cuz it's a pretty big factor when considering this software.
Re:Pynecone – Performant, customizable web apps in pure Python by picklelo on Thursday May 04, 2023 @04:35PM (#35821703)
Yeah we’re only hosting on a single region at the moment so there can be latency depending on your location. We’re working on using edge computing to speed this up.
Re:Pynecone – Performant, customizable web apps in pure Python by pedrosbmartins on Thursday May 04, 2023 @05:41PM (#35822475)
is there a reason why all state is in the server? what about cases where you'd want to keep client-side state, like those strictly related to UI/UX?

(very interesting project nonetheless!)

Re:Pynecone – Performant, customizable web apps in pure Python by picklelo on Thursday May 04, 2023 @05:56PM (#35822649)
Keeping the state on the server allows us to run arbitrary Python code and libraries in our event handlers that update the state. Currently only the ui is compiled to React but the logic stays in Python.

We’re working to offload more logic to the client in the for purely UI operations like you mention, and in the future want to leverage wasm once it’s more mature.

Re:Pynecone – Performant, customizable web apps in pure Python by danudey on Thursday May 04, 2023 @06:59PM (#35823229)
Two quick notes:

1. Looks like you posted this comment pretty close to when this was posted on HN. It's possible the server was more loaded, as I tried it myself and it wasn't very laggy (though there was a delay, it wasn't nearly the one second you experienced).

2. I copied the example code and ran it locally, and the latency is no worse than, say, an electron app. Better than most of them, to be honest.

Likely this was related to server load or network latency or both, because the core functionality seems pretty lag-free.