Skip to content
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

cls-hooked: update namespace methods to include enter and exist for a context #33566

Merged
merged 5 commits into from
Mar 9, 2019

Conversation

kouros51
Copy link
Contributor

@kouros51 kouros51 commented Mar 3, 2019

Update namespace methods to include enter and exist for a context.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes:
  • Both functions added in the namespace definition are already part of the cls-hooked library so no change in the original library code. cls-hooked project
  • But since there is bug issue for that matter caused by behavior inconsistencies across node versions. The solution to have the access to the context is doable with the library but not reflected in the types name-space. This merge request is proposed to give users the ability to work around that bug when using "@types/cookie-parser"
  • The usage is explained in the use case added to the test file. Long story short, when using only the functions exposed in the current version and using many middle-wares in a express application, cls-hooked will lose the context. So when we want to access a certain key in the name-space, this one is undefined. The solution proposed in here is to control the context of a given name-space manually. That's add flexibility and control in the application.
  • Increase the version number in the header if appropriate.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }.

@typescript-bot typescript-bot added this to Waiting for Reviewers in Pull Request Status Board Mar 3, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Mar 3, 2019

@kouros51 Thank you for submitting this PR!

🔔 @aleung - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot typescript-bot moved this from Waiting for Reviewers to Review in Pull Request Status Board Mar 8, 2019
@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Mar 8, 2019
@typescript-bot
Copy link
Contributor

After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience!

@sandersn sandersn merged commit 6b201df into DefinitelyTyped:master Mar 9, 2019
@typescript-bot
Copy link
Contributor

I just published @types/cls-hooked@4.3.0 to npm.

@weswigham weswigham moved this from Review to Done in Pull Request Status Board Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Unmerged The author did not merge the PR when it was ready.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants