perf(m01-sl): Entry 가 SheetLogic 파일을 import() 로 늦게 불러옴 — 엔진이 M01 첫 묶음에 안 들어가게

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016PSXsvyDxjNmufteN5bqmt
This commit is contained in:
2026-10-01 13:06:29 +09:00
co-authored by Claude Opus 5.5
parent 913f04998e
commit 35207e211d
+11 -12
View File
@@ -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<SlListItem[]> => 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<SlListItem[]> =>
import("./M01_SL_Api").then((m) => m.slList()).catch(() => []);
const blankLogic = (name: string, unit: string): Promise<SheetLogic | null> =>
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;