Skip to content

Commit d1a13fe

Browse files
committed
chore: upgrade nextjs & react for all webapps
1 parent 99acefa commit d1a13fe

File tree

21 files changed

+2285
-2360
lines changed

21 files changed

+2285
-2360
lines changed

apps/api-reference/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

apps/api-reference/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@amplitude/analytics-browser": "^2.9.0",
2222
"@amplitude/plugin-autocapture-browser": "^0.9.0",
2323
"@floating-ui/react": "^0.26.17",
24-
"@headlessui/react": "^2.0.4",
24+
"@headlessui/react": "^2.2.0",
2525
"@heroicons/react": "^2.1.4",
2626
"@next/third-parties": "^14.2.4",
2727
"@pythnetwork/client": "^2.22.0",
@@ -33,11 +33,11 @@
3333
"connectkit": "^1.8.2",
3434
"cryptocurrency-icons": "^0.18.1",
3535
"framer-motion": "^11.3.8",
36-
"next": "^14.2.4",
36+
"next": "catalog:",
3737
"next-themes": "^0.3.0",
3838
"pino": "^9.2.0",
39-
"react": "^18.3.1",
40-
"react-dom": "^18.3.1",
39+
"react": "catalog:",
40+
"react-dom": "catalog:",
4141
"react-markdown": "^9.0.1",
4242
"shiki": "^1.7.0",
4343
"viem": "^2.21.32",
@@ -46,16 +46,16 @@
4646
},
4747
"devDependencies": {
4848
"@axe-core/react": "^4.9.1",
49-
"@cprussin/eslint-config": "^3.0.0",
50-
"@cprussin/jest-config": "^1.4.1",
51-
"@cprussin/prettier-config": "^2.1.1",
52-
"@cprussin/tsconfig": "^3.0.1",
49+
"@cprussin/eslint-config": "catalog:",
50+
"@cprussin/jest-config": "catalog:",
51+
"@cprussin/prettier-config": "catalog:",
52+
"@cprussin/tsconfig": "catalog:",
5353
"@svgr/webpack": "^8.1.0",
5454
"@tailwindcss/forms": "^0.5.7",
5555
"@types/jest": "^29.5.12",
5656
"@types/node": "^20.14.6",
57-
"@types/react": "^18.3.3",
58-
"@types/react-dom": "^18.3.0",
57+
"@types/react": "catalog:",
58+
"@types/react-dom": "catalog:",
5959
"autoprefixer": "^10.4.19",
6060
"eslint": "^9.5.0",
6161
"jest": "^29.7.0",

apps/api-reference/src/app/price-feeds/[chain]/[method]/page.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
"use client";
22

33
import { notFound } from "next/navigation";
4-
import type { ComponentProps } from "react";
4+
import { type ComponentProps, use } from "react";
55

66
import * as apis from "../../../../apis";
77
import { EvmApi } from "../../../../components/EvmApi";
88

99
type Props = {
10-
params: {
10+
params: Promise<{
1111
chain: string;
1212
method: string;
13-
};
13+
}>;
1414
};
1515

16-
const Page = ({ params }: Props) => {
16+
const Page = (props: Props) => {
17+
const params = use(props.params);
1718
const chain: (typeof apis)[keyof typeof apis] | undefined = isKeyOf(
1819
params.chain,
1920
apis,

apps/api-reference/src/components/Code/use-highlighted-code.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import {
44
type ReactNode,
5-
type MutableRefObject,
5+
type RefObject,
66
createContext,
77
useContext,
88
useState,
@@ -17,15 +17,15 @@ import type { SupportedLanguage } from "./supported-language";
1717
import { getLogger } from "../../browser-logger";
1818

1919
const HighlighterContext = createContext<
20-
undefined | MutableRefObject<undefined | Highlighter>
20+
undefined | RefObject<undefined | Highlighter>
2121
>(undefined);
2222

2323
export const HighlighterProvider = ({
2424
children,
2525
}: {
2626
children: ReactNode | ReactNode[];
2727
}) => {
28-
const highlighterRef = useRef<undefined | Highlighter>();
28+
const highlighterRef = useRef<undefined | Highlighter>(undefined);
2929
return (
3030
<HighlighterContext.Provider value={highlighterRef}>
3131
{children}

apps/api-reference/src/components/EvmApi/parameter-input.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,8 @@ const PriceFeedListOptions = ({ priceFeedList }: PriceFeedListOptionsProps) => {
137137
</div>
138138
) : (
139139
<ComboboxOptions className="h-80 overflow-y-auto py-1" modal={false}>
140-
{({ option }) => {
141-
// The `option` parameter is typed as `unknown` and we have to
142-
// cast to get it to be correctly typed, see
143-
// https://github.com/tailwindlabs/headlessui/issues/3326
144-
const { feedId, name, description } = option as PriceFeed;
140+
{({ option }: { option: PriceFeed }) => {
141+
const { feedId, name, description } = option;
145142
return (
146143
<ComboboxOption
147144
key={feedId}

apps/api-reference/src/components/Markdown/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type ComponentProps, Fragment } from "react";
1+
import { type ComponentProps } from "react";
22
import MarkdownComponent from "react-markdown";
33

44
import { MARKDOWN_COMPONENTS } from "../../markdown-components";
@@ -12,7 +12,7 @@ export const Markdown = ({ inline, ...props }: Props) =>
1212
<MarkdownComponent
1313
components={{
1414
...MARKDOWN_COMPONENTS,
15-
p: ({ children }) => <Fragment>{children}</Fragment>,
15+
p: ({ children }) => <>{children}</>,
1616
}}
1717
{...props}
1818
/>

apps/api-reference/src/markdown-components.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export const MARKDOWN_COMPONENTS = {
3131
</Code>
3232
);
3333
} else {
34+
// @ts-expect-error react-markdown doesn't officially support react 19
35+
// yet; there's no issues here in practice but the types don't currently
36+
// unify
3437
return <pre {...props} />;
3538
}
3639
},

apps/staking/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

apps/staking/package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"pull:env": "[ $CI ] || VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID=prj_3TIYzlYYncZx7wRtfmzG2YUsNzKp vercel env pull",
1414
"start:dev": "next dev --port 3001",
1515
"start:prod": "next start --port 3001",
16-
"test:format": "jest --selectProjects format",
16+
"test:format": "prettier --check .",
1717
"test:lint": "jest --selectProjects lint",
1818
"test:types": "tsc",
1919
"test:unit": "jest --selectProjects unit"
@@ -34,34 +34,35 @@
3434
"@solana/wallet-adapter-react-ui": "^0.9.35",
3535
"@solana/wallet-adapter-wallets": "0.19.10",
3636
"@solana/web3.js": "1.92.3",
37+
"@vercel/functions": "^1.5.0",
3738
"bcp-47": "^2.1.0",
3839
"clsx": "^2.1.1",
3940
"dnum": "^2.13.1",
40-
"framer-motion": "^11.3.8",
41+
"framer-motion": "catalog:",
4142
"ip-range-check": "^0.2.0",
42-
"next": "^14.2.5",
43+
"next": "catalog:",
4344
"pino": "^9.3.2",
4445
"proxycheck-ts": "^0.0.11",
45-
"react": "^18.3.1",
46+
"react": "catalog:",
4647
"react-aria": "^3.34.3",
4748
"react-aria-components": "^1.3.3",
48-
"react-dom": "^18.3.1",
49-
"recharts": "^2.12.7",
49+
"react-dom": "catalog:",
50+
"recharts": "^2.13.2",
5051
"swr": "^2.2.5",
5152
"zod": "^3.23.8"
5253
},
5354
"devDependencies": {
5455
"@axe-core/react": "^4.9.1",
55-
"@cprussin/eslint-config": "^3.0.0",
56-
"@cprussin/jest-config": "^1.4.1",
57-
"@cprussin/prettier-config": "^2.1.1",
58-
"@cprussin/tsconfig": "^3.0.1",
56+
"@cprussin/eslint-config": "catalog:",
57+
"@cprussin/jest-config": "catalog:",
58+
"@cprussin/prettier-config": "catalog:",
59+
"@cprussin/tsconfig": "catalog:",
5960
"@svgr/webpack": "^8.1.0",
6061
"@tailwindcss/forms": "^0.5.7",
6162
"@types/jest": "^29.5.12",
6263
"@types/node": "^22.0.0",
63-
"@types/react": "^18.3.3",
64-
"@types/react-dom": "^18.3.0",
64+
"@types/react": "catalog:",
65+
"@types/react-dom": "catalog:",
6566
"autoprefixer": "^10.4.19",
6667
"eslint": "^9.8.0",
6768
"jest": "^29.7.0",

apps/staking/src/components/ErrorMessage/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ const UnknownError = ({ error }: { error: unknown }) => {
4949
</div>
5050
</Button>
5151
<m.div
52+
// @ts-expect-error the framer-motion types don't currently expose props
53+
// like `className` correctly for some reason, even though this works
54+
// correctly...
5255
className="overflow-hidden pt-1 opacity-60"
5356
initial={{ height: 0 }}
5457
animate={{ height: detailsOpen ? "auto" : 0 }}

0 commit comments

Comments
 (0)