react-native-windows 0.69.6 → 0.70.0-preview.1

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 (296) hide show
  1. package/.flowconfig +5 -1
  2. package/Chakra/ChakraHelpers.cpp +1 -1
  3. package/Chakra/ChakraPlatform.cpp +1 -1
  4. package/Chakra/ChakraValue.cpp +6 -3
  5. package/Chakra/ChakraValue.h +1 -1
  6. package/Directory.Build.props +7 -7
  7. package/Folly/Folly.vcxproj +20 -13
  8. package/Folly/cgmanifest.json +14 -0
  9. package/Libraries/Alert/Alert.js +18 -4
  10. package/Libraries/Alert/Alert.windows.js +4 -0
  11. package/Libraries/Alert/NativeAlertManager.js +1 -0
  12. package/Libraries/Animated/Animated.js +2 -2
  13. package/Libraries/Animated/AnimatedEvent.js +7 -4
  14. package/Libraries/Animated/AnimatedImplementation.js +17 -3
  15. package/Libraries/Animated/AnimatedMock.js +7 -2
  16. package/Libraries/Animated/NativeAnimatedHelper.js +220 -95
  17. package/Libraries/Animated/NativeAnimatedModule.js +3 -0
  18. package/Libraries/Animated/NativeAnimatedTurboModule.js +3 -0
  19. package/Libraries/Animated/animations/SpringAnimation.js +3 -3
  20. package/Libraries/Animated/animations/TimingAnimation.js +3 -3
  21. package/Libraries/Animated/createAnimatedComponent.js +8 -1
  22. package/Libraries/Animated/nodes/AnimatedAddition.js +3 -1
  23. package/Libraries/Animated/nodes/AnimatedColor.js +50 -29
  24. package/Libraries/Animated/nodes/AnimatedDiffClamp.js +3 -1
  25. package/Libraries/Animated/nodes/AnimatedDivision.js +3 -1
  26. package/Libraries/Animated/nodes/AnimatedInterpolation.js +22 -21
  27. package/Libraries/Animated/nodes/AnimatedModulo.js +3 -1
  28. package/Libraries/Animated/nodes/AnimatedMultiplication.js +3 -2
  29. package/Libraries/Animated/nodes/AnimatedProps.js +20 -12
  30. package/Libraries/Animated/nodes/AnimatedStyle.js +19 -16
  31. package/Libraries/Animated/nodes/AnimatedSubtraction.js +3 -1
  32. package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
  33. package/Libraries/Animated/nodes/AnimatedValue.js +14 -5
  34. package/Libraries/Animated/nodes/AnimatedValueXY.js +28 -1
  35. package/Libraries/Animated/useAnimatedProps.js +1 -0
  36. package/Libraries/AppState/AppState.js +0 -32
  37. package/Libraries/AppTheme/AppTheme.js +14 -8
  38. package/Libraries/AppTheme/AppThemeTypes.d.ts +0 -3
  39. package/Libraries/BatchedBridge/MessageQueue.js +21 -15
  40. package/Libraries/BatchedBridge/NativeModules.js +3 -4
  41. package/Libraries/Blob/FileReader.js +0 -6
  42. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +0 -20
  43. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +0 -20
  44. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -0
  45. package/Libraries/Components/Keyboard/Keyboard.js +0 -11
  46. package/Libraries/Components/Pressable/Pressable.js +2 -0
  47. package/Libraries/Components/Pressable/Pressable.windows.js +2 -0
  48. package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -3
  49. package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -30
  50. package/Libraries/Components/SafeAreaView/SafeAreaView.windows.js +4 -30
  51. package/Libraries/Components/ScrollView/ScrollView.js +13 -11
  52. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +5 -3
  53. package/Libraries/Components/StatusBar/StatusBar.js +10 -7
  54. package/Libraries/Components/TextInput/InputAccessoryView.js +14 -13
  55. package/Libraries/Components/TextInput/TextInput.js +12 -2
  56. package/Libraries/Components/TextInput/TextInput.windows.js +12 -2
  57. package/Libraries/Components/Touchable/PooledClass.js +16 -4
  58. package/Libraries/Components/Touchable/Touchable.js +50 -1
  59. package/Libraries/Components/Touchable/Touchable.windows.js +972 -0
  60. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -2
  61. package/Libraries/Components/View/ReactNativeStyleAttributes.js +0 -7
  62. package/Libraries/Components/View/ViewPropTypes.js +3 -8
  63. package/Libraries/Components/View/ViewPropTypes.windows.js +3 -8
  64. package/Libraries/Core/ExceptionsManager.js +2 -0
  65. package/Libraries/Core/ReactNativeVersion.js +2 -2
  66. package/Libraries/Core/Timers/JSTimers.js +2 -2
  67. package/Libraries/Core/polyfillPromise.js +0 -32
  68. package/Libraries/Core/setUpBatchedBridge.js +5 -1
  69. package/Libraries/Core/setUpPerformance.js +1 -1
  70. package/Libraries/EventEmitter/NativeEventEmitter.js +0 -13
  71. package/Libraries/Image/AssetSourceResolver.js +2 -2
  72. package/Libraries/Image/Image.android.js +5 -3
  73. package/Libraries/Image/Image.ios.js +6 -3
  74. package/Libraries/Image/Image.windows.js +6 -3
  75. package/Libraries/Image/ImageSource.js +7 -5
  76. package/Libraries/Inspector/ElementBox.js +2 -2
  77. package/Libraries/Inspector/NetworkOverlay.js +13 -8
  78. package/Libraries/Interaction/PanResponder.js +16 -14
  79. package/Libraries/Linking/Linking.js +0 -11
  80. package/Libraries/Lists/FlatList.js +3 -2
  81. package/Libraries/Lists/SectionList.js +2 -0
  82. package/Libraries/Lists/ViewabilityHelper.js +7 -3
  83. package/Libraries/Lists/VirtualizeUtils.js +33 -20
  84. package/Libraries/Lists/VirtualizedList.js +93 -47
  85. package/Libraries/Lists/VirtualizedListContext.js +1 -0
  86. package/Libraries/Lists/VirtualizedSectionList.js +14 -9
  87. package/Libraries/Lists/__tests__/VirtualizeUtils-test.js +19 -18
  88. package/Libraries/Lists/__tests__/VirtualizedList-test.js +10 -6
  89. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  90. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  91. package/Libraries/LogBox/LogBox.js +3 -1
  92. package/Libraries/LogBox/UI/AnsiHighlight.js +2 -0
  93. package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +3 -0
  94. package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +0 -3
  95. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +8 -3
  96. package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -18
  97. package/Libraries/NativeComponent/BaseViewConfig.ios.js +26 -12
  98. package/Libraries/NativeComponent/BaseViewConfig.windows.js +26 -12
  99. package/Libraries/Network/XMLHttpRequest.js +9 -11
  100. package/Libraries/Performance/PureComponentDebug.js +1 -0
  101. package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +9 -1
  102. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +16 -0
  103. package/Libraries/Pressability/Pressability.js +26 -16
  104. package/Libraries/Pressability/Pressability.windows.js +30 -17
  105. package/Libraries/Promise.js +0 -1
  106. package/Libraries/ReactNative/AppRegistry.js +16 -13
  107. package/Libraries/ReactNative/BridgelessUIManager.js +2 -0
  108. package/Libraries/ReactNative/PaperUIManager.js +9 -9
  109. package/Libraries/ReactNative/PaperUIManager.windows.js +7 -8
  110. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +12 -0
  111. package/Libraries/ReactNative/ReactNativeRuntimeDiagnostics.js +68 -0
  112. package/Libraries/ReactNative/getNativeComponentAttributes.js +6 -7
  113. package/Libraries/ReactNative/renderApplication.js +1 -1
  114. package/Libraries/Renderer/implementations/ReactFabric-dev.js +4443 -3615
  115. package/Libraries/Renderer/implementations/ReactFabric-prod.js +1496 -1170
  116. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1694 -1356
  117. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +4439 -3588
  118. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1583 -1249
  119. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1719 -1372
  120. package/Libraries/Storage/AsyncStorage.js +7 -1
  121. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +8 -0
  122. package/Libraries/StyleSheet/flattenStyle.js +1 -1
  123. package/Libraries/StyleSheet/processTransform.js +2 -0
  124. package/Libraries/StyleSheet/processTransform.windows.js +2 -0
  125. package/Libraries/StyleSheet/splitLayoutProps.js +2 -0
  126. package/Libraries/Text/Text.js +15 -7
  127. package/Libraries/Text/Text.windows.js +14 -7
  128. package/Libraries/Types/CoreEventTypes.js +137 -11
  129. package/Libraries/Types/CoreEventTypes.windows.js +147 -22
  130. package/Libraries/Utilities/Dimensions.js +0 -13
  131. package/Libraries/Utilities/HMRClient.js +3 -3
  132. package/Libraries/Utilities/Platform.ios.js +0 -7
  133. package/Libraries/Utilities/ReactNativeTestTools.js +3 -1
  134. package/Libraries/Utilities/codegenNativeCommands.js +11 -2
  135. package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
  136. package/Libraries/Utilities/stringifySafe.js +3 -1
  137. package/Libraries/Utilities/truncate.js +1 -1
  138. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -2
  139. package/Libraries/Vibration/Vibration.js +1 -1
  140. package/Libraries/WebSocket/WebSocket.js +1 -0
  141. package/Libraries/vendor/emitter/EventEmitter.js +105 -12
  142. package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +73 -117
  143. package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +24 -12
  144. package/Microsoft.ReactNative/CoreApp.cpp +303 -0
  145. package/Microsoft.ReactNative/CoreAppPage.cpp +21 -0
  146. package/Microsoft.ReactNative/CoreAppPage.h +15 -0
  147. package/Microsoft.ReactNative/CoreAppPage.idl +12 -0
  148. package/Microsoft.ReactNative/CoreAppPage.xaml +14 -0
  149. package/Microsoft.ReactNative/Fabric/ActivityIndicatorComponentView.cpp +1 -2
  150. package/Microsoft.ReactNative/Fabric/ActivityIndicatorComponentView.h +1 -1
  151. package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
  152. package/Microsoft.ReactNative/Fabric/ImageComponentView.cpp +1 -1
  153. package/Microsoft.ReactNative/Fabric/ImageComponentView.h +1 -1
  154. package/Microsoft.ReactNative/Fabric/ParagraphComponentView.cpp +1 -1
  155. package/Microsoft.ReactNative/Fabric/ParagraphComponentView.h +1 -1
  156. package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.cpp +1 -1
  157. package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.h +1 -1
  158. package/Microsoft.ReactNative/Fabric/SliderComponentView.cpp +1 -1
  159. package/Microsoft.ReactNative/Fabric/SliderComponentView.h +1 -1
  160. package/Microsoft.ReactNative/Fabric/SwitchComponentView.cpp +1 -1
  161. package/Microsoft.ReactNative/Fabric/SwitchComponentView.h +1 -1
  162. package/Microsoft.ReactNative/Fabric/TextComponentView.cpp +1 -1
  163. package/Microsoft.ReactNative/Fabric/TextComponentView.h +1 -1
  164. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.cpp +1 -1
  165. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.h +1 -1
  166. package/Microsoft.ReactNative/Fabric/ViewComponentView.cpp +1 -1
  167. package/Microsoft.ReactNative/Fabric/ViewComponentView.h +1 -1
  168. package/Microsoft.ReactNative/GlyphViewManager.cpp +1 -0
  169. package/Microsoft.ReactNative/IReactDispatcher.cpp +18 -0
  170. package/Microsoft.ReactNative/IReactDispatcher.h +18 -3
  171. package/Microsoft.ReactNative/IReactDispatcher.idl +15 -0
  172. package/Microsoft.ReactNative/IReactPropertyBag.cpp +9 -0
  173. package/Microsoft.ReactNative/IReactPropertyBag.h +3 -0
  174. package/Microsoft.ReactNative/IReactPropertyBag.idl +3 -0
  175. package/Microsoft.ReactNative/JsiApi.cpp +41 -1
  176. package/Microsoft.ReactNative/JsiApi.h +3 -0
  177. package/Microsoft.ReactNative/JsiApi.idl +19 -1
  178. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +18 -2
  179. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +7 -7
  180. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +1 -1
  181. package/Microsoft.ReactNative/Modules/AlertModule.cpp +15 -12
  182. package/Microsoft.ReactNative/Modules/AlertModule.h +1 -1
  183. package/Microsoft.ReactNative/Modules/AppStateModule.cpp +45 -9
  184. package/Microsoft.ReactNative/Modules/AppStateModule.h +9 -3
  185. package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.h +1 -1
  186. package/Microsoft.ReactNative/Modules/ClipboardModule.h +1 -1
  187. package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
  188. package/Microsoft.ReactNative/Modules/DeviceInfoModule.h +1 -1
  189. package/Microsoft.ReactNative/Modules/I18nManagerModule.h +1 -1
  190. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
  191. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.h +1 -1
  192. package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
  193. package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -1
  194. package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +66 -39
  195. package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +41 -11
  196. package/Microsoft.ReactNative/Modules/PaperUIManagerModule.h +1 -1
  197. package/Microsoft.ReactNative/QuirkSettings.cpp +22 -0
  198. package/Microsoft.ReactNative/QuirkSettings.h +10 -0
  199. package/Microsoft.ReactNative/QuirkSettings.idl +7 -0
  200. package/Microsoft.ReactNative/ReactApplication.cpp +44 -0
  201. package/Microsoft.ReactNative/ReactApplication.h +40 -5
  202. package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.cpp +5 -2
  203. package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.h +1 -0
  204. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +23 -4
  205. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
  206. package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +12 -2
  207. package/Microsoft.ReactNative/Utils/BatchingEventEmitter.cpp +1 -0
  208. package/Microsoft.ReactNative/Utils/Helpers.cpp +1 -1
  209. package/Microsoft.ReactNative/Utils/Helpers.h +1 -1
  210. package/Microsoft.ReactNative/Utils/PropertyUtils.h +1 -1
  211. package/Microsoft.ReactNative/Utils/TransformableText.h +1 -1
  212. package/Microsoft.ReactNative/Utils/ValueUtils.cpp +0 -1
  213. package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +9 -7
  214. package/Microsoft.ReactNative/Views/DynamicAutomationProperties.cpp +3 -3
  215. package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +13 -1
  216. package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +1 -1
  217. package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +63 -13
  218. package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +1 -1
  219. package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +5 -6
  220. package/Microsoft.ReactNative/Views/Image/ReactImage.h +4 -4
  221. package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.h +1 -1
  222. package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +21 -2
  223. package/Microsoft.ReactNative/Views/TextViewManager.cpp +6 -3
  224. package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +1 -1
  225. package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +7 -1
  226. package/Microsoft.ReactNative/Views/ViewPanel.cpp +4 -0
  227. package/Microsoft.ReactNative/Views/ViewViewManager.cpp +8 -3
  228. package/Microsoft.ReactNative/Views/cppwinrt/DynamicAutomationPeer.idl +2 -0
  229. package/Microsoft.ReactNative/microsoft.reactnative.def +4 -1
  230. package/Microsoft.ReactNative.Cxx/AppModelHelpers.h +17 -0
  231. package/Microsoft.ReactNative.Cxx/CoreApp.h +60 -0
  232. package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +65 -0
  233. package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +13 -0
  234. package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.cpp +53 -0
  235. package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.h +32 -0
  236. package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +14 -2
  237. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -0
  238. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +7 -0
  239. package/Microsoft.ReactNative.Managed/packages.lock.json +1 -24
  240. package/Mso/dispatchQueue/dispatchQueue.h +12 -4
  241. package/Mso/src/dispatchQueue/looperScheduler.cpp +36 -9
  242. package/Mso/src/dispatchQueue/queueService.cpp +2 -2
  243. package/Mso/src/dispatchQueue/queueService.h +2 -2
  244. package/Mso/src/memoryApi/memoryApi.cpp +3 -0
  245. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  246. package/PropertySheets/JSEngine.props +1 -1
  247. package/PropertySheets/Release.props +6 -0
  248. package/ReactCommon/ReactCommon.vcxproj +11 -21
  249. package/ReactCommon/ReactCommon.vcxproj.filters +64 -46
  250. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +145 -0
  251. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +344 -0
  252. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/BaseTextProps.cpp +313 -0
  253. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewProps.cpp +455 -0
  254. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ConcreteComponentDescriptor.h +216 -0
  255. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/PropsMacros.h +91 -0
  256. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/graphics/RectangleEdges.h +100 -0
  257. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/CompactValue.h +3 -1
  258. package/Scripts/Microsoft.ReactNative.nuspec +6 -0
  259. package/Scripts/Microsoft.ReactNative.targets +7 -0
  260. package/Shared/DevSettings.h +4 -0
  261. package/Shared/JSI/ChakraRuntime.cpp +11 -2
  262. package/Shared/JSI/ChakraRuntime.h +2 -0
  263. package/Shared/Modules/BlobModule.cpp +4 -4
  264. package/Shared/Modules/BlobModule.h +1 -1
  265. package/Shared/Modules/FileReaderModule.cpp +3 -2
  266. package/Shared/Modules/IBlobPersistor.h +1 -1
  267. package/Shared/Networking/IHttpResource.h +1 -0
  268. package/Shared/Networking/OriginPolicyHttpFilter.cpp +16 -10
  269. package/Shared/Networking/WinRTHttpResource.cpp +34 -2
  270. package/Shared/OInstance.cpp +14 -6
  271. package/Shared/Threading/BatchingQueueThread.cpp +23 -12
  272. package/Shared/Utils.cpp +2 -5
  273. package/codegen/NativeAlertManagerSpec.g.h +2 -0
  274. package/codegen/NativeAnimatedModuleSpec.g.h +6 -0
  275. package/codegen/NativeAnimatedTurboModuleSpec.g.h +6 -0
  276. package/codegen/react/components/rnwcore/Props.cpp +2 -2
  277. package/codegen/react/components/rnwcore/Props.h +1 -1
  278. package/fmt/cgmanifest.json +14 -0
  279. package/fmt/fmt.vcxproj +25 -11
  280. package/jest/assetFileTransformer.js +3 -2
  281. package/jest/setup.js +4 -0
  282. package/package.json +27 -28
  283. package/rntypes/index.d.ts +0 -1
  284. package/template/cs-app-WinAppSDK/proj/{NuGet.Config → NuGet_Config} +0 -0
  285. package/template/metro.devMode.config.js +49 -2
  286. package/template/shared-app/proj/{NuGet.Config → NuGet_Config} +0 -0
  287. package/template/shared-lib/proj/{NuGet.Config → NuGet_Config} +0 -0
  288. package/Libraries/vendor/emitter/EventSubscription.js +0 -19
  289. package/Libraries/vendor/emitter/_EmitterSubscription.js +0 -62
  290. package/Libraries/vendor/emitter/_EventEmitter.js +0 -184
  291. package/Libraries/vendor/emitter/_EventSubscription.js +0 -45
  292. package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +0 -108
  293. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +0 -87
  294. package/Scripts/copyRNLibraries.js +0 -99
  295. package/jest/preprocessor.js +0 -40
  296. package/jest/preprocessor_DO_NOT_USE.js +0 -122
@@ -8,7 +8,7 @@
8
8
  namespace Mso {
9
9
 
10
10
  struct LooperScheduler : Mso::UnknownObject<Mso::RefCountStrategy::WeakRef, IDispatchQueueScheduler> {
11
- LooperScheduler() noexcept;
11
+ LooperScheduler(DispatchQueueSettings const &settings = {}) noexcept;
12
12
  ~LooperScheduler() noexcept override;
13
13
 
14
14
  static void RunLoop(const Mso::WeakPtr<LooperScheduler> &weakSelf) noexcept;
@@ -23,6 +23,7 @@ struct LooperScheduler : Mso::UnknownObject<Mso::RefCountStrategy::WeakRef, IDis
23
23
 
24
24
  private:
25
25
  ManualResetEvent m_wakeUpEvent;
26
+ DispatchQueueSettings m_settings;
26
27
  Mso::WeakPtr<IDispatchQueueService> m_queue;
27
28
  std::atomic_bool m_isShutdown{false};
28
29
  std::thread m_looperThread; // it must be last in the initialization list
@@ -32,8 +33,8 @@ struct LooperScheduler : Mso::UnknownObject<Mso::RefCountStrategy::WeakRef, IDis
32
33
  // LooperScheduler implementation
33
34
  //=============================================================================
34
35
 
35
- LooperScheduler::LooperScheduler() noexcept
36
- : m_looperThread([weakSelf = Mso::WeakPtr{this}]() noexcept { RunLoop(weakSelf); }) {}
36
+ LooperScheduler::LooperScheduler(DispatchQueueSettings const &settings) noexcept
37
+ : m_settings(settings), m_looperThread([weakSelf = Mso::WeakPtr{this}]() noexcept { RunLoop(weakSelf); }) {}
37
38
 
38
39
  LooperScheduler::~LooperScheduler() noexcept {
39
40
  AwaitTermination();
@@ -42,10 +43,22 @@ LooperScheduler::~LooperScheduler() noexcept {
42
43
  /*static*/ void LooperScheduler::RunLoop(const Mso::WeakPtr<LooperScheduler> &weakSelf) noexcept {
43
44
  for (;;) {
44
45
  if (auto self = weakSelf.GetStrongPtr()) {
45
- if (auto queue = self->m_queue.GetStrongPtr()) {
46
- DispatchTask task;
47
- while (queue->TryDequeTask(task)) {
48
- queue->InvokeTask(std::move(task), std::nullopt);
46
+ if (auto queue = DispatchQueue{self->m_queue.GetStrongPtr()}) {
47
+ for (;;) {
48
+ DispatchTask task;
49
+ if (!(*GetRawState(queue))->TryDequeTask(task)) {
50
+ break;
51
+ }
52
+
53
+ if (auto &func = self->m_settings.TaskStarting) {
54
+ func(queue);
55
+ }
56
+
57
+ (*GetRawState(queue))->InvokeTask(std::move(task), std::nullopt);
58
+
59
+ if (auto &func = self->m_settings.TaskCompleted) {
60
+ func(queue);
61
+ }
49
62
  }
50
63
  }
51
64
 
@@ -53,8 +66,21 @@ LooperScheduler::~LooperScheduler() noexcept {
53
66
  break;
54
67
  }
55
68
 
69
+ if (auto &func = self->m_settings.IdleWaitStarting) {
70
+ if (auto queue = DispatchQueue{self->m_queue.GetStrongPtr()}) {
71
+ func(queue);
72
+ }
73
+ }
74
+
56
75
  self->m_wakeUpEvent.Wait();
57
76
  self->m_wakeUpEvent.Reset();
77
+
78
+ if (auto &func = self->m_settings.IdleWaitCompleted) {
79
+ if (auto queue = DispatchQueue{self->m_queue.GetStrongPtr()}) {
80
+ func(queue);
81
+ }
82
+ }
83
+
58
84
  continue;
59
85
  }
60
86
 
@@ -101,8 +127,9 @@ void LooperScheduler::AwaitTermination() noexcept {
101
127
  // DispatchQueueStatic::MakeThreadPoolScheduler implementation
102
128
  //=============================================================================
103
129
 
104
- /*static*/ Mso::CntPtr<IDispatchQueueScheduler> DispatchQueueStatic::MakeLooperScheduler() noexcept {
105
- return Mso::Make<LooperScheduler, IDispatchQueueScheduler>();
130
+ /*static*/ Mso::CntPtr<IDispatchQueueScheduler> DispatchQueueStatic::MakeLooperScheduler(
131
+ DispatchQueueSettings const &settings) noexcept {
132
+ return Mso::Make<LooperScheduler, IDispatchQueueScheduler>(settings);
106
133
  }
107
134
 
108
135
  } // namespace Mso
@@ -271,8 +271,8 @@ DispatchQueue DispatchQueueStatic::MakeSerialQueue() noexcept {
271
271
  return Mso::Make<QueueService, IDispatchQueueService>(MakeThreadPoolScheduler(/*maxThreads:*/ 1));
272
272
  }
273
273
 
274
- DispatchQueue DispatchQueueStatic::MakeLooperQueue() noexcept {
275
- return Mso::Make<QueueService, IDispatchQueueService>(MakeLooperScheduler());
274
+ DispatchQueue DispatchQueueStatic::MakeLooperQueue(DispatchQueueSettings const &settings) noexcept {
275
+ return Mso::Make<QueueService, IDispatchQueueService>(MakeLooperScheduler(settings));
276
276
  }
277
277
 
278
278
  DispatchQueue DispatchQueueStatic::MakeConcurrentQueue(uint32_t maxThreads) noexcept {
@@ -81,14 +81,14 @@ struct QueueLocalValueEntry {
81
81
 
82
82
  struct DispatchQueueStatic : Mso::UnknownObject<Mso::RefCountStrategy::NoRefCount, IDispatchQueueStatic> {
83
83
  static DispatchQueueStatic *Instance() noexcept;
84
- static Mso::CntPtr<IDispatchQueueScheduler> MakeLooperScheduler() noexcept;
84
+ static Mso::CntPtr<IDispatchQueueScheduler> MakeLooperScheduler(DispatchQueueSettings const &settings) noexcept;
85
85
  static Mso::CntPtr<IDispatchQueueScheduler> MakeThreadPoolScheduler(uint32_t maxThreads) noexcept;
86
86
 
87
87
  public: // IDispatchQueueStatic
88
88
  DispatchQueue CurrentQueue() noexcept override;
89
89
  DispatchQueue const &ConcurrentQueue() noexcept override;
90
90
  DispatchQueue MakeSerialQueue() noexcept override;
91
- DispatchQueue MakeLooperQueue() noexcept override;
91
+ DispatchQueue MakeLooperQueue(DispatchQueueSettings const &settings) noexcept override;
92
92
  DispatchQueue GetCurrentUIThreadQueue() noexcept override;
93
93
  DispatchQueue MakeConcurrentQueue(uint32_t maxThreads) noexcept override;
94
94
  DispatchQueue MakeCustomQueue(Mso::CntPtr<IDispatchQueueScheduler> &&scheduler) noexcept override;
@@ -4,6 +4,9 @@
4
4
  #include "memoryApi/memoryApi.h"
5
5
  #include <cstdlib>
6
6
  #include <memory>
7
+ #ifdef DEBUG
8
+ #include <windows.h>
9
+ #endif
7
10
 
8
11
  #if !__clang__ && !__GNUC__
9
12
  #pragma detect_mismatch("Allocator", "Crt")
@@ -10,10 +10,10 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.69.6</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.70.0-preview.1</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
- <ReactNativeWindowsMinor>69</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>6</ReactNativeWindowsPatch>
15
+ <ReactNativeWindowsMinor>70</ReactNativeWindowsMinor>
16
+ <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
18
  </PropertyGroup>
19
19
  </Project>
@@ -8,7 +8,7 @@
8
8
  <!-- Enabling this will (1) Include hermes glues in the Microsoft.ReactNative binaries AND (2) Make hermes the default engine -->
9
9
  <UseHermes Condition="'$(UseHermes)' == ''">false</UseHermes>
10
10
  <!-- This will be true if (1) the client want to use hermes by setting UseHermes to true OR (2) We are building for UWP where dynamic switching is enabled -->
11
- <HermesVersion Condition="'$(HermesVersion)' == ''">0.12.1</HermesVersion>
11
+ <HermesVersion Condition="'$(HermesVersion)' == ''">0.70.0</HermesVersion>
12
12
  <HermesPackage Condition="'$(HermesPackage)' == '' And Exists('$(PkgReactNative_Hermes_Windows)')">$(PkgReactNative_Hermes_Windows)</HermesPackage>
13
13
  <HermesPackage Condition="'$(HermesPackage)' == ''">$(NuGetPackageRoot)\ReactNative.Hermes.Windows\$(HermesVersion)</HermesPackage>
14
14
  <EnableHermesInspectorInReleaseFlavor Condition="'$(EnableHermesInspectorInReleaseFlavor)' == ''">false</EnableHermesInspectorInReleaseFlavor>
@@ -12,10 +12,16 @@
12
12
 
13
13
  <ItemDefinitionGroup>
14
14
  <ClCompile>
15
+ <StringPooling>true</StringPooling>
15
16
  <Optimization>MinSpace</Optimization>
17
+ <AdditionalOptions>%(AdditionalOptions) /Gw</AdditionalOptions>
16
18
  <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
17
19
  <ControlFlowGuard>Guard</ControlFlowGuard>
18
20
  </ClCompile>
21
+
22
+ <Link>
23
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
24
+ </Link>
19
25
  </ItemDefinitionGroup>
20
26
 
21
27
  </Project>
@@ -87,14 +87,12 @@
87
87
  <ClInclude Include="..\stubs\sys\time.h" />
88
88
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\CxxModule.h" />
89
89
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\CxxNativeModule.h" />
90
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\Executor.h" />
91
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\ExecutorToken.h" />
92
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\ExecutorTokenFactory.h" />
93
90
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\Instance.h" />
94
91
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\JsArgumentHelpers-inl.h" />
95
92
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\JsArgumentHelpers.h" />
96
93
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSBigString.h" />
97
94
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSBundleType.h" />
95
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSExecutor.h" />
98
96
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSIndexedRAMBundle.h" />
99
97
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSModulesUnbundle.h" />
100
98
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\MessageQueueThread.h" />
@@ -103,18 +101,14 @@
103
101
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\NativeModule.h" />
104
102
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\NativeModuleProvider.h" />
105
103
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\NativeToJsBridge.h" />
106
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\oss-compat-util.h" />
107
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\Platform.h" />
108
104
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\ReactMarker.h" />
109
105
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\RecoverableError.h" />
110
106
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\SystraceSection.h" />
111
107
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSIExecutor.h" />
112
108
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSINativeModules.h" />
113
109
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\logger\react_native_log.h" />
114
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\privatedata\PrivateDataBase.h" />
115
110
  <ClInclude Include="$(YogaDir)\yoga\YGEnums.h" />
116
111
  <ClInclude Include="$(YogaDir)\yoga\YGMacros.h" />
117
- <ClInclude Include="$(YogaDir)\yoga\YGNodeList.h" />
118
112
  <ClInclude Include="$(YogaDir)\yoga\Yoga.h" />
119
113
  <ClInclude Include="pch.h" />
120
114
  </ItemGroup>
@@ -124,7 +118,7 @@
124
118
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSBundleType.cpp" />
125
119
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSExecutor.cpp" />
126
120
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSIndexedRAMBundle.cpp" />
127
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\MethodCall.cpp"/>
121
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\MethodCall.cpp" />
128
122
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\ModuleRegistry.cpp" />
129
123
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\NativeToJsBridge.cpp" />
130
124
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\cxxreact\RAMBundleRegistry.cpp" />
@@ -134,21 +128,18 @@
134
128
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp" />
135
129
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSINativeModules.cpp" />
136
130
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\logger\react_native_log.cpp" />
137
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\privatedata\PrivateDataBase.cpp">
138
- <ExcludedFromBuild>true</ExcludedFromBuild>
139
- </ClCompile>
140
131
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\reactperflogger\reactperflogger\BridgeNativeModulePerfLogger.cpp" />
141
- <ClCompile Include="$(YogaDir)\yoga\log.cpp"/>
132
+ <ClCompile Include="$(YogaDir)\yoga\log.cpp" />
142
133
  <!-- We should ideally upstream a fix for missing stdexcept, but Yoga hasn't been accepting PRs as of May 2020 -->
143
134
  <ClCompile Include="$(YogaDir)\yoga\Utils.cpp">
144
135
  <ForcedIncludeFiles>stdexcept;%(ForcedIncludeFiles)</ForcedIncludeFiles>
145
136
  </ClCompile>
146
137
  <ClCompile Include="$(YogaDir)\yoga\YGConfig.cpp" />
147
- <ClCompile Include="$(YogaDir)\yoga\YGEnums.cpp"/>
148
- <ClCompile Include="$(YogaDir)\yoga\YGLayout.cpp"/>
149
- <ClCompile Include="$(YogaDir)\yoga\YGNode.cpp"/>
150
- <ClCompile Include="$(YogaDir)\yoga\YGNodePrint.cpp"/>
151
- <ClCompile Include="$(YogaDir)\yoga\YGStyle.cpp"/>
138
+ <ClCompile Include="$(YogaDir)\yoga\YGEnums.cpp" />
139
+ <ClCompile Include="$(YogaDir)\yoga\YGLayout.cpp" />
140
+ <ClCompile Include="$(YogaDir)\yoga\YGNode.cpp" />
141
+ <ClCompile Include="$(YogaDir)\yoga\YGNodePrint.cpp" />
142
+ <ClCompile Include="$(YogaDir)\yoga\YGStyle.cpp" />
152
143
  <ClCompile Include="$(YogaDir)\yoga\YGValue.cpp" />
153
144
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\core\Sealable.cpp" />
154
145
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\debug\DebugStringConvertible.cpp" />
@@ -159,21 +150,21 @@
159
150
  <!--
160
151
  Using a patched copy of Yoga due to https://github.com/microsoft/react-native-windows/issues/3994
161
152
  -->
162
- <ClCompile Include="Yoga.cpp" AdditionalIncludeDirectories="$(YogaDir)\yoga;%(AdditionalIncludeDirectories)"/>
153
+ <ClCompile Include="Yoga.cpp" AdditionalIncludeDirectories="$(YogaDir)\yoga;%(AdditionalIncludeDirectories)" />
163
154
  <ClCompile Include="$(YogaDir)\yoga\event\event.cpp" />
164
155
  <ClCompile Include="pch.cpp">
165
156
  <PrecompiledHeader>Create</PrecompiledHeader>
166
157
  </ClCompile>
167
158
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\callinvoker\ReactCommon\CallInvoker.h" />
168
159
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\LongLivedObject.h" />
169
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\brdiging\CallbackWrapper.h" />
160
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\bridging\CallbackWrapper.h" />
170
161
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboCxxModule.h" />
171
162
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.h" />
172
163
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleBinding.h" />
173
164
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleUtils.h" />
174
165
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\bridging\LongLivedObject.cpp" />
175
166
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboCxxModule.cpp" />
176
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.cpp"/>
167
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.cpp" />
177
168
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleBinding.cpp" />
178
169
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleUtils.cpp" />
179
170
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\samples\ReactCommon\NativeSampleTurboCxxModuleSpecJSI.cpp" />
@@ -199,5 +190,4 @@
199
190
  <Target Name="ApplyReactCommonTemporaryPatch" BeforeTargets="PrepareForBuild">
200
191
  <Copy DestinationFiles="@(TemporaryReactCommonPatchFiles->'$(ReactNativeDir)\ReactCommon\%(RecursiveDir)%(Filename)%(Extension)')" SourceFiles="@(TemporaryReactCommonPatchFiles)" />
201
192
  </Target>
202
-
203
193
  </Project>
@@ -22,9 +22,6 @@
22
22
  <Filter Include="jsiexecutor\jsireact">
23
23
  <UniqueIdentifier>{1072517c-f7e8-419d-a43a-b037bf46e691}</UniqueIdentifier>
24
24
  </Filter>
25
- <Filter Include="privatedata">
26
- <UniqueIdentifier>{20b1bda7-06e8-4ce8-8733-fc404e0afc13}</UniqueIdentifier>
27
- </Filter>
28
25
  <Filter Include="jsi\jsi">
29
26
  <UniqueIdentifier>{9c8e7a7a-c77d-479d-8611-1ece3cdacad7}</UniqueIdentifier>
30
27
  </Filter>
@@ -34,12 +31,6 @@
34
31
  <Filter Include="turbomodule\core">
35
32
  <UniqueIdentifier>{c4d010df-7391-4171-8658-9048078a5523}</UniqueIdentifier>
36
33
  </Filter>
37
- <Filter Include="jscallinvoker">
38
- <UniqueIdentifier>{d2eae11a-b021-4d0f-bf0f-cc5a164f2579}</UniqueIdentifier>
39
- </Filter>
40
- <Filter Include="jscallinvoker\ReactCommon">
41
- <UniqueIdentifier>{103aab63-7882-4777-85a5-8fdbbc8e54f9}</UniqueIdentifier>
42
- </Filter>
43
34
  <Filter Include="yoga\event">
44
35
  <UniqueIdentifier>{b81cc660-374c-4232-823b-6c76b48564b4}</UniqueIdentifier>
45
36
  </Filter>
@@ -55,8 +46,38 @@
55
46
  <Filter Include="react\renderer\debug">
56
47
  <UniqueIdentifier>{cc363422-d654-4288-b8b8-ea8f38aa7604}</UniqueIdentifier>
57
48
  </Filter>
58
- <Filter Include="react\renderer\mounting">
59
- <UniqueIdentifier>{836654a8-cee1-4d6d-ae20-bd2fb86710f7}</UniqueIdentifier>
49
+ <Filter Include="logger">
50
+ <UniqueIdentifier>{a6918f44-da21-414d-ad25-d9bdb8f8756b}</UniqueIdentifier>
51
+ </Filter>
52
+ <Filter Include="reactperflogger">
53
+ <UniqueIdentifier>{f3362933-5f11-4653-929d-e13607d919b7}</UniqueIdentifier>
54
+ </Filter>
55
+ <Filter Include="reactperflogger\reactperflogger">
56
+ <UniqueIdentifier>{50a825f0-9a6d-454e-94f5-65cf7cad34cc}</UniqueIdentifier>
57
+ </Filter>
58
+ <Filter Include="callinvoker">
59
+ <UniqueIdentifier>{d2eae11a-b021-4d0f-bf0f-cc5a164f2579}</UniqueIdentifier>
60
+ </Filter>
61
+ <Filter Include="callinvoker\ReactCommon">
62
+ <UniqueIdentifier>{103aab63-7882-4777-85a5-8fdbbc8e54f9}</UniqueIdentifier>
63
+ </Filter>
64
+ <Filter Include="react\bridging">
65
+ <UniqueIdentifier>{55de2e00-aeb3-4ab3-a731-6edfc63c4db9}</UniqueIdentifier>
66
+ </Filter>
67
+ <Filter Include="react\renderer\mapbuffer">
68
+ <UniqueIdentifier>{297ffef3-6154-41cf-85b1-75eff3d8fba0}</UniqueIdentifier>
69
+ </Filter>
70
+ <Filter Include="react\nativemodule">
71
+ <UniqueIdentifier>{739297af-da89-4523-899d-02b454fc9330}</UniqueIdentifier>
72
+ </Filter>
73
+ <Filter Include="react\nativemodule\samples">
74
+ <UniqueIdentifier>{d6f7e924-6bcc-49c7-b6c0-59f9199a1bf9}</UniqueIdentifier>
75
+ </Filter>
76
+ <Filter Include="react\nativemodule\samples\ReactCommon">
77
+ <UniqueIdentifier>{e3ff0f65-dba6-4a18-8ec5-acfe73178bb7}</UniqueIdentifier>
78
+ </Filter>
79
+ <Filter Include="react\renderer\telemetry">
80
+ <UniqueIdentifier>{40bfe98f-f174-4c03-9296-d371bc230e53}</UniqueIdentifier>
60
81
  </Filter>
61
82
  </ItemGroup>
62
83
  <ItemGroup>
@@ -120,9 +141,6 @@
120
141
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsi\jsi\JSIDynamic.cpp">
121
142
  <Filter>jsi\jsi</Filter>
122
143
  </ClCompile>
123
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\privatedata\PrivateDataBase.cpp">
124
- <Filter>privatedata</Filter>
125
- </ClCompile>
126
144
  <ClCompile Include="$(YogaDir)\yoga\YGConfig.cpp">
127
145
  <Filter>yoga</Filter>
128
146
  </ClCompile>
@@ -150,10 +168,6 @@
150
168
  <ClCompile Include="$(YogaDir)\yoga\event\event.cpp">
151
169
  <Filter>yoga\event</Filter>
152
170
  </ClCompile>
153
- <CLCompile Include="$(ReactNativeDir)\ReactCommon\reactperflogger\reactperflogger\BridgeNativeModulePerfLogger.cpp" />
154
- <ClCompile Include=".\Yoga.cpp" />
155
- <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\samples\ReactCommon\NativeSampleTurboCxxModuleSpecJSI.cpp" />
156
- <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\samples\ReactCommon\SampleTurboCxxModule.cpp" />
157
171
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\core\Sealable.cpp">
158
172
  <Filter>react\renderer\core</Filter>
159
173
  </ClCompile>
@@ -163,12 +177,29 @@
163
177
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\debug\DebugStringConvertible.cpp">
164
178
  <Filter>react\renderer\debug</Filter>
165
179
  </ClCompile>
180
+ <ClCompile Include="pch.cpp" />
181
+ <ClCompile Include="Yoga.cpp" />
182
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\logger\react_native_log.cpp">
183
+ <Filter>logger</Filter>
184
+ </ClCompile>
185
+ <CLCompile Include="$(ReactNativeDir)\ReactCommon\reactperflogger\reactperflogger\BridgeNativeModulePerfLogger.cpp">
186
+ <Filter>reactperflogger\reactperflogger</Filter>
187
+ </CLCompile>
188
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\mapbuffer\MapBuffer.cpp">
189
+ <Filter>react\renderer\mapbuffer</Filter>
190
+ </ClCompile>
191
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\mapbuffer\MapBufferBuilder.cpp">
192
+ <Filter>react\renderer\mapbuffer</Filter>
193
+ </ClCompile>
194
+ <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\samples\ReactCommon\NativeSampleTurboCxxModuleSpecJSI.cpp">
195
+ <Filter>react\nativemodule\samples\ReactCommon</Filter>
196
+ </CLCompile>
197
+ <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\samples\ReactCommon\SampleTurboCxxModule.cpp">
198
+ <Filter>react\nativemodule\samples\ReactCommon</Filter>
199
+ </CLCompile>
166
200
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\telemetry\TransactionTelemetry.cpp">
167
201
  <Filter>react\renderer\telemetry</Filter>
168
202
  </ClCompile>
169
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\mapbuffer\MapBuffer.cpp" />
170
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\mapbuffer\MapBufferBuilder.cpp" />
171
- <ClCompile Include="pch.cpp" />
172
203
  </ItemGroup>
173
204
  <ItemGroup>
174
205
  <ClInclude Include="..\stubs\sys\mman.h">
@@ -183,15 +214,6 @@
183
214
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\CxxNativeModule.h">
184
215
  <Filter>cxxreact</Filter>
185
216
  </ClInclude>
186
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\Executor.h">
187
- <Filter>cxxreact</Filter>
188
- </ClInclude>
189
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\ExecutorToken.h">
190
- <Filter>cxxreact</Filter>
191
- </ClInclude>
192
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\ExecutorTokenFactory.h">
193
- <Filter>cxxreact</Filter>
194
- </ClInclude>
195
217
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\Instance.h">
196
218
  <Filter>cxxreact</Filter>
197
219
  </ClInclude>
@@ -231,12 +253,6 @@
231
253
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\NativeToJsBridge.h">
232
254
  <Filter>cxxreact</Filter>
233
255
  </ClInclude>
234
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\oss-compat-util.h">
235
- <Filter>cxxreact</Filter>
236
- </ClInclude>
237
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\Platform.h">
238
- <Filter>cxxreact</Filter>
239
- </ClInclude>
240
256
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\ReactMarker.h">
241
257
  <Filter>cxxreact</Filter>
242
258
  </ClInclude>
@@ -258,9 +274,6 @@
258
274
  <ClInclude Include="$(YogaDir)\yoga\YGMacros.h">
259
275
  <Filter>yoga</Filter>
260
276
  </ClInclude>
261
- <ClInclude Include="$(YogaDir)\yoga\YGNodeList.h">
262
- <Filter>yoga</Filter>
263
- </ClInclude>
264
277
  <ClInclude Include="$(YogaDir)\yoga\Yoga.h">
265
278
  <Filter>yoga</Filter>
266
279
  </ClInclude>
@@ -273,15 +286,9 @@
273
286
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsi\jsi\jsi-inl.h">
274
287
  <Filter>jsi\jsi</Filter>
275
288
  </ClInclude>
276
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\privatedata\PrivateDataBase.h">
277
- <Filter>privatedata</Filter>
278
- </ClInclude>
279
289
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleBinding.h">
280
290
  <Filter>turbomodule\core</Filter>
281
291
  </ClInclude>
282
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\bridging\CallbackWrapper.h">
283
- <Filter>turbomodule\core</Filter>
284
- </ClInclude>
285
292
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleUtils.h">
286
293
  <Filter>turbomodule\core</Filter>
287
294
  </ClInclude>
@@ -294,7 +301,18 @@
294
301
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.h">
295
302
  <Filter>turbomodule\core</Filter>
296
303
  </ClInclude>
297
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\callinvoker\ReactCommon\CallInvoker.h" />
298
304
  <ClInclude Include="pch.h" />
305
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\JSExecutor.h">
306
+ <Filter>cxxreact</Filter>
307
+ </ClInclude>
308
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\logger\react_native_log.h">
309
+ <Filter>logger</Filter>
310
+ </ClInclude>
311
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\callinvoker\ReactCommon\CallInvoker.h">
312
+ <Filter>callinvoker\ReactCommon</Filter>
313
+ </ClInclude>
314
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\bridging\CallbackWrapper.h">
315
+ <Filter>react\bridging</Filter>
316
+ </ClInclude>
299
317
  </ItemGroup>
300
318
  </Project>
@@ -0,0 +1,145 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and 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
+
8
+ #pragma once
9
+
10
+ #include <memory>
11
+ #include <string>
12
+
13
+ #include <cxxreact/NativeModule.h>
14
+ #include <folly/dynamic.h>
15
+
16
+ #ifndef RN_EXPORT
17
+ #define RN_EXPORT __attribute__((visibility("default")))
18
+ #endif
19
+
20
+ namespace facebook {
21
+ namespace react {
22
+
23
+ class JSBigString;
24
+ class JSExecutor;
25
+ class JSModulesUnbundle;
26
+ class MessageQueueThread;
27
+ class ModuleRegistry;
28
+ class RAMBundleRegistry;
29
+
30
+ // This interface describes the delegate interface required by
31
+ // Executor implementations to call from JS into native code.
32
+ class ExecutorDelegate {
33
+ public:
34
+ virtual ~ExecutorDelegate() {}
35
+
36
+ virtual std::shared_ptr<ModuleRegistry> getModuleRegistry() = 0;
37
+
38
+ virtual void callNativeModules(
39
+ JSExecutor &executor,
40
+ folly::dynamic &&calls,
41
+ bool isEndOfBatch) = 0;
42
+ virtual MethodCallResult callSerializableNativeHook(
43
+ JSExecutor &executor,
44
+ unsigned int moduleId,
45
+ unsigned int methodId,
46
+ folly::dynamic &&args) = 0;
47
+ };
48
+
49
+ using NativeExtensionsProvider =
50
+ std::function<folly::dynamic(const std::string &)>;
51
+
52
+ class JSExecutorFactory {
53
+ public:
54
+ virtual std::unique_ptr<JSExecutor> createJSExecutor(
55
+ std::shared_ptr<ExecutorDelegate> delegate,
56
+ std::shared_ptr<MessageQueueThread> jsQueue) = 0;
57
+ virtual ~JSExecutorFactory() {}
58
+ };
59
+
60
+ class RN_EXPORT JSExecutor {
61
+ public:
62
+ /**
63
+ * Prepares the JS runtime for React Native by installing global variables.
64
+ * Called once before any JS is evaluated.
65
+ */
66
+ virtual void initializeRuntime() = 0;
67
+ /**
68
+ * Execute an application script bundle in the JS context.
69
+ */
70
+ virtual void loadBundle(
71
+ std::unique_ptr<const JSBigString> script,
72
+ std::string sourceURL) = 0;
73
+
74
+ /**
75
+ * Add an application "RAM" bundle registry
76
+ */
77
+ virtual void setBundleRegistry(
78
+ std::unique_ptr<RAMBundleRegistry> bundleRegistry) = 0;
79
+
80
+ /**
81
+ * Register a file path for an additional "RAM" bundle
82
+ */
83
+ virtual void registerBundle(
84
+ uint32_t bundleId,
85
+ const std::string &bundlePath) = 0;
86
+
87
+ /**
88
+ * Executes BatchedBridge.callFunctionReturnFlushedQueue with the module ID,
89
+ * method ID and optional additional arguments in JS. The executor is
90
+ * responsible for using Bridge->callNativeModules to invoke any necessary
91
+ * native modules methods.
92
+ */
93
+ virtual void callFunction(
94
+ const std::string &moduleId,
95
+ const std::string &methodId,
96
+ const folly::dynamic &arguments) = 0;
97
+
98
+ /**
99
+ * Executes BatchedBridge.invokeCallbackAndReturnFlushedQueue with the cbID,
100
+ * and optional additional arguments in JS and returns the next queue. The
101
+ * executor is responsible for using Bridge->callNativeModules to invoke any
102
+ * necessary native modules methods.
103
+ */
104
+ virtual void invokeCallback(
105
+ const double callbackId,
106
+ const folly::dynamic &arguments) = 0;
107
+
108
+ virtual void setGlobalVariable(
109
+ std::string propName,
110
+ std::unique_ptr<const JSBigString> jsonValue) = 0;
111
+
112
+ virtual void *getJavaScriptContext() {
113
+ return nullptr;
114
+ }
115
+
116
+ /**
117
+ * Returns whether or not the underlying executor supports debugging via the
118
+ * Chrome remote debugging protocol.
119
+ */
120
+ virtual bool isInspectable() {
121
+ return false;
122
+ }
123
+
124
+ /**
125
+ * The description is displayed in the dev menu, if there is one in
126
+ * this build. There is a default, but if this method returns a
127
+ * non-empty string, it will be used instead.
128
+ */
129
+ virtual std::string getDescription() = 0;
130
+
131
+ virtual void handleMemoryPressure(__unused int pressureLevel) {
132
+ }
133
+
134
+ virtual void destroy() {}
135
+ virtual ~JSExecutor() {}
136
+
137
+ virtual void flush() {}
138
+
139
+ static std::string getSyntheticBundlePath(
140
+ uint32_t bundleId,
141
+ const std::string &bundlePath);
142
+ };
143
+
144
+ } // namespace react
145
+ } // namespace facebook