Credits go to @jedireza for finding this one.
Registration order has an impact on decorations access, regardless of the use of server.dependency.
For exemple calling server.views with [Vision, Lout] will work, [Lout, Vision] won't : TypeError: Object [object Object] has no method 'views'.
Decorations are only copied on the initialization of the plugins, so while the server.root is always aware of those decorations, this line will not be propagate the decorators to others.
It seems I have 2 choices here :
- always use
server.root.*
- fix it in hapi, by copying again (maybe here) all the decorations from the root
Willing to make a PR if that's the 2nd case.
Credits go to @jedireza for finding this one.
Registration order has an impact on decorations access, regardless of the use of
server.dependency.For exemple calling
server.viewswith[Vision, Lout]will work,[Lout, Vision]won't :TypeError: Object [object Object] has no method 'views'.Decorations are only copied on the initialization of the plugins, so while the server.root is always aware of those decorations, this line will not be propagate the decorators to others.
It seems I have 2 choices here :
server.root.*Willing to make a PR if that's the 2nd case.