Skip to content

Commit 27ba93a

Browse files
authored
Merge pull request #1414 from scroll-tech/upgrade-nextjs-15
Upgrade nextjs 15
2 parents 053ab8f + fbbeb3d commit 27ba93a

File tree

156 files changed

+3423
-2191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+3423
-2191
lines changed

next.config.mjs

+46-33
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,61 @@
33
// eslint-disable-next-line prettier/prettier
44
import packageJson from "./package.json" with { type: "json" };
55
import "./scripts/download-blog-posts.data.json.mjs"
6+
import createMDX from "@next/mdx"
7+
import rehypeRaw from "rehype-raw"
8+
import rehypeKatex from "rehype-katex"
9+
import remarkGfm from "remark-gfm"
10+
import remarkMath from "remark-math"
611

712
// const { withSentryConfig } = require("@sentry/nextjs")
813

914
const nextConfig = {
1015
env: {
1116
NEXT_PUBLIC_VERSION: packageJson.version,
12-
NEXT_PUBLIC_FRONTENDS_URL: process.env.VERCEL_ENV === "production" ? "https://scroll.io" : process.env.VERCEL_BRANCH_URL?`https://${process.env.VERCEL_BRANCH_URL}`:"http://localhost:3000",
17+
NEXT_PUBLIC_FRONTENDS_URL:
18+
process.env.VERCEL_ENV === "production"
19+
? "https://scroll.io"
20+
: process.env.VERCEL_BRANCH_URL
21+
? `https://${process.env.VERCEL_BRANCH_URL}`
22+
: "http://localhost:3000",
1323
},
1424
images: {
1525
deviceSizes: [600, 900, 1200, 1536],
26+
remotePatterns: [
27+
{
28+
protocol: "https",
29+
hostname: "scroll-tech.github.io",
30+
port: "",
31+
pathname: "/token-list/data/**",
32+
},
33+
{
34+
protocol: "https",
35+
hostname: "scroll-eco-list.netlify.app",
36+
port: "",
37+
pathname: "/logos/**",
38+
},
39+
],
1640
},
41+
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
1742
// trailingSlash: true,
1843
async headers() {
1944
return [
2045
{
21-
source: '/(.*)',
46+
source: "/(.*)",
2247
headers: [
2348
{
24-
key: 'X-Frame-Options',
25-
value: 'DENY'
49+
key: "X-Frame-Options",
50+
value: "DENY",
2651
},
2752
{
28-
key: 'Content-Security-Policy',
29-
value: "frame-ancestors 'none'"
30-
}
31-
]
32-
}
53+
key: "Content-Security-Policy",
54+
value: "frame-ancestors 'none'",
55+
},
56+
],
57+
},
3358
]
3459
},
35-
60+
3661
async redirects() {
3762
return [
3863
{
@@ -56,7 +81,6 @@ const nextConfig = {
5681

5782
{ source: "/sticker-vote", destination: "/sticker-winners", permanent: true },
5883
// { source: "/airdrop-faq", destination: "https://scroll-faqs.gitbook.io/faqs", permanent: false},
59-
6084
]
6185
},
6286
async rewrites() {
@@ -67,22 +91,6 @@ const nextConfig = {
6791
}
6892
]
6993
},
70-
images: {
71-
remotePatterns: [
72-
{
73-
protocol: "https",
74-
hostname: "scroll-tech.github.io",
75-
port: "",
76-
pathname: "/token-list/data/**",
77-
},
78-
{
79-
protocol: "https",
80-
hostname: "scroll-eco-list.netlify.app",
81-
port: "",
82-
pathname: "/logos/**",
83-
},
84-
],
85-
},
8694
// eslint-disable-next-line
8795
webpack: (config, { buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }) => {
8896
config.ignoreWarnings = [
@@ -131,11 +139,6 @@ const nextConfig = {
131139
},
132140
],
133141
},
134-
// .md
135-
{
136-
test: /\.md$/,
137-
use: "raw-loader",
138-
},
139142
],
140143
)
141144

@@ -171,7 +174,6 @@ const nextConfig = {
171174
// automaticVercelMonitors: true,
172175
// },
173176
}
174-
export default nextConfig
175177
// Injected content via Sentry wizard below
176178

177179
// module.exports = withSentryConfig(nextConfig, {
@@ -185,3 +187,14 @@ export default nextConfig
185187
// project: process.env.SENTRY_PROJECT,
186188
// authToken: process.env.SENTRY_AUTH_TOKEN,
187189
// })
190+
191+
const withMDX = createMDX({
192+
// Add markdown plugins here, as desired
193+
options: {
194+
remarkPlugins: [remarkGfm, remarkMath],
195+
rehypePlugins: [rehypeKatex, rehypeRaw],
196+
},
197+
})
198+
199+
// Merge MDX config with Next.js config
200+
export default withMDX(nextConfig)

package.json

