WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   PTR General Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=172)
-   -   Deferred XML Node object named <name> already exists (https://www.wowinterface.com/forums/showthread.php?t=56314)

LanceDH 06-30-18 07:14 AM

Deferred XML Node object named <name> already exists
 
I've just started updating my second addon on the beta client, and I'm running into an error about XML nodes with the same name already existing.
Because using Blizzard's dropdown menu code causes taint, I've been using a copy of the code in my addons to replicate the official dropdowns.
This has always worked just fine, but now it seems the client throws a warning because I have multiple addons creating the same XML frames.
I've tried switching over to someone else's lib, but no luck there.
Everything works just fine. It's just the warning that's annoying and I'd want to get rid of.

Example of one of the warnings:
Code:

Message: Deferred XML Node object named MSA_DropDownMenuButtonTemplate already exists

Ammako 06-30-18 08:07 AM

It's a thing with libs in BfA, I guess. With dozens of addons all having the same libs included and all loading them, they used to ignore it, and now they throw an error.
You'd have to have the lib loaded as its own addon, and not have them included in the other addons anymore. Then only one instance of it exists and loads.
I'd also recommend adding a ! at the front of its name, to hopefully ensure it will load before any of your other addons.

It's a little bit user-non-friendly, if they don't change that behavior for release, though I guess a restructure of addon managers to have libraries as separate addons + having them automatically downloaded when an addon uses them as dependency could be done. But then I'm not sure how well it would handle addons that rely on older versions of libraries (if all addons work fine even with updated libraries then that's not a problem; I just seem to recall instances where an addon was relying on behavior from an older version of one of its libraries that was changed in an update, or something...)

If I understand the situation correctly, at least...

LanceDH 06-30-18 08:29 AM

Sooo, they've made the DropDownMenu issue even more annoying.
I don't know much about libs, so to me the path of least resistance would be to just change the prefix of the lib for every addon.

Ammako 06-30-18 08:42 AM

Not really, that's just a general libs thing. Taking a copy of original blizzard code and loading it as a lib is no different than any user-created library.

As long as you changed the prefix for all frame names and everything then I imagine it'd work, but that seems like a lot of work when you can just drag the library's folder out into AddOns folder and rename it once just so it's at the top of the list.

LanceDH 06-30-18 08:54 AM

So what you're saying is:
Create the lib as a separate addon
Give it a name that ensures it's loaded first
Have the actual addons depend on it
Package a copy of this addon with the actual addon
If someone installs 2 of the addons, the lib addon will just be overwritten so there's always just 1

If I'm understanding you correctly.

Ammako 06-30-18 09:17 AM

In theory. I see issues with that system when it comes to distribution, regarding different addons packaging different versions of the same library which would make that error pop up again (that, and having people download the same library multiple times and overwriting/ignoring feels redundant.)

Ideally, we would stop including libraries within addons, and instruct people to download and maintain them separately, but the average person can't read apparently, and that would cause a lot of headaches.

Alternatively, Blizzard could leave it, and continue allowing the same lib to be contained within multiple addons at once without throwing errors, but I imagine there is a reason why they made that change. If loading the same library multiple times doesn't cause any performance problems then we might as well advocate for them to revert that change.

LanceDH 06-30-18 09:31 AM

I'll just wait until we get closer to release to see if they fix it. If not I'm just going to end up creating a lib with a different prefix for every addon. It's luckily just a few seconds to replace all the variable names. I'm just not a fan of having multiple frames and pieces of code that do the exact same thing, but that's just how it'll have to be.

Ammako 06-30-18 11:16 AM

Quote:

Originally Posted by LanceDH (Post 328471)
I'm just not a fan of having multiple frames and pieces of code that do the exact same thing, but that's just how it'll have to be.

That's the idea behind having the library loaded only once as its own addon.

AcidWeb 06-30-18 11:52 PM

Dropdown libraries are not needed anymore - just use this hack:
https://www.townlong-yak.com/bugs/af...FrameLoadTaint

Gethe 07-01-18 12:31 AM

The issue here isn't specifically targeted at libraries, though that is the main reason you'd see it.

Blizzard had been logging xml and load errors for a while. Things like files not being found and duplicate xml templates. If you go to your Live client you can see these in Logs\FrameXML.log. The difference in BfA is that these are now also being shown in-game as an error.

Nevcairiel 07-02-18 01:50 AM

The new errors (really they are considered "Lua Warnings" by the game) are there to let you know about a potential problem - and as mentioned above they are also not new, just went mostly ignored previously since they were only logged to FrameXML.log. And those errors usually point to a possible problem that might creep up on you down the line.

For this one specifically, you cannot reliable re-declare or version a XML template, so if it ever changes in a future library version, there is no guarantee of it working properly. So in short, avoid any XML content in embedded libraries, because there is no way to properly handle that - never has been, now the game just warns you about that more directly.

If someone really cared, you could probably make a dropdown-replacement library in pure Lua, instead of piling hacks on top of hacks.

lightspark 07-02-18 03:10 AM

Quote:

Originally Posted by Nevcairiel (Post 328513)
If someone really cared, you could probably make a dropdown-replacement library in pure Lua, instead of piling hacks on top of hacks.

@p3lim, it's your time to shine! :D

p3lim 07-02-18 03:22 AM

Quote:

Originally Posted by Nevcairiel (Post 328513)
If someone really cared, you could probably make a dropdown-replacement library in pure Lua, instead of piling hacks on top of hacks.

Quote:

Originally Posted by lightspark (Post 328516)
@p3lim, it's your time to shine! :D

https://github.com/p3lim-wow/LibDropDown

I wrote this library some time ago, it's not fully featured, but it's a Lua implementation of dropdowns from scratch.
Would appreciate feedback and contributions, especially testing.

Torhal 07-03-18 06:51 AM

You might want to pick a different name, since there is "prior art" - https://www.wowace.com/projects/libdropdown-1-0 - a similar situation is why I used LibQTip instead of LibTooltip back in the day.

LanceDH 07-03-18 05:41 PM

I ended up converting the 8.0.1 version of the UIDropDownMenu into a libstub library, including turning the XML into lua.
Took me a while and still need to iron out a few things, but I'm having it run on 2 addons and it works perfectly. So no more XML errors.
I have to create my dropdowns in lua now rather than XML, but I guess I'll have to live with that.


All times are GMT -6. The time now is 01:09 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI