Skip to content

Commit

Permalink
Merge pull request #1945 from Saadnajmi/73-cut
Browse files Browse the repository at this point in the history
Merge up to 0.73 branch cut
  • Loading branch information
Saadnajmi authored Oct 4, 2023
2 parents dbbfafc + 6ecbce1 commit 34b8bc0
Show file tree
Hide file tree
Showing 106 changed files with 1,155 additions and 632 deletions.
2 changes: 1 addition & 1 deletion .ado/templates/apple-job-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ steps:
displayName: Run publish-npm.js
inputs:
script: |
node ./scripts/publish-npm.js --${{ parameters.build_type }}
node ./scripts/publish-npm.js -t ${{ parameters.build_type }}
2 changes: 1 addition & 1 deletion .circleci/configurations/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ jobs:
else
export ORG_GRADLE_PROJECT_reactNativeArchitectures="armeabi-v7a,arm64-v8a,x86,x86_64"
fi
node ./scripts/publish-npm.js --<< parameters.release_type >>
node ./scripts/publish-npm.js -t << parameters.release_type >>
- run:
name: Zip Maven Artifacts from /tmp/maven-local
Expand Down
4 changes: 2 additions & 2 deletions .circleci/configurations/top_level.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ references:
rntester_podfile_lock_cache_key: &rntester_podfile_lock_cache_key v6-podfilelock-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}

# Cocoapods - Template
template_cocoapods_cache_key: &template_cocoapods_cache_key v4-cocoapods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile.lock" }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}
template_podfile_lock_cache_key: &template_podfile_lock_cache_key v4-podfilelock-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}
template_cocoapods_cache_key: &template_cocoapods_cache_key v4-cocoapods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile.lock" }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile" }}-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "packages/rn-tester/Podfile.lock }}
template_podfile_lock_cache_key: &template_podfile_lock_cache_key v4-podfilelock-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/iOSTemplateProject/ios/Podfile" }}-{{ checksum "/tmp/week_year" }}-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "packages/rn-tester/Podfile.lock }}

# Windows
windows_yarn_cache_key: &windows_yarn_cache_key v1-win-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
Expand Down
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ untyped-import
untyped-type-import

[version]
^0.216.1
^0.217.0
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

This file contains all changelogs for latest releases, from 0.70.0 onward. Please check out the other `CHANGELOG-*.md` files for previous versions.

## v0.72.5

