Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps(changelog): Bump Next.js to canary and Sentry SDK to latest #10876

Merged
merged 7 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/changelog/.env.development
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be .env.example? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I purposefully added this. You probably already know this but .env.development will get picked up if you run next dev which I hope will save people time and confusion when they try to run the dev server for the changelog for the first time.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# rename this file to .env and supply the values listed below
# also make sure they are available to the build tool (e.g. Vercel/Netlify)
# warning: variables prefixed with NEXT_PUBLIC_ will be made available to client-side code
# be careful not to expose sensitive data

DATABASE_URL=postgresql://postgres:postgres@localhost:5432/changelog
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=secret
2 changes: 1 addition & 1 deletion apps/changelog/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ next-env.d.ts

# dotenv environment variables file
.env
.env.development
!.env.development
2 changes: 1 addition & 1 deletion apps/changelog/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default withSentryConfig(nextConfig, {
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
disableLogger: process.env.NODE_ENV === 'production',

reactComponentAnnotation: {
enabled: true,
Expand Down
11 changes: 5 additions & 6 deletions apps/changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/themes": "^2.0.3",
"@sentry/nextjs": "^8.8.0",
"@spotlightjs/spotlight": "^2.1.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Why did you remove spotlight?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was one more thing I needed to get working with the new Next.js version. I will add it back in a follow-up. But good that you bring it up!

"next": "^14.2.5",
"@sentry/nextjs": "8.20.0",
"next": "^15.0.0-canary.83",
"next-auth": "^4.24.5",
"next-mdx-remote": "^4.4.1",
"nextjs-toploader": "^1.6.6",
"prism-sentry": "^1.0.2",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "beta",
"react-dom": "beta",
"react-select": "^5.7.3",
"react-textarea-autosize": "^8.5.3",
"rehype-prism-plus": "^1.6.3",
Expand All @@ -47,7 +46,7 @@
"@types/rss": "^0.0.32",
"autoprefixer": "^10.4.17",
"eslint": "^8",
"eslint-config-next": "^14.2.5",
"eslint-config-next": "^15.0.0-canary.83",
"postcss": "^8.4.33",
"prisma": "^5.8.1",
"tailwindcss": "^3.4.1",
Expand Down
11 changes: 3 additions & 8 deletions apps/changelog/sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import * as SentryCore from '@sentry/core';
import * as Sentry from '@sentry/nextjs';
import * as Spotlight from '@spotlightjs/spotlight';

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
Expand All @@ -22,14 +21,10 @@ Sentry.init({
integrations: [
Sentry.replayIntegration(),
SentryCore.thirdPartyErrorFilterIntegration({
filterKeys: ['sentry-docs'],
filterKeys: ['sentry-changelog'],
behaviour: 'drop-error-if-contains-third-party-frames',
}),
],
});

if (process.env.NODE_ENV === 'development') {
Spotlight.init({
showClearEventsButton: true,
});
}
debug: process.env.NODE_ENV !== 'production',
});
2 changes: 1 addition & 1 deletion apps/changelog/sentry.edge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import * as Sentry from '@sentry/nextjs';
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
debug: false,
environment: process.env.NODE_ENV,
debug: process.env.NODE_ENV !== 'production',
});
3 changes: 1 addition & 2 deletions apps/changelog/sentry.server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import * as Sentry from '@sentry/nextjs';
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
debug: false,
environment: process.env.NODE_ENV,
spotlight: process.env.NODE_ENV === 'development',
integrations: [Sentry.prismaIntegration()],
debug: process.env.NODE_ENV !== 'production',
});
3 changes: 2 additions & 1 deletion apps/changelog/src/client/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export function Navbar() {
as={type}
variant={variant}
target={target}
href={to || ''}
// @ts-ignore
href={to || null}
className="w-full !justify-start"
onClick={(e: React.MouseEvent<HTMLAnchorElement>) => {
e.stopPropagation();
Expand Down
4 changes: 4 additions & 0 deletions apps/changelog/src/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as Sentry from '@sentry/nextjs';

export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
await import('../sentry.server.config');
Expand All @@ -7,3 +9,5 @@ export async function register() {
await import('../sentry.edge.config');
}
}

export const onRequestError = Sentry.experimental_captureRequestError;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/themes": "^2.0.3",
"@sentry-internal/global-search": "^1.0.0",
"@sentry/nextjs": "^8.8.0",
"@sentry/nextjs": "8.20.0",
"@types/mdx": "^2.0.9",
"algoliasearch": "^4.23.3",
"esbuild": "^0.19.8",
Expand Down Expand Up @@ -99,6 +99,7 @@
"sass": "^1.69.5",
"search-insights": "^2.2.3",
"server-only": "^0.0.1",
"sharp": "^0.33.4",
"tailwindcss-scoped-preflight": "^3.0.4",
"textarea-markdown-editor": "^1.0.4"
},
Expand Down
3 changes: 1 addition & 2 deletions sentry.client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The config you add here will be used whenever a users loads a page in their browser.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

import * as SentryCore from '@sentry/core';
import * as Sentry from '@sentry/nextjs';
import * as Spotlight from '@spotlightjs/spotlight';

Expand All @@ -28,7 +27,7 @@ Sentry.init({
maskAllText: false,
blockAllMedia: false,
}),
SentryCore.thirdPartyErrorFilterIntegration({
Sentry.thirdPartyErrorFilterIntegration({
filterKeys: ['sentry-docs'],
behaviour: 'apply-tag-if-contains-third-party-frames',
}),
Expand Down
Loading
Loading