react-native-navigation 7.36.0-rc.1 → 7.36.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,6 @@ require 'json'
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
4
 
5
- fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
6
-
7
5
  Pod::Spec.new do |s|
8
6
  s.name = "ReactNativeNavigation"
9
7
  s.version = package['version']
@@ -19,34 +17,19 @@ Pod::Spec.new do |s|
19
17
 
20
18
  s.subspec 'Core' do |ss|
21
19
  s.source = { :git => "https://github.com/wix/react-native-navigation.git", :tag => "#{s.version}" }
22
- s.source_files = 'lib/ios/**/*.{h,m,mm,cpp}'
20
+ s.source_files = "lib/ios/**/*.{h,m,mm}"
23
21
  s.exclude_files = "lib/ios/ReactNativeNavigationTests/**/*.*", "lib/ios/OCMock/**/*.*"
24
22
  end
23
+
24
+ # s.subspec 'Fabric' do |ss|
25
+ # ss.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/RCT-Folly\"",
26
+ # "OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1" }
27
+ # ss.dependency 'React-RCTFabric'
28
+ # ss.dependency 'React-Fabric'
29
+ # ss.dependency 'RCT-Folly/Fabric'
30
+ # end
25
31
 
26
- if fabric_enabled
27
- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
28
- fabric_flags = fabric_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
29
- s.pod_target_xcconfig = {
30
- 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/Headers/Private/React-Core"',
31
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
32
- }
33
- s.compiler_flags = folly_compiler_flags + ' ' + '-DRCT_NEW_ARCH_ENABLED'
34
- s.requires_arc = true
35
-
36
- s.dependency "React"
37
- s.dependency "React-RCTFabric"
38
- s.dependency "React-cxxreact"
39
- s.dependency "React-Fabric"
40
- s.dependency "React-Codegen"
41
- s.dependency "RCT-Folly"
42
- s.dependency "RCTRequired"
43
- s.dependency "RCTTypeSafety"
44
- s.dependency "ReactCommon/turbomodule/core"
45
- s.dependency "React-runtimeexecutor"
46
- s.dependency "React-rncore"
47
- end
48
32
  s.dependency 'React-Core'
49
- s.dependency 'React-CoreModules'
50
33
  s.dependency 'React-RCTImage'
51
34
  s.dependency 'React-RCTText'
52
35
  s.dependency 'HMSegmentedControl'
@@ -8,7 +8,6 @@ import android.view.MotionEvent;
8
8
  import com.facebook.react.ReactInstanceManager;
9
9
  import com.facebook.react.ReactRootView;
10
10
  import com.facebook.react.bridge.ReactContext;
11
- import com.facebook.react.config.ReactFeatureFlags;
12
11
  import com.facebook.react.uimanager.JSTouchDispatcher;
13
12
  import com.facebook.react.uimanager.UIManagerModule;
14
13
  import com.facebook.react.uimanager.events.EventDispatcher;
@@ -35,7 +34,6 @@ public class ReactView extends ReactRootView implements IReactView, Renderable {
35
34
  this.componentId = componentId;
36
35
  this.componentName = componentName;
37
36
  jsTouchDispatcher = new JSTouchDispatcher(this);
38
- setIsFabric(ReactFeatureFlags.enableFabricRenderer);
39
37
  }
40
38
 
41
39
  @Override
@@ -14,9 +14,14 @@ fun MotionEvent.coordinatesInsideView(view: View?): Boolean {
14
14
  view.getHitRect(hitRect)
15
15
  return hitRect.contains(x.toInt(), y.toInt())
16
16
  } else {
17
- val viewGroup = (view as? ViewGroup)?.getChildAt(0) as? ViewGroup ?: view
17
+ val viewGroup = (view as? ViewGroup)?.getChildAt(0) as? ViewGroup ?: return false
18
18
 
19
- viewGroup?.getHitRect(hitRect)
20
- return hitRect.contains(x.toInt(), y.toInt())
19
+ return if (viewGroup.childCount > 0) {
20
+ val content = viewGroup.getChildAt(0)
21
+ content.getHitRect(hitRect)
22
+ hitRect.contains(x.toInt(), y.toInt())
23
+ } else {
24
+ false
25
+ }
21
26
  }
22
27
  }
@@ -6,14 +6,13 @@ import com.facebook.react.ReactInstanceManagerBuilder;
6
6
  import com.facebook.react.ReactNativeHost;
