react-native 0.74.0-nightly-20240128-cfc0ba04a → 1000.0.0

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 (148) hide show
  1. package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
  2. package/Libraries/Animated/nodes/AnimatedStyle.js +1 -1
  3. package/Libraries/Animated/useAnimatedProps.js +1 -1
  4. package/Libraries/AppDelegate/RCTAppDelegate.mm +2 -1
  5. package/Libraries/Blob/React-RCTBlob.podspec +1 -0
  6. package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.android.js +69 -0
  7. package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.d.ts +24 -0
  8. package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.js +33 -0
  9. package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroidNativeComponent.js +13 -0
  10. package/Libraries/Core/ReactNativeVersion.js +2 -3
  11. package/Libraries/Core/ReactNativeVersionCheck.js +1 -1
  12. package/Libraries/Core/registerCallableModule.js +42 -0
  13. package/Libraries/Image/RCTImageLoader.mm +4 -11
  14. package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
  15. package/Libraries/ReactNative/BridgelessUIManager.js +31 -13
  16. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
  17. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -33
  18. package/Libraries/ReactNative/__mocks__/FabricUIManager.js +12 -0
  19. package/Libraries/Renderer/implementations/ReactFabric-dev.js +24543 -21110
  20. package/Libraries/Renderer/implementations/ReactFabric-prod.js +4104 -3058
  21. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4352 -3273
  22. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +25038 -21457
  23. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3721 -2600
  24. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4024 -2869
  25. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +43 -4
  26. package/Libraries/WebPerformance/Performance.js +1 -1
  27. package/React/Base/RCTBridge+Private.h +14 -0
  28. package/React/Base/RCTBridge.mm +6 -0
  29. package/React/Base/RCTKeyCommands.m +12 -1
  30. package/React/Base/RCTVersion.m +3 -3
  31. package/React/CoreModules/RCTAlertController.mm +2 -3
  32. package/React/CoreModules/RCTAppearance.mm +1 -1
  33. package/React/CoreModules/React-CoreModules.podspec +1 -0
  34. package/React/CxxBridge/RCTCxxBridge.mm +21 -3
  35. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +22 -1
  36. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +13 -2
  37. package/React/Fabric/RCTConversions.h +2 -18
  38. package/React/React-RCTFabric.podspec +1 -0
  39. package/React-Core.podspec +1 -3
  40. package/ReactAndroid/api/ReactAndroid.api +53 -1
  41. package/ReactAndroid/gradle.properties +1 -1
  42. package/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNode.java +3 -1
  43. package/ReactAndroid/src/main/java/com/facebook/react/animated/DecayAnimation.java +2 -0
  44. package/ReactAndroid/src/main/java/com/facebook/react/animated/DiffClampAnimatedNode.java +3 -1
  45. package/ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java +3 -1
  46. package/ReactAndroid/src/main/java/com/facebook/react/animated/ObjectAnimatedNode.java +3 -1
  47. package/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.java +3 -1
  48. package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +1 -3
  49. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +5 -2
  50. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +11 -1
  51. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -1
  52. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -1
  53. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -1
  54. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -1
  55. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -1
  56. package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutor.kt +1 -1
  57. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +3 -3
  58. package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +3 -0
  59. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +13 -1
  60. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +7 -0
  61. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +11 -0
  62. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java +9 -1
  63. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +24 -0
  64. package/ReactAndroid/src/main/java/com/facebook/react/views/image/ScaleTypeStartInside.java +1 -1
  65. package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/PopupMenuSelectionEvent.kt +37 -0
  66. package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuContainer.kt +49 -0
  67. package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuManager.kt +54 -0
  68. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java +2 -2
  69. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +2 -2
  70. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +2 -2
  71. package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +2 -0
  72. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +9 -1
  73. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -1
  74. package/ReactAndroid/src/main/jni/react/featureflags/ReactNativeFeatureFlagsProviderHolder.cpp +7 -1
  75. package/ReactAndroid/src/main/jni/react/featureflags/ReactNativeFeatureFlagsProviderHolder.h +2 -1
  76. package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +16 -10
  77. package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.cpp +0 -3
  78. package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.h +0 -1
  79. package/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp +7 -6
  80. package/ReactCommon/cxxreact/Instance.cpp +34 -18
  81. package/ReactCommon/cxxreact/Instance.h +13 -2
  82. package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -1
  83. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  84. package/ReactCommon/jsinspector-modern/InstanceAgent.cpp +34 -0
  85. package/ReactCommon/jsinspector-modern/InstanceAgent.h +54 -0
  86. package/ReactCommon/jsinspector-modern/InstanceTarget.cpp +25 -0
  87. package/ReactCommon/jsinspector-modern/InstanceTarget.h +58 -0
  88. package/ReactCommon/jsinspector-modern/PageAgent.cpp +65 -0
  89. package/ReactCommon/jsinspector-modern/PageAgent.h +13 -0
  90. package/ReactCommon/jsinspector-modern/PageTarget.cpp +41 -0
  91. package/ReactCommon/jsinspector-modern/PageTarget.h +28 -1
  92. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +12 -1
  93. package/ReactCommon/jsinspector-modern/ReactCdp.h +1 -0
  94. package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +2 -0
  95. package/ReactCommon/jsinspector-modern/tests/PageTargetTest.cpp +164 -10
  96. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -1
  97. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -1
  98. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +18 -1
  99. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +3 -1
  100. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -1
  101. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -1
  102. package/ReactCommon/react/featureflags/tests/ReactNativeFeatureFlagsTest.cpp +4 -0
  103. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -0
  104. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -1
  105. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -1
  106. package/ReactCommon/react/renderer/attributedstring/primitives.h +0 -86
  107. package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp +4 -1
  108. package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +0 -16
  109. package/ReactCommon/react/renderer/components/view/CSSTokenizer.cpp +187 -0
  110. package/ReactCommon/react/renderer/components/view/CSSTokenizer.h +101 -0
  111. package/ReactCommon/react/renderer/components/view/tests/CSSTokenizerTest.cpp +144 -0
  112. package/ReactCommon/react/renderer/core/ComponentDescriptor.h +0 -1
  113. package/ReactCommon/react/renderer/core/EventEmitter.cpp +14 -6
  114. package/ReactCommon/react/renderer/core/LayoutPrimitives.h +0 -17
  115. package/ReactCommon/react/renderer/core/graphicsConversions.h +2 -23
  116. package/ReactCommon/react/renderer/core/propsConversions.h +0 -1
  117. package/ReactCommon/react/renderer/graphics/Color.h +7 -3
  118. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +6 -1
  119. package/ReactCommon/react/renderer/graphics/fromRawValueShared.h +50 -0
  120. package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/PlatformColorParser.h +18 -7
  121. package/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/PlatformColorParser.h +16 -4
  122. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +55 -15
  123. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm +132 -0
  124. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/PlatformColorParser.h +15 -17
  125. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/PlatformColorParser.mm +73 -0
  126. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.h +8 -2
  127. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.mm +14 -3
  128. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +4 -19
  129. package/ReactCommon/react/runtime/ReactInstance.cpp +15 -2
  130. package/ReactCommon/react/runtime/ReactInstance.h +13 -2
  131. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +5 -3
  132. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +3 -1
  133. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +10 -2
  134. package/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm +5 -2
  135. package/ReactCommon/react/utils/hash_combine.h +8 -6
  136. package/gradle/libs.versions.toml +1 -1
  137. package/index.js +9 -0
  138. package/package.json +9 -9
  139. package/sdks/hermesc/osx-bin/hermes +0 -0
  140. package/sdks/hermesc/osx-bin/hermesc +0 -0
  141. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  142. package/src/private/featureflags/NativeReactNativeFeatureFlags.js +2 -1
  143. package/src/private/featureflags/ReactNativeFeatureFlags.js +42 -1
  144. package/src/private/specs/components/PopupMenuAndroidNativeComponent.js +47 -0
  145. package/template/Gemfile +3 -1
  146. package/template/package.json +5 -5
  147. package/Libraries/Performance/QuickPerformanceLogger.js +0 -155
  148. package/ReactAndroid/src/main/jni/react/jni/OnLoad.h +0 -16
@@ -18,9 +18,9 @@ import type {
18
18
  } from './NativeAnimatedModule';
19
19
  import type {InterpolationConfigType} from './nodes/AnimatedInterpolation';
20
20
 
21
+ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
21
22
  import NativeEventEmitter from '../EventEmitter/NativeEventEmitter';
22
23
  import RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter';
23
- import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags';
24
24
  import Platform from '../Utilities/Platform';
25
25
  import NativeAnimatedNonTurboModule from './NativeAnimatedModule';
26
26
  import NativeAnimatedTurboModule from './NativeAnimatedTurboModule';
@@ -12,7 +12,7 @@
12
12
 
13
13
  import type {PlatformConfig} from '../AnimatedPlatformConfig';
14
14
 
15
- import ReactNativeFeatureFlags from '../../ReactNative/ReactNativeFeatureFlags';
15
+ import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
16
16
  import flattenStyle from '../../StyleSheet/flattenStyle';
17
17
  import Platform from '../../Utilities/Platform';
18
18
  import NativeAnimatedHelper from '../NativeAnimatedHelper';
@@ -10,8 +10,8 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
13
14
  import {isPublicInstance as isFabricPublicInstance} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils';
14
- import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags';
15
15
  import useRefEffect from '../Utilities/useRefEffect';
