Skip to content

Perf: memoize status chip, cache balance fetch, lazy-load confetti banner; doc test:watch - #964

Merged
Kingsman-99 merged 4 commits into
Stellar-split:mainfrom
valoryyaa-byte:fix/issues-911-910-909-908
Oct 20, 2026
Merged

Kingsman-99 merged 4 commits into
Stellar-split:mainfrom
valoryyaa-byte:fix/issues-911-910-909-908

Conversation

@valoryyaa-byte

Copy link
Copy Markdown
Contributor

Addresses four performance/testing-infrastructure issues. The codebase already had substantial work done in each area, so these are the concrete, real gaps found after reviewing the current code rather than blanket changes:

  • Optimize React component rendering with memo and useMemo #911 — StatusChip in InvoiceTable is rendered once per invoice row and only takes a primitive status string prop. Wrapped it in React.memo so rows whose status hasn't changed skip re-rendering the chip when the table re-renders for unrelated reasons (sort, selection toggles, column visibility).
  • Implement caching strategy for blockchain data #910 — fetchUsdcBalance (called from WalletConnect on wallet connect and PayModal on open) was hitting the RPC on every call, bypassing the existing blockchainCache module already used for quotes/invoices. Added a balance cache kind (10s TTL) and routed the fetch through blockchainCache.getOrFetch.
  • Optimize bundle size with code splitting and lazy loading #909 — ReleaseBanner was statically imported in the invoice detail page even though it only renders once an invoice is released, and it pulls in canvas-confetti eagerly. Converted to next/dynamic (ssr: false) so both the component and the dependency load on demand.
  • Implement continuous testing in local development environment #908 — test:watch (vitest --changed) and test:watch:all already existed in package.json but weren't documented anywhere. Added a README section describing the continuous-testing workflow for local dev.

Closes #911
Closes #910
Closes #909
Closes #908

…ache layer

fetchUsdcBalance() was hitting the RPC on every call (WalletConnect
header polls it on connect, PayModal polls it on open), bypassing the
blockchainCache module already used for quotes/invoices. Added a
'balance' cache kind with a 10s TTL and routed fetchUsdcBalance through
blockchainCache.getOrFetch, so concurrent/rapid reads for the same
wallet collapse onto one RPC simulation.
…row re-renders

StatusChip is rendered once per invoice row (tables can have hundreds of
rows) and only takes a primitive status string prop. Wrapping it in
React.memo lets rows whose status hasn't changed skip re-rendering the
chip when the table re-renders for unrelated reasons (sort, selection
toggles on other rows, column visibility).
…ti bundle cost

ReleaseBanner was statically imported in the invoice detail page even
though it only renders when an invoice transitions to 'released', and
it pulls in canvas-confetti eagerly. Converted the import to
next/dynamic (ssr: false) so that component and dependency are only
fetched when the banner actually needs to show.
test:watch (vitest --changed) and test:watch:all already existed in
package.json but weren't documented anywhere, so the continuous-testing
workflow for local development wasn't discoverable. Added a README
section pointing to them.
@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@valoryyaa-byte 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! 🚀

Learn more about application limits

@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@valoryyaa-byte is attempting to deploy a commit to the kingsman-99's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Kingsman-99
Kingsman-99 merged commit 9cab7a5 into Stellar-split:main Oct 20, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants