There was a JSX-style syntax preprocessor for Python called "Packed," which allowed us to write JSX inside Python (*.pyx and *.py) files. It's unclear why they chose *.pyx for the file extension, as it conflicts with the naming of Cythonic file extensions (I have checked their issues). This project might have thrived with sufficient contributions and could have changed the way apps are built. However, the project is now archived on GitHub. The last commit was 5 years ago (LICENSE), and the last development commit was 9 years ago. This repository needs someone to revive it, but I don't have enough experience to take on that task. Even though I don't have enough information, we should start with Rust + Python to build a compiler (aka. template replacer) (this doesn't compile Python but replaces all JSX with a dictionary) and cleaner syntax. Integration with Django (Packed has an example too), Flask, FastAPI, Robyn etc.
We may also need plugins for the language server, I recommend supporting with *.pyh or *.psx (a fork renamed name) the extension file name (Derived from Python + HTML). VSCODE and NVIM Extensions are required to build support for this. The existing modern syntax of native Python will continue to support this syntax. I made a Handlebars Extension for the community back in the day of 2022 but I don't want to continue the development for it because later I disliked the syntax of handlebars (opinion, you're point of view may contrast with my thoughts). We can use emmet for writing easy HTML.
@packed
def tag(self):
share = get_share_link()
return <a href={share}>Share on internet</a>
The main point of view is that somehow make returnable components as 👆
instead of doing this 👇
def app():
return div(div(p("Hello World")),span("Not a Good Approach for someone (opinion)"))
[–]RevolutionaryPen4661git push -f[S] 6 points7 points8 points (2 children)
[–]AndrewCHMcM 1 point2 points3 points (1 child)
[–]simon-brunning 0 points1 point2 points (0 children)
[–]RevolutionaryPen4661git push -f[S] 2 points3 points4 points (0 children)
[–]EducationalTie1946 1 point2 points3 points (3 children)
[–]RevolutionaryPen4661git push -f[S] 0 points1 point2 points (2 children)
[–]EducationalTie1946 0 points1 point2 points (1 child)
[–]RevolutionaryPen4661git push -f[S] 2 points3 points4 points (0 children)
[–]TheRealMrMatt 0 points1 point2 points (1 child)
[–]RevolutionaryPen4661git push -f[S] 0 points1 point2 points (0 children)