-
Notifications
You must be signed in to change notification settings - Fork 9
[AXON-293] Add _isServerEnv override for VSCODE extensions #26
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
base: main
Are you sure you want to change the base?
[AXON-293] Add _isServerEnv override for VSCODE extensions #26
Conversation
/** | ||
* Overrides the blocking of exposure events if you are working in a Node js project | ||
*/ | ||
overrideServerEnv?: boolean |
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 would rename it to forceLogExposures
for clarity
@@ -119,7 +119,8 @@ export class EventLogger { | |||
} | |||
|
|||
start(): void { | |||
if (_isServerEnv()) { | |||
const override = this._options?.overrideServerEnv | |||
if (_isServerEnv() && !override) { |
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.
to improve performances, values should be checked before function calls
|
||
const override = this._options?.overrideServerEnv; | ||
|
||
if (_isServerEnv() && !override) { |
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.
same
function _assignGlobalInstance(sdkKey: string, client: StatsigClientInterface) { | ||
if (_isServerEnv()) { | ||
function _assignGlobalInstance(sdkKey: string, client: StatsigClientInterface, overrideServerEnv?: boolean) { | ||
if (_isServerEnv() && !overrideServerEnv) { |
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.
same
What is this change:
_isServerEnv()
method which blocks our ability to send exposure eventsWhy:
Related to #23