-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Use android artifacts for react-native libraries in react-native-bridge #39294
Use android artifacts for react-native libraries in react-native-bridge #39294
Conversation
The idea is that we only expose the dependencies of react-native-bridge when we're not publishing the binaries, like for example when building the demo app.
…idge" This reverts commit 7d593bf.
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.
@oguzkocer I think this PR is ready for review, wdyt?
} | ||
|
||
// Extract version from hash of Git URL | ||
def version = dep.substring(dep.lastIndexOf('#') + 1) |
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 should add the case of parsing regular version values (i.e. x.y.z
). This is not an issue yet because this code actually works (the result of dep.lastIndexOf('#')
is -1
) but I don't think it's a reliable approach.
packages/react-native-bridge/android/react-native-bridge/build.gradle
Outdated
Show resolved
Hide resolved
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.
One caveat to take into account is that due to this change, we'll no longer be able to modify the source code of the dependencies when testing locally, as now they'll be read-only. I don't think this is a major issue, but it might affect the development workflow when working on patching for a dependency. As a workaround for this, we could modify locally the following files in case we'd like to modify a dependency (e.g. react-native-video
):
packages/react-native-editor/android/settings.gradle
:
include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../../../node_modules/react-native-video/android-exoplayer')
packages/react-native-editor/android/app/build.gradle
:
// implementation "com.github.wordpress-mobile:react-native-video:${extractPackageVersion('../../../react-native-editor/package.json', 'react-native-video', 'dependencies')}"
api project(':react-native-video')
@@ -10,7 +10,6 @@ buildscript { | |||
wordpressUtilsVersion = '2.3.0' | |||
espressoVersion = '3.0.1' | |||
aztecVersion = 'v1.5.4' | |||
willPublishReactNativeAztecBinary = properties["willPublishReactNativeAztecBinary"]?.toBoolean() ?: false |
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.
Now that we won't use this argument, we could also remove it from this script in GB-mobile.
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 can do this in a follow up PR since passing the property is harmless.
packages/react-native-bridge/android/react-native-bridge/build.gradle
Outdated
Show resolved
Hide resolved
@fluiddot I am not sure I fully understand your suggestion. Are you saying you'd like to keep a commented out code in the repo so it can be used for testing? If that's the case, as a rule of thumb, we typically prefer not to have any commented out code in our repository. We believe My preference would be to not have anything like this in the project and use the proper way to test it by publishing the necessary version from the publisher library and updating the version. The main reason for this is that building from source code might introduce side effects to the project and might even fail because of the configuration of Let me know what you think! |
@oguzkocer I totally agree with your opinion, in fact, the code I provided was just an example of how we could test using the source code of a library, I didn’t want to imply that it was a suggestion to include in the PR, sorry for the confusion. |
@oguzkocer The PR is ready to merge, however, I'll wait until a fixed is provided to address the failure in CI job |
@fluiddot I restarted the CI job and it succeeded this time. As you mentioned, there aren't any changes related to that job in this PR, so I think it's safe to merge, which I'll do so now. |
What?
This PR updates the
react-native-editor
,react-native-aztec
&react-native-bridge
projects to use the published artifacts ofreact-native
&react-native
libraries such asreact-native-svg
.Why?
This is done to simplify these 3 projects and more importantly so that we don't have to maintain forks for them. This change will be followed up with #39348 which will drop these forks and use the original repos instead.
How?
We already had a setup for using these published artifacts in these projects. This was used when we were publishing
react-native-bridge
&react-native-aztec
projects themselves. So, we just needed to remove the setup for using the source code for these libraries.Testing Instructions
We should verify that both
react-native-editor
demo project and WordPress-Android work as expected. There isn't a specific change in this PR, so we'll need to make due with smoke tests.