possible Naming Conflict within Addon Namespace
exochron opened this issue ยท 6 comments
Hi there :)
I'd like to use this Project as an embedded Libary in my Addon. By adding the MountsRarity-2.0.xml into my toc-File some Variables get mixed into my Addon Namespace. For me, that is still fine. BUT I think "data" and "MINOR_VERSION" are very generic names, which might collide with other Addons or even Libaries.
So at the very least, please consider some more unique Variable Names. You could just use a unique Prefix, which might avoid this already completely.
A better way would be to avoid the Addon Namespace entirely. For that you would have to generate everything into a single file. I think that's technically feasible.
Hey there, thanks for your interest and the suggestions. I might have misunderstood the addon namespace, as I thought it was local to the addon and couldn't cause any such conflicts.
I will take a look at this but due to current events, please expect this to take a few weeks.
no rush :)
I got kinda interested in the problem myself. So maybe I can fiddle something together and give you a PR.
btw, after giving it a bit more thought. Having the database inside the namespace can result in unnecessary memory usage as well.
For instance a user could have installed the libary as standalone and 2 more addons with each using this an embedded libary. Every instance uses a different build version. But only latest libary version gets actually used. So there are now 3 database tables floating around in the memory, where only one gets actually used. The other 2 instances never gets cleared by any garbagy collector since they are bound to the namespace and therefore (in theory) still accessible. That's a bit wasted memory. ;)
Here you go ๐
Again, take your time. It's your life and project after all. ๐ค
Awesome, thanks for your effort! Again, I will take a look at your changes asap, but that might still be two weeks out.
I agree that memory use should be as low as possible, though.
In which addon are you using/going to use this library? Thinking about adding a "used in" section in the README with links too.
There is actually an option for that on CurseForge where you can setup relations between different projects. But I think that can only be done by the indivial addon admins.
I'm going to use this Libary in Mount Journal Enhanced. A user pointed me to this project. I think it's a great way to share data between addons. ๐
(Afaik LiteMount uses this Lib as well.)