Skip to content

Commit a29ce47

Browse files
Adamj1232laurencedelislemhchaudhry3
authored
Docs Releases - Search and Migration Guide Updates (#1342)
* Update [...2]onboard.js-migration-guide.md updated links, punctuation and grammar. * addressed comments from PR and updated links * Create [...2]onboard.js-migration-guide.md * Remove duplicate cmigration guide * Add changes that were part of duplicate mig guide * Revert relative path for external * Update link from expired docs to examples folder * injected wallets doc fix * no version bump needed * Add Search to Docs (#1322) * Update layout * Update homepage * Add algolia packages * Update index name * Update search keys * yarn it * Remove algolia from layout-homepage Co-authored-by: laurencedelisle <[email protected]> Co-authored-by: mhchaudhry3 <[email protected]>
1 parent ed5456d commit a29ce47

File tree

9 files changed

+248
-55
lines changed

9 files changed

+248
-55
lines changed

docs/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414
"format": "prettier --write --plugin-search-dir=. ."
1515
},
1616
"devDependencies": {
17+
"@algolia/client-search": "^4.14.2",
18+
"@docsearch/css": "^3.2.1",
19+
"@docsearch/js": "^3.2.1",
1720
"@iconify-json/ri": "^1.1.3",
1821
"@playwright/test": "^1.22.2",
1922
"@sveltejs/adapter-static": "^1.0.0-next.39",
2023
"@sveltejs/adapter-vercel": "next",
2124
"@sveltejs/kit": "1.0.0-next.357",
2225
"@svelteness/kit-docs": "^0.22.12",
2326
"@tailwindcss/typography": "^0.5.2",
27+
"@types/react": "^18.0.21",
2428
"@types/react-dom": "^18.0.6",
2529
"@typescript-eslint/eslint-plugin": "^5.27.0",
2630
"@typescript-eslint/parser": "^5.27.0",
@@ -37,6 +41,8 @@
3741
"postcss": "^8.4.14",
3842
"prettier": "^2.6.2",
3943
"prettier-plugin-svelte": "^2.7.0",
44+
"react": "^18.2.0",
45+
"react-dom": "^18.2.0",
4046
"shiki": "^0.10.1",
4147
"svelte": "^3.44.0",
4248
"svelte-check": "^2.7.1",

docs/src/lib/components/install-code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<TabPanel value="npm">
33

44
```sh copy
5-
npm install @web3-onboard/core @web3-onboard/injected
5+
npm install @web3-onboard/core @web3-onboard/injected-wallets
66
```
77

88
</TabPanel>
99
<TabPanel value="yarn">
1010

1111
```sh copy
12-
yarn add @web3-onboard/core @web3-onboard/injected
12+
yarn add @web3-onboard/core @web3-onboard/injected-wallets
1313
```
1414

1515
</TabPanel>

docs/src/routes/__layout-homepage.svelte

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
import { KitDocs, KitDocsLayout, SocialLink } from '@svelteness/kit-docs'
1414
import IconBN from '$lib/components/icons/blocknative.svelte'
15-
import SEO from '$lib/components/SEO/index.svelte';
15+
import SEO from '$lib/components/SEO/index.svelte'
1616
1717
/** @type {import('@svelteness/kit-docs').NavbarConfig} */
1818
const navbar = {
@@ -25,7 +25,8 @@
2525
}
2626
2727
const title = 'Web3-Onboard | The easy way to connect web3 users to dapps'
28-
const metadescription = 'Open-source, framework-agnostic JavaScript library to onboard users to web3 apps. Help your users transact with ease by enabling wallet connection, real-time transaction states, and more.'
28+
const metadescription =
29+
'Open-source, framework-agnostic JavaScript library to onboard users to web3 apps. Help your users transact with ease by enabling wallet connection, real-time transaction states, and more.'
2930
const url = 'https://onboard.blocknative.com/'
3031
</script>
3132

@@ -38,11 +39,7 @@
3839
{/if}
3940
</svelte:head>
4041

41-
<SEO
42-
{title}
43-
{metadescription}
44-
{url}
45-
/>
42+
<SEO {title} {metadescription} {url} />
4643

4744
<KitDocs>
4845
<KitDocsLayout {navbar} --kd-content-max-width={'100%'}>

docs/src/routes/__layout-kit-docs.svelte

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import '@svelteness/kit-docs/client/styles/theme.css'
2020
import '$lib/styles/fonts.css'
2121
import '$lib/styles/kit-docs.css'
22+
import '@docsearch/css'
23+
import '@svelteness/kit-docs/client/styles/docsearch.css'
2224
2325
import { page } from '$app/stores'
2426
@@ -29,6 +31,7 @@
2931
createKitDocsLoader,
3032
createSidebarContext
3133
} from '@svelteness/kit-docs'
34+
import { Algolia } from '@svelteness/kit-docs/client/algolia'
3235
3336
import IconBN from '$lib/components/icons/blocknative.svelte'
3437
@@ -67,13 +70,20 @@
6770
</svelte:head>
6871
6972
<KitDocs {meta}>
70-
<KitDocsLayout {navbar} {sidebar}>
73+
<KitDocsLayout {navbar} {sidebar} search>
7174
<div slot="navbar-left">
7275
<a class="text-base flex items-center" href="/">
7376
<IconBN />
7477
<span class="ml-4">{'Web3-Onboard'}</span>
7578
</a>
7679
</div>
80+
<Algolia
81+
apiKey="1bce9c4755cea3698e16830544503ee2"
82+
appId="02BH13PRRI"
83+
indexName="docsearch"
84+
placeholder="Search documentation"
85+
slot="search"
86+
/>
7787
<div slot="navbar-right-alt">
7888
<div class="flex">
7989
<SocialLink type="gitHub" href="//github.com/blocknative/web3-onboard" />

docs/src/routes/docs/[...1]overview/[...3]onboard.js-migration-guide.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ With Web3-Onboard, we’ve introduced significant architectural changes that pro
1313

1414
If you have bnc-onboard installed, you will need to install web3-onboard instead. The basic steps you need to take to get started are:
1515

16-
1. Install `npm i @web3-onboard/core`. You can then go ahead and install other specific wallet modules you want.
16+
1. Install `npm i @web3-onboard/core`. You can then go ahead and install other specific wallet modules you want (most likely `npm i @web3-onboard/injected-wallets` for browser wallet support).
1717
2. Initialize Onboard with the wallets you’ve installed along with the networks you would like to support.
1818
3. Make use of our API actions like `await onboard.connectWallet()` to allow a user to connect their wallets.
1919

2020
For a full code overview of the upgrade process using the React Hooks package please see [this PR](https://github.com/blocknative/react-demo/pull/160/files) with special attention to the `App.js` and `services.js` files.
21-
To help you get started quickly on any framework you're using, we’ve put together [a quickstart that includes the above-mentioned steps](https://docs.blocknative.com/onboard#quickstart).
21+
To help you get started quickly we’ve put together [a set of examples across multiple frameworks that includes the above-mentioned steps](https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard-develop/examples).
2222

2323
### Package Upgrade - Modularization
2424

2525
This is the biggest change you might experience as an onboard.js user. With Web3-Onboard, we’ve separated all supported wallets into their modules, meaning you only need to integrate specific wallet modules you intend to support in your app.
26-
For example with Onboard, if you wanted to support only Metamask and Coinbase in your app, you had to install Onboard complete with all other wallets: npm install bnc-onboard
26+
For example with Onboard, if you wanted to support only Metamask and Coinbase in your app, you had to install Onboard complete with all other wallets: `npm install bnc-onboard`.
2727
With Web3-Onboard, you only need to install core along with the desired wallet modules: `npm i @web3-onboard/core @web3-onboard/injected-wallets @web3-onboard/coinbase`
2828
This change allows us to support many web3 wallets without affecting the overall library performance.
2929

3030
### Expansive Initialization Options
3131

32-
We’ve made initialization simpler while introducing more powerful options like [Account Center](https://www.blocknative.com/blog/multichain-and-multiwallet-account-management-on-your-dapp-with-account-center) and Notify in web3-onboard.
32+
We’ve made initialization simpler while introducing more powerful options like [Account Center](https://www.blocknative.com/blog/multichain-and-multiwallet-account-management-on-your-dapp-with-account-center) and Notify in Web3-Onboard.
3333
Onboard now requires two compulsory initial setup options: `wallets` (Wallet modules, as shown above, to be initialized and added to wallet selection modal) and `chains` (EVM networks your app should work with). You can also pass multiple wallets and chains.
3434

3535
```
@@ -46,7 +46,7 @@ const onboard = Onboard({
4646
})
4747
```
4848

49-
You can find the full list of initialization options in our docs here.
49+
You can find the full list of initialization options in our docs [here](/docs/packages/core#options).
5050

5151
### API Upgrades
5252

@@ -55,15 +55,15 @@ Now, you only need to call the connectWallet API:
5555

5656
`await onboard.connectWallet()`
5757

58-
Learn more about state changes tracked with the Onboard API here and the exposed actions you can use to modify the state here.
58+
Learn more about state changes tracked with the Onboard API [here](/docs/packages/core#state) and the exposed actions you can use to modify the state [here](/docs/packages/core#actions-to-modify-state).
5959

6060
### Framework Support
6161

6262
Although Onboard is still framework-agnostic, we’ve introduced a couple of framework-specific modules that are frequently asked for by our users.
6363

64-
`@web3-onboard/react` - React Hooks to connect users to web3 dApps better. You can check out [a comprehensive React Hooks guide](https://www.blocknative.com/blog/react-hooks-ethereum) we've written on that.
64+
`@web3-onboard/react` - React Hooks to connect users to web3 dApps better. You can check out [a comprehensive React Hooks guide](https://www.blocknative.com/blog/react-hooks-ethereum) we've written on it.
6565

66-
`@web3-onboard/vue` - A set of reusable functions for integrating Web3-Onboard into a Vue 3 project. This is also compatible with a Vue 2 + composition-api dapp.
66+
`@web3-onboard/vue` - A set of reusable functions for integrating Web3-Onboard into a Vue 3 project. This is also compatible with a Vue 2 + composition-api dApp.
6767

6868
### CSS Customizations
6969

@@ -89,7 +89,7 @@ We've also added more expansive custom CSS properties so you can style every par
8989
}
9090
```
9191

92-
The full list of CSS variables for web3-onboard are available here.
92+
The full list of CSS variables for web3-onboard are available [here](/docs/packages/core#custom-styling).
9393

9494
### Other Important Changes
9595

@@ -98,4 +98,7 @@ There are also other notable infrastructural changes in Web3-Onboard:
9898
- Dynamic Imports of dependencies
9999
- Wallet Provider Standardization
100100
- Support for Chain ID in decimal format
101-
- If you have questions or requests, please feel free to drop by the [community-support discord channel](https://discord.com/channels/542403978693050389/542406894677917699) or [create a PR or issue on GitHub](https://github.com/blocknative/web3-onboard/issues/new/choose).
101+
102+
### Questions and Requests
103+
104+
If you have questions or requests, please feel free to drop by the [community-support discord channel](https://discord.com/channels/542403978693050389/542406894677917699) or [create a PR or issue on GitHub](https://github.com/blocknative/web3-onboard/issues/new/choose).

docs/src/routes/docs/[...2]getting-started/[...1]installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Install the core Onboard library and the injected wallets module to support brow
1010
<TabPanel value="yarn">
1111

1212
```sh copy
13-
yarn add @web3-onboard/core @web3-onboard/injected
13+
yarn add @web3-onboard/core @web3-onboard/injected-wallets
1414
```
1515

1616
</TabPanel>
1717
<TabPanel value="npm">
1818

1919
```sh copy
20-
npm install @web3-onboard/core @web3-onboard/injected
20+
npm install @web3-onboard/core @web3-onboard/injected-wallets
2121
```
2222

2323
</TabPanel>

docs/src/routes/docs/[...4]packages/injected.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Note: Make sure to install the core module before installing other modules to w3
1010
<TabPanel value="yarn">
1111

1212
```sh copy
13-
yarn add @web3-onboard/injected
13+
yarn add @web3-onboard/injected-wallets
1414
```
1515

1616
</TabPanel>
1717
<TabPanel value="npm">
1818

1919
```sh copy
20-
npm install @web3-onboard/injected
20+
npm install @web3-onboard/injected-wallets
2121
```
2222

2323
</TabPanel>

0 commit comments

Comments
 (0)