ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   AddOn Manifest File Changes (https://www.esoui.com/forums/showthread.php?t=7275)

ZOS_ChipHilseberg 08/07/17 08:17 AM

AddOn Manifest File Changes
 
With API version 100021 we are considering a couple changes to the manifest file processing:

1) File paths in the manifest file extend from the directory that the manifest file is in. Currently these file paths extend from "EsoUI/AddOns/<Manifest File Name>/" which is unintuitive and doesn't allow putting addons into a deeper file structure.
2) We will scan all sub-directories in the AddOns folder for manifest files. Currently we only scan the top level directories which also prevents putting addons into a deeper file structure.
3) Manifest files must have the same name as the directory they are in to be processed. This prevents ReadMe.txt files from being picked up as addons (along with other stray .txts), which becomes more important as the scan goes deeper. This seems to be the standard based on a subset of addons that I looked at, so hopefully most addons will already comply with this.

The main benefit of these changes is that it allows an addon to embed its libraries as addons instead of loading the files as part of the main addon manifest. Combined with the "# AddOnVersion:" directive, only the highest version of each library will be loaded which saves time that would be spent on loading the same library lua files many times and throwing out most of the results.

Let me know if you have any feedback on these changes.

Rhyono 08/07/17 09:21 AM

So if you include 3 libs, will they then show up in someone's addon list for them to individually enable/disable? Inb4 commoners riot that we're installing bloatware!

Shinni 08/07/17 09:21 AM

Just to be sure:
The OnAddonLoaded event will still use <Manifest File Name> as addon name argument and SavedVariables files will still be called <Manifest File Name>.lua?

General feedback:
I think this is great, because it will automatically load newer libraries.
Currently an addon can load a bundled outdated library, if no newer version of the library was loaded via LibStub yet. This can cause errors if the outdated library isn't able to properly "unload", i.e. restore hooked API functions, when the newer addon version is loaded.
With the new changes the load order of the addons bundling the libraries doesn't matter anymore.

Shinni 08/07/17 09:34 AM

Quote:

So if you include 3 libs, will they then show up in someone's addon list for them to individually enable/disable? Inb4 commoners riot that we're installing bloatware!
If I recall correctly, in the WOW addon community libs aren't bundled but have to be installed on their own. So users have all the libs in their addon list as well. However, I think you are totally right that there will be lots of question why the addon list suddenly increased by so many libX entries.

Even more fun will be the no longer maintained addons where the dev copied the txt of the libraries into the lib folder as well, but the lib's lua files are still loaded from the addon's txt. Then the checkbox in the addon list is totally useless because the lib will be loaded regardless.

silvereyes 08/07/17 09:52 AM

Quote:

Originally Posted by ZOS_ChipHilseberg (Post 32182)
3) Manifest files must have the same name as the directory they are in to be processed. This prevents ReadMe.txt files from being picked up as addons (along with other stray .txts)....[snip]

The main benefit of these changes is that it allows an addon to embed its libraries as addons instead of loading the files as part of the main addon manifest.

I like the change to txt file processing, but I think there will only be a few libraries that want to go the full addon route. Users don't need to see "LibAsync", "LibTimeout", "LibLootSummary", "LibCustomMenu", etc. These are technical implementation libraries that will only serve to confuse users if they see them in their addons list. Perhaps if they were grouped together in a Libraries section of the addons list that is collapsed/hidden by default, it would reduce the confusion.

Rhyono 08/07/17 09:55 AM

Quote:

Originally Posted by silvereyes (Post 32188)
Perhaps if they were grouped together in a Libraries section of the addons list that is collapsed/hidden by default, it would reduce the confusion.

I'm in favor of that.

sirinsidiator 08/07/17 10:21 AM

This change won't suddenly make libraries appear in the addon list out of nowhere. The author of the library will first have to update the lib so it properly works with this new feature. Existing libs will just continue to work like they have until now. I also suggest that old libraries don't just switch to the new way, and instead increase their "major" version so it won't affect existing addons.

LibAsync for example can stay how it is and doesn't have to be bundled as a standalone addon. That way it won't show up in the addon list. If an addon author doesn't read the description of a lib and includes it with a manifest file instead of how the lib author specified, it's something they should correct on their end. If it absolutely mustn't be included with a txt, then maybe do it like some other libs and just don't add one at all?

