-
Notifications
You must be signed in to change notification settings - Fork 44
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
Create SR module without native implementation #541
Create SR module without native implementation #541
Conversation
buildToolsVersion getExtOrDefault('buildToolsVersion') | ||
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION | ||
if (agpVersion.tokenize('.')[0].toInteger() >= 7) { | ||
namespace = "com.datadog.sessionreplay.reactnative" |
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.
Let me know if you think we can come up with a better package name (the core package name is com.datadog.reactnative
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.
yes, let's flip the parts and call it com.datadog.reactnative.sessionreplay
, this will align with the naming on the native side, which is com.datadog.android.sessionreplay
728336e
to
85ee611
Compare
d4fc364
to
5f9f7eb
Compare
}, | ||
"license": "Apache-2.0", | ||
"main": "lib/commonjs/index", | ||
"private": true, |
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.
this is the line that prevents the package from being published
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.
Approving the packages/react-native-session-replay/README.md
update, but just wanted to ask whether it's necessary to add a page for something that's not supported yet. Is this something that's expected later?
I might be misunderstanding something or not have all the relevant context, but flagging just in case.
The merge-base changed after approval.
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.0)) | ||
connection.project.dir= | ||
eclipse.preferences.version=1 | ||
gradle.user.home= | ||
java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home |
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.
is this file needed? it contains very old references to Gradle 6.0, which is not used for sure, and Java 11 is needed at least instead of the Java 1.8 referenced here.
buildToolsVersion getExtOrDefault('buildToolsVersion') | ||
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION | ||
if (agpVersion.tokenize('.')[0].toInteger() >= 7) { | ||
namespace = "com.datadog.sessionreplay.reactnative" |
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.
yes, let's flip the parts and call it com.datadog.reactnative.sessionreplay
, this will align with the naming on the native side, which is com.datadog.android.sessionreplay
} | ||
} | ||
|
||
// This is needed to make unmock work. Choreographer class was loaded from android.jar of Android SDK |
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.
There is no more Choreographer
class usage in Android SDK, is this configuration lambda needed?
DatadogSDKReactNativeSessionReplay_compileSdkVersion=31 | ||
DatadogSDKReactNativeSessionReplay_buildToolsVersion=31.0.0 | ||
DatadogSDKReactNativeSessionReplay_targetSdkVersion=31 |
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.
minor question: given that the current Android API is 34, should we target it?
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'd like to keep this in sync with the value used in the version of the RN dev dependency (currently 0.71).
So I agree it should be at least 33 which is the default version for RN 0.71 and 0.72.
Is it ok if I bump it to 34 once we migrate the RN dev dependency to 0.73?
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.
My question is just theoretical, let's keep it in sync with the value used by the latest RN version we are using.
...droid/src/main/kotlin/com/datadog/sessionreplay/reactnative/DdSessionReplayImplementation.kt
Outdated
Show resolved
Hide resolved
...n-replay/android/src/newarch/kotlin/com/datadog/sessionreplay/reactnative/DdSessionReplay.kt
Outdated
Show resolved
Hide resolved
...-replay/android/src/test/kotlin/com/datadog/sessionreplay/reactnative/DdSessionReplayTest.kt
Outdated
Show resolved
Hide resolved
1697817
to
5c54e0d
Compare
5c54e0d
to
0f14db3
Compare
api "com.facebook.react:react-android:$reactNativeVersion" | ||
} | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | ||
compileOnly "com.squareup.okhttp3:okhttp:3.12.13" |
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.
FYI: SDK v2 is on OkHttp 4.11 https://github.com/DataDog/dd-sdk-android/blob/4744e9d7f85449708c96580ba5f7bd9695dbebc0/gradle/libs.versions.toml#L6, so you probably would like to change the version here.
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.
Indeed it's not needed here.
We only use it for the ProxyAuthenticator and it's compileOnly
, so the migration should be fairly easy for core
.
I will create a technical task for the migration.
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.
all files should be moved to conform the new namespace, they shouldn't be under com/datadog/sessionreplay/reactnative
, but under com/datadog/reactnative/sessionreplay
1765a47
to
a65de6b
Compare
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 |
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.
SDK v2 is producing Java 11 bytecode, so maybe you would like to align
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.
What is the risk with changing this value?
I would prefer to make the change in a dedicated PR to avoid breaking support for some client apps.
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 guess there is no risk, because SDK v2 artifacts are already with Java 11 bytecode anyway. Out of curiosity, what bytecode level is emitted by RN itself?
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.
It's VERSION_11
for the latest versions.
unMock { | ||
keep("android.os.Looper") | ||
keep("android.os.MessageQueue") | ||
keep("android.os.SystemProperties") | ||
keep("android.view.Choreographer") | ||
keep("android.view.DisplayEventReceiver") | ||
} |
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.
not sure if all this is still needed with SDK v2
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.
Not needed for RNSR but still needed for core tests. I will remove in the next PR so you don't have to approve this one again for it to be merged :)
@buraizu I wanted to add an indication in case someone noticed it browsing github and would attempt to use it right away. |
a65de6b
to
5c58db4
Compare
testImplementation "com.github.xgouchet.Elmyr:jvm:1.3.1" | ||
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0" | ||
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" | ||
unmock 'org.robolectric:android-all:4.4_r1-robolectric-r2' |
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.
probably you don't need this either and no need to apply unmock
plugin as well, but this is very minor, can be addressed later
What does this PR do?
This creates a module for SR with no actual logic on the native side.
The configuration on the JS side is done, no more thing should be needed here after.
The package cannot be published to npm, even by accident.
Additional Notes
A coming PR will enable SR on both Android and iOS and add test + linting on native code in Bitrise.
Review checklist (to be filled by reviewers)