Conversation
f5139bb to
a3c4345
Compare
BREAKING CHANGE: Certain class members are now static and `disabled` is a potentially-async getter only. **Dynamic Disable** The enhancer can now be dynamically enabled & disabled after being bound. **Static Class Members** Class members that do not require knowledge of the class state are now static. Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
a3c4345 to
798de8b
Compare
| @inject.view(filterByKey(CoreBindings.APPLICATION_CONFIG.key)) | ||
| private _config: ContextView<ApplicationConfig>, |
There was a problem hiding this comment.
Should move this to property injection.
There was a problem hiding this comment.
Are you modifying the _config object afterwards?
There was a problem hiding this comment.
ContextView would allow modification of the configuration after the ConsolidationEnhancer is initialised, which would give a better developer experience instead of having to re-bind the enhancer for those who need a more "dynamic" configuration.
| } | ||
|
|
||
| private patchRef( | ||
| private static patchRef( |
There was a problem hiding this comment.
| private static patchRef( | |
| private static _patchRef( |
There was a problem hiding this comment.
Why changing the name? Do we have a convention to use _ for private declaration names?
There was a problem hiding this comment.
Ctrl + Shift + F on vscode shows that this naming convention is being used across several packages:
loopback-next/packages/context/src/binding.ts
Lines 360 to 377 in 1e3f628
loopback-next/packages/core/src/application.ts
Lines 72 to 81 in 1e3f628
loopback-next/packages/http-server/src/http-server.ts
Lines 89 to 94 in 1e3f628
This PR should be bundled with other breaking changes.
Dynamic Disable
The enhancer can now be dynamically enabled & disabled after being bound.
This feature is intended to provide flexibility for LoopBack applications to have more "instant" configuration control during runtime without requiring a blocking rebind.
Static Class Members
Class members that do not require knowledge of the class state are now static.
Signed-off-by: Rifa Achrinza 25147899+achrinza@users.noreply.github.com
Checklist
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