Repository navigation
Conversation
This branch has not been 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.
Summary
Every route downloaded the whole app as one 9.5 MiB script before painting anything (2.9 MiB even gzipped), and the backend sent it uncompressed. Routes, Plotly, non English locales and a few rarely used libraries now load on demand and the backend gzips and caches hashed assets, so the first paint needs 276 KiB of gzipped JavaScript; it also removes duplicate requests, idle job widget rerenders and an object URL leak. On localhost FCP went from 0.81 to 1.82 s down to 0.20 to 0.34 s and LCP from 0.81 to 2.47 s down to 0.24 to 0.94 s; with the Lighthouse desktop preset FCP went from about 8.6 s to 0.78 to 1.09 s and the Home score from 55 to 97.
Type of Change
Changes (by file)
DashAI/front/src/App.jsx: route pages are lazy behind oneSuspense; Home stays eager.components/shared/LazyPlot.jsx: new, loadsreact-plotly.jswhen the first chart renders.FoldMetricsChart.jsx,LiveMetricsChart.jsx,CorrelationsTab.jsx,NumericTab.jsx,PlotlyJsonVisualizer.jsx,ArtifactRenderer.jsx,PlotActions.jsx,ResultsGraphsPlot.jsx: importLazyPlotunder the samePlotname.utils/i18n/index.js,index.jsx,DashAI/front/vite.config.mjs: English stays bundled; each other language is one chunk loaded before the first render and on language change.ExportableCard.jsx,Upload.jsx:html2canvasandjszipare imported inside their handlers.components/tour/TourProvider.jsx,components/updates/UpdatesButton.jsx: Joyride and the updates dialog are lazy.utils/jobPoller.js: one poll at a time, every 10 s in a hidden tab, immediate poll when the tab is visible again.hooks/useJobPolling.js: polls without changes no longer rerender the job widget.hooks/useStrategyKind.js,api/generativeTask.ts: concurrent identical requests for strategy metadata and the generative model list share one request.ToolListItem.jsx,ToolGridItem.jsx: tool thumbnails useloading="lazy".components/shared/FormSchemaFieldCard.jsx:DescriptionBlockis memoized, so typing no longer reparses every field description.components/predictions/InputField.jsx: the image preview object URL is created in an effect and revoked.DashAI/back/api/front_api.py: hashed/assets/files get immutable cache headers;.jsand.cssare gzipped once per file version for clients that accept gzip.tests/back/test_main.py: tests for the cache headers and gzip responses.Testing (optional)
Notes (optional)
Chart routes now load Plotly after the first paint, so the chart area is empty for a moment the first time a chart appears. On the first visit to a module the app bar paints a moment before the page.