Skip to content
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

[RN73] Support for iOS #7836

Closed
Tracked by #7834
d4vidi opened this issue Jan 28, 2024 · 35 comments
Closed
Tracked by #7834

[RN73] Support for iOS #7836

d4vidi opened this issue Jan 28, 2024 · 35 comments

Comments

@d4vidi
Copy link
Collaborator

d4vidi commented Jan 28, 2024

No description provided.

@d4vidi d4vidi changed the title [RN73] Upgrade for iOS [RN73] Support for iOS Jan 28, 2024
@SudoPlz
Copy link
Collaborator

SudoPlz commented Feb 9, 2024

hey @d4vidi can I help with that?
I could open a PR if you're willing to review, because I'm currently blocked on this.

@gosha212
Copy link
Contributor

gosha212 commented Feb 9, 2024

Hi @SudoPlz,
I'm currently working on this task. It will be ready soon. This task is hard to estimate because it is a research task.

@SudoPlz
Copy link
Collaborator

SudoPlz commented Feb 9, 2024

@gosha212

allright.

By the way I did figure out some of the changes that are required:

diff --git a/node_modules/react-native-navigation/lib/ios/RNNReactView.h b/node_modules/react-native-navigation/lib/ios/RNNReactView.h
index 62850dc..9c83269 100644
--- a/node_modules/react-native-navigation/lib/ios/RNNReactView.h
+++ b/node_modules/react-native-navigation/lib/ios/RNNReactView.h
@@ -1,5 +1,6 @@
 #ifdef RCT_NEW_ARCH_ENABLED
-#import <React/RCTFabricSurfaceHostingProxyRootView.h>
+#import <React/RCTSurfaceHostingProxyRootView.h>
+#import <React/RCTFabricSurface.h>
 #else
 #import <React/RCTRootView.h>
 #endif
@@ -32,7 +33,7 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);
 
 #ifdef RCT_NEW_ARCH_ENABLED
 @interface RNNReactView
-    : RCTFabricSurfaceHostingProxyRootView <RCTRootViewDelegate, RNNComponentProtocol>
+    : RCTSurfaceHostingProxyRootView <RCTRootViewDelegate, RNNComponentProtocol>
 #else
 @interface RNNReactView : RCTRootView <RCTRootViewDelegate, RNNComponentProtocol>
 #endif
diff --git a/node_modules/react-native-navigation/lib/ios/RNNReactView.m b/node_modules/react-native-navigation/lib/ios/RNNReactView.m
index fec6fc6..4c86f23 100644
--- a/node_modules/react-native-navigation/lib/ios/RNNReactView.m
+++ b/node_modules/react-native-navigation/lib/ios/RNNReactView.m
@@ -1,6 +1,5 @@
 #import "RNNReactView.h"
 #import <React/RCTRootContentView.h>
-
 @implementation RNNReactView {
     BOOL _isAppeared;
 }
@@ -11,10 +10,12 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
                   eventEmitter:(RNNEventEmitter *)eventEmitter
                sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
            reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
-    self = [super initWithBridge:bridge
-                      moduleName:moduleName
-               initialProperties:initialProperties
-                 sizeMeasureMode:sizeMeasureMode];
+
+    id<RCTSurfaceProtocol> surface = [[RCTFabricSurface alloc] initWithBridge:bridge
+                                                                       moduleName:moduleName
+                                                            initialProperties:initialProperties];
+    self = [super initWithSurface:surface
+                  sizeMeasureMode:sizeMeasureMode];
 #else
 - (instancetype)initWithBridge:(RCTBridge *)bridge
                     moduleName:(NSString *)moduleName

but now I'm stuck on 'iosfwd' file not found and 'memory' file not found errors.
If you find a way to get this library to build, I'll convert your changes to a patchfile so that me and others can use it sooner (before the PR actually lands).

@gosha212
Copy link
Contributor

gosha212 commented Feb 9, 2024

@SudoPlz I did the Andorid part and currently working on the typescript. Hope to get to it very soon. I will share a link to a draft PR in the beginning of the next week.

@oblador
Copy link
Contributor

oblador commented Feb 10, 2024

@SudoPlz you can get past that by replacing the fabric if statement in the podspec with:

  if fabric_enabled
    install_modules_dependencies(s)
    s.requires_arc    = true
  end

@gosha212
Copy link
Contributor

@SudoPlz #7844 here is the PR

@oblador
Copy link
Contributor

oblador commented Feb 11, 2024

@gosha212 Awesome – thank you, however it only fixes Android? iOS Fabric is still broken for me.

@gosha212
Copy link
Contributor

@oblador I didn't test it with Fabric yet. The tests are working on both platforms

@oblador
Copy link
Contributor

oblador commented Feb 11, 2024

Ah, ok. @SudoPlz's comment is about Fabric on iOS hence the confusion.

@gosha212
Copy link
Contributor

@oblador The code works with Fabric on Android. IOS still WIP

@gosha212
Copy link
Contributor

@oblador the latest commit should work with Fabric. The fix is not merged yet.

@oblador
Copy link
Contributor

oblador commented Feb 18, 2024

@gosha212 Thanks! I tried it out and it does not work with fabric and RN 0.73.4 for me. In the pod spec you are overwriting all the config set by react native. I got everything working with this more minimal setup:

  if fabric_enabled
    s.pod_target_xcconfig = {
      'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Private/React-Core"',
    }
    s.requires_arc = true
    install_modules_dependencies(s)
  end

@asafkorem
Copy link
Collaborator

