From 58833e1f87c47b455fe8bbeb52e4653862a98733 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Fri, 21 Nov 2025 14:53:58 -0500 Subject: [PATCH] update for nextjs 16 --- actions/subscriptions/sendPostToSubscribers.ts | 2 +- next.config.js | 2 +- package-lock.json | 15 --------------- package.json | 1 - src/utils/getCurrentDeploymentDomain.ts | 6 +++--- src/utils/isBot.ts | 16 ---------------- 6 files changed, 5 insertions(+), 37 deletions(-) delete mode 100644 src/utils/isBot.ts diff --git a/actions/subscriptions/sendPostToSubscribers.ts b/actions/subscriptions/sendPostToSubscribers.ts index 6b590f19..8c5d4bed 100644 --- a/actions/subscriptions/sendPostToSubscribers.ts +++ b/actions/subscriptions/sendPostToSubscribers.ts @@ -57,7 +57,7 @@ export async function sendPostToSubscribers({ ) { return; } - let domain = getCurrentDeploymentDomain(); + let domain = await getCurrentDeploymentDomain(); let res = await fetch("https://api.postmarkapp.com/email/batch", { method: "POST", headers: { diff --git a/next.config.js b/next.config.js index 68b3188e..2d702b7d 100644 --- a/next.config.js +++ b/next.config.js @@ -31,8 +31,8 @@ const nextConfig = { { protocol: "https", hostname: "bdefzwcumgzjwllsnaej.supabase.co" }, ], }, + reactCompiler: true, experimental: { - reactCompiler: true, serverActions: { bodySizeLimit: "5mb", }, diff --git a/package-lock.json b/package-lock.json index c6d0f079..d63df567 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "@atproto/syntax": "^0.3.3", "@atproto/xrpc": "^0.7.5", "@atproto/xrpc-server": "^0.9.5", - "@esbuild/darwin-arm64": "^0.27.0", "@hono/node-server": "^1.14.3", "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", @@ -1436,20 +1435,6 @@ "node": ">=18" } }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.0.tgz", - "integrity": "sha512-uJOQKYCcHhg07DL7i8MzjvS2LaP7W7Pn/7uA0B5S1EnqAirJtbyw4yC5jQ5qcFjHK9l6o/MX9QisBg12kNkdHg==", - "cpu": [ - "arm64" - ], - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, "node_modules/@esbuild/darwin-x64": { "version": "0.25.4", "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.4.tgz", diff --git a/package.json b/package.json index e8135901..3a5b8ca4 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "@atproto/syntax": "^0.3.3", "@atproto/xrpc": "^0.7.5", "@atproto/xrpc-server": "^0.9.5", - "@esbuild/darwin-arm64": "^0.27.0", "@hono/node-server": "^1.14.3", "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", diff --git a/src/utils/getCurrentDeploymentDomain.ts b/src/utils/getCurrentDeploymentDomain.ts index c8fd21b2..9a438ebd 100644 --- a/src/utils/getCurrentDeploymentDomain.ts +++ b/src/utils/getCurrentDeploymentDomain.ts @@ -1,6 +1,6 @@ -import { headers, type UnsafeUnwrappedHeaders } from "next/headers"; -export function getCurrentDeploymentDomain() { - const headersList = (headers() as unknown as UnsafeUnwrappedHeaders); +import { headers } from "next/headers"; +export async function getCurrentDeploymentDomain() { + const headersList = await headers(); const hostname = headersList.get("x-forwarded-host"); let protocol = headersList.get("x-forwarded-proto"); return `${protocol}://${hostname}/`; diff --git a/src/utils/isBot.ts b/src/utils/isBot.ts deleted file mode 100644 index 1f1a8222..00000000 --- a/src/utils/isBot.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { cookies, headers, type UnsafeUnwrappedHeaders } from "next/headers"; -export function getIsBot() { - const userAgent = - (headers() as unknown as UnsafeUnwrappedHeaders).get("user-agent") || ""; - const botPatterns = [ - /bot/i, - /crawler/i, - /spider/i, - /googlebot/i, - /bingbot/i, - /yahoo/i, - // Add more patterns as needed - ]; - - return botPatterns.some((pattern) => pattern.test(userAgent)); -} -- 2.51.2