-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[RNMobile] Use tarball instead of git tag for react-native-editor forked dependencies #34886
Conversation
Size Change: +6.15 kB (+1%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
packages/react-native-bridge/android/react-native-bridge/build.gradle
Outdated
Show resolved
Hide resolved
packages/react-native-bridge/android/react-native-bridge/build.gradle
Outdated
Show resolved
Hide resolved
Heads up that I approved all tarball PRs from the forked dependencies, so we could start merging them into |
@ceyhun do you have any concerns regarding starting the merge? Thanks 🙇 ! |
All forked dependency PRs have been merged and their URLs in |
"react-native-keyboard-aware-scroll-view": "git+https://github.com/wordpress-mobile/react-native-keyboard-aware-scroll-view.git#v0.8.8-wp", | ||
"react-native-linear-gradient": "git+https://github.com/wordpress-mobile/react-native-linear-gradient.git#v2.5.6-wp-1", | ||
"react-native-hsv-color-picker": "https://raw.githubusercontent.com/wordpress-mobile/react-native-hsv-color-picker/03c0038419326fb86120560cdc3ce958d52cee37/react-native-hsv-color-picker-1.0.1-wp-1.tgz", | ||
"react-native-keyboard-aware-scroll-view": "https://raw.githubusercontent.com/wordpress-mobile/react-native-keyboard-aware-scroll-view/v0.8.8-wp-1/react-native-keyboard-aware-scroll-view-0.8.8-wp-1.tgz", |
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 only dependency that uses tag instead of commit hash in the URL. In the future, when we introduce changes in a forked repository, we would need to generate a tarball and a tag so it will be expected that tarball URLs have the tag, as we have for react-native-keyboard-aware-scroll-view
package.
I'm not sure why we didn't generate a new tag for the rest of the repositories but probably it was related to the fact that we're not introducing changes and only the tarball file.
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.
@fluiddot from working on #36328, it would appear the following is true. I figured I would capture it for posterity.
npm
usage within this repository is able to install the third-party packages via git commit hash, so it does not require a tag itself.- The native bridge Android integration extracts the tag name from the tarball file name.
- The native bridge Android integration fetches the forked third-party package using the tag name, which means the relevant tag must be pushed to the forked repository origin.
I.e. npm
uses the git reference in the URL. Native bridge Android integration uses the tag name found in the tarball filename.
All that said, it makes sense to me to use the tag name in the URLs found in this file rather than a git commit hash, even though it is not explicitly required by npm
. Hopefully the consistency of using a tag name will avoid future confusion.
Thank you for calling out this subject. It helped me greatly.
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.
LGTM!
Now that this PR has been merged, we should revert the changes introduced in #35111. @hypest I'd appreciate it if you could take a look at the PR I've just created for this, thanks 🙇 . |
Thanks everyone for your hard work here! |
…ked dependencies (#34886) * Use tarball instead of git tag for rn-editor fork dependencies * Update @react-native-community/slider tarball URL * Trigger CI * Hardcode version numbers in rn-bridge build.gradle * Add readHashedVersion function * Update and rename readHashedVersion * Remove println from extractPackageVersion * Update react-native-editor forked repos references * Fix react-native-keyboard-aware-scroll-view dep url * Update package-lock.json Co-authored-by: Carlos Garcia <fluiddot@gmail.com>
Great work folks! Thanks! |
Thank you for the changes introduced. Do you have any follow-up work planned to align dependencies of forked dependencies so they install correctly with npm v7? |
Not yet, so far I have only tried to install the dependencies using the tarball solution and the changes from #33892 but I encountered several errors not related to the forked dependencies. I'll try this week again but starting the NPM 7 migration process from scratch, just in case that approach works. Another thing we need to verify is if all forked dependencies support NPM 7, I don't foresee any issue here but it would be worth it to double-check it. |
Description
Gutenberg Mobile PR: wordpress-mobile/gutenberg-mobile#3982
Used tarball instead of git tag for react-native-editor forked dependencies.
They are created by running
npm install
andnpm pack
in the forked repository and committing the.tgz
file.These
.tgz
files are later referenced inpackages/react-native-editor/package.json
instead of their git tags.Related to #33424
Forked dependency PRs (already merged ✅ ):
How has this been tested?
Screenshots
N/A
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
*.native.js
files for terms that need renaming or removal).