refactor(landing): memoize dashboard cards, lazy-load below-fold sections, shrink logo - #615
Open
Codesmith313 wants to merge 1 commit into
Open
Conversation
…ions, shrink logo - Wrap TopAssets, ActivityHighlights, and QuickConvert in React.memo so an unrelated home-page state update doesn't re-render the whole dashboard; add a test asserting each is actually memo-wrapped. (kellymusk#479) - Lazy-load the landing page's use-cases, FAQ, and footer sections via next/dynamic with CSS-only skeleton fallbacks (no framer-motion, so the fallback itself ships no client JS), keeping the hero and above-fold sections in the initial bundle. (kellymusk#477) - Re-encode the unreferenced 313 KB public/logo.png (a raw Figma export) as an 800px WebP at ~7.5 KB, and add `sizes` to the hero image alongside its existing `priority`. There were no raw <img> tags anywhere in app/components to convert — landing already uses next/image throughout. (kellymusk#478) Along the way, fixed components/session-provider.tsx: a bad merge between the Freighter-auth branch and the session-persistence branch had left duplicate imports, a duplicate Session type, and two interleaved, broken signOut implementations — the file didn't compile, which blocked the full test suite (npm test is what the pre-push hook runs). Reconciled to the cookie-session restoration path plus Freighter sign-in. Closes kellymusk#477 Closes kellymusk#478 Closes kellymusk#479
|
@Codesmith313 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@Codesmith313 is attempting to deploy a commit to the kelly musk's projects Team on Vercel. A member of the Team first needs to authorize it. |
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
Three perf issues, all assigned to me:
TopAssets,ActivityHighlights, andQuickConvert(the home dashboard's balance/activity sections) now wrapped inReact.memo, so an unrelated state update on the home page no longer re-renders the whole dashboard. Added a test confirming each is actually memo-wrapped.next/dynamicwith skeletonloadingfallbacks, so they're split out of the page's initial render path instead of loading eagerly alongside the hero.public/logo.png(313 KB, turned out to be a fully unreferenced raw Figma export — nothing in the app links to it) re-encoded as an 800px-wide WebP at ~7.5 KB. Addedsizesto the hero image next to its existingpriority. There were no raw<img>tags anywhere inapp/componentsto convert — landing already usesnext/imagethroughout.Closes #477
Closes #478
Closes #479
A blocking bug found along the way
components/session-provider.tsxdidn't compile ondev— a bad merge between the Freighter-auth PR and the session-persistence PR left duplicate imports, a duplicate localSessiontype shadowing the one imported from@/lib/api, and two interleavedsignOutimplementations (the second literally opening inside the first's unclosed body). This is whatnpm test(the pre-push hook's full suite) has to be able to compile, so it needed fixing here too. Reconciled it to the cookie-basedapi.getSession()/api.logout()restoration path (the direction issue #582 already points toward, away from storing the JWT inlocalStorage) plus the Freighter sign-in flow, dropping the now-redundant localSessioninterface andlocalStoragefallback in favor of the type@/lib/apialready exports.Notes
next/dynamic'sssr: falseisn't usable from a Server Component, so these three sections stay server-rendered — the benefit here is streaming (the hero + above-fold content isn't blocked on rendering the below-fold sections) rather than a client-JS-bundle reduction, since none ofUseCases/Faq/SiteFootership client JS in the first place. I didn't set up a Lighthouse CI run to produce a hard LCP percentage for this environment — that needs a deployed/built target — but streaming below-fold Server Components is a standard technique for improving TTFB/LCP.npm run buildcurrently fails ondevfor reasons unrelated to this PR —app/(app)/transactions/page.tsxandapp/request/[id]/page.tsxboth have the same "bad merge" pattern assession-provider.tsx(duplicate imports, dozens of now-undefined names), andlib/api.tsreferences an undefinedSep24Interactivetype. None of these are touched by this PR.Test plan
npx jest— 35/35 passing, including the pre-push hook's own full runnpx eslinton every changed file — cleannpx tsc --noEmit— no new errors introduced (pre-existing errors are all in files this PR doesn't touch)logo.webpagainst the originallogo.png— pixel-identical at 800px, well under the 10 KB target