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

Support ReactNative New architecture #1973

Merged
merged 9 commits into from Jul 20, 2023

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Jun 14, 2023

Goal

Support apps using ReactNative New Architecture.

Design

The Bugsnag native components have been adapted to be usable as both Native Modules or Turbo Modules, depending on the configuration of the app being built. A Turbo Module Spec was added to define the functions that can be triggered by the existing Bugsnag ReactNative JS code.

When loading the Bugsnag ReactNative NativeClient we check whether Turbo Modules are enabled and use the TurboModulesRegistry to access the native code if they are.

Android

For Android this involves splitting the Java code into 3 components:

  • The common code, which was extracted from the existing module (and resides in the main sourceset)
  • A Turbo Module facade - which implements the codegen class and forwards the method call to the common module
  • A Native Module facade - which includes the @ReactMethod annotations and delegates to the common module

iOS

The iOS TurboModule is enabled by using conditional compilation flags (#ifdef).

Testing

A new test fixture was added for ReactNative 0.71 with New Architecture enabled.

@yousif-bugsnag
Copy link
Contributor

yousif-bugsnag commented Jul 17, 2023

changes LGTM, but the CI pipeline needs updating as we've moved all the RN tests over to bitbar now

updated

@yousif-bugsnag yousif-bugsnag force-pushed the PLAT-8690/new-architecture-fixture branch from dfe6840 to 4579f9e Compare July 18, 2023 11:04
@github-actions
Copy link

github-actions bot commented Jul 18, 2023

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 43.65 kB 13.39 kB
After 43.65 kB 13.39 kB
± No change No change

code coverage diff

<temporarily disabled>

Generated by 🚫 dangerJS against a9c01e8

@yousif-bugsnag yousif-bugsnag force-pushed the PLAT-8690/new-architecture-fixture branch from 05b6fea to a9c01e8 Compare July 19, 2023 11:11
@yousif-bugsnag yousif-bugsnag marked this pull request as ready for review July 20, 2023 10:42
@yousif-bugsnag yousif-bugsnag self-requested a review July 20, 2023 10:43
@yousif-bugsnag yousif-bugsnag merged commit 695f3b3 into next Jul 20, 2023
141 checks passed
@yousif-bugsnag yousif-bugsnag deleted the PLAT-8690/new-architecture-fixture branch July 20, 2023 14:38
@yousif-bugsnag yousif-bugsnag mentioned this pull request Aug 15, 2023
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.

None yet

2 participants