-
Notifications
You must be signed in to change notification settings - Fork 1.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
Deprecate current-context API [2.x] #2559
Conversation
Would this somehow make it any easier to solve the following issue without a hack? |
Probably not. My intention here is to allow us to back out of |
// ClsContext.getCurrentContext() to loopback.getCurrentContext() | ||
deprecated('loopback.getCurrentContext() is deprecated. ' + | ||
'Consider using different means of passing the context around. ' + | ||
'As a short-term fix, use loopback-context-cls module.'); |
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 message is a bit confusing. Maybe we should say something like:
The current implementation is based on loopback-context-cls and it has some limitations.
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 am fine to improve the message, as long as it remains actionable. I.e. it should be clear to the user how to get rid of that deprecation warning.
IMO, your proposal @raymondfeng, describes the state but does not provide any clue to the user about how to proceed.
Which part of the message do you find confusing?
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.
Can we link to a github issue or wiki (or other doc) so that we can keep the info up to date?
A deprecation warning will be sufficient to direct the person to a doc with some concrete info. We can also keep this up to date as we look into this further.
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.
The confusing part of As a short-term fix, use loopback-context-cls module.
is that it seems to instruct a user to use loopback-context-cls
, which is already being used.
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 have reworded deprecation warnings to point to our documentation page: https://docs.strongloop.com/display/APIC/Using%20current%20context
5c89b50
to
ba55e26
Compare
@raymondfeng @ritch PTAL again, LGTY now? |
LGTM |
I am waiting for https://github.com/strongloop/loopback-context/pull/3/files before landing this PR. |
Deprecate all current-context APIs in favour of loopback-context-cls.
ba55e26
to
ca28e7f
Compare
Deprecate all current-context APIs in favour of loopback-context-cls.
This is a follow-up for strongloop/loopback-context#1
@raymondfeng @ritch please review
cc @strongloop/loopback-dev FYI