Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

chore: Update deps for monorepo #1101

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ module.exports = {
group: ['wagmi/dist'],
message: 'Invalid import: remove dist from import path',
},
{
group: ['@apollo/client'],
importNames: ['useQuery'],
message:
// eslint-disable-next-line max-len
'Import useQuery from @apollo/experimental-nextjs-app-support/ssr to avoid u.inFlightLinkObservables errors',
},
// TODO: delete once we confirm that u.inFlightLinkObservables error does not happen when importing from @apollo/client after migrating to its latest version
// {
// group: ['@apollo/client'],
// importNames: ['useQuery'],
// message:
// // eslint-disable-next-line max-len
// 'Import useQuery from @apollo/experimental-nextjs-app-support/ssr to avoid u.inFlightLinkObservables errors',
// },
{
group: ['act'],
importNames: ['react-dom/test-utils'],
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/pool/PoolProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
GqlChain,
} from '@/lib/shared/services/api/generated/graphql'
import { createContext, PropsWithChildren, useRef } from 'react'
import { useQuery } from '@apollo/experimental-nextjs-app-support/ssr'
import { useQuery } from '@apollo/client'
import { FetchPoolProps } from './pool.types'
import { useMandatoryContext } from '@/lib/shared/utils/contexts'
import { calcBptPriceFor, usePoolHelpers } from './pool.helpers'
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/pool/usePoolEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
GetPoolEventsQuery,
} from '@/lib/shared/services/api/generated/graphql'
import { FetchPolicy } from '@apollo/client'
import { useQuery } from '@apollo/experimental-nextjs-app-support/ssr'
import { useQuery } from '@apollo/client'

type PoolEventList = GetPoolEventsQuery['poolEvents']
export type PoolEventItem = PoolEventList[0]
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/hooks/useProtocolStats.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useQuery } from '@apollo/experimental-nextjs-app-support/ssr'
import { useQuery } from '@apollo/client'
import { GetProtocolStatsDocument } from '../services/api/generated/graphql'
import { supportedNetworks } from '@/lib/modules/web3/ChainConfig'

Expand Down
2 changes: 1 addition & 1 deletion lib/shared/services/api/apollo-client-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

// eslint-disable-next-line max-len
import { ApolloNextAppProvider } from '@apollo/experimental-nextjs-app-support/ssr'
import { ApolloNextAppProvider } from '@apollo/experimental-nextjs-app-support'
import { createApolloClient } from '@/lib/shared/services/api/apollo.client'

export function ApolloClientProvider({ children }: React.PropsWithChildren) {
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/services/api/apollo-server.client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { config } from '@/lib/config/app.config'
import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'
import { registerApolloClient } from '@apollo/experimental-nextjs-app-support/rsc'
import { registerApolloClient } from '@apollo/experimental-nextjs-app-support'

export const { getClient: getApolloServerClient } = registerApolloClient(() => {
return new ApolloClient({
Expand Down
10 changes: 5 additions & 5 deletions lib/shared/services/api/apollo.client.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { config } from '@/lib/config/app.config'
import { ApolloLink, HttpLink } from '@apollo/client'
import {
NextSSRApolloClient,
NextSSRInMemoryCache,
ApolloClient,
InMemoryCache,
SSRMultipartLink,
} from '@apollo/experimental-nextjs-app-support/ssr'
} from '@apollo/experimental-nextjs-app-support'

/*const userMiddleware = new ApolloLink((operation, forward) => {
// add the user address to the headers
Expand All @@ -25,7 +25,7 @@ export function createApolloClient() {
//const keyArgs = ['where', ['poolIdIn']]
const httpLink = new HttpLink({ uri: config.apiUrl })

return new NextSSRApolloClient({
return new ApolloClient({
ssrMode: typeof window === 'undefined',
link:
typeof window === 'undefined'
Expand All @@ -36,7 +36,7 @@ export function createApolloClient() {
httpLink,
])
: httpLink,
cache: new NextSSRInMemoryCache({
cache: new InMemoryCache({
typePolicies: {
GqlToken: {
keyFields: ['address', 'chainId'],
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"postinstall": "npm run gen:theme-typings"
},
"dependencies": {
"@apollo/client": "3.8.0-rc.1",
"@apollo/client": "^3.11.8",
"@balancer/sdk": "^0.25.0",
"@chakra-ui/anatomy": "^2.2.2",
"@chakra-ui/hooks": "^2.2.1",
Expand All @@ -46,10 +46,10 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@nikolovlazar/chakra-ui-prose": "^1.2.1",
"@rainbow-me/rainbowkit": "^2.1.3",
"@rainbow-me/rainbowkit": "^2.1.6",
"@sentry/nextjs": "^8.13.0",
"@studio-freight/react-lenis": "^0.0.47",
"@tanstack/react-query": "^5.29.2",
"@tanstack/react-query": "^5.56.2",
"@tanstack/react-query-devtools": "^5.56.0",
"@tanstack/react-table": "^8.9.3",
"@vercel/speed-insights": "^1.0.1",
Expand Down Expand Up @@ -89,7 +89,7 @@
"wagmi": "^2.12.11"
},
"devDependencies": {
"@apollo/experimental-nextjs-app-support": "^0.8.0",
"@apollo/experimental-nextjs-app-support": "^0.11.3",
"@chakra-ui/cli": "^2.4.1",
"@chakra-ui/styled-system": "^2.9.2",
"@graphql-codegen/cli": "^5.0.0",
Expand Down Expand Up @@ -135,8 +135,8 @@
"stylelint-config-standard": "^33.0.0",
"stylelint-prettier": "^3.0.0",
"typescript": "5.4.5",
"vitest": "1.4.0",
"vitest-mock-extended": "^1.3.1"
"vitest": "^2.1.1",
"vitest-mock-extended": "^2.0.2"
},
"pnpm": {
"peerDependencyRules": {
Expand Down
Loading
Loading