I maintain a Grid plugin called GridDynamicLayout and I came into a weird problem yesterday. I had to securely hook a Grid method so I figured I would just add AceHook-2.1 to the mixin like this :
local GridDynamicLayout = AceLibrary("AceAddon-2.0"):new("AceConsole-2.0", "AceEvent-2.0", "AceHook-2.1")
This didn't work, errored out in OnEnable saying that SecureHook was not a method... After mucho attempts at understanding this rather weird behaviour I came up with the ugly hack to create a new mixin with AceHook-2.1, which worked :
local GridDynamicLayout = AceLibrary("AceAddon-2.0"):new("AceConsole-2.0", "AceEvent-2.0")
local GridDynamicLayout_hook = AceLibrary("AceAddon-2.0"):new("AceHook-2.1")
It works but I hate to keep the code in that state, any suggestions ? I have little experience in Ace2 or method hooking so I probably made some dumb mistake that I'm not seeing...
Note : as a plugin with hard dependency to Grid I don't bother with actually embedding Ace2 libs, I just assume they are here and loaded since Grid will always load before my plugin. Maybe that's the problem but it's rather weird...
Grid does not use AceHook (as in : it doesn't declare AceHook it in the mixin), however it embeds it so the library itself should be loaded.
As a plugin to Grid which is based on Ace2 I'm reluctant to use Ace3...
The Ace3 modules are pretty small and designed to be used independent from one another. Besides - would be best to update the whole plugin to Ace3 eventually anyway, as Ace2 is only on life support for as long as other addons will need it.