16
16
  import {AnimatedEvent} from './AnimatedEvent';
17
17
  import NativeAnimatedHelper from './NativeAnimatedHelper';
@@ -107,6 +107,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
107
107
  sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
108
108
 
109
109
  rootView = (RCTRootView *)surfaceHostingProxyRootView;
110
+ rootView.backgroundColor = [UIColor systemBackgroundColor];
110
111
  } else {
111
112
  if (!self.bridge) {
112
113
  self.bridge = [self createBridgeWithDelegate:self launchOptions:launchOptions];
@@ -251,7 +252,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
251
252
 
252
253
  - (BOOL)bridgelessEnabled
253
254
  {
254
- return NO;
255
+ return [self newArchEnabled];
255
256
  }
256
257
 
257
258
  #pragma mark - RCTComponentViewFactoryComponentProvider
@@ -52,6 +52,7 @@ Pod::Spec.new do |s|
52
52
 
53
53
  add_dependency(s, "React-Codegen")
54
54
  add_dependency(s, "React-NativeModulesApple")
55
+ add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
55
56
  add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
56
57
 
57
58
  if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
@@ -0,0 +1,69 @@
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
+ * @format
8
+ * @flow strict-local
9
+ */
10
+
11
+ import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
12
+ import type {SyntheticEvent} from '../../Types/CoreEventTypes';
13
+ import type {RefObject} from 'react';
14
+
15
+ import PopupMenuAndroidNativeComponent, {
16
+ Commands,
17
+ } from './PopupMenuAndroidNativeComponent';
18
+ import nullthrows from 'nullthrows';
19
+ import * as React from 'react';
20
+ import {useCallback, useImperativeHandle, useRef} from 'react';
21
+
22
+ type PopupMenuSelectionEvent = SyntheticEvent<
23
+ $ReadOnly<{
24
+ item: number,
25
+ }>,
26
+ >;
27
+
28
+ export type PopupMenuAndroidInstance = {
29
+ +show: () => void,
30
+ };
31
+
32
+ type Props = {
33
+ menuItems: $ReadOnlyArray<string>,
34
+ onSelectionChange: number => void,
35
+ children: React.Node,
36
+ instanceRef: RefObject<?PopupMenuAndroidInstance>,
37
+ };
38
+
39
+ export default function PopupMenuAndroid({
40
+ menuItems,
41
+ onSelectionChange,
42
+ children,
43
+ instanceRef,
44
+ }: Props): React.Node {
45
+ const nativeRef = useRef<React.ElementRef<HostComponent<mixed>> | null>(null);
46
+ const _onSelectionChange = useCallback(
47
+ (event: PopupMenuSelectionEvent) => {
48
+ onSelectionChange(event.nativeEvent.item);
49
+ },
50
+ [onSelectionChange],
51
+ );
52
+
53
+ useImperativeHandle(instanceRef, ItemViewabilityInstance => {
54
+ return {
55
+ show() {
56
+ Commands.show(nullthrows(nativeRef.current));
57
+ },
58
+ };
59
+ });
60
+
61
+ return (
62
+ <PopupMenuAndroidNativeComponent
63
+ ref={nativeRef}
64
+ onSelectionChange={_onSelectionChange}
65
+ menuItems={menuItems}>
66
+ {children}
67
+ </PopupMenuAndroidNativeComponent>
68
+ );
69
+ }
@@ -0,0 +1,24 @@
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
+ * @format
8
+ */
9
+
10
+ import type * as React from 'react';
11
+ import {HostComponent} from '../../../types/public/ReactNativeTypes';
12
+
13
+ type PopupMenuAndroidInstance = {
14
+ show: () => void;
15
+ };
16
+
17
+ type Props = {
18
+ menuItems: Array<string>;
19
+ onSelectionChange: (number) => void;
20
+ children: React.ReactNode | undefined;
21
+ instanceRef: React.ElementRef<HostComponent<PopupMenuAndroidInstance>>;
22
+ };
23
+
24
+ declare class PopupMenuAndroid extends React.Component<Props> {}
@@ -0,0 +1,33 @@
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
+ * @format
8
+ * @flow strict-local
9
+ */
10
+
11
+ import type {RefObject} from 'react';
12
+ import type {Node} from 'react';
13
+
14
+ import * as React from 'react';
15
+
16
+ const UnimplementedView = require('../UnimplementedViews/UnimplementedView');
17
+
18
+ export type PopupMenuAndroidInstance = {
19
+ +show: () => void,
20
+ };
21
+
22
+ type Props = {
23
+ menuItems: $ReadOnlyArray<string>,
24
+ onSelectionChange: number => void,
25
+ children: Node,
26
+ instanceRef: RefObject<?PopupMenuAndroidInstance>,
27
+ };
28
+
29
+ function PopupMenuAndroid(props: Props): Node {
30
+ return <UnimplementedView />;
31
+ }
32
+
33
+ export default PopupMenuAndroid;
@@ -0,0 +1,13 @@
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
+ * @format
8
+ * @flow strict-local
9
+ */
10
+
11
+ export * from '../../../src/private/specs/components/PopupMenuAndroidNativeComponent';
12
+ import PopupMenuAndroidNativeComponent from '../../../src/private/specs/components/PopupMenuAndroidNativeComponent';
13
+ export default PopupMenuAndroidNativeComponent;
@@ -1,12 +1,11 @@
1
1
  /**
2
- * @generated by scripts/set-rn-version.js
3
- *
4
2
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
3
  *
6
4
  * This source code is licensed under the MIT license found in the
7
5
  * LICENSE file in the root directory of this source tree.
8
6
  *
9
7
  * @flow strict
8
+ * @generated by scripts/releases/set-rn-version.js
10
9
  */
11
10
 
12
11
  const version: $ReadOnly<{
@@ -18,7 +17,7 @@ const version: $ReadOnly<{
18
17
  major: 0,
19
18
  minor: 74,
20
19
  patch: 0,
21
- prerelease: 'nightly-20240128-cfc0ba04a',
20
+ prerelease: 'nightly-20240131-82e9a5e4f',
22
21
  };
23
22
 
24
23
  module.exports = {version};
@@ -34,7 +34,7 @@ const checkVersions = function checkVersions(): void {
34
34
  `Native version: ${_formatVersion(nativeVersion)}\n\n` +
35
35
  'Make sure that you have rebuilt the native code. If the problem ' +
36
36
  'persists try clearing the Watchman and packager caches with ' +
37
- '`watchman watch-del-all && react-native start --reset-cache`.',
37
+ '`watchman watch-del-all && npx react-native start --reset-cache`.',
38
38
  );
39
39
  }
40
40
  };
@@ -0,0 +1,42 @@
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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ type Module = {...};
14
+ type RegisterCallableModule = (
15
+ name: string,
16
+ moduleOrFactory: Module | (void => Module),
17
+ ) => void;
18
+
19
+ const registerCallableModule: RegisterCallableModule = (function () {
20
+ if (global.RN$Bridgeless === true) {
21
+ return (name, moduleOrFactory) => {
22
+ if (typeof moduleOrFactory === 'function') {
23
+ global.RN$registerCallableModule(name, moduleOrFactory);
24
+ return;
25
+ }
26
+
27
+ global.RN$registerCallableModule(name, () => moduleOrFactory);
28
+ };
29
+ }
30
+
31
+ const BatchedBridge = require('../BatchedBridge/BatchedBridge');
32
+ return (name, moduleOrFactory) => {
33
+ if (typeof moduleOrFactory === 'function') {
34
+ BatchedBridge.registerLazyCallableModule(name, moduleOrFactory);
35
+ return;
36
+ }
37
+
38
+ BatchedBridge.registerCallableModule(name, moduleOrFactory);
39
+ };
40
+ })();
41
+
42
+ export default registerCallableModule;
@@ -44,16 +44,10 @@ static NSInteger RCTImageBytesForImage(UIImage *image)
44
44
  return image.images ? image.images.count * singleImageBytes : singleImageBytes;
45
45
  }
