-
I am trying to override a mixin and the override will not take on build. Is there something special about mixins that I am unaware of on how they work or process? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Do you have an example so we can reproduce the problem? Have you looked at how mixins are loaded or fired when compared to regular Lua functions, or the Lua cache (the If you searched for "mixins" you would have seen this issue where I explained in detail exactly how they work: #4493 As with all things modules, if you're having trouble getting them to load normally or to hot-reload them, you can attach the logic you want to change to something on the |
Beta Was this translation helpful? Give feedback.
-
Maybe this next question would be better targeted, suppose I just want to overwrite an entire file, is using a module to do that the best course of action? |
Beta Was this translation helpful? Give feedback.
To understand why this doesn't work, you have to understand a) how Lua loads and caches items requested through
require
, b) how we load and cache things, and in what order, and c) how mixins are loaded and applied.(in the old style of requiring IDs, but is a good example of the point I'm explaining)
https://www.lua.org/pil/8.1.html
TLDR;
require
loads a file into an internal cache based on the path string you've looked it up with, and then returns that object from the cache if you ask for it again. This internal cache is thepackage.loaded
object. You can clear things out of the cache by setting entries in there tonil
. We do thi…