Repository navigation
Conversation
… one source The React Native Android module kept its own copy of Kotlin files that also live in packages/enriched-markdown-android. The 28 files that were byte-identical are now deleted from the RN tree and compiled from the library instead. android/shared-sources.txt lists the shared files. build.gradle copies exactly those into a generated source dir before compiling; the rest of the library still has different same-named counterparts in the RN tree. For npm, prepack copies the listed files into android/shared-sources and postpack removes them, as it already does for cpp/. Library sources are now inputs of the RN Android turbo tasks and CI jobs.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why?
The React Native Android module and
packages/enriched-markdown-androidkeep separate copies of the same Kotlin files, so every fix has to land twice. This is a pilot for sharing them: the 28 files that were byte-identical are deleted from the RN tree and compiled from the library instead. No behavior change.android/shared-sources.txtlists the shared files. Sharing another file is one line there plus deleting the RN copy.android/build.gradlecopies exactly the listed files into a generated source dir before compiling. Only listed files are taken, because the rest of the library still has different same-named counterparts in the RN tree.scripts/prepare-npm-publish.shcopies the listed files intoandroid/shared-sources/at prepack and removes them at postpack, as it already does forcpp/. The build resolves that folder first, then the monorepo path.Not covered yet: a build on the module's default toolchain (AGP 8.7, Kotlin 2.0.21) and a full
prepack/postpackrun.Testing
Nothing changes on screen, so there is no Playground document for this. Build and run both example apps and check that they look the same as on
main:apps/react-native-example:yarn androidapps/android-example:./gradlew installDebugThe Text screen of both apps was captured top to bottom on
mainand on this branch. 45 of 49 screenshots are byte-identical; the other four differ only around the animated spoiler particles.To check the published layout, run
scripts/prepare-npm-publish.sh prepack, build the RN example (it should compile fromandroid/shared-sources/), then runpostpack.PR Checklist