-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: v2 migration guides, docs, changesets (#1697)
* chore: changsets and docs from #1601 * merge: @daniel/migration-guide-v2 * chore: update docs * chore: update docs with new APIs and wagmi v2 changes * chore: update changesets * chore: update changesets * chore: update changesets * chore: update 2.x.x wagmi version * fix: use single quote instead of double quote * fix: use single quote instead of double quote #2 * fix: refactor custom-wallets.mdx * chore: small tweak * chore: update introduction video * fix: remove chains prop from migration guide * chore: update custom wallets, chains and installation sections * chore: update custom chains * chore: update custom wallet list * chore: tweak * chore: update custom chains and tweak stuff * chore: tweak changeset and migration * chore: update rainbow button guide * chore: update docs and tweak changesets * chore: rainbowkit to major version 2.x.x changeset change * chore: update sitemap * fix: missing tanstack/react-query installs * fix: missing @tanstack/react-query imports * fix: create-rainbowkit minor bump * fix: simplify changeset and migration guide * fix: rainbow button changeset * fix: removed beta link from changeset * fix: removed beta callout * fix: peer references * fix: remove incorrect file * fix: tweak * fix: chains docs * fix: latest reference * fix: tanstack, injectedWallet references * fix: intro * fix: duplicate tanstack install reference * fix: rainbow button readme * fix: wallet connectors reference * fix: queryclientprovider reference * fix: imports for connectorsforwallets * fix: favor viem@2.x * fix: migrate migration guide to guide article * chore: update sitemap --------- Co-authored-by: Magomed Khamidov <53529533+KosmosKey@users.noreply.github.com>
- Loading branch information
1 parent
1c32bd8
commit 5d89f3d
Showing
18 changed files
with
880 additions
and
539 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@rainbow-me/rainbowkit-siwe-next-auth": minor | ||
--- | ||
|
||
RainbowKit has reached v2 alongside [wagmi](https://wagmi.sh), which includes [breaking changes](https://wagmi.sh/react/guides/migrate-from-v1-to-v2). | ||
|
||
`0.4.x` now requires `@rainbow-me/rainbowkit` v2, specifically: `2.x.x`. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
"@rainbow-me/rainbowkit": major | ||
--- | ||
|
||
**Breaking:** | ||
|
||
The [wagmi](https://wagmi.sh) and [viem](https://viem.sh) peer dependencies have reached `2.x.x` with breaking changes. | ||
|
||
Follow the steps below to migrate. | ||
|
||
**1. Upgrade RainbowKit, `wagmi`, and `viem` to their latest versions** | ||
|
||
```bash | ||
npm i @rainbow-me/rainbowkit@2 wagmi@2 viem@2.x | ||
``` | ||
|
||
**2. Install `@tanstack/react-query` peer dependency** | ||
|
||
With Wagmi v2, [TanStack Query](https://tanstack.com/query/v5/docs/react/overview) is now a required peer dependency. | ||
|
||
Install it with the following command: | ||
|
||
```bash | ||
npm i @tanstack/react-query | ||
``` | ||
|
||
**3. Upgrade your RainbowKit and Wagmi configurations** | ||
|
||
```diff | ||
import '@rainbow-me/rainbowkit/styles.css' | ||
|
||
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
- import { createPublicClient, http } from 'viem' | ||
- import { WagmiConfig } from 'wagmi' | ||
+ import { WagmiProvider, http } from 'wagmi' | ||
- import { configureChains, createConfig } from 'wagmi' | ||
import { mainnet } from 'wagmi/chains' | ||
import { RainbowKitProvider } from '@rainbow-me/rainbowkit' | ||
- import { getDefaultWallets, connectorsForWallets } from '@rainbow-me/rainbowkit' | ||
+ import { getDefaultConfig } from '@rainbow-me/rainbowkit' | ||
|
||
/* getDefaultWallets is now optional */ | ||
- const { wallets } = getDefaultWallets({ | ||
- appName: 'RainbowKit demo', | ||
- projectId: 'YOUR_PROJECT_ID', | ||
- chains, | ||
- }) | ||
|
||
/* connectorsForWallets is now optional */ | ||
- const connectors = connectorsForWallets([...wallets]) | ||
|
||
- const { chains, publicClient } = configureChains( | ||
- [mainnet, sepolia], | ||
- [publicProvider(), publicProvider()], | ||
- ) | ||
|
||
- const config = createConfig({ | ||
- autoConnect: true, | ||
- publicClient, | ||
- }) | ||
|
||
/* New API that includes Wagmi's createConfig and bundles getDefaultWallets and connectorsForWallets */ | ||
+ const config = getDefaultConfig({ | ||
+ appName: 'RainbowKit demo', | ||
+ projectId: 'YOUR_PROJECT_ID', | ||
+ chains: [mainnet], | ||
+ transports: { | ||
+ [mainnet.id]: http(), | ||
+ }, | ||
+ }) | ||
|
||
+ const queryClient = new QueryClient() | ||
|
||
const App = () => { | ||
return ( | ||
- <WagmiConfig config={config}> | ||
+ <WagmiProvider config={config}> | ||
+ <QueryClientProvider client={queryClient}> | ||
- <RainbowKitProvider chains={chains}> | ||
+ <RainbowKitProvider> | ||
{/* Your App */} | ||
</RainbowKitProvider> | ||
+ </QueryClientProvider> | ||
- </WagmiConfig> | ||
+ </WagmiProvider> | ||
) | ||
} | ||
``` | ||
|
||
[You can read an in-depth migration guide here](https://rainbowkit.com/guides/rainbowkit-wagmi-v2). | ||
|
||
**4. Check for breaking changes in `wagmi` and `viem`** | ||
|
||
If you use `wagmi` hooks and `viem` actions in your dApp, you will need to follow the migration guides for v2: | ||
|
||
- [Wagmi v2 Migration Guide](https://wagmi.sh/react/guides/migrate-from-v1-to-v2) | ||
- [Viem v2 Breaking Changes](https://viem.sh/docs/migration-guide.html#_2-x-x-breaking-changes) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
"@rainbow-me/rainbow-button": minor | ||
--- | ||
|
||
**Breaking:** | ||
|
||
The [wagmi](https://wagmi.sh) and [viem](https://viem.sh) peer dependencies have reached `2.x.x` with breaking changes. | ||
|
||
Follow the steps below to migrate. | ||
|
||
**1. Upgrade Rainbow Button, `wagmi`, and `viem` to their latest versions**** | ||
|
||
```bash | ||
npm i @rainbow-me/rainbow-button@2 wagmi@2 viem@2.x | ||
``` | ||
|
||
**2. Install `@tanstack/react-query` peer dependency** | ||
|
||
With Wagmi v2, [TanStack Query](https://tanstack.com/query/v5/docs/react/overview) is now a required peer dependency. | ||
|
||
Install it with the following command: | ||
|
||
```bash | ||
npm i @tanstack/react-query | ||
``` | ||
|
||
**3. Upgrade your Rainbow Button and Wagmi configurations** | ||
|
||
`RainbowConnector` is now `rainbowConnector`, and requires `appName` and no longer accepts the `chains` parameter. | ||
|
||
```diff | ||
- import { RainbowConnector } from '@rainbow-me/rainbow-button' | ||
+ import { rainbowConnector } from '@rainbow-me/rainbow-button' | ||
import { createConfig } from 'wagmi' | ||
|
||
const config = createConfig({ | ||
- connectors: [new RainbowConnector({ chains, projectId })], | ||
+ connectors: [ | ||
+ rainbowConnector({ | ||
+ appName: "RainbowKit demo", | ||
+ projectId: "YOUR_PROJECT_ID", | ||
+ }), | ||
+ ], | ||
}) | ||
``` | ||
|
||
Follow the [Wagmi v2 Migration Guide](https://wagmi.sh/react/guides/migrate-from-v1-to-v2) for additional configuration changes. | ||
|
||
**4. Check for breaking changes in `wagmi` and `viem`** | ||
|
||
If you use `wagmi` hooks and `viem` actions in your dApp, you will need to follow the full migration guides for v2: | ||
|
||
- [Wagmi v2 Migration Guide](https://wagmi.sh/react/guides/migrate-from-v1-to-v2) | ||
- [Viem v2 Breaking Changes](https://viem.sh/docs/migration-guide.html#_2-x-x-breaking-changes) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@rainbow-me/create-rainbowkit": minor | ||
--- | ||
|
||
Migrated template to Wagmi v2 with the following package changes: | ||
|
||
- updated `wagmi` from `1.4.x` to `^2.0.0` | ||
- updated `viem` from `1.21.x` to `^2.0.0` | ||
- added `@tanstack/react-query` dependency with version `^5` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"site": patch | ||
--- | ||
|
||
- Added migration guide for `@rainbow-me/rainbowkit` `2.x.x` breaking changes. | ||
- Updated all documentation section to include the latest Wagmi, Viem and TanStack Query usage | ||
- Added migration guide for `2.x.x` breaking changes |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.