fix: use wagmi ssr true#3064
Open
yogurtandjam wants to merge 4 commits into
Open
Conversation
|
@yogurtandjam is attempting to deploy a commit to the Aave Team on Vercel. A member of the Team first needs to authorize it. |
206ca83 to
7aa741d
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
❌ CI run has failed! |
7aa741d to
926c3d0
Compare
The funkit checkout host was mounted app-globally, so the @funkit/connect runtime chunk loaded and ran on every route — including the markets page, where that background activity degraded navigation. Scope the host to the two routes that actually have Supply buttons (dashboard, reserve-overview); other pages (markets, history, etc.) no longer load the SDK at all. Supply clicks fall back to the native supply modal until the checkout is available. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
926c3d0 to
d6c9ceb
Compare
|
❌ CI run has failed! |
wagmi's createConfig defaults ssr:false, which makes WagmiProvider re-run reconnect() on every render. For a cold guest this ping-pongs the account status (connecting<->disconnected) and re-renders the provider tree on each navigation, causing slow guest navigation. Setting ssr:true moves reconnect to the guarded once-on-mount path (the standard Next.js wagmi setting) while preserving auto-reconnect for returning wallets. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The page-scoped dynamic import (loading FunkitCheckout only on the Supply pages) was a workaround for a navigation re-render storm. With `ssr: true` on the wagmi config the guest reconnect no longer churns the wallet status, so funkit's provider subtree no longer thrashes on navigation and the workaround is unnecessary. Mount funkit once globally in _app, matching the standard integration pattern. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The page-scoping commit and its revert left FunkitCheckout relocated and <SupplyModal/> reordered with no functional change. Restore the file to the PR base so this PR's diff is only the wagmi ssr:true change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sets
ssr: trueon the wagmi config.In Next.js, wagmi's non-SSR hydration path calls
reconnect()from theWagmiProviderrender body, so it re-fires on every provider render instead of once on mount. For a guest (not-yet-connected) session this churns account status (disconnected → reconnecting → connected) on each navigation, re-rendering the provider tree and triggering redundant reconnect/background activity as the transient reconnecting state gets treated like a connection change.ssr: truemoves reconnect into a single guarded mount effect, so it runs once. Auto-reconnect for returning wallets is preserved.With the churn resolved, the
FunkitCheckouthost stays a single globalssr: falseisland alongside the other modal hosts (relocated + comment updated; no functional change), reusing the interface's wagmi + react-query —@funkit/connectis client-only, hencessr: false. Supply clicks fall back to the native supply modal while wagmi is still reconnecting.Test plan
tsc --noEmit/ lint clean🤖 Generated with Claude Code