7
7
  import com.facebook.react.ReactPackage;
8
8
  import com.facebook.react.common.LifecycleState;
9
- import com.facebook.react.defaults.DefaultReactNativeHost;
10
9
  import com.facebook.react.devsupport.interfaces.DevBundleDownloadListener;
11
10
  import com.reactnativenavigation.NavigationApplication;
12
11
 
13
12
  import androidx.annotation.NonNull;
14
13
  import androidx.annotation.Nullable;
15
14
 
16
- public abstract class NavigationReactNativeHost extends DefaultReactNativeHost implements BundleDownloadListenerProvider {
15
+ public abstract class NavigationReactNativeHost extends ReactNativeHost implements BundleDownloadListenerProvider {
17
16
 
18
17
  private @Nullable NavigationDevBundleDownloadListener bundleListener;
19
18
  private final DevBundleDownloadListener bundleListenerMediator = new DevBundleDownloadListenerAdapter() {
@@ -34,6 +33,30 @@ public abstract class NavigationReactNativeHost extends DefaultReactNativeHost i
34
33
  bundleListener = listener;
35
34
  }
36
35
 
36
+ protected ReactInstanceManager createReactInstanceManager() {
37
+ ReactInstanceManagerBuilder builder = ReactInstanceManager.builder()
38
+ .setApplication(getApplication())
39
+ .setJSMainModulePath(getJSMainModuleName())
40
+ .setUseDeveloperSupport(getUseDeveloperSupport())
41
+ .setRedBoxHandler(getRedBoxHandler())
42
+ .setJavaScriptExecutorFactory(getJavaScriptExecutorFactory())
43
+ .setInitialLifecycleState(LifecycleState.BEFORE_CREATE)
44
+ .setJSIModulesPackage(getJSIModulePackage())
45
+ .setDevBundleDownloadListener(getDevBundleDownloadListener());
46
+
47
+ for (ReactPackage reactPackage : getPackages()) {
48
+ builder.addPackage(reactPackage);
49
+ }
50
+
51
+ String jsBundleFile = getJSBundleFile();
52
+ if (jsBundleFile != null) {
53
+ builder.setJSBundleFile(jsBundleFile);
54
+ } else {
55
+ builder.setBundleAssetName(Assertions.assertNotNull(getBundleAssetName()));
56
+ }
57
+ return builder.build();
58
+ }
59
+
37
60
  @SuppressWarnings("WeakerAccess")
38
61
  @NonNull
39
62
  protected DevBundleDownloadListener getDevBundleDownloadListener() {
@@ -5,6 +5,8 @@ const react_native_1 = require("react-native");
5
5
  class NativeEventsReceiver {
6
6
  emitter;
7
7
  constructor() {
8
+ // NOTE: This try catch is workaround for integration tests
9
+ // TODO: mock NativeEventEmitter in integration tests rather done adding try catch in source code
8
10
  try {
9
11
  this.emitter = new react_native_1.NativeEventEmitter(react_native_1.NativeModules.RNNEventEmitter);
10
12
  }
@@ -2,11 +2,19 @@
2
2
 
3
3
  @implementation RNNComponentRootView
4
4
 
5
- - (instancetype)init {
6
- self = [super init];
7
- self.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;
5
+ - (instancetype)initWithBridge:(RCTBridge *)bridge
6
+ moduleName:(NSString *)moduleName
7
+ initialProperties:(NSDictionary *)initialProperties
8
+ eventEmitter:(RNNEventEmitter *)eventEmitter
9
+ reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
10
+ self = [super initWithBridge:bridge
11
+ moduleName:moduleName
12
+ initialProperties:initialProperties
13
+ eventEmitter:eventEmitter
14
+ reactViewReadyBlock:reactViewReadyBlock];
8
15
  return self;
9
16
  }
17
+
10
18
  - (NSString *)componentType {
11
19
  return ComponentTypeScreen;
12
20
  }
@@ -94,8 +94,7 @@
94
94
  }];
95
95
  }];
96
96
  self.reactView.backgroundColor = UIColor.clearColor;
97
- self.reactView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
98
- [self.reactView setFrame:self.view.frame];
97
+ self.reactView.translatesAutoresizingMaskIntoConstraints = NO;
99
98
  [self.view addSubview:self.reactView];
100
99
  [self updateReactViewConstraints];
101
100
  } else {
@@ -115,15 +114,24 @@
115
114
  - (void)viewDidLayoutSubviews {
116
115
  [super viewDidLayoutSubviews];
117
116
  [self.presenter applyOptionsOnViewDidLayoutSubviews:self.resolveOptions];
118
- [self updateReactViewConstraints];
119
117
  }
120
118
 
121
119
  - (void)updateReactViewConstraints {
122
120
  if (self.isViewLoaded && self.reactView) {
123
- CGFloat bottomInset = self.shouldDrawBehindBottomTabs ? 0 : self.view.safeAreaInsets.bottom;
124
- CGFloat topInset = self.shouldDrawBehindTopBar ? 0 : self.view.safeAreaInsets.top;
125
- [self.reactView setFrame:CGRectMake(0, topInset, self.view.frame.size.width,
126
- self.view.frame.size.height - topInset - bottomInset)];
121
+ [NSLayoutConstraint deactivateConstraints:_reactViewConstraints];
122
+ _reactViewConstraints = @[
123
+ [self.reactView.topAnchor
124
+ constraintEqualToAnchor:self.shouldDrawBehindTopBar
125
+ ? self.view.topAnchor
126
+ : self.view.safeAreaLayoutGuide.topAnchor],
127
+ [self.reactView.bottomAnchor
128
+ constraintEqualToAnchor:self.shouldDrawBehindBottomTabs
129
+ ? self.view.bottomAnchor
130
+ : self.view.safeAreaLayoutGuide.bottomAnchor],
131
+ [self.reactView.leftAnchor constraintEqualToAnchor:self.view.leftAnchor],
132
+ [self.reactView.rightAnchor constraintEqualToAnchor:self.view.rightAnchor]
133
+ ];
134
+ [NSLayoutConstraint activateConstraints:_reactViewConstraints];
127
135
  }
128
136
  }
129
137
 
@@ -9,8 +9,7 @@
9
9
 
10
10
  if ([hitTestResult isKindOfClass:[UIWindow class]] ||
11
11
  [hitTestResult.subviews.firstObject isKindOfClass:RNNReactView.class] ||
12
- [hitTestResult isKindOfClass:[RCTModalHostView class]] ||
13
- [hitTestResult isKindOfClass:NSClassFromString(@"RCTRootComponentView")]) {
12
+ [hitTestResult isKindOfClass:[RCTModalHostView class]]) {
14
13
  return nil;
15
14
  }
16
15
 
@@ -1,38 +1,6 @@
1
1
  #import "RNNReactButtonView.h"
2
2
 
3
3
  @implementation RNNReactButtonView
4
- #ifdef RCT_NEW_ARCH_ENABLED
5
- - (instancetype)initWithBridge:(RCTBridge *)bridge
6
- moduleName:(NSString *)moduleName
7
- initialProperties:(NSDictionary *)initialProperties
8
- eventEmitter:(RNNEventEmitter *)eventEmitter
9
- sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
10
- reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
11
- self = [super initWithBridge:bridge
12
- moduleName:moduleName
13
- initialProperties:initialProperties
14
- eventEmitter:eventEmitter
15
- sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthUndefined |
16
- RCTSurfaceSizeMeasureModeHeightUndefined
17
- reactViewReadyBlock:reactViewReadyBlock];
18
-
19
- return self;
20
- }
21
- #else
22
- - (instancetype)initWithBridge:(RCTBridge *)bridge
23
- moduleName:(NSString *)moduleName
24
- initialProperties:(NSDictionary *)initialProperties
25
- eventEmitter:(RNNEventEmitter *)eventEmitter
26
- reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
27
- self = [super initWithBridge:bridge
28
- moduleName:moduleName
29
- initialProperties:initialProperties
30
- eventEmitter:eventEmitter
31
- reactViewReadyBlock:reactViewReadyBlock];
32
-
33
- return self;
34
- }
35
- #endif
36
4
 
