-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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:
- Check if TurboModule Spec exists, if not return with error "Create Spec File" to user and end.
- Check the package.json file and update the codegen part if missing with spec file path.
- Delete node_modules folder first from root directory if already there
- Run yarn in the root directory
- Upgrade RNW and RN to latest versions available in npm and upgrade other dependencies too.
- Run yarn again
- 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. - Codegen Windows: npx react-native codegen-windows
- Add CPP and .H stub versions of all the methods in the spec file.
- 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.