react-native-macos 0.0.0-cf2105fa4 → 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/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/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/ViewPropTypes.js +1 -7
- 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/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 +7 -9
- 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/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 +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +11 -0
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +35 -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/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.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.h +5 -2
- package/React/Views/RCTView.m +22 -10
- package/React/Views/RCTViewManager.m +12 -16
- 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 +23 -15
- 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/React/Base/macOS/RCTDynamicColor.h +0 -28
- package/React/Base/macOS/RCTDynamicColor.m +0 -217
- 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
|
@@ -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
|
|
@@ -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
|
}
|
|
@@ -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;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#import <better/map.h>
|
|
11
11
|
|
|
12
12
|
#import <React/RCTAssert.h>
|
|
13
|
+
#import <React/RCTComponent.h>
|
|
13
14
|
#import <React/RCTFollyConvert.h>
|
|
14
15
|
#import <React/RCTLog.h>
|
|
15
16
|
#import <React/RCTUtils.h>
|
|
@@ -26,6 +27,18 @@
|
|
|
26
27
|
|
|
27
28
|
using namespace facebook::react;
|
|
28
29
|
|
|
30
|
+
static SurfaceId RCTSurfaceIdForView(UIView *view)
|
|
31
|
+
{
|
|
32
|
+
do {
|
|
33
|
+
if (RCTIsReactRootView(@(view.tag))) {
|
|
34
|
+
return view.tag;
|
|
35
|
+
}
|
|
36
|
+
view = view.superview;
|
|
37
|
+
} while (view != nil);
|
|
38
|
+
|
|
39
|
+
return -1;
|
|
40
|
+
}
|
|
41
|
+
|
|
29
42
|
static void RCTPerformMountInstructions(
|
|
30
43
|
ShadowViewMutationList const &mutations,
|
|
31
44
|
RCTComponentViewRegistry *registry,
|
|
@@ -282,9 +295,10 @@ static void RCTPerformMountInstructions(
|
|
|
282
295
|
{
|
|
283
296
|
RCTAssertMainQueue();
|
|
284
297
|
UIView<RCTComponentViewProtocol> *componentView = [_componentViewRegistry findComponentViewWithTag:reactTag];
|
|
298
|
+
SurfaceId surfaceId = RCTSurfaceIdForView(componentView);
|
|
285
299
|
SharedProps oldProps = [componentView props];
|
|
286
300
|
SharedProps newProps = componentDescriptor.cloneProps(
|
|
287
|
-
PropsParserContext{
|
|
301
|
+
PropsParserContext{surfaceId, *_contextContainer.get()}, oldProps, RawProps(convertIdToFollyDynamic(props)));
|
|
288
302
|
|
|
289
303
|
NSSet<NSString *> *propKeys = componentView.propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN ?: [NSSet new];
|
|
290
304
|
propKeys = [propKeys setByAddingObjectsFromArray:props.allKeys];
|
|
@@ -110,7 +110,6 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
|
|
|
110
110
|
std::shared_ptr<SchedulerDelegateProxy> _delegateProxy;
|
|
111
111
|
std::shared_ptr<LayoutAnimationDelegateProxy> _layoutAnimationDelegateProxy;
|
|
112
112
|
RunLoopObserver::Unique _uiRunLoopObserver;
|
|
113
|
-
BOOL _layoutAnimationsEnabled;
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
- (instancetype)initWithToolbox:(SchedulerToolbox)toolbox
|
|
@@ -118,14 +117,22 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
|
|
|
118
117
|
if (self = [super init]) {
|
|
119
118
|
auto reactNativeConfig =
|
|
120
119
|
toolbox.contextContainer->at<std::shared_ptr<const ReactNativeConfig>>("ReactNativeConfig");
|
|
121
|
-
_layoutAnimationsEnabled = reactNativeConfig->getBool("react_fabric:enabled_layout_animations_ios");
|
|
122
120
|
|
|
123
121
|
_delegateProxy = std::make_shared<SchedulerDelegateProxy>((__bridge void *)self);
|
|
124
122
|
|
|
125
|
-
if (
|
|
123
|
+
if (reactNativeConfig->getBool("react_fabric:enabled_layout_animations_ios")) {
|
|
126
124
|
_layoutAnimationDelegateProxy = std::make_shared<LayoutAnimationDelegateProxy>((__bridge void *)self);
|
|
127
125
|
_animationDriver =
|
|
128
126
|
std::make_shared<LayoutAnimationDriver>(toolbox.runtimeExecutor, _layoutAnimationDelegateProxy.get());
|
|
127
|
+
if (reactNativeConfig->getBool("react_fabric:enabled_skip_invalidated_key_frames_ios")) {
|
|
128
|
+
_animationDriver->enableSkipInvalidatedKeyFrames();
|
|
129
|
+
}
|
|
130
|
+
if (reactNativeConfig->getBool("react_fabric:enable_crash_on_missing_component_descriptor")) {
|
|
131
|
+
_animationDriver->enableCrashOnMissingComponentDescriptor();
|
|
132
|
+
}
|
|
133
|
+
if (reactNativeConfig->getBool("react_fabric:enable_simulate_image_props_memory_access")) {
|
|
134
|
+
_animationDriver->enableSimulateImagePropsMemoryAccess();
|
|
135
|
+
}
|
|
129
136
|
_uiRunLoopObserver =
|
|
130
137
|
toolbox.mainRunLoopObserverFactory(RunLoopObserver::Activity::BeforeWaiting, _layoutAnimationDelegateProxy);
|
|
131
138
|
_uiRunLoopObserver->setDelegate(_layoutAnimationDelegateProxy.get());
|
|
@@ -190,6 +190,7 @@ static NSString *CAMediaTimingFunctionNameFromRCTAnimationType(RCTAnimationType
|
|
|
190
190
|
_animationType == animation.animationType;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
193
194
|
- (NSString *)description
|
|
194
195
|
{
|
|
195
196
|
return [NSString
|
|
@@ -204,5 +205,6 @@ static NSString *CAMediaTimingFunctionNameFromRCTAnimationType(RCTAnimationType
|
|
|
204
205
|
_initialVelocity,
|
|
205
206
|
(long)_animationType];
|
|
206
207
|
}
|
|
208
|
+
#endif // TODO(macOS GH#774)
|
|
207
209
|
|
|
208
210
|
@end
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
[_deletingLayoutAnimation isEqual:deletingLayoutAnimation]);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
#if DEBUG // TODO(macOS GH#774) description is a debug-only feature
|
|
67
68
|
- (NSString *)description
|
|
68
69
|
{
|
|
69
70
|
return
|
|
@@ -75,5 +76,6 @@
|
|
|
75
76
|
[_updatingLayoutAnimation description],
|
|
76
77
|
[_deletingLayoutAnimation description]];
|
|
77
78
|
}
|
|
79
|
+
#endif // TODO(macOS GH#774)
|
|
78
80
|
|
|
79
81
|
@end
|
|
@@ -1501,6 +1501,7 @@ RCT_EXPORT_METHOD(clearJSResponder)
|
|
|
1501
1501
|
static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
|
|
1502
1502
|
NSMutableDictionary<NSString *, NSDictionary *> *directEvents,
|
|
1503
1503
|
NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents,
|
|
1504
|
+
NSMutableDictionary<NSString *, NSString *> *registrationCache, // TODO(macOS GH#774)
|
|
1504
1505
|
RCTComponentData *componentData)
|
|
1505
1506
|
{
|
|
1506
1507
|
NSMutableDictionary<NSString *, id> *moduleConstants = [NSMutableDictionary new];
|
|
@@ -1520,6 +1521,8 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
|
|
|
1520
1521
|
moduleConstants[@"bubblingEventTypes"] = bubblingEventTypes;
|
|
1521
1522
|
moduleConstants[@"directEventTypes"] = directEventTypes;
|
|
1522
1523
|
|
|
1524
|
+
NSString *componentName = [componentData name]; // TODO(macOS GH#774)
|
|
1525
|
+
|
|
1523
1526
|
// Add direct events
|
|
1524
1527
|
for (NSString *eventName in viewConfig[@"directEvents"]) {
|
|
1525
1528
|
if (!directEvents[eventName]) {
|
|
@@ -1530,11 +1533,13 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
|
|
|
1530
1533
|
directEventTypes[eventName] = directEvents[eventName];
|
|
1531
1534
|
if (RCT_DEBUG && bubblingEvents[eventName]) {
|
|
1532
1535
|
RCTLogError(
|
|
1533
|
-
@"Component '%@' re-registered bubbling event '%@' as a "
|
|
1536
|
+
@"Component '%@' re-registered bubbling event '%@' (originally registered by '%@') as a "
|
|
1534
1537
|
"direct event",
|
|
1535
|
-
|
|
1536
|
-
eventName
|
|
1538
|
+
componentName,
|
|
1539
|
+
eventName,
|
|
1540
|
+
registrationCache[eventName] ?: @"<unknown>"); // TODO(macOS GH#774)
|
|
1537
1541
|
}
|
|
1542
|
+
registrationCache[eventName] = componentName; // TODO(macOS GH#774)
|
|
1538
1543
|
}
|
|
1539
1544
|
|
|
1540
1545
|
// Add bubbling events
|
|
@@ -1551,11 +1556,13 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
|
|
|
1551
1556
|
bubblingEventTypes[eventName] = bubblingEvents[eventName];
|
|
1552
1557
|
if (RCT_DEBUG && directEvents[eventName]) {
|
|
1553
1558
|
RCTLogError(
|
|
1554
|
-
@"Component '%@' re-registered direct event '%@' as a "
|
|
1559
|
+
@"Component '%@' re-registered direct event '%@' (originally registered by '%@') as a "
|
|
1555
1560
|
"bubbling event",
|
|
1556
|
-
|
|
1557
|
-
eventName
|
|
1561
|
+
componentName,
|
|
1562
|
+
eventName,
|
|
1563
|
+
registrationCache[eventName] ?: @"<unknown>"); // TODO(macOS GH#774)
|
|
1558
1564
|
}
|
|
1565
|
+
registrationCache[eventName] = componentName; // TODO(macOS GH#774)
|
|
1559
1566
|
}
|
|
1560
1567
|
|
|
1561
1568
|
return moduleConstants;
|
|
@@ -1571,12 +1578,13 @@ static NSMutableDictionary<NSString *, id> *moduleConstantsForComponent(
|
|
|
1571
1578
|
NSMutableDictionary<NSString *, NSDictionary *> *constants = [NSMutableDictionary new];
|
|
1572
1579
|
NSMutableDictionary<NSString *, NSDictionary *> *directEvents = [NSMutableDictionary new];
|
|
1573
1580
|
NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents = [NSMutableDictionary new];
|
|
1581
|
+
NSMutableDictionary<NSString *, NSString *> *registrationCache = [NSMutableDictionary new]; // TODO(macOS GH#774)
|
|
1574
1582
|
|
|
1575
1583
|
[_componentDataByName
|
|
1576
1584
|
enumerateKeysAndObjectsUsingBlock:^(NSString *name, RCTComponentData *componentData, __unused BOOL *stop) {
|
|
1577
1585
|
RCTAssert(!constants[name], @"UIManager already has constants for %@", componentData.name);
|
|
1578
1586
|
NSMutableDictionary<NSString *, id> *moduleConstants =
|
|
1579
|
-
moduleConstantsForComponent(directEvents, bubblingEvents, componentData);
|
|
1587
|
+
moduleConstantsForComponent(directEvents, bubblingEvents, registrationCache, componentData); // TODO(macOS GH#774)
|
|
1580
1588
|
constants[name] = moduleConstants;
|
|
1581
1589
|
}];
|
|
1582
1590
|
|
|
@@ -1621,10 +1629,11 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(lazilyLoadView : (NSString *)name)
|
|
|
1621
1629
|
bridge:self.bridge
|
|
1622
1630
|
eventDispatcher:self.bridge.eventDispatcher];
|
|
1623
1631
|
_componentDataByName[componentData.name] = componentData;
|
|
1624
|
-
NSMutableDictionary *directEvents = [NSMutableDictionary new];
|
|
1625
|
-
NSMutableDictionary *bubblingEvents = [NSMutableDictionary new];
|
|
1632
|
+
NSMutableDictionary<NSString *, NSDictionary *> *directEvents = [NSMutableDictionary new];
|
|
1633
|
+
NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents = [NSMutableDictionary new];
|
|
1634
|
+
NSMutableDictionary<NSString *, NSString *> *registrationCache = [NSMutableDictionary new]; // TODO(macOS GH#774)
|
|
1626
1635
|
NSMutableDictionary<NSString *, id> *moduleConstants =
|
|
1627
|
-
moduleConstantsForComponent(directEvents, bubblingEvents, componentData);
|
|
1636
|
+
moduleConstantsForComponent(directEvents, bubblingEvents, registrationCache, componentData); // TODO(macOS GH#774)
|
|
1628
1637
|
return @{
|
|
1629
1638
|
@"viewConfig" : moduleConstants,
|
|
1630
1639
|
};
|