View Single Post
07-05-16, 07:43 PM   #9
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
While it is not recommended to stip LibStub and CallbackHandler, it is fine to do so if you wish. The reasoning why not to strip them from libraries is that LibStub is required to load libraries, and if you fire your own events (callbacks), a library would require CBH.

Remember that users are dumb. They'll look at their AddOns list, wonder what LibStub and CallbackHandler are, figure they don't need them if they don't know what they are, and disable or delete them. Then libraries will cease to load, which in turn causes AddOns that use said libraries to fail at loading, and then...

Yep, you guessed it: the user will blame the AddOn, and write an incorrect bug report to the AddOn author. It is better to hide the existance of LibStub and CallbackHandler by not using lib-strip.

As for a library that depends on another library (not named LibStub or CallbackHandler), you can modify your folder structure before uploading the zip or committing to the repository.

For example, LibGuildBankComm-1.0 requires both LibCompress and AceSerialize-3.0 to function, along with LS and CBH. In this case, it would be recommended to just bundle the relevant Lua files, rather than the whole of the libary. Come to think about it, I should double check if I did that....

Then, in your ToC, reference each Lua file directly.
Code:
LibStub\LibStub.lua
CallbackHandler-1.0\CallbackHandler.lua -- don't bundle the .xml
LibCompress\LibCompress.lua -- same deal
AceSerialize-3.0\AceSerialize-3.0.lua -- and again

lib.xml -- or LibSomeName-1.0.lua (this is YOUR library)
  Reply With Quote