-
Notifications
You must be signed in to change notification settings - Fork 83
feat: Convert event_tag_utils module to TS #544
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
feat: Convert event_tag_utils module to TS #544
Conversation
6f5d89e
to
a1cbc3d
Compare
a1cbc3d
to
172b7ae
Compare
…izely/javascript-sdk into mcarroll/optimizely-sdk-typescript
2512009
to
c5ed708
Compare
c5ed708
to
f99e533
Compare
…izely/javascript-sdk into mcarroll/optimizely-sdk-typescript
f99e533
to
7caeddd
Compare
@@ -15,6 +15,9 @@ | |||
*/ | |||
import { sprintf } from '@optimizely/js-sdk-utils'; | |||
|
|||
import { EventTags } from '../../../../event-processor/src/events'; | |||
import { LoggerFacade } from '../../../../logging/src/models'; |
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.
import { LoggerFacade } from '../../../../logging/src/models'; | |
import { LoggerFacade } from '@optimizely/js-sdk-logging'; |
034f8db
to
f69fd61
Compare
let revenue = null; | ||
let eventValue = null; | ||
|
||
if (eventTags) { |
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.
@mjc1283 FYI if (eventTags) {...}
already exists in event_builder/index.js
, so this is the only place where we need to put it.
*/ | ||
import { sprintf } from '@optimizely/js-sdk-utils'; | ||
|
||
import { EventTags } from '../../../../event-processor/src/events'; |
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.
Oops, I missed this one last time.
Just like the logging import - we can't reach into other packages. They are published separately.
import { EventTags } from '../../../../event-processor/src/events'; | |
import { EventTags } from '@optimizely/js-sdk-event-processor'; |
let parsedRevenueValue; | ||
let parsedEventValue; |
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.
Normally I would suggest declaring these inside the functions where they're used. Let me know your thoughts on declaring them here vs. inside.
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.
You are absolutely right, we should keep them inside the code block where they are being used. :)
75ab813
to
a61a375
Compare
* Convert event_tag_utils module to TS * Convert event_tag_utils module to TS * Add type guard to avoid using any * Move 'if (eventTags)' to top level functions * Move let variables to inside the functions
Summary
event_tag_utils
module from JS to TS.Test plan