We can provide bulk data for our addons functionality in a seperate .lua file, by assigning the data to a global Variable in the .lua file. Something like this:
Lua Code:
OurAddonConstants = {
--insert really big table here
}
We are supposed to use this in particular for localisation (with the idea that the the proper languages .lua file is loaded based on client langauge and manifest entry):
Code:
localization/$(language).lua
On the plus side this allows us to split large amount of default data (like where each Skyshard/Lorebook can be found) over multile files.
On the downside this does pollute the global namespace with a lot of constants (at least 1 per addon; possible 1 more for Localisation uses). And if there is one thing I don't like it is a untidy global namespace.
LibStub allows us to share libraries across Addon barriers. It also ensures only the most current version is used. But very important for me it also keeps the global namespace clean - the only thing that is needed is the global variable that holds libStub itself. Via it you can request every library, wheter you provided it with your addon or it was installed stand alone.
LibMediaProvider does something similar for Media like Fonts, Textures and sounds (once they get implemented).
Would anybody be interested in writing such a library?
Could LibMedia Provider be expaneded for another read only type called "Lua Data"?