Allow server-side components to send messages to client-side components
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
- Domínio
- full-stack
Direção de pesquisa
Start with the callback registration in src/client/packages/@reactpy/client/src/reactpy-vdom.tsx and trace the existing client-to-server event path. The issue still needs an agreed interface for targets or channels before implementation. Done means server-side components can deliver messages to the intended custom client-side component and the contract is documented and tested.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Current Situation
Presently, custom client-side components are able to send events back to the server. However, it is not possible to send events from server-side components to client-side ones.
Proposed Actions
Now that custom JS components have the ability to register callbacks with the client this should be technologically feasible. With that said, while users can listen in on particular message types, there is no concept of a message "target". We could achieve this by having message types of the form server-event:<the-target>, but this seems like a bit of a hack. Perhaps we can allow (require?) a nullable target field for this purpose.
Before diving into all those details though, we need to work out exactly what this interface should look like.
I can imagine having an interface similar to:
@component
def example():
channel = use_channel()
@use_effect
async def delayed_message():
import asyncio
await asyncio.sleep(5)
await channel.send({"my": "message"})
response = await channel.receive()
return custom_js_component({"channel_id": channel.id})
where custom_js_component would then subscribe to messages of the type channel-message and target channel.id.
- 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