From b360ee62303cebb8fed4e0da99da17f204f7a25e Mon Sep 17 00:00:00 2001 From: Calic Date: Thu, 11 Jun 2026 02:03:19 +0200 Subject: [PATCH] refactor(launcher): memoize markdown.lua in manifest_loader ensure_deps Matches the existing frontmatter.lua memoization pattern. Avoids re-dofile'ing markdown.lua per successful load_for call (matters once L.9 rolls out manifest.launcher.md to every module and the init-time call count goes from 1 to N). --- manifest_loader.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manifest_loader.lua b/manifest_loader.lua index f552796..c46ef70 100644 --- a/manifest_loader.lua +++ b/manifest_loader.lua @@ -1,11 +1,14 @@ local M = {} -local fm +local fm, md local function ensure_deps() if not fm then fm = dofile(engine.module.dir_of("lib-management.launcher") .. "/frontmatter.lua") end + if not md then + md = dofile(engine.module.dir_of("lib-management.launcher") .. "/markdown.lua") + end end -- Returns: @@ -23,7 +26,6 @@ function M.load_for(module_id) if not meta then return { _missing = false, _err = perr }, {} end - local md = dofile(engine.module.dir_of("lib-management.launcher") .. "/markdown.lua") local blocks = md.parse(body) return meta, blocks end