Allow server-side components to send messages to client-side components
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
- Domaine
- full-stack
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- 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