-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supported autolinking on the new architecture #642
Commits on Aug 27, 2022
-
Renamed codegen library to navigationreactnative
Autolinking on Android doesn't like hyphens in library name
Configuration menu - View commit details
-
Copy full SHA for 9595635 - Browse repository at this point
Copy the full SHA 9595635View commit details -
Renamed folder to codegen lib name and run on ios
And renamed import to match as well, though don't know why needed the folder name before. Plan to drop the subfolders from cpp folder
Configuration menu - View commit details
-
Copy full SHA for a744d44 - Browse repository at this point
Copy the full SHA a744d44View commit details -
Moved c++ state into root cpp folder
There's no need for the subfolders now that React Native autolinks on android. The subfolders were to make the handwritten setup on android more consistent
Configuration menu - View commit details
-
Copy full SHA for ca6288f - Browse repository at this point
Copy the full SHA ca6288fView commit details
Commits on Sep 14, 2022
-
Revert "Moved c++ state into root cpp folder"
This reverts commit ca6288f.
Configuration menu - View commit details
-
Copy full SHA for 8227a35 - Browse repository at this point
Copy the full SHA 8227a35View commit details -
Added react-native.config.js for android build
Copying code from react native's autolinking example troZee/react-native-cpp-autolinking@5e1b0f2
Configuration menu - View commit details
-
Copy full SHA for e597051 - Browse repository at this point
Copy the full SHA e597051View commit details -
Added custom android make file
Copied it from the codegen'ed one and pointed LOCAL_SRC_FILES at both the codegen and the hand-written c++ state files in cpp folder. Just a first go, not tried it yet
Configuration menu - View commit details
-
Copy full SHA for dfc5c56 - Browse repository at this point
Copy the full SHA dfc5c56View commit details -
Added CMakeLists because run-android asked for one
Don't know why it's needed as well as Android.mk?! Copied the codegen'ed one and added codegen files and c++ state cpp files
Configuration menu - View commit details
-
Copy full SHA for 9348013 - Browse repository at this point
Copy the full SHA 9348013View commit details -
Copied all codegen-ed into hand-written cpp folder
Couldn't get it to work using codegen and cpp folder - so followed advice from reactwg/react-native-new-architecture#71 (comment) that said needed own c++ implementation for everything. Gets further but falling over at the NativeMaterial3ModuleSpec - it's not generated now. Wondering if this approach works with ModuleSpecs as well?!
Configuration menu - View commit details
-
Copy full SHA for 6258613 - Browse repository at this point
Copy the full SHA 6258613View commit details
Commits on Sep 17, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 374b537 - Browse repository at this point
Copy the full SHA 374b537View commit details -
This file was codegen'ed but clearer to drop the 'generated' from the name
Configuration menu - View commit details
-
Copy full SHA for 3999f25 - Browse repository at this point
Copy the full SHA 3999f25View commit details -
Copying from react native autolinking repo and they only have the CMakeLists.txt troZee/react-native-cpp-autolinking@5e1b0f2
Configuration menu - View commit details
-
Copy full SHA for 4d15c46 - Browse repository at this point
Copy the full SHA 4d15c46View commit details -
Need to put together example repo with android build failing so react native can investigate
Configuration menu - View commit details
-
Copy full SHA for 41573b0 - Browse repository at this point
Copy the full SHA 41573b0View commit details -
Got a successful build on android
Had to go through all the files on the example repo 1 by 1 to see what was wrong, JSI_EXPORT. There were 3 key errors 1. Added JSI_EXPORT to hand-written cpp interfaces 2. Include "Props.h" instead of <react/renderer/components/navigationreactnative/Props.h> 3. Removed libraries from codegenConfig in package.json These each took me ages to spot
Configuration menu - View commit details
-
Copy full SHA for 6f67a69 - Browse repository at this point
Copy the full SHA 6f67a69View commit details -
Removed library name now reading from package.json
Also went back to androidMkPath because cmakeListsPath is a later change. Copies the config from React Native's autlink example
Configuration menu - View commit details
-
Copy full SHA for 2cb889e - Browse repository at this point
Copy the full SHA 2cb889eView commit details -
Configuration menu - View commit details
-
Copy full SHA for b66a5df - Browse repository at this point
Copy the full SHA b66a5dfView commit details
Commits on Sep 18, 2022
-
Pointed at codegen because didn't work in ios
Copying over the codegen didn't work for ios. Ended up with redefinition of EventEmitters errors reactwg/react-native-new-architecture#71 (reply in thread). There's no custom build on ios so it includes the copied over codegen as well as the actual codegen so it gets included twice. Can't just exclude it on ios because the includes on shadownodes point to local "EventEmitters.h'. So went with the react native screens approach of pointing at the codegen instead of copying it over reactwg/react-native-new-architecture#71 (comment). It works on android and should work on ios (haven't tested yet) because it's just the hand-written files now
Configuration menu - View commit details
-
Copy full SHA for af514f7 - Browse repository at this point
Copy the full SHA af514f7View commit details -
Copied this over from react native screens example but isn't necessary
Configuration menu - View commit details
-
Copy full SHA for a8261fe - Browse repository at this point
Copy the full SHA a8261feView commit details -
Pointed at generated modules instead of copying
This matches approach for generated components
Configuration menu - View commit details
-
Copy full SHA for 777d180 - Browse repository at this point
Copy the full SHA 777d180View commit details -
The current directory has no relevant cpp files - they're now all in react/renderer/components/navigationreactnative
Configuration menu - View commit details
-
Copy full SHA for 20addab - Browse repository at this point
Copy the full SHA 20addabView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1838236 - Browse repository at this point
Copy the full SHA 1838236View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2adf3eb - Browse repository at this point
Copy the full SHA 2adf3ebView commit details -
Got it working on android and ios!!
Still copying code from react native screens example reactwg/react-native-new-architecture#71 (comment) Couldn't work out how to get the ComponentDescriptor in the generated rncli.cpp because it only includes ComponentDescriptors.h. Noticed it also includes navigationreactnative.h - so the trick is to include the hand-written descriptors in that file!! React native screens did this just didn't notice or realise what it was for. It's very sneaky! This allows it to work on android and ios!! And with lower maintenance because not copying over hand-generated - apart from navigationreactnative.h and .cpp. Had to exclude these files from the podspec otherwise doesn't build on ios
Configuration menu - View commit details
-
Copy full SHA for 159a56e - Browse repository at this point
Copy the full SHA 159a56eView commit details