-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Introduce an ApplicationInstance-specific registry to Boot Cleanup WIP #10308
Conversation
@@ -18,23 +18,34 @@ var VALID_FULL_NAME_REGEXP = /^[^:]+.+:[^:]+$/; | |||
@class Registry | |||
*/ | |||
function Registry(options) { | |||
this.failover = options && options.failover ? options.failover : null; |
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 total bikeshed, but I'm not totally in love with the term "failover." To me, a failover implies latch-like behavior: once the "fail" has occurred, you switch everything over to the failover. For example, if the power goes out, you have a "failover" generator that everything switches to.
In this case, it's not really a failover per se… it just looks in its local one first, then expands its search to the parent registry if it's available. Perhaps this terminology is controversial, but I think I'd almost prefer parentRegistry
to failover
.
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.
fallback?
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.
Fallback seems good.
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.
ok, fallback
it is - thanks @rwjblue!
A registry's fallback registry resolves registrations and injections when no matches can be found.
The instance's registry sets its fallback to the corresponding application's registry.
3a6cfc2
to
c771d3c
Compare
Ensure that `name` and `type` are valid after initial parsing and before any post-parsing mutations might be performed. This fixes a problem in which mutations are performed to the cached object (e.g. "route:basic" -> "route:") and then the validation of the mutated object fail when it's accessed a second time. It's also more efficient, since validation only occurs once.
c771d3c
to
a162f86
Compare
Bless you child. 🙏 |
🍻 |
The ApplicationInstance-specific registry uses its corresponding Application's registry as a failover to resolve registrations and injections.
Soon, this registry will be abstracted behind proxies such as
register
andinject
on the instance itself.cc @wycats @tomdale