Re:Reviving PyMiniRacer: A Python <> JavaScript Bridge
by leontrolski on Saturday March 23, 2024 @07:05PM
(#39803664)
I'm always excited by the idea of rendering jsx from Python in the same process. Mostly as a bridge between eg. an existing Django app and full SPA React land. You'd swap out the scrappy Django string templating with jsx, then once a page passes some frontend interaction complexity threshold shift it over entirely (with shared components between both). Could this project help achieve this or are imports/build processes etc too much of an impediment?
[ Parent
| on HN ]
Re:Reviving PyMiniRacer: A Python <> JavaScript Bridge
by btown on Saturday March 23, 2024 @07:26PM
(#39803764)
I’ve often wondered about an automatic codemod that takes a Django template and turns it into an API endpoint + React component that does the same thing. Your {% if request.user.is_superuser %} checks get propagated to protecting the API data within. Frankly, though, the impetus to upgrade is often accompanied by a design rework anyways. But I do think it would be viable!
Re:Reviving PyMiniRacer: A Python <> JavaScript Bridge
by jennasys on Saturday March 23, 2024 @10:43PM
(#39804751)
I've made React applications using Python via Transcrypt, but wrap component functions in a Python decorator that make direct calls to React.createElement() instead of using JSX (example: https://github.com/JennaSys/tictacreact2). It's possible to use JSX with this approach as well, but IMO it starts to get messy and defeats the purpose of using JSX in the first place.