37
5
  - (NSString *)componentType {
38
6
  return ComponentTypeButton;
@@ -53,7 +53,7 @@
53
53
 
54
54
  - (NSMapTable *)componentsForParentId:(NSString *)parentComponentId {
55
55
  if (![_componentStore objectForKey:parentComponentId]) {
56
- [_componentStore setObject:[NSMapTable strongToWeakObjectsMapTable]
56
+ [_componentStore setObject:[NSMapTable weakToStrongObjectsMapTable]
57
57
  forKey:parentComponentId];
58
58
  ;
59
59
  }
@@ -64,6 +64,7 @@
64
64
 
65
65
  - (void)clearComponentsForParentId:(NSString *)parentComponentId {
66
66
  [_componentStore removeObjectForKey:parentComponentId];
67
+ ;
67
68
  }
68
69
 
69
70
  - (void)removeComponent:(NSString *)componentId {
@@ -21,23 +21,12 @@
21
21
  ofType:(RNNComponentType)componentType
22
22
  reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
23
23
  [self verifyRootViewId:rootViewId];
24
- #ifdef RCT_NEW_ARCH_ENABLED
25
24
  return [[[self resolveComponentViewClass:componentType] alloc]
26
25
  initWithBridge:_bridge
27
26
  moduleName:name
28
27
  initialProperties:@{@"componentId" : rootViewId}
29
28
  eventEmitter:_eventEmitter
30
- sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact |
31
- RCTSurfaceSizeMeasureModeHeightExact
32
29
  reactViewReadyBlock:reactViewReadyBlock];
33
- #else
34
- return [[[self resolveComponentViewClass:componentType] alloc]
35
- initWithBridge:_bridge
36
- moduleName:name
37
- initialProperties:@{@"componentId" : rootViewId}
38
- eventEmitter:_eventEmitter
39
- reactViewReadyBlock:reactViewReadyBlock];
40
- #endif
41
30
  }
42
31
 
43
32
  - (Class)resolveComponentViewClass:(RNNComponentType)componentType {
@@ -1,4 +1,4 @@
1
- #ifdef RCT_NEW_ARCH_ENABLED
1
+ #ifdef RN_FABRIC_ENABLED
2
2
  #import <React/RCTFabricSurfaceHostingProxyRootView.h>
3
3
  #else
4
4
  #import <React/RCTRootView.h>
@@ -30,27 +30,18 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);
30
30
 
31
31
  @end
32
32
 
33
- #ifdef RCT_NEW_ARCH_ENABLED
33
+ #ifdef RN_FABRIC_ENABLED
34
34
  @interface RNNReactView
35
35
  : RCTFabricSurfaceHostingProxyRootView <RCTRootViewDelegate, RNNComponentProtocol>
36
36
  #else
37
37
  @interface RNNReactView : RCTRootView <RCTRootViewDelegate, RNNComponentProtocol>
38
38
  #endif
39
39
 
40
- #ifdef RCT_NEW_ARCH_ENABLED
41
40
  - (instancetype)initWithBridge:(RCTBridge *)bridge
42
41
  moduleName:(NSString *)moduleName
43
42
  initialProperties:(NSDictionary *)initialProperties
44
43
  eventEmitter:(RNNEventEmitter *)eventEmitter
45
- sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
46
44
  reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock;
47
- #else
48
- - (instancetype)initWithBridge:(RCTBridge *)bridge
49
- moduleName:(NSString *)moduleName
50
- initialProperties:(NSDictionary *)initialProperties
51
- eventEmitter:(RNNEventEmitter *)eventEmitter
52
- reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock;
53
- #endif
54
45
 
55
46
  @property(nonatomic, copy) RNNReactViewReadyCompletionBlock reactViewReadyBlock;
56
47
  @property(nonatomic, strong) RNNEventEmitter *eventEmitter;
@@ -4,26 +4,13 @@
4
4
  @implementation RNNReactView {
5
5
  BOOL _isAppeared;
6
6
  }
7
- #ifdef RCT_NEW_ARCH_ENABLED
8
- - (instancetype)initWithBridge:(RCTBridge *)bridge
9
- moduleName:(NSString *)moduleName
10
- initialProperties:(NSDictionary *)initialProperties
11
- eventEmitter:(RNNEventEmitter *)eventEmitter
12
- sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
13
- reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
14
- self = [super initWithBridge:bridge
15
- moduleName:moduleName
16
- initialProperties:initialProperties
17
- sizeMeasureMode:sizeMeasureMode];
18
- #else
7
+
19
8
  - (instancetype)initWithBridge:(RCTBridge *)bridge
20
9
  moduleName:(NSString *)moduleName
21
10
  initialProperties:(NSDictionary *)initialProperties
22
11
  eventEmitter:(RNNEventEmitter *)eventEmitter
23
12
  reactViewReadyBlock:(RNNReactViewReadyCompletionBlock)reactViewReadyBlock {
24
13
  self = [super initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
25
- #endif
26
-
27
14
  [[NSNotificationCenter defaultCenter] addObserver:self
28
15
  selector:@selector(contentDidAppear:)
29
16
  name:RCTContentDidAppearNotification
@@ -34,10 +34,17 @@
34
34
 
35
35
  [self addChildViewController:self.child];
36
36
  [self.child.view setFrame:self.view.bounds];
37
- self.child.view.autoresizingMask =
38
- UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
39
37
  [self.view addSubview:self.child.view];
40
38
  [self.view bringSubviewToFront:self.child.view];
39
+ self.child.view.translatesAutoresizingMaskIntoConstraints = NO;
40
+
41
+ [NSLayoutConstraint activateConstraints:@[
42
+ [self.child.view.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],
43
+ [self.child.view.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],
44
+ [self.child.view.topAnchor constraintEqualToAnchor:self.view.topAnchor],
45
+ [self.child.view.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]
46
+ ]];
47
+
41
48
  [self.child didMoveToParentViewController:self];
42
49
  }
43
50
 
@@ -87,13 +87,31 @@
87
87
  buttonOptions:(RNNButtonOptions *)buttonOptions
88
88
  onPress:(RNNButtonPressCallback)onPress {
89
89
  self = [super initWithCustomView:reactView];
90
- [reactView setFrame:CGRectMake(0, 0, 50, 50)];
91
90
  [self applyOptions:buttonOptions];
92
91
 
92
+ reactView.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;
93
93
  reactView.delegate = self;
94
-
95
94
  reactView.backgroundColor = [UIColor clearColor];
96
-
95
+ reactView.hidden = CGRectEqualToRect(reactView.frame, CGRectZero);
96
+
97
+ [NSLayoutConstraint deactivateConstraints:reactView.constraints];
98
+ self.widthConstraint =
99
+ [NSLayoutConstraint constraintWithItem:reactView
100
+ attribute:NSLayoutAttributeWidth
101
+ relatedBy:NSLayoutRelationEqual
102
+ toItem:nil
103
+ attribute:NSLayoutAttributeNotAnAttribute
104
+ multiplier:1.0
105
+ constant:reactView.intrinsicContentSize.width];
106
+ self.heightConstraint =
107
+ [NSLayoutConstraint constraintWithItem:reactView
108
+ attribute:NSLayoutAttributeHeight
109
+ relatedBy:NSLayoutRelationEqual
110
+ toItem:nil
111
+ attribute:NSLayoutAttributeNotAnAttribute
112
+ multiplier:1.0
113
+ constant:reactView.intrinsicContentSize.height];
114
+ [NSLayoutConstraint activateConstraints:@[ self.widthConstraint, self.heightConstraint ]];
97
115
  self.onPress = onPress;
98
116
  return self;
99
117
  }
@@ -255,8 +255,6 @@
255
255
  507ACB1223F44D1E00829911 /* RNNComponentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 507ACB1023F44D1E00829911 /* RNNComponentView.m */; };
256
256
  507ACB1523F44E5200829911 /* RNNComponentRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 507ACB1323F44E5200829911 /* RNNComponentRootView.h */; };
257
257
  507ACB1623F44E5200829911 /* RNNComponentRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 507ACB1423F44E5200829911 /* RNNComponentRootView.m */; };
258
- 507DBBDB2A31DE8400F1FC74 /* RNNAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 507DBBD92A31DE8400F1FC74 /* RNNAppDelegate.h */; };
259
- 507DBBDC2A31DE8400F1FC74 /* RNNAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 507DBBDA2A31DE8400F1FC74 /* RNNAppDelegate.mm */; };
260
258
  507E7D57201DDD3000444E6C /* RNNSharedElementAnimationOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 507E7D55201DDD3000444E6C /* RNNSharedElementAnimationOptions.h */; };
