Skip to content

Commit b3c0269

Browse files
committed
Merge branch 'master' into fix-header-onbarding-overlap
2 parents 515df01 + afbe581 commit b3c0269

File tree

531 files changed

+6692
-3155
lines changed

Some content is hidden

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

531 files changed

+6692
-3155
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "📝 Documentation on develop.sentry.dev"
2+
labels: ["Type: Content", "Develop"]
3+
description: Missing, incorrect, or unclear developer documentation.
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |-
8+
Is the documentation issue something you know how to fix? Consider contributing to Open Source by opening a PR to fix it instead!
9+
- type: input
10+
id: area-specific
11+
attributes:
12+
label: Which section?
13+
description: Which section of the developer documentation needs to be updated?
14+
validations:
15+
required: true
16+
- type: input
17+
id: page-url
18+
attributes:
19+
label: Page URL
20+
description: Please provide the URL of the page which should be changed (if applicable).
21+
- type: textarea
22+
id: description
23+
attributes:
24+
label: Description
25+
description: What were you looking for/trying to do/expecting?
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: solution
30+
attributes:
31+
label: Suggested Solution
32+
description: If you have an idea on how we can solve this, please share.
33+
- type: markdown
34+
attributes:
35+
value: |-
36+
## Thanks 🙏
37+
Check our [triage docs](https://open.sentry.io/triage/) for what to expect next.
38+

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

Lines changed: 81 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ import {Home} from 'sentry-docs/components/home';
1111
import {Include} from 'sentry-docs/components/include';
1212
import {PlatformContent} from 'sentry-docs/components/platformContent';
1313
import {
14+
DocNode,
1415
getCurrentPlatformOrGuide,
1516
getDocsRootNode,
17+
getNextNode,
18+
getPreviousNode,
1619
nodeForPath,
1720
} from 'sentry-docs/docTree';
1821
import {isDeveloperDocs} from 'sentry-docs/isDeveloperDocs';
@@ -24,6 +27,7 @@ import {
2427
} from 'sentry-docs/mdx';
2528
import {mdxComponents} from 'sentry-docs/mdxComponents';
2629
import {setServerContext} from 'sentry-docs/serverContext';
30+
import {PaginationNavNode} from 'sentry-docs/types/paginationNavNode';
2731
import {stripVersion} from 'sentry-docs/versioning';
2832

2933
export async function generateStaticParams() {
@@ -42,7 +46,11 @@ export const dynamic = 'force-static';
4246

4347
const mdxComponentsWithWrapper = mdxComponents(
4448
{Include, PlatformContent},
45-
({children, frontMatter}) => <DocPage frontMatter={frontMatter}>{children}</DocPage>
49+
({children, frontMatter, nextPage, previousPage}) => (
50+
<DocPage frontMatter={frontMatter} nextPage={nextPage} previousPage={previousPage}>
51+
{children}
52+
</DocPage>
53+
)
4654
);
4755

4856
function MDXLayoutRenderer({mdxSource, ...rest}) {
@@ -59,6 +67,42 @@ export default async function Page({params}: {params: {path?: string[]}}) {
5967
path: params.path ?? [],
6068
});
6169

70+
if (!params.path && !isDeveloperDocs) {
71+
return <Home />;
72+
}
73+
74+
const pageNode = nodeForPath(rootNode, params.path ?? '');
75+
76+
if (!pageNode) {
77+
// eslint-disable-next-line no-console
78+
console.warn('no page node', params.path);
79+
return notFound();
80+
}
81+
82+
// gather previous and next page that will be displayed in the bottom pagination
83+
const getPaginationDetails = (
84+
getNode: (node: DocNode) => DocNode | undefined | 'root',
85+
page: PaginationNavNode | undefined
86+
) => {
87+
if (page && 'path' in page && 'title' in page) {
88+
return page;
89+
}
90+
91+
const node = getNode(pageNode);
92+
93+
if (node === 'root') {
94+
return {path: '', title: 'Welcome to Sentry'};
95+
}
96+
97+
return node ? {path: node.path, title: node.frontmatter.title} : undefined;
98+
};
99+
100+
const previousPage = getPaginationDetails(
101+
getPreviousNode,
102+
pageNode?.frontmatter?.previousPage
103+
);
104+
const nextPage = getPaginationDetails(getNextNode, pageNode?.frontmatter?.nextPage);
105+
62106
if (isDeveloperDocs) {
63107
// get the MDX for the current doc and render it
64108
let doc: Awaited<ReturnType<typeof getFileBySlug>> | null = null;
@@ -74,13 +118,17 @@ export default async function Page({params}: {params: {path?: string[]}}) {
74118
}
75119
const {mdxSource, frontMatter} = doc;
76120
// pass frontmatter tree into sidebar, rendered page + fm into middle, headers into toc
77-
return <MDXLayoutRenderer mdxSource={mdxSource} frontMatter={frontMatter} />;
78-
}
79-
if (!params.path) {
80-
return <Home />;
121+
return (
122+
<MDXLayoutRenderer
123+
mdxSource={mdxSource}
124+
frontMatter={frontMatter}
125+
nextPage={nextPage}
126+
previousPage={previousPage}
127+
/>
128+
);
81129
}
82130

83-
if (params.path[0] === 'api' && params.path.length > 1) {
131+
if (params.path?.[0] === 'api' && params.path.length > 1) {
84132
const categories = await apiCategories();
85133
const category = categories.find(c => c.slug === params?.path?.[1]);
86134
if (category) {
@@ -94,14 +142,6 @@ export default async function Page({params}: {params: {path?: string[]}}) {
94142
}
95143
}
96144

97-
const pageNode = nodeForPath(rootNode, params.path);
98-
99-
if (!pageNode) {
100-
// eslint-disable-next-line no-console
101-
console.warn('no page node', params.path);
102-
return notFound();
103-
}
104-
105145
// get the MDX for the current doc and render it
106146
let doc: Awaited<ReturnType<typeof getFileBySlug>> | null = null;
107147
try {
@@ -122,7 +162,12 @@ export default async function Page({params}: {params: {path?: string[]}}) {
122162

123163
// pass frontmatter tree into sidebar, rendered page + fm into middle, headers into toc.
124164
return (
125-
<MDXLayoutRenderer mdxSource={mdxSource} frontMatter={{...frontMatter, versions}} />
165+
<MDXLayoutRenderer
166+
mdxSource={mdxSource}
167+
frontMatter={{...frontMatter, versions}}
168+
nextPage={nextPage}
169+
previousPage={previousPage}
170+
/>
126171
);
127172
}
128173

@@ -132,6 +177,17 @@ type MetadataProps = {
132177
};
133178
};
134179

180+
// Helper function to clean up canonical tags missing leading or trailing slash
181+
function formatCanonicalTag(tag: string) {
182+
if (tag.charAt(0) !== '/') {
183+
tag = '/' + tag;
184+
}
185+
if (tag.charAt(tag.length - 1) !== '/') {
186+
tag = tag + '/';
187+
}
188+
return tag;
189+
}
190+
135191
export async function generateMetadata({params}: MetadataProps): Promise<Metadata> {
136192
const domain = isDeveloperDocs
137193
? 'https://develop.sentry.dev'
@@ -142,6 +198,7 @@ export async function generateMetadata({params}: MetadataProps): Promise<Metadat
142198
: domain;
143199
let title =
144200
'Sentry Docs | Application Performance Monitoring &amp; Error Tracking Software';
201+
let customCanonicalTag;
145202
let description =
146203
'Self-hosted and cloud-based application performance monitoring &amp; error tracking that helps software teams see clearer, solve quicker, &amp; learn continuously.';
147204
const images = [{url: `${previewDomain ?? domain}/meta.jpg`, width: 1200, height: 822}];
@@ -160,13 +217,18 @@ export async function generateMetadata({params}: MetadataProps): Promise<Metadat
160217
pageNode.frontmatter.title +
161218
(guideOrPlatform ? ` | Sentry for ${guideOrPlatform.title}` : '');
162219
description = pageNode.frontmatter.description ?? '';
220+
221+
if (pageNode.frontmatter.customCanonicalTag) {
222+
customCanonicalTag = formatCanonicalTag(pageNode.frontmatter.customCanonicalTag);
223+
}
163224
}
164225
}
165226

166-
let canonical = domain;
167-
if (params.path) {
168-
canonical = `${domain}/${params.path.join('/')}/`;
169-
}
227+
const canonical = customCanonicalTag
228+
? domain + customCanonicalTag
229+
: params.path
230+
? `${domain}/${params.path.join('/')}/`
231+
: domain;
170232

171233
return {
172234
title,

app/platform-redirect/page.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {redirect} from 'next/navigation';
22

3+
import {Alert} from 'sentry-docs/components/alert';
34
import {DocPage} from 'sentry-docs/components/docPage';
45
import {PlatformIcon} from 'sentry-docs/components/platformIcon';
56
import {SmartLink} from 'sentry-docs/components/smartLink';
@@ -14,16 +15,31 @@ export default async function Page({
1415
if (Array.isArray(next)) {
1516
next = next[0];
1617
}
18+
1719
// discard the hash
1820
const [pathname, _] = next.split('#');
1921
const rootNode = await getDocsRootNode();
22+
const defaultTitle = 'Platform Specific Content';
23+
let description = '';
24+
const platformInfo =
25+
"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.";
26+
let title = defaultTitle;
27+
2028
// get rid of irrelevant platforms for the `next` path
2129
const platformList = extractPlatforms(rootNode).filter(platform_ => {
22-
return !!nodeForPath(rootNode, [
30+
const node = nodeForPath(rootNode, [
2331
'platforms',
2432
platform_.key,
2533
...pathname.split('/').filter(Boolean),
2634
]);
35+
36+
// extract title and description for displaying it on page
37+
if (node && title === defaultTitle && pathname.length > 0) {
38+
title = node.frontmatter.title ?? title;
39+
description = node.frontmatter.description || '';
40+
}
41+
42+
return !!node;
2743
});
2844

2945
if (platformList.length === 0) {
@@ -42,18 +58,16 @@ export default async function Page({
4258
}
4359

4460
const frontMatter = {
45-
title: 'Platform Specific Content',
61+
title,
62+
description,
4663
};
4764

4865
// make the Sidebar aware of the current path
4966
setServerContext({rootNode, path: ['platform-redirect']});
5067

5168
return (
5269
<DocPage frontMatter={frontMatter}>
53-
<p>
54-
The page you are looking for is customized for each platform. Select your platform
55-
below and we&apos;ll direct you to the most specific documentation on it.
56-
</p>
70+
<Alert level="info">{platformInfo}</Alert>
5771

5872
<ul>
5973
{platformList.map(p => (

apps/changelog/package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
"@radix-ui/react-icons": "^1.3.0",
2222
"@radix-ui/react-toolbar": "^1.0.4",
2323
"@radix-ui/themes": "^2.0.3",
24-
"@sentry/nextjs": "8.29.0",
24+
"@sentry/nextjs": "8.36.0-beta.0",
2525
"@spotlightjs/spotlight": "^2.1.1",
26-
"next": "^15.0.0-canary.83",
26+
"next": "15.0.0-rc.1",
2727
"next-auth": "^4.24.5",
2828
"next-mdx-remote": "^4.4.1",
2929
"nextjs-toploader": "^1.6.6",
3030
"nuqs": "^1.17.7",
3131
"prism-sentry": "^1.0.2",
32-
"react": "beta",
33-
"react-dom": "beta",
32+
"react": "19.0.0-rc-cd22717c-20241013",
33+
"react-dom": "19.0.0-rc-cd22717c-20241013",
3434
"react-select": "^5.7.3",
3535
"react-textarea-autosize": "^8.5.3",
3636
"rehype-prism-plus": "^1.6.3",
@@ -44,8 +44,8 @@
4444
"@tailwindcss/forms": "^0.5.7",
4545
"@tailwindcss/typography": "^0.5.10",
4646
"@types/node": "^20",
47-
"@types/react": "^18",
48-
"@types/react-dom": "^18.3.0",
47+
"@types/react": "npm:[email protected]",
48+
"@types/react-dom": "npm:[email protected]",
4949
"@types/rss": "^0.0.32",
5050
"autoprefixer": "^10.4.17",
5151
"dotenv-cli": "^7.4.2",
@@ -58,5 +58,9 @@
5858
},
5959
"volta": {
6060
"extends": "../../package.json"
61+
},
62+
"resolutions": {
63+
"@types/react": "npm:[email protected]",
64+
"@types/react-dom": "npm:[email protected]"
6165
}
6266
}

apps/changelog/src/app/changelog/%5Fadmin/[id]/edit/page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import Link from 'next/link';
44
import {prismaClient} from '@/server/prisma-client';
55
import {EditChangelogForm} from '@/client/components/forms/editChangelogForm';
66

7-
export default async function ChangelogCreatePage({params}: {params: {id: string}}) {
7+
export default async function ChangelogCreatePage(props: {
8+
params: Promise<{id: string}>;
9+
}) {
10+
const params = await props.params;
811
const categories = await prismaClient.category.findMany({
912
orderBy: {
1013
name: 'asc',

apps/changelog/src/app/changelog/[slug]/page.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ import {mdxOptions} from '@/server/mdxOptions';
1616
export const dynamic = 'force-dynamic';
1717

1818
export async function generateMetadata(
19-
{params}: {params: {slug: string}},
19+
props: {params: Promise<{slug: string}>},
2020
parent: ResolvingMetadata
2121
): Promise<Metadata> {
22+
const params = await props.params;
2223
let changelog: Changelog | null = null;
2324
try {
2425
changelog = await getChangelog(params.slug);
@@ -57,7 +58,8 @@ const getChangelog = unstable_cache(
5758
{tags: ['changelog-detail']}
5859
);
5960

60-
export default async function ChangelogEntry({params}: {params: {slug: string}}) {
61+
export default async function ChangelogEntry(props: {params: Promise<{slug: string}>}) {
62+
const params = await props.params;
6163
const changelog = await getChangelog(params.slug);
6264

6365
if (!changelog) {

develop-docs/application/config.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Configuration
3+
sidebar_order: 60
34
---
45

56
This document describes configuration available to the Sentry server itself.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Control Silo
3+
sidebar_order: 30
34
---
45

56
Within the Control Silo are features that allow us to provide backwards compatibility for both customer API usage, and integrations

develop-docs/backend/cross-region-replication.mdx renamed to develop-docs/application/cross-region-replication.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Cross Region Replication
3+
sidebar_order: 40
34
---
45

56
Our data-model includes many relations between users and the objects they create or interact with. Eventually users are deleted, and they need to be detached from the records they created, or those records need to be destroyed. Before sentry became a multi-region application, we relied on a mixture of Django callbacks, and postgres constraints to cascade deletions. However, in a multi-region state we arent't able to rely on these anymore as Users are in [Control Silo](/architecture/#silo-modes) and many of the objects they interact with are in the various Region Silos.

develop-docs/backend/cross-region-rpc.mdx renamed to develop-docs/application/cross-region-rpc.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Cross Region RPC
3+
sidebar_order: 50
34
---
45

56
When Sentry is deployed in a multi-region deployment (like sentry.io) there are many scenarios and workflows where a region silo requires information that is stored in Control Silo. Similarly there are flows where Control Silo operations need to read or mutate state stored in regions.

0 commit comments

Comments
 (0)