-
Notifications
You must be signed in to change notification settings - Fork 83
feat: Convert projectConfig module to TS #653
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
Conversation
e10eda9
to
8acab1c
Compare
67eb025
to
fa3a61d
Compare
I reviewed #659 first and i see that you have already converted |
@zashraf1985 the #659 branch is based off of this branch. The plan was for this pr to be merged first and #659 to be rebased after that. Should have been more explicit about it, sorry! |
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.
Looks Great! A few nits and optional suggestions.
* Determine for given experiment if event is running, which determines whether should be dispatched or not | ||
* @param {ProjectConfig} configObj Object representing project configuration | ||
* @param {string} experimentKey Experiment key for which the status is to be determined | ||
* @return {boolean} True is the experiment is running |
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.
SUPER NIT: True if
* @param {ProjectConfig} configObj Object representing project configuration | ||
* @param {string} experimentKey Experiment key for which the status is to be determined | ||
* @return {boolean} True is the experiment is running | ||
* False is the experiment is not running |
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.
SUPER NIT: False if
variableValue: string, | ||
variableType: string, | ||
logger: LogHandler | ||
): unknown { |
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.
Should return type be one of the variable types or'ed
? like string | number | ...
. Just suggesting. this is also fine as is.
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.
We have been using unknown
everywhere when dealing with variables of unknown type (example functions: getFeatureVariableForType
, getFeatureVariableValueFromVariation
, and getAllFeatureVariables
, so I think it is best to stay consistent with what we have.
* @returns {TryCreatingProjectConfigResult} | ||
*/ | ||
export const tryCreatingProjectConfig = function( | ||
config: TryCreatingProjectConfigConfig |
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.
Why defining this interface separately. if its not being reused anywhere or not being exposed outside, this can probably be done inline.? same for the return type. Just a suggestion, feel free to take it or leave it.
Summary
Convert
projectConfig
module to TSTest plan
Existing unit tests