From e78994700d6fa73c2e5af53183b0398385401d07 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Fri, 4 Sep 2026 13:45:01 +0900 Subject: [PATCH] =?UTF-8?q?260904=5F01=5FBUG:=20next=20config=EA=B0=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EB=90=98=EB=A9=B4=EC=84=9C=20=EC=83=9D?= =?UTF-8?q?=EA=B8=B4=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 11 +++++++++++ package.json | 2 +- .../base/src/components/app-shell/AppMainLayout.tsx | 7 ++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index f0a64d9..6626644 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -251,6 +251,17 @@ When implementation is complete, report in Korean: - Validate external data at runtime; a shared TypeScript type alone does not validate an API response or persisted value. - Prefer named public exports and retain the consumer project's current module system and bundler conventions. +### React Compiler and Manual Memoization + +- `createKriNextConfig` enables `reactCompiler: true` unless the project overrides it; confirm the effective configuration. +- When enabled, rely on React Compiler instead of adding `useMemo`, `useCallback`, or `React.memo` as a routine performance precaution. +- Use manual memoization only for required reference stability, an Effect or third-party contract, compiler-incompatible code, or a measured performance problem. +- Preserve existing memoization unless approved and verified for removal. Use `"use memo"` or `"use no memo"` only for a documented compiler boundary. + +### Project Instruction Budget + +- Keep `.agent/project.md` at or below 8 KiB (8,192 bytes) as the normal target. Do not delete material rules merely to meet the budget; move schemas, endpoint inventories, examples, and temporary issue history to linked project documentation, and keep concise read-routing instructions here. + ### Change Safety - Pin or constrain the package version according to the consumer repository's dependency policy and commit its lockfile changes. diff --git a/package.json b/package.json index 62a5ef4..3a7dd79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kri/create-next-app", - "version": "0.1.7", + "version": "0.2.0", "description": "Create a KRI standard Next.js application", "type": "module", "bin": { diff --git a/templates/base/src/components/app-shell/AppMainLayout.tsx b/templates/base/src/components/app-shell/AppMainLayout.tsx index 2442875..6f125a3 100644 --- a/templates/base/src/components/app-shell/AppMainLayout.tsx +++ b/templates/base/src/components/app-shell/AppMainLayout.tsx @@ -1,6 +1,7 @@ "use client"; -import { useMemo, useState } from "react"; +import type { Route } from "next"; +import { useMemo, useState, type ReactNode } from "react"; import { usePathname, useRouter } from "next/navigation"; import { KriMainLayout } from "@/components/layout/KriMainLayout"; import { AppHeader } from "./AppHeader"; @@ -8,7 +9,7 @@ import { AppSidebar } from "./AppSidebar"; import { sideMenus, topMenus } from "@/config/menu.data"; import { useAuth } from "@/hooks/useAuth"; -export function AppMainLayout({ children }: { children: React.ReactNode }) { +export function AppMainLayout({ children }: { children: ReactNode }) { const pathname = usePathname(); const router = useRouter(); const { auth } = useAuth(); @@ -19,7 +20,7 @@ export function AppMainLayout({ children }: { children: React.ReactNode }) { [pathname], ); - const navigate = (path: string) => router.push(path); + const navigate = (path: string) => router.push(path as Route); const hasSidebar = sideMenus.length > 0; return (