mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
145
Commits
@@ -14,7 +14,7 @@
|
||||
# and build a Android application that can be used to run the
|
||||
# tests specified in the scripts/ directory.
|
||||
#
|
||||
FROM reactnativecommunity/react-native-android:6.0
|
||||
FROM reactnativecommunity/react-native-android:6.1
|
||||
|
||||
LABEL Description="React Native Android Test Image"
|
||||
LABEL maintainer="Héctor Ramos <hector@fb.com>"
|
||||
|
||||
+97
-70
@@ -48,15 +48,15 @@ references:
|
||||
# Anchors for the cache keys
|
||||
|
||||
cache_keys:
|
||||
checkout_cache_key: &checkout_cache_key v1-checkout
|
||||
checkout_cache_key: &checkout_cache_key v5-checkout
|
||||
gems_cache_key: &gems_cache_key v1-gems-{{ checksum "Gemfile.lock" }}
|
||||
gradle_cache_key: &gradle_cache_key v1-gradle-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "ReactAndroid/gradle.properties" }}
|
||||
hermes_workspace_cache_key: &hermes_workspace_cache_key v4-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
|
||||
hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}
|
||||
hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}
|
||||
hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
hermes_windows_cache_key: &hermes_windows_cache_key v3-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
|
||||
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v2-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}
|
||||
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v1-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}
|
||||
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v4-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v3-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
|
||||
pods_cache_key: &pods_cache_key v8-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
|
||||
windows_yarn_cache_key: &windows_yarn_cache_key v1-win-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
|
||||
yarn_cache_key: &yarn_cache_key v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}
|
||||
@@ -102,7 +102,7 @@ executors:
|
||||
reactnativeandroid:
|
||||
<<: *defaults
|
||||
docker:
|
||||
- image: reactnativecommunity/react-native-android:6.0
|
||||
- image: reactnativecommunity/react-native-android:6.1
|
||||
resource_class: "xlarge"
|
||||
environment:
|
||||
- TERM: "dumb"
|
||||
@@ -119,6 +119,8 @@ executors:
|
||||
macos:
|
||||
xcode: *xcode_version
|
||||
resource_class: macos.x86.medium.gen2
|
||||
environment:
|
||||
- REACT_NATIVE_CI: true
|
||||
|
||||
# -------------------------
|
||||
# COMMANDS
|
||||
@@ -132,10 +134,7 @@ commands:
|
||||
type: string
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
|
||||
- << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-
|
||||
- << parameters.checkout_base_cache_key >>-{{ arch }}-
|
||||
key: << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
|
||||
- checkout
|
||||
- save_cache:
|
||||
key: << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
|
||||
@@ -259,6 +258,17 @@ commands:
|
||||
name: Report size of RNTester.app (analysis-bot)
|
||||
command: GITHUB_TOKEN="$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A""$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B" scripts/circleci/report-bundle-size.sh << parameters.platform >> || true
|
||||
|
||||
get_react_native_version:
|
||||
steps:
|
||||
- run:
|
||||
name: Get React Native version
|
||||
command: |
|
||||
VERSION=$( grep '"version"' package.json | cut -d '"' -f 4 | head -1)
|
||||
# Save the react native version we are building in a file so we can use that file as part of the cache key.
|
||||
echo "$VERSION" > /tmp/react-native-version
|
||||
echo "React Native Version is $(cat /tmp/react-native-version)"
|
||||
echo "Hermes commit is $(cat /tmp/hermes/hermesversion)"
|
||||
|
||||
with_hermes_tarball_cache_span:
|
||||
parameters:
|
||||
steps:
|
||||
@@ -275,6 +285,7 @@ commands:
|
||||
type: string
|
||||
default: *hermes_tarball_artifacts_dir
|
||||
steps:
|
||||
- get_react_native_version
|
||||
- when:
|
||||
condition:
|
||||
equal: [ << parameters.flavor >>, "Debug"]
|
||||
@@ -306,8 +317,8 @@ commands:
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TARBALL_FILENAME=$(node ~/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>" --releaseVersion "*")
|
||||
TARBALL_PATH=$(ls $HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME)
|
||||
TARBALL_FILENAME=$(node ~/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
|
||||
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
|
||||
echo "$TARBALL_PATH"
|
||||
@@ -319,6 +330,21 @@ commands:
|
||||
|
||||
echo "Found Hermes tarball at $TARBALL_PATH"
|
||||
echo "export HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $BASH_ENV
|
||||
- run:
|
||||
name: Print Hermes version
|
||||
command: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=<< parameters.hermes_tarball_artifacts_dir >>
|
||||
TARBALL_FILENAME=$(node ~/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
if [[ -e $TARBALL_PATH ]]; then
|
||||
tar -xf $TARBALL_PATH
|
||||
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
|
||||
./destroot/bin/hermes test.js
|
||||
rm test.js
|
||||
rm -rf destroot
|
||||
else
|
||||
echo 'No Hermes tarball found.'
|
||||
fi
|
||||
- steps: << parameters.steps >>
|
||||
- when:
|
||||
condition:
|
||||
@@ -507,8 +533,17 @@ jobs:
|
||||
- run:
|
||||
name: "Run Tests: JavaScript Tests"
|
||||
command: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
|
||||
- run_e2e:
|
||||
platform: js
|
||||
|
||||
# When not in 0.XX-stable branch, run e2e tests
|
||||
- when:
|
||||
condition:
|
||||
not:
|
||||
matches:
|
||||
pattern: "0.[0-9]{2}-stable"
|
||||
value: << pipeline.git.branch >>
|
||||
steps:
|
||||
- run_e2e:
|
||||
platform: js
|
||||
|
||||
# Optionally, run disabled tests
|
||||
- when:
|
||||
@@ -828,6 +863,11 @@ jobs:
|
||||
description: Whether Flipper is enabled. Must be one of "WithFlipper", "WithoutFlipper".
|
||||
type: enum
|
||||
enum: ["WithFlipper", "WithoutFlipper"]
|
||||
use_frameworks:
|
||||
default: "StaticLibraries"
|
||||
description: Which kind of option we want to use for `use_frameworks!`
|
||||
type: enum
|
||||
enum: ["StaticLibraries", "StaticFrameworks"] #TODO: Add "DynamicFrameworks"
|
||||
environment:
|
||||
- PROJECT_NAME: "iOSTemplateProject"
|
||||
- HERMES_WS_DIR: *hermes_workspace_root
|
||||
@@ -842,6 +882,24 @@ jobs:
|
||||
steps:
|
||||
- run:
|
||||
command: circleci-agent step halt # this interrupts the job successfully.
|
||||
# use_frameworks! does not works with Flipper enabled
|
||||
- when:
|
||||
condition:
|
||||
and:
|
||||
- equal: [ << parameters.use_frameworks >>, "StaticFrameworks"]
|
||||
- equal: [ << parameters.flipper >>, "WithFlipper" ]
|
||||
steps:
|
||||
- run:
|
||||
command: circleci-agent step halt # this interrupts the job successfully.
|
||||
# use_frameworks! does not works with the New Architecture enabled
|
||||
- when:
|
||||
condition:
|
||||
and:
|
||||
- equal: [ << parameters.use_frameworks >>, "StaticFrameworks"]
|
||||
- equal: [ << parameters.architecture >>, "NewArch" ]
|
||||
steps:
|
||||
- run:
|
||||
command: circleci-agent step halt # this interrupts the job successfully.
|
||||
# Valid configuration, we can continue
|
||||
- checkout_code_with_cache
|
||||
- run_yarn
|
||||
@@ -855,7 +913,9 @@ jobs:
|
||||
- run:
|
||||
name: Set HERMES_ENGINE_TARBALL_PATH
|
||||
command: |
|
||||
echo "export HERMES_ENGINE_TARBALL_PATH=$(ls -AU $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-*.tar.gz | head -1)" >> $BASH_ENV
|
||||
BUILD_TYPE="<< parameters.flavor >>"
|
||||
TARBALL_FILENAME=$(node ./scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
echo "export HERMES_ENGINE_TARBALL_PATH=$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME" >> $BASH_ENV
|
||||
- run:
|
||||
name: Create iOS template project
|
||||
command: |
|
||||
@@ -889,6 +949,10 @@ jobs:
|
||||
export NO_FLIPPER=1
|
||||
fi
|
||||
|
||||
if [[ << parameters.use_frameworks >> == "StaticFrameworks" ]]; then
|
||||
export USE_FRAMEWORKS=static
|
||||
fi
|
||||
|
||||
bundle exec pod install
|
||||
- run:
|
||||
name: Build template project
|
||||
@@ -967,8 +1031,8 @@ jobs:
|
||||
environment:
|
||||
- ANDROID_HOME: "C:\\Android\\android-sdk"
|
||||
- ANDROID_NDK: "C:\\Android\\android-sdk\\ndk\\20.1.5948944"
|
||||
- ANDROID_BUILD_VERSION: 31
|
||||
- ANDROID_TOOLS_VERSION: 31.0.0
|
||||
- ANDROID_BUILD_VERSION: 33
|
||||
- ANDROID_TOOLS_VERSION: 33.0.0
|
||||
- GRADLE_OPTS: -Dorg.gradle.daemon=false
|
||||
steps:
|
||||
- checkout_code_with_cache
|
||||
@@ -1074,6 +1138,7 @@ jobs:
|
||||
environment:
|
||||
- HERMES_WS_DIR: *hermes_workspace_root
|
||||
- HERMES_VERSION_FILE: "sdks/.hermesversion"
|
||||
- REACT_NATIVE_CI: true
|
||||
steps:
|
||||
- run:
|
||||
name: Install dependencies
|
||||
@@ -1179,6 +1244,7 @@ jobs:
|
||||
- checkout_code_with_cache
|
||||
- run_yarn
|
||||
- *attach_hermes_workspace
|
||||
- get_react_native_version
|
||||
- when:
|
||||
condition:
|
||||
equal: [ << parameters.flavor >>, "Debug"]
|
||||
@@ -1211,9 +1277,6 @@ jobs:
|
||||
command: |
|
||||
cd ./sdks/hermes || exit 1
|
||||
BUILD_TYPE="<< parameters.flavor >>" ./utils/build-mac-framework.sh
|
||||
- with_hermesc_span:
|
||||
flavor: << parameters.flavor >>
|
||||
steps:
|
||||
- run:
|
||||
name: Build the Hermes iOS frameworks
|
||||
command: |
|
||||
@@ -1227,20 +1290,13 @@ jobs:
|
||||
|
||||
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
|
||||
|
||||
# get_release_version() is defined in build-apple-framework.sh
|
||||
pushd ./sdks/hermes || exit 1
|
||||
BUILD_TYPE=$BUILD_TYPE source ./utils/build-apple-framework.sh
|
||||
RELEASE_VERSION=$(get_release_version)
|
||||
popd
|
||||
|
||||
TARBALL_FILENAME=$(node ./scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE" --releaseVersion "$RELEASE_VERSION")
|
||||
TARBALL_FILENAME=$(node ./scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
|
||||
TARBALL_OUTPUT_PATH=$(node ./scripts/hermes/create-tarball.js \
|
||||
--inputDir ./sdks/hermes \
|
||||
--buildType "$BUILD_TYPE" \
|
||||
--releaseVersion "$RELEASE_VERSION" \
|
||||
--outputDir $TARBALL_OUTPUT_DIR)
|
||||
|
||||
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
|
||||
@@ -1365,13 +1421,20 @@ jobs:
|
||||
- run_yarn
|
||||
- add_ssh_keys:
|
||||
fingerprints:
|
||||
- "1c:98:e0:3a:52:79:95:29:12:cd:b4:87:5b:41:e2:bb"
|
||||
- "1f:c7:61:c4:e2:ff:77:e3:cc:ca:a7:34:c2:79:e3:3c"
|
||||
- brew_install:
|
||||
package: cmake
|
||||
- run:
|
||||
name: "Set new react-native version and commit changes"
|
||||
command: |
|
||||
node ./scripts/prepare-package-for-release.js -v << parameters.version >> -l << parameters.latest >> --dry-run << parameters.dryrun >>
|
||||
VERSION=<< parameters.version >>
|
||||
|
||||
if [[ -z "$VERSION" ]]; then
|
||||
VERSION=$(grep '"version"' package.json | cut -d '"' -f 4 | head -1)
|
||||
echo "Using the version from the package.json: $VERSION"
|
||||
fi
|
||||
|
||||
node ./scripts/prepare-package-for-release.js -v "$VERSION" -l << parameters.latest >> --dry-run << parameters.dryrun >>
|
||||
|
||||
build_npm_package:
|
||||
parameters:
|
||||
@@ -1409,8 +1472,8 @@ jobs:
|
||||
cp -r $HERMES_WS_DIR/win64-bin/* ./sdks/hermesc/win64-bin/.
|
||||
cp -r $HERMES_WS_DIR/linux64-bin/* ./sdks/hermesc/linux64-bin/.
|
||||
mkdir -p ./ReactAndroid/external-artifacts/artifacts/
|
||||
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-debug-*.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
|
||||
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-release-*.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
|
||||
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
|
||||
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
|
||||
|
||||
- run_yarn
|
||||
- download_gradle_dependencies
|
||||
@@ -1495,43 +1558,6 @@ jobs:
|
||||
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${CIRCLE_TAG:1}\" }}"
|
||||
# END: Stable releases
|
||||
|
||||
# START: Stables and commitlies
|
||||
- when:
|
||||
condition:
|
||||
or:
|
||||
- equal: [ "release", << parameters.release_type >> ]
|
||||
- equal: [ "dry-run", << parameters.release_type >> ]
|
||||
steps:
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: apt update && apt install -y jq jo
|
||||
- run:
|
||||
name: Create draft GitHub Release and upload Hermes binaries
|
||||
command: |
|
||||
RELEASE_VERSION=$(cat build/.version)
|
||||
if [[ << parameters.release_type >> == "release" ]]; then
|
||||
GIT_TAG=$CIRCLE_TAG
|
||||
elif [[ << parameters.release_type >> == "dry-run" ]]; then
|
||||
GIT_TAG=v1000.0.0
|
||||
fi
|
||||
|
||||
ARTIFACTS=("")
|
||||
for build_type in "Debug" "Release"; do
|
||||
TARBALL_FILENAME=$(node ./scripts/hermes/get-tarball-name.js \
|
||||
--buildType $build_type \
|
||||
--releaseVersion $RELEASE_VERSION)
|
||||
|
||||
ARTIFACTS+=("$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME")
|
||||
done
|
||||
|
||||
./scripts/circleci/create_github_release.sh \
|
||||
<< parameters.release_type >> \
|
||||
$GIT_TAG \
|
||||
$RELEASE_VERSION \
|
||||
$GITHUB_TOKEN \
|
||||
"${ARTIFACTS[@]}"
|
||||
# END: Stable and commitlies
|
||||
|
||||
# -------------------------
|
||||
# JOBS: Nightly
|
||||
# -------------------------
|
||||
@@ -1616,6 +1642,7 @@ workflows:
|
||||
flavor: ["Debug", "Release"]
|
||||
jsengine: ["Hermes", "JSC"]
|
||||
flipper: ["WithFlipper", "WithoutFlipper"]
|
||||
use_frameworks: [ "StaticLibraries", "StaticFrameworks" ] #TODO: make it works with DynamicFrameworks
|
||||
- test_ios_rntester:
|
||||
requires:
|
||||
- build_hermes_macos
|
||||
@@ -1688,7 +1715,7 @@ workflows:
|
||||
jobs:
|
||||
- prepare_package_for_release:
|
||||
name: prepare_package_for_release
|
||||
version: 'v1000.0.1'
|
||||
version: ''
|
||||
latest : false
|
||||
dryrun: true
|
||||
- prepare_hermes_workspace:
|
||||
|
||||
+2
-1
@@ -64,7 +64,8 @@ buck-out
|
||||
.gradle
|
||||
local.properties
|
||||
*.iml
|
||||
/android/
|
||||
/android/*
|
||||
!/android/README.md
|
||||
|
||||
# Node
|
||||
node_modules
|
||||
|
||||
@@ -10,6 +10,9 @@ load(
|
||||
)
|
||||
load(
|
||||
"//tools/build_defs/oss:rn_defs.bzl",
|
||||
"ANDROID",
|
||||
"APPLE",
|
||||
"CXX",
|
||||
"HERMES_BYTECODE_VERSION",
|
||||
"IOS",
|
||||
"RCT_IMAGE_DATA_DECODER_SOCKET",
|
||||
@@ -112,7 +115,7 @@ rn_xplat_cxx_library2(
|
||||
react_native_root_target("React/CoreModules:CoreModules"),
|
||||
react_native_xplat_target("cxxreact:bridge"),
|
||||
react_native_xplat_target("cxxreact:jsbigstring"),
|
||||
react_native_xplat_target("jsi:JSCRuntime"),
|
||||
react_native_xplat_target("jsc:JSCRuntime"),
|
||||
react_native_xplat_target("jsiexecutor:jsiexecutor"),
|
||||
react_native_xplat_target("reactperflogger:reactperflogger"),
|
||||
],
|
||||
@@ -264,6 +267,7 @@ REACT_PUBLIC_HEADERS = {
|
||||
"React/RCTDevLoadingViewProtocol.h": RCTDEVSUPPORT_PATH + "RCTDevLoadingViewProtocol.h",
|
||||
"React/RCTDevLoadingViewSetEnabled.h": RCTDEVSUPPORT_PATH + "RCTDevLoadingViewSetEnabled.h",
|
||||
"React/RCTDisplayLink.h": RCTBASE_PATH + "RCTDisplayLink.h",
|
||||
"React/RCTDynamicTypeRamp.h": RCTLIB_PATH + "Text/Text/RCTDynamicTypeRamp.h",
|
||||
"React/RCTErrorCustomizer.h": RCTBASE_PATH + "RCTErrorCustomizer.h",
|
||||
"React/RCTErrorInfo.h": RCTBASE_PATH + "RCTErrorInfo.h",
|
||||
# NOTE: RCTEventDispatcher.h is exported from CoreModules:CoreModulesApple
|
||||
@@ -1453,3 +1457,28 @@ rn_xplat_cxx_library2(
|
||||
"//fbobjc/VendorLib/react-native-maps:react-native-maps",
|
||||
],
|
||||
)
|
||||
|
||||
rn_xplat_cxx_library2(
|
||||
name = "RCTWebPerformance",
|
||||
srcs = glob([
|
||||
"Libraries/WebPerformance/**/*.cpp",
|
||||
]),
|
||||
header_namespace = "",
|
||||
exported_headers = subdir_glob(
|
||||
[("Libraries/WebPerformance", "*.h")],
|
||||
prefix = "RCTWebPerformance",
|
||||
),
|
||||
fbandroid_compiler_flags = [
|
||||
"-fexceptions",
|
||||
"-frtti",
|
||||
],
|
||||
labels = [
|
||||
"depslint_never_remove",
|
||||
"pfh:ReactNative_CommonInfrastructurePlaceholder",
|
||||
],
|
||||
platforms = (ANDROID, APPLE, CXX),
|
||||
visibility = ["PUBLIC"],
|
||||
deps = [
|
||||
":FBReactNativeSpecJSI",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
||||
ruby '2.7.6'
|
||||
ruby File.read(File.join(__dir__, '.ruby-version')).strip
|
||||
|
||||
gem 'cocoapods', '~> 1.11', '>= 1.11.3'
|
||||
|
||||
+6
-6
@@ -56,7 +56,7 @@ GEM
|
||||
colored2 (3.1.2)
|
||||
concurrent-ruby (1.1.10)
|
||||
escape (0.0.4)
|
||||
ethon (0.15.0)
|
||||
ethon (0.16.0)
|
||||
ffi (>= 1.15.0)
|
||||
ffi (1.15.5)
|
||||
fourflusher (2.3.1)
|
||||
@@ -65,8 +65,8 @@ GEM
|
||||
httpclient (2.8.3)
|
||||
i18n (1.12.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.6.2)
|
||||
minitest (5.16.3)
|
||||
json (2.6.3)
|
||||
minitest (5.17.0)
|
||||
molinillo (0.8.0)
|
||||
nanaimo (0.3.0)
|
||||
nap (1.1.0)
|
||||
@@ -85,16 +85,16 @@ GEM
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
zeitwerk (2.6.0)
|
||||
zeitwerk (2.6.6)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
cocoapods (~> 1.11, >= 1.11.2)
|
||||
cocoapods (~> 1.11, >= 1.11.3)
|
||||
|
||||
RUBY VERSION
|
||||
ruby 2.7.5p203
|
||||
ruby 2.7.6p219
|
||||
|
||||
BUNDLED WITH
|
||||
2.3.22
|
||||
|
||||
Vendored
+28
@@ -116,6 +116,17 @@ export namespace Animated {
|
||||
|
||||
type ValueListenerCallback = (state: {value: number}) => void;
|
||||
|
||||
type Animation = {
|
||||
start(
|
||||
fromValue: number,
|
||||
onUpdate: (value: number) => void,
|
||||
onEnd: EndCallback | null,
|
||||
previousAnimation: Animation | null,
|
||||
animatedValue: AnimatedValue,
|
||||
): void;
|
||||
stop(): void;
|
||||
};
|
||||
|
||||
/**
|
||||
* Standard value for driving animations. One `Animated.Value` can drive
|
||||
* multiple properties in a synchronized fashion, but can only be driven by one
|
||||
@@ -168,6 +179,13 @@ export namespace Animated {
|
||||
*/
|
||||
stopAnimation(callback?: (value: number) => void): void;
|
||||
|
||||
/**
|
||||
* Stops any animation and resets the value to its original.
|
||||
*
|
||||
* See https://reactnative.dev/docs/animatedvalue#resetanimation
|
||||
*/
|
||||
resetAnimation(callback?: (value: number) => void): void;
|
||||
|
||||
/**
|
||||
* Interpolates the value before updating the property, e.g. mapping 0-1 to
|
||||
* 0-10.
|
||||
@@ -175,6 +193,14 @@ export namespace Animated {
|
||||
interpolate<OutputT extends number | string>(
|
||||
config: InterpolationConfigType,
|
||||
): AnimatedInterpolation<OutputT>;
|
||||
|
||||
/**
|
||||
* Typically only used internally, but could be used by a custom Animation
|
||||
* class.
|
||||
*
|
||||
* See https://reactnative.dev/docs/animatedvalue#animate
|
||||
*/
|
||||
animate(animation: Animation, callback?: EndCallback | null): void;
|
||||
}
|
||||
|
||||
type ValueXYListenerCallback = (value: {x: number; y: number}) => void;
|
||||
@@ -201,6 +227,8 @@ export namespace Animated {
|
||||
|
||||
extractOffset(): void;
|
||||
|
||||
resetAnimation(callback?: (value: {x: number; y: number}) => void): void;
|
||||
|
||||
stopAnimation(callback?: (value: {x: number; y: number}) => void): void;
|
||||
|
||||
addListener(callback: ValueXYListenerCallback): string;
|
||||
|
||||
@@ -69,6 +69,14 @@ export interface AccessibilityInfoStatic {
|
||||
*/
|
||||
isReduceMotionEnabled: () => Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Query whether reduce motion and prefer cross-fade transitions settings are currently enabled.
|
||||
*
|
||||
* Returns a promise which resolves to a boolean.
|
||||
* The result is `true` when prefer cross-fade transitions is enabled and `false` otherwise.
|
||||
*/
|
||||
prefersCrossFadeTransitions(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Query whether reduce transparency is currently enabled.
|
||||
*
|
||||
@@ -81,6 +89,16 @@ export interface AccessibilityInfoStatic {
|
||||
*/
|
||||
isScreenReaderEnabled: () => Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Query whether Accessibility Service is currently enabled.
|
||||
*
|
||||
* Returns a promise which resolves to a boolean.
|
||||
* The result is `true` when any service is enabled and `false` otherwise.
|
||||
*
|
||||
* @platform android
|
||||
*/
|
||||
isAccessibilityServiceEnabled(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Add an event handler. Supported events:
|
||||
* - announcementFinished: iOS-only event. Fires when the screen reader has finished making an announcement.
|
||||
@@ -111,6 +129,17 @@ export interface AccessibilityInfoStatic {
|
||||
*/
|
||||
announceForAccessibility: (announcement: string) => void;
|
||||
|
||||
/**
|
||||
* Post a string to be announced by the screen reader.
|
||||
* - `announcement`: The string announced by the screen reader.
|
||||
* - `options`: An object that configures the reading options.
|
||||
* - `queue`: The announcement will be queued behind existing announcements. iOS only.
|
||||
*/
|
||||
announceForAccessibilityWithOptions(
|
||||
announcement: string,
|
||||
options: {queue?: boolean},
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Gets the timeout in millisecond that the user needs.
|
||||
* This value is set in "Time to take action (Accessibility timeout)" of "Accessibility" settings.
|
||||
|
||||
+3
-3
@@ -829,8 +829,8 @@ export class ScrollView extends ScrollViewBase {
|
||||
y?: number | undefined;
|
||||
animated?: boolean | undefined;
|
||||
},
|
||||
x?: number,
|
||||
animated?: boolean,
|
||||
deprecatedX?: number,
|
||||
deprecatedAnimated?: boolean,
|
||||
): void;
|
||||
|
||||
/**
|
||||
@@ -841,7 +841,7 @@ export class ScrollView extends ScrollViewBase {
|
||||
* The options object has an animated prop, that enables the scrolling animation or not.
|
||||
* The animated prop defaults to true
|
||||
*/
|
||||
scrollToEnd(options?: {animated: boolean}): void;
|
||||
scrollToEnd(options?: {animated?: boolean}): void;
|
||||
|
||||
/**
|
||||
* Displays the scroll indicators momentarily.
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
*/
|
||||
|
||||
exports.version = {
|
||||
major: 1000,
|
||||
minor: 0,
|
||||
major: 0,
|
||||
minor: 71,
|
||||
patch: 0,
|
||||
prerelease: null,
|
||||
prerelease: 'rc.6',
|
||||
};
|
||||
|
||||
Vendored
-48
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
export interface OpenCameraDialogOptions {
|
||||
/** Defaults to false */
|
||||
videoMode?: boolean | undefined;
|
||||
}
|
||||
|
||||
export interface OpenSelectDialogOptions {
|
||||
/** Defaults to true */
|
||||
showImages?: boolean | undefined;
|
||||
/** Defaults to false */
|
||||
showVideos?: boolean | undefined;
|
||||
}
|
||||
|
||||
/** [imageURL|tempImageTag, height, width] */
|
||||
export type ImagePickerResult = [string, number, number];
|
||||
|
||||
export interface ImagePickerIOSStatic {
|
||||
canRecordVideos(callback: (value: boolean) => void): void;
|
||||
canUseCamera(callback: (value: boolean) => void): void;
|
||||
openCameraDialog(
|
||||
config: OpenCameraDialogOptions,
|
||||
successCallback: (args: ImagePickerResult) => void,
|
||||
cancelCallback: (args: any[]) => void,
|
||||
): void;
|
||||
openSelectDialog(
|
||||
config: OpenSelectDialogOptions,
|
||||
successCallback: (args: ImagePickerResult) => void,
|
||||
cancelCallback: (args: any[]) => void,
|
||||
): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* ImagePickerIOS has been extracted from react-native core and will be removed in a future release.
|
||||
* Please upgrade to use either `@react-native-community/react-native-image-picker` or 'expo-image-picker'.
|
||||
* If you cannot upgrade to a different library, please install the deprecated `@react-native-community/image-picker-ios` package.
|
||||
* @see https://github.com/react-native-community/react-native-image-picker-ios
|
||||
* @deprecated
|
||||
*/
|
||||
export const ImagePickerIOS: ImagePickerIOSStatic;
|
||||
export type ImagePickerIOS = ImagePickerIOSStatic;
|
||||
@@ -1,103 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict-local
|
||||
*/
|
||||
|
||||
import NativeImagePickerIOS from './NativeImagePickerIOS';
|
||||
import invariant from 'invariant';
|
||||
|
||||
const ImagePickerIOS = {
|
||||
canRecordVideos: function (callback: (result: boolean) => void): void {
|
||||
invariant(NativeImagePickerIOS, 'ImagePickerIOS is not available');
|
||||
return NativeImagePickerIOS.canRecordVideos(callback);
|
||||
},
|
||||
canUseCamera: function (callback: (result: boolean) => void): void {
|
||||
invariant(NativeImagePickerIOS, 'ImagePickerIOS is not available');
|
||||
return NativeImagePickerIOS.canUseCamera(callback);
|
||||
},
|
||||
openCameraDialog: function (
|
||||
config: $ReadOnly<{|
|
||||
unmirrorFrontFacingCamera?: boolean,
|
||||
videoMode?: boolean,
|
||||
|}>,
|
||||
successCallback: (imageURL: string, height: number, width: number) => void,
|
||||
cancelCallback: () => void,
|
||||
): void {
|
||||
invariant(NativeImagePickerIOS, 'ImagePickerIOS is not available');
|
||||
|
||||
var newConfig = {
|
||||
videoMode: true,
|
||||
unmirrorFrontFacingCamera: false,
|
||||
};
|
||||
|
||||
if (config.videoMode != null) {
|
||||
newConfig.videoMode = config.videoMode;
|
||||
}
|
||||
|
||||
if (config.unmirrorFrontFacingCamera != null) {
|
||||
newConfig.unmirrorFrontFacingCamera = config.unmirrorFrontFacingCamera;
|
||||
}
|
||||
|
||||
return NativeImagePickerIOS.openCameraDialog(
|
||||
newConfig,
|
||||
successCallback,
|
||||
cancelCallback,
|
||||
);
|
||||
},
|
||||
openSelectDialog: function (
|
||||
config: $ReadOnly<{|
|
||||
showImages?: boolean,
|
||||
showVideos?: boolean,
|
||||
|}>,
|
||||
successCallback: (imageURL: string, height: number, width: number) => void,
|
||||
cancelCallback: () => void,
|
||||
): void {
|
||||
invariant(NativeImagePickerIOS, 'ImagePickerIOS is not available');
|
||||
|
||||
var newConfig = {
|
||||
showImages: true,
|
||||
showVideos: false,
|
||||
};
|
||||
|
||||
if (config.showImages != null) {
|
||||
newConfig.showImages = config.showImages;
|
||||
}
|
||||
|
||||
if (config.showVideos != null) {
|
||||
newConfig.showVideos = config.showVideos;
|
||||
}
|
||||
|
||||
return NativeImagePickerIOS.openSelectDialog(
|
||||
newConfig,
|
||||
successCallback,
|
||||
cancelCallback,
|
||||
);
|
||||
},
|
||||
/**
|
||||
* In iOS 13, the video URLs returned by the Image Picker are invalidated when
|
||||
* the picker is dismissed, unless reference to it is held. This API allows
|
||||
* the application to signal when it's finished with the video so that the
|
||||
* reference can be cleaned up.
|
||||
* It is safe to call this method for urlsthat aren't video URLs;
|
||||
* it will be a no-op.
|
||||
*/
|
||||
removePendingVideo: function (url: string): void {
|
||||
invariant(NativeImagePickerIOS, 'ImagePickerIOS is not available');
|
||||
NativeImagePickerIOS.removePendingVideo(url);
|
||||
},
|
||||
/**
|
||||
* WARNING: In most cases, removePendingVideo should be used instead because
|
||||
* clearAllPendingVideos could clear out pending videos made by other callers.
|
||||
*/
|
||||
clearAllPendingVideos: function (): void {
|
||||
invariant(NativeImagePickerIOS, 'ImagePickerIOS is not available');
|
||||
NativeImagePickerIOS.clearAllPendingVideos();
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = ImagePickerIOS;
|
||||
@@ -11,8 +11,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Keep this in sync with `DeprecatedImageSourcePropType.js`.
|
||||
*
|
||||
* This type is intentionally inexact in order to permit call sites that supply
|
||||
* extra properties.
|
||||
*/
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {TurboModule} from '../TurboModule/RCTExport';
|
||||
|
||||
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+getConstants: () => {||};
|
||||
+canRecordVideos: (callback: (result: boolean) => void) => void;
|
||||
+canUseCamera: (callback: (result: boolean) => void) => void;
|
||||
+openCameraDialog: (
|
||||
config: {|
|
||||
unmirrorFrontFacingCamera: boolean,
|
||||
videoMode: boolean,
|
||||
|},
|
||||
successCallback: (imageURL: string, height: number, width: number) => void,
|
||||
cancelCallback: () => void,
|
||||
) => void;
|
||||
+openSelectDialog: (
|
||||
config: {|
|
||||
showImages: boolean,
|
||||
showVideos: boolean,
|
||||
|},
|
||||
successCallback: (imageURL: string, height: number, width: number) => void,
|
||||
cancelCallback: () => void,
|
||||
) => void;
|
||||
+clearAllPendingVideos: () => void;
|
||||
+removePendingVideo: (url: string) => void;
|
||||
}
|
||||
|
||||
export default (TurboModuleRegistry.get<Spec>('ImagePickerIOS'): ?Spec);
|
||||
Vendored
+1
-42
@@ -19,48 +19,6 @@ import {ViewStyle} from '../StyleSheet/StyleSheetTypes';
|
||||
import {View} from '../Components/View/View';
|
||||
|
||||
export interface FlatListProps<ItemT> extends VirtualizedListProps<ItemT> {
|
||||
/**
|
||||
* Rendered in between each item, but not at the top or bottom
|
||||
*/
|
||||
ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
|
||||
|
||||
/**
|
||||
* Rendered when the list is empty.
|
||||
*/
|
||||
ListEmptyComponent?:
|
||||
| React.ComponentType<any>
|
||||
| React.ReactElement
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* Rendered at the very end of the list.
|
||||
*/
|
||||
ListFooterComponent?:
|
||||
| React.ComponentType<any>
|
||||
| React.ReactElement
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* Styling for internal View for ListFooterComponent
|
||||
*/
|
||||
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
|
||||
|
||||
/**
|
||||
* Rendered at the very beginning of the list.
|
||||
*/
|
||||
ListHeaderComponent?:
|
||||
| React.ComponentType<any>
|
||||
| React.ReactElement
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* Styling for internal View for ListHeaderComponent
|
||||
*/
|
||||
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
|
||||
|
||||
/**
|
||||
* Optional custom style for multi-item rows generated when numColumns > 1
|
||||
*/
|
||||
@@ -248,6 +206,7 @@ export class FlatList<ItemT = any> extends React.Component<
|
||||
scrollToItem: (params: {
|
||||
animated?: boolean | null | undefined;
|
||||
item: ItemT;
|
||||
viewOffset?: number | undefined;
|
||||
viewPosition?: number | undefined;
|
||||
}) => void;
|
||||
|
||||
|
||||
@@ -334,6 +334,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
||||
scrollToItem(params: {
|
||||
animated?: ?boolean,
|
||||
item: ItemT,
|
||||
viewOffset?: number,
|
||||
viewPosition?: number,
|
||||
...
|
||||
}) {
|
||||
|
||||
Vendored
-42
@@ -61,48 +61,6 @@ export type SectionListRenderItem<ItemT, SectionT = DefaultSectionT> = (
|
||||
|
||||
export interface SectionListProps<ItemT, SectionT = DefaultSectionT>
|
||||
extends VirtualizedListWithoutRenderItemProps<ItemT> {
|
||||
/**
|
||||
* Rendered in between adjacent Items within each section.
|
||||
*/
|
||||
ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
|
||||
|
||||
/**
|
||||
* Rendered when the list is empty.
|
||||
*/
|
||||
ListEmptyComponent?:
|
||||
| React.ComponentType<any>
|
||||
| React.ReactElement
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* Rendered at the very end of the list.
|
||||
*/
|
||||
ListFooterComponent?:
|
||||
| React.ComponentType<any>
|
||||
| React.ReactElement
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* Styling for internal View for ListFooterComponent
|
||||
*/
|
||||
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined | null;
|
||||
|
||||
/**
|
||||
* Rendered at the very beginning of the list.
|
||||
*/
|
||||
ListHeaderComponent?:
|
||||
| React.ComponentType<any>
|
||||
| React.ReactElement
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* Styling for internal View for ListHeaderComponent
|
||||
*/
|
||||
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined | null;
|
||||
|
||||
/**
|
||||
* Rendered in between each section.
|
||||
*/
|
||||
|
||||
Vendored
+31
-1
@@ -9,7 +9,14 @@
|
||||
|
||||
import type * as React from 'react';
|
||||
import type {LayoutChangeEvent} from '../../types';
|
||||
import type {ScrollViewProps} from '../Components/ScrollView/ScrollView';
|
||||
import {StyleProp} from '../StyleSheet/StyleSheet';
|
||||
import {ViewStyle} from '../StyleSheet/StyleSheetTypes';
|
||||
import type {
|
||||
ScrollResponderMixin,
|
||||
ScrollView,
|
||||
ScrollViewProps,
|
||||
} from '../Components/ScrollView/ScrollView';
|
||||
import type {View} from '../Components/View/View';
|
||||
|
||||
export interface ViewToken {
|
||||
item: any;
|
||||
@@ -96,6 +103,7 @@ export class VirtualizedList<ItemT> extends React.Component<
|
||||
scrollToItem: (params: {
|
||||
animated?: boolean | undefined;
|
||||
item: ItemT;
|
||||
viewOffset?: number | undefined;
|
||||
viewPosition?: number | undefined;
|
||||
}) => void;
|
||||
|
||||
@@ -111,6 +119,13 @@ export class VirtualizedList<ItemT> extends React.Component<
|
||||
}) => void;
|
||||
|
||||
recordInteraction: () => void;
|
||||
|
||||
getScrollRef: () =>
|
||||
| React.ElementRef<typeof ScrollView>
|
||||
| React.ElementRef<typeof View>
|
||||
| null;
|
||||
|
||||
getScrollResponder: () => ScrollResponderMixin | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,6 +139,11 @@ export interface VirtualizedListProps<ItemT>
|
||||
|
||||
export interface VirtualizedListWithoutRenderItemProps<ItemT>
|
||||
extends ScrollViewProps {
|
||||
/**
|
||||
* Rendered in between each item, but not at the top or bottom
|
||||
*/
|
||||
ItemSeparatorComponent?: React.ComponentType<any> | null | undefined;
|
||||
|
||||
/**
|
||||
* Rendered when the list is empty. Can be a React Component Class, a render function, or
|
||||
* a rendered element.
|
||||
@@ -144,6 +164,11 @@ export interface VirtualizedListWithoutRenderItemProps<ItemT>
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* Styling for internal View for ListFooterComponent
|
||||
*/
|
||||
ListFooterComponentStyle?: StyleProp<ViewStyle> | undefined;
|
||||
|
||||
/**
|
||||
* Rendered at the top of all the items. Can be a React Component Class, a render function, or
|
||||
* a rendered element.
|
||||
@@ -154,6 +179,11 @@ export interface VirtualizedListWithoutRenderItemProps<ItemT>
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* Styling for internal View for ListHeaderComponent
|
||||
*/
|
||||
ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
|
||||
|
||||
/**
|
||||
* The default accessor functions assume this is an Array<{key: string}> but you can override
|
||||
* getItem, getItemCount, and keyExtractor to handle any type of index-based data.
|
||||
|
||||
@@ -263,6 +263,7 @@ export default class VirtualizedList extends StateSafePureComponent<
|
||||
scrollToItem(params: {
|
||||
animated?: ?boolean,
|
||||
item: Item,
|
||||
viewOffset?: number,
|
||||
viewPosition?: number,
|
||||
...
|
||||
}) {
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
export type Timestamp = number;
|
||||
export type PerformanceEntryType = 'event';
|
||||
|
||||
export class PerformanceEntry {
|
||||
name: string;
|
||||
entryType: PerformanceEntryType;
|
||||
startTime: Timestamp;
|
||||
duration: number;
|
||||
|
||||
// For "event" entries only:
|
||||
processingStart: ?Timestamp;
|
||||
processingEnd: ?Timestamp;
|
||||
interactionId: ?number;
|
||||
|
||||
// $FlowIgnore: Flow(unclear-type)
|
||||
toJSON(): Object {
|
||||
return {
|
||||
name: this.name,
|
||||
entryType: this.entryType,
|
||||
startTime: this.startTime,
|
||||
duration: this.duration,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export type PerformanceEntryList = $ReadOnlyArray<PerformanceEntry>;
|
||||
|
||||
export class PerformanceObserverEntryList {
|
||||
_entries: PerformanceEntryList;
|
||||
|
||||
constructor(entries: PerformanceEntryList) {
|
||||
this._entries = entries;
|
||||
}
|
||||
|
||||
getEntries(): PerformanceEntryList {
|
||||
return this._entries;
|
||||
}
|
||||
|
||||
getEntriesByType(type: PerformanceEntryType): PerformanceEntryList {
|
||||
return this._entries.filter(entry => entry.entryType === type);
|
||||
}
|
||||
|
||||
getEntriesByName(
|
||||
name: string,
|
||||
type?: PerformanceEntryType,
|
||||
): PerformanceEntryList {
|
||||
if (type === undefined) {
|
||||
return this._entries.filter(entry => entry.name === name);
|
||||
} else {
|
||||
return this._entries.filter(
|
||||
entry => entry.name === name && entry.entryType === type,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type PerformanceObserverCallback = (
|
||||
list: PerformanceObserverEntryList,
|
||||
observer: PerformanceObserver,
|
||||
) => void;
|
||||
|
||||
export type PerformanceObserverInit =
|
||||
| {
|
||||
entryTypes: PerformanceEntryType[],
|
||||
buffered?: boolean,
|
||||
}
|
||||
| {
|
||||
type: PerformanceEntryType,
|
||||
buffered?: boolean,
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of the PerformanceObserver interface for RN,
|
||||
* corresponding to the standard in https://www.w3.org/TR/performance-timeline/
|
||||
*
|
||||
* @example
|
||||
* const observer = new PerformanceObserver((list, _observer) => {
|
||||
* const entries = list.getEntries();
|
||||
* entries.forEach(entry => {
|
||||
* reportEvent({
|
||||
* eventName: entry.name,
|
||||
* startTime: entry.startTime,
|
||||
* endTime: entry.startTime + entry.duration,
|
||||
* processingStart: entry.processingStart,
|
||||
* processingEnd: entry.processingEnd,
|
||||
* interactionId: entry.interactionId,
|
||||
* });
|
||||
* });
|
||||
* });
|
||||
* observer.observe({ type: "event" });
|
||||
*/
|
||||
export default class PerformanceObserver {
|
||||
_callback: PerformanceObserverCallback;
|
||||
|
||||
constructor(callback: PerformanceObserverCallback) {
|
||||
this._callback = callback;
|
||||
}
|
||||
|
||||
observe(options: PerformanceObserverInit) {
|
||||
console.log('PerformanceObserver: started observing');
|
||||
}
|
||||
|
||||
disconnect(): void {
|
||||
console.log('PerformanceObserver: stopped observing');
|
||||
}
|
||||
|
||||
takeRecords(): PerformanceEntryList {
|
||||
return [];
|
||||
}
|
||||
|
||||
static supportedEntryTypes: PerformanceEntryType[] = ['event'];
|
||||
}
|
||||
@@ -75,7 +75,8 @@ const PERMISSIONS = Object.freeze({
|
||||
ANSWER_PHONE_CALLS: 'android.permission.ANSWER_PHONE_CALLS',
|
||||
READ_PHONE_NUMBERS: 'android.permission.READ_PHONE_NUMBERS',
|
||||
UWB_RANGING: 'android.permission.UWB_RANGING',
|
||||
POST_NOTIFICATION: 'android.permission.POST_NOTIFICATIONS',
|
||||
POST_NOTIFICATION: 'android.permission.POST_NOTIFICATIONS', // Remove in 0.72
|
||||
POST_NOTIFICATIONS: 'android.permission.POST_NOTIFICATIONS',
|
||||
NEARBY_WIFI_DEVICES: 'android.permission.NEARBY_WIFI_DEVICES',
|
||||
});
|
||||
|
||||
@@ -106,7 +107,8 @@ class PermissionsAndroid {
|
||||
CAMERA: string,
|
||||
GET_ACCOUNTS: string,
|
||||
NEARBY_WIFI_DEVICES: string,
|
||||
POST_NOTIFICATION: string,
|
||||
POST_NOTIFICATION: string, // Remove in 0.72
|
||||
POST_NOTIFICATIONS: string,
|
||||
PROCESS_OUTGOING_CALLS: string,
|
||||
READ_CALENDAR: string,
|
||||
READ_CALL_LOG: string,
|
||||
|
||||
@@ -49,6 +49,11 @@ export interface PushNotification {
|
||||
*/
|
||||
getData(): Object;
|
||||
|
||||
/**
|
||||
* Gets the thread ID on the notif
|
||||
*/
|
||||
getThreadId(): string;
|
||||
|
||||
/**
|
||||
* iOS Only
|
||||
* Signifies remote notification handling is complete
|
||||
@@ -135,6 +140,21 @@ export interface PushNotificationIOSStatic {
|
||||
*/
|
||||
cancelAllLocalNotifications(): void;
|
||||
|
||||
/**
|
||||
* Remove all delivered notifications from Notification Center.
|
||||
*/
|
||||
removeAllDeliveredNotifications(): void;
|
||||
|
||||
/**
|
||||
* Provides you with a list of the app’s notifications that are still displayed in Notification Center.
|
||||
*/
|
||||
getDeliveredNotifications(callback: (notifications: Object[]) => void): void;
|
||||
|
||||
/**
|
||||
* Removes the specified notifications from Notification Center
|
||||
*/
|
||||
removeDeliveredNotifications(identifiers: string[]): void;
|
||||
|
||||
/**
|
||||
* Cancel local notifications.
|
||||
* Optionally restricts the set of canceled notifications to those notifications whose userInfo fields match the corresponding fields in the userInfo argument.
|
||||
|
||||
+51
@@ -8,9 +8,12 @@
|
||||
*/
|
||||
|
||||
import type * as React from 'react';
|
||||
import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
|
||||
|
||||
type Task = (taskData: any) => Promise<void>;
|
||||
type TaskProvider = () => Task;
|
||||
type TaskCanceller = () => void;
|
||||
type TaskCancelProvider = () => TaskCanceller;
|
||||
|
||||
export type ComponentProvider = () => React.ComponentType<any>;
|
||||
|
||||
@@ -22,6 +25,15 @@ export type AppConfig = {
|
||||
run?: Runnable | undefined;
|
||||
};
|
||||
|
||||
export type ComponentProviderInstrumentationHook = (
|
||||
component: ComponentProvider,
|
||||
scopedPerformanceLogger: IPerformanceLogger,
|
||||
) => React.ComponentType<any>;
|
||||
|
||||
export type WrapperComponentProvider = (
|
||||
appParameters: any,
|
||||
) => React.ComponentType<any>;
|
||||
|
||||
/**
|
||||
* `AppRegistry` is the JS entry point to running all React Native apps. App
|
||||
* root components should register themselves with
|
||||
@@ -38,17 +50,31 @@ export type AppConfig = {
|
||||
* `require`d.
|
||||
*/
|
||||
export namespace AppRegistry {
|
||||
export function setWrapperComponentProvider(
|
||||
provider: WrapperComponentProvider,
|
||||
): void;
|
||||
|
||||
export function registerConfig(config: AppConfig[]): void;
|
||||
|
||||
export function registerComponent(
|
||||
appKey: string,
|
||||
getComponentFunc: ComponentProvider,
|
||||
section?: boolean,
|
||||
): string;
|
||||
|
||||
export function registerRunnable(appKey: string, func: Runnable): string;
|
||||
|
||||
export function registerSection(
|
||||
appKey: string,
|
||||
component: ComponentProvider,
|
||||
): void;
|
||||
|
||||
export function getAppKeys(): string[];
|
||||
|
||||
export function getSectionKeys(): string[];
|
||||
|
||||
export function getSections(): Record<string, Runnable>;
|
||||
|
||||
export function unmountApplicationComponentAtRootTag(rootTag: number): void;
|
||||
|
||||
export function runApplication(appKey: string, appParameters: any): void;
|
||||
@@ -65,4 +91,29 @@ export namespace AppRegistry {
|
||||
): void;
|
||||
|
||||
export function getRunnable(appKey: string): Runnable | undefined;
|
||||
|
||||
export function getRegistry(): {sections: string[]; runnables: Runnable[]};
|
||||
|
||||
export function setComponentProviderInstrumentationHook(
|
||||
hook: ComponentProviderInstrumentationHook,
|
||||
): void;
|
||||
|
||||
export function registerHeadlessTask(
|
||||
taskKey: string,
|
||||
taskProvider: TaskProvider,
|
||||
): void;
|
||||
|
||||
export function registerCancellableHeadlessTask(
|
||||
taskKey: string,
|
||||
taskProvider: TaskProvider,
|
||||
taskCancelProvider: TaskCancelProvider,
|
||||
): void;
|
||||
|
||||
export function startHeadlessTask(
|
||||
taskId: number,
|
||||
taskKey: string,
|
||||
data: any,
|
||||
): void;
|
||||
|
||||
export function cancelHeadlessTask(taskId: number, taskKey: string): void;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,9 @@ export type Registry = {
|
||||
runnables: Runnables,
|
||||
...
|
||||
};
|
||||
export type WrapperComponentProvider = any => React$ComponentType<any>;
|
||||
export type WrapperComponentProvider = (
|
||||
appParameters: any,
|
||||
) => React$ComponentType<any>;
|
||||
|
||||
const runnables: Runnables = {};
|
||||
let runCount = 1;
|
||||
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type * as React from 'react';
|
||||
|
||||
export type RootTag = number;
|
||||
export const RootTagContext: React.Context<RootTag>;
|
||||
Vendored
+7
-3
@@ -87,9 +87,13 @@ export namespace StyleSheet {
|
||||
* an array, saving allocations and maintaining reference equality for
|
||||
* PureComponent checks.
|
||||
*/
|
||||
export function compose<T>(
|
||||
style1: StyleProp<T> | Array<StyleProp<T>>,
|
||||
style2: StyleProp<T> | Array<StyleProp<T>>,
|
||||
export function compose<
|
||||
T extends ViewStyle | TextStyle | ImageStyle,
|
||||
U extends T,
|
||||
V extends T,
|
||||
>(
|
||||
style1: StyleProp<U> | Array<StyleProp<U>>,
|
||||
style2: StyleProp<V> | Array<StyleProp<V>>,
|
||||
): StyleProp<T>;
|
||||
|
||||
/**
|
||||
|
||||
-1
@@ -236,7 +236,6 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
|
||||
borderTopWidth?: number | undefined;
|
||||
borderWidth?: number | undefined;
|
||||
opacity?: number | undefined;
|
||||
testID?: string | undefined;
|
||||
/**
|
||||
* Sets the elevation of a view, using Android's underlying
|
||||
* [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).
|
||||
|
||||
@@ -36,6 +36,7 @@ RCT_REMAP_SHADOW_PROPERTY(fontWeight, textAttributes.fontWeight, NSString)
|
||||
RCT_REMAP_SHADOW_PROPERTY(fontStyle, textAttributes.fontStyle, NSString)
|
||||
RCT_REMAP_SHADOW_PROPERTY(fontVariant, textAttributes.fontVariant, NSArray)
|
||||
RCT_REMAP_SHADOW_PROPERTY(allowFontScaling, textAttributes.allowFontScaling, BOOL)
|
||||
RCT_REMAP_SHADOW_PROPERTY(dynamicTypeRamp, textAttributes.dynamicTypeRamp, RCTDynamicTypeRamp)
|
||||
RCT_REMAP_SHADOW_PROPERTY(maxFontSizeMultiplier, textAttributes.maxFontSizeMultiplier, CGFloat)
|
||||
RCT_REMAP_SHADOW_PROPERTY(letterSpacing, textAttributes.letterSpacing, CGFloat)
|
||||
// Paragraph Styles
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <React/RCTDynamicTypeRamp.h>
|
||||
#import <React/RCTTextDecorationLineType.h>
|
||||
|
||||
#import "RCTTextTransform.h"
|
||||
@@ -36,6 +37,7 @@ extern NSString *const RCTTextAttributesTagAttributeName;
|
||||
@property (nonatomic, copy, nullable) NSString *fontStyle;
|
||||
@property (nonatomic, copy, nullable) NSArray<NSString *> *fontVariant;
|
||||
@property (nonatomic, assign) BOOL allowFontScaling;
|
||||
@property (nonatomic, assign) RCTDynamicTypeRamp dynamicTypeRamp;
|
||||
@property (nonatomic, assign) CGFloat letterSpacing;
|
||||
// Paragraph Styles
|
||||
@property (nonatomic, assign) CGFloat lineHeight;
|
||||
|
||||
@@ -59,6 +59,8 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
|
||||
_fontStyle = textAttributes->_fontStyle ?: _fontStyle;
|
||||
_fontVariant = textAttributes->_fontVariant ?: _fontVariant;
|
||||
_allowFontScaling = textAttributes->_allowFontScaling || _allowFontScaling; // *
|
||||
_dynamicTypeRamp = textAttributes->_dynamicTypeRamp != RCTDynamicTypeRampUndefined ? textAttributes->_dynamicTypeRamp
|
||||
: _dynamicTypeRamp;
|
||||
_letterSpacing = !isnan(textAttributes->_letterSpacing) ? textAttributes->_letterSpacing : _letterSpacing;
|
||||
|
||||
// Paragraph Styles
|
||||
@@ -230,6 +232,12 @@ NSString *const RCTTextAttributesTagAttributeName = @"RCTTextAttributesTagAttrib
|
||||
|
||||
if (fontScalingEnabled) {
|
||||
CGFloat fontSizeMultiplier = !isnan(_fontSizeMultiplier) ? _fontSizeMultiplier : 1.0;
|
||||
if (_dynamicTypeRamp != RCTDynamicTypeRampUndefined) {
|
||||
UIFontMetrics *fontMetrics = RCTUIFontMetricsForDynamicTypeRamp(_dynamicTypeRamp);
|
||||
// Using a specific font size reduces rounding errors from -scaledValueForValue:
|
||||
CGFloat requestedSize = isnan(_fontSize) ? RCTBaseSizeForDynamicTypeRamp(_dynamicTypeRamp) : _fontSize;
|
||||
fontSizeMultiplier = [fontMetrics scaledValueForValue:requestedSize] / requestedSize;
|
||||
}
|
||||
CGFloat maxFontSizeMultiplier = !isnan(_maxFontSizeMultiplier) ? _maxFontSizeMultiplier : 0.0;
|
||||
return maxFontSizeMultiplier >= 1.0 ? fminf(maxFontSizeMultiplier, fontSizeMultiplier) : fontSizeMultiplier;
|
||||
} else {
|
||||
@@ -324,7 +332,7 @@ static NSString *capitalizeText(NSString *text)
|
||||
RCTTextAttributesCompareFloats(_fontSizeMultiplier) && RCTTextAttributesCompareFloats(_maxFontSizeMultiplier) &&
|
||||
RCTTextAttributesCompareStrings(_fontWeight) && RCTTextAttributesCompareObjects(_fontStyle) &&
|
||||
RCTTextAttributesCompareObjects(_fontVariant) && RCTTextAttributesCompareOthers(_allowFontScaling) &&
|
||||
RCTTextAttributesCompareFloats(_letterSpacing) &&
|
||||
RCTTextAttributesCompareOthers(_dynamicTypeRamp) && RCTTextAttributesCompareFloats(_letterSpacing) &&
|
||||
// Paragraph Styles
|
||||
RCTTextAttributesCompareFloats(_lineHeight) && RCTTextAttributesCompareFloats(_alignment) &&
|
||||
RCTTextAttributesCompareOthers(_baseWritingDirection) && RCTTextAttributesCompareOthers(_lineBreakStrategy) &&
|
||||
|
||||
Vendored
+17
@@ -26,6 +26,23 @@ export interface TextPropsIOS {
|
||||
*/
|
||||
adjustsFontSizeToFit?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* The Dynamic Text scale ramp to apply to this element on iOS.
|
||||
*/
|
||||
dynamicTypeRamp?:
|
||||
| 'caption2'
|
||||
| 'caption1'
|
||||
| 'footnote'
|
||||
| 'subheadline'
|
||||
| 'callout'
|
||||
| 'body'
|
||||
| 'headline'
|
||||
| 'title3'
|
||||
| 'title2'
|
||||
| 'title1'
|
||||
| 'largeTitle'
|
||||
| undefined;
|
||||
|
||||
/**
|
||||
* Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <React/RCTConvert.h>
|
||||
|
||||
typedef NS_ENUM(NSInteger, RCTDynamicTypeRamp) {
|
||||
RCTDynamicTypeRampUndefined,
|
||||
RCTDynamicTypeRampCaption2,
|
||||
RCTDynamicTypeRampCaption1,
|
||||
RCTDynamicTypeRampFootnote,
|
||||
RCTDynamicTypeRampSubheadline,
|
||||
RCTDynamicTypeRampCallout,
|
||||
RCTDynamicTypeRampBody,
|
||||
RCTDynamicTypeRampHeadline,
|
||||
RCTDynamicTypeRampTitle3,
|
||||
RCTDynamicTypeRampTitle2,
|
||||
RCTDynamicTypeRampTitle1,
|
||||
RCTDynamicTypeRampLargeTitle
|
||||
};
|
||||
|
||||
@interface RCTConvert (DynamicTypeRamp)
|
||||
|
||||
+ (RCTDynamicTypeRamp)RCTDynamicTypeRamp:(nullable id)json;
|
||||
|
||||
@end
|
||||
|
||||
/// Generates a `UIFontMetrics` instance representing a particular Dynamic Type ramp.
|
||||
UIFontMetrics *_Nonnull RCTUIFontMetricsForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp);
|
||||
/// The "reference" size for a particular font scale ramp, equal to a text element's size under default text size
|
||||
/// settings.
|
||||
CGFloat RCTBaseSizeForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp);
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <React/RCTDynamicTypeRamp.h>
|
||||
|
||||
@implementation RCTConvert (DynamicTypeRamp)
|
||||
|
||||
RCT_ENUM_CONVERTER(
|
||||
RCTDynamicTypeRamp,
|
||||
(@{
|
||||
@"caption2" : @(RCTDynamicTypeRampCaption2),
|
||||
@"caption1" : @(RCTDynamicTypeRampCaption1),
|
||||
@"footnote" : @(RCTDynamicTypeRampFootnote),
|
||||
@"subheadline" : @(RCTDynamicTypeRampSubheadline),
|
||||
@"callout" : @(RCTDynamicTypeRampCallout),
|
||||
@"body" : @(RCTDynamicTypeRampBody),
|
||||
@"headline" : @(RCTDynamicTypeRampHeadline),
|
||||
@"title3" : @(RCTDynamicTypeRampTitle3),
|
||||
@"title2" : @(RCTDynamicTypeRampTitle2),
|
||||
@"title1" : @(RCTDynamicTypeRampTitle1),
|
||||
@"largeTitle" : @(RCTDynamicTypeRampLargeTitle),
|
||||
}),
|
||||
RCTDynamicTypeRampUndefined,
|
||||
integerValue)
|
||||
|
||||
@end
|
||||
|
||||
UIFontMetrics *RCTUIFontMetricsForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp)
|
||||
{
|
||||
static NSDictionary<NSNumber *, UIFontTextStyle> *mapping;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
mapping = @{
|
||||
@(RCTDynamicTypeRampCaption2) : UIFontTextStyleCaption2,
|
||||
@(RCTDynamicTypeRampCaption1) : UIFontTextStyleCaption1,
|
||||
@(RCTDynamicTypeRampFootnote) : UIFontTextStyleFootnote,
|
||||
@(RCTDynamicTypeRampSubheadline) : UIFontTextStyleSubheadline,
|
||||
@(RCTDynamicTypeRampCallout) : UIFontTextStyleCallout,
|
||||
@(RCTDynamicTypeRampBody) : UIFontTextStyleBody,
|
||||
@(RCTDynamicTypeRampHeadline) : UIFontTextStyleHeadline,
|
||||
@(RCTDynamicTypeRampTitle3) : UIFontTextStyleTitle3,
|
||||
@(RCTDynamicTypeRampTitle2) : UIFontTextStyleTitle2,
|
||||
@(RCTDynamicTypeRampTitle1) : UIFontTextStyleTitle1,
|
||||
@(RCTDynamicTypeRampLargeTitle) : UIFontTextStyleLargeTitle,
|
||||
};
|
||||
});
|
||||
|
||||
id textStyle =
|
||||
mapping[@(dynamicTypeRamp)] ?: UIFontTextStyleBody; // Default to body if we don't recognize the specified ramp
|
||||
return [UIFontMetrics metricsForTextStyle:textStyle];
|
||||
}
|
||||
|
||||
CGFloat RCTBaseSizeForDynamicTypeRamp(RCTDynamicTypeRamp dynamicTypeRamp)
|
||||
{
|
||||
static NSDictionary<NSNumber *, NSNumber *> *mapping;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
// Values taken from
|
||||
// https://developer.apple.com/design/human-interface-guidelines/foundations/typography/#specifications
|
||||
mapping = @{
|
||||
@(RCTDynamicTypeRampCaption2) : @11,
|
||||
@(RCTDynamicTypeRampCaption1) : @12,
|
||||
@(RCTDynamicTypeRampFootnote) : @13,
|
||||
@(RCTDynamicTypeRampSubheadline) : @15,
|
||||
@(RCTDynamicTypeRampCallout) : @16,
|
||||
@(RCTDynamicTypeRampBody) : @17,
|
||||
@(RCTDynamicTypeRampHeadline) : @17,
|
||||
@(RCTDynamicTypeRampTitle3) : @20,
|
||||
@(RCTDynamicTypeRampTitle2) : @22,
|
||||
@(RCTDynamicTypeRampTitle1) : @28,
|
||||
@(RCTDynamicTypeRampLargeTitle) : @34,
|
||||
};
|
||||
});
|
||||
|
||||
NSNumber *baseSize =
|
||||
mapping[@(dynamicTypeRamp)] ?: @17; // Default to body size if we don't recognize the specified ramp
|
||||
return CGFLOAT_IS_DOUBLE ? [baseSize doubleValue] : [baseSize floatValue];
|
||||
}
|
||||
@@ -34,6 +34,7 @@ const textViewConfig = {
|
||||
numberOfLines: true,
|
||||
ellipsizeMode: true,
|
||||
allowFontScaling: true,
|
||||
dynamicTypeRamp: true,
|
||||
maxFontSizeMultiplier: true,
|
||||
disabled: true,
|
||||
selectable: true,
|
||||
|
||||
@@ -229,6 +229,23 @@ export type TextProps = $ReadOnly<{|
|
||||
*/
|
||||
adjustsFontSizeToFit?: ?boolean,
|
||||
|
||||
/**
|
||||
* The Dynamic Text scale ramp to apply to this element on iOS.
|
||||
*/
|
||||
dynamicTypeRamp?: ?(
|
||||
| 'caption2'
|
||||
| 'caption1'
|
||||
| 'footnote'
|
||||
| 'subheadline'
|
||||
| 'callout'
|
||||
| 'body'
|
||||
| 'headline'
|
||||
| 'title3'
|
||||
| 'title2'
|
||||
| 'title1'
|
||||
| 'largeTitle'
|
||||
),
|
||||
|
||||
/**
|
||||
* Smallest possible scale a font can reach.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
export type Timespan = {
|
||||
startTime: number;
|
||||
endTime?: number;
|
||||
totalTime?: number;
|
||||
startExtras?: Extras;
|
||||
endExtras?: Extras;
|
||||
};
|
||||
|
||||
// Extra values should be serializable primitives
|
||||
export type ExtraValue = number | string | boolean;
|
||||
|
||||
export type Extras = {[key: string]: ExtraValue};
|
||||
|
||||
export interface IPerformanceLogger {
|
||||
addTimespan(
|
||||
key: string,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
startExtras?: Extras,
|
||||
endExtras?: Extras,
|
||||
): void;
|
||||
append(logger: IPerformanceLogger): void;
|
||||
clear(): void;
|
||||
clearCompleted(): void;
|
||||
close(): void;
|
||||
currentTimestamp(): number;
|
||||
getExtras(): {[key: string]: ExtraValue | null};
|
||||
getPoints(): {[key: string]: number | null};
|
||||
getPointExtras(): {[key: string]: Extras | null};
|
||||
getTimespans(): {[key: string]: Timespan | null};
|
||||
hasTimespan(key: string): boolean;
|
||||
isClosed(): boolean;
|
||||
logEverything(): void;
|
||||
markPoint(key: string, timestamp?: number, extras?: Extras): void;
|
||||
removeExtra(key: string): ExtraValue | null;
|
||||
setExtra(key: string, value: ExtraValue): void;
|
||||
startTimespan(key: string, timestamp?: number, extras?: Extras): void;
|
||||
stopTimespan(key: string, timestamp?: number, extras?: Extras): void;
|
||||
}
|
||||
Vendored
+1
-1
@@ -31,7 +31,7 @@
|
||||
* V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(3s)--> V(fixed)
|
||||
*/
|
||||
export interface VibrationStatic {
|
||||
vibrate(pattern?: number | number[] | null, repeat?: boolean | null): void;
|
||||
vibrate(pattern?: number | number[], repeat?: boolean): void;
|
||||
|
||||
/**
|
||||
* Stop vibration
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include "NativePerformanceObserver.h"
|
||||
#include <glog/logging.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
NativePerformanceObserver::NativePerformanceObserver(
|
||||
std::shared_ptr<CallInvoker> jsInvoker)
|
||||
: NativePerformanceObserverCxxSpec(std::move(jsInvoker)) {}
|
||||
|
||||
void NativePerformanceObserver::startReporting(
|
||||
jsi::Runtime &rt,
|
||||
std::string entryType) {
|
||||
LOG(INFO) << "Started reporting perf entry type: " << entryType;
|
||||
}
|
||||
|
||||
void NativePerformanceObserver::stopReporting(
|
||||
jsi::Runtime &rt,
|
||||
std::string entryType) {
|
||||
LOG(INFO) << "Stopped reporting perf entry type: " << entryType;
|
||||
}
|
||||
|
||||
std::vector<RawPerformanceEntry> NativePerformanceObserver::getPendingEntries(
|
||||
jsi::Runtime &rt) {
|
||||
return std::vector<RawPerformanceEntry>{};
|
||||
}
|
||||
|
||||
void NativePerformanceObserver::setOnPerformanceEntryCallback(
|
||||
jsi::Runtime &rt,
|
||||
std::optional<AsyncCallback<>> callback) {
|
||||
callback_ = callback;
|
||||
LOG(INFO) << "setOnPerformanceEntryCallback: "
|
||||
<< (callback ? "non-empty" : "empty");
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <FBReactNativeSpec/FBReactNativeSpecJSI.h>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
#pragma mark - Structs
|
||||
|
||||
using RawPerformanceEntry = NativePerformanceObserverCxxBaseRawPerformanceEntry<
|
||||
std::string,
|
||||
int32_t,
|
||||
double,
|
||||
double,
|
||||
// For "event" entries only:
|
||||
std::optional<double>,
|
||||
std::optional<double>,
|
||||
std::optional<double>>;
|
||||
|
||||
template <>
|
||||
struct Bridging<RawPerformanceEntry>
|
||||
: NativePerformanceObserverCxxBaseRawPerformanceEntryBridging<
|
||||
std::string,
|
||||
int32_t,
|
||||
double,
|
||||
double,
|
||||
std::optional<double>,
|
||||
std::optional<double>,
|
||||
std::optional<double>> {};
|
||||
|
||||
#pragma mark - implementation
|
||||
|
||||
class NativePerformanceObserver
|
||||
: public NativePerformanceObserverCxxSpec<NativePerformanceObserver>,
|
||||
std::enable_shared_from_this<NativePerformanceObserver> {
|
||||
public:
|
||||
NativePerformanceObserver(std::shared_ptr<CallInvoker> jsInvoker);
|
||||
|
||||
void startReporting(jsi::Runtime &rt, std::string entryType);
|
||||
|
||||
void stopReporting(jsi::Runtime &rt, std::string entryType);
|
||||
|
||||
std::vector<RawPerformanceEntry> getPendingEntries(jsi::Runtime &rt);
|
||||
|
||||
void setOnPerformanceEntryCallback(
|
||||
jsi::Runtime &rt,
|
||||
std::optional<AsyncCallback<>> callback);
|
||||
|
||||
private:
|
||||
std::optional<AsyncCallback<>> callback_;
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict
|
||||
* @format
|
||||
*/
|
||||
|
||||
import type {TurboModule} from '../TurboModule/RCTExport';
|
||||
|
||||
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
|
||||
|
||||
export const RawPerformanceEntryTypeValues = {
|
||||
UNDEFINED: 0,
|
||||
};
|
||||
|
||||
export type RawPerformanceEntryType = number;
|
||||
|
||||
export type RawPerformanceEntry = {|
|
||||
name: string,
|
||||
entryType: RawPerformanceEntryType,
|
||||
startTime: number,
|
||||
duration: number,
|
||||
// For "event" entries only:
|
||||
processingStart?: number,
|
||||
processingEnd?: number,
|
||||
interactionId?: number,
|
||||
|};
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+startReporting: (entryType: string) => void;
|
||||
+stopReporting: (entryType: string) => void;
|
||||
+getPendingEntries: () => $ReadOnlyArray<RawPerformanceEntry>;
|
||||
+setOnPerformanceEntryCallback: (callback?: () => void) => void;
|
||||
}
|
||||
|
||||
export default (TurboModuleRegistry.get<Spec>(
|
||||
'NativePerformanceObserverCxx',
|
||||
): ?Spec);
|
||||
@@ -0,0 +1,223 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
import type {
|
||||
RawPerformanceEntry,
|
||||
RawPerformanceEntryType,
|
||||
} from './NativePerformanceObserver';
|
||||
|
||||
import warnOnce from '../Utilities/warnOnce';
|
||||
import NativePerformanceObserver from './NativePerformanceObserver';
|
||||
|
||||
export type HighResTimeStamp = number;
|
||||
// TODO: Extend once new types (such as event) are supported.
|
||||
// TODO: Get rid of the "undefined" once there is at least one type supported.
|
||||
export type PerformanceEntryType = 'undefined';
|
||||
|
||||
export class PerformanceEntry {
|
||||
name: string;
|
||||
entryType: PerformanceEntryType;
|
||||
startTime: HighResTimeStamp;
|
||||
duration: number;
|
||||
|
||||
constructor(init: {
|
||||
name: string,
|
||||
entryType: PerformanceEntryType,
|
||||
startTime: HighResTimeStamp,
|
||||
duration: number,
|
||||
}) {
|
||||
this.name = init.name;
|
||||
this.entryType = init.entryType;
|
||||
this.startTime = init.startTime;
|
||||
this.duration = init.duration;
|
||||
}
|
||||
|
||||
// $FlowIgnore: Flow(unclear-type)
|
||||
toJSON(): Object {
|
||||
return {
|
||||
name: this.name,
|
||||
entryType: this.entryType,
|
||||
startTime: this.startTime,
|
||||
duration: this.duration,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function rawToPerformanceEntryType(
|
||||
type: RawPerformanceEntryType,
|
||||
): PerformanceEntryType {
|
||||
return 'undefined';
|
||||
}
|
||||
|
||||
function rawToPerformanceEntry(entry: RawPerformanceEntry): PerformanceEntry {
|
||||
return new PerformanceEntry({
|
||||
name: entry.name,
|
||||
entryType: rawToPerformanceEntryType(entry.entryType),
|
||||
startTime: entry.startTime,
|
||||
duration: entry.duration,
|
||||
});
|
||||
}
|
||||
|
||||
export type PerformanceEntryList = $ReadOnlyArray<PerformanceEntry>;
|
||||
|
||||
export class PerformanceObserverEntryList {
|
||||
_entries: PerformanceEntryList;
|
||||
|
||||
constructor(entries: PerformanceEntryList) {
|
||||
this._entries = entries;
|
||||
}
|
||||
|
||||
getEntries(): PerformanceEntryList {
|
||||
return this._entries;
|
||||
}
|
||||
|
||||
getEntriesByType(type: PerformanceEntryType): PerformanceEntryList {
|
||||
return this._entries.filter(entry => entry.entryType === type);
|
||||
}
|
||||
|
||||
getEntriesByName(
|
||||
name: string,
|
||||
type?: PerformanceEntryType,
|
||||
): PerformanceEntryList {
|
||||
if (type === undefined) {
|
||||
return this._entries.filter(entry => entry.name === name);
|
||||
} else {
|
||||
return this._entries.filter(
|
||||
entry => entry.name === name && entry.entryType === type,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type PerformanceObserverCallback = (
|
||||
list: PerformanceObserverEntryList,
|
||||
observer: PerformanceObserver,
|
||||
) => void;
|
||||
|
||||
export type PerformanceObserverInit =
|
||||
| {
|
||||
entryTypes: Array<PerformanceEntryType>,
|
||||
}
|
||||
| {
|
||||
type: PerformanceEntryType,
|
||||
};
|
||||
|
||||
let _observedEntryTypeRefCount: Map<PerformanceEntryType, number> = new Map();
|
||||
|
||||
let _observers: Set<PerformanceObserver> = new Set();
|
||||
|
||||
let _onPerformanceEntryCallbackIsSet: boolean = false;
|
||||
|
||||
function warnNoNativePerformanceObserver() {
|
||||
warnOnce(
|
||||
'missing-native-performance-observer',
|
||||
'Missing native implementation of PerformanceObserver',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of the PerformanceObserver interface for RN,
|
||||
* corresponding to the standard in https://www.w3.org/TR/performance-timeline/
|
||||
*
|
||||
* @example
|
||||
* const observer = new PerformanceObserver((list, _observer) => {
|
||||
* const entries = list.getEntries();
|
||||
* entries.forEach(entry => {
|
||||
* reportEvent({
|
||||
* eventName: entry.name,
|
||||
* startTime: entry.startTime,
|
||||
* endTime: entry.startTime + entry.duration,
|
||||
* processingStart: entry.processingStart,
|
||||
* processingEnd: entry.processingEnd,
|
||||
* interactionId: entry.interactionId,
|
||||
* });
|
||||
* });
|
||||
* });
|
||||
* observer.observe({ type: "event" });
|
||||
*/
|
||||
export default class PerformanceObserver {
|
||||
_callback: PerformanceObserverCallback;
|
||||
_entryTypes: $ReadOnlySet<PerformanceEntryType>;
|
||||
|
||||
constructor(callback: PerformanceObserverCallback) {
|
||||
this._callback = callback;
|
||||
}
|
||||
|
||||
observe(options: PerformanceObserverInit) {
|
||||
if (!NativePerformanceObserver) {
|
||||
warnNoNativePerformanceObserver();
|
||||
return;
|
||||
}
|
||||
if (!_onPerformanceEntryCallbackIsSet) {
|
||||
NativePerformanceObserver.setOnPerformanceEntryCallback(
|
||||
onPerformanceEntry,
|
||||
);
|
||||
_onPerformanceEntryCallbackIsSet = true;
|
||||
}
|
||||
if (options.entryTypes) {
|
||||
this._entryTypes = new Set(options.entryTypes);
|
||||
} else {
|
||||
this._entryTypes = new Set([options.type]);
|
||||
}
|
||||
this._entryTypes.forEach(type => {
|
||||
if (!_observedEntryTypeRefCount.has(type)) {
|
||||
NativePerformanceObserver.startReporting(type);
|
||||
}
|
||||
_observedEntryTypeRefCount.set(
|
||||
type,
|
||||
(_observedEntryTypeRefCount.get(type) ?? 0) + 1,
|
||||
);
|
||||
});
|
||||
_observers.add(this);
|
||||
}
|
||||
|
||||
disconnect(): void {
|
||||
if (!NativePerformanceObserver) {
|
||||
warnNoNativePerformanceObserver();
|
||||
return;
|
||||
}
|
||||
this._entryTypes.forEach(type => {
|
||||
const entryTypeRefCount = _observedEntryTypeRefCount.get(type) ?? 0;
|
||||
if (entryTypeRefCount === 1) {
|
||||
_observedEntryTypeRefCount.delete(type);
|
||||
NativePerformanceObserver.stopReporting(type);
|
||||
} else if (entryTypeRefCount !== 0) {
|
||||
_observedEntryTypeRefCount.set(type, entryTypeRefCount - 1);
|
||||
}
|
||||
});
|
||||
_observers.delete(this);
|
||||
if (_observers.size === 0) {
|
||||
NativePerformanceObserver.setOnPerformanceEntryCallback(undefined);
|
||||
_onPerformanceEntryCallbackIsSet = false;
|
||||
}
|
||||
}
|
||||
|
||||
static supportedEntryTypes: $ReadOnlyArray<PerformanceEntryType> =
|
||||
// TODO: add types once they are fully supported
|
||||
Object.freeze([]);
|
||||
}
|
||||
|
||||
// This is a callback that gets scheduled and periodically called from the native side
|
||||
function onPerformanceEntry() {
|
||||
if (!NativePerformanceObserver) {
|
||||
return;
|
||||
}
|
||||
const rawEntries = NativePerformanceObserver.getPendingEntries();
|
||||
const entries = rawEntries.map(rawToPerformanceEntry);
|
||||
_observers.forEach(observer => {
|
||||
const entriesForObserver: PerformanceEntryList = entries.filter(entry =>
|
||||
observer._entryTypes.has(entry.entryType),
|
||||
);
|
||||
observer._callback(
|
||||
new PerformanceObserverEntryList(entriesForObserver),
|
||||
observer,
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -21,10 +21,10 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^(void){
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(1000),
|
||||
RCTVersionMinor: @(0),
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(71),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
RCTVersionPrerelease: @"rc.6",
|
||||
};
|
||||
});
|
||||
return __rnVersion;
|
||||
|
||||
@@ -36,7 +36,6 @@ Class RCTCoreModulesClassProvider(const char *name) {
|
||||
{"PerfMonitor", RCTPerfMonitorCls},
|
||||
{"DevMenu", RCTDevMenuCls},
|
||||
{"DevSettings", RCTDevSettingsCls},
|
||||
{"BlobModule", RCTBlobManagerCls},
|
||||
{"RedBox", RCTRedBoxCls},
|
||||
{"LogBox", RCTLogBoxCls},
|
||||
{"WebSocketExecutor", RCTWebSocketExecutorCls},
|
||||
@@ -44,6 +43,7 @@ Class RCTCoreModulesClassProvider(const char *name) {
|
||||
{"DevLoadingView", RCTDevLoadingViewCls},
|
||||
{"DevSplitBundleLoader", RCTDevSplitBundleLoaderCls},
|
||||
{"EventDispatcher", RCTEventDispatcherCls},
|
||||
{"BlobModule", RCTBlobManagerCls},
|
||||
};
|
||||
|
||||
auto p = sCoreModuleClassMap->find(name);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "JSCExecutorFactory.h"
|
||||
|
||||
#import <jsi/JSCRuntime.h>
|
||||
#import <jsc/JSCRuntime.h>
|
||||
|
||||
#import <memory>
|
||||
|
||||
|
||||
+81
-28
@@ -92,6 +92,10 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
|
||||
"react_newarchdefaults",
|
||||
new Pair("src/main/jni/react/newarchdefaults", "")
|
||||
),
|
||||
new PrefabPreprocessingEntry(
|
||||
"react_render_animations",
|
||||
new Pair("../ReactCommon/react/renderer/animations/", "react/renderer/animations/")
|
||||
),
|
||||
new PrefabPreprocessingEntry(
|
||||
"react_render_core",
|
||||
new Pair("../ReactCommon/react/renderer/core/", "react/renderer/core/")
|
||||
@@ -117,7 +121,10 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
|
||||
),
|
||||
new PrefabPreprocessingEntry(
|
||||
"fabricjni",
|
||||
new Pair("src/main/jni/react/fabric", "")
|
||||
[
|
||||
new Pair("src/main/jni/react/fabric", "react/fabric/"),
|
||||
new Pair("src/main/jni/react/cxxcomponents", "react/cxxcomponents/")
|
||||
]
|
||||
),
|
||||
new PrefabPreprocessingEntry(
|
||||
"react_render_mapbuffer",
|
||||
@@ -144,6 +151,7 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
|
||||
new Pair(new File(buildDir, "third-party-ndk/boost/boost_1_76_0/").absolutePath, ""),
|
||||
new Pair(new File(buildDir, "third-party-ndk/double-conversion/").absolutePath, ""),
|
||||
new Pair(new File(buildDir, "third-party-ndk/folly/").absolutePath, ""),
|
||||
new Pair(new File(buildDir, "third-party-ndk/glog/exported/").absolutePath, ""),
|
||||
new Pair("../ReactCommon/butter/", "butter/"),
|
||||
new Pair("../ReactCommon/callinvoker/", ""),
|
||||
new Pair("../ReactCommon/react/bridging/", "react/bridging/"),
|
||||
@@ -152,6 +160,8 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
|
||||
new Pair("../ReactCommon/react/nativemodule/core/platform/android/", ""),
|
||||
new Pair("../ReactCommon/react/renderer/componentregistry/", "react/renderer/componentregistry/"),
|
||||
new Pair("../ReactCommon/react/renderer/components/root/", "react/renderer/components/root/"),
|
||||
new Pair("../ReactCommon/react/renderer/core/", "react/renderer/core/"),
|
||||
new Pair("../ReactCommon/react/renderer/debug/", "react/renderer/debug/"),
|
||||
new Pair("../ReactCommon/react/renderer/leakchecker/", "react/renderer/leakchecker/"),
|
||||
new Pair("../ReactCommon/react/renderer/mapbuffer/", "react/renderer/mapbuffer/"),
|
||||
new Pair("../ReactCommon/react/renderer/mounting/", "react/renderer/mounting/"),
|
||||
@@ -159,6 +169,7 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
|
||||
new Pair("../ReactCommon/react/renderer/scheduler/", "react/renderer/scheduler/"),
|
||||
new Pair("../ReactCommon/react/renderer/telemetry/", "react/renderer/telemetry/"),
|
||||
new Pair("../ReactCommon/react/renderer/uimanager/", "react/renderer/uimanager/"),
|
||||
new Pair("../ReactCommon/react/debug/", "react/debug/"),
|
||||
new Pair("../ReactCommon/react/utils/", "react/utils/"),
|
||||
new Pair("src/main/jni/react/jni", "react/jni/"),
|
||||
]
|
||||
@@ -174,6 +185,38 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
|
||||
"rrc_image",
|
||||
new Pair("../ReactCommon/react/renderer/components/image/", "react/renderer/components/image/")
|
||||
),
|
||||
// These prefab targets are used by Expo & Reanimated
|
||||
new PrefabPreprocessingEntry(
|
||||
"hermes_executor",
|
||||
// "hermes_executor" is statically linking against "hermes_executor_common"
|
||||
// and "hermes_inspector". Here we expose only the headers that we know are needed.
|
||||
new Pair("../ReactCommon/hermes/inspector/", "hermes/inspector/")
|
||||
),
|
||||
new PrefabPreprocessingEntry(
|
||||
"jscexecutor",
|
||||
// "jscexecutor" is statically linking against "jscruntime"
|
||||
// Here we expose only the headers that we know are needed.
|
||||
new Pair("../ReactCommon/jsc/", "jsc/")
|
||||
),
|
||||
new PrefabPreprocessingEntry(
|
||||
"react_render_uimanager",
|
||||
new Pair("../ReactCommon/react/renderer/uimanager/", "react/renderer/uimanager/"),
|
||||
),
|
||||
new PrefabPreprocessingEntry(
|
||||
"react_render_scheduler",
|
||||
new Pair("../ReactCommon/react/renderer/scheduler/", "react/renderer/scheduler/"),
|
||||
),
|
||||
new PrefabPreprocessingEntry(
|
||||
"react_render_mounting",
|
||||
new Pair("../ReactCommon/react/renderer/mounting/", "react/renderer/mounting/"),
|
||||
),
|
||||
new PrefabPreprocessingEntry(
|
||||
"reactnativejni",
|
||||
[
|
||||
new Pair("src/main/jni/react/jni", "react/jni/"),
|
||||
new Pair("../ReactCommon/cxxreact/", "cxxreact/"),
|
||||
]
|
||||
),
|
||||
]
|
||||
)
|
||||
it.outputDir.set(prefabHeadersDir)
|
||||
@@ -363,8 +406,8 @@ task installArchives {
|
||||
}
|
||||
|
||||
android {
|
||||
buildToolsVersion = "31.0.0"
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion = "33.0.0"
|
||||
compileSdkVersion 33
|
||||
|
||||
// Used to override the NDK path/version on internal CI or by allowing
|
||||
// users to customize the NDK path/version from their root project (e.g. for M1 support)
|
||||
@@ -377,7 +420,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion(21)
|
||||
targetSdkVersion(31)
|
||||
targetSdkVersion(33)
|
||||
versionCode(1)
|
||||
versionName("1.0")
|
||||
|
||||
@@ -402,12 +445,11 @@ android {
|
||||
"-DANDROID_TOOLCHAIN=clang",
|
||||
"-DANDROID_PLATFORM=android-21"
|
||||
|
||||
targets "reactnativejni",
|
||||
"jscexecutor",
|
||||
"jsijniprofiler",
|
||||
targets "jsijniprofiler",
|
||||
"reactnativeblob",
|
||||
"reactperfloggerjni",
|
||||
// prefab targets
|
||||
"reactnativejni",
|
||||
"react_render_debug",
|
||||
"turbomodulejsijni",
|
||||
"runtimeexecutor",
|
||||
@@ -415,6 +457,7 @@ android {
|
||||
"react_debug",
|
||||
"react_render_componentregistry",
|
||||
"react_newarchdefaults",
|
||||
"react_render_animations",
|
||||
"react_render_core",
|
||||
"react_render_graphics",
|
||||
"rrc_image",
|
||||
@@ -426,7 +469,12 @@ android {
|
||||
"yoga",
|
||||
"folly_runtime",
|
||||
"react_nativemodule_core",
|
||||
"react_render_imagemanager"
|
||||
"react_render_imagemanager",
|
||||
"react_render_uimanager",
|
||||
"react_render_scheduler",
|
||||
"react_render_mounting",
|
||||
"hermes_executor",
|
||||
"jscexecutor"
|
||||
}
|
||||
}
|
||||
ndk {
|
||||
@@ -434,24 +482,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
targets "hermes-executor-debug"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
release {
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
targets "hermes-executor-release"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path "src/main/jni/CMakeLists.txt"
|
||||
@@ -513,6 +543,9 @@ android {
|
||||
react_newarchdefaults {
|
||||
headers(new File(prefabHeadersDir, "react_newarchdefaults").absolutePath)
|
||||
}
|
||||
react_render_animations {
|
||||
headers(new File(prefabHeadersDir, "react_render_animations").absolutePath)
|
||||
}
|
||||
react_render_core {
|
||||
headers(new File(prefabHeadersDir, "react_render_core").absolutePath)
|
||||
}
|
||||
@@ -549,6 +582,24 @@ android {
|
||||
react_render_imagemanager {
|
||||
headers(new File(prefabHeadersDir, "react_render_imagemanager").absolutePath)
|
||||
}
|
||||
react_render_uimanager {
|
||||
headers(new File(prefabHeadersDir, "react_render_uimanager").absolutePath)
|
||||
}
|
||||
react_render_scheduler {
|
||||
headers(new File(prefabHeadersDir, "react_render_scheduler").absolutePath)
|
||||
}
|
||||
react_render_mounting {
|
||||
headers(new File(prefabHeadersDir, "react_render_mounting").absolutePath)
|
||||
}
|
||||
reactnativejni {
|
||||
headers(new File(prefabHeadersDir, "reactnativejni").absolutePath)
|
||||
}
|
||||
hermes_executor {
|
||||
headers(new File(prefabHeadersDir, "hermes_executor").absolutePath)
|
||||
}
|
||||
jscexecutor {
|
||||
headers(new File(prefabHeadersDir, "jscexecutor").absolutePath)
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
@@ -616,11 +667,13 @@ apply plugin: "org.jetbrains.kotlin.android"
|
||||
apply from: "./publish.gradle"
|
||||
|
||||
// We need to override the artifact ID as this project is called `ReactAndroid` but
|
||||
// the maven coordinates are on `react-native`.
|
||||
// the maven coordinates are on `react-android`.
|
||||
// Please note that the original coordinates, `react-native`, have been voided
|
||||
// as they caused https://github.com/facebook/react-native/issues/35210
|
||||
publishing {
|
||||
publications {
|
||||
getByName("release") {
|
||||
artifactId 'react-native'
|
||||
artifactId 'react-android'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ if(EXISTS ${PROJECT_BUILD_DIR}/generated/rncli/src/main/jni/Android-rncli.cmake)
|
||||
include(${PROJECT_BUILD_DIR}/generated/rncli/src/main/jni/Android-rncli.cmake)
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME} ${AUTOLINKED_LIBRARIES})
|
||||
foreach(autolinked_library ${AUTOLINKED_LIBRARIES})
|
||||
target_link_libraries(autolinked_library common_flags)
|
||||
target_link_libraries(${autolinked_library} common_flags)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -48,7 +48,14 @@ void registerComponents(
|
||||
rncli_registerProviders(registry);
|
||||
}
|
||||
|
||||
std::shared_ptr<TurboModule> provideModules(
|
||||
std::shared_ptr<TurboModule> cxxModuleProvider(
|
||||
const std::string &name,
|
||||
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
||||
// Not implemented yet: provide pure-C++ NativeModules here.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<TurboModule> javaModuleProvider(
|
||||
const std::string &name,
|
||||
const JavaTurboModule::InitParams ¶ms) {
|
||||
// Here you can provide your own module provider for TurboModules coming from
|
||||
@@ -70,8 +77,10 @@ std::shared_ptr<TurboModule> provideModules(
|
||||
|
||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
|
||||
return facebook::jni::initialize(vm, [] {
|
||||
facebook::react::DefaultTurboModuleManagerDelegate::
|
||||
moduleProvidersFromEntryPoint = &facebook::react::provideModules;
|
||||
facebook::react::DefaultTurboModuleManagerDelegate::cxxModuleProvider =
|
||||
&facebook::react::cxxModuleProvider;
|
||||
facebook::react::DefaultTurboModuleManagerDelegate::javaModuleProvider =
|
||||
&facebook::react::javaModuleProvider;
|
||||
facebook::react::DefaultComponentsRegistry::
|
||||
registerComponentDescriptorsFromEntryPoint =
|
||||
&facebook::react::registerComponents;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1000.0.0
|
||||
VERSION_NAME=0.71.0-rc.6
|
||||
GROUP=com.facebook.react
|
||||
|
||||
# JVM Versions
|
||||
|
||||
@@ -234,4 +234,17 @@ afterEvaluate {
|
||||
prepareHeadersForPrefab.dependsOn(buildHermes)
|
||||
}
|
||||
|
||||
/* Publishing Configuration */
|
||||
apply from: "../publish.gradle"
|
||||
|
||||
// We need to override the artifact ID as this project is called `hermes-engine` but
|
||||
// the maven coordinates are on `hermes-android`.
|
||||
// Please note that the original coordinates, `hermes-engine`, have been voided
|
||||
// as they caused https://github.com/facebook/react-native/issues/35210
|
||||
publishing {
|
||||
publications {
|
||||
getByName("release") {
|
||||
artifactId 'hermes-android'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ rn_android_library(
|
||||
react_native_target("java/com/facebook/hermes/instrumentation:instrumentation"),
|
||||
react_native_target("java/com/facebook/hermes/instrumentation:hermes_samplingprofiler"),
|
||||
react_native_target("java/com/facebook/react/bridge:bridge"),
|
||||
react_native_target("java/com/facebook/react/common:common"),
|
||||
react_native_target("jni/react/hermes/reactexecutor:jni"),
|
||||
":runtimeconfig",
|
||||
],
|
||||
|
||||
@@ -9,6 +9,7 @@ package com.facebook.hermes.reactexecutor;
|
||||
|
||||
import com.facebook.jni.HybridData;
|
||||
import com.facebook.react.bridge.JavaScriptExecutor;
|
||||
import com.facebook.react.common.build.ReactBuildConfig;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -23,11 +24,11 @@ public class HermesExecutor extends JavaScriptExecutor {
|
||||
if (mode_ == null) {
|
||||
// libhermes must be loaded explicitly to invoke its JNI_OnLoad.
|
||||
SoLoader.loadLibrary("hermes");
|
||||
try {
|
||||
SoLoader.loadLibrary("hermes-executor-debug");
|
||||
SoLoader.loadLibrary("hermes_executor");
|
||||
// libhermes_executor is built differently for Debug & Release so we load the proper mode.
|
||||
if (ReactBuildConfig.DEBUG == true) {
|
||||
mode_ = "Debug";
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
SoLoader.loadLibrary("hermes-executor-release");
|
||||
} else {
|
||||
mode_ = "Release";
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -15,8 +15,8 @@ import java.util.Map;
|
||||
|
||||
public class ReactNativeVersion {
|
||||
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
|
||||
"major", 1000,
|
||||
"minor", 0,
|
||||
"major", 0,
|
||||
"minor", 71,
|
||||
"patch", 0,
|
||||
"prerelease", null);
|
||||
"prerelease", "rc.6");
|
||||
}
|
||||
|
||||
@@ -120,7 +120,9 @@ public class ReactModalHostView extends ViewGroup
|
||||
|
||||
@Override
|
||||
public int getChildCount() {
|
||||
return mHostView.getChildCount();
|
||||
// This method may be called by the parent constructor
|
||||
// before mHostView is initialized.
|
||||
return mHostView == null ? 0 : mHostView.getChildCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -56,6 +56,7 @@ add_react_common_subdir(reactperflogger)
|
||||
add_react_common_subdir(logger)
|
||||
add_react_common_subdir(jsiexecutor)
|
||||
add_react_common_subdir(cxxreact)
|
||||
add_react_common_subdir(jsc)
|
||||
add_react_common_subdir(jsi)
|
||||
add_react_common_subdir(butter)
|
||||
add_react_common_subdir(callinvoker)
|
||||
|
||||
@@ -14,6 +14,6 @@ rn_xplat_cxx_library(
|
||||
headers = [],
|
||||
header_namespace = "",
|
||||
compiler_flags = ["-fexceptions"],
|
||||
soname = "libhermes-executor.$(ext)",
|
||||
soname = "libhermes_executor.$(ext)",
|
||||
visibility = ["PUBLIC"],
|
||||
)
|
||||
|
||||
@@ -8,29 +8,20 @@ set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
file(GLOB_RECURSE hermes_executor_SRC CONFIGURE_DEPENDS *.cpp)
|
||||
|
||||
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
|
||||
set(HERMES_TARGET_SUFFIX debug)
|
||||
else()
|
||||
set(HERMES_TARGET_SUFFIX release)
|
||||
endif()
|
||||
|
||||
set(HERMES_TARGET_NAME hermes-executor-${HERMES_TARGET_SUFFIX})
|
||||
|
||||
add_library(
|
||||
${HERMES_TARGET_NAME}
|
||||
add_library(hermes_executor
|
||||
SHARED
|
||||
${hermes_executor_SRC}
|
||||
)
|
||||
target_compile_options(
|
||||
${HERMES_TARGET_NAME}
|
||||
hermes_executor
|
||||
PRIVATE
|
||||
$<$<CONFIG:Debug>:-DHERMES_ENABLE_DEBUGGER=1>
|
||||
-fexceptions
|
||||
)
|
||||
target_include_directories(${HERMES_TARGET_NAME} PRIVATE .)
|
||||
target_include_directories(hermes_executor PRIVATE .)
|
||||
target_link_libraries(
|
||||
${HERMES_TARGET_NAME}
|
||||
hermes-executor-common
|
||||
hermes_executor
|
||||
hermes_executor_common
|
||||
jsireact
|
||||
fb
|
||||
fbjni
|
||||
|
||||
@@ -16,7 +16,7 @@ rn_xplat_cxx_library(
|
||||
deps = [
|
||||
FBJNI_TARGET,
|
||||
react_native_target("jni/react/jni:jni"),
|
||||
react_native_xplat_target("jsi:JSCRuntime"),
|
||||
react_native_xplat_target("jsc:JSCRuntime"),
|
||||
react_native_xplat_target("jsiexecutor:jsiexecutor"),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <fbjni/fbjni.h>
|
||||
#include <jsi/JSCRuntime.h>
|
||||
#include <jsc/JSCRuntime.h>
|
||||
#include <jsireact/JSIExecutor.h>
|
||||
#include <react/jni/JReactMarker.h>
|
||||
#include <react/jni/JSLogging.h>
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ComponentFactory.h>
|
||||
#include <fbjni/fbjni.h>
|
||||
#include <react/fabric/ComponentFactory.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
|
||||
+15
-6
@@ -12,10 +12,15 @@
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
std::function<std::shared_ptr<TurboModule>(
|
||||
const std::string &,
|
||||
const std::shared_ptr<CallInvoker> &)>
|
||||
DefaultTurboModuleManagerDelegate::cxxModuleProvider{nullptr};
|
||||
|
||||
std::function<std::shared_ptr<TurboModule>(
|
||||
const std::string &,
|
||||
const JavaTurboModule::InitParams &)>
|
||||
DefaultTurboModuleManagerDelegate::moduleProvidersFromEntryPoint{nullptr};
|
||||
DefaultTurboModuleManagerDelegate::javaModuleProvider{nullptr};
|
||||
|
||||
jni::local_ref<DefaultTurboModuleManagerDelegate::jhybriddata>
|
||||
DefaultTurboModuleManagerDelegate::initHybrid(jni::alias_ref<jhybridobject>) {
|
||||
@@ -32,17 +37,21 @@ void DefaultTurboModuleManagerDelegate::registerNatives() {
|
||||
std::shared_ptr<TurboModule> DefaultTurboModuleManagerDelegate::getTurboModule(
|
||||
const std::string &name,
|
||||
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
||||
// Not implemented yet: provide pure-C++ NativeModules here.
|
||||
auto moduleProvider = DefaultTurboModuleManagerDelegate::cxxModuleProvider;
|
||||
if (moduleProvider) {
|
||||
return moduleProvider(name, jsInvoker);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<TurboModule> DefaultTurboModuleManagerDelegate::getTurboModule(
|
||||
const std::string &name,
|
||||
const JavaTurboModule::InitParams ¶ms) {
|
||||
auto resolvedModule = (DefaultTurboModuleManagerDelegate::
|
||||
moduleProvidersFromEntryPoint)(name, params);
|
||||
if (resolvedModule != nullptr) {
|
||||
return resolvedModule;
|
||||
auto moduleProvider = DefaultTurboModuleManagerDelegate::javaModuleProvider;
|
||||
if (moduleProvider) {
|
||||
if (auto resolvedModule = moduleProvider(name, params)) {
|
||||
return resolvedModule;
|
||||
}
|
||||
}
|
||||
return rncore_ModuleProvider(name, params);
|
||||
}
|
||||
|
||||
@@ -27,10 +27,15 @@ class DefaultTurboModuleManagerDelegate : public jni::HybridClass<
|
||||
|
||||
static void registerNatives();
|
||||
|
||||
static std::function<std::shared_ptr<TurboModule>(
|
||||
const std::string &,
|
||||
const std::shared_ptr<CallInvoker> &)>
|
||||
cxxModuleProvider;
|
||||
|
||||
static std::function<std::shared_ptr<TurboModule>(
|
||||
const std::string &,
|
||||
const JavaTurboModule::InitParams &)>
|
||||
moduleProvidersFromEntryPoint;
|
||||
javaModuleProvider;
|
||||
|
||||
std::shared_ptr<TurboModule> getTurboModule(
|
||||
const std::string &name,
|
||||
|
||||
@@ -78,7 +78,6 @@ Pod::Spec.new do |s|
|
||||
|
||||
s.subspec "core" do |ss|
|
||||
ss.dependency folly_dep_name, folly_version
|
||||
ss.dependency "React-jsidynamic", version
|
||||
ss.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
|
||||
ss.source_files = "react/renderer/core/**/*.{m,mm,cpp,h}"
|
||||
ss.exclude_files = "react/renderer/core/tests"
|
||||
@@ -303,7 +302,6 @@ Pod::Spec.new do |s|
|
||||
|
||||
s.subspec "uimanager" do |ss|
|
||||
ss.dependency folly_dep_name, folly_version
|
||||
ss.dependency "React-jsidynamic", version
|
||||
ss.compiler_flags = folly_compiler_flags
|
||||
ss.source_files = "react/renderer/uimanager/**/*.{m,mm,cpp,h}"
|
||||
ss.exclude_files = "react/renderer/uimanager/tests"
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
require "json"
|
||||
|
||||
package = JSON.parse(File.read(File.join(__dir__, "..", "package.json")))
|
||||
version = package['version']
|
||||
|
||||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||||
if version == '1000.0.0'
|
||||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||||
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
||||
else
|
||||
source[:tag] = "v#{version}"
|
||||
end
|
||||
|
||||
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-gnu-zero-variadic-macro-arguments'
|
||||
folly_version = '2021.07.22.00'
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "React-bridging"
|
||||
s.version = version
|
||||
s.summary = "-" # TODO
|
||||
s.homepage = "https://reactnative.dev/"
|
||||
s.license = package["license"]
|
||||
s.author = "Facebook, Inc. and its affiliates"
|
||||
s.platforms = { :ios => "12.4" }
|
||||
s.source = source
|
||||
s.source_files = "react/bridging/**/*.{cpp,h}"
|
||||
s.exclude_files = "react/bridging/tests"
|
||||
s.header_dir = "react/bridging"
|
||||
s.header_mappings_dir = "."
|
||||
s.compiler_flags = folly_compiler_flags
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\"",
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
||||
"GCC_WARN_PEDANTIC" => "YES" }
|
||||
|
||||
s.dependency "RCT-Folly", folly_version
|
||||
s.dependency "React-jsi", version
|
||||
end
|
||||
@@ -32,7 +32,7 @@ Pod::Spec.new do |s|
|
||||
s.source = source
|
||||
s.header_dir = "ReactCommon" # Use global header_dir for all subspecs for use_frameworks! compatibility
|
||||
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers\"",
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
||||
"GCC_WARN_PEDANTIC" => "YES" }
|
||||
@@ -40,7 +40,6 @@ Pod::Spec.new do |s|
|
||||
# TODO (T48588859): Restructure this target to align with dir structure: "react/nativemodule/..."
|
||||
# Note: Update this only when ready to minimize breaking changes.
|
||||
s.subspec "turbomodule" do |ss|
|
||||
ss.dependency "React-bridging", version
|
||||
ss.dependency "React-callinvoker", version
|
||||
ss.dependency "React-perflogger", version
|
||||
ss.dependency "React-Core", version
|
||||
@@ -51,10 +50,21 @@ Pod::Spec.new do |s|
|
||||
ss.dependency "DoubleConversion"
|
||||
ss.dependency "glog"
|
||||
|
||||
ss.subspec "bridging" do |sss|
|
||||
sss.dependency "React-jsi", version
|
||||
sss.source_files = "react/bridging/**/*.{cpp,h}"
|
||||
sss.exclude_files = "react/bridging/tests"
|
||||
sss.header_dir = "react/bridging"
|
||||
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
|
||||
end
|
||||
|
||||
ss.subspec "core" do |sss|
|
||||
sss.source_files = "react/nativemodule/core/ReactCommon/**/*.{cpp,h}",
|
||||
"react/nativemodule/core/platform/ios/**/*.{mm,cpp,h}"
|
||||
sss.dependency "React-jsidynamic", version
|
||||
excluded_files = ENV['USE_FRAMEWORKS'] == nil ?
|
||||
"react/nativemodule/core/ReactCommon/LongLivedObject.h" :
|
||||
"react/nativemodule/core/ReactCommon/{LongLivedObject,CallbackWrapper}.h"
|
||||
sss.exclude_files = excluded_files
|
||||
end
|
||||
|
||||
s.subspec "react_debug_core" do |sss|
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
namespace facebook::react {
|
||||
|
||||
constexpr struct {
|
||||
int32_t Major = 1000;
|
||||
int32_t Minor = 0;
|
||||
int32_t Major = 0;
|
||||
int32_t Minor = 71;
|
||||
int32_t Patch = 0;
|
||||
std::string_view Prerelease = "";
|
||||
std::string_view Prerelease = "rc.6";
|
||||
} ReactNativeVersion;
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
@@ -44,7 +44,6 @@ Pod::Spec.new do |s|
|
||||
}.merge!(build_type == :debug ? { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } : {})
|
||||
s.header_dir = "reacthermes"
|
||||
s.dependency "React-cxxreact", version
|
||||
s.dependency "React-jsidynamic", version
|
||||
s.dependency "React-jsiexecutor", version
|
||||
s.dependency "React-jsinspector", version
|
||||
s.dependency "React-perflogger", version
|
||||
|
||||
@@ -8,21 +8,22 @@ set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
file(GLOB_RECURSE hermes_executor_SRC CONFIGURE_DEPENDS *.cpp)
|
||||
add_library(
|
||||
hermes-executor-common
|
||||
hermes_executor_common
|
||||
STATIC
|
||||
${hermes_executor_SRC}
|
||||
)
|
||||
target_include_directories(hermes-executor-common PUBLIC .)
|
||||
target_link_libraries(hermes-executor-common
|
||||
target_include_directories(hermes_executor_common PUBLIC .)
|
||||
target_link_libraries(hermes_executor_common
|
||||
jsireact
|
||||
hermes-engine::libhermes
|
||||
jsi
|
||||
debug hermes-inspector
|
||||
debug
|
||||
hermes_inspector
|
||||
)
|
||||
|
||||
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
|
||||
target_compile_options(
|
||||
hermes-executor-common
|
||||
hermes_executor_common
|
||||
PRIVATE
|
||||
-DHERMES_ENABLE_DEBUGGER=1
|
||||
)
|
||||
|
||||
@@ -8,20 +8,20 @@ set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
file(GLOB hermesinspector_SRC CONFIGURE_DEPENDS *.cpp detail/*.cpp chrome/*.cpp)
|
||||
|
||||
add_library(hermes-inspector
|
||||
add_library(hermes_inspector
|
||||
STATIC
|
||||
${hermesinspector_SRC})
|
||||
|
||||
target_compile_options(
|
||||
hermes-inspector
|
||||
hermes_inspector
|
||||
PRIVATE
|
||||
-DHERMES_ENABLE_DEBUGGER=1
|
||||
-DHERMES_INSPECTOR_FOLLY_KLUDGE=1
|
||||
-fexceptions
|
||||
)
|
||||
|
||||
target_include_directories(hermes-inspector PUBLIC ${REACT_COMMON_DIR})
|
||||
target_link_libraries(hermes-inspector
|
||||
target_include_directories(hermes_inspector PUBLIC ${REACT_COMMON_DIR})
|
||||
target_link_libraries(hermes_inspector
|
||||
jsinspector
|
||||
fb
|
||||
fbjni
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
Checks: '>
|
||||
clang-diagnostic-*,
|
||||
'
|
||||
InheritParentConfig: true
|
||||
...
|
||||
@@ -0,0 +1,34 @@
|
||||
load("//tools/build_defs/oss:rn_defs.bzl", "APPLE", "IOS", "MACOSX", "get_apple_compiler_flags", "get_apple_inspector_flags", "get_preprocessor_flags_for_build_mode", "react_native_xplat_dep", "rn_xplat_cxx_library")
|
||||
|
||||
APPLE_COMPILER_FLAGS = get_apple_compiler_flags()
|
||||
|
||||
rn_xplat_cxx_library(
|
||||
name = "JSCRuntime",
|
||||
srcs = [
|
||||
"JSCRuntime.cpp",
|
||||
],
|
||||
header_namespace = "jsc",
|
||||
exported_headers = [
|
||||
"JSCRuntime.h",
|
||||
],
|
||||
apple_sdks = (IOS, MACOSX),
|
||||
compiler_flags_pedantic = True,
|
||||
fbobjc_compiler_flags = APPLE_COMPILER_FLAGS + [
|
||||
"-Os",
|
||||
],
|
||||
fbobjc_frameworks = [
|
||||
"$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework",
|
||||
],
|
||||
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
|
||||
labels = [
|
||||
"pfh:ReactNative_CommonInfrastructurePlaceholder",
|
||||
],
|
||||
platforms = APPLE,
|
||||
visibility = ["PUBLIC"],
|
||||
xplat_mangled_args = {
|
||||
"soname": "libjscjsi.$(ext)",
|
||||
},
|
||||
exported_deps = [
|
||||
react_native_xplat_dep("jsi:jsi"),
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,35 @@
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
##################
|
||||
### jscruntime ###
|
||||
##################
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
|
||||
add_compile_options(
|
||||
-fexceptions
|
||||
-frtti
|
||||
-O3
|
||||
-Wno-unused-lambda-capture
|
||||
-DLOG_TAG=\"ReactNative\")
|
||||
|
||||
add_library(jscruntime
|
||||
STATIC
|
||||
JSCRuntime.h
|
||||
JSCRuntime.cpp)
|
||||
|
||||
target_include_directories(jscruntime PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(jscruntime
|
||||
folly_runtime
|
||||
jsc
|
||||
jsi
|
||||
glog)
|
||||
|
||||
# TODO: Remove this flag when ready.
|
||||
# Android has this enabled by default, but the flag is still needed for iOS.
|
||||
target_compile_options(jscruntime PRIVATE -DRN_FABRIC_ENABLED)
|
||||
@@ -28,12 +28,8 @@ Pod::Spec.new do |s|
|
||||
s.source_files = "JSCRuntime.{cpp,h}"
|
||||
s.exclude_files = "**/test/*"
|
||||
s.framework = "JavaScriptCore"
|
||||
s.dependency "React-jsi", version
|
||||
s.default_subspec = "Default"
|
||||
|
||||
s.subspec "Default" do
|
||||
# no-op
|
||||
end
|
||||
s.dependency "React-jsi", version
|
||||
|
||||
s.subspec "Fabric" do |ss|
|
||||
ss.pod_target_xcconfig = { "OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" }
|
||||
+1
-31
@@ -1,4 +1,4 @@
|
||||
load("//tools/build_defs/oss:rn_defs.bzl", "APPLE", "IOS", "MACOSX", "react_native_xplat_dep", "rn_xplat_cxx_library")
|
||||
load("//tools/build_defs/oss:rn_defs.bzl", "react_native_xplat_dep", "rn_xplat_cxx_library")
|
||||
|
||||
rn_xplat_cxx_library(
|
||||
name = "jsi",
|
||||
@@ -56,33 +56,3 @@ rn_xplat_cxx_library(
|
||||
react_native_xplat_dep("jsi:jsi"),
|
||||
],
|
||||
)
|
||||
|
||||
rn_xplat_cxx_library(
|
||||
name = "JSCRuntime",
|
||||
srcs = [
|
||||
"JSCRuntime.cpp",
|
||||
],
|
||||
header_namespace = "jsi",
|
||||
exported_headers = [
|
||||
"JSCRuntime.h",
|
||||
],
|
||||
apple_sdks = (IOS, MACOSX),
|
||||
compiler_flags_pedantic = True,
|
||||
fbobjc_compiler_flags = [
|
||||
"-Os",
|
||||
],
|
||||
fbobjc_frameworks = [
|
||||
"$SDKROOT/System/Library/Frameworks/JavaScriptCore.framework",
|
||||
],
|
||||
labels = [
|
||||
"pfh:ReactNative_CommonInfrastructurePlaceholder",
|
||||
],
|
||||
platforms = APPLE,
|
||||
visibility = ["PUBLIC"],
|
||||
xplat_mangled_args = {
|
||||
"soname": "libjscjsi.$(ext)",
|
||||
},
|
||||
exported_deps = [
|
||||
react_native_xplat_dep("jsi:jsi"),
|
||||
],
|
||||
)
|
||||
|
||||
@@ -25,19 +25,3 @@ target_include_directories(jsi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(jsi
|
||||
folly_runtime
|
||||
glog)
|
||||
|
||||
##################
|
||||
### jscruntime ###
|
||||
##################
|
||||
|
||||
add_library(jscruntime STATIC
|
||||
JSCRuntime.h
|
||||
JSCRuntime.cpp)
|
||||
|
||||
target_include_directories(jscruntime PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(jscruntime folly_runtime jsc glog)
|
||||
|
||||
# TODO: Remove this flag when ready.
|
||||
# Android has this enabled by default, but the flag is still needed for iOS.
|
||||
target_compile_options(jscruntime PRIVATE -DRN_FABRIC_ENABLED)
|
||||
|
||||
@@ -20,6 +20,10 @@ else
|
||||
source[:tag] = "v#{version}"
|
||||
end
|
||||
|
||||
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
||||
folly_version = '2021.07.22.00'
|
||||
boost_compiler_flags = '-Wno-documentation'
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "React-jsi"
|
||||
s.version = version
|
||||
@@ -30,18 +34,27 @@ Pod::Spec.new do |s|
|
||||
s.platforms = { :ios => "12.4" }
|
||||
s.source = source
|
||||
|
||||
s.header_dir = "jsi"
|
||||
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\"" }
|
||||
|
||||
s.dependency "boost", "1.76.0"
|
||||
s.dependency "DoubleConversion"
|
||||
s.dependency "RCT-Folly", folly_version
|
||||
s.dependency "glog"
|
||||
|
||||
if js_engine == :jsc
|
||||
s.source_files = "**/*.{cpp,h}"
|
||||
s.exclude_files = [
|
||||
"jsi/JSIDynamic.{h,cpp}",
|
||||
"jsi/jsilib-posix.cpp",
|
||||
"jsi/jsilib-windows.cpp",
|
||||
"**/test/*"
|
||||
]
|
||||
s.header_dir = "jsi"
|
||||
|
||||
elsif js_engine == :hermes
|
||||
# JSI is provided by hermes-engine when Hermes is enabled
|
||||
s.source_files = ""
|
||||
# Just need to provide JSIDynamic in this case.
|
||||
s.source_files = "jsi/JSIDynamic.{cpp,h}"
|
||||
s.dependency "hermes-engine"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
require "json"
|
||||
|
||||
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json")))
|
||||
version = package['version']
|
||||
|
||||
source = { :git => 'https://github.com/facebook/react-native.git' }
|
||||
if version == '1000.0.0'
|
||||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
||||
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
||||
else
|
||||
source[:tag] = "v#{version}"
|
||||
end
|
||||
|
||||
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
||||
folly_version = '2021.07.22.00'
|
||||
boost_compiler_flags = '-Wno-documentation'
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "React-jsidynamic"
|
||||
s.version = version
|
||||
s.summary = "Provides support for converting between folly::dynamic and jsi::value"
|
||||
s.homepage = "https://reactnative.dev/"
|
||||
s.license = package["license"]
|
||||
s.author = "Facebook, Inc. and its affiliates"
|
||||
s.platforms = { :ios => "12.4" }
|
||||
s.source = source
|
||||
s.source_files = "jsi/JSIDynamic.{cpp,h}"
|
||||
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\"" }
|
||||
s.header_dir = 'jsi'
|
||||
|
||||
s.dependency "boost", "1.76.0"
|
||||
s.dependency "DoubleConversion"
|
||||
s.dependency "RCT-Folly", folly_version
|
||||
s.dependency "glog"
|
||||
s.dependency "React-jsi", version
|
||||
end
|
||||
@@ -36,7 +36,6 @@ Pod::Spec.new do |s|
|
||||
|
||||
s.dependency "React-cxxreact", version
|
||||
s.dependency "React-jsi", version
|
||||
s.dependency "React-jsidynamic", version
|
||||
s.dependency "React-perflogger", version
|
||||
s.dependency "RCT-Folly", folly_version
|
||||
s.dependency "DoubleConversion"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <jsi/jsi.h>
|
||||
#include <react/bridging/LongLivedObject.h>
|
||||
#include "LongLivedObject.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// This header is left here for compatibility reasons.
|
||||
#include <react/bridging/CallbackWrapper.h>
|
||||
@@ -13,8 +13,7 @@
|
||||
#include <jsi/jsi.h>
|
||||
|
||||
#include <ReactCommon/CallInvoker.h>
|
||||
#include <react/bridging/CallbackWrapper.h>
|
||||
#include <react/bridging/LongLivedObject.h>
|
||||
#include <ReactCommon/CallbackWrapper.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
@@ -46,6 +46,9 @@ void TextAttributes::apply(TextAttributes textAttributes) {
|
||||
allowFontScaling = textAttributes.allowFontScaling.has_value()
|
||||
? textAttributes.allowFontScaling
|
||||
: allowFontScaling;
|
||||
dynamicTypeRamp = textAttributes.dynamicTypeRamp.has_value()
|
||||
? textAttributes.dynamicTypeRamp
|
||||
: dynamicTypeRamp;
|
||||
letterSpacing = !std::isnan(textAttributes.letterSpacing)
|
||||
? textAttributes.letterSpacing
|
||||
: letterSpacing;
|
||||
@@ -111,6 +114,7 @@ bool TextAttributes::operator==(const TextAttributes &rhs) const {
|
||||
fontStyle,
|
||||
fontVariant,
|
||||
allowFontScaling,
|
||||
dynamicTypeRamp,
|
||||
alignment,
|
||||
baseWritingDirection,
|
||||
lineBreakStrategy,
|
||||
@@ -131,6 +135,7 @@ bool TextAttributes::operator==(const TextAttributes &rhs) const {
|
||||
rhs.fontStyle,
|
||||
rhs.fontVariant,
|
||||
rhs.allowFontScaling,
|
||||
rhs.dynamicTypeRamp,
|
||||
rhs.alignment,
|
||||
rhs.baseWritingDirection,
|
||||
rhs.lineBreakStrategy,
|
||||
@@ -186,6 +191,7 @@ SharedDebugStringConvertibleList TextAttributes::getDebugProps() const {
|
||||
debugStringConvertibleItem("fontStyle", fontStyle),
|
||||
debugStringConvertibleItem("fontVariant", fontVariant),
|
||||
debugStringConvertibleItem("allowFontScaling", allowFontScaling),
|
||||
debugStringConvertibleItem("dynamicTypeRamp", dynamicTypeRamp),
|
||||
debugStringConvertibleItem("letterSpacing", letterSpacing),
|
||||
|
||||
// Paragraph Styles
|
||||
|
||||
@@ -50,6 +50,7 @@ class TextAttributes : public DebugStringConvertible {
|
||||
std::optional<FontStyle> fontStyle{};
|
||||
std::optional<FontVariant> fontVariant{};
|
||||
std::optional<bool> allowFontScaling{};
|
||||
std::optional<DynamicTypeRamp> dynamicTypeRamp{};
|
||||
Float letterSpacing{std::numeric_limits<Float>::quiet_NaN()};
|
||||
std::optional<TextTransform> textTransform{};
|
||||
|
||||
|
||||
@@ -34,6 +34,84 @@
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
inline std::string toString(const DynamicTypeRamp &dynamicTypeRamp) {
|
||||
switch (dynamicTypeRamp) {
|
||||
case DynamicTypeRamp::Caption2:
|
||||
return "caption2";
|
||||
case DynamicTypeRamp::Caption1:
|
||||
return "caption1";
|
||||
case DynamicTypeRamp::Footnote:
|
||||
return "footnote";
|
||||
case DynamicTypeRamp::Subheadline:
|
||||
return "subheadline";
|
||||
case DynamicTypeRamp::Callout:
|
||||
return "callout";
|
||||
case DynamicTypeRamp::Body:
|
||||
return "body";
|
||||
case DynamicTypeRamp::Headline:
|
||||
return "headline";
|
||||
case DynamicTypeRamp::Title3:
|
||||
return "title3";
|
||||
case DynamicTypeRamp::Title2:
|
||||
return "title2";
|
||||
case DynamicTypeRamp::Title1:
|
||||
return "title1";
|
||||
case DynamicTypeRamp::LargeTitle:
|
||||
return "largeTitle";
|
||||
}
|
||||
|
||||
LOG(ERROR) << "Unsupported DynamicTypeRamp value";
|
||||
react_native_assert(false);
|
||||
|
||||
// Sane default in case of parsing errors
|
||||
return "body";
|
||||
}
|
||||
|
||||
inline void fromRawValue(
|
||||
const PropsParserContext &context,
|
||||
const RawValue &value,
|
||||
DynamicTypeRamp &result) {
|
||||
react_native_assert(value.hasType<std::string>());
|
||||
if (value.hasType<std::string>()) {
|
||||
auto string = (std::string)value;
|
||||
if (string == "caption2") {
|
||||
result = DynamicTypeRamp::Caption2;
|
||||
} else if (string == "caption1") {
|
||||
result = DynamicTypeRamp::Caption1;
|
||||
} else if (string == "footnote") {
|
||||
result = DynamicTypeRamp::Footnote;
|
||||
} else if (string == "subheadline") {
|
||||
result = DynamicTypeRamp::Subheadline;
|
||||
} else if (string == "callout") {
|
||||
result = DynamicTypeRamp::Callout;
|
||||
} else if (string == "body") {
|
||||
result = DynamicTypeRamp::Body;
|
||||
} else if (string == "headline") {
|
||||
result = DynamicTypeRamp::Headline;
|
||||
} else if (string == "title3") {
|
||||
result = DynamicTypeRamp::Title3;
|
||||
} else if (string == "title2") {
|
||||
result = DynamicTypeRamp::Title2;
|
||||
} else if (string == "title1") {
|
||||
result = DynamicTypeRamp::Title1;
|
||||
} else if (string == "largeTitle") {
|
||||
result = DynamicTypeRamp::LargeTitle;
|
||||
} else {
|
||||
// sane default
|
||||
LOG(ERROR) << "Unsupported DynamicTypeRamp value: " << string;
|
||||
react_native_assert(false);
|
||||
result = DynamicTypeRamp::Body;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
LOG(ERROR) << "Unsupported DynamicTypeRamp type";
|
||||
react_native_assert(false);
|
||||
|
||||
// Sane default in case of parsing errors
|
||||
result = DynamicTypeRamp::Body;
|
||||
}
|
||||
|
||||
inline std::string toString(const EllipsizeMode &ellipsisMode) {
|
||||
switch (ellipsisMode) {
|
||||
case EllipsizeMode::Clip:
|
||||
|
||||
@@ -46,6 +46,20 @@ enum class FontVariant : int {
|
||||
ProportionalNums = 1 << 5
|
||||
};
|
||||
|
||||
enum class DynamicTypeRamp {
|
||||
Caption2,
|
||||
Caption1,
|
||||
Footnote,
|
||||
Subheadline,
|
||||
Callout,
|
||||
Body,
|
||||
Headline,
|
||||
Title3,
|
||||
Title2,
|
||||
Title1,
|
||||
LargeTitle
|
||||
};
|
||||
|
||||
enum class EllipsizeMode {
|
||||
Clip, // Do not add ellipsize, simply clip.
|
||||
Head, // Truncate at head of line: "...wxyz".
|
||||
@@ -190,6 +204,13 @@ struct hash<facebook::react::FontWeight> {
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct hash<facebook::react::DynamicTypeRamp> {
|
||||
size_t operator()(const facebook::react::DynamicTypeRamp &v) const {
|
||||
return hash<int>()(static_cast<int>(v));
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct hash<facebook::react::EllipsizeMode> {
|
||||
size_t operator()(const facebook::react::EllipsizeMode &v) const {
|
||||
|
||||
@@ -73,6 +73,12 @@ static TextAttributes convertRawProp(
|
||||
"allowFontScaling",
|
||||
sourceTextAttributes.allowFontScaling,
|
||||
defaultTextAttributes.allowFontScaling);
|
||||
textAttributes.dynamicTypeRamp = convertRawProp(
|
||||
context,
|
||||
rawProps,
|
||||
"dynamicTypeRamp",
|
||||
sourceTextAttributes.dynamicTypeRamp,
|
||||
defaultTextAttributes.dynamicTypeRamp);
|
||||
textAttributes.letterSpacing = convertRawProp(
|
||||
context,
|
||||
rawProps,
|
||||
|
||||
@@ -94,6 +94,7 @@ inline bool areTextAttributesEquivalentLayoutWise(
|
||||
lhs.fontStyle,
|
||||
lhs.fontVariant,
|
||||
lhs.allowFontScaling,
|
||||
lhs.dynamicTypeRamp,
|
||||
lhs.alignment) ==
|
||||
std::tie(
|
||||
rhs.fontFamily,
|
||||
@@ -101,6 +102,7 @@ inline bool areTextAttributesEquivalentLayoutWise(
|
||||
rhs.fontStyle,
|
||||
rhs.fontVariant,
|
||||
rhs.allowFontScaling,
|
||||
rhs.dynamicTypeRamp,
|
||||
rhs.alignment) &&
|
||||
floatEquality(lhs.fontSize, rhs.fontSize) &&
|
||||
floatEquality(lhs.fontSizeMultiplier, rhs.fontSizeMultiplier) &&
|
||||
@@ -121,6 +123,7 @@ inline size_t textAttributesHashLayoutWise(
|
||||
textAttributes.fontStyle,
|
||||
textAttributes.fontVariant,
|
||||
textAttributes.allowFontScaling,
|
||||
textAttributes.dynamicTypeRamp,
|
||||
textAttributes.letterSpacing,
|
||||
textAttributes.lineHeight,
|
||||
textAttributes.alignment);
|
||||
|
||||
+78
-9
@@ -55,6 +55,83 @@ inline static UIFontWeight RCTUIFontWeightFromInteger(NSInteger fontWeight)
|
||||
return weights[(fontWeight + 50) / 100 - 1];
|
||||
}
|
||||
|
||||
inline static UIFontTextStyle RCTUIFontTextStyleForDynamicTypeRamp(const DynamicTypeRamp &dynamicTypeRamp)
|
||||
{
|
||||
switch (dynamicTypeRamp) {
|
||||
case DynamicTypeRamp::Caption2:
|
||||
return UIFontTextStyleCaption2;
|
||||
case DynamicTypeRamp::Caption1:
|
||||
return UIFontTextStyleCaption1;
|
||||
case DynamicTypeRamp::Footnote:
|
||||
return UIFontTextStyleFootnote;
|
||||
case DynamicTypeRamp::Subheadline:
|
||||
return UIFontTextStyleSubheadline;
|
||||
case DynamicTypeRamp::Callout:
|
||||
return UIFontTextStyleCallout;
|
||||
case DynamicTypeRamp::Body:
|
||||
return UIFontTextStyleBody;
|
||||
case DynamicTypeRamp::Headline:
|
||||
return UIFontTextStyleHeadline;
|
||||
case DynamicTypeRamp::Title3:
|
||||
return UIFontTextStyleTitle3;
|
||||
case DynamicTypeRamp::Title2:
|
||||
return UIFontTextStyleTitle2;
|
||||
case DynamicTypeRamp::Title1:
|
||||
return UIFontTextStyleTitle1;
|
||||
case DynamicTypeRamp::LargeTitle:
|
||||
return UIFontTextStyleLargeTitle;
|
||||
}
|
||||
}
|
||||
|
||||
inline static CGFloat RCTBaseSizeForDynamicTypeRamp(const DynamicTypeRamp &dynamicTypeRamp)
|
||||
{
|
||||
// Values taken from
|
||||
// https://developer.apple.com/design/human-interface-guidelines/foundations/typography/#specifications
|
||||
switch (dynamicTypeRamp) {
|
||||
case DynamicTypeRamp::Caption2:
|
||||
return 11.0;
|
||||
case DynamicTypeRamp::Caption1:
|
||||
return 12.0;
|
||||
case facebook::react::DynamicTypeRamp::Footnote:
|
||||
return 13.0;
|
||||
case facebook::react::DynamicTypeRamp::Subheadline:
|
||||
return 15.0;
|
||||
case facebook::react::DynamicTypeRamp::Callout:
|
||||
return 16.0;
|
||||
case facebook::react::DynamicTypeRamp::Body:
|
||||
return 17.0;
|
||||
case facebook::react::DynamicTypeRamp::Headline:
|
||||
return 17.0;
|
||||
case facebook::react::DynamicTypeRamp::Title3:
|
||||
return 20.0;
|
||||
case facebook::react::DynamicTypeRamp::Title2:
|
||||
return 22.0;
|
||||
case facebook::react::DynamicTypeRamp::Title1:
|
||||
return 28.0;
|
||||
case facebook::react::DynamicTypeRamp::LargeTitle:
|
||||
return 34.0;
|
||||
}
|
||||
}
|
||||
|
||||
inline static CGFloat RCTEffectiveFontSizeMultiplierFromTextAttributes(const TextAttributes &textAttributes)
|
||||
{
|
||||
if (textAttributes.allowFontScaling.value_or(true)) {
|
||||
if (textAttributes.dynamicTypeRamp.has_value()) {
|
||||
DynamicTypeRamp dynamicTypeRamp = textAttributes.dynamicTypeRamp.value();
|
||||
UIFontMetrics *fontMetrics =
|
||||
[UIFontMetrics metricsForTextStyle:RCTUIFontTextStyleForDynamicTypeRamp(dynamicTypeRamp)];
|
||||
// Using a specific font size reduces rounding errors from -scaledValueForValue:
|
||||
CGFloat requestedSize =
|
||||
isnan(textAttributes.fontSize) ? RCTBaseSizeForDynamicTypeRamp(dynamicTypeRamp) : textAttributes.fontSize;
|
||||
return [fontMetrics scaledValueForValue:requestedSize] / requestedSize;
|
||||
} else {
|
||||
return textAttributes.fontSizeMultiplier;
|
||||
}
|
||||
} else {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
inline static UIFont *RCTEffectiveFontFromTextAttributes(const TextAttributes &textAttributes)
|
||||
{
|
||||
NSString *fontFamily = [NSString stringWithCString:textAttributes.fontFamily.c_str() encoding:NSUTF8StringEncoding];
|
||||
@@ -71,19 +148,11 @@ inline static UIFont *RCTEffectiveFontFromTextAttributes(const TextAttributes &t
|
||||
fontProperties.weight = textAttributes.fontWeight.has_value()
|
||||
? RCTUIFontWeightFromInteger((NSInteger)textAttributes.fontWeight.value())
|
||||
: NAN;
|
||||
fontProperties.sizeMultiplier =
|
||||
textAttributes.allowFontScaling.value_or(true) ? textAttributes.fontSizeMultiplier : 1;
|
||||
fontProperties.sizeMultiplier = RCTEffectiveFontSizeMultiplierFromTextAttributes(textAttributes);
|
||||
|
||||
return RCTFontWithFontProperties(fontProperties);
|
||||
}
|
||||
|
||||
inline static CGFloat RCTEffectiveFontSizeMultiplierFromTextAttributes(const TextAttributes &textAttributes)
|
||||
{
|
||||
return textAttributes.allowFontScaling.value_or(true) && !isnan(textAttributes.fontSizeMultiplier)
|
||||
? textAttributes.fontSizeMultiplier
|
||||
: 1.0;
|
||||
}
|
||||
|
||||
inline static UIColor *RCTEffectiveForegroundColorFromTextAttributes(const TextAttributes &textAttributes)
|
||||
{
|
||||
UIColor *effectiveForegroundColor = RCTUIColorFromSharedColor(textAttributes.foregroundColor) ?: [UIColor blackColor];
|
||||
|
||||
@@ -2079,7 +2079,7 @@ static float YGDistributeFreeSpaceSecondPass(
|
||||
const float availableInnerCrossDim,
|
||||
const float availableInnerWidth,
|
||||
const float availableInnerHeight,
|
||||
const bool flexBasisOverflows,
|
||||
const bool mainAxisOverflows,
|
||||
const YGMeasureMode measureModeCrossDim,
|
||||
const bool performLayout,
|
||||
const YGConfigRef config,
|
||||
@@ -2175,7 +2175,7 @@ static float YGDistributeFreeSpaceSecondPass(
|
||||
!YGNodeIsStyleDimDefined(
|
||||
currentRelativeChild, crossAxis, availableInnerCrossDim) &&
|
||||
measureModeCrossDim == YGMeasureModeExactly &&
|
||||
!(isNodeFlexWrap && flexBasisOverflows) &&
|
||||
!(isNodeFlexWrap && mainAxisOverflows) &&
|
||||
YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch &&
|
||||
currentRelativeChild->marginLeadingValue(crossAxis).unit !=
|
||||
YGUnitAuto &&
|
||||
@@ -2383,7 +2383,7 @@ static void YGResolveFlexibleLength(
|
||||
const float availableInnerCrossDim,
|
||||
const float availableInnerWidth,
|
||||
const float availableInnerHeight,
|
||||
const bool flexBasisOverflows,
|
||||
const bool mainAxisOverflows,
|
||||
const YGMeasureMode measureModeCrossDim,
|
||||
const bool performLayout,
|
||||
const YGConfigRef config,
|
||||
@@ -2411,7 +2411,7 @@ static void YGResolveFlexibleLength(
|
||||
availableInnerCrossDim,
|
||||
availableInnerWidth,
|
||||
availableInnerHeight,
|
||||
flexBasisOverflows,
|
||||
mainAxisOverflows,
|
||||
measureModeCrossDim,
|
||||
performLayout,
|
||||
config,
|
||||
@@ -2540,6 +2540,11 @@ static void YGJustifyMainAxis(
|
||||
const YGNodeRef child = node->getChild(i);
|
||||
const YGStyle& childStyle = child->getStyle();
|
||||
const YGLayout childLayout = child->getLayout();
|
||||
const bool isLastChild = i == collectedFlexItemsValues.endOfLineIndex - 1;
|
||||
// remove the gap if it is the last element of the line
|
||||
if (isLastChild) {
|
||||
betweenMainDim -= gap;
|
||||
}
|
||||
if (childStyle.display() == YGDisplayNone) {
|
||||
continue;
|
||||
}
|
||||
@@ -2884,7 +2889,9 @@ static void YGNodelayoutImpl(
|
||||
|
||||
// STEP 3: DETERMINE FLEX BASIS FOR EACH ITEM
|
||||
|
||||
float totalOuterFlexBasis = YGNodeComputeFlexBasisForChildren(
|
||||
// Computed basis + margins + gap
|
||||
float totalMainDim = 0;
|
||||
totalMainDim += YGNodeComputeFlexBasisForChildren(
|
||||
node,
|
||||
availableInnerWidth,
|
||||
availableInnerHeight,
|
||||
@@ -2899,10 +2906,17 @@ static void YGNodelayoutImpl(
|
||||
depth,
|
||||
generationCount);
|
||||
|
||||
const bool flexBasisOverflows = measureModeMainDim == YGMeasureModeUndefined
|
||||
? false
|
||||
: totalOuterFlexBasis > availableInnerMainDim;
|
||||
if (isNodeFlexWrap && flexBasisOverflows &&
|
||||
if (childCount > 1) {
|
||||
totalMainDim +=
|
||||
node->getGapForAxis(mainAxis, availableInnerCrossDim).unwrap() *
|
||||
(childCount - 1);
|
||||
}
|
||||
|
||||
const bool mainAxisOverflows =
|
||||
(measureModeMainDim != YGMeasureModeUndefined) &&
|
||||
totalMainDim > availableInnerMainDim;
|
||||
|
||||
if (isNodeFlexWrap && mainAxisOverflows &&
|
||||
measureModeMainDim == YGMeasureModeAtMost) {
|
||||
measureModeMainDim = YGMeasureModeExactly;
|
||||
}
|
||||
@@ -3025,7 +3039,7 @@ static void YGNodelayoutImpl(
|
||||
availableInnerCrossDim,
|
||||
availableInnerWidth,
|
||||
availableInnerHeight,
|
||||
flexBasisOverflows,
|
||||
mainAxisOverflows,
|
||||
measureModeCrossDim,
|
||||
performLayout,
|
||||
config,
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# The `/android` folder inside `react-native`
|
||||
|
||||
Starting from React Native 0.71, we're not shipping the `/android` folder inside the React Native NPM package
|
||||
anymore due to sizing constraints on NPM. The Android artifacts are distributed via Maven Central.
|
||||
You can read more about it in this RFC:
|
||||
https://github.com/react-native-community/discussions-and-proposals/pull/508
|
||||
|
||||
If you're a library author and you're manipulating the React Native .aar files, to extract headers,
|
||||
extract `.so` files or do anything with it, you're probably doing something wrong. React Native
|
||||
0.71 ships with all the necessary logic to let you consume it transparently by just using:
|
||||
|
||||
```
|
||||
implementation("com.facebook.react:react-android")
|
||||
// or to keep backward compatibility with older versions of React Native:
|
||||
implementation("com.facebook.react:react-native:+")
|
||||
```
|
||||
|
||||
You should consider refactoring your library code not to unzip/manipulate the React Native .aar files.
|
||||
|
||||
This README.md file is kept in this folder as some libraries are checking the existence of the `/android` folder
|
||||
and failing user builds if the folder is missing.
|
||||
@@ -59,7 +59,6 @@ import typeof Dimensions from './Libraries/Utilities/Dimensions';
|
||||
import typeof Easing from './Libraries/Animated/Easing';
|
||||
import typeof ReactNative from './Libraries/Renderer/shims/ReactNative';
|
||||
import typeof I18nManager from './Libraries/ReactNative/I18nManager';
|
||||
import typeof ImagePickerIOS from './Libraries/Image/ImagePickerIOS';
|
||||
import typeof InteractionManager from './Libraries/Interaction/InteractionManager';
|
||||
import typeof Keyboard from './Libraries/Components/Keyboard/Keyboard';
|
||||
import typeof LayoutAnimation from './Libraries/LayoutAnimation/LayoutAnimation';
|
||||
@@ -281,16 +280,6 @@ module.exports = {
|
||||
get I18nManager(): I18nManager {
|
||||
return require('./Libraries/ReactNative/I18nManager');
|
||||
},
|
||||
get ImagePickerIOS(): ImagePickerIOS {
|
||||
warnOnce(
|
||||
'imagePickerIOS-moved',
|
||||
'ImagePickerIOS has been extracted from react-native core and will be removed in a future release. ' +
|
||||
"Please upgrade to use either '@react-native-community/react-native-image-picker' or 'expo-image-picker'. " +
|
||||
"If you cannot upgrade to a different library, please install the deprecated '@react-native-community/image-picker-ios' package. " +
|
||||
'See https://github.com/rnc-archive/react-native-image-picker-ios',
|
||||
);
|
||||
return require('./Libraries/Image/ImagePickerIOS');
|
||||
},
|
||||
get InteractionManager(): InteractionManager {
|
||||
return require('./Libraries/Interaction/InteractionManager');
|
||||
},
|
||||
@@ -765,4 +754,20 @@ if (__DEV__) {
|
||||
);
|
||||
},
|
||||
});
|
||||
/* $FlowFixMe[prop-missing] This is intentional: Flow will error when
|
||||
* attempting to access ImagePickerIOS. */
|
||||
/* $FlowFixMe[invalid-export] This is intentional: Flow will error when
|
||||
* attempting to access ImagePickerIOS. */
|
||||
Object.defineProperty(module.exports, 'ImagePickerIOS', {
|
||||
configurable: true,
|
||||
get() {
|
||||
invariant(
|
||||
false,
|
||||
'ImagePickerIOS has been removed from React Native. ' +
|
||||
"Please upgrade to use either '@react-native-community/react-native-image-picker' or 'expo-image-picker'. " +
|
||||
"If you cannot upgrade to a different library, please install the deprecated '@react-native-community/image-picker-ios' package. " +
|
||||
'See https://github.com/rnc-archive/react-native-image-picker-ios',
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Vendored
+3
-1
@@ -12,5 +12,7 @@
|
||||
const NodeEnv = require('jest-environment-node').TestEnvironment;
|
||||
|
||||
module.exports = class ReactNativeEnv extends NodeEnv {
|
||||
// this is where we'll add our custom logic
|
||||
exportConditions() {
|
||||
return ['react-native'];
|
||||
}
|
||||
};
|
||||
|
||||
+59
-20
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"private": true,
|
||||
"version": "1000.0.0",
|
||||
"version": "0.71.0-rc.6",
|
||||
"bin": "./cli.js",
|
||||
"description": "A framework for building native apps using React",
|
||||
"license": "MIT",
|
||||
@@ -86,7 +85,7 @@
|
||||
"prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"",
|
||||
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
|
||||
"update-lock": "npx yarn-deduplicate",
|
||||
"docker-setup-android": "docker pull reactnativecommunity/react-native-android:6.0",
|
||||
"docker-setup-android": "docker pull reactnativecommunity/react-native-android:6.1",
|
||||
"docker-build-android": "docker build -t reactnativeci/android -f .circleci/Dockerfiles/Dockerfile.android .",
|
||||
"test-android-run-instrumentation": "docker run --cap-add=SYS_ADMIN -it reactnativeci/android bash .circleci/Dockerfiles/scripts/run-android-docker-instrumentation-tests.sh",
|
||||
"test-android-run-unit": "docker run --cap-add=SYS_ADMIN -it reactnativeci/android bash .circleci/Dockerfiles/scripts/run-android-docker-unit-tests.sh",
|
||||
@@ -98,41 +97,38 @@
|
||||
"test-e2e-local": "node ./scripts/test-e2e-local.js",
|
||||
"test-e2e-local-clean": "node ./scripts/test-e2e-local-clean.js",
|
||||
"test-ios": "./scripts/objc-test.sh test",
|
||||
"test-typescript": "dtslint types"
|
||||
"test-typescript": "dtslint types",
|
||||
"test-typescript-offline": "dtslint --localTs node_modules/typescript/lib types"
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*",
|
||||
"repo-config"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"react": "18.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/create-cache-key-function": "^29.2.1",
|
||||
"@react-native-community/cli": "10.0.0-alpha.2",
|
||||
"@react-native-community/cli-platform-android": "10.0.0-alpha.2",
|
||||
"@react-native-community/cli-platform-ios": "10.0.0-alpha.1",
|
||||
"@react-native-community/cli": "10.0.0",
|
||||
"@react-native-community/cli-platform-android": "10.0.0",
|
||||
"@react-native-community/cli-platform-ios": "10.0.0",
|
||||
"@react-native/assets": "1.0.0",
|
||||
"@react-native/normalize-color": "2.0.0",
|
||||
"@react-native/normalize-color": "2.1.0",
|
||||
"@react-native/polyfills": "2.0.0",
|
||||
"abort-controller": "^3.0.0",
|
||||
"anser": "^1.4.9",
|
||||
"base64-js": "^1.1.2",
|
||||
"deprecated-react-native-prop-types": "^2.3.0",
|
||||
"deprecated-react-native-prop-types": "^3.0.1",
|
||||
"event-target-shim": "^5.0.1",
|
||||
"invariant": "^2.2.4",
|
||||
"jest-environment-node": "^29.2.1",
|
||||
"jsc-android": "^250230.2.1",
|
||||
"memoize-one": "^5.0.0",
|
||||
"metro-react-native-babel-transformer": "0.73.3",
|
||||
"metro-runtime": "0.73.3",
|
||||
"metro-source-map": "0.73.3",
|
||||
"metro-react-native-babel-transformer": "0.73.5",
|
||||
"metro-runtime": "0.73.5",
|
||||
"metro-source-map": "0.73.5",
|
||||
"mkdirp": "^0.5.1",
|
||||
"nullthrows": "^1.1.1",
|
||||
"pretty-format": "^26.5.2",
|
||||
"promise": "^8.3.0",
|
||||
"react-devtools-core": "^4.26.1",
|
||||
"react-native-gradle-plugin": "^0.71.8",
|
||||
"react-native-gradle-plugin": "^0.71.12",
|
||||
"react-refresh": "^0.4.0",
|
||||
"react-shallow-renderer": "^16.15.0",
|
||||
"regenerator-runtime": "^0.13.2",
|
||||
@@ -140,13 +136,56 @@
|
||||
"stacktrace-parser": "^0.1.3",
|
||||
"use-sync-external-store": "^1.0.0",
|
||||
"whatwg-fetch": "^3.0.0",
|
||||
"ws": "^6.2.2"
|
||||
"ws": "^6.2.2",
|
||||
"react-native-codegen": "^0.71.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"flow-bin": "^0.191.0",
|
||||
"hermes-eslint": "0.8.0",
|
||||
"react": "18.2.0",
|
||||
"react-test-renderer": "^18.2.0"
|
||||
"react-test-renderer": "18.2.0",
|
||||
"@babel/core": "^7.14.0",
|
||||
"@babel/eslint-parser": "^7.18.2",
|
||||
"@babel/generator": "^7.14.0",
|
||||
"@babel/plugin-transform-regenerator": "^7.0.0",
|
||||
"@definitelytyped/dtslint": "^0.0.127",
|
||||
"@react-native-community/eslint-config": "*",
|
||||
"@react-native-community/eslint-plugin": "*",
|
||||
"@react-native/eslint-plugin-specs": "^0.71.1",
|
||||
"@reactions/component": "^2.0.2",
|
||||
"@types/react": "^18.0.18",
|
||||
"@typescript-eslint/parser": "^5.30.5",
|
||||
"async": "^3.2.2",
|
||||
"clang-format": "^1.8.0",
|
||||
"connect": "^3.6.5",
|
||||
"coveralls": "^3.1.1",
|
||||
"eslint": "^8.19.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-babel": "^5.3.1",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-ft-flow": "^2.0.1",
|
||||
"eslint-plugin-jest": "^26.5.3",
|
||||
"eslint-plugin-jsx-a11y": "^6.6.0",
|
||||
"eslint-plugin-lint": "^1.0.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-react": "^7.30.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-native": "^4.0.0",
|
||||
"eslint-plugin-relay": "^1.8.3",
|
||||
"inquirer": "^7.1.0",
|
||||
"jest": "^29.2.1",
|
||||
"jest-junit": "^10.0.0",
|
||||
"jscodeshift": "^0.13.1",
|
||||
"metro-babel-register": "0.73.5",
|
||||
"metro-memory-fs": "0.73.5",
|
||||
"mkdirp": "^0.5.1",
|
||||
"mock-fs": "^5.1.4",
|
||||
"prettier": "^2.4.1",
|
||||
"shelljs": "^0.8.5",
|
||||
"signedsource": "^1.0.0",
|
||||
"typescript": "4.1.3",
|
||||
"ws": "^6.2.2",
|
||||
"yargs": "^17.5.1"
|
||||
},
|
||||
"codegenConfig": {
|
||||
"libraries": [
|
||||
@@ -166,4 +205,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "0.71.0",
|
||||
"version": "0.71.1",
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"repository": {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
load("@fbsource//tools/build_defs/third_party:yarn_defs.bzl", "yarn_workspace")
|
||||
|
||||
yarn_workspace(
|
||||
name = "yarn-workspace",
|
||||
srcs = glob(
|
||||
["**/*.js"],
|
||||
exclude = [
|
||||
"**/__fixtures__/**",
|
||||
"**/__flowtests__/**",
|
||||
"**/__mocks__/**",
|
||||
"**/__server_snapshot_tests__/**",
|
||||
"**/__tests__/**",
|
||||
"**/node_modules/**",
|
||||
"**/node_modules/.bin/**",
|
||||
"**/.*",
|
||||
"**/.*/**",
|
||||
"**/.*/.*",
|
||||
"**/*.xcodeproj/**",
|
||||
"**/*.xcworkspace/**",
|
||||
],
|
||||
),
|
||||
visibility = ["PUBLIC"],
|
||||
)
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native-community/eslint-config",
|
||||
"version": "3.1.0",
|
||||
"version": "3.2.0",
|
||||
"description": "ESLint config for React Native",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native-community/eslint-plugin",
|
||||
"version": "1.2.0",
|
||||
"version": "1.3.0",
|
||||
"description": "ESLint rules for @react-native-community/eslint-config",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin-specs",
|
||||
"version": "0.71.0",
|
||||
"version": "0.71.1",
|
||||
"description": "ESLint rules to validate NativeModule and Component Specs",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/hermes-inspector-msggen",
|
||||
"private": true,
|
||||
"version": "0.71.0",
|
||||
"version": "0.71.1",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"msggen": "./bin/index.js"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user