Allow server-side components to send messages to client-side components
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, python
- Ambito
- full-stack
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 8.1k
- Fork
- 332
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di reactive-python/reactpy
-
Outdated GIF in Docs Apertapriority-3-low type-docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
reactive-python/reactpy#1034 ·
-
priority-2-moderate type-revision
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
reactive-python/reactpy#1319 ·
-
priority-1-high
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
reactive-python/reactpy#1277 ·
-
priority-3-low
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
reactive-python/reactpy#1273 · 1 reazione ·
-
priority-2-moderate
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
reactive-python/reactpy#1272 · 2 reazioni ·
Tutte le issue di reactive-python/reactpy
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
OpenHands/extensions#626 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
CSCfi/sd-search-api#39 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
please add to porn list Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
StevenBlack/hosts#3255 ·