Skip to content

Streamline RNW Community Modules Integration & Creation Process #15078

@anupriya13

Description

@anupriya13

Add some script or AI prompts to speed up integration and API creation of community module in Windows for New Architecture Fabric.

End goal is to automate steps from creation of spec file to C++ API definitions so that we only need to work on API implementation and not spend time debugging or fixing other cases.

The outcome should be to add windows code in any react native module - For example: https://github.com/react-native-webview/react-native-webview

There can be a 1 line command yarn react-native setup-module-windows that would do everything:

  1. Check if TurboModule Spec exists, if not return with error "Create Spec File" to user and end.
  2. Check the package.json file and update the codegen part if missing with spec file path.
  3. Delete node_modules folder first from root directory if already there
  4. Run yarn in the root directory
  5. Upgrade RNW and RN to latest versions available in npm and upgrade other dependencies too.
  6. Run yarn again
  7. Upgrade the windows library implementation -yarn react-native init-windows --template cpp-lib. Note: This command creates/updates the windows folder and all the relevant files to the latest implementation.
  8. Codegen Windows: npx react-native codegen-windows
  9. Add CPP and .H stub versions of all the methods in the spec file.
  10. Build the .sln and should work fine.

The 1 line command can be "yarn react-native setup-module-windows" which only works for new architecture cpp-lib for now and internally calls init-windows in step 7.

Some work is already done here: PR Please fix it with updated point 1 and below feedbacks:

  • rename to setup-module-windows
  • instead of removing multiply function keep it with a comment to take it as a reference only: Consider adding some kind of Hello, world as a replacement for the old multiply. It’s there for a newbie module author to know that things worked when they deploy a module. For instance, the first react app screen shows something meaningful when things work.

Sub-issues

Metadata

Metadata

Labels

Area: Native ModulesArea: Turbo ModulesExtensionsTracks issues against community modules and extensionsNew ArchitectureBroad category for issues that apply to the RN "new" architecture of Turbo Modules + FabricOld ArchitectureBroad category for issues that apply to the RN "old" architecture of Cxx Modules + PaperWorkstream: Module SupportModule developers have the requisite tooling and clear path for adding windows support to modules.enhancement

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions