From f2d4c88410b16679e09e6fc84475e95dffa0979f Mon Sep 17 00:00:00 2001 From: Paras verma Date: Sun, 16 Aug 2026 15:15:07 +0530 Subject: [PATCH 1/2] chore: upgrade to Next.js 16.3.1 and React 19.2.8 --- app/BlogListing.tsx | 28 +- app/[slug]/page.tsx | 41 +- app/page.tsx | 18 +- components/blog/PostCard.tsx | 23 +- components/theme/ThemeToggle.tsx | 35 +- components/ui/SearchOverlay.tsx | 1 - eslint.config.mjs | 22 +- lib/content/index.ts | 9 +- lib/content/types.ts | 10 + lib/utils.ts | 22 + next-env.d.ts | 3 +- next.config.ts | 4 - package.json | 13 +- pnpm-lock.yaml | 1085 +++++++++++++++--------------- tsconfig.json | 10 +- 15 files changed, 657 insertions(+), 667 deletions(-) diff --git a/app/BlogListing.tsx b/app/BlogListing.tsx index 650bfa2..b04388b 100644 --- a/app/BlogListing.tsx +++ b/app/BlogListing.tsx @@ -2,7 +2,8 @@ import Link from "next/link"; import { useRouter } from "next/navigation"; -import { useEffect, useMemo, useState } from "react"; +import { useMemo, useState } from "react"; +import { formatDate } from "@/lib/utils"; import { Briefcase, CircleHelp, @@ -55,27 +56,6 @@ interface BlogListingProps { initialQuery?: string; } -const MONTHS = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec", -] as const; - -function formatDate(iso: string): string { - const d = new Date(iso); - if (Number.isNaN(d.getTime())) return iso; - return `${MONTHS[d.getUTCMonth()]} ${d.getUTCDate()}, ${d.getUTCFullYear()}`; -} - /** * Client-side blog listing - hero, search, type/category filters, and a * sticky featured rail. Filter state is derived from props (URL) + local state. @@ -95,10 +75,6 @@ export default function BlogListing({ PostCategory | undefined >(initialCategory); - useEffect(() => { - setQuery(initialQuery ?? ""); - }, [initialQuery]); - const types = useMemo( () => Array.from(new Set(posts.map((p) => p.type))), [posts], diff --git a/app/[slug]/page.tsx b/app/[slug]/page.tsx index 4806b77..cfe21f5 100644 --- a/app/[slug]/page.tsx +++ b/app/[slug]/page.tsx @@ -13,6 +13,7 @@ import { TYPE_LABELS, CATEGORY_LABELS, } from "@/lib/content"; +import { formatDate } from "@/lib/utils"; import { APP_URL, APP_CONFIG, SOURCE_EDIT_BASE } from "@/lib/constants"; import { cn } from "@/lib/utils"; import { SECTION_CONTAINER_CLASS } from "@/components/ui/Container"; @@ -91,28 +92,6 @@ export async function generateMetadata({ }; } -const MONTHS = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec", -] as const; - -/** Locale-independent so SSR and client HTML match. */ -function formatDate(iso: string): string { - const d = new Date(iso); - if (Number.isNaN(d.getTime())) return iso; - return `${MONTHS[d.getUTCMonth()]} ${d.getUTCDate()}, ${d.getUTCFullYear()}`; -} - /** Full article page - cover, prose body, tags, share, and related posts. */ export default async function BlogPostPage({ params }: PageProps) { const { slug } = await params; @@ -272,12 +251,18 @@ export default async function BlogPostPage({ params }: PageProps) { )}
- - {post.author} - + {post.authorUrl ? ( + + {post.author} + + ) : ( + + {post.author} + + )}