### Changed
- Bump CLI to 11.3.7 ([6f02d55deb](https://github.com/facebook/react-native/commit/6f02d55debe818dcb1db753f2ca4cc0b804d0df5) by [@huntie](https://github.com/huntie))
- Bump @react-native/codegen to 0.72.7 ([4da991407d](https://github.com/facebook/react-native/commit/4da991407da2791f22ded368ad04457b03be5ee3) by [@Titozzz](https://github.com/Titozzz))

### Fixed
#### Android specific

- Fix building Android on Windows. ([054ab62be0](https://github.com/facebook/react-native/commit/054ab62be0db5d14f02f5aeb4c696f037ea68794) by [@alespergl](https://github.com/alespergl))
- A bug fix for Android builds with new arch on Windows host. ([a323249e0a](https://github.com/facebook/react-native/commit/a323249e0a0f9c2fb75ee05d7da62a34f3c56be0) by [@birdofpreyru](https://github.com/birdofpreyru))
- Fix null crash when using maintainVisibleContentPosition on Android ([1a1a79871b](https://github.com/facebook/react-native/commit/1a1a79871b2d040764537433b431bc3b416904e3) by [@janicduplessis](https://github.com/janicduplessis))

#### iOS specific

- XCode 15 fixes ([21763e85e3](https://github.com/facebook/react-native/commit/21763e85e39e17a19a1cf7a9026ef74517464749), [0dbd621c59](https://github.com/facebook/react-native/commit/0dbd621c598e3ba7a203ec41bb70ce395ad1d62c) & [8a5b2d6735](https://github.com/facebook/react-native/commit/8a5b2d673502037731ee6bc40fc64cdd22139011))
- Fix timer background state when App is launched from background ([a4ea737ae1](https://github.com/facebook/react-native/commit/a4ea737ae1773e7fd49969ae20b962bdd7481b37) by [@zhongwuzw](https://github.com/zhongwuzw))
- Guard `JSGlobalContextSetInspectable` behind a compile time check for Xcode 14.3+ ([3eeee11d7a](https://github.com/facebook/react-native/commit/3eeee11d7ac4075d0917233d3be4a9469f802d35) by [@Saadnajmi](https://github.com/Saadnajmi))
- Re-enable direct debugging with JSC on iOS 16.4+ ([8b1bf058c4](https://github.com/facebook/react-native/commit/8b1bf058c4bcbf4e5ca45b0056217266a1ed870c) by [@huntie](https://github.com/huntie))

## v0.72.4

### Added
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.15.0",
"flow-bin": "^0.216.1",
"flow-bin": "^0.217.0",
"glob": "^7.1.1",
"hermes-eslint": "0.15.0",
"inquirer": "^7.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/community-cli-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
],
"dependencies": {
"@react-native/dev-middleware": "^0.73.0",
"@react-native-community/cli-server-api": "12.0.0-alpha.12",
"@react-native-community/cli-tools": "12.0.0-alpha.12",
"@react-native-community/cli-server-api": "12.0.0-alpha.15",
"@react-native-community/cli-tools": "12.0.0-alpha.15",
"@react-native/metro-babel-transformer": "^0.73.11",
"chalk": "^4.0.0",
"execa": "^5.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@babel/template": "^7.0.0",
"@react-native/babel-plugin-codegen": "*",
"babel-plugin-transform-flow-enums": "^0.0.2",
"react-refresh": "^0.4.0"
"react-refresh": "^0.14.0"
},
"peerDependencies": {
"@babel/core": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`GenerateModuleCpp can generate a header file NativeModule specs with as
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
* @generated by codegen project: GenerateModuleCpp.js
*/
#include \\"RNCodegenModuleFixturesJSI.h\\"
Expand Down Expand Up @@ -830,7 +830,7 @@ exports[`GenerateModuleCpp can generate an implementation file NativeModule spec
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
* @generated by codegen project: GenerateModuleCpp.js
*/
#include \\"RNCodegenModuleFixturesJSI.h\\"
Expand Down
17 changes: 16 additions & 1 deletion packages/react-native-codegen/scripts/oss/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ else
fi
YARN_BINARY="${YARN_BINARY:-$YARN_OR_NPM}"

# mv command to use when copying files into the working directory
EDEN_SAFE_MV="mv"

if [ -x "$(command -v eden)" ]; then
pushd "$THIS_DIR"

# Detect if we are in an EdenFS checkout
if [[ "$OSTYPE" == "darwin"* ]] && eden info; then
EDEN_SAFE_MV="cp -R -X"
fi

popd >/dev/null
fi

if [[ ${FBSOURCE_ENV:-0} -eq 1 ]]; then
# Custom FB-specific setup
pushd "$CODEGEN_DIR" >/dev/null
Expand Down Expand Up @@ -56,6 +70,7 @@ else

popd >/dev/null

mv "$TMP_DIR/lib" "$TMP_DIR/node_modules" "$CODEGEN_DIR"
$EDEN_SAFE_MV "$TMP_DIR/lib" "$CODEGEN_DIR"
$EDEN_SAFE_MV "$TMP_DIR/node_modules" "$CODEGEN_DIR"
rm -rf "$TMP_DIR"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const FileTemplate = ({
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* ${'@'}generated by codegen project: GenerateModuleH.js
* ${'@'}generated by codegen project: GenerateModuleCpp.js
*/
#include "${libraryName}JSI.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Map {
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
* @generated by codegen project: GenerateModuleCpp.js
*/
#include \\"SampleWithUppercaseNameJSI.h\\"
Expand Down Expand Up @@ -38,7 +38,7 @@ Map {
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
* @generated by codegen project: GenerateModuleCpp.js
*/
#include \\"complex_objectsJSI.h\\"
Expand Down Expand Up @@ -120,7 +120,7 @@ Map {
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
* @generated by codegen project: GenerateModuleCpp.js
*/
#include \\"cxx_only_native_modulesJSI.h\\"
Expand Down Expand Up @@ -188,7 +188,7 @@ Map {
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
* @generated by codegen project: GenerateModuleCpp.js
*/
#include \\"empty_native_modulesJSI.h\\"
Expand Down Expand Up @@ -218,7 +218,7 @@ Map {
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
* @generated by codegen project: GenerateModuleCpp.js
*/
#include \\"native_modules_with_type_aliasesJSI.h\\"
Expand Down Expand Up @@ -260,7 +260,7 @@ Map {
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
* @generated by codegen project: GenerateModuleCpp.js
*/
#include \\"real_module_exampleJSI.h\\"
Expand Down Expand Up @@ -365,7 +365,7 @@ Map {
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
* @generated by codegen project: GenerateModuleCpp.js
*/
#include \\"simple_native_modulesJSI.h\\"
Expand Down Expand Up @@ -494,7 +494,7 @@ Map {
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleH.js
* @generated by codegen project: GenerateModuleCpp.js
*/
#include \\"two_modules_different_filesJSI.h\\"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const {verifyPropNotAlreadyDefined} = require('../../parsers-commons');
import type {TypeDeclarationMap, PropAST, ASTNode} from '../../utils';
import type {BuildSchemaFN, Parser} from '../../parser';

// $FlowFixMe[unsupported-variance-annotation]
function getTypeAnnotationForArray<+T>(
name: string,
typeAnnotation: $FlowFixMe,
Expand Down Expand Up @@ -206,6 +207,7 @@ function flattenProperties(
.filter(Boolean);
}

// $FlowFixMe[unsupported-variance-annotation]
function getTypeAnnotation<+T>(
name: string,
annotation: $FlowFixMe | ASTNode,
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native-codegen/src/parsers/parsers-commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ function wrapModuleSchema(
};
}

// $FlowFixMe[unsupported-variance-annotation]
function unwrapNullable<+T: NativeModuleTypeAnnotation>(
x: Nullable<T>,
): [T, boolean] {
Expand All @@ -115,6 +116,7 @@ function unwrapNullable<+T: NativeModuleTypeAnnotation>(
return [x, false];
}

// $FlowFixMe[unsupported-variance-annotation]
function wrapNullable<+T: NativeModuleTypeAnnotation>(
nullable: boolean,
typeAnnotation: T,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 2 additions & 1 deletion packages/react-native-gradle-plugin/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ abstract class PrivateReactExtension @Inject constructor(project: Project) {
.directoryProperty()
.convention(
// This is the default for the project root if the users hasn't specified anything.
// If the project is called "react-native-github"
// If the project is called "react-native-github" or "react-native-build-from-source"
// - We're inside the Github Repo -> root is defined by RN Tester (so no default
// needed)
// - We're inside an includedBuild as we're performing a build from source
Expand All @@ -39,7 +39,8 @@ abstract class PrivateReactExtension @Inject constructor(project: Project) {
// - We're inside a user project, so inside the ./android folder. Default should be
// ../
// User can always override this default by setting a `root =` inside the template.
if (project.rootProject.name == "react-native-github") {
if (project.rootProject.name == "react-native-github" ||
project.rootProject.name == "react-native-build-from-source") {
project.rootProject.layout.projectDirectory.dir("../../")
} else {
project.rootProject.layout.projectDirectory.dir("../")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import * as React from 'react';
* @see https://github.com/facebook/react-native/commit/b8c8562
*/
const FlatListWithEventThrottle = React.forwardRef(
// $FlowFixMe[incompatible-call]
(
props: React.ElementConfig<typeof FlatList>,
ref:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const AnimatedScrollView: AnimatedComponentType<Props, Instance> =
});

const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
// $FlowFixMe[incompatible-call]
(
props: {
...React.ElementConfig<typeof ScrollView>,
Expand All @@ -76,6 +77,7 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
const {intermediatePropsForRefreshControl, intermediatePropsForScrollView} =
useMemo(() => {
// $FlowFixMe[underconstrained-implicit-instantiation]
// $FlowFixMe[incompatible-call]
const {outer, inner} = splitLayoutProps(flattenStyle(props.style));
return {
intermediatePropsForRefreshControl: {style: outer},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import * as React from 'react';
* @see https://github.com/facebook/react-native/commit/b8c8562
*/
const SectionListWithEventThrottle = React.forwardRef(
// $FlowFixMe[incompatible-call]
(
props: React.ElementConfig<typeof SectionList>,
ref:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default function createAnimatedComponent<TProps: {...}, TInstance>(
// $FlowFixMe[incompatible-call]
props,
);
// $FlowFixMe[incompatible-call]
const ref = useMergeRefs<TInstance | null>(callbackRef, forwardedRef);

// Some components require explicit passthrough values for animation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
_subscriptions: Array<EventSubscription> = [];
viewRef: {current: React.ElementRef<typeof View> | null, ...};
_initialFrameHeight: number = 0;
_bottom: number = 0;

constructor(props: Props) {
super(props);
Expand Down Expand Up @@ -129,20 +130,32 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
}
};

// Avoid unnecessary renders if the KeyboardAvoidingView is disabled.
_setBottom = (value: number) => {
const enabled = this.props.enabled ?? true;
this._bottom = value;
if (enabled) {
this.setState({bottom: value});
}
};

_updateBottomIfNecessary = async () => {
if (this._keyboardEvent == null) {
this.setState({bottom: 0});
this._setBottom(0);
return;
}

const {duration, easing, endCoordinates} = this._keyboardEvent;
const height = await this._relativeKeyboardHeight(endCoordinates);

if (this.state.bottom === height) {
if (this._bottom === height) {
return;
}

if (duration && easing) {
this._setBottom(height);

const enabled = this.props.enabled ?? true;
if (enabled && duration && easing) {
LayoutAnimation.configureNext({
// We have to pass the duration equal to minimal accepted duration defined here: RCTLayoutAnimation.m
duration: duration > 10 ? duration : 10,
Expand All @@ -152,9 +165,15 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
},
});
}
this.setState({bottom: height});
};

componentDidUpdate(_: Props, prevState: State): void {
const enabled = this.props.enabled ?? true;
if (enabled && this._bottom !== prevState.bottom) {
this.setState({bottom: this._bottom});
}
}

componentDidMount(): void {
if (Platform.OS === 'ios') {
this._subscriptions = [
Expand Down
Loading

0 comments on commit 34b8bc0

Please sign in to comment.