Skip to content

Use require for loading more modules - #10267

Merged
LocalIdentity merged 1 commit into
PathOfBuildingCommunity:devfrom
vaisest:requirement
Aug 23, 2026
Merged

LocalIdentity merged 1 commit into
PathOfBuildingCommunity:devfrom
vaisest:requirement

Conversation

@vaisest

@vaisest vaisest commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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:

  • Tests pass
  • Relevant features don't crash

Link to a build that showcases this PR:

Before screenshot:

After screenshot:

@LocalIdentity LocalIdentity added the technical Hidden from release notes label Aug 23, 2026
@LocalIdentity
LocalIdentity merged commit 81dbae8 into PathOfBuildingCommunity:dev Aug 23, 2026
3 checks passed
@vaisest
vaisest deleted the requirement branch August 23, 2026 13:11
@mcagnion

mcagnion commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex narrowed this down to a concrete cross-tree asset regression on 67134df. PoB retains 3.29 while lazily loading 3.29 Ruthless, but require("TreeData.3_19.Assets") shares their mutable assets table. The Ruthless load reprocesses retained Bloodline sprite rectangles as standalone PNGs such as TreeData/ClassesBrinerot.png, which do not exist, overwriting their handles and dimensions; returning to 3.29 reuses the affected table. The Ruthless tree still exposes all 13 Bloodlines. In the headless repro, all 13 corresponding class artwork assets are affected (ClassesBrinerot: 567×537 → 1×1), while the exact base changes 0. A native UI reproduction confirmed that the Velka Bloodline artwork disappears after loading Ruthless and remains absent after switching back to 3.29.

RicoKirstein pushed a commit to RicoKirstein/PathOfBuilding that referenced this pull request Aug 24, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical Hidden from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants