Allow server-side components to send messages to client-side components
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Feature
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- javascript, python
- Bereich
- full-stack
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 8.1k
- Forks
- 332
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus reactive-python/reactpy
-
Outdated GIF in Docs Offenpriority-3-low type-docs
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
reactive-python/reactpy#1034 ·
-
priority-2-moderate type-revision
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
reactive-python/reactpy#1319 ·
-
priority-1-high
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
reactive-python/reactpy#1277 ·
-
priority-3-low
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
reactive-python/reactpy#1273 · 1 Reaktion ·
-
priority-2-moderate
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
reactive-python/reactpy#1272 · 2 Reaktionen ·
Alle Issues in reactive-python/reactpy
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
learningequality/ricecooker#747 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
run-llama/llama_index#23199 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
KhronosGroup/glTF-Blender-IO#2769 ·