react-native-macos 0.0.0-cfdd34990 → 0.0.0-d2f5a1ffb
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/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +25 -0
- package/Libraries/Animated/AnimatedEvent.js +23 -4
- package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +0 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/CheckBox/CheckBox.macos.js +8 -4
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
- package/Libraries/Components/Keyboard/Keyboard.js +2 -2
- package/Libraries/Components/ScrollView/ScrollView.js +8 -5
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
- package/Libraries/Components/Touchable/TouchableBounce.js +11 -22
- package/Libraries/Components/Touchable/TouchableHighlight.js +19 -30
- package/Libraries/Components/Touchable/TouchableOpacity.js +14 -29
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +8 -18
- package/Libraries/Components/View/ReactNativeViewAttributes.js +8 -7
- package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +1 -2
- package/Libraries/Components/View/View.js +8 -10
- package/Libraries/Components/View/ViewAccessibility.js +0 -1
- package/Libraries/Components/View/ViewPropTypes.js +1 -7
- package/Libraries/Core/ExceptionsManager.js +3 -1
- package/Libraries/Core/ReactNativeVersion.js +5 -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/Data/LogBoxData.js +18 -18
- 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/PlatformColorValueTypes.macos.js +16 -1
- package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +2 -0
- package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +8 -1
- package/Libraries/StyleSheet/normalizeColor.js +2 -2
- package/Libraries/Text/RawText/RCTRawTextShadowView.m +2 -0
- package/Libraries/Text/Text/RCTTextView.m +8 -4
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +10 -8
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +2 -0
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +15 -3
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +10 -1
- package/Libraries/Text/TextProps.js +1 -7
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
- package/Libraries/Types/RootTagTypes.js~merged +23 -0
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/Libraries/WebSocket/RCTSRWebSocket.m +23 -0
- package/README.md +18 -42
- 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 +2 -2
- package/React/Base/RCTBundleURLProvider.h +1 -1
- package/React/Base/RCTBundleURLProvider.mm +2 -2
- package/React/Base/RCTConvert.m +23 -6
- 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 +5 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +11 -0
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +35 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +1 -1
- package/React/Base/macOS/RCTPlatformDisplayLink.m +4 -1
- package/React/CoreModules/RCTActionSheetManager.mm +4 -0
- package/React/CoreModules/RCTAddressSanitizerCrashManager.h +12 -0
- package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +18 -0
- package/React/CoreModules/RCTAlertController.m +8 -4
- package/React/CoreModules/RCTAppearance.mm +5 -1
- package/React/CoreModules/RCTDevLoadingView.mm +14 -9
- 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/FBReactNativeSpec-generated.mm +2126 -0
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2682 -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/RCTEventEmitter.h +2 -2
- 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.h +5 -2
- package/React/Views/RCTView.m +22 -10
- package/React/Views/RCTViewManager.m +12 -17
- 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/React-Core.podspec +0 -11
- 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/ReactActivity.java +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +7 -0
- 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/devsupport/interfaces/BundleLoadCallback.java +3 -1
- 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/appearance/AppearanceModule.java +10 -1
- 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 +5 -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/java/com/facebook/react/views/textinput/ReactTextInputManager.java +0 -8
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +8 -8
- 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/jni/third-party/libevent/event-config.h +339 -339
- package/ReactAndroid/src/main/third-party/android/androidx/BUCK +6 -6
- package/ReactCommon/React-Fabric.podspec +9 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -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/jest/preprocessor.js +7 -75
- package/local-cli/cli.js +0 -0
- package/package.json +28 -22
- 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-xcode.sh +1 -1
- package/scripts/react_native_pods.rb +157 -38
- package/template/_flowconfig +1 -1
- package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/template/package.json +4 -2
- package/CHANGELOG.json +0 -500
- package/CHANGELOG.md +0 -240
- package/Libraries/.npmignore +0 -1
- 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/React/Base/macOS/RCTDynamicColor.h +0 -28
- package/React/Base/macOS/RCTDynamicColor.m +0 -217
- package/ReactAndroid/.npmignore +0 -5
- 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/ReactAndroid/src/main/jni/first-party/fbjni/.gitignore +0 -2
- package/ReactCommon/hermes/inspector/tools/msggen/.gitignore +0 -3
- package/scripts/generate-specs.sh +0 -99
- package/template/_editorconfig +0 -3
- package/template/_gitattributes +0 -3
|
@@ -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
|
|
|
@@ -62,7 +62,7 @@ RCT_NOT_IMPLEMENTED(-(nullable instancetype)initWithCoder : (NSCoder *)coder)
|
|
|
62
62
|
[self _updateViews];
|
|
63
63
|
|
|
64
64
|
// For backward compatibility with RCTRootView, set a color here instead of transparent (OS default).
|
|
65
|
-
self.backgroundColor = [RCTUIColor whiteColor];
|
|
65
|
+
self.backgroundColor = [RCTUIColor whiteColor]; // TODO(macOS GH#774)
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
return self;
|
|
@@ -50,7 +50,7 @@ static CVReturn RCTPlatformDisplayLinkCallBack(__unused CVDisplayLinkRef display
|
|
|
50
50
|
os_unfair_lock_lock(&rctDisplayLink->_lock);
|
|
51
51
|
if (rctDisplayLink->_runLoop != nil) {
|
|
52
52
|
CFRunLoopRef cfRunLoop = [rctDisplayLink->_runLoop getCFRunLoop];
|
|
53
|
-
CFRunLoopPerformBlock(cfRunLoop,
|
|
53
|
+
CFRunLoopPerformBlock(cfRunLoop, (__bridge CFArrayRef)rctDisplayLink->_modes, ^{
|
|
54
54
|
[rctDisplayLink tick];
|
|
55
55
|
});
|
|
56
56
|
CFRunLoopWakeUp(cfRunLoop);
|
|
@@ -71,14 +71,17 @@ static CVReturn RCTPlatformDisplayLinkCallBack(__unused CVDisplayLinkRef display
|
|
|
71
71
|
|
|
72
72
|
- (void)addToRunLoop:(NSRunLoop *)runloop forMode:(NSRunLoopMode)mode
|
|
73
73
|
{
|
|
74
|
+
os_unfair_lock_lock(&_lock);
|
|
74
75
|
_runLoop = runloop;
|
|
75
76
|
|
|
76
77
|
if (_displayLink != NULL) {
|
|
77
78
|
[_modes addObject:mode];
|
|
79
|
+
os_unfair_lock_unlock(&_lock);
|
|
78
80
|
return;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
_modes = @[mode].mutableCopy;
|
|
84
|
+
os_unfair_lock_unlock(&_lock);
|
|
82
85
|
CVReturn ret = CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink);
|
|
83
86
|
if (ret != kCVReturnSuccess) {
|
|
84
87
|
ret = CVDisplayLinkCreateWithCGDisplay(CGMainDisplayID(), &_displayLink);
|
|
@@ -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
|
{
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* This source code is licensed under the MIT license found in the
|
|
4
|
+
* LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#import <React/RCTUIKit.h>
|
|
8
|
+
#import <React/RCTBridge.h>
|
|
9
|
+
|
|
10
|
+
@interface RCTAddressSanitizerCrashManager : NSObject <RCTBridgeModule>
|
|
11
|
+
|
|
12
|
+
@end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RCTAddressSanitizerCrashManager.mm
|
|
3
|
+
// Pods
|
|
4
|
+
//
|
|
5
|
+
|
|
6
|
+
#import "RCTAddressSanitizerCrashManager.h"
|
|
7
|
+
|
|
8
|
+
@implementation RCTAddressSanitizerCrashManager
|
|
9
|
+
|
|
10
|
+
RCT_EXPORT_MODULE(ASANCrash)
|
|
11
|
+
|
|
12
|
+
RCT_EXPORT_METHOD(invokeMemoryCrash) {
|
|
13
|
+
char *s = (char*)malloc(100);
|
|
14
|
+
free(s);
|
|
15
|
+
strcpy(s, "Hello world!"); // AddressSanitizer: heap-use-after-free
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@end
|
|
@@ -32,12 +32,16 @@
|
|
|
32
32
|
|
|
33
33
|
- (void)show:(BOOL)animated completion:(void (^)(void))completion
|
|
34
34
|
{
|
|
35
|
-
[self.alertWindow makeKeyAndVisible];
|
|
36
|
-
|
|
37
35
|
// [TODO(macOS GH#774)
|
|
36
|
+
// Call self.alertWindow to ensure that it gets populated
|
|
37
|
+
UIWindow *alertWindow = self.alertWindow;
|
|
38
|
+
|
|
38
39
|
// If the window is tracked by our application then it will show the alert
|
|
39
|
-
if ([[[UIApplication sharedApplication] windows] containsObject:
|
|
40
|
-
|
|
40
|
+
if ([[[UIApplication sharedApplication] windows] containsObject:alertWindow]) {
|
|
41
|
+
// On iOS 14, makeKeyAndVisible should only be called if alertWindow is tracked by the application.
|
|
42
|
+
// Later versions of iOS appear to already do this check for us behind the scenes.
|
|
43
|
+
[alertWindow makeKeyAndVisible];
|
|
44
|
+
[alertWindow.rootViewController presentViewController:self animated:animated completion:completion];
|
|
41
45
|
} else {
|
|
42
46
|
// When using Scenes, we must present the alert from a view controller associated with a window in the Scene. A fresh window (i.e. _alertWindow) cannot show the alert.
|
|
43
47
|
[RCTPresentedViewController() presentViewController:self animated:animated completion:completion];
|
|
@@ -81,7 +81,11 @@ NSString *RCTColorSchemePreference(NSAppearance *appearance)
|
|
|
81
81
|
return RCTAppearanceColorSchemeLight;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
if (@available(macOS 11.0, *)) {
|
|
85
|
+
appearance = appearance ?: [NSAppearance currentDrawingAppearance];
|
|
86
|
+
} else {
|
|
87
|
+
appearance = appearance ?: [NSAppearance currentAppearance];
|
|
88
|
+
}
|
|
85
89
|
NSAppearanceName appearanceName = [appearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
|
|
86
90
|
return appearances[appearanceName] ?: RCTAppearanceColorSchemeLight;
|
|
87
91
|
}
|
|
@@ -266,16 +266,21 @@ RCT_EXPORT_METHOD(hide)
|
|
|
266
266
|
|
|
267
267
|
- (void)showOfflineMessage
|
|
268
268
|
{
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
269
|
+
// [TODO(macOS GH#774) - isDarkModeEnabled should only be run on the main thread
|
|
270
|
+
__weak __typeof(self) weakSelf = self;
|
|
271
|
+
RCTExecuteOnMainQueue(^{
|
|
272
|
+
RCTUIColor *color = [RCTUIColor whiteColor]; // TODO(macOS GH#774)
|
|
273
|
+
RCTUIColor *backgroundColor = [RCTUIColor blackColor]; // TODO(macOS GH#774)
|
|
274
|
+
|
|
275
|
+
if ([weakSelf isDarkModeEnabled]) {
|
|
276
|
+
color = [RCTUIColor blackColor]; // TODO(macOS GH#774)
|
|
277
|
+
backgroundColor = [RCTUIColor whiteColor]; // TODO(macOS GH#774)
|
|
278
|
+
}
|
|
276
279
|
|
|
277
|
-
|
|
278
|
-
|
|
280
|
+
NSString *message = [NSString stringWithFormat:@"Connect to %@ to develop JavaScript.", RCT_PACKAGER_NAME];
|
|
281
|
+
[weakSelf showMessage:message color:color backgroundColor:backgroundColor];
|
|
282
|
+
});
|
|
283
|
+
// ]TODO(macOS GH#774)
|
|
279
284
|
}
|
|
280
285
|
|
|
281
286
|
- (BOOL)isDarkModeEnabled
|
|
@@ -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
|
}
|