+27-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scroll.io",
3-
"version": "5.4.0",
3+
"version": "5.4.1",
44
"private": false,
55
"license": "MIT",
66
"scripts": {
@@ -20,42 +20,46 @@
2020
"@emotion/server": "^11.11.0",
2121
"@emotion/styled": "^11.11.0",
2222
"@ethereum-attestation-service/eas-sdk": "^1.5.0",
23-
"@mui/icons-material": "^5.8.4",
24-
"@mui/lab": "^5.0.0-alpha.108",
25-
"@mui/material": "^5.13.5",
26-
"@mui/material-nextjs": "^5.15.5",
23+
"@mdx-js/loader": "^3.1.0",
24+
"@mdx-js/react": "^3.1.0",
25+
"@mui/icons-material": "6",
26+
"@mui/lab": "^6.0.0-beta.23",
27+
"@mui/material": "6",
28+
"@mui/material-nextjs": "6",
2729
"@next/third-parties": "^15.1.5",
30+
"@next/mdx": "^15.1.5",
2831
"@rainbow-me/rainbowkit": "^2.1.2",
2932
"@sentry/nextjs": "^7.95.0",
3033
"@tanstack/react-query": "^5.55.3",
34+
"@tanstack/react-virtual": "^3.11.2",
35+
"@types/mdx": "^2.0.13",
3136
"@typescript-eslint/parser": "^8.4.0",
3237
"copy-to-clipboard": "^3.3.2",
3338
"dayjs": "^1.11.5",
3439
"ethers": "6.12.0",
35-
"framer-motion": "^9.0.4",
3640
"immer": "^9.0.7",
3741
"lodash": "^4.17.21",
38-
"next": "14.2.19",
42+
"motion": "^11.18.1",
43+
"next": "15.1.4",
3944
"notistack": "^3.0.1",
4045
"number-flip": "^1.2.3",
4146
"numbro": "^2.3.6",
4247
"path-to-regexp": "^6.2.1",
43-
"react": "^18.2.0",
48+
"react": "19.0.0",
4449
"react-awesome-reveal": "^4.2.5",
4550
"react-cool-img": "^1.2.12",
4651
"react-countdown": "^2.3.2",
4752
"react-device-detect": "^2.2.3",
48-
"react-dom": "^18.2.0",
53+
"react-dom": "19.0.0",
4954
"react-fast-marquee": "^1.6.5",
5055
"react-mailchimp-subscribe": "^2.1.3",
51-
"react-markdown": "^8.0.3",
56+
"react-markdown": "^9.0.3",
5257
"react-use": "^17.4.0",
53-
"react-virtualized": "^9.22.5",
54-
"rehype-katex": "^6.0.2",
55-
"rehype-raw": "^6.1.1",
58+
"rehype-katex": "^7.0.1",
59+
"rehype-raw": "^7.0.0",
5660
"rehype-sanitize": "^6.0.0",
57-
"remark-gfm": "^3.0.1",
58-
"remark-math": "^5.1.1",
61+
"remark-gfm": "^4.0.0",
62+
"remark-math": "^6.0.0",
5963
"squirrel-gill": "1.0.5",
6064
"swiper": "^10.1.0",
6165
"swr": "^2.1.3",
@@ -73,15 +77,15 @@
7377
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
7478
"@types/lodash": "^4.14.186",
7579
"@types/node": "^20.10.6",
76-
"@types/react": "^18.0.15",
77-
"@types/react-dom": "^18.0.6",
80+
"@types/react": "19.0.4",
81+
"@types/react-dom": "19.0.2",
7882
"@types/react-helmet": "^6.1.6",
7983
"@types/three": "^0.128.0",
8084
"@typescript-eslint/eslint-plugin": "^8.4.0",
8185
"autoprefixer": "^10.4.12",
8286
"cross-env": "^7.0.3",
8387
"eslint": "^8",
84-
"eslint-config-next": "14.0.4",
88+
"eslint-config-next": "15.1.4",
8589
"eslint-config-prettier": "^9.1.0",
8690
"eslint-plugin-prettier": "^5.1.3",
8791
"husky": "^8.0.2",
@@ -96,5 +100,9 @@
96100
"engines": {
97101
"node": "22.x"
98102
},
99-
"packageManager": "[email protected]"
103+
"packageManager": "[email protected]",
104+
"resolutions": {
105+
"@types/react": "19.0.4",
106+
"@types/react-dom": "19.0.2"
107+
}
100108
}

src/apis/blog.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export const blogOrigin = "https://scroll-blog-list.netlify.app"
2-
export const blogListUrl = blogOrigin + "/docs/"
3-
export const blogListLogoUrl = blogOrigin + "/covers/"
1+
export const blogOrigin = "https://blog.scroll.cat"
2+
3+
export const fetchBlogDetailURL = (blogId: string) => `${blogOrigin}/api/post/${blogId}.md?title=1`

src/app/SCR-sSCR/Explaination/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import SectionHeader from "@/components/SectionHeader"
1313
import data from "./data"
1414

1515
const Explaination = () => {
16-
const wrapperRef = useRef()
16+
const wrapperRef = useRef<HTMLDivElement>(null)
1717

1818
return (
1919
<ScrollExpandedBg sx={{ pt: ["6rem", "9.6rem"], pb: ["8rem", "14rem"] }} anchorEl={wrapperRef} fastScrollIn>

src/app/_canvas-and-badges/Badges/BadgeList/BadgeCard.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ const BadgeCard = props => {
8686
style={{ height: isMobile ? "6.4rem" : "8rem", aspectRatio: "1 / 1", borderRadius: "0.45rem" }}
8787
/>
8888
<Typography
89-
sx={[
90-
{ fontSize: ["1.8rem", "2rem"], lineHeight: "3.2rem", fontWeight: 600, maxWidth: "100%" },
91-
theme => (theme as any).vars.singleLineEllipsis,
92-
]}
89+
sx={[{ fontSize: ["1.8rem", "2rem"], lineHeight: "3.2rem", fontWeight: 600, maxWidth: "100%" }, theme => theme.singleLineEllipsis]}
9390
>
9491
{name}
9592
</Typography>

0 commit comments

Comments
 (0)