Skip to content

Remove LibStub #77

@p3lim

Description

@p3lim

So there's a quite major issue with this library that I would like to talk about publicly, which will heavily influence a future "LibEditMode-2.0".

LEM has to deal with a lot of changes because of how tightly it integrates with the Edit Mode, which is a very movable target - i.e. it doesn't stay the same two patches in a row.

Unlike most other libraries that are mostly or fully self-contained, ensuring deprecations and upgrades can work between minor version upgrades or multiple different versions of the library loaded at the same time, this is a non-insignificant issue with LEM.

Because of this, and to allow myself to make more sweeping changes to the library without being limited to minor version changes because of LibStub, I am going to stop using LibStub in the next major version of this library, in favor of injecting it straight into the addon namespace.

This would allow me to use a different versioning scheme (like SemVer) and do more broad changes to the library without having to consider other versions of the same library being loaded at the same time, without having to create a new library every time. I do something similar for my boilerplate "Dashi", although it is not versioned.

The only communication needed between multiple versions of LEM (and potentially other libraries that have popped up that do the same thing) is closing existing opened dialogs (like the Blizzard system one), which can be handled by anonymous callbacks through Blizzard's callback system.

This obviously brings a little more overhead, as multiple instances of LEM will exist at the same time, but they'll only be managing one addon each, and should never run into the issue where they could interfere with each other.

For users of this library, this should be the only change needed:

-- replace this:
local LEM = LibStub('LibEditMode')
-- with this:
local _, ns = ...
local LEM = ns.LibEditMode

Of course, a new major version would or could introduce changes to the APIs, that is expected.

Now, the reason I haven't started this work yet is because I've been in contact with Blizzard and talked with them about the reason we need this library in the first place, and the response was that they'd look into making the Edit Mode more approachable by addons in the same way they revamped the Settings and Menu systems. Until I hear back from them about the plans about this I am holding off doing any work to bring a new major version of LEM out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions