Closed hardikmashru closed 5 months ago
I still see some types that could be consolidated, i.e., IEmbeddedImpression
-> Impression
, IEmbeddedSession
-> Session
. Mind doing an audit of these to see if some of these types are redundant?
And one nit, can we remove the I
prepended on the interfaces (IEmbeddedMetadata -> EmbeddedMetadata
)? We know the type is an interface
so it's a bit unnecessary.
Thanks in advance!
I still see some types that could be consolidated, i.e.,
IEmbeddedImpression
->Impression
,IEmbeddedSession
->Session
. Mind doing an audit of these to see if some of these types are redundant?And one nit, can we remove the
I
prepended on the interfaces (IEmbeddedMetadata -> EmbeddedMetadata
)? We know the type is aninterface
so it's a bit unnecessary.Thanks in advance!
Some types of interfaces could not be consolidated like IEmbeddedSession -> Session because IEmbeddedSession has start, end, placementId, impressions, id and deviceInfo Session has id, start and end.
IEmbeddedSession is used in trackEmbeddedSession in src/events/embedded/events.ts. Session is used internally in EmbeddedMessagingSession interface in src/events/embedded/types.ts
We cannot remove the 'I' prefix from the interfaces because it will result in the same name as some classes. For example, There is an EmbeddedImpressionData class, and the IEmbeddedImpressionData interface is used in src/embedded/embeddedSessionManagers.ts.
EmbeddedSession class, and the IEmbeddedSession interface is used in src/embedded/embeddedSessionManagers.ts.
So to remove I
from the interface we have to think about new names for those interfaces which right now seem like ideal names.
I still see some types that could be consolidated, i.e.,
IEmbeddedImpression
->Impression
,IEmbeddedSession
->Session
. Mind doing an audit of these to see if some of these types are redundant? And one nit, can we remove theI
prepended on the interfaces (IEmbeddedMetadata -> EmbeddedMetadata
)? We know the type is aninterface
so it's a bit unnecessary. Thanks in advance!Some types of interfaces could not be consolidated like IEmbeddedSession -> Session because IEmbeddedSession has start, end, placementId, impressions, id and deviceInfo Session has id, start and end.
IEmbeddedSession is used in trackEmbeddedSession in src/events/embedded/events.ts. Session is used internally in EmbeddedMessagingSession interface in src/events/embedded/types.ts
We cannot remove the 'I' prefix from the interfaces because it will result in the same name as some classes. For example, There is an EmbeddedImpressionData class, and the IEmbeddedImpressionData interface is used in src/embedded/embeddedSessionManagers.ts.
EmbeddedSession class, and the IEmbeddedSession interface is used in src/embedded/embeddedSessionManagers.ts.
So to remove
I
from the interface we have to think about new names for those interfaces which right now seem like ideal names.
@hardikmashru understood! thanks for the thorough response!
JIRA Ticket(s) if any
Description
Test Steps