Use require for loading more modules - #10267
Conversation
|
Codex narrowed this down to a concrete cross-tree asset regression on |
Upstream reworked the class syntax (new("Foo", args) is now
new("Foo"):Foo(args) and errors otherwise, PathOfBuildingCommunity#9861) and moved the calc
modules to require (PathOfBuildingCommunity#10267), so beyond the textual conflicts this merge
converts all of our custom code to the new conventions: the solve-set
and preset UI in TradeQuery, the worker-pool and MCP settings in Main,
the MCP command/trade modules, WorkerJobs, the specs, and the
TradeSetOptimiser class definition. CalcNodeAggregate now registers
itself on require("Modules.CalcBase") like the other calc modules.
Semantic merges:
- buildModListForNode keeps our cross-pass node modlist cache on top of
upstream's scratch-list reuse and flag prefilter; a scratch-built list
is never cached since the caller recycles it.
- Upstream's breakdown-pin refresh moved into our PerformRecalc, which
replaced the inline buildFlag block it was added to.
- Our newModList fast path is kept; it builds exactly the fields the
reworked ModStore constructor sets.
- Upstream's lone compound assignment (count += 1) is written as plain
Lua: the system LuaJIT running the headless harness predates
compound-assignment support.
Verified: full busted suite in the tests container (594 passing),
HeadlessWrapper boots, and the headless harness produces identical
stats to pre-merge on two ladder builds.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Description of the problem being solved:
This PR changes more modules to import using require(). This was mostly motivated by Zao's mention of repeated modules slowing down loading speeds. On my system, this ended up making the F5 items tab load time 200 ms faster (1.8 -> 1.6), and tests about 3 sec faster (33 -> 3).
Steps taken to verify a working solution:
Link to a build that showcases this PR:
Before screenshot:
After screenshot: