-
Notifications
You must be signed in to change notification settings - Fork 11
fix: support use_frameworks! #11
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
fix: support use_frameworks! #11
Conversation
@@ -17,7 +17,7 @@ | |||
"react-native": "0.75.2", | |||
"react-native-codegen": "0.71.3", | |||
"react-native-safe-area-context": "^4.10.8", | |||
"react-native-screens": "^3.34.0" | |||
"react-native-screens": "4.3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh hey I got a bit further. In c8d230c, the build works with
Progress! |
a9c4c9f
to
c8d230c
Compare
Maybe related to #9. I'll try that patch later. |
Cherry-picked 8fb4717 into this branch. I'll check that everything works without frameworks, with dynamic frameworks, and without the new arch as well. |
Ok, I've got it working with The only thing that isn't working right now is
My intuition is that some difference in using dynamic libraries means that we're missing some linking for I'll keep investigating, but I'd be happy for additional insight in the meantime. Or perhaps it makes sense to merge this and #9 so that people can at least use static frameworks, and handle dynamic frameworks in a separate PR. |
Sweet, with 08b9798, I've got it working with:
The last change here was to update the macros in With static libraries, these macros get ignored at compile time. But with dynamic libraries, they still get evaluated, so we need to provide them a way to not try and access the old architecture properties there safely. @dominicstop - I think this is good to be reviewed now. Happy to make any adjustments as needed. |
hello, i apologize for the very late response and thank you very much for contributing to this library. i will merge and release a new version w/ your changes. not a lot ppl contribute to my libraries, so i am inexperienced with handling PR's; this is just a future reminder for myself not to press the "merge and rebase" button (again). |
Thanks @dominicstop! No problem at all. Love what you've done here and I appreciate your time. I'll keep an eye out for future releases. Let me know if there's any regressions, or if there's anything else I can help with - either in the code, or if you need a hand working with community contributions. |
hello, i added a workflow action to test out paper/fabric + static library/dynamic framework i updated the imports again, and it still seems to work ok. please let me know if there are any potential regressions |
Closes #10
Xcode will replace hyphens with underscores when building Frameworks. So if you install this project with:
All of the generated paths will be converted from
react-native-ios-utilities
toreact_native_ios_utilities
.This PR uses a preprocessor directive to check if the imported headers exist at the path with underscores. If they do, then we use the underscore imports. If not, we use the old ones.
Other options to consider
ReactNativeIosUtilities
to be more conventional.module_name
to set the name to something different, but there's no way to include hyphens in the module name for bridging, so there would still be this conditional logic.react-native-ios-utilities
andreact_native_ios_utilities
. That way you could just use relative paths to the headers. I strongly considered this option, but I don't love the idea of collision possibilities or ambiguity.So here, I just went through file-by-file and cleaned up the headers. This fixes one problem (headers for the project being incorrect), but leaves another issue (I'll write about that later on).
Here is an example of one of the errors I've observed on the example app in
master
, whenUSE_FRAMEWORKS
is eitherstatic
ordynamic
:With this PR, these errors go away (they're pervasive in all the header imports).
Remaining issues
Unfortunately, I'm still running into some issues in the React Native UIManager class, which is throwing this error:
I found a similar looking issue in Expo: expo/expo#31092, which they solved by adding React-rendererconsistency as a dependency.
However, that patch doesn't change anything, and I actually see that being installed through Pods already. I'm guessing there's some problem with the header/framework lookup paths, but I'm stumped at this point. @dominicstop - I would love your thoughts on that. Happy to continue doing the work if you have any insights into how to troubleshoot that.
Checking locally
cd example/ios
pod deintegrate && rm -rf Pods/ && rm -rf Podfile.lock && NO_FLIPPER="1" USE_FRAMEWORKS="static" RCT_NEW_ARCH_ENABLED="1" pod install --repo-update && open IosUtilitiesExample.xcworkspace
(just to be like, super sure about all of the dependencies being clean