This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Since I started using this library I've been getting a lot of reports of it breaking which I tracked back to other addons using older versions of the library. Looking at how you wrote it you are just creating a set of global functions instead of adding them to the library table created from LibStub. How you currently have it set up to version check with LibStub only works with a matching Major Version. Unfortunately since you have changed the major version multiple time LibStub is considering each version as a unique library which is then loaded and then overwrites the globals with an outdated version. If an addon gets loaded after mine that still has a V1 or V2 library then that one is what is gets used and breaks any 9.0 addons that require the background changes. I believe that this is what the causing the other issue I had reported about my menus displaying info from other addons since the other addon is using V2 of the library.
Every global and function should to be attached to the table generated from the 'local lib = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)' line IE lib.L_UIDropDownMenuDelegate_OnAttributeChanged(...) That way users can get just use the LibStub:GetLibrary command to always get the most up to date revision of the major version they select.
Right, that's a good point. I did observe same issue but haven't decided when would be the best timing to implement it.
Actually, with WoW 9.0.x's release, it should be a best timing for the changes, but I missed it.
So, ideally all the global function to be a subset of the library like you mentioned:
lib.L_UIDropDownMenuDelegate_OnAttributeChanged(...)
The change will impact to lots of addon and users. So I was thinking to maybe branch a version for the new implementation. I can try to inform all the addon author to temporary move to use the branch and they will have to make sure to revise their dropdown menu functions calls. And then probably after a while later I can merge the codes back to the trunk.
Did I miss anything?
Suggestion is welcome.
Please help to test branch 4.0 here: https://repos.wowace.com/wow/libuidropdownmenu/branches/v4.00
To post a comment, please login or register a new account.