You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
===== Pack.register yar
===== Pack.register callback dep checks
===== Pack.register myAuthenticationPluginWhichNeedsYar
===== Pack.register callback dep checks
if I alpha-sort the keys to the manifest's plugins, Hapi registers myAuthenticationPluginWhichNeedsYar before yar and crashes with the 'missing dependency' assertion.
The documentation suggests circular requirements are OK if at most one plugin declares an after method:
after - an optional function called after all the specified dependencies have been registered and before the servers start. The function is only called if the pack servers are started. If a circular dependency is created, the call will assert (e.g. two plugins each has an after function to be called after the other).
I'm thus surprised Hapi checks the dependencies on every register, not just the last.
An object is an unordered collection of zero or more name/value pairs, where a name is a string and a value is a string, number, boolean, null, object, or array.
This might make circular plugin dependencies impossible when using hapi -c for the "deploy with two files" (manifest and package) strategy I've heard @hueniverse rightly spruik more than once
It feels brittle
Reasons to argue this is OK:
V8 enumerates keys in insertion order as long as the keys don't parse as integers.
Who cares about hapi -c?
Who cares about my feels?
The text was updated successfully, but these errors were encountered:
hapi -c
crashes if pluginx
registers withplugin.dependency('y')
andmanifest.json
declaresx
beforey
:Consider Pack.register with two calls to
console.error
jammed in:Output if I declare
yar
first inmanifest.json
:if I alpha-sort the keys to the manifest's
plugins
, Hapi registersmyAuthenticationPluginWhichNeedsYar
beforeyar
and crashes with the'missing dependency'
assertion.The documentation suggests circular requirements are OK if at most one plugin declares an
after
method:I'm thus surprised Hapi checks the dependencies on every
register
, not just the last.Reasons to argue this is not OK:
Not all JSON-handling tools are guaranteed to preserve order, as the standard does not require order preservation:
This might make circular plugin dependencies impossible when using
hapi -c
for the "deploy with two files" (manifest
andpackage
) strategy I've heard @hueniverse rightly spruik more than onceIt feels brittle
Reasons to argue this is OK:
hapi -c
?The text was updated successfully, but these errors were encountered: