react-native-macos 0.0.0-7ae1439d0 → 0.0.0-7c6fa2fb1
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/Libraries/Animated/AnimatedEvent.js +23 -4
- package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
- package/Libraries/Components/ScrollView/ScrollView.js +8 -5
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
- package/Libraries/Core/ExceptionsManager.js +3 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpGlobals.js +2 -0
- package/Libraries/Core/setUpTimers.js +2 -2
- package/Libraries/Image/Image.ios.js +6 -0
- package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
- package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +0 -3
- package/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +6 -3
- package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.h +1 -2
- package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +2 -1
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/Pressability/Pressability.js +1 -0
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -0
- package/Libraries/Renderer/REVISION +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +238 -47
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +84 -18
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +84 -18
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +238 -47
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +84 -18
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +84 -18
- package/Libraries/StyleSheet/normalizeColor.js +2 -2
- package/Libraries/Text/RawText/RCTRawTextShadowView.m +2 -0
- package/Libraries/Text/Text/RCTTextView.m +7 -9
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +10 -8
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +1 -1
- package/Libraries/Text/TextProps.js +1 -7
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/Libraries/WebSocket/RCTSRWebSocket.m +23 -0
- package/React/Base/RCTBridge+Private.h +8 -0
- package/React/Base/RCTBridge.h +4 -0
- package/React/Base/RCTBridge.m +17 -0
- package/React/Base/RCTBridgeModule.h +1 -1
- package/React/Base/RCTBundleURLProvider.h +1 -1
- package/React/Base/RCTBundleURLProvider.mm +2 -2
- package/React/Base/RCTConvert.m +1 -1
- package/React/Base/RCTDefines.h +12 -3
- package/React/Base/RCTEventDispatcherProtocol.h +2 -0
- package/React/Base/RCTImageSource.m +2 -0
- package/React/Base/RCTJSStackFrame.m +2 -0
- package/React/Base/RCTJavaScriptLoader.mm +2 -0
- package/React/Base/RCTKeyCommands.m +2 -0
- package/React/Base/RCTModuleData.mm +2 -0
- package/React/Base/RCTModuleMethod.mm +2 -0
- package/React/Base/RCTRootView.h +15 -0
- package/React/Base/RCTRootView.m +15 -0
- package/React/Base/RCTTouchEvent.m +2 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +11 -0
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +35 -1
- package/React/CoreModules/RCTActionSheetManager.mm +4 -0
- package/React/CoreModules/RCTDevMenu.mm +4 -4
- package/React/CoreModules/RCTDevSettings.mm +6 -6
- package/React/CoreModules/RCTDevSplitBundleLoader.mm +1 -1
- package/React/CoreModules/RCTDeviceInfo.mm +4 -4
- package/React/CoreModules/RCTEventDispatcher.mm +5 -0
- package/React/CoreModules/RCTPerfMonitor.mm +9 -4
- package/React/CxxBridge/RCTCxxBridge.mm +18 -1
- package/React/CxxModule/RCTCxxMethod.mm +2 -0
- package/React/DevSupport/RCTInspectorDevServerHelper.mm +12 -0
- package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +11 -3
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +9 -0
- package/React/Fabric/Mounting/RCTMountingManager.mm +15 -1
- package/React/Fabric/RCTScheduler.mm +10 -3
- package/React/Modules/RCTLayoutAnimation.m +2 -0
- package/React/Modules/RCTLayoutAnimationGroup.m +2 -0
- package/React/Modules/RCTUIManager.m +19 -10
- package/React/Views/RCTFont.mm +58 -47
- package/React/Views/RCTShadowView.m +3 -1
- package/React/Views/RCTView.m +4 -8
- package/React/Views/RCTViewManager.m +3 -2
- package/React/Views/SafeAreaView/RCTSafeAreaView.m +2 -0
- package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.h +2 -2
- package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.m +4 -4
- package/React/Views/ScrollView/RCTScrollContentView.m +10 -24
- package/React/Views/ScrollView/RCTScrollView.m +1 -5
- package/ReactAndroid/build.gradle +12 -6
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK +0 -1
- package/ReactAndroid/src/androidTest/js/TestBundle.js +0 -7
- package/ReactAndroid/src/main/java/com/facebook/react/BUCK +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +51 -21
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +12 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCxxErrorHandler.java +39 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/RuntimeScheduler.java +21 -0
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/Binding.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +14 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +9 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +19 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/{JavaScriptTimerManager.java → JavaScriptTimerExecutor.java} +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.java +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java +23 -19
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java +1 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +0 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +20 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +25 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +25 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java +3 -0
- package/ReactAndroid/src/main/jni/react/jni/Android.mk +3 -2
- package/ReactAndroid/src/main/jni/react/jni/BUCK +2 -0
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +29 -0
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +4 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.cpp +18 -0
- package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h +25 -0
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.cpp +22 -0
- package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.h +30 -0
- package/ReactAndroid/src/main/third-party/android/androidx/BUCK +6 -6
- package/ReactCommon/React-Fabric.podspec +9 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/package.json +7 -4
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +1238 -1491
- package/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +14 -31
- package/ReactCommon/react/renderer/animations/BUCK +1 -0
- package/ReactCommon/react/renderer/animations/LayoutAnimationCallbackWrapper.h +34 -0
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +5 -26
- package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h +3 -13
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1399 -1622
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +76 -244
- package/ReactCommon/react/renderer/animations/conversions.h +212 -0
- package/ReactCommon/react/renderer/animations/primitives.h +104 -0
- package/ReactCommon/react/renderer/animations/utils.cpp +71 -0
- package/ReactCommon/react/renderer/animations/utils.h +80 -0
- package/ReactCommon/react/renderer/attributedstring/AttributedString.h +0 -1
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +7 -3
- package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +12 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +1 -1
- package/ReactCommon/react/renderer/attributedstring/conversions.h +58 -3
- package/ReactCommon/react/renderer/attributedstring/primitives.h +18 -1
- package/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h +1 -17
- package/ReactCommon/react/renderer/components/view/Android.mk +1 -1
- package/ReactCommon/react/renderer/components/view/ViewComponentDescriptor.h +0 -23
- package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +2 -3
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +1 -0
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +14 -6
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +1 -0
- package/ReactCommon/react/renderer/core/Props.h +1 -0
- package/ReactCommon/react/renderer/core/PropsParserContext.h +3 -2
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +10 -2
- package/ReactCommon/react/renderer/core/ReactPrimitives.h +0 -2
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +1 -0
- package/ReactCommon/react/renderer/graphics/Android.mk +1 -1
- package/ReactCommon/react/renderer/graphics/Transform.cpp +1 -1
- package/ReactCommon/react/renderer/graphics/Transform.h +1 -1
- package/ReactCommon/react/renderer/mounting/Android.mk +2 -1
- package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
- package/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp +12 -0
- package/ReactCommon/react/renderer/mounting/ShadowViewMutation.h +10 -1
- package/ReactCommon/react/renderer/runtimescheduler/BUCK +0 -1
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +4 -3
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerClock.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/SchedulerPriority.h +4 -3
- package/ReactCommon/react/renderer/runtimescheduler/Task.cpp +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -2
- package/ReactCommon/react/renderer/runtimescheduler/primitives.h +4 -2
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +4 -4
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +2 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +19 -0
- package/ReactCommon/react/renderer/timeline/BUCK +6 -6
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationDelegate.h +1 -1
- package/ReactCommon/react/test_utils/BUCK +3 -0
- package/ReactCommon/react/test_utils/MockSurfaceHandler.h +25 -0
- package/ReactCommon/react/utils/ContextContainer.h +0 -27
- package/flow/global.js +45 -0
- package/index.js +15 -10
- package/package.json +21 -13
- package/react.gradle +1 -1
- package/scripts/generate-specs-cli.js +18 -0
- package/scripts/ios-configure-glog.sh +4 -0
- package/scripts/react_native_pods.rb +156 -37
- package/template/_flowconfig +1 -1
- package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/template/package.json +2 -2
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
- package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/DatePickerDialogTestCase.java +0 -172
- package/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js +0 -45
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK +0 -27
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java +0 -137
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java +0 -153
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerMode.java +0 -15
- package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DismissableDatePickerDialog.java +0 -117
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/BUCK +0 -20
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/RuntimeSchedulerManager.java +0 -39
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/Android.mk +0 -34
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/BUCK +0 -35
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/OnLoad.cpp +0 -15
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.cpp +0 -46
- package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.h +0 -40
- package/scripts/generate-specs.sh +0 -99
- package/template/_editorconfig +0 -3
- package/template/_gitattributes +0 -3
|
@@ -21,7 +21,7 @@ NSString *const kRCTPlatformName = @"ios";
|
|
|
21
21
|
NSString *const kRCTPlatformName = @"macos";
|
|
22
22
|
#endif // ]TODO(macOS GH#774)
|
|
23
23
|
|
|
24
|
-
#if RCT_DEV_MENU
|
|
24
|
+
#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY
|
|
25
25
|
static BOOL kRCTAllowPackagerAccess = YES;
|
|
26
26
|
void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed)
|
|
27
27
|
{
|
|
@@ -156,7 +156,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
156
156
|
|
|
157
157
|
- (NSString *)packagerServerHostPort
|
|
158
158
|
{
|
|
159
|
-
#if RCT_DEV_MENU
|
|
159
|
+
#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY
|
|
160
160
|
if (!kRCTAllowPackagerAccess) {
|
|
161
161
|
RCTLogInfo(@"Packager server access is disabled in this environment");
|
|
162
162
|
return nil;
|
package/React/Base/RCTConvert.m
CHANGED
|
@@ -1423,7 +1423,7 @@ RCT_ENUM_CONVERTER(
|
|
|
1423
1423
|
@"link": NSAccessibilityLinkRole, // also a legacy iOS accessibilityTraits
|
|
1424
1424
|
@"menu": NSAccessibilityMenuRole,
|
|
1425
1425
|
@"menubar": NSAccessibilityMenuBarRole,
|
|
1426
|
-
@"menuitem":
|
|
1426
|
+
@"menuitem": NSAccessibilityMenuItemRole,
|
|
1427
1427
|
@"none": NSAccessibilityUnknownRole,
|
|
1428
1428
|
@"progressbar": NSAccessibilityProgressIndicatorRole,
|
|
1429
1429
|
@"radio": NSAccessibilityRadioButtonRole,
|
package/React/Base/RCTDefines.h
CHANGED
|
@@ -54,6 +54,15 @@
|
|
|
54
54
|
#define RCT_DEV_MENU RCT_DEV
|
|
55
55
|
#endif
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Controls for the core packgaer loading functionality
|
|
59
|
+
* By default, this inherits from RCT_DEV_MENU but it also gives the capability to
|
|
60
|
+
* enable the packager functionality without the rest of the dev tools from RCT_DEV_MENU
|
|
61
|
+
*/
|
|
62
|
+
#ifndef RCT_ENABLE_LOADING_FROM_PACKAGER
|
|
63
|
+
#define RCT_ENABLE_LOADING_FROM_PACKAGER RCT_DEV_MENU
|
|
64
|
+
#endif
|
|
65
|
+
|
|
57
66
|
#ifndef RCT_ENABLE_INSPECTOR
|
|
58
67
|
#if RCT_DEV && __has_include(<React/RCTInspectorDevServerHelper.h>)
|
|
59
68
|
#define RCT_ENABLE_INSPECTOR 1
|
|
@@ -62,11 +71,11 @@
|
|
|
62
71
|
#endif
|
|
63
72
|
#endif
|
|
64
73
|
|
|
65
|
-
#ifndef
|
|
74
|
+
#ifndef RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
|
|
66
75
|
#if RCT_DEV && (__has_include("RCTPackagerConnection.h") || __has_include(<React/RCTPackagerConnection.h>))
|
|
67
|
-
#define
|
|
76
|
+
#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 1
|
|
68
77
|
#else
|
|
69
|
-
#define
|
|
78
|
+
#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 0
|
|
70
79
|
#endif
|
|
71
80
|
#endif
|
|
72
81
|
|
|
@@ -81,6 +81,8 @@ typedef NS_ENUM(NSInteger, RCTTextEventType) {
|
|
|
81
81
|
*/
|
|
82
82
|
@protocol RCTEventDispatcherProtocol <RCTBridgeModule, RCTJSDispatcherModule>
|
|
83
83
|
|
|
84
|
+
- (void)sendViewEventWithName:(NSString *)name reactTag:(NSNumber *)reactTag;
|
|
85
|
+
|
|
84
86
|
/**
|
|
85
87
|
* Deprecated, do not use.
|
|
86
88
|
*/
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
(CGSizeEqualToSize(_size, object.size) || CGSizeEqualToSize(object.size, CGSizeZero));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
45
46
|
- (NSString *)description
|
|
46
47
|
{
|
|
47
48
|
return [NSString stringWithFormat:@"<RCTImageSource: %p URL=%@, size=%@, scale=%0.f>",
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
NSStringFromCGSize(_size),
|
|
51
52
|
_scale];
|
|
52
53
|
}
|
|
54
|
+
#endif // TODO(macOS GH#774)
|
|
53
55
|
|
|
54
56
|
@end
|
|
55
57
|
|
|
@@ -136,6 +136,7 @@ static NSRegularExpression *RCTJSStackFrameRegex()
|
|
|
136
136
|
return stack;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
139
140
|
- (NSString *)description
|
|
140
141
|
{
|
|
141
142
|
return [NSString stringWithFormat:@"<%@: %p method name: %@; file name: %@; line: %ld; column: %ld>",
|
|
@@ -146,5 +147,6 @@ static NSRegularExpression *RCTJSStackFrameRegex()
|
|
|
146
147
|
(long)self.lineNumber,
|
|
147
148
|
(long)self.column];
|
|
148
149
|
}
|
|
150
|
+
#endif // TODO(macOS GH#774)
|
|
149
151
|
|
|
150
152
|
@end
|
|
@@ -62,6 +62,7 @@ static RCTSource *RCTSourceCreate(NSURL *url, NSData *data, int64_t length) NS_R
|
|
|
62
62
|
|
|
63
63
|
@implementation RCTLoadingProgress
|
|
64
64
|
|
|
65
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
65
66
|
- (NSString *)description
|
|
66
67
|
{
|
|
67
68
|
NSMutableString *desc = [NSMutableString new];
|
|
@@ -77,6 +78,7 @@ static RCTSource *RCTSourceCreate(NSURL *url, NSData *data, int64_t length) NS_R
|
|
|
77
78
|
[desc appendString:@"\u2026"];
|
|
78
79
|
return desc;
|
|
79
80
|
}
|
|
81
|
+
#endif // TODO(macOS GH#774)
|
|
80
82
|
|
|
81
83
|
@end
|
|
82
84
|
|
|
@@ -74,6 +74,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
|
74
74
|
return [_key isEqual:input] && (_flags == flags || flags == 0);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
77
78
|
- (NSString *)description
|
|
78
79
|
{
|
|
79
80
|
return [NSString stringWithFormat:@"<%@:%p input=\"%@\" flags=%lld hasBlock=%@>",
|
|
@@ -83,6 +84,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
|
83
84
|
(long long)_flags,
|
|
84
85
|
_block ? @"YES" : @"NO"];
|
|
85
86
|
}
|
|
87
|
+
#endif // TODO(macOS GH#774)
|
|
86
88
|
|
|
87
89
|
@end
|
|
88
90
|
|
|
@@ -570,9 +570,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init);
|
|
|
570
570
|
_methodQueue = nil;
|
|
571
571
|
}
|
|
572
572
|
|
|
573
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
573
574
|
- (NSString *)description
|
|
574
575
|
{
|
|
575
576
|
return [NSString stringWithFormat:@"<%@: %p; name=\"%@\">", [self class], self, self.name];
|
|
576
577
|
}
|
|
578
|
+
#endif // TODO(macOS GH#774)
|
|
577
579
|
|
|
578
580
|
@end
|
|
@@ -602,6 +602,7 @@ RCT_EXTERN_C_END
|
|
|
602
602
|
return [NSString stringWithFormat:@"-[%@ %s]", _moduleClass, sel_getName(_selector)];
|
|
603
603
|
}
|
|
604
604
|
|
|
605
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
605
606
|
- (NSString *)description
|
|
606
607
|
{
|
|
607
608
|
return [NSString stringWithFormat:@"<%@: %p; exports %@ as %s(); type: %s>",
|
|
@@ -611,5 +612,6 @@ RCT_EXTERN_C_END
|
|
|
611
612
|
self.JSMethodName,
|
|
612
613
|
RCTFunctionDescriptorFromType(self.functionType)];
|
|
613
614
|
}
|
|
615
|
+
#endif // TODO(macOS GH#774)
|
|
614
616
|
|
|
615
617
|
@end
|
package/React/Base/RCTRootView.h
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
10
|
#import <React/RCTBridge.h>
|
|
11
|
+
#import <React/RCTBridgeModule.h>
|
|
12
|
+
#import <React/RCTEventDispatcherProtocol.h>
|
|
11
13
|
|
|
12
14
|
@protocol RCTRootViewDelegate;
|
|
13
15
|
|
|
@@ -75,6 +77,19 @@ extern
|
|
|
75
77
|
initialProperties:(nullable NSDictionary *)initialProperties
|
|
76
78
|
launchOptions:(nullable NSDictionary *)launchOptions;
|
|
77
79
|
|
|
80
|
+
/**
|
|
81
|
+
* This API allows RCTRootView users to know if the root view is backed by the bridge.
|
|
82
|
+
*/
|
|
83
|
+
@property (nonatomic, readonly) BOOL hasBridge;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* This API allows users of RCTRootView to access other NativeModules, without
|
|
87
|
+
* directly accessing the bridge.
|
|
88
|
+
*/
|
|
89
|
+
@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry;
|
|
90
|
+
|
|
91
|
+
@property (nonatomic, strong, readonly) id<RCTEventDispatcherProtocol> eventDispatcher;
|
|
92
|
+
|
|
78
93
|
/**
|
|
79
94
|
* The name of the JavaScript module to execute within the
|
|
80
95
|
* specified scriptURL (required). Setting this will not have
|
package/React/Base/RCTRootView.m
CHANGED
|
@@ -136,6 +136,21 @@ NSString *const RCTContentDidAppearNotification = @"RCTContentDidAppearNotificat
|
|
|
136
136
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
137
137
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
|
138
138
|
|
|
139
|
+
- (BOOL)hasBridge
|
|
140
|
+
{
|
|
141
|
+
return _bridge != nil;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
- (RCTModuleRegistry *)moduleRegistry
|
|
145
|
+
{
|
|
146
|
+
return _bridge.moduleRegistry;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
- (id<RCTEventDispatcherProtocol>)eventDispatcher
|
|
150
|
+
{
|
|
151
|
+
return [self.moduleRegistry moduleForName:"EventDispatcher"];
|
|
152
|
+
}
|
|
153
|
+
|
|
139
154
|
#pragma mark - passThroughTouches
|
|
140
155
|
|
|
141
156
|
- (BOOL)passThroughTouches
|
|
@@ -98,10 +98,12 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
|
98
98
|
return _coalescingKey;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
101
102
|
- (NSString *)description
|
|
102
103
|
{
|
|
103
104
|
return [NSString
|
|
104
105
|
stringWithFormat:@"<%@: %p; name = %@; coalescing key = %hu>", [self class], self, _eventName, _coalescingKey];
|
|
105
106
|
}
|
|
107
|
+
#endif // TODO(macOS GH#774)
|
|
106
108
|
|
|
107
109
|
@end
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
9
|
|
|
10
|
+
#import <React/RCTBridgeModule.h>
|
|
10
11
|
#import <React/RCTRootView.h>
|
|
11
12
|
|
|
12
13
|
#import "RCTSurfaceHostingView.h"
|
|
@@ -26,6 +27,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
26
27
|
|
|
27
28
|
@property (nonatomic, copy, readonly) NSString *moduleName;
|
|
28
29
|
@property (nonatomic, strong, readonly) RCTBridge *bridge;
|
|
30
|
+
@property (nonatomic, readonly) BOOL hasBridge;
|
|
31
|
+
@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry;
|
|
32
|
+
@property (nonatomic, strong, readonly) id<RCTEventDispatcherProtocol> eventDispatcher;
|
|
29
33
|
@property (nonatomic, copy, readwrite) NSDictionary *appProperties;
|
|
30
34
|
@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility;
|
|
31
35
|
@property (nonatomic, weak) id<RCTRootViewDelegate> delegate;
|
|
@@ -46,6 +50,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
46
50
|
initialProperties:(NSDictionary *)initialProperties
|
|
47
51
|
launchOptions:(NSDictionary *)launchOptions;
|
|
48
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Bridgeless mode initializer
|
|
55
|
+
*/
|
|
56
|
+
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
|
|
57
|
+
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
|
|
58
|
+
moduleRegistry:(RCTModuleRegistry *)moduleRegistry;
|
|
59
|
+
|
|
49
60
|
- (void)cancelTouches;
|
|
50
61
|
|
|
51
62
|
@end
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#import <objc/runtime.h>
|
|
11
11
|
|
|
12
12
|
#import "RCTAssert.h"
|
|
13
|
+
#import "RCTBridge+Private.h"
|
|
13
14
|
#import "RCTBridge.h"
|
|
14
15
|
#import "RCTLog.h"
|
|
15
16
|
#import "RCTPerformanceLogger.h"
|
|
@@ -48,7 +49,9 @@ static RCTRootViewSizeFlexibility convertToRootViewSizeFlexibility(RCTSurfaceSiz
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
@implementation RCTSurfaceHostingProxyRootView
|
|
52
|
+
@implementation RCTSurfaceHostingProxyRootView {
|
|
53
|
+
RCTModuleRegistry *_moduleRegistry;
|
|
54
|
+
}
|
|
52
55
|
|
|
53
56
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
54
57
|
moduleName:(NSString *)moduleName
|
|
@@ -94,6 +97,37 @@ static RCTRootViewSizeFlexibility convertToRootViewSizeFlexibility(RCTSurfaceSiz
|
|
|
94
97
|
return [self initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
|
|
95
98
|
}
|
|
96
99
|
|
|
100
|
+
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
|
|
101
|
+
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode
|
|
102
|
+
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
|
|
103
|
+
{
|
|
104
|
+
if (self = [super initWithSurface:surface sizeMeasureMode:sizeMeasureMode]) {
|
|
105
|
+
_moduleRegistry = moduleRegistry;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return self;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
- (BOOL)hasBridge
|
|
112
|
+
{
|
|
113
|
+
return _bridge != nil;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
- (RCTModuleRegistry *)moduleRegistry
|
|
117
|
+
{
|
|
118
|
+
// In bridgeless mode, RCTSurfaceHostingProxyRootView is created with an RCTModuleRegistry
|
|
119
|
+
if (_moduleRegistry) {
|
|
120
|
+
return _moduleRegistry;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return _bridge.moduleRegistry;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
- (id<RCTEventDispatcherProtocol>)eventDispatcher
|
|
127
|
+
{
|
|
128
|
+
return [self.moduleRegistry moduleForName:"EventDispatcher"];
|
|
129
|
+
}
|
|
130
|
+
|
|
97
131
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
98
132
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
|
99
133
|
|
|
@@ -43,7 +43,11 @@ NSSharingServicePickerDelegate
|
|
|
43
43
|
|
|
44
44
|
RCT_EXPORT_MODULE()
|
|
45
45
|
|
|
46
|
+
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
47
|
+
@synthesize bridge = _bridge;
|
|
48
|
+
#else // TODO(macOS GH#774)
|
|
46
49
|
@synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;
|
|
50
|
+
#endif // ]TODO(macOS GH#774)
|
|
47
51
|
|
|
48
52
|
- (dispatch_queue_t)methodQueue
|
|
49
53
|
{
|
|
@@ -297,10 +297,10 @@ RCT_EXPORT_MODULE()
|
|
|
297
297
|
addObject:[RCTDevMenuItem
|
|
298
298
|
buttonItemWithTitle:@"Debugger Unavailable"
|
|
299
299
|
handler:^{
|
|
300
|
-
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
301
300
|
NSString *message = RCTTurboModuleEnabled()
|
|
302
301
|
? @"Debugging with Chrome is not supported when TurboModules are enabled."
|
|
303
302
|
: @"Include the RCTWebSocket library to enable JavaScript debugging.";
|
|
303
|
+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
304
304
|
UIAlertController *alertController =
|
|
305
305
|
[UIAlertController alertControllerWithTitle:@"Debugger Unavailable"
|
|
306
306
|
message:message
|
|
@@ -319,10 +319,10 @@ RCT_EXPORT_MODULE()
|
|
|
319
319
|
completion:NULL];
|
|
320
320
|
#else // [TODO(macOS GH#774)
|
|
321
321
|
NSAlert *alert = [[NSAlert alloc] init];
|
|
322
|
-
[alert setMessageText:@"
|
|
323
|
-
[alert setInformativeText
|
|
322
|
+
[alert setMessageText:@"Debugger Unavailable"];
|
|
323
|
+
[alert setInformativeText:message];
|
|
324
324
|
[alert addButtonWithTitle:@"OK"];
|
|
325
|
-
[alert setAlertStyle:
|
|
325
|
+
[alert setAlertStyle:NSAlertStyleWarning];
|
|
326
326
|
[alert beginSheetModalForWindow:[NSApp keyWindow] completionHandler:nil];
|
|
327
327
|
#endif // ]TODO(macOS GH#774)
|
|
328
328
|
}]];
|
|
@@ -35,7 +35,7 @@ static NSString *const kRCTDevSettingSecondClickToShowDevMenu = @"secondClickToS
|
|
|
35
35
|
|
|
36
36
|
static NSString *const kRCTDevSettingsUserDefaultsKey = @"RCTDevMenu";
|
|
37
37
|
|
|
38
|
-
#if
|
|
38
|
+
#if RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
|
|
39
39
|
#import <React/RCTPackagerClient.h>
|
|
40
40
|
#import <React/RCTPackagerConnection.h>
|
|
41
41
|
#endif
|
|
@@ -128,14 +128,14 @@ void RCTDevSettingsSetEnabled(BOOL enabled)
|
|
|
128
128
|
|
|
129
129
|
@end
|
|
130
130
|
|
|
131
|
-
#if
|
|
131
|
+
#if RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
|
|
132
132
|
static RCTHandlerToken reloadToken;
|
|
133
133
|
static std::atomic<int> numInitializedModules{0};
|
|
134
134
|
#endif
|
|
135
135
|
|
|
136
136
|
@interface RCTDevSettings () <RCTBridgeModule, RCTInvalidating, NativeDevSettingsSpec, RCTDevSettingsInspectable> {
|
|
137
137
|
BOOL _isJSLoaded;
|
|
138
|
-
#if
|
|
138
|
+
#if RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
|
|
139
139
|
RCTHandlerToken _bridgeExecutorOverrideToken;
|
|
140
140
|
#endif
|
|
141
141
|
}
|
|
@@ -192,7 +192,7 @@ RCT_EXPORT_MODULE()
|
|
|
192
192
|
|
|
193
193
|
- (void)initialize
|
|
194
194
|
{
|
|
195
|
-
#if DEBUG &&
|
|
195
|
+
#if DEBUG && RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION // TODO(OSS Candidate ISS#2710739)
|
|
196
196
|
if (self.bridge) {
|
|
197
197
|
RCTBridge *__weak weakBridge = self.bridge;
|
|
198
198
|
_bridgeExecutorOverrideToken = [[RCTPackagerConnection sharedPackagerConnection]
|
|
@@ -245,7 +245,7 @@ RCT_EXPORT_MODULE()
|
|
|
245
245
|
- (void)invalidate
|
|
246
246
|
{
|
|
247
247
|
[super invalidate];
|
|
248
|
-
#if
|
|
248
|
+
#if RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
|
|
249
249
|
if (self.bridge) {
|
|
250
250
|
[[RCTPackagerConnection sharedPackagerConnection] removeHandler:_bridgeExecutorOverrideToken];
|
|
251
251
|
}
|
|
@@ -470,7 +470,7 @@ RCT_EXPORT_METHOD(addMenuItem : (NSString *)title)
|
|
|
470
470
|
|
|
471
471
|
- (void)addHandler:(id<RCTPackagerClientMethod>)handler forPackagerMethod:(NSString *)name
|
|
472
472
|
{
|
|
473
|
-
#if
|
|
473
|
+
#if RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
|
|
474
474
|
[[RCTPackagerConnection sharedPackagerConnection] addHandler:handler forMethod:name];
|
|
475
475
|
#endif
|
|
476
476
|
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#import <React/RCTAssert.h>
|
|
13
13
|
#import <React/RCTConstants.h>
|
|
14
14
|
#import <React/RCTEventDispatcherProtocol.h>
|
|
15
|
+
#import <React/RCTInitializing.h>
|
|
15
16
|
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
16
17
|
#import <React/RCTUIUtils.h>
|
|
17
18
|
#import <React/RCTUtils.h>
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
|
|
22
23
|
using namespace facebook::react;
|
|
23
24
|
|
|
24
|
-
@interface RCTDeviceInfo () <NativeDeviceInfoSpec>
|
|
25
|
+
@interface RCTDeviceInfo () <NativeDeviceInfoSpec, RCTInitializing>
|
|
25
26
|
@end
|
|
26
27
|
|
|
27
28
|
@implementation RCTDeviceInfo {
|
|
@@ -45,14 +46,13 @@ RCT_EXPORT_MODULE()
|
|
|
45
46
|
return dispatch_get_main_queue();
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
- (void)
|
|
49
|
+
- (void)initialize
|
|
49
50
|
{
|
|
50
|
-
_moduleRegistry = moduleRegistry;
|
|
51
51
|
#if !TARGET_OS_OSX // TODO(macOS GH#774)
|
|
52
52
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
53
53
|
selector:@selector(didReceiveNewContentSizeMultiplier)
|
|
54
54
|
name:RCTAccessibilityManagerDidUpdateMultiplierNotification
|
|
55
|
-
object:[
|
|
55
|
+
object:[_moduleRegistry moduleForName:"AccessibilityManager"]];
|
|
56
56
|
|
|
57
57
|
_currentInterfaceOrientation = [RCTSharedApplication() statusBarOrientation];
|
|
58
58
|
|
|
@@ -56,6 +56,11 @@ RCT_EXPORT_MODULE()
|
|
|
56
56
|
_observersLock = [NSLock new];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
- (void)sendViewEventWithName:(NSString *)name reactTag:(NSNumber *)reactTag
|
|
60
|
+
{
|
|
61
|
+
[_callableJSModules invokeModule:@"RCTViewEventEmitter" method:@"emit" withArgs:@[ name, RCTNullIfNil(reactTag) ]];
|
|
62
|
+
}
|
|
63
|
+
|
|
59
64
|
- (void)sendAppEventWithName:(NSString *)name body:(id)body
|
|
60
65
|
{
|
|
61
66
|
[_callableJSModules invokeModule:@"RCTNativeAppEventEmitter"
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
#import <React/RCTBridge+Private.h>
|
|
21
21
|
#import <React/RCTBridge.h>
|
|
22
22
|
#import <React/RCTFPSGraph.h>
|
|
23
|
+
#import <React/RCTInitializing.h>
|
|
23
24
|
#import <React/RCTInvalidating.h>
|
|
24
25
|
#import <React/RCTJavaScriptExecutor.h>
|
|
25
26
|
#import <React/RCTPerformanceLogger.h>
|
|
@@ -84,8 +85,13 @@ static vm_size_t RCTGetResidentMemorySize(void)
|
|
|
84
85
|
return memoryUsageInByte;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
@interface RCTPerfMonitor
|
|
88
|
-
|
|
88
|
+
@interface RCTPerfMonitor : NSObject <
|
|
89
|
+
RCTBridgeModule,
|
|
90
|
+
RCTTurboModule,
|
|
91
|
+
RCTInitializing,
|
|
92
|
+
RCTInvalidating,
|
|
93
|
+
UITableViewDataSource,
|
|
94
|
+
UITableViewDelegate>
|
|
89
95
|
|
|
90
96
|
#if __has_include(<React/RCTDevMenu.h>)
|
|
91
97
|
@property (nonatomic, strong, readonly) RCTDevMenuItem *devMenuItem;
|
|
@@ -150,9 +156,8 @@ RCT_EXPORT_MODULE()
|
|
|
150
156
|
return dispatch_get_main_queue();
|
|
151
157
|
}
|
|
152
158
|
|
|
153
|
-
- (void)
|
|
159
|
+
- (void)initialize
|
|
154
160
|
{
|
|
155
|
-
_moduleRegistry = moduleRegistry;
|
|
156
161
|
#if __has_include(<React/RCTDevMenu.h>)
|
|
157
162
|
[(RCTDevMenu *)[_moduleRegistry moduleForName:"DevMenu"] addItem:self.devMenuItem];
|
|
158
163
|
#endif
|
|
@@ -245,6 +245,11 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|
|
245
245
|
@synthesize performanceLogger = _performanceLogger;
|
|
246
246
|
@synthesize valid = _valid;
|
|
247
247
|
|
|
248
|
+
- (RCTModuleRegistry *)moduleRegistry
|
|
249
|
+
{
|
|
250
|
+
return _objCModuleRegistry;
|
|
251
|
+
}
|
|
252
|
+
|
|
248
253
|
- (void)setRCTTurboModuleRegistry:(id<RCTTurboModuleRegistry>)turboModuleRegistry
|
|
249
254
|
{
|
|
250
255
|
_turboModuleRegistry = turboModuleRegistry;
|
|
@@ -287,6 +292,18 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|
|
287
292
|
if ([bridgeModule respondsToSelector:@selector(setCallableJSModules:)]) {
|
|
288
293
|
bridgeModule.callableJSModules = _callableJSModules;
|
|
289
294
|
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Attach the RCTModuleRegistry to this TurboModule, which allows this TurboModule
|
|
298
|
+
* to require other TurboModules/NativeModules.
|
|
299
|
+
*
|
|
300
|
+
* Usage: In the TurboModule @implementation, include:
|
|
301
|
+
* `@synthesize moduleRegistry = _moduleRegistry`
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
if ([bridgeModule respondsToSelector:@selector(setModuleRegistry:)]) {
|
|
305
|
+
bridgeModule.moduleRegistry = _objCModuleRegistry;
|
|
306
|
+
}
|
|
290
307
|
}
|
|
291
308
|
|
|
292
309
|
- (std::shared_ptr<MessageQueueThread>)jsMessageThread
|
|
@@ -1129,7 +1146,7 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|
|
1129
1146
|
[self.devSettings setupHMRClientWithBundleURL:self.bundleURL];
|
|
1130
1147
|
}
|
|
1131
1148
|
|
|
1132
|
-
#if RCT_DEV_MENU
|
|
1149
|
+
#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY
|
|
1133
1150
|
- (void)loadAndExecuteSplitBundleURL:(NSURL *)bundleURL
|
|
1134
1151
|
onError:(RCTLoadAndExecuteErrorBlock)onError
|
|
1135
1152
|
onComplete:(dispatch_block_t)onComplete
|
|
@@ -131,9 +131,11 @@ using namespace facebook::react;
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
134
135
|
- (NSString *)description
|
|
135
136
|
{
|
|
136
137
|
return [NSString stringWithFormat:@"<%@: %p; name = %s>", [self class], self, self.JSMethodName];
|
|
137
138
|
}
|
|
139
|
+
#endif // TODO(macOS GH#774)
|
|
138
140
|
|
|
139
141
|
@end
|
|
@@ -110,9 +110,21 @@ static void sendEventToAllConnections(NSString *event)
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
NSString *key = [inspectorURL absoluteString];
|
|
113
|
+
// [TODO(macOS GH#774) - safety check to avoid a crash
|
|
114
|
+
if (key == nil) {
|
|
115
|
+
RCTLogError(@"failed to get inspector URL");
|
|
116
|
+
return nil;
|
|
117
|
+
}
|
|
118
|
+
// ]TODO(macOS GH#774)
|
|
113
119
|
RCTInspectorPackagerConnection *connection = socketConnections[key];
|
|
114
120
|
if (!connection || !connection.isConnected) {
|
|
115
121
|
connection = [[RCTInspectorPackagerConnection alloc] initWithURL:inspectorURL];
|
|
122
|
+
// [TODO(macOS GH#774) - safety check to avoid a crash
|
|
123
|
+
if (connection == nil) {
|
|
124
|
+
RCTLogError(@"failed to initialize RCTInspectorPackagerConnection");
|
|
125
|
+
return nil;
|
|
126
|
+
}
|
|
127
|
+
// ]TODO(macOS GH#774)
|
|
116
128
|
socketConnections[key] = connection;
|
|
117
129
|
[connection connect];
|
|
118
130
|
}
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
# LICENSE file in the root directory of this source tree.
|
|
5
5
|
|
|
6
6
|
require "json"
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
react_native_path = "../.."
|
|
9
|
+
require_relative "#{react_native_path}/scripts/react_native_pods.rb"
|
|
8
10
|
|
|
9
11
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json")))
|
|
10
12
|
version = package['version']
|
|
@@ -31,7 +33,7 @@ Pod::Spec.new do |s|
|
|
|
31
33
|
s.platforms = { :ios => "11.0", :osx => "10.15" } # TODO(macOS GH#774)
|
|
32
34
|
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
|
|
33
35
|
s.source = source
|
|
34
|
-
s.source_files = "
|
|
36
|
+
s.source_files = "**/FBReactNativeSpec*.{h,mm}"
|
|
35
37
|
s.header_dir = "FBReactNativeSpec"
|
|
36
38
|
|
|
37
39
|
s.pod_target_xcconfig = {
|
|
@@ -47,5 +49,11 @@ Pod::Spec.new do |s|
|
|
|
47
49
|
s.dependency "React-jsi", version
|
|
48
50
|
s.dependency "ReactCommon/turbomodule/core", version
|
|
49
51
|
|
|
50
|
-
use_react_native_codegen!
|
|
52
|
+
use_react_native_codegen!(s, {
|
|
53
|
+
:react_native_path => react_native_path,
|
|
54
|
+
:js_srcs_dir => "#{react_native_path}/Libraries",
|
|
55
|
+
:library_name => "FBReactNativeSpec",
|
|
56
|
+
:library_type => "modules",
|
|
57
|
+
:output_dir => "#{react_native_path}/React/FBReactNativeSpec/FBReactNativeSpec"
|
|
58
|
+
})
|
|
51
59
|
end
|
|
@@ -133,6 +133,15 @@ static void RCTSendPaperScrollEvent_DEPRECATED(UIScrollView *scrollView, NSInteg
|
|
|
133
133
|
[self.scrollViewDelegateSplitter removeAllDelegates];
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
- (void)layoutSubviews
|
|
137
|
+
{
|
|
138
|
+
[super layoutSubviews];
|
|
139
|
+
|
|
140
|
+
if (_subviewClippingEnabled) {
|
|
141
|
+
[self _remountChildren];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
136
145
|
- (RCTGenericDelegateSplitter<id<UIScrollViewDelegate>> *)scrollViewDelegateSplitter
|
|
137
146
|
{
|
|
138
147
|
return ((RCTEnhancedScrollView *)_scrollView).delegateSplitter;
|