-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat(core): derived context #288
Conversation
Codecov Report
@@ Coverage Diff @@
## master #288 +/- ##
==========================================
- Coverage 95.41% 95.37% -0.05%
==========================================
Files 157 162 +5
Lines 2769 2981 +212
Branches 366 401 +35
==========================================
+ Hits 2642 2843 +201
- Misses 123 134 +11
Partials 4 4
Continue to review full report at Codecov.
|
You so wonderfully documented the implications of these changes in the PR description, but I don't see any of that in the code. I'd love to see some of these less-obvious implications described at the code level. |
What do you mean? It only affects EventBus reader so far. Or do you mean the dedicated test case which covers this kind of scenario? |
Well, for example, its not entirely obvious to me purely from code what DerivedContext means. The code is very clear in the sense that I understand what is done, but I don't understand the why 🤔 Lacking that knowledge its not entirely clear why https://github.com/marblejs/marble/pull/288/files#diff-2430a932986481cd11bfd4c84fc9dcebR105 doesn't lead to infinite recursion. The PR at least hints at the purpose, but PR descriptions are lost in time. 🤷♂️ |
21a26c0
to
7e1a589
Compare
@tstelzer it is mostly an internal thing and I'm not sure if it can be documented differently... The documentation for |
👍 I like to document these kind of decisions on the code level, rather than in PRs or even commit messages. Different styles, I guess. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
EventBus
initializes the reader with the copy of derived context, eg. HttpServer context. Marble.js dependency injection container (aka Context) is built around JS Map. When removing a token from the context, references are changed because the whole Map is cloned.What is the new behavior?
EventBus
uses a new concept of derived context (aka Context in Context)How does it work?
DerivedContext
token which points to a derived context objectDerivedContext
and recursively invoke the lookup process again for that context.Does this PR introduce a breaking change?