-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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: update Expo plugin to be compatible with objcpp #6223
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
This comment was marked as resolved.
This comment was marked as resolved.
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.
Looks good, thanks 😁 I missed that change in my PR.
@@ -19,7 +19,7 @@ export function modifyObjcAppDelegate(contents: string): string { | |||
contents = contents.replace( | |||
/#import "AppDelegate.h"/g, | |||
`#import "AppDelegate.h" | |||
@import Firebase;`, | |||
#import <Firebase/Firebase.h>`, |
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.
According to the RNFB docs, I don't know if it shouldn't be #import <Firebase.h>
🤔
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.
I believe we use to advice using @import Firebase
a long time ago, but we also switched, maybe that's the confusion?
Either way this reminded me of some previous issues, and in triage of those we made sure both ways work (or, worked - @import
won't work now I understand that:
#4069
Also, I made this change myself recently in my demo script - which hadn't been updated from @import
style yet, and I can say I know this is working as well with new style:
mikehardy/rnfbdemo@cfed4d8#diff-3e27ae623577d0c559bd8ab973a0c34af8cc65ef9beb9868a9cdb029854f8078R33
Which is all to say: I'm pretty comfortable this will be backwards compatible (excellent!) and also I know for RN68 you need it as well
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.
This looks great! And yes, I discovered it was needed as well, when I updated my demo script to the RN68 builds, but didn't think of the expo plugins here :-). Thanks for posting this, and sorry about the CLA-bot hassle - who knows what happened there
I'll push a patch release in a moment
@@ -19,7 +19,7 @@ export function modifyObjcAppDelegate(contents: string): string { | |||
contents = contents.replace( | |||
/#import "AppDelegate.h"/g, | |||
`#import "AppDelegate.h" | |||
@import Firebase;`, | |||
#import <Firebase/Firebase.h>`, |
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.
I believe we use to advice using @import Firebase
a long time ago, but we also switched, maybe that's the confusion?
Either way this reminded me of some previous issues, and in triage of those we made sure both ways work (or, worked - @import
won't work now I understand that:
#4069
Also, I made this change myself recently in my demo script - which hadn't been updated from @import
style yet, and I can say I know this is working as well with new style:
mikehardy/rnfbdemo@cfed4d8#diff-3e27ae623577d0c559bd8ab973a0c34af8cc65ef9beb9868a9cdb029854f8078R33
Which is all to say: I'm pretty comfortable this will be backwards compatible (excellent!) and also I know for RN68 you need it as well
Codecov Report
@@ Coverage Diff @@
## main #6223 +/- ##
=============================================
- Coverage 53.40% 25.80% -27.59%
=============================================
Files 208 97 -111
Lines 10302 4283 -6019
Branches 1633 1046 -587
=============================================
- Hits 5501 1105 -4396
+ Misses 4543 2579 -1964
- Partials 258 599 +341 |
I'm short-cutting some of the CI steps because I just ran through everything and did a release yesterday, plus I know which aspects could/would change based on these file edits. So I've merged it after seeing the affected jobs complete and likewise I know what's affected on main (nothing, vs this PR) so I just kicked off the publish workflow. Should have a patch version up on npmjs.com in a few minutes. Cheers! |
I was just about to open an issue, thank you for this! |
* Update setup-native-firebase.md After doing some research, I came across [this](invertase/react-native-firebase#6223) Pull Request, suggesting to instead import Firebase with `#import <Firebase/Firebase.h>` as opposed to `@import Firebase;` for SDK 45.
Description
Expo SDK 45, which is now in beta, has switched to using
objcpp
forAppDelegate
on iOS. The current import syntax, using@import
, is incompatible with this. Therefore, SDK 45 beta users using the config plugin are experiencing build issues. This change is backwards compatible withcpp
, Firebase switched to it 2 years ago (firebase/FirebaseUI-iOS#875 and the linked PR in that issue).Related issues
Fixes #6221
Release Summary
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter