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: support linking of BaseReactPackage subclasses #2563

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

vonovak
Copy link
Member

@vonovak vonovak commented Dec 12, 2024

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
Member

Thanks! I can port that to older versions once merged

@thymikee thymikee merged commit d3b1080 into main Dec 12, 2024
4 of 10 checks passed
@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 <[email protected]>

---------

Co-authored-by: Michał Pierzchała <[email protected]>
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 <[email protected]>

---------

Co-authored-by: Michał Pierzchała <[email protected]>
@thymikee
Copy link
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
Member

Great stuff folks!

vonovak referenced this pull request in facebook/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 free to 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