Skip to content

Commit

Permalink
test cache 2
Browse files Browse the repository at this point in the history
  • Loading branch information
vnugent committed Apr 26, 2024
1 parent 3c51d50 commit cd906a8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 28 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dependencies": {
"@algolia/autocomplete-js": "1.7.1",
"@algolia/autocomplete-theme-classic": "1.7.1",
"@apollo/client": "^3.9.10",
"@apollo/experimental-nextjs-app-support": "^0.9.1",
"@apollo/client": "^3.10.1",
"@apollo/experimental-nextjs-app-support": "^0.10.0",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
Expand Down
5 changes: 3 additions & 2 deletions src/app/(default)/header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import clx from 'classnames'
import Link from 'next/link'

import OpenBetaLogo from '@/assets/brand/openbeta-logo'
import { DesktopHeader } from './components/DesktopHeader'
Expand Down Expand Up @@ -26,9 +27,9 @@ export enum LogoSize {
*/
export const Logo: React.FC<{ size?: LogoSize, className?: string, withText?: boolean }> = ({ size = LogoSize.sm, className, withText = false }) => {
return (
<a href='/' className='flex items-center gap-2'>
<Link href='/' className='flex items-center gap-2'>
<OpenBetaLogo className={clx(size, className)} />
{withText && <span className='font-bold text-lg tracking-tight'>OpenBeta</span>}
</a>
</Link>
)
}
3 changes: 2 additions & 1 deletion src/app/(maps)/components/ProfileMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client'
import Link from 'next/link'
import { SessionProvider } from 'next-auth/react'
import { House } from '@phosphor-icons/react/dist/ssr'
import AuthenticatedProfileNavButton from '@/components/AuthenticatedProfileNavButton'
Expand All @@ -9,7 +10,7 @@ export const ProfileMenu: React.FC = () => {
<SessionProvider>
<div className='absolute right-4 top-4 z-50'>
<nav className='flex items-center gap-2'>
<a className='btn glass' href='/'><House size={18} />Home</a>
<Link className='btn glass' href='/'><House size={18} />Home</Link>
<AuthenticatedProfileNavButton isMobile={false} />
</nav>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/js/graphql/ServerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (uri === '' || uri == null) {
throw new Error('NEXT_PUBLIC_API_SERVER is not set')
}

export const { getClient: getClientForServerComponent } = registerApolloClient(() => {
export const { getClient } = registerApolloClient(() => {
return new ApolloClient({
cache: new InMemoryCache(),
link: new HttpLink({
Expand Down
3 changes: 1 addition & 2 deletions src/js/graphql/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import AwesomeDebouncePromise from 'awesome-debounce-promise'

import { AreaType, ClimbType, TickType, MediaByUsers, CountrySummaryType, MediaWithTags } from '../types'
import { graphqlClient } from './Client'
import { getClientForServerComponent } from './ServerClient'

import { CORE_CRAG_FIELDS, QUERY_CRAGS_WITHIN, QUERY_TICKS_BY_USER_AND_CLIMB, QUERY_TICKS_BY_USER, QUERY_ALL_COUNTRIES } from './gql/fragments'
import { QUERY_MEDIA_FOR_FEED } from './gql/tags'
Expand Down Expand Up @@ -88,7 +87,7 @@ export const getAreaByUUID = (uuid: string): AreaType | null => {

export const getMediaForFeed = async (maxUsers: number, maxFiles: number): Promise<MediaByUsers[]> => {
try {
const rs = await getClientForServerComponent().query<{ getMediaForFeed: MediaByUsers[] }>({
const rs = await graphqlClient.query<{ getMediaForFeed: MediaByUsers[] }>({
query: QUERY_MEDIA_FOR_FEED,
variables: {
maxUsers,
Expand Down
4 changes: 2 additions & 2 deletions src/js/graphql/getPopularAreasUSA.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { gql } from '@apollo/client'

import { FRAGMENT_MEDIA_WITH_TAGS } from './gql/tags'
import { getClientForServerComponent } from './ServerClient'
import { getClient } from './ServerClient'

import { AreaType } from '../types'

Expand Down Expand Up @@ -80,7 +80,7 @@ export interface USAToCProps {
}

export const getPopularAreasInUSA = async (): Promise<USAToCProps> => {
const rs = await getClientForServerComponent().query<USAToCProps>({
const rs = await getClient().query<USAToCProps>({
query,
variables: {
filter: {
Expand Down
36 changes: 18 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@
"@jridgewell/gen-mapping" "^0.3.0"
"@jridgewell/trace-mapping" "^0.3.9"

"@apollo/client-react-streaming@0.9.1":
version "0.9.1"
resolved "https://registry.yarnpkg.com/@apollo/client-react-streaming/-/client-react-streaming-0.9.1.tgz#f3a5c17dc57bf7d42bc5e13af17bb3a3a9a36603"
integrity sha512-Drzx/4/nGmJ+gjJe3DEQ/9ib3Uc2WoZ4V1SiuHRLXNjUFX65RGa88XgOLZmTNbivD43uF7BvbiaMi/1Vd8DNYA==
"@apollo/client-react-streaming@0.10.0":
version "0.10.0"
resolved "https://registry.yarnpkg.com/@apollo/client-react-streaming/-/client-react-streaming-0.10.0.tgz#1f9a818c679b41791ca02105f16525c93412994c"
integrity sha512-iZ2jYghRS71xFv6O3Js5Ojrrmk4SnIEKwPRKIswQyAtqjHrfvUTyXCDzxrhPcGQe/y7su/XcE7Xp0kOp7yTnlg==
dependencies:
superjson "^1.12.2 || ^2.0.0"
ts-invariant "^0.10.3"

"@apollo/client@^3.9.10":
version "3.9.10"
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.9.10.tgz#f381f67f3559cb5f5b66ce9183f84f49616acbe4"
integrity sha512-w8i/Lk1P0vvWZF0Xb00XPonn79/0rgRJ1vopBlVudVuy9QP29/NZXK0rI2xJIN6VrKuEqJZaVGJC+7k23I2sfA==
"@apollo/client@^3.10.1":
version "3.10.1"
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.10.1.tgz#4c8eec28fcce25b96f27c1f1e443ec5c676e4de0"
integrity sha512-QNacQBZzJla5UQ/LLBXJWM7/1v1C5cfpMQPAFjW4hg4T54wHWbg4Dr+Dp6N+hy/ygu8tepdM+/y/5VFLZhovlQ==
dependencies:
"@graphql-typed-document-node/core" "^3.1.1"
"@wry/caches" "^1.0.0"
Expand All @@ -81,19 +81,19 @@
hoist-non-react-statics "^3.3.2"
optimism "^0.18.0"
prop-types "^15.7.2"
rehackt "0.0.6"
rehackt "^0.1.0"
response-iterator "^0.2.6"
symbol-observable "^4.0.0"
ts-invariant "^0.10.3"
tslib "^2.3.0"
zen-observable-ts "^1.2.5"

"@apollo/experimental-nextjs-app-support@^0.9.1":
version "0.9.1"
resolved "https://registry.yarnpkg.com/@apollo/experimental-nextjs-app-support/-/experimental-nextjs-app-support-0.9.1.tgz#6ee9e047a5e1f9e85b8c6bf40a8c8d6948bf6ef5"
integrity sha512-a7cqLbszqSjyR3RqEhOIG+zBO8wjN1oc9oswcRHQB4PSb+W0lKSN1zALCuaV7zCAEPlsxLotj/qLLVUyFyuwLQ==
"@apollo/experimental-nextjs-app-support@^0.10.0":
version "0.10.0"
resolved "https://registry.yarnpkg.com/@apollo/experimental-nextjs-app-support/-/experimental-nextjs-app-support-0.10.0.tgz#2fe52e6bc18de87c17bfc2bc78ec63acf8260c8f"
integrity sha512-S3mfZRnAAAaKwA8RNckS4TWYLX5utpmRTwG3WGFtpooYx8QQG8xft0p0a9eTQ53Jrw3nSMJc/wOOsT/5noMCQg==
dependencies:
"@apollo/client-react-streaming" "0.9.1"
"@apollo/client-react-streaming" "0.10.0"

"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.13":
version "7.22.13"
Expand Down Expand Up @@ -8298,10 +8298,10 @@ regjsparser@^0.9.1:
dependencies:
jsesc "~0.5.0"

rehackt@0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/rehackt/-/rehackt-0.0.6.tgz#7a0a2247f2295e7548915417e44fbbf03bf004f4"
integrity sha512-l3WEzkt4ntlEc/IB3/mF6SRgNHA6zfQR7BlGOgBTOmx7IJJXojDASav+NsgXHFjHn+6RmwqsGPFgZpabWpeOdw==
rehackt@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/rehackt/-/rehackt-0.1.0.tgz#a7c5e289c87345f70da8728a7eb878e5d03c696b"
integrity sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==

remark-parse@^11.0.0:
version "11.0.0"
Expand Down

0 comments on commit cd906a8

Please sign in to comment.