react-native-progress-view / progress-view

ProgressView Component for react-native iOS/macOS/Windows
MIT License
176 stars 49 forks source link

Fabric support #101

Closed nutstick closed 2 years ago

nutstick commented 2 years ago

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

Cpp changes

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

Android Changes

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

Affected platforms

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
zabojad commented 1 year ago

@nutstick Is there anything specific to do in order to compile successfully?

I can't get XCode to compile progress-view with new arch enabled, it seems it doesn't find the codegen files.

Screenshot 2023-08-22 at 16 24 28

(issue https://github.com/react-native-progress-view/progress-view/issues/131)

nutstick commented 1 year ago

Hi @zabojad there might be some change to support react-native 0.72 (I suspected it change the generated files slightly difference). It might requires an update for this library to support newer version.