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).
This commit is contained in:
Calic
2026-06-11 02:03:19 +02:00
parent d63dd91bb6
commit b360ee6230

View File

@@ -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