If you're interested in this sort of thing, but want to code in Java, try Flavour: https://flavour.sourceforge.io/ Flavour is a fast, batteries-included, type-safe framework for making modern SPA web apps in Java (and other JVM languages). * Great Lighthouse scores? Check! * Real SPAs without sluggish network round trips? Check! * Modern path-based routing? Check! * Components (built-in and user-defined)? Check! * Ef…
None of these links seem to work? This site can’t be reachedCheck if there is a typo in frequal.com. DNS_PROBE_FINISHED_NXDOMAIN
React, but in Python
51–60 of 179 posts
Re: React, but in Python
#52Earlier quoted context omitted.
I haven't used htmx but it looks nothing like pyreact. htmx is about adding attributes to html, so again, you are still writing html.
Htmx is not only about adding attributes to HTML :) check how responses to requests are expected to contain full or partial HTML instead of, say, json.
you could still have your html in a template file and parse and return the contents of that.
Re: React, but in Python
#53Does anyone have a list of full-stack Python frameworks for building interactive web apps? I feel like a new one comes out each week, and it would be nice to see them together to compare.
(Not complete. Pull requests welcome.)
Re: React, but in Python
#54Earlier quoted context omitted.
None of these links seem to work? This site can’t be reachedCheck if there is a typo in frequal.com. DNS_PROBE_FINISHED_NXDOMAIN
Not sure if your parent commenter fixed, but FYI all links worked for me.
Re: React, but in Python
#55Long ago, before jsx and react, before hack, Facebook had a fork of php called xhp, which allowed xml data within php. I'm not suggesting anybody should maintain a fork of python with xml support but a pre-processor could parse xython and generate standard python with trees of html.xx() calls. https://en.wikipedia.org/wiki/XHP
There was also ComponentKit, which was used heavily in fbobjc: https://github.com/facebook/componentkit
Re: React, but in Python
#56If you're interested in using React-style frontend programming in Python but want an experience / API closer to that of React, I recommend checkout out Reacton [1]. Similarly to this library, it gives you a `@component` decorator that allows you to create components out of functions. But it also: 1. Includes all existing React hooks (use_state, use_memo, etc) -- so you don't have to learn new patterns. I believe this…
The follow up of that is Solara: "NextJS, but in Python" :)
Re: React, but in Python
#57I'm lost. React builds interactive UIs (web, mobile). After each interaction, the virtual DOM is programmatically recreated and reconciled to the actual DOM. But reactpy is running on a backend sever??? Is each interaction resulting in a server call? Can someone explain what is going on? EDIT: Ah, okay, thanks. Every re-render is a network call. If people complained about web UI performance before..... :)
In reality, an important and large class of apps will hit the backend on roughly every click anyway, and having full control over in-browser interactivity is kind of overkill for those apps. Business apps with tables, charts, and forms, for example. You click the nav to load a new page, you scroll down or click a button to load more data, you fill a form and click submit, all those things hit the server. For those ty…
I understand the benefits, then again if interacting with these elements requires calling the backend then the cost is quite high.
Re: React, but in Python
#58Earlier quoted context omitted.
yes, from reading the docs, there's a websocket. Making a 'server call' on each interaction is also what web apps used to do before SPAs were a thing. And in many cases it's what SPAs do as well. Of course, it depends what counts as an 'interaction', but that's been the case since JavaScript existed.
> Making a 'server call' on each interaction is also what web apps used to do before SPAs were a thing. One of the reasons behind the popularity around webapps was that they would no longer need to make 'a server call' on each interaction. > And in many cases it's what SPAs do as well. I feel you're grossly misrepresenting what SPAs do. SPAs do calls to send and receive data, not to fetch server-side rendered content…
Ironically, many modern SPAs are significantly slower than the traditional apps they replaced. Try using Twitter's webapp on a non-premium phone, for example.
Sometimes it's regrettable that the webdev truck has no rear-view mirror.
Re: React, but in Python
#59Long ago, before jsx and react, before hack, Facebook had a fork of php called xhp, which allowed xml data within php. I'm not suggesting anybody should maintain a fork of python with xml support but a pre-processor could parse xython and generate standard python with trees of html.xx() calls. https://en.wikipedia.org/wiki/XHP
Re: React, but in Python
#60I'm lost. React builds interactive UIs (web, mobile). After each interaction, the virtual DOM is programmatically recreated and reconciled to the actual DOM. But reactpy is running on a backend sever??? Is each interaction resulting in a server call? Can someone explain what is going on? EDIT: Ah, okay, thanks. Every re-render is a network call. If people complained about web UI performance before..... :)
In reality, an important and large class of apps will hit the backend on roughly every click anyway, and having full control over in-browser interactivity is kind of overkill for those apps. Business apps with tables, charts, and forms, for example. You click the nav to load a new page, you scroll down or click a button to load more data, you fill a form and click submit, all those things hit the server. For those ty…
You'd have to conscious of this.
It's defiantly not a "write a usual React app, but in Python"...every dropdown, menu, modal, etc interaction interaction is a backend call.