Skip to content

fix: support linking of BaseReactPackage subclasses - #2563

Merged
thymikee merged 2 commits into
mainfrom
fix/BaseReactPackage-linking
Dec 12, 2024
Merged

fix: support linking of BaseReactPackage subclasses#2563
thymikee merged 2 commits into
mainfrom
fix/BaseReactPackage-linking

Conversation

@vonovak

@vonovakvonovak commented Dec 12, 2024

Copy link
Copy Markdown
Member

Summary:

TurboReactPackage is deprecated and the advice is to use BaseReactPackage. However, the cli does not recognize BaseReactPackage as something that should be autolinked, so following the advice actually breaks apps with:

com.facebook.react.common.JavascriptException: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNCDatePicker' could not be found. Verify that a module by this name is registered in the native binary. Bridgeless mode: false. TurboModule interop: false. Modules loaded: {"NativeModules":["HeadlessJsTaskSupport","PlatformConstants","SourceCode","DeviceInfo","UIManager","DeviceEventManager"],"TurboModules":[],"NotFound":["NativePerformanceObserverCxx","NativePerformanceCxx","NativeReactNativeFeatureFlagsCxx","RedBox","BugReporting","RNCDatePicker"]}, js engine: hermes

Would be nice to have this picked to older cli versions too.

Test Plan:

You can see test failures in react-native-datetimepicker/datetimepicker#950 prior to applying the patch and after patching, tests are green.

Checklist

  • Documentation is up to date to reflect these changes.
  • Follows commit message convention described in CONTRIBUTING.md

@thymikee

Copy link
Copy Markdown
Member

Thanks! I can port that to older versions once merged

…assName.test.ts
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
@thymikee
thymikee merged commit d3b1080 into mainDec 12, 2024
@thymikee
thymikee deleted the fix/BaseReactPackage-linking branch December 12, 2024 08:47
thymikee added a commit that referenced this pull request Dec 12, 2024
* fix: support linking of BaseReactPackage subclasses
* Update packages/cli-config-android/src/config/__tests__/findPackageClassName.test.ts
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
---------
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
thymikee added a commit that referenced this pull request Dec 12, 2024
* fix: support linking of BaseReactPackage subclasses
* Update packages/cli-config-android/src/config/__tests__/findPackageClassName.test.ts
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
---------
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
@thymikee

Copy link
Copy Markdown
Member

This is now released in:

  • 16.0.1 (RN 0.77)
  • 15.1.3 (RN 0.76)
  • 14.1.2 (RN 0.75)

@cortinico

Copy link
Copy Markdown
Member

Great stuff folks!

vonovak referenced this pull request in react/react-native Dec 16, 2024
Summary:
Pull Request resolved: #47680
This was deprecated in D50128456 so should be safe to remove now.
Changelog: [Android][Removed] Removed TurboReactPackage, which was replaced by BaseReactPackage
Reviewed By: mdvacca
Differential Revision: D66127067
fbshipit-source-id: a4090ab439cf99dc693622b8da2c0cffa247ad24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vonovak@thymikee@cortinico