Skip to content
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

fix(react-native-cli): ensure kotlin files are updated #2092

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

yousif-bugsnag
Copy link
Contributor

@yousif-bugsnag yousif-bugsnag commented Mar 5, 2024

Goal

Builds on #2091 to ensure that the React Native CLI updates native Android files correctly in React Native 0.73 projects.

The previous PR updated the file lookup to find MainApplication.kt files as well as MainApplication.java, but the subsequent update still fails as it was still looking for java code snippets.

In addition, the CLI was still suggesting BAGP version 7.+ for RN 0.73, but should be suggesting 8.+

Design

  • Added Kotlin code snippets and regexes for updating MainApplication.kt files
  • getSuggestedBugsnagGradleVersion now attempts to suggests a version based on the detected React Native version when the AGP version is not found in the Gradle file (recent versions of React Native do not explicitly set the AGP version in the root build.gradle file)

Testing

Added unit test cases and tested manually on fresh RN 0.71, 0.72 and 0.73 projects

Copy link

github-actions bot commented Mar 5, 2024

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 43.70 kB 13.40 kB
After 43.70 kB 13.40 kB
± No change No change

code coverage diff

<temporarily disabled>

Generated by 🚫 dangerJS against 8b92f0b

packages/react-native-cli/src/lib/Insert.ts Outdated Show resolved Hide resolved
@yousif-bugsnag yousif-bugsnag merged commit d2aab02 into next Mar 5, 2024
124 of 126 checks passed
@yousif-bugsnag yousif-bugsnag deleted the PLAT-11696/rn-cli-073-fix branch March 5, 2024 11:57
@yousif-bugsnag yousif-bugsnag mentioned this pull request Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants