Allow server-side components to send messages to client-side components
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, python
- Lĩnh vực
- full-stack
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 8.1k
- Fork
- 332
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của reactive-python/reactpy
-
Outdated GIF in Docs Đang mởpriority-3-low type-docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
reactive-python/reactpy#1034 ·
-
priority-2-moderate type-revision
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
reactive-python/reactpy#1319 ·
-
priority-1-high
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
reactive-python/reactpy#1277 ·
-
priority-3-low
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
reactive-python/reactpy#1273 · 1 reaction ·
-
priority-2-moderate
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
reactive-python/reactpy#1272 · 2 reaction ·
Tất cả issue của reactive-python/reactpy
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
🐛 Bug 🔔 Pending processing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
jumpserver/jumpserver#17584 ·