callstack / react-native-builder-bob

👷‍♂️ Simple set of CLIs to scaffold and build React Native libraries for different targets
https://callstack.github.io/react-native-builder-bob/
2.78k stars 184 forks source link

feat: view+module native templates #562

Closed atlj closed 4 months ago

atlj commented 4 months ago

Summary

This adds new templates that use Kotlin and Objective-C. The templates each have a native view and a native module included.

Other Changes / Side Effects

  1. With 993d5cd2d624c9e6de15554d3c676b3dcf4f42e9, the new arch and mixed arch views will no longer have the View suffix in their codegen names. This doesn't break codegen as the name field is arbitrary as it isn't stated otherwise in the new arch working group documents. One important matter to remember here is to make sure we pass the RN prefix since headers can conflict.
  2. No more Java templates! I've removed them all for the sake of Kotlin.
  3. I've removed templates like view-new (new arch-only view template) since we now have view+module templates and it would be hard to maintain the old model.
  4. I kept module-legacy, module-mixed, and module-new since they are used by cpp.
  5. I kept module-legacy, and view-legacy since they are used by Swift.

Test plan

  1. Go to packages/create-react-native-library.
  2. Call yarn prepare to build the CLI.
  3. Run ./bin/create-react-native-library to run the CLI you built.
  4. Fill in the name, email, etc., and make sure to select Fabric view and Turbo module with backward compat.
  5. Go to the library you created and make sure to build the following: a. Android with old architecture b. iOS with old architecture c. Android with new architecture d. iOS with new architecture