react-native-navigation 8.1.0 → 8.1.1
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.
- package/ReactNativeNavigation.podspec +15 -8
- package/autolink/postlink/__snapshots__/applicationLinker.test.js.snap +2 -2
- package/autolink/postlink/applicationLinker.js +17 -16
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/navigator/Navigator.java +3 -0
- package/lib/ios/RNNAppDelegate.mm +38 -0
- package/package.json +1 -1
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
require 'json'
|
|
2
|
+
require 'find'
|
|
2
3
|
|
|
3
4
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
5
|
|
|
5
6
|
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
6
7
|
|
|
7
8
|
# Detect if this is a Swift project by looking for user AppDelegate.swift files
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
start_dir = File.expand_path('../../', __dir__)
|
|
10
|
+
swift_delegate_path = nil
|
|
11
|
+
Find.find(start_dir) do |path|
|
|
12
|
+
if path =~ /AppDelegate\.swift$/
|
|
13
|
+
swift_delegate_path = path
|
|
14
|
+
break
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
swift_project = swift_delegate_path && File.exist?(swift_delegate_path)
|
|
12
19
|
|
|
13
20
|
# Debug output
|
|
14
21
|
if swift_project
|
|
15
22
|
puts "ReactNativeNavigation: Swift AppDelegate detected - enabling Swift-compatible configuration"
|
|
16
|
-
else
|
|
23
|
+
else
|
|
17
24
|
puts "ReactNativeNavigation: Objective-C AppDelegate detected - using standard configuration"
|
|
18
25
|
end
|
|
19
26
|
|
|
@@ -43,19 +50,19 @@ Pod::Spec.new do |s|
|
|
|
43
50
|
end
|
|
44
51
|
|
|
45
52
|
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DFOLLY_CFG_NO_COROUTINES=1'
|
|
46
|
-
|
|
53
|
+
|
|
47
54
|
# Base xcconfig settings
|
|
48
55
|
xcconfig_settings = {
|
|
49
56
|
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/Headers/Private/React-Core" "$(PODS_ROOT)/Headers/Private/Yoga"',
|
|
50
57
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
51
58
|
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
52
59
|
}
|
|
53
|
-
|
|
60
|
+
|
|
54
61
|
# Only add DEFINES_MODULE for Swift projects
|
|
55
62
|
if swift_project
|
|
56
63
|
xcconfig_settings["DEFINES_MODULE"] = "YES"
|
|
57
64
|
end
|
|
58
|
-
|
|
65
|
+
|
|
59
66
|
s.pod_target_xcconfig = xcconfig_settings
|
|
60
67
|
|
|
61
68
|
if fabric_enabled
|
|
@@ -8,18 +8,18 @@ import com.facebook.react.PackageList
|
|
|
8
8
|
import com.reactnativenavigation.NavigationApplication
|
|
9
9
|
import com.facebook.react.ReactHost
|
|
10
10
|
import com.facebook.react.ReactNativeHost
|
|
11
|
-
import com.reactnativenavigation.react.NavigationReactNativeHost
|
|
12
11
|
import com.facebook.react.ReactPackage
|
|
13
12
|
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
|
14
13
|
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
|
|
15
14
|
import com.facebook.react.defaults.DefaultReactNativeHost
|
|
15
|
+
import com.reactnativenavigation.react.NavigationReactNativeHost
|
|
16
16
|
import com.facebook.react.soloader.OpenSourceMergedSoMapping
|
|
17
17
|
import com.facebook.soloader.SoLoader
|
|
18
18
|
|
|
19
19
|
class MainApplication : NavigationApplication() {
|
|
20
20
|
|
|
21
21
|
override val reactNativeHost: ReactNativeHost =
|
|
22
|
-
object :
|
|
22
|
+
object : NavigationReactNativeHost(this) {
|
|
23
23
|
override fun getPackages(): List<ReactPackage> =
|
|
24
24
|
PackageList(this).packages.apply {
|
|
25
25
|
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
@@ -16,8 +16,8 @@ class ApplicationLinker {
|
|
|
16
16
|
if (!this.applicationPath) {
|
|
17
17
|
errorn(
|
|
18
18
|
'MainApplication.kt not found! Does the file exist in the correct folder?\n' +
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
' Please check the manual installation docs:\n' +
|
|
20
|
+
' https://wix.github.io/react-native-navigation/docs/installing#3-update-mainapplicationjava'
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -78,10 +78,7 @@ class ApplicationLinker {
|
|
|
78
78
|
if (this._doesExtendApplication(applicationContent)) {
|
|
79
79
|
debugn(' Extending NavigationApplication');
|
|
80
80
|
return applicationContent
|
|
81
|
-
.replace(
|
|
82
|
-
/:\s*Application\(\)\s*,\s*ReactApplication/gi,
|
|
83
|
-
': NavigationApplication()'
|
|
84
|
-
)
|
|
81
|
+
.replace(/:\s*Application\(\)\s*,\s*ReactApplication/gi, ': NavigationApplication()')
|
|
85
82
|
.replace(
|
|
86
83
|
'import com.facebook.react.ReactApplication',
|
|
87
84
|
'import com.reactnativenavigation.NavigationApplication'
|
|
@@ -114,21 +111,21 @@ class ApplicationLinker {
|
|
|
114
111
|
return applicationContent;
|
|
115
112
|
}
|
|
116
113
|
|
|
117
|
-
if (this.
|
|
114
|
+
if (this._doesExtendDefaultReactNativeHost(applicationContent)) {
|
|
118
115
|
debugn(' Changing host implementation to NavigationReactNativeHost');
|
|
119
116
|
return applicationContent
|
|
120
|
-
.replace('
|
|
117
|
+
.replace('DefaultReactNativeHost(this)', 'NavigationReactNativeHost(this)')
|
|
121
118
|
.replace(
|
|
122
|
-
'import com.facebook.react.
|
|
123
|
-
'import com.facebook.react.
|
|
119
|
+
'import com.facebook.react.defaults.DefaultReactNativeHost',
|
|
120
|
+
'import com.facebook.react.defaults.DefaultReactNativeHost\nimport com.reactnativenavigation.react.NavigationReactNativeHost'
|
|
124
121
|
);
|
|
125
|
-
} else if (this.
|
|
122
|
+
} else if (this._doesExtendReactNativeHost(applicationContent)) {
|
|
126
123
|
debugn(' Changing host implementation to NavigationReactNativeHost');
|
|
127
124
|
return applicationContent
|
|
128
|
-
.replace('
|
|
125
|
+
.replace('ReactNativeHost(this)', 'NavigationReactNativeHost(this)')
|
|
129
126
|
.replace(
|
|
130
|
-
'import com.facebook.react.
|
|
131
|
-
'import com.facebook.react.
|
|
127
|
+
'import com.facebook.react.ReactNativeHost',
|
|
128
|
+
'import com.facebook.react.ReactNativeHost\nimport com.reactnativenavigation.react.NavigationReactNativeHost'
|
|
132
129
|
);
|
|
133
130
|
}
|
|
134
131
|
|
|
@@ -160,7 +157,9 @@ class ApplicationLinker {
|
|
|
160
157
|
}
|
|
161
158
|
|
|
162
159
|
_isSOLoaderInitCalled(applicationContent) {
|
|
163
|
-
return /SoLoader\.init\(\s*this\s*,\s*OpenSourceMergedSoMapping\s*\);?/.test(
|
|
160
|
+
return /SoLoader\.init\(\s*this\s*,\s*OpenSourceMergedSoMapping\s*\);?/.test(
|
|
161
|
+
applicationContent
|
|
162
|
+
);
|
|
164
163
|
}
|
|
165
164
|
|
|
166
165
|
_removeNewArchEntryPointLoad(applicationContent) {
|
|
@@ -176,7 +175,9 @@ class ApplicationLinker {
|
|
|
176
175
|
}
|
|
177
176
|
|
|
178
177
|
_isNewArchEntryPointLoadCalled(applicationContent) {
|
|
179
|
-
return /if\s*\(\s*BuildConfig\.IS_NEW_ARCHITECTURE_ENABLED\s*\)\s*\{[\s\S]*?load\(\)\s*[\s}]*?\}/.test(
|
|
178
|
+
return /if\s*\(\s*BuildConfig\.IS_NEW_ARCHITECTURE_ENABLED\s*\)\s*\{[\s\S]*?load\(\)\s*[\s}]*?\}/.test(
|
|
179
|
+
applicationContent
|
|
180
|
+
);
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
183
|
|
|
@@ -284,6 +284,9 @@ public class Navigator extends ParentController<ViewGroup> {
|
|
|
284
284
|
|
|
285
285
|
public void onHostResume() {
|
|
286
286
|
overlayManager.onHostResume();
|
|
287
|
+
if (root != null && root.getView() != null) {
|
|
288
|
+
root.getView().requestLayout();
|
|
289
|
+
}
|
|
287
290
|
if (!modalStack.isEmpty()) {
|
|
288
291
|
modalStack.onHostResume();
|
|
289
292
|
if(modalStack.peekDisplayedOverCurrentContext()){
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
#import "RNNAppDelegate.h"
|
|
3
3
|
#import <ReactNativeNavigation/ReactNativeNavigation.h>
|
|
4
|
+
#import <react/featureflags/ReactNativeFeatureFlags.h>
|
|
5
|
+
#import <react/featureflags/ReactNativeFeatureFlagsDefaults.h>
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
#import "RCTAppSetupUtils.h"
|
|
@@ -31,6 +33,8 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
|
|
|
31
33
|
- (BOOL)application:(UIApplication *)application
|
|
32
34
|
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
|
33
35
|
|
|
36
|
+
[self _setUpFeatureFlags];
|
|
37
|
+
|
|
34
38
|
// Copied from RCTAppDelegate, it private inside it
|
|
35
39
|
self.rootViewFactory = [self createRCTRootViewFactory];
|
|
36
40
|
|
|
@@ -94,4 +98,38 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
|
|
|
94
98
|
return true;
|
|
95
99
|
}
|
|
96
100
|
|
|
101
|
+
#pragma mark - Feature Flags
|
|
102
|
+
|
|
103
|
+
class RCTAppDelegateBridgelessFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults {
|
|
104
|
+
public:
|
|
105
|
+
bool enableBridgelessArchitecture() override
|
|
106
|
+
{
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
bool enableFabricRenderer() override
|
|
110
|
+
{
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
bool useTurboModules() override
|
|
114
|
+
{
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
bool useNativeViewConfigsInBridgelessMode() override
|
|
118
|
+
{
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
bool enableFixForViewCommandRace() override
|
|
122
|
+
{
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
- (void)_setUpFeatureFlags
|
|
128
|
+
{
|
|
129
|
+
if ([self bridgelessEnabled]) {
|
|
130
|
+
facebook::react::ReactNativeFeatureFlags::override(std::make_unique<RCTAppDelegateBridgelessFeatureFlags>());
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
97
134
|
@end
|
|
135
|
+
|