Exporting tables directly
From User talk:Kephir
If you want to use table data from another module, like at Module:form of, then it's a good idea to add in a comment in the module which other modules use it. That way, it's easier to change later. Functions can be tracked if needed to rename them, but tables can't.
Actually, they can:
export.whatever = nil
setmetatable(export, {
__index = function (self, key)
if key == 'whatever' then
require('Module:debug').track('whatever')
return whatever
end
end
})
But I agree, annotating these is a good idea.
— Keφr
That code snippet would be very useful to preserve on Category:Template tracking!