Compare commits

...
Author SHA1 Message Date
Luna Wei a0429ebb54 [0.66.0-rc.0] Bump version numbers 2021-08-27 01:12:10 -07:00
Luna Wei ab829005bd Move react-native-codegen to root 2021-08-26 23:40:46 -07:00
Luna Wei 27073242f2 Update manual testing script to also test Hermes for RNTester
Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester

Reviewed By: ShikaSD

Differential Revision: D30569403

fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737
2021-08-26 23:40:46 -07:00
Connor TumblesonandLuna Wei b78f6cee7d feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079)
Summary:
This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them.

https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE

You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488

## Changelog

[Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid

Pull Request resolved: https://github.com/facebook/react-native/pull/32079

Test Plan:
```
PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE'
```

Reviewed By: cortinico

Differential Revision: D30532656

Pulled By: yungsters

fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9
2021-08-26 22:12:28 -07:00
Tommy NguyenandLuna Wei 10daf76e68 chore: prefer the local react-native-codegen package (#32096)
Summary:
Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Fixed] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package

Pull Request resolved: https://github.com/facebook/react-native/pull/32096

Test Plan:
1. Make the following changes
   ```diff
   diff --git a/package.json b/package.json
   index 847c726a69b..78da8232988 100644
   --- a/package.json
   +++ b/package.json
   @@ -107,6 +107,7 @@
        "promise": "^8.0.3",
        "prop-types": "^15.7.2",
        "react-devtools-core": "^4.13.0",
   +    "react-native-codegen": "^0.0.7",
        "react-refresh": "^0.4.0",
        "regenerator-runtime": "^0.13.2",
        "scheduler": "^0.20.2",
   diff --git a/template/package.json b/template/package.json
   index 715614112ac..5e0762b1b25 100644
   --- a/template/package.json
   +++ b/template/package.json
   @@ -21,7 +21,6 @@
        "eslint": "7.14.0",
        "jest": "^26.6.3",
        "metro-react-native-babel-preset": "^0.66.2",
   -    "react-native-codegen": "^0.0.7",
        "react-test-renderer": "17.0.2"
      },
      "jest": {
   ```
2. Run `scripts/test-manual-e2e.sh`

## Expected Behavior

Task `:ReactAndroid:buildReactNdkLib` succeeds.

## Actual Behavior

```
> Task :ReactAndroid:buildReactNdkLib FAILED
make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni'
fcntl(): Bad file descriptor
make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni'
~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view
~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies.    .  Stop.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ReactAndroid:buildReactNdkLib'.
> Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 19s
20 actionable tasks: 20 executed
Couldn't generate artifacts
```

Reviewed By: ShikaSD

Differential Revision: D30581194

Pulled By: hramos

fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c
2021-08-26 22:12:28 -07:00
Luna Wei e6eb81e097 Include Swift lib in LIBRARY_SEARCH_PATHS
Summary:
changelog: Fix Xcode 13 build error in RNTester

Including `usr/lib/swift` fixes error:
{F642876047}

Reviewed By: fkgozali

Differential Revision: D30559838

fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329
2021-08-25 17:10:30 -07:00
Nick GerlemanandLuna Wei 72eb06009b Bump @react-native/polyfills version (#32074)
Summary:
https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one.

Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish.

## Changelog

[Internal][Fixed] - Bump react-native/polyfills version

Pull Request resolved: https://github.com/facebook/react-native/pull/32074

Reviewed By: lunaleaps, cortinico

Differential Revision: D30498104

Pulled By: yungsters

fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86
2021-08-25 17:10:07 -07:00
14 changed files with 106 additions and 40 deletions
+4 -4
View File
@@ -1,17 +1,17 @@
/**
* @generated by scripts/bump-oss-version.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @generated by scripts/bump-oss-version.js
* @flow strict
*/
exports.version = {
major: 0,
minor: 0,
minor: 66,
patch: 0,
prerelease: null,
prerelease: 'rc.0',
};
@@ -43,7 +43,8 @@ export type PermissionType =
| 'android.permission.READ_EXTERNAL_STORAGE'
| 'android.permission.WRITE_EXTERNAL_STORAGE'
| 'android.permission.BLUETOOTH_CONNECT'
| 'android.permission.BLUETOOTH_SCAN';
| 'android.permission.BLUETOOTH_SCAN'
| 'android.permission.BLUETOOTH_ADVERTISE';
*/
export interface Spec extends TurboModule {
@@ -61,6 +61,7 @@ const PERMISSIONS = Object.freeze({
WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE',
BLUETOOTH_CONNECT: 'android.permission.BLUETOOTH_CONNECT',
BLUETOOTH_SCAN: 'android.permission.BLUETOOTH_SCAN',
BLUETOOTH_ADVERTISE: 'android.permission.BLUETOOTH_ADVERTISE',
});
/**
@@ -75,6 +76,7 @@ class PermissionsAndroid {
ACCESS_COARSE_LOCATION: string,
ACCESS_FINE_LOCATION: string,
ADD_VOICEMAIL: string,
BLUETOOTH_ADVERTISE: string,
BLUETOOTH_CONNECT: string,
BLUETOOTH_SCAN: string,
BODY_SENSORS: string,
+5 -5
View File
@@ -21,11 +21,11 @@ NSDictionary* RCTGetReactNativeVersion(void)
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^(void){
__rnVersion = @{
RCTVersionMajor: @(0),
RCTVersionMinor: @(0),
RCTVersionPatch: @(0),
RCTVersionPrerelease: [NSNull null],
};
RCTVersionMajor: @(0),
RCTVersionMinor: @(66),
RCTVersionPatch: @(0),
RCTVersionPrerelease: @"rc.0",
};
});
return __rnVersion;
}
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION_NAME=1000.0.0-main
VERSION_NAME=0.66.0-rc.0
GROUP=com.facebook.react
POM_NAME=ReactNative
@@ -16,7 +16,7 @@ import java.util.Map;
public class ReactNativeVersion {
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
"major", 0,
"minor", 0,
"minor", 66,
"patch", 0,
"prerelease", null);
"prerelease", "rc.0");
}
+2 -2
View File
@@ -16,9 +16,9 @@ namespace facebook::react {
constexpr struct {
int32_t Major = 0;
int32_t Minor = 0;
int32_t Minor = 66;
int32_t Patch = 0;
std::string_view Prerelease = "";
std::string_view Prerelease = "rc.0";
} ReactNativeVersion;
} // namespace facebook::react
+44 -9
View File
@@ -1,7 +1,6 @@
{
"name": "react-native",
"private": true,
"version": "1000.0.0",
"version": "0.66.0-rc.0",
"bin": "./cli.js",
"description": "A framework for building native apps using React",
"license": "MIT",
@@ -81,10 +80,6 @@
"test-ios-e2e": "detox test -c ios.sim.release packages/rn-tester/e2e",
"test-ios": "./scripts/objc-test.sh test"
},
"workspaces": [
"packages/!(eslint-config-react-native-community)",
"repo-config"
],
"peerDependencies": {
"react": "17.0.2"
},
@@ -95,7 +90,7 @@
"@react-native-community/cli-platform-ios": "^6.0.0",
"@react-native/assets": "1.0.0",
"@react-native/normalize-color": "1.0.0",
"@react-native/polyfills": "1.0.0",
"@react-native/polyfills": "2.0.0",
"abort-controller": "^3.0.0",
"anser": "^1.4.9",
"base64-js": "^1.1.2",
@@ -112,6 +107,7 @@
"promise": "^8.0.3",
"prop-types": "^15.7.2",
"react-devtools-core": "^4.13.0",
"react-native-codegen": "^0.0.7",
"react-refresh": "^0.4.0",
"regenerator-runtime": "^0.13.2",
"scheduler": "^0.20.2",
@@ -122,7 +118,46 @@
},
"devDependencies": {
"flow-bin": "^0.158.0",
"react": "17.0.2"
"react": "17.0.2",
"@babel/core": "^7.14.0",
"@babel/generator": "^7.14.0",
"@babel/template": "^7.0.0",
"@babel/types": "^7.0.0",
"@react-native-community/eslint-plugin": "*",
"@reactions/component": "^2.0.2",
"async": "^2.4.0",
"babel-eslint": "^10.1.0",
"babel-preset-fbjs": "^3.4.0",
"clang-format": "^1.2.4",
"connect": "^3.6.5",
"coveralls": "^3.0.2",
"detox": "16.7.2",
"eslint": "7.12.0",
"eslint-config-fb-strict": "^24.9.0",
"eslint-config-fbjs": "2.1.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-eslint-comments": "^3.1.1",
"eslint-plugin-flowtype": "2.50.3",
"eslint-plugin-jest": "22.4.1",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-prettier": "2.6.2",
"eslint-plugin-react": "7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "3.10.0",
"eslint-plugin-relay": "1.8.1",
"jest": "^26.6.3",
"jest-junit": "^10.0.0",
"jscodeshift": "^0.11.0",
"metro-transform-plugins": "^0.66.0",
"mkdirp": "^0.5.1",
"prettier": "1.19.1",
"react-shallow-renderer": "16.14.1",
"react-test-renderer": "17.0.2",
"shelljs": "^0.7.8",
"signedsource": "^1.0.0",
"ws": "^6.1.4",
"yargs": "^15.3.1"
},
"detox": {
"test-runner": "jest",
@@ -161,4 +196,4 @@
}
}
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@react-native/polyfills",
"version": "1.0.0",
"version": "2.0.0",
"description": "Polyfills for React Native.",
"repository": {
"type": "git",
@@ -787,6 +787,7 @@
"$(inherited)",
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
"\"$(SDKROOT)/usr/lib/swift\"",
);
"LIBRARY_SEARCH_PATHS[arch=*]" = "$(inherited)";
OTHER_LDFLAGS = (
@@ -821,6 +822,7 @@
"$(inherited)",
"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)",
"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)",
"\"$(SDKROOT)/usr/lib/swift\"",
);
OTHER_LDFLAGS = (
"$(inherited)",
+2
View File
@@ -127,9 +127,11 @@ fs.writeFileSync(
);
let packageJson = JSON.parse(cat('package.json'));
const repoConfigJson = JSON.parse(cat('repo-config/package.json'));
packageJson.version = version;
delete packageJson.workspaces;
delete packageJson.private;
packageJson.devDependencies = {...packageJson.devDependencies, ...repoConfigJson.dependencies};
fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2), 'utf-8');
// Change ReactAndroid/gradle.properties
+2 -2
View File
@@ -11,9 +11,9 @@
let RNCodegen;
try {
RNCodegen = require('react-native-codegen/lib/generators/RNCodegen.js');
} catch (e) {
RNCodegen = require('../packages/react-native-codegen/lib/generators/RNCodegen.js');
} catch (e) {
RNCodegen = require('react-native-codegen/lib/generators/RNCodegen.js');
if (!RNCodegen) {
throw 'RNCodegen not found.';
}
+36 -11
View File
@@ -4,8 +4,6 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
JAVA_VERSION="1.7"
RED="\033[0;31m"
GREEN="\033[0;32m"
BLUE="\033[0;35m"
@@ -49,28 +47,55 @@ lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill
info "Start the packager in another terminal by running 'npm start' from the root"
info "and then press any key."
info ""
read -n 1
read -r -n 1
./gradlew :packages:rn-tester:android:app:installJscDebug || error "Couldn't build RNTester Android"
info "Press any key to run RNTester in an already running Android emulator/device"
info ""
read -n 1
read -r -n 1
adb shell am start -n com.facebook.react.uiapp/.RNTesterActivity
success "Installing CocoaPods dependencies"
info "Once done testing, keep emulator running"
info "Press any key to run RNTester on Android with Hermes enabled"
read -r -n 1
./gradlew :packages:rn-tester:android:app:installHermesDebug || error "Couldn't build RNTester Android"
adb shell am start -n com.facebook.react.uiapp/.RNTesterActivity
info "When done testing RNTester on Android,"
info "Press any key to start testing RNTester in iOS"
read -r -n 1
success "About to test iOS JSC... "
success "Installing CocoaPods dependencies..."
rm -rf packages/rn-tester/Pods
(cd packages/rn-tester && pod install)
info "Press any key to open the workspace in Xcode, then build and test manually."
info ""
read -n 1
read -r -n 1
open "packages/rn-tester/RNTesterPods.xcworkspace"
info "When done testing iOS JSC, press any key to test iOS Hermes"
read -r -n 1
success "About to test iOS Hermes... "
success "Installing CocoaPods dependencies..."
rm -rf packages/rn-tester/Pods
(cd packages/rn-tester && USE_HERMES=1 pod install)
info "Press any key to open the workspace in Xcode, then build and test manually."
info ""
read -r -n 1
open "packages/rn-tester/RNTesterPods.xcworkspace"
info "When done testing RNTester app on iOS and Android press any key to continue."
info ""
read -n 1
read -r -n 1
success "Killing packager"
lsof -i :8081 | grep LISTEN
@@ -86,7 +111,7 @@ success "React Native version changed in the template"
project_name="RNTestProject"
cd /tmp/
cd /tmp/ || exit
rm -rf "$project_name"
node "$repo_root/cli.js" init "$project_name" --template "$repo_root"
@@ -102,7 +127,7 @@ info " - Verify 'Reload JS' works"
info ""
info "Press any key to run the sample in Android emulator/device"
info ""
read -n 1
read -r -n 1
cd "/tmp/${project_name}" && npx react-native run-android
info "Test the following on iOS:"
@@ -115,10 +140,10 @@ info " - Disable Fast Refresh."
info ""
info "Press any key to open the project in Xcode"
info ""
read -n 1
read -r -n 1
open "/tmp/${project_name}/ios/${project_name}.xcworkspace"
cd "$repo_root"
cd "$repo_root" || exit
info "Next steps:"
info " - https://github.com/facebook/react-native/blob/HEAD/Releases.md"
+1 -2
View File
@@ -11,7 +11,7 @@
},
"dependencies": {
"react": "17.0.2",
"react-native": "1000.0.0"
"react-native": "0.66.0-rc.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
@@ -21,7 +21,6 @@
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-native-codegen": "^0.0.7",
"react-test-renderer": "17.0.2"
},
"jest": {