MountsRarity

MountsRarity

24.5k Downloads

possible Naming Conflict within Addon Namespace

exochron opened this issue ยท 6 comments

commented

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.

commented

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.

commented

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. ;)

commented

Here you go ๐Ÿ˜„
Again, take your time. It's your life and project after all. ๐Ÿค—

commented

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.

commented

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.)

commented

I'll hopefully be able to take a look at the problem, your PR, the relationships on CF and everything related in the coming days, maybe already on the weekend.

But you are right, LiteMount uses this addon. I created it originally for that use case. ๐Ÿ˜„