46
46
 
47
- static uint64_t monotonicTimeGetCurrentNanoseconds(void)
47
+ static uint64_t getNextImageRequestCount(void)
48
48
  {
49
- static struct mach_timebase_info tb_info = {0};
50
- static dispatch_once_t onceToken;
51
- dispatch_once(&onceToken, ^{
52
- __unused int ret = mach_timebase_info(&tb_info);
53
- assert(0 == ret);
54
- });
55
-
56
- return (mach_absolute_time() * tb_info.numer) / tb_info.denom;
49
+ static uint64_t requestCounter = 0;
50
+ return requestCounter++;
57
51
  }
58
52
 
59
53
  static NSError *addResponseHeadersToError(NSError *originalError, NSHTTPURLResponse *response)
@@ -528,8 +522,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image, CGSize size, CGFloat scal
528
522
  auto cancelled = std::make_shared<std::atomic<int>>(0);
529
523
  __block dispatch_block_t cancelLoad = nil;
530
524
  __block NSLock *cancelLoadLock = [NSLock new];
531
- NSString *requestId =
532
- [NSString stringWithFormat:@"%@-%llu", [[NSUUID UUID] UUIDString], monotonicTimeGetCurrentNanoseconds()];
525
+ NSString *requestId = [NSString stringWithFormat:@"%@-%llu", [[NSUUID UUID] UUIDString], getNextImageRequestCount()];
533
526
 
