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.
Files changed (275) hide show
  1. package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +25 -0
  2. package/Libraries/Animated/AnimatedEvent.js +23 -4
  3. package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
  4. package/Libraries/Animated/nodes/AnimatedValue.js +0 -1
  5. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +22 -12
  6. package/Libraries/Components/Button.js +1 -1
  7. package/Libraries/Components/CheckBox/CheckBox.macos.js +8 -4
  8. package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
  9. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
  10. package/Libraries/Components/Keyboard/Keyboard.js +2 -2
  11. package/Libraries/Components/ScrollView/ScrollView.js +8 -5
  12. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
  13. package/Libraries/Components/Touchable/TouchableBounce.js +11 -22
  14. package/Libraries/Components/Touchable/TouchableHighlight.js +19 -30
  15. package/Libraries/Components/Touchable/TouchableOpacity.js +14 -29
  16. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +8 -18
  17. package/Libraries/Components/View/ReactNativeViewAttributes.js +8 -7
  18. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +1 -2
  19. package/Libraries/Components/View/View.js +8 -10
  20. package/Libraries/Components/View/ViewAccessibility.js +0 -1
  21. package/Libraries/Components/View/ViewPropTypes.js +1 -7
  22. package/Libraries/Core/ExceptionsManager.js +3 -1
  23. package/Libraries/Core/ReactNativeVersion.js +5 -1
  24. package/Libraries/Core/setUpBatchedBridge.js +1 -1
  25. package/Libraries/Core/setUpGlobals.js +2 -0
  26. package/Libraries/Core/setUpTimers.js +2 -2
  27. package/Libraries/Image/Image.ios.js +6 -0
  28. package/Libraries/LogBox/Data/LogBoxData.js +18 -18
  29. package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
  30. package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
  31. package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
  32. package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
  33. package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
  34. package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +0 -3
  35. package/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +6 -3
  36. package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.h +1 -2
  37. package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +2 -1
  38. package/Libraries/NewAppScreen/components/logo.png +0 -0
  39. package/Libraries/Pressability/Pressability.js +1 -0
  40. package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -0
  41. package/Libraries/Renderer/REVISION +1 -1
  42. package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +238 -47
  43. package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +84 -18
  44. package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +84 -18
  45. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +238 -47
  46. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +84 -18
  47. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +84 -18
  48. package/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +16 -1
  49. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +2 -0
  50. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +8 -1
  51. package/Libraries/StyleSheet/normalizeColor.js +2 -2
  52. package/Libraries/Text/RawText/RCTRawTextShadowView.m +2 -0
  53. package/Libraries/Text/Text/RCTTextView.m +8 -4
  54. package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +10 -8
  55. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +2 -0
  56. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +15 -3
  57. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +10 -1
  58. package/Libraries/Text/TextProps.js +1 -7
  59. package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
  60. package/Libraries/Types/RootTagTypes.js~merged +23 -0
  61. package/Libraries/Utilities/HMRClient.js +1 -1
  62. package/Libraries/WebSocket/RCTSRWebSocket.m +23 -0
  63. package/README.md +18 -42
  64. package/React/Base/RCTBridge+Private.h +8 -0
  65. package/React/Base/RCTBridge.h +4 -0
  66. package/React/Base/RCTBridge.m +17 -0
  67. package/React/Base/RCTBridgeModule.h +2 -2
  68. package/React/Base/RCTBundleURLProvider.h +1 -1
  69. package/React/Base/RCTBundleURLProvider.mm +2 -2
  70. package/React/Base/RCTConvert.m +23 -6
  71. package/React/Base/RCTDefines.h +12 -3
  72. package/React/Base/RCTEventDispatcherProtocol.h +2 -0
  73. package/React/Base/RCTImageSource.m +2 -0
  74. package/React/Base/RCTJSStackFrame.m +2 -0
  75. package/React/Base/RCTJavaScriptLoader.mm +2 -0
  76. package/React/Base/RCTKeyCommands.m +2 -0
  77. package/React/Base/RCTModuleData.mm +2 -0
  78. package/React/Base/RCTModuleMethod.mm +2 -0
  79. package/React/Base/RCTRootView.h +15 -0
  80. package/React/Base/RCTRootView.m +15 -0
  81. package/React/Base/RCTTouchEvent.m +2 -0
  82. package/React/Base/RCTVersion.m +5 -1
  83. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +11 -0
  84. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +35 -1
  85. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +1 -1
  86. package/React/Base/macOS/RCTPlatformDisplayLink.m +4 -1
  87. package/React/CoreModules/RCTActionSheetManager.mm +4 -0
  88. package/React/CoreModules/RCTAddressSanitizerCrashManager.h +12 -0
  89. package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +18 -0
  90. package/React/CoreModules/RCTAlertController.m +8 -4
  91. package/React/CoreModules/RCTAppearance.mm +5 -1
  92. package/React/CoreModules/RCTDevLoadingView.mm +14 -9
  93. package/React/CoreModules/RCTDevMenu.mm +4 -4
  94. package/React/CoreModules/RCTDevSettings.mm +6 -6
  95. package/React/CoreModules/RCTDevSplitBundleLoader.mm +1 -1
  96. package/React/CoreModules/RCTDeviceInfo.mm +4 -4
  97. package/React/CoreModules/RCTEventDispatcher.mm +5 -0
  98. package/React/CoreModules/RCTPerfMonitor.mm +9 -4
  99. package/React/CxxBridge/RCTCxxBridge.mm +18 -1
  100. package/React/CxxModule/RCTCxxMethod.mm +2 -0
  101. package/React/DevSupport/RCTInspectorDevServerHelper.mm +12 -0
  102. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2126 -0
  103. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2682 -0
  104. package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +11 -3
  105. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +9 -0
  106. package/React/Fabric/Mounting/RCTMountingManager.mm +15 -1
  107. package/React/Fabric/RCTScheduler.mm +10 -3
  108. package/React/Modules/RCTEventEmitter.h +2 -2
  109. package/React/Modules/RCTLayoutAnimation.m +2 -0
  110. package/React/Modules/RCTLayoutAnimationGroup.m +2 -0
  111. package/React/Modules/RCTUIManager.m +19 -10
  112. package/React/Views/RCTFont.mm +58 -47
  113. package/React/Views/RCTShadowView.m +3 -1
  114. package/React/Views/RCTView.h +5 -2
  115. package/React/Views/RCTView.m +22 -10
  116. package/React/Views/RCTViewManager.m +12 -17
  117. package/React/Views/SafeAreaView/RCTSafeAreaView.m +2 -0
  118. package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.h +2 -2
  119. package/React/Views/ScrollView/MacOS/RCTScrollContentLocalData.m +4 -4
  120. package/React/Views/ScrollView/RCTScrollContentView.m +10 -24
  121. package/React/Views/ScrollView/RCTScrollView.m +1 -5
  122. package/React-Core.podspec +0 -11
  123. package/ReactAndroid/build.gradle +12 -6
  124. package/ReactAndroid/gradle.properties +1 -1
  125. package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/BUCK +0 -1
  126. package/ReactAndroid/src/androidTest/js/TestBundle.js +0 -7
  127. package/ReactAndroid/src/main/java/com/facebook/react/BUCK +0 -1
  128. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +7 -0
  129. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +7 -0
  130. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +51 -21
  131. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java +12 -0
  132. package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +6 -0
  133. package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +4 -0
  134. package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +4 -0
  135. package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCxxErrorHandler.java +39 -0
  136. package/ReactAndroid/src/main/java/com/facebook/react/bridge/RuntimeScheduler.java +21 -0
  137. package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +6 -0
  138. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/BundleLoadCallback.java +3 -1
  139. package/ReactAndroid/src/main/java/com/facebook/react/fabric/Binding.java +5 -0
  140. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricJSIModuleProvider.java +1 -0
  141. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk +2 -1
  142. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +14 -0
  143. package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.h +2 -0
  144. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +9 -1
  145. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +19 -0
  146. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java +10 -1
  147. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/{JavaScriptTimerManager.java → JavaScriptTimerExecutor.java} +1 -1
  148. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.java +7 -7
  149. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.java +2 -2
  150. package/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nManagerModule.java +7 -1
  151. package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java +23 -19
  152. package/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java +1 -4
  153. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +5 -1
  154. package/ReactAndroid/src/main/java/com/facebook/react/shell/BUCK +0 -1
  155. package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +0 -5
  156. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +0 -4
  157. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +16 -0
  158. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +8 -0
  159. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +20 -1
  160. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +25 -6
  161. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +25 -5
  162. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditTextInputConnectionWrapper.java +3 -0
  163. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +0 -8
  164. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +8 -8
  165. package/ReactAndroid/src/main/jni/react/jni/Android.mk +3 -2
  166. package/ReactAndroid/src/main/jni/react/jni/BUCK +2 -0
  167. package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +29 -0
  168. package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +4 -0
  169. package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.cpp +18 -0
  170. package/ReactAndroid/src/main/jni/react/jni/JReactCxxErrorHandler.h +25 -0
  171. package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.cpp +22 -0
  172. package/ReactAndroid/src/main/jni/react/jni/JRuntimeScheduler.h +30 -0
  173. package/ReactAndroid/src/main/jni/third-party/libevent/event-config.h +339 -339
  174. package/ReactAndroid/src/main/third-party/android/androidx/BUCK +6 -6
  175. package/ReactCommon/React-Fabric.podspec +9 -0
  176. package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -1
  177. package/ReactCommon/hermes/inspector/tools/msggen/package.json +7 -4
  178. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +1238 -1491
  179. package/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm +14 -31
  180. package/ReactCommon/react/renderer/animations/BUCK +1 -0
  181. package/ReactCommon/react/renderer/animations/LayoutAnimationCallbackWrapper.h +34 -0
  182. package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.cpp +5 -26
  183. package/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h +3 -13
  184. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1399 -1622
  185. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +76 -244
  186. package/ReactCommon/react/renderer/animations/conversions.h +212 -0
  187. package/ReactCommon/react/renderer/animations/primitives.h +104 -0
  188. package/ReactCommon/react/renderer/animations/utils.cpp +71 -0
  189. package/ReactCommon/react/renderer/animations/utils.h +80 -0
  190. package/ReactCommon/react/renderer/attributedstring/AttributedString.h +0 -1
  191. package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.cpp +7 -3
  192. package/ReactCommon/react/renderer/attributedstring/ParagraphAttributes.h +12 -2
  193. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +1 -1
  194. package/ReactCommon/react/renderer/attributedstring/conversions.h +58 -3
  195. package/ReactCommon/react/renderer/attributedstring/primitives.h +18 -1
  196. package/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h +1 -17
  197. package/ReactCommon/react/renderer/components/view/Android.mk +1 -1
  198. package/ReactCommon/react/renderer/components/view/ViewComponentDescriptor.h +0 -23
  199. package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +2 -3
  200. package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +1 -0
  201. package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +1 -1
  202. package/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
  203. package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +14 -6
  204. package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +1 -0
  205. package/ReactCommon/react/renderer/core/Props.h +1 -0
  206. package/ReactCommon/react/renderer/core/PropsParserContext.h +3 -2
  207. package/ReactCommon/react/renderer/core/RawPropsKey.cpp +10 -2
  208. package/ReactCommon/react/renderer/core/ReactPrimitives.h +0 -2
  209. package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +1 -0
  210. package/ReactCommon/react/renderer/graphics/Android.mk +1 -1
  211. package/ReactCommon/react/renderer/graphics/Transform.cpp +1 -1
  212. package/ReactCommon/react/renderer/graphics/Transform.h +1 -1
  213. package/ReactCommon/react/renderer/mounting/Android.mk +2 -1
  214. package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
  215. package/ReactCommon/react/renderer/mounting/ShadowViewMutation.cpp +12 -0
  216. package/ReactCommon/react/renderer/mounting/ShadowViewMutation.h +10 -1
  217. package/ReactCommon/react/renderer/runtimescheduler/BUCK +0 -1
  218. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +4 -2
  219. package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +4 -2
  220. package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.cpp +4 -3
  221. package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerBinding.h +4 -2
  222. package/ReactCommon/react/renderer/runtimescheduler/RuntimeSchedulerClock.h +4 -2
  223. package/ReactCommon/react/renderer/runtimescheduler/SchedulerPriority.h +4 -3
  224. package/ReactCommon/react/renderer/runtimescheduler/Task.cpp +4 -2
  225. package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -2
  226. package/ReactCommon/react/renderer/runtimescheduler/primitives.h +4 -2
  227. package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +4 -4
  228. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +2 -0
  229. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +19 -0
  230. package/ReactCommon/react/renderer/timeline/BUCK +6 -6
  231. package/ReactCommon/react/renderer/uimanager/UIManagerAnimationDelegate.h +1 -1
  232. package/ReactCommon/react/test_utils/BUCK +3 -0
  233. package/ReactCommon/react/test_utils/MockSurfaceHandler.h +25 -0
  234. package/ReactCommon/react/utils/ContextContainer.h +0 -27
  235. package/flow/global.js +45 -0
  236. package/index.js +15 -10
  237. package/jest/preprocessor.js +7 -75
  238. package/local-cli/cli.js +0 -0
  239. package/package.json +28 -22
  240. package/react.gradle +1 -1
  241. package/scripts/generate-specs-cli.js +18 -0
  242. package/scripts/ios-configure-glog.sh +4 -0
  243. package/scripts/react-native-xcode.sh +1 -1
  244. package/scripts/react_native_pods.rb +157 -38
  245. package/template/_flowconfig +1 -1
  246. package/template/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  247. package/template/package.json +4 -2
  248. package/CHANGELOG.json +0 -500
  249. package/CHANGELOG.md +0 -240
  250. package/Libraries/.npmignore +0 -1
  251. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
  252. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
  253. package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
  254. package/React/Base/macOS/RCTDynamicColor.h +0 -28
  255. package/React/Base/macOS/RCTDynamicColor.m +0 -217
  256. package/ReactAndroid/.npmignore +0 -5
  257. package/ReactAndroid/src/androidTest/java/com/facebook/react/tests/DatePickerDialogTestCase.java +0 -172
  258. package/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js +0 -45
  259. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/BUCK +0 -27
  260. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogFragment.java +0 -137
  261. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerDialogModule.java +0 -153
  262. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DatePickerMode.java +0 -15
  263. package/ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DismissableDatePickerDialog.java +0 -117
  264. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/BUCK +0 -20
  265. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/RuntimeSchedulerManager.java +0 -39
  266. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/Android.mk +0 -34
  267. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/BUCK +0 -35
  268. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/OnLoad.cpp +0 -15
  269. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.cpp +0 -46
  270. package/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.h +0 -40
  271. package/ReactAndroid/src/main/jni/first-party/fbjni/.gitignore +0 -2
  272. package/ReactCommon/hermes/inspector/tools/msggen/.gitignore +0 -3
  273. package/scripts/generate-specs.sh +0 -99
  274. package/template/_editorconfig +0 -3
  275. 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 (!global.RN$Bridgeless) {
19
+ if (global.RN$Bridgeless !== true) {
20
20
  // Backward compatibility layer during migration.
21
21
  const legacyModule = NativeModules[name];
22
22
  if (legacyModule != null) {
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ <<<<<<< HEAD
12
+ export type {RootTag} from '../ReactNative/RootTag';
13
+ =======
14
+ <<<<<<< HEAD:Libraries/Components/DatePicker/DatePickerIOS.macos.js
15
+ // TODO(macOS GH#774)
16
+
17
+ 'use strict';
18
+
19
+ module.exports = require('../UnimplementedViews/UnimplementedView');
20
+ =======
21
+ export type {RootTag} from '../ReactNative/RootTag';
22
+ >>>>>>> facebook/0.66-stable:Libraries/Types/RootTagTypes.js
23
+ >>>>>>> facebook/0.66-stable
@@ -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
- ## Contributing
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
- [React Native already has great documentation](https://reactnative.dev/docs/getting-started) and we're working to ensure the React Native for Windows + macOS are part of that documentation story.
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 bootstrapping documentation for macOS at this time, tune in for updates.
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
- ### Examples
66
+ ### Git flow and syncing with upstream
91
67
 
92
- - Using the CLI in the [Getting Started](https://microsoft.github.io/react-native-windows/docs/rnm-getting-started) guide will set you up with a sample React Native for macOS app that you can begin editing right away.
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
- [l]: https://github.com/facebook/react-native/blob/HEAD/LICENSE
104
- [ld]: https://github.com/facebook/react-native/blob/HEAD/LICENSE-docs
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)
@@ -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,
@@ -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, readonly) RCTModuleRegistry *moduleRegistry;
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;
@@ -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
- RCTDynamicColor *color = [[RCTDynamicColor alloc] initWithAquaColor:lightColor darkAquaColor:darkColor];
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": NSAccessibilityMenuBarItemRole,
1426
+ @"menuitem": NSAccessibilityMenuItemRole,
1410
1427
  @"none": NSAccessibilityUnknownRole,
1411
1428
  @"progressbar": NSAccessibilityProgressIndicatorRole,
1412
1429
  @"radio": NSAccessibilityRadioButtonRole,
@@ -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 ENABLE_PACKAGER_CONNECTION
74
+ #ifndef RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION
66
75
  #if RCT_DEV && (__has_include("RCTPackagerConnection.h") || __has_include(<React/RCTPackagerConnection.h>))
67
- #define ENABLE_PACKAGER_CONNECTION 1
76
+ #define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 1
68
77
  #else
69
- #define ENABLE_PACKAGER_CONNECTION 0
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
@@ -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
@@ -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
@@ -15,6 +15,10 @@ NSString* const RCTVersionPatch = @"patch";
15
15
  NSString* const RCTVersionPrerelease = @"prerelease";
16
16
 
17
17
 
18
+ // [TODO(macOS GH#944)
19
+ // Note: Be careful not to override these version numbers
20
+ // when we merge upstream stable branches into main
21
+ // TODO(macOS GH#944)]
18
22
  NSDictionary* RCTGetReactNativeVersion(void)
19
23
  {
20
24
  static NSDictionary* __rnVersion;
@@ -24,7 +28,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
28
  RCTVersionMajor: @(0),
25
29
  RCTVersionMinor: @(0),
26
30
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"cfdd34990",
31
+ RCTVersionPrerelease: @"d2f5a1ffb",
28
32
  };
29
33
  });
30
34
  return __rnVersion;
@@ -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