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
|
@@ -66,13 +66,7 @@ export type TextProps = $ReadOnly<{|
|
|
|
66
66
|
* Set hyphenation strategy on Android.
|
|
67
67
|
*
|
|
68
68
|
*/
|
|
69
|
-
android_hyphenationFrequency?: ?(
|
|
70
|
-
| 'normal'
|
|
71
|
-
| 'none'
|
|
72
|
-
| 'full'
|
|
73
|
-
| 'high'
|
|
74
|
-
| 'balanced'
|
|
75
|
-
),
|
|
69
|
+
android_hyphenationFrequency?: ?('normal' | 'none' | 'full'),
|
|
76
70
|
children?: ?Node,
|
|
77
71
|
|
|
78
72
|
/**
|
|
@@ -16,7 +16,7 @@ const turboModuleProxy = global.__turboModuleProxy;
|
|
|
16
16
|
|
|
17
17
|
function requireModule<T: TurboModule>(name: string): ?T {
|
|
18
18
|
// Bridgeless mode requires TurboModules
|
|
19
|
-
if (
|
|
19
|
+
if (global.RN$Bridgeless !== true) {
|
|
20
20
|
// Backward compatibility layer during migration.
|
|
21
21
|
const legacyModule = NativeModules[name];
|
|
22
22
|
if (legacyModule != null) {
|
|
@@ -119,7 +119,7 @@ const HMRClient: HMRClientNativeInterface = {
|
|
|
119
119
|
JSON.stringify({
|
|
120
120
|
type: 'log',
|
|
121
121
|
level,
|
|
122
|
-
mode: global.RN$Bridgeless ? 'NOBRIDGE' : 'BRIDGE',
|
|
122
|
+
mode: global.RN$Bridgeless === true ? 'NOBRIDGE' : 'BRIDGE',
|
|
123
123
|
data: data.map(item =>
|
|
124
124
|
typeof item === 'string'
|
|
125
125
|
? item
|
|
@@ -540,10 +540,33 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
|
|
540
540
|
// ]TODO(macOS ISS#2323203)
|
|
541
541
|
}
|
|
542
542
|
|
|
543
|
+
// [TODO(macOS GH#774)
|
|
544
|
+
// We've seen a rare ASan crash where _inputStream seems to be invalid. This is just a safety check.
|
|
545
|
+
#if DEBUG
|
|
546
|
+
[self _validateStream:_outputStream name:@"_outputStream"];
|
|
547
|
+
[self _validateStream:_inputStream name:@"_inputStream"];
|
|
548
|
+
#endif
|
|
549
|
+
// ]TODO(macOS GH#774)
|
|
550
|
+
|
|
543
551
|
[_outputStream open];
|
|
544
552
|
[_inputStream open];
|
|
545
553
|
}
|
|
546
554
|
|
|
555
|
+
// [TODO(macOS GH#774)
|
|
556
|
+
#if DEBUG
|
|
557
|
+
- (void)_validateStream:(NSStream *)stream name:(NSString *)name {
|
|
558
|
+
NSStreamStatus status = stream.streamStatus;
|
|
559
|
+
if (status != NSStreamStatusNotOpen) {
|
|
560
|
+
RCTLogWarn(@"%@ was already opened, why are we opening it again? status=%@", name, @(status));
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
if (stream.delegate == nil) {
|
|
564
|
+
RCTLogError(@"%@'s delegate is nil, did we clean it up too early?", name);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
#endif
|
|
568
|
+
// ]TODO(macOS GH#774)
|
|
569
|
+
|
|
547
570
|
- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode
|
|
548
571
|
{
|
|
549
572
|
[_outputStream scheduleInRunLoop:aRunLoop forMode:mode];
|
package/README.md
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
</a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
> See the official [React Native website](https://reactnative.dev/) for an introduction to React Native.
|
|
19
|
+
> See the official [React Native website](https://reactnative.dev/) for an introduction to React Native.
|
|
20
20
|
|
|
21
21
|
[React Native](https://reactnative.dev) is a framework developed by Facebook that enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and [React](https://reactjs.org/). The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere.
|
|
22
22
|
|
|
23
|
-
This repository is a working fork of **facebook/react-native** that adds support for the official React Native for macOS implementation from Microsoft.
|
|
23
|
+
This repository is a working fork of **facebook/react-native** that adds support for the official React Native for macOS implementation from Microsoft.
|
|
24
24
|
|
|
25
25
|
[hello-world]: https://snack.expo.io/@hramos/hello,-world!
|
|
26
26
|
[new-app]: https://reactnative.dev/docs/getting-started
|
|
@@ -28,38 +28,6 @@ This repository is a working fork of **facebook/react-native** that adds support
|
|
|
28
28
|
|
|
29
29
|
You can read more about the macOS implementation in our website - [React Native for Windows + macOS](https://microsoft.github.io/react-native-windows/)
|
|
30
30
|
|
|
31
|
-
The full documentation for React Native can be found on our [website][docs].
|
|
32
|
-
|
|
33
|
-
The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the [React documentation][r-docs].
|
|
34
|
-
|
|
35
|
-
The source for the React Native documentation and website is hosted on a separate repo, [**@facebook/react-native-website**][repo-website].
|
|
36
|
-
|
|
37
|
-
[docs]: https://reactnative.dev/docs/getting-started
|
|
38
|
-
[r-docs]: https://reactjs.org/docs/getting-started.html
|
|
39
|
-
[repo-website]: https://github.com/facebook/react-native-website
|
|
40
|
-
|
|
41
|
-
## 🚀 Upgrading
|
|
42
|
-
|
|
43
|
-
Upgrading to new versions of React Native may give you access to more APIs, views, developer tools, and other goodies. See the [Upgrading Guide][u] for instructions.
|
|
44
|
-
|
|
45
|
-
React Native releases are discussed in the React Native Community, [**@react-native-community/react-native-releases**][repo-releases].
|
|
46
|
-
|
|
47
|
-
[u]: https://reactnative.dev/docs/upgrading
|
|
48
|
-
[repo-releases]: https://github.com/react-native-community/react-native-releases
|
|
49
|
-
|
|
50
|
-
## 👏 How to Contribute
|
|
51
|
-
|
|
52
|
-
You can read more about the macOS implementation on our website - [React Native for Windows + macOS](https://microsoft.github.io/react-native-windows/)
|
|
53
|
-
|
|
54
|
-
## Contents
|
|
55
|
-
|
|
56
|
-
- [Requirements](#requirements)
|
|
57
|
-
- [Getting Started](#getting-started)
|
|
58
|
-
- [Contributing](#contributing)
|
|
59
|
-
- [Documentation](#documentation)
|
|
60
|
-
- [License](#license)
|
|
61
|
-
- [Code of Conduct](#code-of-conduct)
|
|
62
|
-
|
|
63
31
|
## Requirements
|
|
64
32
|
|
|
65
33
|
You can run React Native for macOS apps on Mac devices with versions Catalina (10.15) or newer.
|
|
@@ -67,30 +35,37 @@ You can run React Native for macOS apps on Mac devices with versions Catalina (1
|
|
|
67
35
|
For a full and detailed list of the system requirements and how to set up your development platform, see our [System Requirements](https://microsoft.github.io/react-native-windows/docs/rnm-dependencies) documentation on our website.
|
|
68
36
|
|
|
69
37
|
## Getting Started
|
|
38
|
+
|
|
70
39
|
See the [Getting Started Guide](https://microsoft.github.io/react-native-windows/docs/rnm-getting-started) on our React Native for Windows + macOS website to build your first React Native for macOS app.
|
|
71
40
|
|
|
72
41
|
### Logging Issues
|
|
42
|
+
|
|
73
43
|
Search the [existing issues](https://github.com/microsoft/react-native-macos/issues) and try to make sure your problem doesn’t already exist before opening a new issue. If your issue doesn't exist yet, try to make sure you provide as much information as possible to us so we can help you sooner. It’s helpful if you include information like:
|
|
74
44
|
|
|
75
45
|
- The version of macOS, React Native, React Native macOS extension where you ran into the issue.
|
|
76
46
|
- A stack trace and reduced repro case when possible.
|
|
77
47
|
- Ensure the [appropriate template](https://github.com/microsoft/react-native-macos/issues/new/choose) is used when filing your issue(s).
|
|
78
48
|
|
|
79
|
-
##
|
|
49
|
+
## Contributing
|
|
50
|
+
|
|
80
51
|
See [Contributing guidelines](https://github.com/microsoft/react-native-macos/blob/master/CONTRIBUTING.md) for how to set up your fork of the repo and start a PR to contribute to React Native for macOS.
|
|
81
52
|
|
|
82
53
|
[Good First Issue](https://github.com/microsoft/react-native-macos/labels/good%20first%20issue) and [help wanted](https://github.com/microsoft/react-native-macos/labels/help%20wanted) are great starting points for PRs.
|
|
83
54
|
|
|
84
55
|
## Documentation
|
|
85
|
-
|
|
56
|
+
|
|
57
|
+
The full documentation for React Native can be found on the [documentation website][docs]. The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the [React documentation][r-docs].
|
|
58
|
+
|
|
59
|
+
The source for the React Native documentation and website is hosted on a separate repo, [**@facebook/react-native-website**][repo-website].
|
|
86
60
|
|
|
87
61
|
[React Native for Windows + macOS](https://microsoft.github.io/react-native-windows/) has its own separate documentation site where Windows and macOS
|
|
88
|
-
specific information, like API docs and blog updates live. We are
|
|
62
|
+
specific information, like API docs and blog updates live. We are still working on the documentation for macOS, contributions are welcome!
|
|
63
|
+
|
|
64
|
+
If you're looking for sample code, just browse the [RNTester folder](https://github.com/microsoft/react-native-macos/tree/master/packages/rn-tester) for examples
|
|
89
65
|
|
|
90
|
-
###
|
|
66
|
+
### Git flow and syncing with upstream
|
|
91
67
|
|
|
92
|
-
|
|
93
|
-
- If you're looking for sample code, just browse the [RNTester folder](https://github.com/microsoft/react-native-macos/tree/master/packages/rn-tester) for examples
|
|
68
|
+
For more details on how this fork handles keeping up with upstream, and how the general git flow works, check out [this dedicated document](./docs/GitFlow.md).
|
|
94
69
|
|
|
95
70
|
## License
|
|
96
71
|
|
|
@@ -100,5 +75,6 @@ The React Native for macOS extension, including modifications to the original Fa
|
|
|
100
75
|
|
|
101
76
|
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
102
77
|
|
|
103
|
-
[
|
|
104
|
-
[
|
|
78
|
+
[docs]: https://reactnative.dev/docs/getting-started
|
|
79
|
+
[r-docs]: https://reactjs.org/docs/getting-started.html
|
|
80
|
+
[repo-website]: https://github.com/facebook/react-native-website
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#import <React/RCTBridge.h>
|
|
9
9
|
|
|
10
|
+
@class RCTModuleRegistry;
|
|
10
11
|
@class RCTModuleData;
|
|
11
12
|
@protocol RCTJavaScriptExecutor;
|
|
12
13
|
|
|
@@ -62,6 +63,13 @@ RCT_EXTERN void RCTRegisterModule(Class);
|
|
|
62
63
|
*/
|
|
63
64
|
@property (nonatomic, strong, readwrite) NSURL *bundleURL;
|
|
64
65
|
|
|
66
|
+
/**
|
|
67
|
+
* An object that allows one to require NativeModules/TurboModules.
|
|
68
|
+
* RCTModuleRegistry is implemented in bridgeless mode and bridge mode.
|
|
69
|
+
* Used by RCTRootView.
|
|
70
|
+
*/
|
|
71
|
+
@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry;
|
|
72
|
+
|
|
65
73
|
@end
|
|
66
74
|
|
|
67
75
|
@interface RCTBridge (RCTCxxBridge)
|
package/React/Base/RCTBridge.h
CHANGED
|
@@ -160,6 +160,10 @@ RCT_EXTERN void RCTEnableTurboModuleEagerInit(BOOL enabled);
|
|
|
160
160
|
RCT_EXTERN BOOL RCTTurboModuleSharedMutexInitEnabled(void);
|
|
161
161
|
RCT_EXTERN void RCTEnableTurboModuleSharedMutexInit(BOOL enabled);
|
|
162
162
|
|
|
163
|
+
// Turn off TurboModule delegate locking
|
|
164
|
+
RCT_EXTERN BOOL RCTTurboModuleManagerDelegateLockingDisabled(void);
|
|
165
|
+
RCT_EXTERN void RCTDisableTurboModuleManagerDelegateLocking(BOOL enabled);
|
|
166
|
+
|
|
163
167
|
typedef enum {
|
|
164
168
|
kRCTGlobalScope,
|
|
165
169
|
kRCTGlobalScopeUsingRetainJSCallback,
|
package/React/Base/RCTBridge.m
CHANGED
|
@@ -150,6 +150,18 @@ void RCTSetTurboModuleCleanupMode(RCTTurboModuleCleanupMode mode)
|
|
|
150
150
|
turboModuleCleanupMode = mode;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
// Turn off TurboModule delegate locking
|
|
154
|
+
static BOOL turboModuleManagerDelegateLockingDisabled = YES;
|
|
155
|
+
BOOL RCTTurboModuleManagerDelegateLockingDisabled(void)
|
|
156
|
+
{
|
|
157
|
+
return turboModuleManagerDelegateLockingDisabled;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
void RCTDisableTurboModuleManagerDelegateLocking(BOOL disabled)
|
|
161
|
+
{
|
|
162
|
+
turboModuleManagerDelegateLockingDisabled = disabled;
|
|
163
|
+
}
|
|
164
|
+
|
|
153
165
|
@interface RCTBridge () <RCTReloadListener>
|
|
154
166
|
@end
|
|
155
167
|
|
|
@@ -258,6 +270,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
|
258
270
|
});
|
|
259
271
|
}
|
|
260
272
|
|
|
273
|
+
- (RCTModuleRegistry *)moduleRegistry
|
|
274
|
+
{
|
|
275
|
+
return self.batchedBridge.moduleRegistry;
|
|
276
|
+
}
|
|
277
|
+
|
|
261
278
|
- (NSArray<Class> *)moduleClasses
|
|
262
279
|
{
|
|
263
280
|
return self.batchedBridge.moduleClasses;
|
|
@@ -124,7 +124,7 @@ RCT_EXTERN_C_END
|
|
|
124
124
|
* moduleRegistry = _moduleRegistry;`. If using Swift, add
|
|
125
125
|
* `@objc var moduleRegistry: RCTModuleRegistry!` to your module.
|
|
126
126
|
*/
|
|
127
|
-
@property (nonatomic, weak,
|
|
127
|
+
@property (nonatomic, weak, readwrite) RCTModuleRegistry *moduleRegistry;
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* A reference to the RCTViewRegistry. Useful for modules that query UIViews,
|
|
@@ -441,7 +441,7 @@ typedef NSURL * (^RCTBridgelessBundleURLGetter)(void);
|
|
|
441
441
|
andSetter:(RCTBridgelessBundleURLSetter)setter
|
|
442
442
|
andDefaultGetter:(RCTBridgelessBundleURLGetter)defaultGetter;
|
|
443
443
|
- (void)resetBundleURL;
|
|
444
|
-
@property NSURL *bundleURL;
|
|
444
|
+
@property (strong) NSURL *bundleURL; // TODO(macOS GH#774)
|
|
445
445
|
@end
|
|
446
446
|
|
|
447
447
|
typedef RCTPlatformView * (^RCTBridgelessComponentViewProvider)(NSNumber *); // TODO(macOS GH#774)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
RCT_EXTERN NSString *const RCTBundleURLProviderUpdatedNotification;
|
|
13
13
|
RCT_EXTERN const NSUInteger kRCTBundleURLProviderDefaultPort;
|
|
14
14
|
|
|
15
|
-
#if RCT_DEV_MENU
|
|
15
|
+
#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY
|
|
16
16
|
/**
|
|
17
17
|
* Allow/disallow accessing the packager server for various runtime scenario.
|
|
18
18
|
* For instance, if a test run should never access the packager, disable it
|
|
@@ -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
|
@@ -16,10 +16,6 @@
|
|
|
16
16
|
#import "RCTParserUtils.h"
|
|
17
17
|
#import "RCTUtils.h"
|
|
18
18
|
|
|
19
|
-
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
20
|
-
#import "RCTDynamicColor.h"
|
|
21
|
-
#endif // ]TODO(macOS GH#774)
|
|
22
|
-
|
|
23
19
|
@implementation RCTConvert
|
|
24
20
|
|
|
25
21
|
RCT_CONVERTER(id, id, self)
|
|
@@ -1043,7 +1039,28 @@ static NSColor *RCTColorWithSystemEffect(NSColor* color, NSString *systemEffectS
|
|
|
1043
1039
|
RCTUIColor *highContrastDarkColor = [RCTConvert UIColor:highContrastDark]; // TODO(macOS GH#750)
|
|
1044
1040
|
if (lightColor != nil && darkColor != nil) {
|
|
1045
1041
|
#if TARGET_OS_OSX
|
|
1046
|
-
|
|
1042
|
+
NSColor *color = [NSColor colorWithName:nil dynamicProvider:^NSColor * _Nonnull(NSAppearance * _Nonnull appearance) {
|
|
1043
|
+
NSMutableArray<NSAppearanceName> *appearances = [NSMutableArray arrayWithArray:@[NSAppearanceNameAqua,NSAppearanceNameDarkAqua]];
|
|
1044
|
+
if (highContrastLightColor != nil) {
|
|
1045
|
+
[appearances addObject:NSAppearanceNameAccessibilityHighContrastAqua];
|
|
1046
|
+
}
|
|
1047
|
+
if (highContrastDarkColor != nil) {
|
|
1048
|
+
[appearances addObject:NSAppearanceNameAccessibilityHighContrastDarkAqua];
|
|
1049
|
+
}
|
|
1050
|
+
NSAppearanceName bestMatchingAppearance = [appearance bestMatchFromAppearancesWithNames:appearances];
|
|
1051
|
+
if (bestMatchingAppearance == NSAppearanceNameAqua) {
|
|
1052
|
+
return lightColor;
|
|
1053
|
+
} else if (bestMatchingAppearance == NSAppearanceNameDarkAqua) {
|
|
1054
|
+
return darkColor;
|
|
1055
|
+
} else if (bestMatchingAppearance == NSAppearanceNameAccessibilityHighContrastAqua) {
|
|
1056
|
+
return highContrastLightColor;
|
|
1057
|
+
} else if (bestMatchingAppearance == NSAppearanceNameAccessibilityHighContrastDarkAqua) {
|
|
1058
|
+
return highContrastDarkColor;
|
|
1059
|
+
} else {
|
|
1060
|
+
RCTLogConvertError(json, @"an NSColorColor. Could not resolve current appearance. Defaulting to light.");
|
|
1061
|
+
return lightColor;
|
|
1062
|
+
}
|
|
1063
|
+
}];
|
|
1047
1064
|
return color;
|
|
1048
1065
|
#else
|
|
1049
1066
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
|
|
@@ -1406,7 +1423,7 @@ RCT_ENUM_CONVERTER(
|
|
|
1406
1423
|
@"link": NSAccessibilityLinkRole, // also a legacy iOS accessibilityTraits
|
|
1407
1424
|
@"menu": NSAccessibilityMenuRole,
|
|
1408
1425
|
@"menubar": NSAccessibilityMenuBarRole,
|
|
1409
|
-
@"menuitem":
|
|
1426
|
+
@"menuitem": NSAccessibilityMenuItemRole,
|
|
1410
1427
|
@"none": NSAccessibilityUnknownRole,
|
|
1411
1428
|
@"progressbar": NSAccessibilityProgressIndicatorRole,
|
|
1412
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
|
|