Repository navigation
refactor(dbo-1130): fetch inicial en server component - #54
Merged
mbarradev-debug merged 1 commit intoJul 27, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
mbarradev-debug
deleted the
mbarragit/dbo-1130-mdi-047-fetch-inicial-en-server-component-con-fallbackdata
branch
July 27, 2026 21:15
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes DBO-1130
Acceptance criteria
Nota importante sobre el ultimo criterio
Se extrajo la logica de armado del snapshot (antes solo en el Route Handler) a lib/indicadores-snapshot.ts, compartida entre app/api/indicadores/route.ts y el nuevo Server Component en app/page.tsx -- ambos usan el mismo cache de resiliencia por indicador en vez de mantener dos copias.
Se probaron dos enfoques para pasar el snapshot inicial a SWR (fallbackData directo, y SWRConfig con fallback -- el patron oficialmente documentado por SWR para SSR). Verificado con curl contra un build de produccion real: el HTML crudo que manda el servidor sigue mostrando el Skeleton, no los valores, aunque el Server Component si calculo los datos correctamente. En el navegador con JS, despues de hidratar, los datos aparecen casi instantaneo (~1s o menos, sin llamada de red visible a la API) -- gran mejora sobre el estado anterior, pero es un repintado post-hidratacion, no un primer paint literalmente sin loading state.
Decision tomada con el usuario: aceptar este resultado (mejora real y grande) en vez de invertir en la arquitectura completa que eliminaria el repintado del todo (separar el render inicial en un Server Component puro sin Client Component/SWR de por medio), que excede el alcance de esta issue. Detalle completo documentado en memoria del proyecto.
PR checklist