progress-view icon indicating copy to clipboard operation
progress-view copied to clipboard

Fabric support

Open nutstick opened this issue 3 years ago • 0 comments

This pull request resolves https://github.com/react-native-progress-view/progress-view/issues/91

Description

Support for Fabric in iOS and Android.

JS changes

  • Add codegenConfig in package.json
  • Move requireNativeComponent to separate file and migrate to codegenNativeComponent
  • Split the type into 3 files RNCProgressViewNativeComponentAndroid (for Android), RNCProgressViewNativeComponent (for iOS, macOS), RNCProgressViewNativeComponentWindows (for Windows) since the types is slightly difference.

Cpp changes

  • Add new common/cpp
  • Only use by iOS

Why?

iOS supports setting an image as a background of progress. It's a bit tricky to add, but I follow the solution from https://github.com/reactwg/react-native-new-architecture/discussions/31#discussioncomment-3072215 which requires implementing image loading in c++ layer. Another solution is https://github.com/reactwg/react-native-new-architecture/discussions/31#discussioncomment-2717047 which looks cleaner and won't impact Android but it have to import RCTBridge+Private.h so I choose to implement c++ instead, can let me know which one you prefer.

iOS changes

  • Update podspec
  • iOS Implementation for fabric support
  • Support auto link

Android Changes

  • Update gradle files
  • Android Implementation for fabric support
  • Maintain backward compatibility using RNCProgressViewManagerImpl
  • Support auto link

Breaking change: It should support both old architecture and new architecture. But requires bumping minimum RN version and minimum iOS version

  • Fabric -> RN version >= 0.70
  • Old architecture -> RN version >= 0.65 and minimal iOS version to 11.0

Affected platforms

  • [x] Android
  • [x] iOS
  • [ ] Windows
  • [ ] MacOS

Test plan/screenshots/videos

I created fabric-example/ for testing out fabric using RN 0.70 (+ react-native-test-app).

Paper

iOS Android
Simulator Screen Shot - iPhone 13 - 2022-10-21 at 00 34 43 Screenshot_1666364415

Fabric

iOS Android
Simulator Screen Shot - iPhone 13 - 2022-10-22 at 22 15 26 Screenshot_1666454734

nutstick avatar Oct 20 '22 18:10 nutstick