Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

LibStub

Last wiki revision 2022-01-08

LibStub is a minimalistic versioning library embedded by thousands of other addons. It allows addons to more easily share libraries by checking for the most recent version and making it available to other installed addons. This cross-community library-sharing system was creditted to Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel and joshborke; and has resided in the Public Domain since c. 2007.

An iterator over the registered major libraries.

  • Ace3, for which it was originally designed
  • Rock, ckknight's framework
  • Auctioneer uses it for its libraries
  • Some Dongle-related libraries use it.
  • ... and hopefully many more to come!
  • get a copy of the current version
  • copy into your library's folder
  • set up your file to load (in case you support stand alone loading of the lib)
  • don't load LibStub via the xml file ment for embedded loading of your lib
  • don't set LibStub as X-embeded or OptDep
  • set up an external pointing to

or

  • get a copy of the current version
  • copy LibStub.lua into your addon's folder or a subfolder of it
  • set up your or embeds.xml file to load
  • don't set LibStub as X-embeded or OptDep

Using an integer for minor versions:

Using revision control system tags for minor versions:

Bumping the number from a revision control system after it resets or slides backwards (i.e. when moving code from one repository to another):

This is a convention rather than a function of the specification, but all Ace3 and Rock related libraries use the following semantics for doing embedding / mixing in.

Specifically, libraries with an .Embed member can be specified as embeds during addon object creation rather than having to embed them explicitly. At the end of the file, we handle library upgrades by re-embedding it in all positions where it was previously embedded / mixed in:

Source

https://warcraft.wiki.gg/wiki/LibStub · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.