Skip to content

Commit b2d26b6

Browse files
Merge branch 'master' into krystofwoldrich-patch-1
2 parents 1b466f0 + 0717c17 commit b2d26b6

File tree

320 files changed

+8930
-1435
lines changed

Some content is hidden

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

320 files changed

+8930
-1435
lines changed

.github/labels.yml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
color: F6F6F8
1818
description: Pull requests that update a dependency file
1919

20+
# Issue types
21+
- name: 'Type: Content'
22+
color: FBCA04
23+
- name: 'Type: Platform'
24+
color: 1D76DB
25+
26+
#
27+
- name: 'Develop'
28+
color: F6F6F8
29+
2030
# Impacts
2131
- name: 'Impact: Large'
2232
color: C83852
@@ -32,6 +42,8 @@
3242
color: '584774'
3343
- name: 'Platform: Capacitor'
3444
color: '584774'
45+
- name: 'Platform: CLI'
46+
color: '584774'
3547
- name: 'Platform: Cocoa'
3648
color: '584774'
3749
- name: 'Platform: Cordova'
@@ -40,14 +52,20 @@
4052
color: '584774'
4153
- name: 'Platform: Elixir'
4254
color: '584774'
55+
- name: 'Platform: Flutter'
56+
color: '584774'
4357
- name: 'Platform: Go'
4458
color: '584774'
59+
- name: 'Platform: iOS'
60+
color: '584774'
4561
- name: 'Platform: Java'
4662
color: '584774'
4763
- name: 'Platform: JavaScript'
4864
color: '584774'
4965
- name: 'Platform: KMP'
5066
color: '584774'
67+
- name: 'Platform: Native'
68+
color: '584774'
5169
- name: 'Platform: PHP'
5270
color: '584774'
5371
- name: 'Platform: Python'
@@ -67,6 +85,7 @@
6785
- name: 'Platform: Xamarin'
6886
color: '584774'
6987

88+
7089
# Waiting for Labels
7190
- name: 'Waiting for: Support'
7291
color: '8D5494'
@@ -217,16 +236,36 @@
217236
- name: 'Team: Web Frontend'
218237
color: 8D5494
219238
description: team-web-sdk-frontend
239+
- name: 'Team: Web Frontend SDKs'
240+
color: 8D5494
241+
description: team-web-sdk-frontend
220242
- name: 'Team: Web SDK Backend'
221243
color: 8D5494
222244
description: team-web-sdk-backend
245+
- name: 'Team: Web Backend SDKs'
246+
color: 8D5494
247+
description: team-web-sdk-backend
223248
- name: 'Team: Workflow'
224249
color: 8D5494
250+
- name: 'All SDKs'
251+
color: 1D76DB
252+
- name: 'SDKs'
253+
color: 1D76DB
254+
- name: 'Develop'
255+
color: 8D5494
256+
- name: 'Do not merge'
257+
color: 8D5494
258+
- name: 'Improvement'
259+
color: 8D5494
260+
- name: 'Launch 🚀'
261+
color: 8D5494
262+
- name: 'Product'
263+
color: 8D5494
225264

226265
# Miscellaneous
227266
- name: API Docs
228267
color: 649B42
229-
- name: bug
268+
- name: Bug
230269
color: F6F6F8
231270
- name: Common content
232271
color: B0E299
@@ -279,3 +318,11 @@
279318
color: F6F6F8
280319
- name: release health
281320
color: F6F6F8
321+
- name: submodules
322+
color: F6F6F8
323+
- name: '404'
324+
color: F6F6F8
325+
- name: darkmode
326+
color: F6F6F8
327+
- name: github_actions
328+
color: F6F6F8

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
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.36.0-beta.0",
24+
"@sentry/nextjs": "8.36.0",
2525
"@spotlightjs/spotlight": "^2.1.1",
2626
"next": "15.0.0-rc.1",
2727
"next-auth": "^4.24.5",

apps/changelog/src/client/components/navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ const NAV_ITEMS: NavItemsProps[] = [
508508
},
509509
{
510510
id: 'siginIn',
511-
title: 'Sign In',
511+
title: 'Go to Sentry',
512512
type: 'a',
513513
to: 'https://sentry.io/auth/login',
514514
variant: 'ghost',

0 commit comments

Comments
 (0)