Skip to content

perf: lazy load frontend pages - #54

Merged
forthfate merged 3 commits into
forthfate:mainfrom
KavinamuthanGP:fix/frontend-bundle-size
Sep 14, 2026
Merged

perf: lazy load frontend pages#54
forthfate merged 3 commits into
forthfate:mainfrom
KavinamuthanGP:fix/frontend-bundle-size

Conversation

@KavinamuthanGP

Copy link
Copy Markdown
Contributor

Summary

  • Lazy-load non-dashboard frontend pages with React.lazy and dynamic imports.
  • Add a Suspense fallback while page chunks are loading.
  • Reduce the initial JavaScript bundle from 1,725.43 kB to 1,129.18 kB (~34.5% reduction).

Validation

  • npm --prefix frontend run lint
  • npm --prefix frontend run build
  • git diff --check

Lint completed with 0 errors and 1 existing warning in frontend/src/features/evaluations/page.tsx.

@forthfate

Copy link
Copy Markdown
Owner

Hi @KavinamuthanGP !
It's really great to meet you in this PR!
Thanks so much for your contribution! That was way faster than expected.
Realizing it now, a skeleton UI feels necessary here.
I'll set up the skeleton UI for this screen's loading state rather than using hardcoded text or a spinner.
Mind holding off for a bit?

@KavinamuthanGP

Copy link
Copy Markdown
Contributor Author

Hi @forthfate, Sure, no problem! Take your time. Thanks for the feedback!

@forthfate

Copy link
Copy Markdown
Owner

Hi! @KavinamuthanGP
Thank you for your patience!
Now that we have skeleton UIs applied to all screens, let's go ahead and implement lazy loading! Let's do this!

@forthfate
forthfate self-requested a review September 10, 2026 14:41
@KavinamuthanGP
KavinamuthanGP force-pushed the fix/frontend-bundle-size branch from 893689d to 37bb833 Compare September 10, 2026 15:02
@KavinamuthanGP

Copy link
Copy Markdown
Contributor Author

Hi @forthfate, sounds good! The lazy loading implementation is now ready on the PR. I’ve also updated the fallback to use the new skeleton UI.

@forthfate

Copy link
Copy Markdown
Owner

@KavinamuthanGP Thanks again for the performance improvement!

I checked the conflict against the latest main. Please rebase your branch and keep the lazy-loading change, but update the renamed builds page reference:

const BuildsPage = lazy(() =>
  import("./features/builds/page").then((module) => ({
    default: module.BuildsPage,
  })),
);

Please use BuildsPage and ./features/builds/page instead of the older EvaluationBuildsPage / ./features/evaluation-builds/page names. The page stack can remain wrapped in <Suspense fallback={<SectionSkeleton rows={6} />}>.

I tested this resolution against the latest main: lint passes with the existing unrelated warning, and the production build succeeds.

Sorry for the extra work here, and thank you for your patience and contribution!

@KavinamuthanGP

Copy link
Copy Markdown
Contributor Author

Hi @forthfate, no worries at all! It’s my pleasure to contribute and work on this. Thanks for checking everything against the latest main and pointing out the updated reference.

I’ll rebase the branch and make the requested change. Please give me a little time to complete it, and I’ll update the PR once it’s ready.

@forthfate

Copy link
Copy Markdown
Owner

@KavinamuthanGP
I'll be happily waiting!

@KavinamuthanGP
KavinamuthanGP force-pushed the fix/frontend-bundle-size branch from 37bb833 to 3bb905a Compare September 12, 2026 16:11
@KavinamuthanGP

Copy link
Copy Markdown
Contributor Author

Hi @forthfate, the requested changes are now completed and I've rebased the branch onto the latest main. The lazy-loading implementation is updated to use the renamed BuildsPage, and the skeleton loading fallback is also in place.

Sorry for the delay bro , and thank you again for your patience and guidance throughout this! It was really good working with you, and I’m looking forward to future collaborations.

Please take a look whenever you get a chance. Thanks again!

@forthfate forthfate left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked and saw that everything has been correctly revised.

@forthfate

Copy link
Copy Markdown
Owner

@KavinamuthanGP
Thanks for the update!
I really enjoyed working with you as well.
I checked and saw that everything has been correctly revised. Approved!
Please merge this when you get a chance!

@KavinamuthanGP

Copy link
Copy Markdown
Contributor Author

Hi @forthfate! GitHub is currently showing the branch as out-of-date with main, although it says the changes can be cleanly merged. Since the PR is already approved, would you like me to update the branch once more, or would you prefer to merge it from your side?

@forthfate
forthfate merged commit 6a02947 into forthfate:main Sep 14, 2026
2 checks passed
@forthfate

Copy link
Copy Markdown
Owner

@KavinamuthanGP
Just merged! Thank you, and have a great day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants