Skip to content

Commit a024bb3

Browse files
authored
chore(platform): Migrate docs to next 15 (#11889)
1 parent 66af8c8 commit a024bb3

File tree

9 files changed

+891
-408
lines changed

9 files changed

+891
-408
lines changed

.eslintrc.js

-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,10 @@
1-
/* eslint-env node */
2-
/* eslint import/no-nodejs-modules:0 */
3-
41
module.exports = {
52
extends: ['sentry-docs', 'plugin:@next/next/recommended'],
63
globals: {
7-
jest: true,
84
Atomics: 'readonly',
95
SharedArrayBuffer: 'readonly',
106
},
117
rules: {
128
'import/no-nodejs-modules': 'off',
139
},
14-
overrides: [
15-
{
16-
files: ['*.ts', '*.tsx'],
17-
rules: {
18-
// Reach is vendored into gatsby. They have their own webpack
19-
// resolution for it which this eslint plugin can't seem to detect
20-
'import/no-unresolved': ['error', {ignore: ['@reach']}],
21-
},
22-
},
23-
],
2410
};

app/[[...path]]/page.tsx

+6-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ function MDXLayoutRenderer({mdxSource, ...rest}) {
5858
return <MDXLayout components={mdxComponentsWithWrapper} {...rest} />;
5959
}
6060

61-
export default async function Page({params}: {params: {path?: string[]}}) {
61+
export default async function Page(props: {params: Promise<{path?: string[]}>}) {
62+
const params = await props.params;
6263
// get frontmatter of all docs in tree
6364
const rootNode = await getDocsRootNode();
6465

@@ -172,9 +173,9 @@ export default async function Page({params}: {params: {path?: string[]}}) {
172173
}
173174

174175
type MetadataProps = {
175-
params: {
176+
params: Promise<{
176177
path?: string[];
177-
};
178+
}>;
178179
};
179180

180181
// Helper function to clean up canonical tags missing leading or trailing slash
@@ -188,7 +189,8 @@ function formatCanonicalTag(tag: string) {
188189
return tag;
189190
}
190191

191-
export async function generateMetadata({params}: MetadataProps): Promise<Metadata> {
192+
export async function generateMetadata(props: MetadataProps): Promise<Metadata> {
193+
const params = await props.params;
192194
const domain = isDeveloperDocs
193195
? 'https://develop.sentry.dev'
194196
: 'https://docs.sentry.io';

app/platform-redirect/page.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ export const metadata: Metadata = {
1515
'The page you are looking for is customized for each platform. Select your platform below and we’ll direct you to the most specific documentation on it.',
1616
};
1717

18-
export default async function Page({
19-
searchParams: {next = '', platform},
20-
}: {
21-
searchParams: {[key: string]: string | string[] | undefined};
18+
export default async function Page(props: {
19+
searchParams: Promise<{[key: string]: string | string[] | undefined}>;
2220
}) {
21+
const searchParams = await props.searchParams;
22+
23+
let next = searchParams.next || '';
24+
const platform = searchParams.platform;
25+
2326
if (Array.isArray(next)) {
2427
next = next[0];
2528
}

jest-preprocess.js

-8
This file was deleted.

jest.config.js

-25
This file was deleted.

next-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
/// <reference types="next/navigation-types/compat/navigation" />
44

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

next.config.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ const {codecovNextJSWebpackPlugin} = require('@codecov/nextjs-webpack-plugin');
44
const {withSentryConfig} = require('@sentry/nextjs');
55

66
const outputFileTracingExcludes = process.env.NEXT_PUBLIC_DEVELOPER_DOCS
7-
? {}
7+
? {
8+
'/**/*': ['./.git/**/*', './apps/**/*', 'docs/**/*'],
9+
}
810
: {
911
'/**/*': [
1012
'./.git/**/*',
@@ -24,14 +26,9 @@ const outputFileTracingExcludes = process.env.NEXT_PUBLIC_DEVELOPER_DOCS
2426
/** @type {import('next').NextConfig} */
2527
const nextConfig = {
2628
pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],
27-
2829
trailingSlash: true,
29-
30-
experimental: {
31-
serverComponentsExternalPackages: ['rehype-preset-minify'],
32-
outputFileTracingExcludes,
33-
},
34-
30+
serverExternalPackages: ['rehype-preset-minify'],
31+
outputFileTracingExcludes,
3532
webpack: (config, options) => {
3633
config.plugins.push(
3734
codecovNextJSWebpackPlugin({

package.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"@google-cloud/storage": "^7.7.0",
4343
"@mdx-js/loader": "^3.0.0",
4444
"@mdx-js/react": "^3.0.0",
45-
"@next/mdx": "^14.2.4",
4645
"@popperjs/core": "^2.11.8",
4746
"@prettier/plugin-xml": "^3.3.1",
4847
"@radix-ui/colors": "^3.0.0",
@@ -68,16 +67,16 @@
6867
"mdx-bundler": "^10.0.1",
6968
"mermaid": "^11.4.0",
7069
"micromark": "^4.0.0",
71-
"next": "14.2.4",
70+
"next": "15.0.3",
7271
"next-mdx-remote": "^4.4.1",
7372
"next-themes": "^0.3.0",
7473
"nextjs-toploader": "^1.6.6",
7574
"parse-numeric-range": "^1.3.0",
7675
"platformicons": "^6.0.3",
7776
"prism-sentry": "^1.0.2",
7877
"query-string": "^6.13.1",
79-
"react": "^18",
80-
"react-dom": "^18",
78+
"react": "rc",
79+
"react-dom": "rc",
8180
"react-feather": "^2.0.8",
8281
"react-popper": "^2.3.0",
8382
"react-select": "^5.7.3",
@@ -106,14 +105,14 @@
106105
"@tailwindcss/forms": "^0.5.7",
107106
"@tailwindcss/typography": "^0.5.10",
108107
"@types/node": "^20",
109-
"@types/react": "^18",
110-
"@types/react-dom": "^18",
108+
"@types/react": "18.3.12",
109+
"@types/react-dom": "18.3.1",
111110
"@types/ws": "^8.5.10",
112111
"autoprefixer": "^10.4.17",
113112
"concurrently": "^8.2.2",
114113
"dotenv-cli": "^7.4.1",
115114
"eslint": "^8",
116-
"eslint-config-next": "14.0.1",
115+
"eslint-config-next": "15.0.3",
117116
"eslint-config-sentry-docs": "^1.118.0",
118117
"jest": "^29.5.0",
119118
"jest-dom": "^4.0.0",
@@ -131,4 +130,4 @@
131130
"node": "20.11.0",
132131
"yarn": "1.22.21"
133132
}
134-
}
133+
}

0 commit comments

Comments
 (0)