From 35207e211d173340bc82f9d9c41cca9b31385f7e Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 1 Oct 2026 13:06:29 +0900 Subject: [PATCH] =?UTF-8?q?perf(m01-sl):=20Entry=20=EA=B0=80=20SheetLogic?= =?UTF-8?q?=20=ED=8C=8C=EC=9D=BC=EC=9D=84=20import()=20=EB=A1=9C=20?= =?UTF-8?q?=EB=8A=A6=EA=B2=8C=20=EB=B6=88=EB=9F=AC=EC=98=B4=20=E2=80=94=20?= =?UTF-8?q?=EC=97=94=EC=A7=84=EC=9D=B4=20M01=20=EC=B2=AB=20=EB=AC=B6?= =?UTF-8?q?=EC=9D=8C=EC=97=90=20=EC=95=88=20=EB=93=A4=EC=96=B4=EA=B0=80?= =?UTF-8?q?=EA=B2=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt --- M01_MasterData/SheetLogic/M01_SL_Entry.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/M01_MasterData/SheetLogic/M01_SL_Entry.ts b/M01_MasterData/SheetLogic/M01_SL_Entry.ts index d8ac397c7..3398ed630 100644 --- a/M01_MasterData/SheetLogic/M01_SL_Entry.ts +++ b/M01_MasterData/SheetLogic/M01_SL_Entry.ts @@ -17,8 +17,8 @@ import { } from "@ui/ui_template_elements"; import { openModal } from "@ui/ui_template_modal"; import { listEasy, plainError, type EasyListItem } from "../EasyCalc/M01_EasyCalc_Api"; -import { slList, type SlListItem } from "./M01_SL_Api"; -import { newLogic, type SheetLogic } from "./M01_SL_Model"; +import type { SlListItem } from "./M01_SL_Api"; +import type { SheetLogic } from "./M01_SL_Model"; import "./M01_SL_Entry.css"; const TEXT = { @@ -76,15 +76,12 @@ const amountOf = (resultUnit: string): string => { }; const isMoney = (resultUnit: string): boolean => resultUnit.startsWith("원/"); -/* ponytail: SL Api(sub4) · Model(sub7) 속이 「준비 중」 인 동안만 대신함 — 채워지면 두 catch 를 지움 */ -const loadMine = (): Promise => slList().catch(() => []); -const blankLogic = (name: string, unit: string): SheetLogic | null => { - try { - return newLogic(name, unit); - } catch { - return null; - } -}; +/* SheetLogic 파일은 늦게 불러옴(import()) — 스프레드시트 엔진이 M01 첫 묶음에 안 들어가게. + * ponytail: SL Api(sub4) · Model(sub7) 속이 「준비 중」 인 동안만 빈 목록 · null 로 대신함 — 채워지면 catch 를 지움 */ +const loadMine = (): Promise => + import("./M01_SL_Api").then((m) => m.slList()).catch(() => []); +const blankLogic = (name: string, unit: string): Promise => + import("./M01_SL_Model").then((m) => m.newLogic(name, unit)).catch(() => null); /** 「로직 만들기(시험)」 옆에 놓는 단추 — 누르면 큰 창 */ export function createSheetLogicButton(): HTMLButtonElement { @@ -235,7 +232,9 @@ function openSheetLogic(): void { const showPaper = (): void => { let dirty = false; const units = unitChoices(); - paper = { dirty: () => dirty, sl: blankLogic("", units[0]) }; + const mine: { dirty(): boolean; sl: SheetLogic | null } = { dirty: () => dirty, sl: null }; + paper = mine; + void blankLogic("", units[0]).then((sl) => (mine.sl = sl)); const unsaved = createTag(te("Unsaved"), "warning"); unsaved.hidden = true;