Skip to content

Conversation

shubham1172
Copy link
Member

@shubham1172 shubham1172 commented Feb 16, 2022

Description

This PR makes DaprClient and DaprServer configurable using environment variables. If missing, they fallback to a sane default value.

Issue reference

Please reference the issue this PR will close: #178

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
@shubham1172 shubham1172 requested review from a team as code owners February 16, 2022 13:42
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
@shubham1172 shubham1172 changed the title [WIP] Use environment variables to initialize client and server Use environment variables to initialize client and server Feb 16, 2022
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
@shubham1172
Copy link
Member Author

/cc @XavierGeerinck for review

@XavierGeerinck
Copy link
Contributor

One extra question: I see you are using ?? is there a reason you are not using ||?

I personally prefer || more since it also replaces null values in Javascript, since Javascript is sometimes "interesting" with "Falsey" variables

@shubham1172
Copy link
Member Author

@XavierGeerinck, I had seen ?? in other TS codebases. Also saw this one https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#nullish-coalescing
image

From https://stackoverflow.com/questions/61480993/when-should-i-use-nullish-coalescing-vs-logical-or, ||

But the OR operator || can be problematic if your left value might contain "" or 0 or false

What do you think?

@XavierGeerinck
Copy link
Contributor

Awesome, LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JS-SDK client uses environment variables to initialize
2 participants