From 05a52516589965cde74caeba8cf9bd76879dfc74 Mon Sep 17 00:00:00 2001 From: yuanzonghao Date: Fri, 19 Jun 2026 01:33:40 +0800 Subject: [PATCH 1/2] perf(web): self-host Font Awesome instead of cdnjs CDN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the external cdnjs.cloudflare.com with a bundled npm import so FA CSS+fonts ship as static assets through the same Cloudflare CDN that serves the app — eliminates an extra DNS lookup and third-party CDN dependency, improves reliability for China users. Co-Authored-By: Claude Opus 4.6 --- app/layout.tsx | 6 +----- next-env.d.ts | 2 +- package.json | 1 + pnpm-lock.yaml | 9 +++++++++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/layout.tsx b/app/layout.tsx index 5a2f0fa..50be5d8 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -5,6 +5,7 @@ import { Analytics } from "@/components/Analytics"; import { LOCALES, DEFAULT_LOCALE, type Locale } from "@/lib/i18n/config"; import { localePath } from "@/lib/i18n/navigation"; import { stripLocalePrefix } from "@/lib/i18n/navigation"; +import "@fortawesome/fontawesome-free/css/all.min.css"; import "./globals.css"; // Editorial fonts: drive tailwind `font-serif`/`font-sans` via @@ -61,11 +62,6 @@ export default async function RootLayout({ suppressHydrationWarning > - {/* Font Awesome — fa-solid icons used by home, /play, /new, CustomForm. */} - {LOCALES.map((l) => ( /// -import "./.next/dev/types/routes.d.ts"; +import "./.next/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/package.json b/package.json index 20cd476..165dd7c 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "deploy:cf": "opennextjs-cloudflare deploy" }, "dependencies": { + "@fortawesome/fontawesome-free": "6.5.1", "@supabase/ssr": "^0.12", "@supabase/supabase-js": "^2.108", "drizzle-orm": "^0.45.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3e8916c..19df499 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@fortawesome/fontawesome-free': + specifier: 6.5.1 + version: 6.5.1 '@supabase/ssr': specifier: ^0.12 version: 0.12.0(@supabase/supabase-js@2.108.1) @@ -1003,6 +1006,10 @@ packages: cpu: [x64] os: [win32] + '@fortawesome/fontawesome-free@6.5.1': + resolution: {integrity: sha512-CNy5vSwN3fsUStPRLX7fUYojyuzoEMSXPl7zSLJ8TgtRfjv24LOnOWKT2zYwaHZCJGkdyRnTmstR0P+Ah503Gw==} + engines: {node: '>=6'} + '@img/colour@1.1.0': resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==} engines: {node: '>=18'} @@ -3893,6 +3900,8 @@ snapshots: '@esbuild/win32-x64@0.28.1': optional: true + '@fortawesome/fontawesome-free@6.5.1': {} + '@img/colour@1.1.0': {} '@img/sharp-darwin-arm64@0.33.5': From 8468d5da3ab7734786581b5c7b9fec1ec6f511ff Mon Sep 17 00:00:00 2001 From: yuanzonghao Date: Fri, 19 Jun 2026 01:36:15 +0800 Subject: [PATCH 2/2] chore: revert auto-generated next-env.d.ts change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the unintended path change (.next/dev/types → .next/types) that `next build` auto-wrote — this file is managed by Next.js and should not carry build-vs-dev path diffs across branches. Co-Authored-By: Claude Opus 4.6 --- next-env.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/next-env.d.ts b/next-env.d.ts index 9edff1c..c4b7818 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/types/routes.d.ts"; +import "./.next/dev/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.