perf: sparkline SVG propio en KpiCard — recharts fuera del bundle inicial - #27
Merged
Conversation
…cial (closes #25) - Sustituye el AreaChart de recharts por SVG propio (curva monotone + gradiente + animacion framer-motion) para los sparklines de 14 puntos del dashboard - Quita recharts del manualChunks: queda embebido en el chunk lazy de Rentabilidad - JS inicial: 1070 KB -> 674 KB (-37%), recharts (411 KB) ya no se descarga en el arranque - Verificado: build OK, lint sin errores, tests 34/34, Playwright (dashboard 3.6s vs 4.0s movil 4G+CPUx4, Rentabilidad carga recharts sin errores)
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 #25
Qué
Sustituye el AreaChart de recharts en KpiCard (usado en el dashboard) por un SVG propio (curva monotone + gradiente + animación con framer-motion) para los sparklines de ~14 puntos.
Además quita recharts del manualChunks: queda embebido en el chunk lazy de Rentabilidad, donde sí se usa.
Por qué
recharts (~411 KB, 38% del JS inicial) se descargaba en el arranque solo para dibujar sparklines de 14 puntos en el dashboard. En móvil (390px, red 4G + CPU x4) el tiempo a UI interactiva era ~4 s.
Resultado medido
Verificado