261
259
  507E7D58201DDD3000444E6C /* RNNSharedElementAnimationOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 507E7D56201DDD3000444E6C /* RNNSharedElementAnimationOptions.m */; };
262
260
  507F43C51FF4F17C00D9425B /* RNNTopTabsViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */; };
@@ -794,8 +792,6 @@
794
792
  507ACB1023F44D1E00829911 /* RNNComponentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNComponentView.m; sourceTree = "<group>"; };
795
793
  507ACB1323F44E5200829911 /* RNNComponentRootView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNComponentRootView.h; sourceTree = "<group>"; };
796
794
  507ACB1423F44E5200829911 /* RNNComponentRootView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNComponentRootView.m; sourceTree = "<group>"; };
797
- 507DBBD92A31DE8400F1FC74 /* RNNAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNAppDelegate.h; sourceTree = "<group>"; };
798
- 507DBBDA2A31DE8400F1FC74 /* RNNAppDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RNNAppDelegate.mm; sourceTree = "<group>"; };
799
795
  507E7D55201DDD3000444E6C /* RNNSharedElementAnimationOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNSharedElementAnimationOptions.h; sourceTree = "<group>"; };
800
796
  507E7D56201DDD3000444E6C /* RNNSharedElementAnimationOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSharedElementAnimationOptions.m; sourceTree = "<group>"; };
801
797
  507F43C31FF4F17C00D9425B /* RNNTopTabsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNTopTabsViewController.h; sourceTree = "<group>"; };
@@ -1732,8 +1728,6 @@
1732
1728
  50588B8723AA87E3001F6A5E /* Animations */,
