Skip to content

Commit cba5f3f

Browse files
authored
Update dependencies + quick fixes (#241)
* Update dependencies * Fix build error * Quick fixes
1 parent cde2bc8 commit cba5f3f

File tree

8 files changed

+334
-218
lines changed

8 files changed

+334
-218
lines changed

layout/MDXLayoutNav.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ const MobileWrapper = ({ title, children }: PropsWithChildren<{ title?: string }
123123
)
124124
}
125125

126+
const DocSearchHit = ({ hit, children }: PropsWithChildren<{ hit: { url: string } }>) => (
127+
<Link href={removeBasePathFromUrl(hit.url)}>{children}</Link>
128+
)
129+
126130
export const MDXLayoutNav = ({ mobile = false }: { mobile?: boolean }) => {
127131
const router = useRouter()
128132
const { navItems, currentPage } = useContext(NavContext)!
@@ -147,7 +151,7 @@ export const MDXLayoutNav = ({ mobile = false }: { mobile?: boolean }) => {
147151
url: item.url.replace('https://thegraph.com/docs', process.env.BASE_PATH ?? ''),
148152
}))
149153
}}
150-
hitComponent={({ hit, children }) => <Link href={removeBasePathFromUrl(hit.url)}>{children}</Link>}
154+
hitComponent={DocSearchHit}
151155
navigator={{
152156
navigate({ itemUrl }) {
153157
void router.push(removeBasePathFromUrl(itemUrl))
@@ -178,7 +182,7 @@ export const MDXLayoutNav = ({ mobile = false }: { mobile?: boolean }) => {
178182
}
179183
if ('children' in navItem) {
180184
return (
181-
<NavTree.Group active={currentPage?.path.startsWith(navItem.path)}>
185+
<NavTree.Group active={currentPage?.path.startsWith(`${navItem.path}/`)}>
182186
<NavTree.Group.Heading
183187
sx={mobile ? { py: 0 } : {}}
184188
buttonProps={{ sx: mobile ? {} : { paddingInlineEnd: 0 } }}

lib/remarkMdxLayout.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import process from 'process'
44
import { slugifyWithCounter } from '@sindresorhus/slugify'
55
import { Parser } from 'acorn'
66
import acornJsx from 'acorn-jsx'
7-
import { merge } from 'lodash-es'
7+
import lodash from 'lodash'
88
import { Serializer } from 'serialize-as-code'
99
import { visit } from 'unist-util-visit'
1010

@@ -79,7 +79,7 @@ export const remarkMdxLayout = () => {
7979

8080
const headingId = slugify(headingText) || `heading-${headingCount}`
8181

82-
heading.data = merge(heading.data, {
82+
heading.data = lodash.merge(heading.data, {
8383
hProperties: {
8484
id: headingId,
8585
},

navigation/navigation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ export const navigation = (locale: AppLocale): NavItemDefinition[] => [
149149
slug: 'indexing',
150150
children: [
151151
{
152-
slug: 'operating-graph-node'
153-
}
152+
slug: 'operating-graph-node',
153+
},
154154
],
155155
},
156156
{

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"dependencies": {
2323
"@docsearch/react": "^3.3.0",
24-
"@edgeandnode/components": "^24.0.5",
24+
"@edgeandnode/components": "^24.0.7",
2525
"@emotion/react": "^11.10.5",
2626
"@mdx-js/loader": "^2.1.5",
2727
"@mdx-js/react": "^2.1.5",
@@ -30,7 +30,7 @@
3030
"@radix-ui/react-popover": "^1.0.2",
3131
"@radix-ui/react-visually-hidden": "^1.0.1",
3232
"@reach/auto-id": "^0.18.0",
33-
"lodash-es": "^4.17.21",
33+
"lodash": "^4.17.21",
3434
"next": "^12.3.4",
3535
"next-seo": "^5.14.1",
3636
"prism-react-renderer": "^1.3.5",
@@ -47,15 +47,15 @@
4747
"@sindresorhus/slugify": "^2.1.1",
4848
"@svgr/webpack": "^6.5.1",
4949
"@types/color": "^3.0.3",
50-
"@types/lodash-es": "^4.17.6",
51-
"@types/node": "^16.18.3",
50+
"@types/lodash": "^4.14.191",
51+
"@types/node": "^16.18.4",
5252
"@types/react": "^17.0.52",
5353
"@types/react-dom": "^17.0.18",
5454
"acorn": "^8.8.1",
5555
"acorn-jsx": "^5.3.2",
5656
"eslint": "^8.28.0",
5757
"husky": "^8.0.2",
58-
"lint-staged": "^13.0.3",
58+
"lint-staged": "^13.0.4",
5959
"path": "^0.12.7",
6060
"prettier": "^2.8.0",
6161
"remark-frontmatter": "^4.0.1",

pages/_app.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { merge } from 'lodash-es'
1+
import merge from 'lodash/merge'
22
import { AppProps } from 'next/app'
33
import Head from 'next/head'
44
import NextLink from 'next/link'

pages/en/indexing/operating-graph-node.mdx

+7-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This provides a contextual overview of Graph Node, and some of the more advanced
1010

1111
[Graph Node](https://github.com/graphprotocol/graph-node) is the reference implementation for indexing Subgraphs on The Graph Network, connecting to blockchain clients, indexing subgraphs and making indexed data available to query.
1212

13-
Graph Node (and the whole indexer stack) can be run on bare metal, or in a cloud environment. This flexibility of the central indexing component is crucial to the robustness of The Graph Protocol. Similarly, Graph Node can be [built from source](https://github.com/graphprotocol/graph-node), or indexers can use one of the [provided Docker Images](https://hub.docker.com/r/graphprotocol/graph-node). As well
13+
Graph Node (and the whole indexer stack) can be run on bare metal, or in a cloud environment. This flexibility of the central indexing component is crucial to the robustness of The Graph Protocol. Similarly, Graph Node can be [built from source](https://github.com/graphprotocol/graph-node), or indexers can use one of the [provided Docker Images](https://hub.docker.com/r/graphprotocol/graph-node).
1414

1515
#### PostgreSQL database
1616

@@ -150,6 +150,7 @@ Graph Node indexing can scale horizontally, running multiple instances of Graph
150150
Given multiple Graph Nodes, it is necessary to manage deployment of new subgraphs so that the same subgraph isn't being indexed by two different nodes, which would lead to collisions. This can be done by using deployment rules, which can also specify which `shard` a subgraph's data should be stored in, if database sharding is being used. Deployment rules can match on the subgraph name and the network that the deployment is indexing in order to make a decision.
151151

152152
Example deployment rule configuration:
153+
153154
```toml
154155
[deployment]
155156
[[deployment.rule]]
@@ -215,6 +216,7 @@ ingestor = "block_ingestor_node"
215216
### Supporting multiple networks
216217

217218
The Graph Protocol is increasing the number of networks supported for indexing rewards, and there exist many subgraphs indexing unsupported networks which an indexer would like to process. The `config.toml` file allows for expressive and flexible configuration of:
219+
218220
- Multiple networks
219221
- Multiple providers per network (this can allow splitting of load across providers, and can also allow for configuration of full nodes as well as archive nodes, with Graph Node preferring cheaper providers if a given workload allows).
220222
- Additional provider details, such as features, authentication and the type of provider (for experimental Firehose support)
@@ -283,13 +285,15 @@ The full schema is available [here](https://github.com/graphprotocol/graph-node/
283285
### Indexing performance
284286

285287
There are three separate parts of the indexing process:
288+
286289
- Fetching events of interest from the provider
287290
- Processing events in order with the appropriate handlers (this can involve calling the chain for state, and fetching data from the store)
288291
- Writing the resulting data to the store
289292

290293
These stages are pipelined (i.e. they can be executed in parallel), but they are dependent on one another. Where subgraphs are slow to index, the underlying cause will depend on the specific subgraph.
291294

292295
Common causes of indexing slowness:
296+
293297
- Time taken to find relevant events from the chain (call handlers in particular can be slow, given the reliance on `trace_filter`)
294298
- Making large numbers of `eth_calls` as part of handlers
295299
- A large amount of store interaction during execution
@@ -322,8 +326,8 @@ If a block cache inconsistency is suspected, such as a tx receipt missing event:
322326

323327
1. `graphman chain list` to find the chain name.
324328
2. `graphman chain check-blocks <CHAIN> by-number <NUMBER>` will check if the cached block matches the provider, and deletes the block from the cache if it doesn’t.
325-
1. If there is a difference, it may be safer to truncate the whole cache with `graphman chain truncate <CHAIN>`.
326-
2. If the block matches the provider, then the issue can be debugged directly against the provider.
329+
1. If there is a difference, it may be safer to truncate the whole cache with `graphman chain truncate <CHAIN>`.
330+
2. If the block matches the provider, then the issue can be debugged directly against the provider.
327331

328332
### Querying issues and errors
329333

pages/en/network-transition-faq.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Developers will have plenty of time to migrate their subgraphs to the decentrali
66

77
Each chain on the hosted service, including Ethereum, will sunset gradually as it is supported on the decentralized network to achieve feature parity and a high quality of service. This will happen on a chain-to-chain basis with help from Indexers in the [MIPs program](https://thegraph.com/blog/mips-multi-chain-indexing-incentivized-program/), to enable full support for each chain on the decentralized network.
88

9-
To add more clarity around continued support for each chain on the hosted service, these FAQs answer common questions regarding the specifics of the network transition process. If you would like to start the subgraph migration process now, here is a [step-by-step guide](https://thegraph.com/blog/how-to-migrate-ethereum-subgraph). To skip to the migration FAQ, [click here](#migration-fa-qs-answers-to-common-questions).
9+
To add more clarity around continued support for each chain on the hosted service, these FAQs answer common questions regarding the specifics of the network transition process. If you would like to start the subgraph migration process now, here is a [step-by-step guide](https://thegraph.com/blog/how-to-migrate-ethereum-subgraph). To skip to the migration FAQ, [click here](#migration-faqs).
1010

1111
## Hosted Service Sunset FAQs
1212

0 commit comments

Comments
 (0)