fullstory-babel-plugin-annotate-react icon indicating copy to clipboard operation
fullstory-babel-plugin-annotate-react copied to clipboard

README inaccuracy

Open van-fs opened this issue 10 months ago • 5 comments

Describe the bug The readme states, "For React on the web the attributes are data-component, data-element, and data-source-file. For React Native the attributes are dataComponent, dataElement, and dataSourceFile."

To Reproduce N/A

Expected behavior From looking at selectors in a native mobile org, data- attribute selectors definitely index for Mobile Apps platform dependent criteria. I'm not seeing any for dataComponent though. Kevin and Prashanth both said that's a doc bug FWIW. Can we remove the incorrect distinction between web and mobile? My understanding is that its data-* regardless of platform but could use someone more knowledge to clarify.

Actual behavior N/A

Node env (please complete the following information): N/A

Additional comments

Logs N/A

van-fs avatar Apr 16 '24 15:04 van-fs

It depends on where you look or what it is actually referring to. In order to get React Native to compile, internally the attributes actually are camel case. However, that is later changed to kebab-case when it hits our backend (I forget where).

JoshMiers-FS avatar Apr 18 '24 22:04 JoshMiers-FS

Ah, here it is: https://github.com/fullstorydev/fullstory-react-native/blob/master/android/src/main/java/com/fullstory/reactnative/FullStoryNativeProps.java

This is for Android, but you can see we add the kebabe-case as the actual attribute name when it gets set.

JoshMiers-FS avatar Apr 18 '24 22:04 JoshMiers-FS

I don't mind it being changed, but we should at least be clear that, for the babel plugin, it adds them as camelCase and then changed back to kebab-case when set so that you see them as kebab-case (just like for React web) in FSTA.

JoshMiers-FS avatar Apr 18 '24 22:04 JoshMiers-FS

@JoshMiers-FS Perhaps we append the text in bold to the paragraph. WDYT?

For React on the web the attributes are data-component, data-element, and data-source-file. For React Native the attributes are dataComponent, dataElement, and dataSourceFile. Note that for both React web and Native, these attributes will appear as kebab-case in the Fullstory application due to backend processing. End users of Fullstory should create search filters (i.e. segments, metrics, etc) using kebab-case.

van-fs avatar Apr 22 '24 14:04 van-fs

That sounds good to me.

JoshMiers-FS avatar Apr 22 '24 15:04 JoshMiers-FS