1733
1729
  7BA500731E2544B9001B9E1B /* ReactNativeNavigation.h */,
1734
1730
  7BA500741E2544B9001B9E1B /* ReactNativeNavigation.m */,
1735
- 507DBBD92A31DE8400F1FC74 /* RNNAppDelegate.h */,
1736
- 507DBBDA2A31DE8400F1FC74 /* RNNAppDelegate.mm */,
1737
1731
  5030B62023D5B4CA008F1642 /* Color+Interpolation.h */,
1738
1732
  5030B61F23D5B4CA008F1642 /* Color+Interpolation.m */,
1739
1733
  5030B62623D5B54D008F1642 /* LNInterpolable.h */,
@@ -2016,7 +2010,6 @@
2016
2010
  50395593217485B000B0A663 /* Double.h in Headers */,
2017
2011
  5050465421F8F4490035497A /* RNNReactComponentRegistry.h in Headers */,
2018
2012
  506BF65C2600AE4200A22755 /* CenterTransition.h in Headers */,
2019
- 507DBBDB2A31DE8400F1FC74 /* RNNAppDelegate.h in Headers */,
2020
2013
  504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */,
2021
2014
  50E38DD723A7A2BE009817F6 /* AnimatedViewFactory.h in Headers */,
2022
2015
  E8E5182E1F83A48B000467AC /* RNNTransitionStateHolder.h in Headers */,
