Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration 12/1 #12571

Merged
merged 22 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
da9bc16
integrate c464b215e
TatianaKapos Jan 9, 2024
27377fa
Change files
TatianaKapos Jan 9, 2024
b262a1a
force to use latest JSIDynamic
TatianaKapos Jan 9, 2024
98d427c
integrate c30f2b620
TatianaKapos Jan 9, 2024
7773143
fix lint and snapshot
TatianaKapos Jan 9, 2024
dd7b27a
Merge branch 'main' of https://github.com/TatianaKapos/react-native-w…
TatianaKapos Jan 10, 2024
8a3f113
Merge branch 'main' of https://github.com/TatianaKapos/react-native-w…
TatianaKapos Jan 10, 2024
e39cace
add issue numbers
TatianaKapos Jan 10, 2024
0f826a0
add setExternalMemoryPressure
TatianaKapos Jan 10, 2024
71f2a54
fix build
TatianaKapos Jan 10, 2024
888697c
revert changes
TatianaKapos Jan 12, 2024
738e84e
Merge branch 'main' of https://github.com/TatianaKapos/react-native-w…
TatianaKapos Jan 12, 2024
f602ff8
Merge branch 'main' of https://github.com/TatianaKapos/react-native-w…
TatianaKapos Jan 16, 2024
d4469ae
Update NodeApiJsi with the new JSI APIs
vmoroz Jan 18, 2024
51f87c9
Merge remote-tracking branch 'upstream/main' into tk-integrate-12-1
vmoroz Jan 18, 2024
a787664
Fix Microsoft.ReactNative.Cxx
vmoroz Jan 18, 2024
fa2058b
Remove JSIDynamic overrides
vmoroz Jan 19, 2024
b231592
Merge remote-tracking branch 'upstream/main' into tk-integrate-12-1
vmoroz Jan 19, 2024
fde6883
Add missing setExternalMemoryPressure implementations
vmoroz Jan 19, 2024
f0cdd1d
Fix unused parameter errors
vmoroz Jan 19, 2024
58414e2
See JSI_VERSION to 11 in Microsoft.ReactNative.Cxx
vmoroz Jan 19, 2024
53bc7e3
Disable failing JSI test
vmoroz Jan 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "integrate 12/1",
"packageName": "@office-iss/react-native-win32",
"email": "tatianakapos@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "integrate c464b215e",
"packageName": "@react-native-windows/automation-channel",
"email": "tatianakapos@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "integrate 12/1",
"packageName": "react-native-windows",
"email": "tatianakapos@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"excludePatterns": [
"src/js/examples-win32/**"
],
"baseVersion": "0.74.0-nightly-20231116-fa89dd68b",
"baseVersion": "0.74.0-nightly-20231201-c30f2b620",
"overrides": [
{
"type": "patch",
Expand Down
4 changes: 2 additions & 2 deletions packages/@office-iss/react-native-win32-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"peerDependencies": {
"@office-iss/react-native-win32": "^0.0.0-canary.226",
"react": "18.0.0",
"react-native": "0.74.0-nightly-20231116-fa89dd68b"
"react-native": "0.74.0-nightly-20231201-c30f2b620"
},
"devDependencies": {
"@office-iss/react-native-win32": "^0.0.0-canary.226",
Expand All @@ -30,7 +30,7 @@
"@types/node": "^18.0.0",
"eslint": "^8.19.0",
"just-scripts": "^1.3.3",
"react-native": "0.74.0-nightly-20231116-fa89dd68b",
"react-native": "0.74.0-nightly-20231201-c30f2b620",
"react-native-platform-override": "^1.9.17",
"typescript": "^4.9.5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@office-iss/react-native-win32/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ untyped-import
untyped-type-import

[version]
^0.222.0
^0.223.0
16 changes: 8 additions & 8 deletions packages/@office-iss/react-native-win32/overrides.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
"**/__snapshots__/**",
"src/rntypes/**"
],
"baseVersion": "0.74.0-nightly-20231116-fa89dd68b",
"baseVersion": "0.74.0-nightly-20231201-c30f2b620",
"overrides": [
{
"type": "derived",
"file": ".flowconfig",
"baseFile": ".flowconfig",
"baseHash": "397a9d59e4415e8758adc635d5e016070e6d85d7"
"baseHash": "172a4663d9243a77e3b35a2d8a5e403fd62062cf"
},
{
"type": "derived",
"file": "src/index.win32.js",
"baseFile": "packages/react-native/index.js",
"baseHash": "b658f287732c27fdd28722a8765c3b1b0c1316fa"
"baseHash": "6c91f268c2189f9db74bead7fef1ed262c77586e"
},
{
"type": "platform",
Expand Down Expand Up @@ -112,7 +112,7 @@
"type": "derived",
"file": "src/Libraries/Components/ScrollView/ScrollView.win32.js",
"baseFile": "packages/react-native/Libraries/Components/ScrollView/ScrollView.js",
"baseHash": "6e3e4933173d1f910232f3f46602e2f525127eb5"
"baseHash": "6367cf4ba4637cd8292b68c629cb9d59df99ade1"
},
{
"type": "platform",
Expand All @@ -130,7 +130,7 @@
"type": "derived",
"file": "src/Libraries/Components/TextInput/TextInput.win32.js",
"baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.js",
"baseHash": "d12fe54e9da3be0b1003a5bc18fa3c6d09728564"
"baseHash": "f6742637eda13080bd175a45eb0edbc83fa260c5"
},
{
"type": "patch",
Expand Down Expand Up @@ -252,7 +252,7 @@
"type": "derived",
"file": "src/Libraries/Image/Image.win32.js",
"baseFile": "packages/react-native/Libraries/Image/Image.ios.js",
"baseHash": "bccd20ad47baa18b187bd8eb92b7627135be29fd",
"baseHash": "ba2c259fd454ed0c0f73b82f6390fef8045320ab",
"issue": 4320
},
{
Expand Down Expand Up @@ -306,7 +306,7 @@
"type": "patch",
"file": "src/Libraries/Inspector/Inspector.win32.js",
"baseFile": "packages/react-native/Libraries/Inspector/Inspector.js",
"baseHash": "03565787cbe09078824ee3fcfc12401085995454"
"baseHash": "db79965ed999c40d6bebaf1860a0921749d54b4f"
},
{
"type": "patch",
Expand Down Expand Up @@ -511,7 +511,7 @@
"type": "copy",
"file": "src/Libraries/Utilities/useMergeRefs.js",
"baseFile": "packages/react-native/Libraries/Utilities/useMergeRefs.js",
"baseHash": "d21cc9b2de5af9f398429e7a03c5f13ea7dc7227"
"baseHash": "1f1ca637132e6e0fe1549ba520d98508269ca2bd"
}
]
}
18 changes: 9 additions & 9 deletions packages/@office-iss/react-native-win32/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
"@react-native-community/cli-platform-android": "12.0.0",
"@react-native-community/cli-platform-ios": "12.0.0",
"@react-native/assets": "1.0.0",
"@react-native/assets-registry": "0.74.0-nightly-20231116-fa89dd68b",
"@react-native/codegen": "0.74.0-nightly-20231116-fa89dd68b",
"@react-native/community-cli-plugin": "0.74.0-nightly-20231116-fa89dd68b",
"@react-native/gradle-plugin": "0.74.0-nightly-20231116-fa89dd68b",
"@react-native/js-polyfills": "0.74.0-nightly-20231116-fa89dd68b",
"@react-native/assets-registry": "0.74.0-nightly-20231201-c30f2b620",
"@react-native/codegen": "0.74.0-nightly-20231201-c30f2b620",
"@react-native/community-cli-plugin": "0.74.0-nightly-20231201-c30f2b620",
"@react-native/gradle-plugin": "0.74.0-nightly-20231201-c30f2b620",
"@react-native/js-polyfills": "0.74.0-nightly-20231201-c30f2b620",
"@react-native/metro-config": "^0.73.0",
"@react-native/normalize-colors": "0.74.0-nightly-20231116-fa89dd68b",
"@react-native/virtualized-lists": "0.74.0-nightly-20231116-fa89dd68b",
"@react-native/normalize-colors": "0.74.0-nightly-20231201-c30f2b620",
"@react-native/virtualized-lists": "0.74.0-nightly-20231201-c30f2b620",
"abort-controller": "^3.0.0",
"anser": "^1.4.9",
"ansi-regex": "^5.0.0",
Expand Down Expand Up @@ -85,13 +85,13 @@
"just-scripts": "^1.3.3",
"prettier": "^2.4.1",
"react": "18.2.0",
"react-native": "0.74.0-nightly-20231116-fa89dd68b",
"react-native": "0.74.0-nightly-20231201-c30f2b620",
"react-native-platform-override": "^1.9.17",
"typescript": "^4.9.5"
},
"peerDependencies": {
"react": "18.2.0",
"react-native": "0.74.0-nightly-20231116-fa89dd68b"
"react-native": "0.74.0-nightly-20231201-c30f2b620"
},
"beachball": {
"defaultNpmTag": "canary",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1148,21 +1148,6 @@ class ScrollView extends React.Component<Props, State> {
}

_handleScroll = (e: ScrollEvent) => {
if (__DEV__) {
if (
this.props.onScroll &&
this.props.scrollEventThrottle == null &&
Platform.OS === 'ios'
) {
console.log(
'You specified `onScroll` on a <ScrollView> but not ' +
'`scrollEventThrottle`. You will only receive one event. ' +
'Using `16` you get all the events but be aware that it may ' +
"cause frame drops, use a bigger number if you don't need as " +
'much precision.',
);
}
}
this._observedScrollSinceBecomingResponder = true;
this.props.onScroll && this.props.onScroll(e);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,12 @@ export type Props = $ReadOnly<{|
*/
selectionColor?: ?ColorValue,

/**
* The text selection handle color.
* @platform android
*/
selectionHandleColor?: ?ColorValue,

/**
* If `true`, all text will automatically be selected on focus.
*/
Expand Down Expand Up @@ -1156,6 +1162,9 @@ function InternalTextInput(props: Props): React.Node {
id,
tabIndex,
selection: propsSelection,
selectionColor,
selectionHandleColor,
cursorColor,
...otherProps
} = props;

Expand Down Expand Up @@ -1329,10 +1338,7 @@ function InternalTextInput(props: Props): React.Node {
[mostRecentEventCount, viewCommands],
);

const ref = useMergeRefs<TextInputInstance | null>(
setLocalRef,
props.forwardedRef,
);
const ref = useMergeRefs<TextInputInstance>(setLocalRef, props.forwardedRef);

const _onChange = (event: ChangeEvent) => {
const currentText = event.nativeEvent.text;
Expand Down Expand Up @@ -1620,7 +1626,15 @@ function InternalTextInput(props: Props): React.Node {
if (childCount > 1) {
children = <Text>{children}</Text>;
}

// For consistency with iOS set cursor/selectionHandle color as selectionColor
const colorProps = {
selectionColor,
selectionHandleColor:
selectionHandleColor === undefined
? selectionColor
: selectionHandleColor,
cursorColor: cursorColor === undefined ? selectionColor : cursorColor,
};
textInput = (
/* $FlowFixMe[prop-missing] the types for AndroidTextInput don't match up
* exactly with the props for TextInput. This will need to get fixed */
Expand All @@ -1634,6 +1648,7 @@ function InternalTextInput(props: Props): React.Node {
// $FlowFixMe[incompatible-type] - Figure out imperative + forward refs.
ref={ref}
{...otherProps}
{...colorProps}
{...eventHandlers}
accessibilityErrorMessage={accessibilityErrorMessage}
accessibilityState={_accessibilityState}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import {createRootTag} from '../ReactNative/RootTag';
import flattenStyle from '../StyleSheet/flattenStyle';
import StyleSheet from '../StyleSheet/StyleSheet';
import ImageAnalyticsTagContext from './ImageAnalyticsTagContext';
import {unstable_getImageComponentDecorator} from './ImageInjection';
import {
unstable_getImageComponentDecorator,
useWrapRefWithImageAttachedCallbacks,
} from './ImageInjection';
import {getImageSourcesFromImageProps} from './ImageSourceUtils';
import {convertObjectFitToResizeMode} from './ImageUtils';
import ImageViewNativeComponent from './ImageViewNativeComponent';
Expand Down Expand Up @@ -190,6 +193,8 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
};
const accessibilityLabel = props['aria-label'] ?? props.accessibilityLabel;

const actualRef = useWrapRefWithImageAttachedCallbacks(forwardedRef);

return (
// [Win32
<TextAncestor.Consumer>
Expand All @@ -209,7 +214,7 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
{...restProps}
accessible={props.alt !== undefined ? true : props.accessible}
accessibilityLabel={accessibilityLabel ?? props.alt}
ref={forwardedRef}
ref={actualRef}
style={style}
resizeMode={resizeMode}
tintColor={tintColor}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import type {
} from '../Renderer/shims/ReactNativeTypes';
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
import type {ReactDevToolsAgent} from '../Types/ReactDevToolsTypes';
import type {HostRef} from './getInspectorDataForViewAtPoint';

const PressabilityDebug = require('../Pressability/PressabilityDebug');
const ReactNative = require('../Renderer/shims/ReactNative');
Expand Down Expand Up @@ -47,15 +46,15 @@ export type InspectedElement = $ReadOnly<{
export type ElementsHierarchy = InspectorData['hierarchy'];

type Props = {
inspectedView: ?HostRef,
inspectedViewRef: React.RefObject<React.ElementRef<typeof View> | null>,
onRequestRerenderApp: () => void,
reactDevToolsAgent?: ReactDevToolsAgent,
};

const UIManager = require('../ReactNative/UIManager'); // [Win32]

function Inspector({
inspectedView,
inspectedViewRef,
onRequestRerenderApp,
reactDevToolsAgent,
}: Props): React.Node {
Expand Down Expand Up @@ -115,7 +114,7 @@ function Inspector({
}

// [Win32 Avoid Dimensions call
const node = ReactNative.findNodeHandle(inspectedView);
const node = ReactNative.findNodeHandle(inspectedViewRef);
// $FlowFixMe[incompatible-call]
UIManager.measure(node, (x, y, width, height, left, top) => {
setPanelPosition(pointerY > height / 2 ? 'top' : 'bottom');
Expand All @@ -132,7 +131,7 @@ function Inspector({

// ]Win32
getInspectorDataForViewAtPoint(
inspectedView,
inspectedViewRef.current,
locationX,
locationY,
viewData => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
* @format
*/

import * as React from 'react';
import {useCallback} from 'react';

type CallbackRef<T> = T => mixed;
type ObjectRef<T> = {current: T, ...};

type Ref<T> = CallbackRef<T> | ObjectRef<T>;

/**
* Constructs a new ref that forwards new values to each of the given refs. The
* given refs will always be invoked in the order that they are supplied.
Expand All @@ -24,11 +20,11 @@ type Ref<T> = CallbackRef<T> | ObjectRef<T>;
* the returned callback ref is supplied as a `ref` to a React element, this may
* lead to problems with the given refs being invoked more times than desired.
*/
export default function useMergeRefs<T>(
...refs: $ReadOnlyArray<?Ref<T>>
): CallbackRef<T> {
export default function useMergeRefs<Instance>(
...refs: $ReadOnlyArray<?React.RefSetter<Instance>>
): (Instance | null) => void {
return useCallback(
(current: T) => {
(current: Instance | null) => {
for (const ref of refs) {
if (ref != null) {
if (typeof ref === 'function') {
Expand Down
Loading