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

upgrade to 15 #166

Merged
merged 1 commit into from
Nov 2, 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: 7 additions & 1 deletion app/(post)/og/[id]/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ const robotoMono400 = fetch(
)
).then(res => res.arrayBuffer());

export async function GET(_req: Request, { params: { id } }) {
export async function GET(_req: Request, props) {
const params = await props.params;

const {
id
} = params;

const posts = await getPosts();
const post = posts.find(p => p.id === id);
if (!post) {
Expand Down
17 changes: 9 additions & 8 deletions app/links/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ import links from "@/links.json";
import { headers } from "next/headers";
import { redirect, notFound } from "next/navigation";

export default function Link({
params,
searchParams,
}: {
params: { id: string };
searchParams: { bot?: string };
}) {
export default async function Link(
props: {
params: Promise<{ id: string }>;
searchParams: Promise<{ bot?: string }>;
}
) {
const searchParams = await props.searchParams;
const params = await props.params;
const link = links[params.id];

if (link == null) {
return notFound();
}

if (searchParams.bot || /bot/i.test(headers().get("user-agent") as string)) {
if (searchParams.bot || /bot/i.test((await headers()).get("user-agent") as string)) {
return <></>;
} else {
redirect(link.link);
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
2 changes: 0 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ module.exports = withMDX({
experimental: {
mdxRs: true,
},
swcMinify: true,
reactStrictMode: true,
images: {
remotePatterns: [
{
Expand Down
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"@fontsource/inter": "^4.5.15",
"@fontsource/roboto-mono": "^4.5.10",
"@mdx-js/react": "^2.3.0",
"@next/mdx": "13.1.7-canary.10",
"@next/mdx": "15.0.2",
"@types/node-fetch": "^2.6.2",
"@upstash/redis": "^1.20.1",
"@vercel/analytics": "^1.0.0",
"comma-number": "^2.1.0",
"date-fns": "^2.29.3",
"image-size": "^1.0.2",
"load-script": "^1.0.0",
"next": "14.0.5-canary.16",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"next": "15.0.2",
"react": "19.0.0-rc-02c0e824-20241028",
"react-dom": "19.0.0-rc-02c0e824-20241028",
"react-intersection-observer": "^8.34.0",
"react-tweet": "^3.1.1",
"react-wrap-balancer": "^0.2.4",
Expand All @@ -27,11 +27,11 @@
},
"devDependencies": {
"@types/comma-number": "^2.1.0",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@types/react": "npm:types-react@19.0.0-rc.1",
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
"autoprefixer": "^10.4.14",
"eslint": "^8.56.0",
"eslint-config-next": "^14.0.4",
"eslint-config-next": "15.0.2",
"postcss": "^8.4.21",
"prettier": "^2.8.4",
"tailwindcss": "^3.3.1",
Expand All @@ -43,10 +43,14 @@
"webpack",
"@mdx-js/loader"
]
},
"overrides": {
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
}
},
"scripts": {
"dev": "next dev -H 0.0.0.0",
"dev": "next dev --turbopack -H 0.0.0.0",
"build": "next build",
"start": "next start"
},
Expand Down
Loading
Loading