I would also wait and see if any user even notices this or is bothered at all. I don't believe it will be that much of a problem seeing as some addons already come with a lot of baggage anyways (e.g. Harvest Map, Master Merchant).

I do however agree that a library section and a way to see which path a library or addon was loaded from might be nice.

haggen 08/07/17 07:46 PM

Shinni and sirinsidiator make very good points. Now you mentioned AddOnVersion and I wonder, how is it parsed and compared? Is it just a string? Does the game understand major, minor and revision numbers?

sirinsidiator 08/08/17 01:48 AM

Quote:

Originally Posted by haggen (Post 32193)
Shinni and sirinsidiator make very good points. Now you mentioned AddOnVersion and I wonder, how is it parsed and compared? Is it just a string? Does the game understand major, minor and revision numbers?

It's an unsigned integer.

Ayantir 08/08/17 03:11 AM

I don't know what to think about it, it's both very good but it will be confusing and hard to implement without some global update..

So basically, now I have my libs loaded throught libstub, they don't have access to xml and savedvars (but for saved vars, I can cheat with zo_ingame..) and with this, my libs will be able to be full addons with their metafile and so on..

so why still embedding libs ?.. why not pushing them as full addons ?.. we're only doing the half of the way even if there is all we need to do the full thing.. Well, I'll still have to rethink about consequence and migration.

One thing is sure, I would really like to see the requests about addonmanager being done at same time. (API flag & System explorer)

ZOS_ChipHilseberg 08/09/17 02:13 PM

I talked to our UI designer about this and we came up with adding a new checkbox to the addon window that auto manages dependencies and a new directive to mark an addon as a library. When you enable an addon it enables all addons marked as libraries that it depends on. And when you disable an addon, if libraries it was using became unused they are disabled. The addons marked as libraries would not be shown in the list in this mode. You could toggle off this auto mode and the libraries will be shown in the window and can be managed directly. Would something like this work?

sirinsidiator 08/09/17 02:23 PM

That sounds pretty good to me. Is the "auto mode" enabled by default?

Rhyono 08/09/17 03:51 PM

For addons being marked as libraries: is that automatic for nested addons (likely libraries) or is it something only possible via authors specifying it as such?

ZOS_ChipHilseberg 08/10/17 08:21 AM

Quote:

Originally Posted by sirinsidiator (Post 32243)
That sounds pretty good to me. Is the "auto mode" enabled by default?

It would be default, yes.

ZOS_ChipHilseberg 08/10/17 08:22 AM

Quote:

Originally Posted by Rhyono (Post 32246)
For addons being marked as libraries: is that automatic for nested addons (likely libraries) or is it something only possible via authors specifying it as such?

I think it would be safer to do it manually since there aren't too many libraries and it prevents weird issues when people use non-standard organizations of their addons into folders.

votan 08/10/17 08:35 AM

Something that came into my mind:
How should we "register" our libraries?

Should we continue to embed LibStub?
Or is it wise to make LibStub build-in???

LibStub has changed exactly once to support minor version numbers. Which will be obsolete again.

Rhyono 08/10/17 09:13 AM

Quote:

Originally Posted by ZOS_ChipHilseberg (Post 32256)
I think it would be safer to do it manually since there aren't too many libraries and it prevents weird issues when people use non-standard organizations of their addons into folders.

Probably. I was just thinking about the many outdated addons whose libraries will now appear in the list simply because they haven't been updated. So if an old addon with LAM loads, then a new addon with LAM loads (let's assume they are the same version), will LAM show up in the addon (not the library) list because of the older one that was not specified as a library?

sirinsidiator 08/10/17 09:21 AM

Quote:

Originally Posted by Rhyono (Post 32258)
Probably. I was just thinking about the many outdated addons whose libraries will now appear in the list simply because they haven't been updated. So if an old addon with LAM loads, then a new addon with LAM loads (let's assume they are the same version), will LAM show up in the addon (not the library) list because of the older one that was not specified as a library?

No. LAM has never been bundled with a txt until now. If I did change to the new system, it would be as LAM3.0

Rhyono 08/10/17 09:35 AM

I didn't literally mean LAM, just any lib that a lot use. :P

sirinsidiator 08/10/17 09:46 AM

Quote:

Originally Posted by Rhyono (Post 32260)
I didn't literally mean LAM, just any lib that a lot use. :P

It's the same for any lib that exists right now. I don't know of any that is bundled with an txt file included.


All times are GMT -6. The time now is 11:32 AM.

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