react-native 0.74.0-nightly-20240129-39cb02f6f → 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.
- package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
- package/Libraries/Animated/nodes/AnimatedStyle.js +1 -1
- package/Libraries/Animated/useAnimatedProps.js +1 -1
- package/Libraries/AppDelegate/RCTAppDelegate.mm +2 -1
- package/Libraries/Blob/React-RCTBlob.podspec +1 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.android.js +69 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.d.ts +24 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.js +33 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroidNativeComponent.js +13 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -3
- package/Libraries/Core/registerCallableModule.js +42 -0
- package/Libraries/Image/RCTImageLoader.mm +4 -11
- package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
- package/Libraries/ReactNative/BridgelessUIManager.js +31 -13
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -33
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +12 -0
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +24543 -21110
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +4104 -3058
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4352 -3273
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +25038 -21457
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3721 -2600
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4024 -2869
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +43 -4
- package/Libraries/WebPerformance/Performance.js +1 -1
- package/React/Base/RCTBridge+Private.h +14 -0
- package/React/Base/RCTBridge.mm +6 -0
- package/React/Base/RCTKeyCommands.m +12 -1
- package/React/Base/RCTVersion.m +3 -3
- package/React/CoreModules/RCTAlertController.mm +2 -3
- package/React/CoreModules/RCTAppearance.mm +1 -1
- package/React/CoreModules/React-CoreModules.podspec +1 -0
- package/React/CxxBridge/RCTCxxBridge.mm +21 -3
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +22 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +13 -2
- package/React/Fabric/RCTConversions.h +2 -18
- package/React/React-RCTFabric.podspec +1 -0
- package/React-Core.podspec +1 -3
- package/ReactAndroid/api/ReactAndroid.api +53 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNode.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/DecayAnimation.java +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/animated/DiffClampAnimatedNode.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/ObjectAnimatedNode.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +5 -2
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutor.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +13 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +11 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +24 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/image/ScaleTypeStartInside.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/PopupMenuSelectionEvent.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuContainer.kt +49 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuManager.kt +54 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +2 -2
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +2 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +9 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -1
- package/ReactAndroid/src/main/jni/react/featureflags/ReactNativeFeatureFlagsProviderHolder.cpp +7 -1
- package/ReactAndroid/src/main/jni/react/featureflags/ReactNativeFeatureFlagsProviderHolder.h +2 -1
- package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +16 -10
- package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.cpp +0 -3
- package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.h +0 -1
- package/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp +7 -6
- package/ReactCommon/cxxreact/Instance.cpp +34 -18
- package/ReactCommon/cxxreact/Instance.h +13 -2
- package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/jsinspector-modern/InstanceAgent.cpp +34 -0
- package/ReactCommon/jsinspector-modern/InstanceAgent.h +54 -0
- package/ReactCommon/jsinspector-modern/InstanceTarget.cpp +25 -0
- package/ReactCommon/jsinspector-modern/InstanceTarget.h +58 -0
- package/ReactCommon/jsinspector-modern/PageAgent.cpp +65 -0
- package/ReactCommon/jsinspector-modern/PageAgent.h +13 -0
- package/ReactCommon/jsinspector-modern/PageTarget.cpp +41 -0
- package/ReactCommon/jsinspector-modern/PageTarget.h +28 -1
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +12 -1
- package/ReactCommon/jsinspector-modern/ReactCdp.h +1 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +2 -0
- package/ReactCommon/jsinspector-modern/tests/PageTargetTest.cpp +164 -10
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +18 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +3 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -1
- package/ReactCommon/react/featureflags/tests/ReactNativeFeatureFlagsTest.cpp +4 -0
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -0
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -1
- package/ReactCommon/react/renderer/attributedstring/primitives.h +0 -86
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +0 -16
- package/ReactCommon/react/renderer/components/view/CSSTokenizer.cpp +187 -0
- package/ReactCommon/react/renderer/components/view/CSSTokenizer.h +101 -0
- package/ReactCommon/react/renderer/components/view/tests/CSSTokenizerTest.cpp +144 -0
- package/ReactCommon/react/renderer/core/ComponentDescriptor.h +0 -1
- package/ReactCommon/react/renderer/core/LayoutPrimitives.h +0 -17
- package/ReactCommon/react/renderer/core/propsConversions.h +0 -1
- package/ReactCommon/react/renderer/graphics/Color.h +7 -3
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +6 -1
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +55 -15
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm +132 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/PlatformColorParser.h +4 -18
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/PlatformColorParser.mm +73 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.h +8 -2
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.mm +14 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +4 -19
- package/ReactCommon/react/runtime/ReactInstance.cpp +15 -2
- package/ReactCommon/react/runtime/ReactInstance.h +13 -2
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +5 -3
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +3 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +10 -2
- package/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm +5 -2
- package/ReactCommon/react/utils/hash_combine.h +8 -6
- package/gradle/libs.versions.toml +1 -1
- package/index.js +9 -0
- package/package.json +9 -9
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/src/private/featureflags/NativeReactNativeFeatureFlags.js +2 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +42 -1
- package/src/private/specs/components/PopupMenuAndroidNativeComponent.js +47 -0
- package/template/package.json +5 -5
- 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 '
|
|
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
|
|
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-
|
|
20
|
+
prerelease: 'nightly-20240131-82e9a5e4f',
|
|
22
21
|
};
|
|
23
22
|
|
|
24
23
|
module.exports = {version};
|
|
@@ -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
|
|
47
|
+
static uint64_t getNextImageRequestCount(void)
|
|
48
48
|
{
|
|
49
|
-
static
|
|
50
|
-
|
|
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
|
|
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
|
-
...
|
|
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 '
|
|
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
|
},
|