When changing native props on Fabric, codegen generates corresponding interfaces and delegates. To make sure both implementations are consistent, we implement those interfaces on Paper too. Currently, after generating interfaces using codegen, developer needs to copy corresponding files for paper manually. This task adds Gradle task, that automates this.
Changes
Current assumption:
Two scripts: check-archs-consistency and sync-archs. The first one generates codegen interfaces and compares them with what we have for paper, the second generates and copies for paper to sync the archs.
sync is run when staged on changes to src/specs
check is run on CI when src/specs or android/paper/src/java/com/facebook/react/viewmanagers changes
Test code and steps to reproduce
Open src/specs/RNGestureHandlerButtonNativeComponent.ts and remove any proper form interface. Now:
when building paper, interface should be updated
when committing, interface should be updated
if committed and pushed, Test consistency between Paper & Fabric should fail :)
Brining back the prop and repeating up should cause the interface back and CI green.
Posting changes in other places should cause CI task to run.
You can also run those commands yourself using yarn check-archs-consistency and yarn sync-archs
Changes moved from: https://github.com/software-mansion/react-native-screens/pull/2224
Description
When changing native props on Fabric, codegen generates corresponding interfaces and delegates. To make sure both implementations are consistent, we implement those interfaces on Paper too. Currently, after generating interfaces using codegen, developer needs to copy corresponding files for paper manually. This task adds Gradle task, that automates this.
Changes
Current assumption: Two scripts:
check-archs-consistency
andsync-archs
. The first one generates codegen interfaces and compares them with what we have for paper, the second generates and copies for paper to sync the archs.src/specs
src/specs
orandroid/paper/src/java/com/facebook/react/viewmanagers
changesTest code and steps to reproduce
Open
src/specs/RNGestureHandlerButtonNativeComponent.ts
and remove any proper form interface. Now:You can also run those commands yourself using
yarn check-archs-consistency
andyarn sync-archs