Open pi0 opened 8 months ago
I love the idea of auto tracking modules. (It should be possible even without unctx
as modules run sequentially.)
We could rely on sequential order until when one module installs another. Also with unctx and ALS i guess we might be abe to track hooks origin too.
Something like this would be great, the source of module installation gets even harder to track when this happens in layers and their modules.
Perhaps unrelated, it feels like there's still some functionality missing for installModule
, shouldn't we be able to merge/retrieve all options passed to installModule
like we do with module options passed for layers?
When modules use
installModule
kit util to install another, it is often hard to trace it without explicitly checking all bundled codes. Adding to top, when users also try to manually install some.I think something we could at least do is to support new
from
param forinstallModule(name, { from: }
. so that we can trace what module installed another and find a way to encourage module authors do it.I guess we might at least leverage it for devtools to somehow visualize.
(as another enhancement, we could make nuxt kit made modules to be auto trackable using
unctx
and AsyncLocalStorage it might be useful for further DX enhancements)Reference: How i debugged it currently by patching kit today: