Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Stackflow transition breaks when activity suspends longer than transitionDuration

Aberta
#472 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
react, typescript
Domínio
frontend

Direção de pesquisa

Comece rastreando o estado de transição e o fluxo de inscrição entre @stackflow/core e @stackflow/react, usando como contexto a sequência neste issue e o issue relacionado #434. Defina como o estado pending e a ação pós-renderização devem interagir com Activities suspensas. Considera-se concluído quando a renderização inicial não pode ignorar a transição de entrada quando a suspensão ultrapassa transitionDuration, e o comportamento está coberto pelos testes existentes relevantes.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
TypeScript
Estrelas
1k
Forks
114
Merge médio
59min
PRs com merge (30d)
4

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de daangn/stackflow

Todas as issues de daangn/stackflow

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.