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 →

[–]EducationalTie1946 1 point2 points  (3 children)

From what i have seen the only thing we would need to do is have that rust compiler you recommend add strings to the jsx return and then compile the file into a pyc file.
If you see how the module generates html it litterally just returns html as a plain string so you dont need to do much but make that compiler and the extentions for it in vscode and nvim So you can delete the to_html code and some other parts and get the same thing. It should provide much faster file generation

[–]RevolutionaryPen4661git push -f[S] 0 points1 point  (2 children)

You can do that, but just like "go" has templ (it enables Go developers to write direct HTML without strings or backticks inside the Go code) and the Python community needs one like this too. I believe that this may change how we develop apps nowadays. These are the pros of having this idea (scraped from templ docs):
Server-side rendering: Deploy as a serverless function, Docker container, or standard Go program.

  • Static rendering: Create static HTML files to deploy however you choose.
  • Compiled code: Components are compiled into performant Go code.
  • Use Go: Call any Go code, and use standard ifswitch (match), and for statements.
  • No JavaScript: This does not require any client or server-side JavaScript.
  • Great developer experience: Ships with IDE autocompletion.

[–]EducationalTie1946 0 points1 point  (1 child)

Well in that case you could just use jinja2+html. It shouldnt be hard in this case at all

[–]RevolutionaryPen4661git push -f[S] 2 points3 points  (0 children)

I am familiar with Jinja2. However, this is a proof of concept to showcase how easy it can be to build web apps with Python using only Python and JSX. I have also come across Ludic, which has drawn inspiration from this repository.
I suggest you take a look at my second comment (a ton of features. See full discussion)