-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support inline dependencies on plugins #2405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
}; | ||
|
||
Hoek.assert(item.name, 'Missing plugin name', hint); | ||
Hoek.assert(typeof item.dependencies === 'string' || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not a joi.assert here?
@hueniverse like that or do you want to check the whole item object ? I don't know if doing it now would be a breaking change for some people. |
This is fine, but why a breaking change for some people? |
Support inline dependencies on plugins
|
||
selection.dependency(item.dependencies, function (server, next) { | ||
|
||
// Deferred registration when all dependencies are resolve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change in behavior. Dependency does not imply order. If you want to dictate order of registration you can't use this mechanism.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's an order to have here, dependencies in registration all just have to be there before the plugin begins his own registration. How is that a change if there wasn't any mechanism for that before ?
EDIT: now I get what you mean, I think people will expect that. If you declare a dependency to register a auth scheme or strategy for example, you need it to be done before you declare your own routes right ? What I did was less surprising IMO.
@hueniverse breaking because depending on how we validate the object, we might reject existing configurations if it's too strict. |
Sorry about not working on this. Glad it's landed though :-) |
@Marsup not if we allow unknown keys :-) |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Fixes #2332.
I have a small doubt on L248 of this patch,
server
is the same asselection
right ?