Syntax similar to JSX
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Fonctionnalité
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- javascript, python, react
Piste de recherche
Start by reading the linked tagstr transpiler issue and the example implementation in tagstr/examples/htmldom.py. Clarify whether the work targets the interim transpiler, the tag string PEP, or both, then define the html tag function's expected behavior from the JSX examples. Done means an agreed implementation path with working transpiler support and an html tag usable by the shown example.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Current Situation
ReactJS has a method of HTML templating called JSX. We currently do not have an equivalent. We should create a Python-based JSX equivalent that operates similarly to how it is used in ReactJS (Javascript).
The key difference here is we will not use a dedicated file extension (such as .psx) in order to not break existing toolchains. Instead, we will rely on the tag string PEP that adds template literals to Python. Here is an example of the tag string syntax:
from reactpy import html
button_style = {"font_style": "bold"}
button_text = "Click me!"
view = html(t"<button on_click={lambda event: ...} style={button_text}>{button_text}</button>")
While we wait for the tag string PEP to be merged, we could potentially use an interim transpiler to use a similar syntax. The interim transpiler syntax would look something like this:
from reactpy import html
button_style = {"font_style": "bold"}
button_text = "Click me!"
view = html @ f"<button on_click={lambda event: ...} style={button_text}>{button_text}</button>"
Proposed Actions
Aid in the development of this proposed transpiler and then develop an html tag function. An initial implementation of an html tag can be found here.
News: There is now a VSCode Extension to add syntax highlighting for inline HTML. (and a second one)
- Langage dominant
- Python
- Étoiles
- 8.1k
- Forks
- 332
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de reactive-python/reactpy
-
Outdated GIF in Docs Ouvertepriority-3-low type-docs
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
reactive-python/reactpy#1034 ·
-
priority-2-moderate type-revision
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
reactive-python/reactpy#1319 ·
-
priority-1-high
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
reactive-python/reactpy#1277 ·
-
priority-3-low
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
reactive-python/reactpy#1273 · 1 réaction ·
-
priority-2-moderate
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
reactive-python/reactpy#1272 · 2 réactions ·
Toutes les issues de reactive-python/reactpy
Issues similaires
-
link-check link-check:sphinx-theme
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
OpenHands/extensions#626 · 1 commentaire ·
-
Change observation tooltip text Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
CSCfi/sd-search-api#39 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100