@@ -2361,7 +2354,6 @@
2361
2354
  50BCB29223F2C7CD00D6C8E5 /* AnchorTransition.m in Sources */,
2362
2355
  50344D2923A03DB4004B6A7C /* BottomTabsAttachMode.m in Sources */,
2363
2356
  501224072173592D000F5F98 /* RNNBottomTabsPresenter.m in Sources */,
2364
- 507DBBDC2A31DE8400F1FC74 /* RNNAppDelegate.mm in Sources */,
2365
2357
  50A00C38200F84D6000F01A6 /* RNNOverlayOptions.m in Sources */,
2366
2358
  50A5628B23DDAB5A0027C219 /* ScreenAnimationController.m in Sources */,
2367
2359
  5039559C2174867000B0A663 /* DoubleParser.m in Sources */,
@@ -1,4 +1,4 @@
1
- import { NativeModules, NativeEventEmitter, EmitterSubscription } from 'react-native';
1
+ import { NativeModules, NativeEventEmitter, EventEmitter, EmitterSubscription } from 'react-native';
2
2
  import {
3
3
  ComponentWillAppearEvent,
4
4
  ComponentDidAppearEvent,
@@ -19,8 +19,10 @@ import {
19
19
  } from '../interfaces/Events';
20
20
 
21
21
  export class NativeEventsReceiver {
22
- private emitter: NativeEventEmitter;
22
+ private emitter: EventEmitter;
23
23
  constructor() {
24
+ // NOTE: This try catch is workaround for integration tests
25
+ // TODO: mock NativeEventEmitter in integration tests rather done adding try catch in source code
24
26
  try {
25
27
  this.emitter = new NativeEventEmitter(NativeModules.RNNEventEmitter);
26
28
  } catch (e) {
@@ -30,7 +32,7 @@ export class NativeEventsReceiver {
30
32
  remove: () => undefined,
31
33
  };
32
34
  },
33
- } as any) as NativeEventEmitter;
35
+ } as any) as EventEmitter;
34
36
  }
35
37
  }
36
38
 
