Vue: Pending prefetch blocks navigation until deferred props resolve

Aperta
#832 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
32/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Start at packages/void/src/pages/navigation-engine.ts around lines 740-744, where the navigation waits on an in-flight prefetch before committing, and read how prefetch results are stored and later reused. Compare that path with the non-prefetch navigation path that renders core content and streams deferred props. Use the reproduction branch linked in the issue (prefetch-blocks-deferred-navigation) to observe both behaviours. Done means navigation to a deferred route no longer waits on a pending prefetch, while fully completed prefetches remain reusable.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When a route uses defer(), clicking its link while a prefetch is still running delays the entire navigation until the deferred data resolves.
Without prefetch, the same route renders its core content immediately and streams the secondary data afterward.

Reproduced with [email protected] and @void/[email protected]. Not tested with 1.9.x but the relevant code is still in it so it should be the same.

Minimal reproduction

See https://github.com/TheAlexLichter/void-reproduction/tree/prefetch-blocks-deferred-navigation

Actual behavior

With the prefetch still pending, the current page remains visible until the deferred operation finishes. The next page's heading and loading state never get a chance to appear first.

With prefetch disabled, the heading and loading state appear before the deferred result.

Expected behavior

Navigation to a route with deferred props should be able to show its core content without waiting for secondary data, including when prefetching has already started. Fully completed prefetches should remain reusable.

Could Void either support consuming an in-flight prefetch progressively, or provide an option to reuse only completed prefetches and otherwise fall back to streamed navigation?

Current workaround

I disable automatic prefetch for routes with deferred sections. This restores progressive navigation, but means giving up automatic prefetching for those routes.

Lingua principale
TypeScript
Stelle
684
Fork
83
Merge medio
15h 22m
PR unite (30g)
219

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di voidzero-dev/void

Tutte le issue di voidzero-dev/void

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.