News for hackers. Stuff that matters.
Re:Show HN: Pynecone – Web Apps in Pure Python by dragonwriter on Friday December 09, 2022 @10:10PM (#33929458)
Single-codebase full-stack in Python is an interesting thing to do, but honestly that API for UI is ugly compared to React or even React-wrapped-in-Python by way of Pyodide. [0]

[0] the approach of this blog post: https://blog.pyodide.org/posts/react-in-python-with-pyodide/

Re:Show HN: Pynecone – Web Apps in Pure Python by jennasys on Saturday December 10, 2022 @02:43PM (#33936035)
The ugliness is something I struggled with a bit when I was first using Transcrypt to create React applications with Python. Even though that approach is more of a 1-to-1 Python-to-JS mapping instead of a Python wrapper, I felt all the calls to createElement affected readability. But once I started using a Python decorator to wrap the components in createElement, the code got a lot cleaner. Here's a basic example based on the official React tutorial: https://github.com/JennaSys/tictacreact2/blob/main/tictacrea...