package/metro.config.js CHANGED
@@ -1,8 +1,4 @@
1
- const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
2
-
3
- const config = {
1
+ module.exports = {
4
2
  projectRoot: `${__dirname}`,
5
3
  watchFolders: [__dirname],
6
4
  };
7
-
8
- module.exports = mergeConfig(getDefaultConfig(__dirname), config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "7.36.0-rc.1",
3
+ "version": "7.36.0-rc.2",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,
@@ -33,8 +33,7 @@
33
33
  "start": "node ./scripts/start",
34
34
  "pretest-js": "npm run build",
35
35
  "test-js": "node ./scripts/test-js",
36
- "pod-install-new-arch": "cd playground/ios && BUNDLE_GEMFILE=../../Gemfile BUNDLE_PATH=~/gems/ bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install",
37
- "pod-install": "cd playground/ios && pod install",
36
+ "pod-install": "pod install --project-directory=playground/ios",
38
37
  "test-unit-ios": "node ./scripts/test-unit --ios",
39
38
  "test-snapshot-ios": "node ./scripts/test-snapshot --ios",
40
39
  "test-unit-android": "node ./scripts/test-unit --android",
@@ -72,8 +71,7 @@
72
71
  "@babel/plugin-proposal-export-default-from": "7.10.1",
73
72
  "@babel/plugin-proposal-export-namespace-from": "7.10.1",
74
73
  "@babel/runtime": "^7.20.0",
75
- "@babel/types": "7.22.5",
76
- "@react-native/metro-config": "^0.73.0",
74
+ "@babel/types": "7.15.6",
77
75
  "@react-native-community/blur": "^3.6.0",
78
76
  "@react-native-community/datetimepicker": "^3.4.7",
79
77
  "@react-native-community/eslint-config": "2.0.0",
@@ -102,15 +100,15 @@
102
100
  "identity-obj-proxy": "3.0.0",
103
101
  "jest": "^27.5.1",
104
102
  "lint-staged": "10.2.11",
105
- "metro-react-native-babel-preset": "^0.76.2",
103
+ "metro-react-native-babel-preset": "^0.70.3",
106
104
  "pixelmatch": "^5.2.1",
107
105
  "pngjs": "^6.0.0",
108
106
  "prettier": "2.1.2",
109
107
  "react": "18.2.0",
110
- "react-native": "0.72.3",
108
+ "react-native": "0.71.8",
111
109
  "react-native-fast-image": "^8.6.3",
112
110
  "react-native-gesture-handler": "^2.10.1",
113
- "react-native-reanimated": "3.4.1",
111
+ "react-native-reanimated": "2.14.1",
114
112
  "react-native-ui-lib": "7.3.6",
115
113
  "react-redux": "5.x.x",
116
114
  "react-test-renderer": "18.2.0",
package/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
- ruby '>= 2.6.10'
5
-
6
- gem 'cocoapods', '>= 1.11.3'
@@ -1,20 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import <React/RCTBridge.h>
3
- #import <React/RCTBridgeDelegate.h>
4
-
5
- @class RCTSurfacePresenterBridgeAdapter;
6
- @class RCTTurboModuleManager;
7
-
8
- @interface RNNAppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
9
-
10
- @property(nonatomic, strong) UIWindow *window;
11
-
12
- #if RCT_NEW_ARCH_ENABLED
13
-
14
- /// The TurboModule manager
15
- @property(nonatomic, strong) RCTTurboModuleManager *turboModuleManager;
16
- @property(nonatomic, strong) RCTSurfacePresenterBridgeAdapter *bridgeAdapter;
17
-
18
- #endif
19
-
20
- @end
@@ -1,135 +0,0 @@
1
- #import "RNNAppDelegate.h"
2
- #import <ReactNativeNavigation/ReactNativeNavigation.h>
3
-
4
- #if RCT_NEW_ARCH_ENABLED
5
- #import "RCTAppSetupUtils.h"
6
- #import "RCTLegacyInteropComponents.h"
7
- #import <React/CoreModulesPlugins.h>
8
- #import <React/RCTCxxBridgeDelegate.h>
9
- #import <React/RCTFabricSurfaceHostingProxyRootView.h>
10
- #import <React/RCTLegacyViewManagerInteropComponentView.h>
11
- #import <React/RCTRuntimeExecutorFromBridge.h>
12
- #import <React/RCTSurfacePresenter.h>
13
- #import <React/RCTSurfacePresenterBridgeAdapter.h>
14
- #import <ReactCommon/RCTTurboModuleManager.h>
15
- #import <react/config/ReactNativeConfig.h>
16
- #import <react/renderer/runtimescheduler/RuntimeScheduler.h>
17
- #import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
18
-
19
- static NSString *const kRNConcurrentRoot = @"concurrentRoot";
20
-
21
- @interface RNNAppDelegate () <RCTTurboModuleManagerDelegate, RCTCxxBridgeDelegate> {
22
- std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
23
- facebook::react::ContextContainer::Shared _contextContainer;
24
- std::shared_ptr<facebook::react::RuntimeScheduler> _runtimeScheduler;
25
- }
26
- @end
27
-
28
- #endif
29
-
30
- @implementation RNNAppDelegate
31
-
32
- #if RCT_NEW_ARCH_ENABLED
33
- - (instancetype)init {
34
- if (self = [super init]) {
35
- _contextContainer = std::make_shared<facebook::react::ContextContainer const>();
36
- _reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
37
- _contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
38
- }
39
- return self;
40
- }
41
- #endif
42
-
43
- - (BOOL)application:(UIApplication *)application
44
- didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
45
- #if RCT_NEW_ARCH_ENABLED
46
- RCTEnableTurboModule(true);
47
- #endif
48
- RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
49
- #if RCT_NEW_ARCH_ENABLED
50
- self.bridgeAdapter =
51
- [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge
52
- contextContainer:_contextContainer];
53
- bridge.surfacePresenter = self.bridgeAdapter.surfacePresenter;
54
-
55
- [self unstable_registerLegacyComponents];
56
- #endif
57
-
58
- [ReactNativeNavigation bootstrapWithBridge:bridge];
59
-
60
- return YES;
61
- }
62
-
63
- - (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
64
- return [ReactNativeNavigation extraModulesForBridge:bridge];
65
- }
66
-
67
- #if RCT_NEW_ARCH_ENABLED
68
- #pragma mark - RCTCxxBridgeDelegate
69
- - (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:
70
- (RCTBridge *)bridge {
71
- _runtimeScheduler = _runtimeScheduler =
72
- std::make_shared<facebook::react::RuntimeScheduler>(RCTRuntimeExecutorFromBridge(bridge));
73
- std::shared_ptr<facebook::react::CallInvoker> callInvoker =
74
- std::make_shared<facebook::react::RuntimeSchedulerCallInvoker>(_runtimeScheduler);
75
- self.turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
76
- delegate:self
77
- jsInvoker:callInvoker];
78
- _contextContainer->erase("RuntimeScheduler");
79
- _contextContainer->insert("RuntimeScheduler", _runtimeScheduler);
80
- return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager, _runtimeScheduler);
81
- }
82
-
83
- #pragma mark RCTTurboModuleManagerDelegate
84
-
85
- - (Class)getModuleClassFromName:(const char *)name {
86
- return RCTCoreModulesClassProvider(name);
87
- }
88
-
89
- - (std::shared_ptr<facebook::react::TurboModule>)
90
- getTurboModule:(const std::string &)name
91
- jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker {
92
- return nullptr;
93
- }
94
-
95
- - (std::shared_ptr<facebook::react::TurboModule>)
96
- getTurboModule:(const std::string &)name
97
- initParams:(const facebook::react::ObjCTurboModule::InitParams &)params {
98
- return nullptr;
99
- }
100
-
101
- - (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass {
102
- return RCTAppSetupDefaultModuleFromClass(moduleClass);
103
- }
104
-
105
- #pragma mark - New Arch Enabled settings
106
-
107
- - (BOOL)turboModuleEnabled {
108
- return YES;
109
- }
110
-
111
- - (BOOL)fabricEnabled {
112
- return YES;
113
- }
114
-
115
- #pragma mark - New Arch Utilities
116
-
117
- - (void)unstable_registerLegacyComponents {
118
- for (NSString *legacyComponent in [RCTLegacyInteropComponents legacyInteropComponents]) {
119
- [RCTLegacyViewManagerInteropComponentView supportLegacyViewManagerWithName:legacyComponent];
120
- }
121
- }
122
-
123
- #endif
124
-
125
- - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
126
- [NSException raise:@"RCTBridgeDelegate::sourceURLForBridge not implemented"
127
- format:@"Subclasses must implement a valid sourceURLForBridge method"];
128
- return nil;
129
- }
130
-
131
- - (BOOL)concurrentRootEnabled {
132
- return true;
133
- }
134
-
135
- @end