Syntax similar to JSX
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Funcionalidade
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript, python, react
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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)
- Linguagem predominante
- Python
- Estrelas
- 8.1k
- Forks
- 332
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de reactive-python/reactpy
-
Outdated GIF in Docs Abertapriority-3-low type-docs
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
reactive-python/reactpy#1034 ·
-
priority-2-moderate type-revision
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
reactive-python/reactpy#1319 ·
-
priority-1-high
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
reactive-python/reactpy#1277 ·
-
priority-3-low
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
reactive-python/reactpy#1273 · 1 reação ·
-
priority-2-moderate
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 30/100
reactive-python/reactpy#1272 · 2 reações ·
Todas as issues de reactive-python/reactpy
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100