Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Stackflow transition breaks when activity suspends longer than transitionDuration

Đang mở
#472 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu bằng cách theo dõi trạng thái chuyển tiếp và luồng đăng ký giữa @stackflow/core và @stackflow/react, sử dụng trình tự trong issue này và issue liên quan #434 làm ngữ cảnh. Xác định cách trạng thái pending và hành động post-render tương tác với các Activities bị suspend. Được xem là hoàn tất khi lần render ban đầu không thể bỏ qua enter transition nếu suspension kéo dài hơn transitionDuration, và hành vi này được bao phủ bởi các bài test hiện có liên quan.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Currently, Stackflow activities' enter transition is only expressed with enter-active and enter-done. However, this doesn't work well with frameworks that do concurrent rendering because the core state update happens regardless of whether activities render synchronously or suspend during render. This results in something like this:

sequenceDiagram
    participant Core as @stackflow/core
    participant Integration as Integration (@stackflow/react)
    participant View
    View->>Core: push()
    activate Core
    note left of Core: Transition
    Core->>Integration: notify on subscribe() listener
    Integration->>Core: getStack()
    Core->>Integration: State with `enter-active`
    Integration->>View: Render new activity with `enter-active`
    activate View
    note right of View: Suspend
    Core->>Integration: notify on subscribe() listener
    deactivate Core
    Integration->>Core: getStack()
    Core->>Integration: State with `enter-done`
    Integration->>View: Rerender with `enter-done`
    deactivate View
    note right of View: Initial render with `enter-done`

As described above, if the view suspends longer than the core transition, the initial render of the view is done with enter-done state, resulting in broken CSS transitions.

To mitigate this, the core transition should be started after confirming that the initial view was rendered. These are the required parts to implement the feature:

  • Add a new transition state to express activities that didn't complete the initial render. (enter-pending?)
  • Add a new action that notifies the core after completing the initial render. (no idea about naming 🥲)

I'm willing to implement the feature after the direction is fixed.

Related: #434

Ngôn ngữ chính
TypeScript
Star
1k
Fork
114
Merge trung bình
59 phút
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của daangn/stackflow

Tất cả issue của daangn/stackflow

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.