Skip to content

Commit

Permalink
chore: add deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed May 20, 2022
1 parent a54f3e2 commit 1928685
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 73 deletions.
15 changes: 10 additions & 5 deletions docs/pages/docs/migrating-to-03.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import Callout from 'nextra-theme-docs/callout'

If you are coming from an earlier version of `wagmi`, in order to update to versions above `0.3.x`, you will need to make sure to update the following hooks & API's listed below.

## 0.4.x Breaking changes

<Callout>
Not ready to migrate yet? You can find the `0.2.x` docs
[here](https://0.2.x.wagmi.sh).
Not ready to migrate yet? You can find the `0.3.x` docs
[here](https://0.3.x.wagmi.sh).
</Callout>

## 0.4.x Breaking changes

### Passing a function to `createClient` `connectors` has now been deprecated.

If you previously derived an RPC URL from the `chainId` in `connectors`, you will need to migrate to use the [`configureChains` API](https://wagmi.sh/docs/providers/configuring-chains).
Expand Down Expand Up @@ -115,10 +115,15 @@ Duplicate exports with different names and the same functionality were removed t
- `useWagmiClient` alias was removed. Use `useClient` instead.
- `WagmiClient` alias was removed. Use `Client` instead.
- `createWagmiStorage` alias was removed. Use `createStorage` instead.
- `Provider` was renamed and `WagmiProvider` alias was removed. Use `WagmiConfig` instead.
- `Provider` was renamed and `WagmiProvider` alias is now deprecated. Use `WagmiConfig` instead.

## 0.3.x Breaking changes

<Callout>
Not ready to migrate yet? You can find the `0.2.x` docs
[here](https://0.2.x.wagmi.sh).
</Callout>

### `Provider` no longer supports configuration as props

The `Provider` component no longer supports configuration directly as props. You will now need to create a wagmi [`Client`](/docs/client) via `createClient`, and then pass the client to `Provider`:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@changesets/changelog-github": "^0.4.4",
"@changesets/cli": "^2.22.0",
"@ethersproject/providers": "^5.6.5",
"@nomiclabs/hardhat-ethers": "^2.0.5",
"@nomiclabs/hardhat-ethers": "^2.0.6",
"@preconstruct/cli": "^2.1.5",
"@swc-node/jest": "^1.5.2",
"@testing-library/jest-dom": "^5.16.4",
Expand All @@ -68,7 +68,7 @@
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-testing-library": "^5.4.0",
"ethers": "^5.6.5",
"hardhat": "^2.9.3",
"hardhat": "^2.9.6",
"husky": "^7.0.4",
"jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ it('should expose correct exports', () => {
[
"createClient",
"WagmiConfig",
"WagmiProvider",
"useClient",
"useAccount",
"useBalance",
Expand Down Expand Up @@ -59,3 +60,7 @@ it('should expose correct exports', () => {
]
`)
})

it('should alias "WagmiConfig" as "WagmiProvider"', () => {
expect(Exports.WagmiConfig).toBe(Exports.WagmiProvider)
})
8 changes: 7 additions & 1 deletion packages/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
export { createClient, WagmiConfig, useClient } from './context'
export {
createClient,
WagmiConfig,
/** @deprecated use `WagmiConfig` instead */
WagmiConfig as WagmiProvider,
useClient,
} from './context'
export type { CreateClientConfig, WagmiConfigProps } from './context'

export {
Expand Down
Loading

1 comment on commit 1928685

@vercel
Copy link

@vercel vercel bot commented on 1928685 May 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wagmi – ./

wagmi.sh
wagmi-zoo.vercel.app
wagmi-git-main-zoo.vercel.app
wagmi-xyz.vercel.app
www.wagmi.sh

Please sign in to comment.