asafkorem commented Feb 18, 2024

@gosha212 Thanks! I tried it out and it does not work with fabric and RN 0.73.4 for me. In the pod spec you are overwriting all the config set by react native. I got everything working with this more minimal setup:

  if fabric_enabled
    s.pod_target_xcconfig = {
      'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Private/React-Core"',
    }
    s.requires_arc = true
    install_modules_dependencies(s)
  end

Hey @oblador, in the podspec we just add React's headers to the search paths and declare some dependencies. What error are you getting? can you please copy it here?

@asafkorem
Copy link
Collaborator

@SudoPlz @oblador please try the latest released version (7.38.0)

@oblador
Copy link
Contributor

oblador commented Feb 19, 2024

@asafkorem That version fails for me during install with:

node_modules/react-native-navigation: Command failed.
Exit code: 1
Command: node scripts/postinstall.js

The issue is overwriting search paths and c++ flags causing my build to fail for failing to import memory et al. install_modules_dependencies will append, therefore it should be placed after not before your own configs

@oblador
Copy link
Contributor

oblador commented Feb 19, 2024

@asafkorem have a fix for the postinstall bug here: #7849

@asafkorem
Copy link
Collaborator

Thanks @oblador, checking 🙏🏼

@SudoPlz
Copy link
Collaborator

SudoPlz commented Feb 19, 2024

Waiting for the merged code to be released. 0.38 fails on my end too because of the post install script.

@asafkorem
Copy link
Collaborator

@oblador @SudoPlz please try 7.38.1

@SudoPlz
Copy link
Collaborator

SudoPlz commented Feb 19, 2024

I did, everything builds fine. The only problem is, I get a blank screen and no react components show up at all when fabric is enabled.

@oblador
Copy link
Contributor

oblador commented Feb 19, 2024

Yup same for me, it installs and builds now, but I'm seeing an empty screen.

@SudoPlz
Copy link
Collaborator

SudoPlz commented Feb 19, 2024

so glad it's not just me.

@asafkorem
Copy link
Collaborator

@oblador @SudoPlz
We'll look into this. Does the issue occur on iOS, Android, or both? Also, does this issue persist in the most recent version when Fabric is disabled as well, or only when Fabric is enabled?

@SudoPlz
Copy link
Collaborator

SudoPlz commented Feb 19, 2024

@oblador @SudoPlz We'll look into this. Does the issue occur on iOS, Android, or both? Also, does this issue persist in the most recent version when Fabric is disabled as well, or only when Fabric is enabled?

I've only tested iOS so far.

It only happens when fabric is enabled. (when it's disabled everything works fine)

@asafkorem
Copy link
Collaborator

OK, thanks for reporting. I'll test that with a clean RN+RNN app.
Also, can you please list the other public dependencies you're using in your app? I wonder if there might be another suspect. Our playground app plays well with the latest version 🤔

@asafkorem
Copy link
Collaborator

asafkorem commented Feb 20, 2024

FYI @gosha212 @d4vidi @SudoPlz @oblador

I'm able to reproduce this issue on iOS with a new RN 0.73.4 + Fabric + RNN 7.38.1 app
When disabling fabric - app works fine.
image

For some reason it doesn't reproduce on our playground app.

I'll continue the investigation later today. Will update.

@SudoPlz
Copy link
Collaborator

SudoPlz commented Feb 21, 2024

@asafkorem super happy you were able to repro this one.
Did you track the root cause of the issue by any chance?

@asafkorem
Copy link
Collaborator

asafkorem commented Feb 28, 2024

Hi @SudoPlz, I made a brief investigation to identify the underlying issue but haven't uncovered anything so far :(
At the moment, we aren't focused on this, but we plan to revisit it shortly. It is prioritized

@SudoPlz
Copy link
Collaborator

SudoPlz commented Mar 12, 2024

Hey @asafkorem, no pressure or anything, but I'm curious, what's the blocker?

@SudoPlz
Copy link
Collaborator

SudoPlz commented Mar 15, 2024

@asafkorem or is there any way I can help contribute to help move along the migration?
It's important for me to start working towards fabric, and I'm not confident I understand what's blocking it at the moment, so if there's anything I can do to help I'd be happy to.

@asafkorem
Copy link
Collaborator

Hey @SudoPlz, this issue requires investigation and we're not working on it at the moment. We plan to get there soon but for the meanwhile feel free to clone the reproduction repo https://github.com/asafkorem/react-native-navigation-demo and investigate why we get this white screen when Fabric is enabled.
Thanks for the willingness to help!

Also, if we'll have any update from our end we'll post it here.

@SudoPlz
Copy link
Collaborator

SudoPlz commented Apr 8, 2024

Hey @d4vidi why was this closed since it's still bugging?
Is there another issue responsible for fixing React Native fabric?

@d4vidi
Copy link
Collaborator Author

d4vidi commented Apr 8, 2024

Hey @d4vidi why was this closed since it's still bugging? Is there another issue responsible for fixing React Native fabric?

Hey @SudoPlz, yes - we will deal with fabric under a different context, in due time. Contribution (upgrading and surfacing the issues) would definitely help speed things up 🙏🏻

@gosha212
Copy link
Contributor

gosha212 commented Apr 9, 2024

@SudoPlz here is a ticket for tracking: #7836
As @d4vidi mentioned. We will be happy to get some contribution here =)

@TheLonelyAstronaut
Copy link
Contributor

TheLonelyAstronaut commented Apr 16, 2024

@d4vidi @gosha212 added fix in issue #7865

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants