Skip to content

Support React Native 0.79#2410

Merged
hamudi-ahmed merged 4 commits intonextfrom
PLAT-14057/react-native-079
Apr 14, 2025
Merged

Support React Native 0.79#2410
hamudi-ahmed merged 4 commits intonextfrom
PLAT-14057/react-native-079

Conversation

@hamudi-ahmed
Copy link
Copy Markdown
Contributor

@hamudi-ahmed hamudi-ahmed commented Apr 11, 2025

Goal

Add support for React Native 0.79

Changeset

  • Updated the React Native CLI to handle AppDelegate template changes in React Native 0.79 ios projects
  • Added 0.79 tests to CI

Testing

Covered by CI

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 11, 2025

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 46.96 kB 14.02 kB
After 46.96 kB 14.02 kB
± No change No change

code coverage diff

<temporarily disabled>

Generated by 🚫 dangerJS against 80815df

@hamudi-ahmed hamudi-ahmed force-pushed the PLAT-14057/react-native-079 branch from 48772b8 to 06fc1cc Compare April 14, 2025 08:45
@hamudi-ahmed hamudi-ahmed changed the title Add React Native 0.79 tests Support React Native 0.79 Apr 14, 2025
@hamudi-ahmed hamudi-ahmed marked this pull request as ready for review April 14, 2025 10:05
@hamudi-ahmed hamudi-ahmed requested a review from gingerbenw April 14, 2025 10:05
- "0.74"
- "0.76"
- "0.77"
- "0.78"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we drop 0.72 from the matrix yet? I can't remember what the decision was on the support matrix, but 0.76 is now unsupported by react native.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can drop 0.72 - our test matrix policy is the latest 3 versions, plus even versions back to 0.72

Comment on lines +141 to +144
"paths": [
"test/react-native-cli",
"packages/react-native-cli"
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@@ -0,0 +1,51 @@
import Bugsnag
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to confirm, this is the only change between these versions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also the Bugsnag.start call on line 18.

The reason we need new before/after fixture files is because the whole AppDelegate.swift template has changed in 0.79 with the introduction of RCTReactNativeFactory

@hamudi-ahmed hamudi-ahmed merged commit d8c34e0 into next Apr 14, 2025
36 checks passed
@hamudi-ahmed hamudi-ahmed deleted the PLAT-14057/react-native-079 branch April 14, 2025 14:29
@hamudi-ahmed hamudi-ahmed mentioned this pull request Apr 23, 2025
@irekrog
Copy link
Copy Markdown

irekrog commented Apr 28, 2025

Hi @yousif-bugsnag , I do not want to open a new issue, so I ask here.

  1. When will this version 8.3.2 appears on npm? Because is still not there https://www.npmjs.com/package/@bugsnag/react-native?activeTab=versions
  2. Does this version fix Android support? Because there is an error in 0.79.1
> Task :bugsnag_react-native:generateCodegenSchemaFromJavaScript FAILED
node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module '.../node_modules/@react-native/codegen/lib/cli/combine/combine-js-to-schema-cli.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.18.0

[Incubating] Problems report is available at: .../android/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bugsnag_react-native:generateCodegenSchemaFromJavaScript'.

@hamudi-ahmed
Copy link
Copy Markdown
Contributor Author

Hi @irekrog,

bugsnag-js is a monorepo, and so not all packages are published on each new release (unless it's a new major version). Unfortunately this can make looking at the GitHub releases a little confusing.

There is no v8.3.2 of @bugsnag/react-native - this release was only for the CLI tool (@bugsnag/react-native-cli). So the latest version is still v8.3.1.

This PR did add tests for React Native 0.79 though, and we haven't seen any build issues on Android. It looks like the gradle task isn't able to resolve the codegen script for some reason. Do you see the same error if you invoke the codegen task manually before building?

./gradlew generateCodegenArtifactsFromSchema

If you're still having problems please feel free to write in to support@bugsnag.com with some more details, and ideally some steps to reproduce, and we can try to investigate further.

Thanks!

@irekrog
Copy link
Copy Markdown

irekrog commented Apr 29, 2025

Ok, got it. Yes, after calling ./gradlew generateCodegenArtifactsFromSchema there is the same error I posted above. I will try to do the investment on my side, if there is still an error I will write to support.

Thanks!

@irekrog
Copy link
Copy Markdown

irekrog commented Apr 29, 2025

Ok, when I manually added the package:
"@react-native/codegen: "0.79.1"

then it works fine, I think there is a problem with monorepo/pnpm (which I use)

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.

3 participants