feat: wagmi v3 compatibility (rebased, all CI passing)#2627
feat: wagmi v3 compatibility (rebased, all CI passing)#2627phelix001 wants to merge 4 commits intorainbow-me:mainfrom
Conversation
🦋 Changeset detectedLatest commit: a5f0a5b The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Hey, I'm looking forward to this. could someone on the team look at this? @phelix001 did some good work to put this together. let's not let RK get stale please. |
|
Any update on this moving forward? Would be lovely to get Wagmi V3 support into rainbowkit |
wagmi v3 requires all hooks to be used within WagmiProvider context. During Static Site Generation (SSG), pages are pre-rendered without proper context, causing WagmiProviderNotFoundError. Changes: - Add 404/500 error pages without wagmi providers for all Next.js examples - Update _app.tsx in Pages Router examples to exclude error pages from providers - Add getServerSideProps to opt out of SSG where needed - Use dynamic imports with ssr: false for site components using wagmi hooks - Remove direct wagmi hook usage from layout components - Add export const dynamic = 'force-dynamic' for App Router examples Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
c9c967e to
f5691dc
Compare
|
@phelix001 is attempting to deploy a commit to the rainbowdotme Team on Vercel. A member of the Team first needs to authorize it. |
Rebased & Conflict-FreeJust rebased this PR on current For teams blocked by thisIn the meantime, you can use our pre-built fork package directly: npm install @rainbow-me/rainbowkit@github:phelix001/rainbowkit#v2.2.10-wagmi3Or reference the release: https://github.com/phelix001/rainbowkit/releases/tag/v2.2.10-wagmi3 For maintainers@DanielSinclair @markdalgleish @jxom — this PR is the rebased, clean version of #2591 with all SSG/SSR fixes included. It's been blocking multiple teams for 2+ months now. Would really appreciate a review and merge so the community can move to wagmi v3. The changes are minimal and well-scoped:
|
wagmi v3 does not export a `gemini` connector from `wagmi/connectors`, causing build failures. Switch geminiWallet to use the standard injected provider pattern (like other EIP-6963 wallets) instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
This PR provides complete wagmi v3 support for RainbowKit, rebased on current main with all CI issues fixed.
This is a continuation of #2591 which has stale merge conflicts.
Changes
Core wagmi v3 Migration
wagmidependency from^2.xto3.xuseAccountwithuseConnectionwhere appropriateSSG Build Fixes
Fixed
WagmiProviderNotFoundErrorduring Next.js Static Site Generation:Pages Router examples:
getServerSidePropsto opt out of SSG for wagmi pagesApp Router examples:
export const dynamic = 'force-dynamic'to layout.tsxDocumentation site:
next/dynamicwithssr: falseTemplates:
Verification
All checks pass locally:
pnpm buildpnpm test(89 tests passed)pnpm lintBreaking Changes
This is a major version bump - see migration guide updates included.
Related
/cc @DanielSinclair
PR-Codex overview
This PR focuses on upgrading the
wagmidependency to version 3, which introduces breaking changes. It modifies various components to use the newuseConnectionhook instead ofuseAccount. Additionally, it improves error handling for pages that do not require theRainbowKitproviders.Detailed summary
wagmifrom version 2.x to 3.x.useAccountwithuseConnectionin multiple components and hooks.wagmihooks to prevent SSG errors.RainbowKitproviders.package.jsonfiles.RainbowKitandwagmi.