Change the module loading system to use package.preload for loading packages, which uses Lua's intended mechanisms for loading modules into Lua from C, rather than through package.loaded which is Lua's module cache. This change also loads modules lazily. As an escape hatch for potential unintentional dependency on lovely's previous eager module loading order, module patches have an additional option load_now, which if enabled loads them eagerly rather than lazily.
Change the module loading system to use
package.preload
for loading packages, which uses Lua's intended mechanisms for loading modules into Lua from C, rather than throughpackage.loaded
which is Lua's module cache. This change also loads modules lazily. As an escape hatch for potential unintentional dependency on lovely's previous eager module loading order, module patches have an additional optionload_now
, which if enabled loads them eagerly rather than lazily.