534
527
  void (^completionHandler)(NSError *, id, id, NSURLResponse *) =
535
528
  ^(NSError *error, id imageOrData, id imageMetadata, NSURLResponse *response) {
@@ -16,8 +16,8 @@ import type {
16
16
  LayoutAnimationType,
17
17
  } from '../Renderer/shims/ReactNativeTypes';
18
18
 
19
+ import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
19
20
  import {getFabricUIManager} from '../ReactNative/FabricUIManager';
20
- import ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags';
21
21
  import Platform from '../Utilities/Platform';
22
22
 
23
23
  const UIManager = require('../ReactNative/UIManager');
@@ -122,7 +122,7 @@ const UIManagerJSOverridenAPIs = {
122
122
  * In OSS, the New Architecture will just use the Fabric renderer, which uses
123
123
  * different APIs.
124
124
  */
125
- const UIManagerJSUnusedAPIs = {
125
+ const UIManagerJSUnusedInNewArchAPIs = {
126
126
  createView: (
127
127
  reactTag: ?number,
128
128
  viewName: string,
@@ -155,6 +155,34 @@ const UIManagerJSUnusedAPIs = {
155
155
  },
156
156
  };
157
157
 
158
+ /**
159
+ * Leave unimplemented: These APIs are deprecated in UIManager. We will eventually remove
160
+ * them from React Native.
161
+ */
162
+ const UIManagerJSDeprecatedPlatformAPIs = Platform.select({
163
+ android: {
164
+ // TODO(T175424986): Remove UIManager.showPopupMenu() in React Native v0.75.
165
+ showPopupMenu: (
166
+ reactTag: ?number,
167
+ items: Array<string>,
168
+ error: (error: Object) => void,
169
+ success: (event: string, selected?: number) => void,
170
+ ): void => {
171
+ raiseSoftError(
172
+ 'showPopupMenu',
173
+ 'Please use the <PopupMenuAndroid /> component instead.',
174
+ );
175
+ },
176
+ // TODO(T175424986): Remove UIManager.dismissPopupMenu() in React Native v0.75.
177
+ dismissPopupMenu: (): void => {
178
+ raiseSoftError(
179
+ 'dismissPopupMenu',
180
+ 'Please use the <PopupMenuAndroid /> component instead.',
181
+ );
182
+ },
183
+ },
184
+ });
185
+
158
186
  const UIManagerJSPlatformAPIs = Platform.select({
159
187
  android: {
160
188
  getConstantsForViewManager: (viewManagerName: string): ?Object => {
@@ -232,17 +260,6 @@ const UIManagerJSPlatformAPIs = Platform.select({
232
260
 
233
261
  FabricUIManager.sendAccessibilityEvent(shadowNode, eventName);
234
262
  },
235
- showPopupMenu: (
236
- reactTag: ?number,
237
- items: Array<string>,
238
- error: (error: Object) => void,
239
- success: (event: string, selected?: number) => void,
240
- ): void => {
241
- raiseSoftError('showPopupMenu');
242
- },
243
- dismissPopupMenu: (): void => {
244
- raiseSoftError('dismissPopupMenu');
245
- },
246
263
  },
247
264
  ios: {
248
265
  /**
@@ -293,8 +310,9 @@ const UIManagerJSPlatformAPIs = Platform.select({
293
310
 
294
311
  const UIManagerJS: UIManagerJSInterface & {[string]: any} = {
295
312
  ...UIManagerJSOverridenAPIs,
313
+ ...UIManagerJSDeprecatedPlatformAPIs,
296
314
  ...UIManagerJSPlatformAPIs,
297
- ...UIManagerJSUnusedAPIs,
315
+ ...UIManagerJSUnusedInNewArchAPIs,
298
316
  getViewManagerConfig: (viewManagerName: string): mixed => {
299
317
  if (getUIManagerConstants) {
300
318
  const constants = getUIManagerConstantsCached();
@@ -23,7 +23,7 @@ import type {
23
23
  } from '../../Renderer/shims/ReactNativeTypes';
24
24
  import type ReactFabricHostComponent from './ReactFabricHostComponent';
25
25
 
26
- import ReactNativeFeatureFlags from '../ReactNativeFeatureFlags';
26
+ import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
27
27
 
28
28
  // Lazy loaded to avoid evaluating the module when using the legacy renderer.
29
29
  let PublicInstanceClass:
@@ -9,11 +9,6 @@
9
9
  */
10
10
 
11
11
  export type FeatureFlags = {|
12
- /**
13
- * Function used to enable / disabled Layout Animations in React Native.
14
- * Default value = true.
15
- */
16
- isLayoutAnimationEnabled: () => boolean,
17
12
  /**
18
13
  * Function used to enable / disable W3C pointer event emitting in React Native.
19
14
  * If enabled you must also flip the equivalent native flags on each platform:
@@ -26,39 +21,11 @@ export type FeatureFlags = {|
26
21
  * for its hover callbacks
27
22
  */
28
23
  shouldPressibilityUseW3CPointerEventsForHover: () => boolean,
29
- /**
30
- * Enables an experimental flush-queue debouncing in Animated.js.
31
- */
32
- animatedShouldDebounceQueueFlush: () => boolean,
33
- /**
34
- * Enables an experimental mega-operation for Animated.js that replaces
35
- * many calls to native with a single call into native, to reduce JSI/JNI
36
- * traffic.
37
- */
38
- animatedShouldUseSingleOp: () => boolean,
39
- /**
40
- * Enables access to the host tree in Fabric using DOM-compatible APIs.
41
- */
42
- enableAccessToHostTreeInFabric: () => boolean,
43
- /**
44
- * Enables use of AnimatedObject for animating transform values.
45
- */
46
- shouldUseAnimatedObjectForTransform: () => boolean,
47
- /**
48
- * Enables use of setNativeProps in JS driven animations.
49
- */
50
- shouldUseSetNativePropsInFabric: () => boolean,
51
24
  |};
52
25
 
53
26
  const ReactNativeFeatureFlags: FeatureFlags = {
54
- isLayoutAnimationEnabled: () => true,
55
27
  shouldEmitW3CPointerEvents: () => false,
56
28
  shouldPressibilityUseW3CPointerEventsForHover: () => false,
57
- animatedShouldDebounceQueueFlush: () => false,
58
- animatedShouldUseSingleOp: () => false,
59
- enableAccessToHostTreeInFabric: () => false,
60
- shouldUseAnimatedObjectForTransform: () => false,
61
- shouldUseSetNativePropsInFabric: () => true,
62
29
  };
63
30
 
64
31
  module.exports = ReactNativeFeatureFlags;
@@ -24,6 +24,8 @@ import type {
24
24
  Spec as FabricUIManager,
25
25
  } from '../FabricUIManager';
26
26
 
27
+ import {createRootTag} from '../RootTag.js';
28
+
27
29
  export type NodeMock = {
28
30
  children: NodeSet,
29
31
  instanceHandle: InternalInstanceHandle,
@@ -160,6 +162,7 @@ function hasDisplayNone(node: Node): boolean {
160
162
  }
161
163
 
162
164
  interface IFabricUIManagerMock extends FabricUIManager {
165
+ getRoot(rootTag: RootTag | number): NodeSet;
163
166
  __getInstanceHandleFromNode(node: Node): InternalInstanceHandle;
164
167
  __addCommitHook(commitHook: UIManagerCommitHook): void;
165
168
  __removeCommitHook(commitHook: UIManagerCommitHook): void;
@@ -638,6 +641,15 @@ const FabricUIManagerMock: IFabricUIManagerMock = {
638
641
  return 'RN:' + fromNode(node).viewName;
639
642
  }),
640
643
 
644
+ getRoot(containerTag: RootTag | number): NodeSet {
645
+ const tag = createRootTag(containerTag);
646
+ const root = roots.get(tag);
647
+ if (!root) {
648
+ throw new Error('No root found for containerTag ' + Number(tag));
649
+ }
650
+ return root;
651
+ },
652
+
641
653
  __getInstanceHandleFromNode(node: Node): InternalInstanceHandle {
642
654
  return fromNode(node).instanceHandle;
643
655
  },