Compare commits

..
Author SHA1 Message Date
Blake Friedman 14cce6c313 [RN][CI] Fix typo in template action watcher script
Trivial typo

Changelog: [Internal]
2024-10-29 14:45:28 +00:00
255 changed files with 45863 additions and 64951 deletions
+1 -1
View File
@@ -90,4 +90,4 @@ untyped-import
untyped-type-import
[version]
^0.251.1
^0.250.0
+1 -1
View File
@@ -8,7 +8,7 @@ runs:
using: "composite"
steps:
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
# We want the Gradle cache to be written only on main/-stable branches run, and only for jobs with `cache-read-only` == false (i.e. `build_android`).
@@ -0,0 +1,13 @@
name: "Validate Gradle Wrapper"
on:
push:
pull_request:
jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
-17
View File
@@ -1,22 +1,5 @@
# Changelog
## v0.76.1
### Fixed
#### Android specific
- **runtime** Made AppRegistry callable from Native code in Bridgeless (fixes headless tasks) ([f3fee67c54](https://github.com/facebook/react-native/commit/f3fee67c547ace5e08bc9e119bcb80e0f3454d30) by [@robik](https://github.com/robik))
- **runtime** Add jsBundleFile to DefaultReactNativeHost.kt ([e56bd89ef](https://github.com/facebook/react-native/commit/e56bd89eff72f1d38d2940b9dbd8f7b97037dc22))
#### iOS specific
- **codegen** Do not generate the ComponentCls function in the RCTThirdPartyFabricComponentsProvider for components deined in the app. ([dc7e9e2d83](https://github.com/facebook/react-native/commit/dc7e9e2d83f5af3d2a970521af4fcc7f86d2168d) by [@cipolleschi](https://github.com/cipolleschi))
- **infra** Generated NODE_BINARY in .xcode.env.local now supports paths with a space ([eeaa3ff458](https://github.com/facebook/react-native/commit/eeaa3ff458a3e5c902075bb45161d6ccde31fe53) by [@blakef](https://github.com/blakef))
- **infra** Pin Xcodeproj to < 1.26.0 ([e8776240b41](https://github.com/facebook/react-native/commit/e8776240b41a3147e95713299b69c813be60b8e8))
- **runtime** Fixed bug where background colors would sometimes animate when changing on Views ([1d6ac09530](https://github.com/facebook/react-native/commit/1d6ac09530145e6d2bf1e4dd9d40f51542d9e7f6) by [@joevilches](https://github.com/joevilches))
- **runtime** Fixes regression of RCTWindowFrameDidChangeNotification not fired ([e271b23fad](https://github.com/facebook/react-native/commit/e271b23fad89e1e7da2e91a8f1e5cbb295406c74) by [@zhongwuzw](https://github.com/zhongwuzw))
## v0.76.0
### Breaking
+8 -4
View File
@@ -14,7 +14,8 @@
"flow": "flow",
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
"format": "npm run prettier && npm run clang-format",
"featureflags": "cd packages/react-native && yarn featureflags",
"featureflags-check": "cd packages/react-native && yarn featureflags-check",
"featureflags-update": "cd packages/react-native && yarn featureflags-update",
"lint-ci": "./scripts/circleci/analyze_code.sh && yarn shellcheck",
"lint-java": "node ./scripts/lint-java.js",
"lint": "eslint .",
@@ -77,7 +78,7 @@
"eslint-plugin-redundant-undefined": "^0.4.0",
"eslint-plugin-relay": "^1.8.3",
"flow-api-translator": "0.24.0",
"flow-bin": "^0.251.1",
"flow-bin": "^0.250.0",
"glob": "^7.1.1",
"hermes-eslint": "0.24.0",
"hermes-transform": "0.24.0",
@@ -93,13 +94,16 @@
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.24.0",
"react": "18.3.1",
"react-test-renderer": "18.3.1",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"signedsource": "^1.0.0",
"supports-color": "^7.1.0",
"typescript": "5.0.4",
"ws": "^6.2.3"
},
"resolutions": {
"react-is": "19.0.0-rc-fb9a90fa48-20240614"
}
}
+1 -1
View File
@@ -31,7 +31,7 @@
"nullthrows": "^1.1.1",
"open": "^7.0.3",
"selfsigned": "^2.4.1",
"serve-static": "^1.16.2",
"serve-static": "^1.13.1",
"ws": "^6.2.3"
},
"engines": {
+2 -2
View File
@@ -39,7 +39,7 @@ module.exports = {
overrides: [
{
files: ['*.js'],
parser: '@babel/eslint-parser',
parser: 'hermes-eslint',
plugins: ['ft-flow'],
rules: {
// Flow Plugin
@@ -51,7 +51,7 @@ module.exports = {
},
{
files: ['*.jsx'],
parser: '@babel/eslint-parser',
parser: 'hermes-eslint',
},
{
files: ['*.ts', '*.tsx'],
@@ -21,7 +21,6 @@
"main": "index.js",
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@react-native/eslint-plugin": "0.77.0-main",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
@@ -31,7 +30,8 @@
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.0.0"
"eslint-plugin-react-native": "^4.0.0",
"hermes-eslint": "0.24.0"
},
"peerDependencies": {
"eslint": ">=8",
@@ -1,5 +1,5 @@
[versions]
agp = "8.7.2"
agp = "8.7.1"
gson = "2.8.9"
guava = "31.0.1-jre"
javapoet = "1.13.0"
@@ -59,15 +59,15 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
val cxxModuleCMakeListsPath = dep.cxxModuleCMakeListsPath
if (libraryName != null && cmakeListsPath != null) {
// If user provided a custom cmakeListsPath, let's honor it.
val nativeFolderPath = sanitizeCmakeListsPath(cmakeListsPath)
val nativeFolderPath = cmakeListsPath.replace("CMakeLists.txt", "")
addDirectoryString +=
"add_subdirectory(\"$nativeFolderPath\" ${libraryName}_autolinked_build)"
"add_subdirectory($nativeFolderPath ${libraryName}_autolinked_build)"
}
if (cxxModuleCMakeListsPath != null) {
// If user provided a custom cxxModuleCMakeListsPath, let's honor it.
val nativeFolderPath = sanitizeCmakeListsPath(cxxModuleCMakeListsPath)
val nativeFolderPath = cxxModuleCMakeListsPath.replace("CMakeLists.txt", "")
addDirectoryString +=
"\nadd_subdirectory(\"$nativeFolderPath\" ${libraryName}_cxxmodule_autolinked_build)"
"\nadd_subdirectory($nativeFolderPath ${libraryName}_cxxmodule_autolinked_build)"
}
addDirectoryString
}
@@ -159,9 +159,6 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
const val COMPONENT_DESCRIPTOR_FILENAME = "ComponentDescriptors.h"
const val COMPONENT_INCLUDE_PATH = "react/renderer/components"
internal fun sanitizeCmakeListsPath(cmakeListsPath: String): String =
cmakeListsPath.replace("CMakeLists.txt", "").replace(" ", "\\ ")
// language=cmake
val CMAKE_TEMPLATE =
"""
@@ -53,8 +53,11 @@ internal object NdkConfiguratorUtils {
if (cmakeArgs.none { it.startsWith("-DANDROID_STL") }) {
cmakeArgs.add("-DANDROID_STL=c++_shared")
}
if (cmakeArgs.none { it.startsWith("-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES") }) {
cmakeArgs.add("-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON")
// Due to the new NDK toolchain file, the C++ flags gets overridden between compilation
// units. This is causing some libraries to don't be compiled with -DANDROID and other
// crucial flags. This can be revisited once we bump to NDK 25/26
if (cmakeArgs.none { it.startsWith("-DANDROID_USE_LEGACY_TOOLCHAIN_FILE") }) {
cmakeArgs.add("-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON")
}
val architectures = project.getReactNativeArchitectures()
@@ -11,7 +11,6 @@ import com.facebook.react.model.ModelAutolinkingConfigJson
import com.facebook.react.model.ModelAutolinkingDependenciesJson
import com.facebook.react.model.ModelAutolinkingDependenciesPlatformAndroidJson
import com.facebook.react.model.ModelAutolinkingDependenciesPlatformJson
import com.facebook.react.tasks.GenerateAutolinkingNewArchitecturesFileTask.Companion.sanitizeCmakeListsPath
import com.facebook.react.tests.createTestTask
import org.assertj.core.api.Assertions.assertThat
import org.junit.Rule
@@ -146,9 +145,9 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
# or link against a old prefab target (this is needed for React Native 0.76 on).
set(REACTNATIVE_MERGED_SO true)
add_subdirectory("./a/directory/" aPackage_autolinked_build)
add_subdirectory("./another/directory/with\ spaces/" anotherPackage_autolinked_build)
add_subdirectory("./another/directory/cxx/" anotherPackage_cxxmodule_autolinked_build)
add_subdirectory(./a/directory/ aPackage_autolinked_build)
add_subdirectory(./another/directory/ anotherPackage_autolinked_build)
add_subdirectory(./another/directory/cxx/ anotherPackage_cxxmodule_autolinked_build)
set(AUTOLINKED_LIBRARIES
react_codegen_aPackage
@@ -259,24 +258,6 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
.trimIndent())
}
@Test
fun sanitizeCmakeListsPath_withPathEndingWithFileName_removesFilename() {
val input = "./a/directory/CMakeLists.txt"
assertThat(sanitizeCmakeListsPath(input)).isEqualTo("./a/directory/")
}
@Test
fun sanitizeCmakeListsPath_withSpaces_removesSpaces() {
val input = "./a/dir ectory/with spaces/"
assertThat(sanitizeCmakeListsPath(input)).isEqualTo("./a/dir\\ ectory/with\\ spaces/")
}
@Test
fun sanitizeCmakeListsPath_withPathEndingWithFileNameAndSpaces_sanitizesIt() {
val input = "./a/dir ectory/CMakeLists.txt"
assertThat(sanitizeCmakeListsPath(input)).isEqualTo("./a/dir\\ ectory/")
}
private val testDependencies =
listOf(
ModelAutolinkingDependenciesPlatformAndroidJson(
@@ -295,7 +276,7 @@ class GenerateAutolinkingNewArchitecturesFileTaskTest {
buildTypes = emptyList(),
libraryName = "anotherPackage",
componentDescriptors = listOf("AnotherPackageComponentDescriptor"),
cmakeListsPath = "./another/directory/with spaces/CMakeLists.txt",
cmakeListsPath = "./another/directory/CMakeLists.txt",
cxxModuleCMakeListsPath = "./another/directory/cxx/CMakeLists.txt",
cxxModuleHeaderName = "AnotherCxxModule",
cxxModuleCMakeListsModuleName = "another_cxxModule",
+2 -2
View File
@@ -12,7 +12,7 @@
"test": "jest"
},
"dependencies": {
"react": "18.3.1",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-native": "1000.0.0"
},
"devDependencies": {
@@ -28,7 +28,7 @@
"eslint": "^8.19.0",
"jest": "^29.6.3",
"listr2": "^8.2.1",
"react-test-renderer": "18.3.1",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"rxjs": "^7.8.1"
},
"engines": {
+17
View File
@@ -387,6 +387,15 @@ const LOG_LEVELS = {
warn: 2,
error: 3,
};
const INSPECTOR_LEVELS = [];
INSPECTOR_LEVELS[LOG_LEVELS.trace] = 'debug';
INSPECTOR_LEVELS[LOG_LEVELS.info] = 'log';
INSPECTOR_LEVELS[LOG_LEVELS.warn] = 'warning';
INSPECTOR_LEVELS[LOG_LEVELS.error] = 'error';
// Strip the inner function in getNativeLogFunction(), if in dev also
// strip method printing to originalConsole.
const INSPECTOR_FRAMES_TO_SKIP = __DEV__ ? 2 : 1;
function getNativeLogFunction(level) {
return function () {
@@ -420,6 +429,14 @@ function getNativeLogFunction(level) {
// (Note: Logic duplicated in ExceptionsManager.js.)
logLevel = LOG_LEVELS.warn;
}
if (global.__inspectorLog) {
global.__inspectorLog(
INSPECTOR_LEVELS[logLevel],
str,
[].slice.call(arguments),
INSPECTOR_FRAMES_TO_SKIP,
);
}
if (groupStack.length) {
str = groupFormat('', str);
}
+3 -10
View File
@@ -286,11 +286,6 @@ export interface UnsafeAnyTypeAnnotation {
readonly type: 'AnyTypeAnnotation',
}
export interface NativeModuleNumberLiteralTypeAnnotation {
readonly type: 'NumberLiteralTypeAnnotation';
readonly value: number;
}
export interface NativeModuleStringTypeAnnotation {
readonly type: 'StringTypeAnnotation';
}
@@ -325,10 +320,10 @@ export interface NativeModuleBooleanTypeAnnotation {
readonly type: 'BooleanTypeAnnotation';
}
export type NativeModuleEnumMember = {
export type NativeModuleEnumMembers = readonly {
readonly name: string;
readonly value: string | number;
};
}[];
export type NativeModuleEnumMemberType =
| 'NumberTypeAnnotation'
@@ -344,7 +339,7 @@ export interface NativeModuleEnumDeclarationWithMembers {
name: string;
type: 'EnumDeclarationWithMembers';
memberType: NativeModuleEnumMemberType;
members: readonly NativeModuleEnumMember[];
members: NativeModuleEnumMembers;
}
export interface NativeModuleGenericObjectTypeAnnotation {
@@ -385,7 +380,6 @@ export type NativeModuleEventEmitterBaseTypeAnnotation =
| NativeModuleFloatTypeAnnotation
| NativeModuleInt32TypeAnnotation
| NativeModuleNumberTypeAnnotation
| NativeModuleNumberLiteralTypeAnnotation
| NativeModuleStringTypeAnnotation
| NativeModuleStringLiteralTypeAnnotation
| NativeModuleStringLiteralUnionTypeAnnotation
@@ -405,7 +399,6 @@ export type NativeModuleBaseTypeAnnotation =
| NativeModuleStringLiteralTypeAnnotation
| NativeModuleStringLiteralUnionTypeAnnotation
| NativeModuleNumberTypeAnnotation
| NativeModuleNumberLiteralTypeAnnotation
| NativeModuleInt32TypeAnnotation
| NativeModuleDoubleTypeAnnotation
| NativeModuleFloatTypeAnnotation
+7 -12
View File
@@ -37,11 +37,6 @@ export type Int32TypeAnnotation = $ReadOnly<{
type: 'Int32TypeAnnotation',
}>;
export type NumberLiteralTypeAnnotation = $ReadOnly<{
type: 'NumberLiteralTypeAnnotation',
value: number,
}>;
export type StringTypeAnnotation = $ReadOnly<{
type: 'StringTypeAnnotation',
}>;
@@ -309,10 +304,12 @@ export type NativeModuleNumberTypeAnnotation = $ReadOnly<{
type: 'NumberTypeAnnotation',
}>;
export type NativeModuleEnumMember = {
name: string,
value: string | number,
};
export type NativeModuleEnumMembers = $ReadOnlyArray<
$ReadOnly<{
name: string,
value: string | number,
}>,
>;
export type NativeModuleEnumMemberType =
| 'NumberTypeAnnotation'
@@ -328,7 +325,7 @@ export type NativeModuleEnumDeclarationWithMembers = {
name: string,
type: 'EnumDeclarationWithMembers',
memberType: NativeModuleEnumMemberType,
members: $ReadOnlyArray<NativeModuleEnumMember>,
members: NativeModuleEnumMembers,
};
export type NativeModuleGenericObjectTypeAnnotation = $ReadOnly<{
@@ -369,7 +366,6 @@ type NativeModuleEventEmitterBaseTypeAnnotation =
| FloatTypeAnnotation
| Int32TypeAnnotation
| NativeModuleNumberTypeAnnotation
| NumberLiteralTypeAnnotation
| StringTypeAnnotation
| StringLiteralTypeAnnotation
| StringLiteralUnionTypeAnnotation
@@ -389,7 +385,6 @@ export type NativeModuleBaseTypeAnnotation =
| StringLiteralTypeAnnotation
| StringLiteralUnionTypeAnnotation
| NativeModuleNumberTypeAnnotation
| NumberLiteralTypeAnnotation
| Int32TypeAnnotation
| DoubleTypeAnnotation
| FloatTypeAnnotation
@@ -186,8 +186,6 @@ function serializeArg(
return wrap(val => `${val}.asNumber()`);
case 'Int32TypeAnnotation':
return wrap(val => `${val}.asNumber()`);
case 'NumberLiteralTypeAnnotation':
return wrap(val => `${val}.asNumber()`);
case 'ArrayTypeAnnotation':
return wrap(val => `${val}.asObject(rt).asArray(rt)`);
case 'FunctionTypeAnnotation':
@@ -16,7 +16,7 @@ import type {
import type {
NativeModuleAliasMap,
NativeModuleEnumMap,
NativeModuleEnumMember,
NativeModuleEnumMembers,
NativeModuleEnumMemberType,
NativeModuleEventEmitterShape,
NativeModuleFunctionTypeAnnotation,
@@ -179,8 +179,6 @@ function translatePrimitiveJSTypeToCpp(
return wrapOptional('jsi::String', isRequired);
case 'NumberTypeAnnotation':
return wrapOptional('double', isRequired);
case 'NumberLiteralTypeAnnotation':
return wrapOptional('double', isRequired);
case 'DoubleTypeAnnotation':
return wrapOptional('double', isRequired);
case 'FloatTypeAnnotation':
@@ -409,7 +407,7 @@ struct Bridging<${enumName}> {
function generateEnum(
hasteModuleName: string,
origEnumName: string,
members: $ReadOnlyArray<NativeModuleEnumMember>,
members: NativeModuleEnumMembers,
memberType: NativeModuleEnumMemberType,
): string {
const enumName = getEnumName(hasteModuleName, origEnumName);
@@ -136,7 +136,6 @@ function translateEventEmitterTypeToJavaType(
case 'StringLiteralUnionTypeAnnotation':
return 'String';
case 'NumberTypeAnnotation':
case 'NumberLiteralTypeAnnotation':
case 'FloatTypeAnnotation':
case 'DoubleTypeAnnotation':
case 'Int32TypeAnnotation':
@@ -204,8 +203,6 @@ function translateFunctionParamToJavaType(
return wrapOptional('String', isRequired);
case 'NumberTypeAnnotation':
return wrapOptional('double', isRequired);
case 'NumberLiteralTypeAnnotation':
return wrapOptional('double', isRequired);
case 'FloatTypeAnnotation':
return wrapOptional('double', isRequired);
case 'DoubleTypeAnnotation':
@@ -300,8 +297,6 @@ function translateFunctionReturnTypeToJavaType(
return wrapOptional('String', isRequired);
case 'NumberTypeAnnotation':
return wrapOptional('double', isRequired);
case 'NumberLiteralTypeAnnotation':
return wrapOptional('double', isRequired);
case 'FloatTypeAnnotation':
return wrapOptional('double', isRequired);
case 'DoubleTypeAnnotation':
@@ -378,8 +373,6 @@ function getFalsyReturnStatementFromReturnType(
return '';
case 'NumberTypeAnnotation':
return nullable ? 'return null;' : 'return 0;';
case 'NumberLiteralTypeAnnotation':
return nullable ? 'return null;' : 'return 0;';
case 'FloatTypeAnnotation':
return nullable ? 'return null;' : 'return 0.0;';
case 'DoubleTypeAnnotation':
@@ -197,8 +197,6 @@ function translateReturnTypeToKind(
}
case 'NumberTypeAnnotation':
return 'NumberKind';
case 'NumberLiteralTypeAnnotation':
return 'NumberKind';
case 'DoubleTypeAnnotation':
return 'NumberKind';
case 'FloatTypeAnnotation':
@@ -282,8 +280,6 @@ function translateParamTypeToJniType(
}
case 'NumberTypeAnnotation':
return !isRequired ? 'Ljava/lang/Double;' : 'D';
case 'NumberLiteralTypeAnnotation':
return !isRequired ? 'Ljava/lang/Double;' : 'D';
case 'DoubleTypeAnnotation':
return !isRequired ? 'Ljava/lang/Double;' : 'D';
case 'FloatTypeAnnotation':
@@ -364,8 +360,6 @@ function translateReturnTypeToJniType(
}
case 'NumberTypeAnnotation':
return nullable ? 'Ljava/lang/Double;' : 'D';
case 'NumberLiteralTypeAnnotation':
return nullable ? 'Ljava/lang/Double;' : 'D';
case 'DoubleTypeAnnotation':
return nullable ? 'Ljava/lang/Double;' : 'D';
case 'FloatTypeAnnotation':
@@ -23,7 +23,6 @@ import type {
NativeModuleObjectTypeAnnotation,
NativeModuleTypeAliasTypeAnnotation,
Nullable,
NumberLiteralTypeAnnotation,
ReservedTypeAnnotation,
StringLiteralTypeAnnotation,
StringLiteralUnionTypeAnnotation,
@@ -64,7 +63,6 @@ export type StructTypeAnnotation =
| StringLiteralTypeAnnotation
| StringLiteralUnionTypeAnnotation
| NativeModuleNumberTypeAnnotation
| NumberLiteralTypeAnnotation
| Int32TypeAnnotation
| DoubleTypeAnnotation
| FloatTypeAnnotation
@@ -100,8 +100,6 @@ function toObjCType(
return 'NSString *';
case 'NumberTypeAnnotation':
return wrapCxxOptional('double', isRequired);
case 'NumberLiteralTypeAnnotation':
return wrapCxxOptional('double', isRequired);
case 'FloatTypeAnnotation':
return wrapCxxOptional('double', isRequired);
case 'Int32TypeAnnotation':
@@ -185,8 +183,6 @@ function toObjCValue(
return value;
case 'NumberTypeAnnotation':
return wrapPrimitive('double');
case 'NumberLiteralTypeAnnotation':
return wrapPrimitive('double');
case 'FloatTypeAnnotation':
return wrapPrimitive('double');
case 'Int32TypeAnnotation':
@@ -91,8 +91,6 @@ function toObjCType(
return 'NSString *';
case 'NumberTypeAnnotation':
return wrapCxxOptional('double', isRequired);
case 'NumberLiteralTypeAnnotation':
return wrapCxxOptional('double', isRequired);
case 'FloatTypeAnnotation':
return wrapCxxOptional('double', isRequired);
case 'Int32TypeAnnotation':
@@ -175,8 +173,6 @@ function toObjCValue(
return RCTBridgingTo('String');
case 'NumberTypeAnnotation':
return RCTBridgingTo('Double');
case 'NumberLiteralTypeAnnotation':
return RCTBridgingTo('Double');
case 'FloatTypeAnnotation':
return RCTBridgingTo('Double');
case 'Int32TypeAnnotation':
@@ -25,7 +25,6 @@ function getEventEmitterTypeObjCType(
case 'StringLiteralUnionTypeAnnotation':
return 'NSString *_Nonnull';
case 'NumberTypeAnnotation':
case 'NumberLiteralTypeAnnotation':
return 'NSNumber *_Nonnull';
case 'BooleanTypeAnnotation':
return 'BOOL';
@@ -263,8 +263,6 @@ function getParamObjCType(
return notStruct(wrapOptional('NSString *', !nullable));
case 'NumberTypeAnnotation':
return notStruct(isRequired ? 'double' : 'NSNumber *');
case 'NumberLiteralTypeAnnotation':
return notStruct(isRequired ? 'double' : 'NSNumber *');
case 'FloatTypeAnnotation':
return notStruct(isRequired ? 'float' : 'NSNumber *');
case 'DoubleTypeAnnotation':
@@ -346,8 +344,6 @@ function getReturnObjCType(
return wrapOptional('NSString *', isRequired);
case 'NumberTypeAnnotation':
return wrapOptional('NSNumber *', isRequired);
case 'NumberLiteralTypeAnnotation':
return wrapOptional('NSNumber *', isRequired);
case 'FloatTypeAnnotation':
return wrapOptional('NSNumber *', isRequired);
case 'DoubleTypeAnnotation':
@@ -418,8 +414,6 @@ function getReturnJSType(
return 'StringKind';
case 'NumberTypeAnnotation':
return 'NumberKind';
case 'NumberLiteralTypeAnnotation':
return 'NumberKind';
case 'FloatTypeAnnotation':
return 'NumberKind';
case 'DoubleTypeAnnotation':
@@ -126,7 +126,6 @@ import * as TurboModuleRegistry from '../TurboModuleRegistry';
export interface Spec extends TurboModule {
+passBool?: (arg: boolean) => void;
+passNumber: (arg: number) => void;
+passNumberLiteral: (arg: 4) => void;
+passString: (arg: string) => void;
+passStringish: (arg: Stringish) => void;
+passStringLiteral: (arg: 'A String Literal') => void;
@@ -978,26 +978,6 @@ exports[`RN Codegen Flow Parser can generate fixture NATIVE_MODULE_WITH_BASIC_PA
]
}
},
{
'name': 'passNumberLiteral',
'optional': false,
'typeAnnotation': {
'type': 'FunctionTypeAnnotation',
'returnTypeAnnotation': {
'type': 'VoidTypeAnnotation'
},
'params': [
{
'name': 'arg',
'optional': false,
'typeAnnotation': {
'type': 'NumberLiteralTypeAnnotation',
'value': 4
}
}
]
}
},
{
'name': 'passString',
'optional': false,
@@ -38,7 +38,6 @@ const {
emitCommonTypes,
emitDictionary,
emitFunction,
emitNumberLiteral,
emitPromise,
emitRootTag,
emitUnion,
@@ -244,9 +243,6 @@ function translateTypeAnnotation(
case 'UnionTypeAnnotation': {
return emitUnion(nullable, hasteModuleName, typeAnnotation, parser);
}
case 'NumberLiteralTypeAnnotation': {
return emitNumberLiteral(nullable, typeAnnotation.value);
}
case 'StringLiteralTypeAnnotation': {
return wrapNullable(nullable, {
type: 'StringLiteralTypeAnnotation',
+2 -4
View File
@@ -15,7 +15,7 @@ import type {
NamedShape,
NativeModuleAliasMap,
NativeModuleEnumMap,
NativeModuleEnumMember,
NativeModuleEnumMembers,
NativeModuleEnumMemberType,
NativeModuleParamTypeAnnotation,
Nullable,
@@ -227,9 +227,7 @@ class FlowParser implements Parser {
});
}
parseEnumMembers(
typeAnnotation: $FlowFixMe,
): $ReadOnlyArray<NativeModuleEnumMember> {
parseEnumMembers(typeAnnotation: $FlowFixMe): NativeModuleEnumMembers {
return typeAnnotation.members.map(member => ({
name: member.id.name,
value: member.init?.value ?? member.id.name,
+2 -4
View File
@@ -15,7 +15,7 @@ import type {
NamedShape,
NativeModuleAliasMap,
NativeModuleEnumMap,
NativeModuleEnumMember,
NativeModuleEnumMembers,
NativeModuleEnumMemberType,
NativeModuleParamTypeAnnotation,
Nullable,
@@ -240,9 +240,7 @@ export interface Parser {
/**
* Calculates enum's members
*/
parseEnumMembers(
typeAnnotation: $FlowFixMe,
): $ReadOnlyArray<NativeModuleEnumMember>;
parseEnumMembers(typeAnnotation: $FlowFixMe): NativeModuleEnumMembers;
/**
* Given a node, it returns true if it is a module interface
+2 -4
View File
@@ -15,7 +15,7 @@ import type {
NamedShape,
NativeModuleAliasMap,
NativeModuleEnumMap,
NativeModuleEnumMember,
NativeModuleEnumMembers,
NativeModuleEnumMemberType,
NativeModuleParamTypeAnnotation,
Nullable,
@@ -168,9 +168,7 @@ export class MockedParser implements Parser {
return;
}
parseEnumMembers(
typeAnnotation: $FlowFixMe,
): $ReadOnlyArray<NativeModuleEnumMember> {
parseEnumMembers(typeAnnotation: $FlowFixMe): NativeModuleEnumMembers {
return typeAnnotation.type === 'StringTypeAnnotation'
? [
{
@@ -31,7 +31,6 @@ import type {
NativeModuleTypeAnnotation,
NativeModuleUnionTypeAnnotation,
Nullable,
NumberLiteralTypeAnnotation,
ObjectTypeAnnotation,
ReservedTypeAnnotation,
StringLiteralTypeAnnotation,
@@ -171,16 +170,6 @@ function emitMixed(
});
}
function emitNumberLiteral(
nullable: boolean,
value: number,
): Nullable<NumberLiteralTypeAnnotation> {
return wrapNullable(nullable, {
type: 'NumberLiteralTypeAnnotation',
value,
});
}
function emitString(nullable: boolean): Nullable<StringTypeAnnotation> {
return wrapNullable(nullable, {
type: 'StringTypeAnnotation',
@@ -773,7 +762,6 @@ module.exports = {
emitInt32Prop,
emitMixedProp,
emitNumber,
emitNumberLiteral,
emitGenericObject,
emitDictionary,
emitObject,
@@ -113,7 +113,6 @@ import * as TurboModuleRegistry from '../TurboModuleRegistry';
export interface Spec extends TurboModule {
readonly passBool?: (arg: boolean) => void;
readonly passNumber: (arg: number) => void;
readonly passNumberLiteral: (arg: 4) => void;
readonly passString: (arg: string) => void;
readonly passStringish: (arg: Stringish) => void;
readonly passStringLiteral: (arg: 'A String Literal') => void;
@@ -1123,26 +1123,6 @@ exports[`RN Codegen TypeScript Parser can generate fixture NATIVE_MODULE_WITH_BA
]
}
},
{
'name': 'passNumberLiteral',
'optional': false,
'typeAnnotation': {
'type': 'FunctionTypeAnnotation',
'returnTypeAnnotation': {
'type': 'VoidTypeAnnotation'
},
'params': [
{
'name': 'arg',
'optional': false,
'typeAnnotation': {
'type': 'NumberLiteralTypeAnnotation',
'value': 4
}
}
]
}
},
{
'name': 'passString',
'optional': false,
@@ -37,7 +37,6 @@ const {
emitCommonTypes,
emitDictionary,
emitFunction,
emitNumberLiteral,
emitPromise,
emitRootTag,
emitStringLiteral,
@@ -404,9 +403,6 @@ function translateTypeAnnotation(
case 'StringLiteral': {
return emitStringLiteral(nullable, literal.value);
}
case 'NumericLiteral': {
return emitNumberLiteral(nullable, literal.value);
}
default: {
throw new UnsupportedTypeAnnotationParserError(
hasteModuleName,
@@ -15,7 +15,7 @@ import type {
NamedShape,
NativeModuleAliasMap,
NativeModuleEnumMap,
NativeModuleEnumMember,
NativeModuleEnumMembers,
NativeModuleEnumMemberType,
NativeModuleParamTypeAnnotation,
Nullable,
@@ -223,9 +223,7 @@ class TypeScriptParser implements Parser {
});
}
parseEnumMembers(
typeAnnotation: $FlowFixMe,
): $ReadOnlyArray<NativeModuleEnumMember> {
parseEnumMembers(typeAnnotation: $FlowFixMe): NativeModuleEnumMembers {
return typeAnnotation.members.map(member => ({
name: member.id.name,
value: member.initializer?.value ?? member.id.name,
@@ -16,5 +16,5 @@ import * as React from 'react';
export default (createAnimatedComponent(FlatList): AnimatedComponentType<
React.ElementConfig<typeof FlatList>,
FlatList<mixed>,
React.ElementRef<typeof FlatList>,
>);
@@ -8,9 +8,7 @@
#import <React/RCTBridgeDelegate.h>
#import <React/RCTConvert.h>
#import <UIKit/UIKit.h>
#import "RCTArchConfiguratorProtocol.h"
#import "RCTRootViewFactory.h"
#import "RCTUIConfiguratorProtocol.h"
@class RCTBridge;
@protocol RCTBridgeDelegate;
@@ -57,12 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
(const facebook::react::ObjCTurboModule::InitParams &)params
* - (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
*/
@interface RCTAppDelegate : UIResponder <
UIApplicationDelegate,
UISceneDelegate,
RCTBridgeDelegate,
RCTUIConfiguratorProtocol,
RCTArchConfiguratorProtocol>
@interface RCTAppDelegate : UIResponder <UIApplicationDelegate, UISceneDelegate, RCTBridgeDelegate>
/// The window object, used to render the UViewControllers
@property (nonatomic, strong, nonnull) UIWindow *window;
@@ -103,6 +96,48 @@ NS_ASSUME_NONNULL_BEGIN
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
moduleName:(NSString *)moduleName
initProps:(NSDictionary *)initProps;
/**
* This method can be used to customize the rootView that is passed to React Native.
* A typical example is to override this method in the AppDelegate to change the background color.
* To achieve this, add in your `AppDelegate.mm`:
* ```
* - (void)customizeRootView:(RCTRootView *)rootView
* {
* rootView.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor *(UITraitCollection *traitCollection) {
* if ([traitCollection userInterfaceStyle] == UIUserInterfaceStyleDark) {
* return [UIColor blackColor];
* } else {
* return [UIColor whiteColor];
* }
* }];
* }
* ```
*
* @parameter: rootView - The root view to customize.
*/
- (void)customizeRootView:(RCTRootView *)rootView;
/**
* It creates the RootViewController.
* By default, it creates a new instance of a `UIViewController`.
* You can override it to provide your own initial ViewController.
*
* @return: an instance of `UIViewController`.
*/
- (UIViewController *)createRootViewController;
/**
* It assigns the rootView to the rootViewController
* By default, it assigns the rootView to the view property of the rootViewController
* If you are not using a simple UIViewController, then there could be other methods to use to setup the rootView.
* For example: UISplitViewController requires `setViewController(_:for:)`
*/
- (void)setRootView:(UIView *)rootView toRootViewController:(UIViewController *)rootViewController;
/**
* The default `RCTColorSpace` for the app. It defaults to `RCTColorSpaceSRGB`.
*/
@property (nonatomic, readonly) RCTColorSpace defaultColorSpace;
/// This method returns a map of Component Descriptors and Components classes that needs to be registered in the
/// new renderer. The Component Descriptor is a string which represent the name used in JS to refer to the native
@@ -112,6 +147,27 @@ NS_ASSUME_NONNULL_BEGIN
/// @return a dictionary that associate a component for the new renderer with his descriptor.
- (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
/// This method controls whether the `turboModules` feature of the New Architecture is turned on or off.
///
/// @note: This is required to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the Turbo Native Module are enabled. Otherwise, it returns `false`.
- (BOOL)turboModuleEnabled __attribute__((deprecated("Use newArchEnabled instead")));
/// This method controls whether the App will use the Fabric renderer of the New Architecture or not.
///
/// @return: `true` if the Fabric Renderer is enabled. Otherwise, it returns `false`.
- (BOOL)fabricEnabled __attribute__((deprecated("Use newArchEnabled instead")));
/// This method controls whether React Native's new initialization layer is enabled.
///
/// @return: `true` if the new initialization layer is enabled. Otherwise returns `false`.
- (BOOL)bridgelessEnabled __attribute__((deprecated("Use newArchEnabled instead")));
/// This method controls whether React Native uses new Architecture.
///
/// @return: `true` if the new architecture is enabled. Otherwise returns `false`.
- (BOOL)newArchEnabled;
/// Return the bundle URL for the main bundle.
- (NSURL *__nullable)bundleURL;
@@ -34,8 +34,6 @@
#endif
#import <react/nativemodule/defaults/DefaultTurboModules.h>
using namespace facebook::react;
@interface RCTAppDelegate () <RCTComponentViewFactoryComponentProvider, RCTHostDelegate>
@end
@@ -181,6 +179,18 @@ using namespace facebook::react;
{
}
- (void)host:(RCTHost *)host
didReceiveJSErrorStack:(NSArray<NSDictionary<NSString *, id> *> *)stack
message:(NSString *)message
originalMessage:(NSString *_Nullable)originalMessage
name:(NSString *_Nullable)name
componentStack:(NSString *_Nullable)componentStack
exceptionId:(NSUInteger)exceptionId
isFatal:(BOOL)isFatal
extraData:(NSDictionary<NSString *, id> *)extraData
{
}
#pragma mark - Bridge and Bridge Adapter properties
- (RCTBridge *)bridge
@@ -214,14 +224,15 @@ using namespace facebook::react;
#endif
}
- (std::shared_ptr<TurboModule>)getTurboModule:(const std::string &)name
jsInvoker:(std::shared_ptr<CallInvoker>)jsInvoker
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
{
return DefaultTurboModules::getTurboModule(name, jsInvoker);
return facebook::react::DefaultTurboModules::getTurboModule(name, jsInvoker);
}
- (std::shared_ptr<TurboModule>)getTurboModule:(const std::string &)name
initParams:(const ObjCTurboModule::InitParams &)params
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
initParams:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
return nullptr;
}
@@ -295,7 +306,7 @@ using namespace facebook::react;
#pragma mark - Feature Flags
class RCTAppDelegateBridgelessFeatureFlags : public ReactNativeFeatureFlagsDefaults {
class RCTAppDelegateBridgelessFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults {
public:
bool enableBridgelessArchitecture() override
{
@@ -309,16 +320,12 @@ class RCTAppDelegateBridgelessFeatureFlags : public ReactNativeFeatureFlagsDefau
{
return true;
}
bool useNativeViewConfigsInBridgelessMode() override
{
return true;
}
};
- (void)_setUpFeatureFlags
{
if ([self bridgelessEnabled]) {
ReactNativeFeatureFlags::override(std::make_unique<RCTAppDelegateBridgelessFeatureFlags>());
facebook::react::ReactNativeFeatureFlags::override(std::make_unique<RCTAppDelegateBridgelessFeatureFlags>());
}
}
@@ -53,9 +53,7 @@ RCTAppSetupDefaultRootView(RCTBridge *bridge, NSString *moduleName, NSDictionary
id<RCTSurfaceProtocol> surface = [[RCTFabricSurface alloc] initWithBridge:bridge
moduleName:moduleName
initialProperties:initialProperties];
UIView *rootView = [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
[surface start];
return rootView;
return [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
}
return [[RCTRootView alloc] initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
}
@@ -1,32 +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.
*/
#import <React/RCTConvert.h>
#import <UIKit/UIKit.h>
@protocol RCTArchConfiguratorProtocol
/// This method controls whether the `turboModules` feature of the New Architecture is turned on or off.
///
/// @note: This is required to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the Turbo Native Module are enabled. Otherwise, it returns `false`.
- (BOOL)turboModuleEnabled __attribute__((deprecated("Use newArchEnabled instead")));
/// This method controls whether the App will use the Fabric renderer of the New Architecture or not.
///
/// @return: `true` if the Fabric Renderer is enabled. Otherwise, it returns `false`.
- (BOOL)fabricEnabled __attribute__((deprecated("Use newArchEnabled instead")));
/// This method controls whether React Native's new initialization layer is enabled.
///
/// @return: `true` if the new initialization layer is enabled. Otherwise returns `false`.
- (BOOL)bridgelessEnabled __attribute__((deprecated("Use newArchEnabled instead")));
/// This method controls whether React Native uses new Architecture.
///
/// @return: `true` if the new architecture is enabled. Otherwise returns `false`.
- (BOOL)newArchEnabled;
@end
@@ -161,9 +161,12 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
initialProperties:(NSDictionary *)initialProperties
launchOptions:(NSDictionary *)launchOptions
{
NSDictionary *initProps = updateInitialProps(initialProperties, _configuration.fabricEnabled);
NSDictionary *initProps = updateInitialProps(initialProperties, self->_configuration.fabricEnabled);
if (self->_configuration.bridgelessEnabled) {
// Enable native view config interop only if both bridgeless mode and Fabric is enabled.
RCTSetUseNativeViewConfigsInBridgelessMode(self->_configuration.fabricEnabled);
if (_configuration.bridgelessEnabled) {
// Enable TurboModule interop by default in Bridgeless mode
RCTEnableTurboModuleInterop(YES);
RCTEnableTurboModuleInteropBridgeProxy(YES);
@@ -172,8 +175,9 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
RCTFabricSurface *surface = [self.reactHost createSurfaceWithModuleName:moduleName initialProperties:initProps];
RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView =
[[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc]
initWithSurface:surface
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
surfaceHostingProxyRootView.backgroundColor = [UIColor systemBackgroundColor];
if (self->_configuration.customizeRootView != nil) {
@@ -186,8 +190,8 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
[self createBridgeAdapterIfNeeded];
UIView *rootView;
if (_configuration.createRootViewWithBridge != nil) {
rootView = _configuration.createRootViewWithBridge(self.bridge, moduleName, initProps);
if (self->_configuration.createRootViewWithBridge != nil) {
rootView = self->_configuration.createRootViewWithBridge(self.bridge, moduleName, initProps);
} else {
rootView = [self createRootViewWithBridge:self.bridge moduleName:moduleName initProps:initProps];
}
@@ -1,56 +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.
*/
#import <React/RCTConvert.h>
#import <UIKit/UIKit.h>
@class RCTRootView;
@protocol RCTUIConfiguratorProtocol
/**
* The default `RCTColorSpace` for the app. It defaults to `RCTColorSpaceSRGB`.
*/
- (RCTColorSpace)defaultColorSpace;
/**
* This method can be used to customize the rootView that is passed to React Native.
* A typical example is to override this method in the AppDelegate to change the background color.
* To achieve this, add in your `AppDelegate.mm`:
* ```
* - (void)customizeRootView:(RCTRootView *)rootView
* {
* rootView.backgroundColor = [UIColor colorWithDynamicProvider:^UIColor *(UITraitCollection *traitCollection) {
* if ([traitCollection userInterfaceStyle] == UIUserInterfaceStyleDark) {
* return [UIColor blackColor];
* } else {
* return [UIColor whiteColor];
* }
* }];
* }
* ```
*
* @parameter: rootView - The root view to customize.
*/
- (void)customizeRootView:(RCTRootView *)rootView;
/**
* It creates the RootViewController.
* By default, it creates a new instance of a `UIViewController`.
* You can override it to provide your own initial ViewController.
*
* @return: an instance of `UIViewController`.
*/
- (UIViewController *)createRootViewController;
/**
* It assigns the rootView to the rootViewController
* By default, it assigns the rootView to the view property of the rootViewController
* If you are not using a simple UIViewController, then there could be other methods to use to setup the rootView.
* For example: UISplitViewController requires `setViewController(_:for:)`
*/
- (void)setRootView:(UIView *)rootView toRootViewController:(UIViewController *)rootViewController;
@end
@@ -55,7 +55,6 @@ const EventNames: Map<
['highTextContrastChanged', 'highTextContrastDidChange'],
['screenReaderChanged', 'touchExplorationDidChange'],
['accessibilityServiceChanged', 'accessibilityServiceDidChange'],
['invertColorsChanged', 'invertColorDidChange'],
])
: new Map([
['announcementFinished', 'announcementFinished'],
@@ -139,13 +138,7 @@ const AccessibilityInfo = {
*/
isInvertColorsEnabled(): Promise<boolean> {
if (Platform.OS === 'android') {
return new Promise((resolve, reject) => {
if (NativeAccessibilityInfoAndroid?.isInvertColorsEnabled != null) {
NativeAccessibilityInfoAndroid.isInvertColorsEnabled(resolve);
} else {
reject(null);
}
});
return Promise.resolve(false);
} else {
return new Promise((resolve, reject) => {
if (NativeAccessibilityManagerIOS != null) {
+11 -25
View File
@@ -142,11 +142,7 @@ let inExceptionHandler = false;
*/
function handleException(e: mixed, isFatal: boolean) {
// TODO(T196834299): We should really use a c++ turbomodule for this
const reportToConsole = true;
if (
!global.RN$handleException ||
!global.RN$handleException(e, isFatal, reportToConsole)
) {
if (!global.RN$handleException || !global.RN$handleException(e, isFatal)) {
let error: Error;
if (e instanceof Error) {
error = e;
@@ -162,7 +158,7 @@ function handleException(e: mixed, isFatal: boolean) {
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
* parameters */
// $FlowFixMe[incompatible-call]
reportException(error, isFatal, reportToConsole);
reportException(error, isFatal, /*reportToConsole*/ true);
} finally {
inExceptionHandler = false;
}
@@ -177,10 +173,7 @@ function reactConsoleErrorHandler(...args) {
if (!console.reportErrorsAsExceptions) {
return;
}
if (
inExceptionHandler ||
(global.RN$inExceptionHandler && global.RN$inExceptionHandler())
) {
if (inExceptionHandler) {
// The fundamental trick here is that are multiple entry point to logging errors:
// (see D19743075 for more background)
//
@@ -234,21 +227,14 @@ function reactConsoleErrorHandler(...args) {
error.name = 'console.error';
}
const isFatal = false;
const reportToConsole = false;
if (
!global.RN$handleException ||
!global.RN$handleException(error, isFatal, reportToConsole)
) {
reportException(
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
* parameters */
// $FlowFixMe[incompatible-call]
error,
isFatal,
reportToConsole,
);
}
reportException(
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
* parameters */
// $FlowFixMe[incompatible-call]
error,
false, // isFatal
false, // reportToConsole
);
}
/**
+29 -18
View File
@@ -60,28 +60,18 @@ export interface ImagePropsIOS {
interface ImagePropsAndroid {
/**
* The mechanism that should be used to resize the image when the image's dimensions
* differ from the image view's dimensions. Defaults to `auto`.
* differ from the image view's dimensions. Defaults to auto.
*
* - `auto`: Use heuristics to pick between `resize` and `scale`.
* 'auto': Use heuristics to pick between resize and scale.
*
* - `resize`: A software operation which changes the encoded image in memory before it
* gets decoded. This should be used instead of `scale` when the image is much larger
* than the view.
* 'resize': A software operation which changes the encoded image in memory before it gets decoded.
* This should be used instead of scale when the image is much larger than the view.
*
* - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is
* faster (usually hardware accelerated) and produces higher quality images. This
* should be used if the image is smaller than the view. It should also be used if the
* image is slightly bigger than the view.
*
* - `none`: No sampling is performed and the image is displayed in its full resolution. This
* should only be used in rare circumstances because it is considered unsafe as Android will
* throw a runtime exception when trying to render images that consume too much memory.
*
* More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
*
* @platform android
* 'scale': The image gets drawn downscaled or upscaled. Compared to resize, scale is faster (usually hardware accelerated)
* and produces higher quality images. This should be used if the image is smaller than the view.
* It should also be used if the image is slightly bigger than the view.
*/
resizeMethod?: 'auto' | 'resize' | 'scale' | 'none' | undefined;
resizeMethod?: 'auto' | 'resize' | 'scale' | undefined;
/**
* Duration of fade in animation in ms. Defaults to 300
@@ -203,6 +193,27 @@ export interface ImagePropsBase
*/
resizeMode?: ImageResizeMode | undefined;
/**
* The mechanism that should be used to resize the image when the image's dimensions
* differ from the image view's dimensions. Defaults to `auto`.
*
* - `auto`: Use heuristics to pick between `resize` and `scale`.
*
* - `resize`: A software operation which changes the encoded image in memory before it
* gets decoded. This should be used instead of `scale` when the image is much larger
* than the view.
*
* - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is
* faster (usually hardware accelerated) and produces higher quality images. This
* should be used if the image is smaller than the view. It should also be used if the
* image is slightly bigger than the view.
*
* More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html.
*
* @platform android
*/
resizeMethod?: 'auto' | 'resize' | 'scale' | undefined;
/**
* The image source (either a remote URL or a local file resource).
*
+1 -1
View File
@@ -51,7 +51,7 @@ export interface ImageURISource {
* to a URL load request, no attempt is made to load the data from the originating source,
* and the load is considered to have failed.
*
* @platform ios (for `force-cache`)
* @platform ios
*/
cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached' | undefined;
/**
+1 -1
View File
@@ -66,7 +66,7 @@ export interface ImageURISource {
* to a URL load request, no attempt is made to load the data from the originating source,
* and the load is considered to have failed.
*
* @platform ios (for `force-cache`)
* @platform ios
*/
+cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached');
@@ -477,10 +477,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image, CGSize size, CGFloat scal
// Add missing png extension
if (request.URL.fileURL && request.URL.pathExtension.length == 0) {
NSURL *pngRequestURL = [request.URL URLByAppendingPathExtension:@"png"];
if ([[NSFileManager defaultManager] fileExistsAtPath:pngRequestURL.path]) {
mutableRequest.URL = pngRequestURL;
}
mutableRequest.URL = [request.URL URLByAppendingPathExtension:@"png"];
}
if (_redirectDelegate != nil) {
mutableRequest.URL = [_redirectDelegate redirectAssetsURL:mutableRequest.URL];
+2 -2
View File
@@ -480,10 +480,10 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
this._checkProps(this.props);
}
_listRef: ?VirtualizedList;
_listRef: ?React.ElementRef<typeof VirtualizedList>;
_virtualizedListPairs: Array<ViewabilityConfigCallbackPair> = [];
_captureRef = (ref: ?VirtualizedList) => {
_captureRef = (ref: ?React.ElementRef<typeof VirtualizedList>) => {
this._listRef = ref;
};
+17 -26
View File
@@ -37,8 +37,6 @@ const COLORS = {
'ansi-bright-white': 'rgb(247, 247, 247)',
};
const LRM = '\u200E'; // Left-to-Right Mark
export default function Ansi({
text,
style,
@@ -82,28 +80,25 @@ export default function Ansi({
};
return (
<View style={styles.container}>
<View>
{parsedLines.map((items, i) => (
<View style={styles.line} key={i}>
<Text>
{LRM}
{items.map((bundle, key) => {
const textStyle =
bundle.fg && COLORS[bundle.fg]
? {
backgroundColor: bundle.bg && COLORS[bundle.bg],
color: bundle.fg && COLORS[bundle.fg],
}
: {
backgroundColor: bundle.bg && COLORS[bundle.bg],
};
return (
<Text style={[style, textStyle]} key={key}>
{getText(bundle.content, key)}
</Text>
);
})}
</Text>
{items.map((bundle, key) => {
const textStyle =
bundle.fg && COLORS[bundle.fg]
? {
backgroundColor: bundle.bg && COLORS[bundle.bg],
color: bundle.fg && COLORS[bundle.fg],
}
: {
backgroundColor: bundle.bg && COLORS[bundle.bg],
};
return (
<Text style={[style, textStyle]} key={key}>
{getText(bundle.content, key)}
</Text>
);
})}
</View>
))}
</View>
@@ -111,10 +106,6 @@ export default function Ansi({
}
const styles = StyleSheet.create({
container: {
minWidth: '100%',
direction: 'ltr',
},
line: {
flexDirection: 'row',
},
@@ -59,9 +59,7 @@ function LogBoxInspectorCodeFrame(props: Props): React.Node {
<LogBoxInspectorSection heading="Source" action={<AppInfo />}>
<View style={styles.box}>
<View style={styles.frame}>
<ScrollView
horizontal
contentContainerStyle={styles.contentContainer}>
<ScrollView horizontal>
<AnsiHighlight style={styles.content} text={codeFrame.content} />
</ScrollView>
</View>
@@ -140,9 +138,6 @@ const styles = StyleSheet.create({
paddingTop: 10,
paddingBottom: 10,
},
contentContainer: {
minWidth: '100%',
},
content: {
color: LogBoxStyle.getTextColor(1),
fontSize: 12,
@@ -26,11 +26,6 @@ exports[`LogBoxInspectorCodeFrame should render a code frame 1`] = `
}
>
<ScrollView
contentContainerStyle={
Object {
"minWidth": "100%",
}
}
horizontal={true}
>
<Ansi
@@ -113,11 +108,6 @@ exports[`LogBoxInspectorCodeFrame should render a code frame without a location
}
>
<ScrollView
contentContainerStyle={
Object {
"minWidth": "100%",
}
}
horizontal={true}
>
<Ansi
@@ -80,7 +80,7 @@ describe('LogBox', () => {
expect(mockWarn).not.toBeCalled();
expect(console.error).toBeCalledTimes(1);
expect(console.error.mock.calls[0]).toEqual([
'Warning: Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.%s',
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.%s',
'\n\nCheck the render method of `DoesNotUseKey`.',
'',
expect.stringMatching('at DoesNotUseKey'),
@@ -94,7 +94,7 @@ describe('LogBox', () => {
componentStackType: 'stack',
message: {
content:
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://reactjs.org/link/warning-keys for more information.',
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://react.dev/link/warning-keys for more information.',
substitutions: [
{length: 45, offset: 62},
{length: 0, offset: 107},
@@ -106,7 +106,7 @@ describe('LogBox', () => {
// We also interpolate the string before passing to the underlying console method.
expect(mockError.mock.calls[0]).toEqual([
expect.stringMatching(
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://reactjs.org/link/warning-keys for more information.\n at ',
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://react.dev/link/warning-keys for more information.\n at ',
),
]);
});
@@ -134,7 +134,7 @@ describe('LogBox', () => {
expect(mockWarn).not.toBeCalled();
expect(console.error).toBeCalledTimes(1);
expect(console.error.mock.calls[0]).toEqual([
'Warning: Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.%s',
'Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.%s',
'invalid',
expect.stringMatching('at FragmentWithProp'),
]);
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -36,7 +36,6 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
{
if (![self isDescendantOfView:scrollView]) {
// View is outside scroll view
scrollView.firstResponderViewOutsideScrollView = self.backedTextInputView;
return;
}
@@ -683,7 +683,7 @@ exports[`public API should not change unintentionally Libraries/Animated/bezier.
exports[`public API should not change unintentionally Libraries/Animated/components/AnimatedFlatList.js 1`] = `
"declare export default AnimatedComponentType<
React.ElementConfig<typeof FlatList>,
FlatList<mixed>,
React.ElementRef<typeof FlatList>,
>;
"
`;
@@ -5725,7 +5725,7 @@ declare class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
setNativeProps(props: { [string]: mixed, ... }): void;
constructor(props: Props<ItemT>): void;
componentDidUpdate(prevProps: Props<ItemT>): void;
_listRef: ?VirtualizedList;
_listRef: ?React.ElementRef<typeof VirtualizedList>;
_virtualizedListPairs: Array<ViewabilityConfigCallbackPair>;
_captureRef: $FlowFixMe;
_checkProps(props: Props<ItemT>): void;
@@ -18,9 +18,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface RCTBridgeProxy : NSProxy
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
bundleManager:(RCTBundleManager *)bundleManager
@@ -41,8 +41,6 @@ using namespace facebook;
void *_runtime;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
bundleManager:(RCTBundleManager *)bundleManager
@@ -63,10 +61,8 @@ using namespace facebook;
_runtime = runtime;
_launchOptions = [launchOptions copy];
}
return self;
}
#pragma clang diagnostic pop
- (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue
{
@@ -418,10 +414,6 @@ using namespace facebook;
RCTViewRegistry *_viewRegistry;
NSMutableDictionary<NSNumber *, UIView *> *_legacyViewRegistry;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
{
self = [super self];
@@ -432,8 +424,6 @@ using namespace facebook;
return self;
}
#pragma clang diagnostic pop
/**
* RCTViewRegistry
*/
@@ -11,11 +11,6 @@
std::shared_ptr<facebook::react::CallInvoker> _callInvoker;
}
- (instancetype)init
{
return [self initWithCallInvoker:nullptr];
}
- (instancetype)initWithCallInvoker:(std::shared_ptr<facebook::react::CallInvoker>)callInvoker
{
if (self = [super init]) {
@@ -50,3 +50,15 @@ RCT_EXTERN NSString *const RCTDidInitializeModuleNotification;
*/
RCT_EXTERN BOOL RCTGetDispatchW3CPointerEvents(void);
RCT_EXTERN void RCTSetDispatchW3CPointerEvents(BOOL value);
/*
* Memory Pressure Unloading Level
*/
RCT_EXTERN int RCTGetMemoryPressureUnloadLevel(void);
RCT_EXTERN void RCTSetMemoryPressureUnloadLevel(int value);
/*
* Use native view configs in bridgeless mode
*/
RCT_EXTERN BOOL RCTGetUseNativeViewConfigsInBridgelessMode(void);
RCT_EXTERN void RCTSetUseNativeViewConfigsInBridgelessMode(BOOL value);
@@ -38,3 +38,34 @@ void RCTSetDispatchW3CPointerEvents(BOOL value)
{
RCTDispatchW3CPointerEvents = value;
}
/*
* Memory Pressure Unloading Level for experimentation only.
* Default is 15, which is TRIM_MEMORY_RUNNING_CRITICAL.
*/
static int RCTMemoryPressureUnloadLevel = 15;
int RCTGetMemoryPressureUnloadLevel(void)
{
return RCTMemoryPressureUnloadLevel;
}
void RCTSetMemoryPressureUnloadLevel(int value)
{
RCTMemoryPressureUnloadLevel = value;
}
/*
* Use native view configs in bridgeless mode
*/
static BOOL RCTUseNativeViewConfigsInBridgelessMode = NO;
BOOL RCTGetUseNativeViewConfigsInBridgelessMode(void)
{
return RCTUseNativeViewConfigsInBridgelessMode;
}
void RCTSetUseNativeViewConfigsInBridgelessMode(BOOL value)
{
RCTUseNativeViewConfigsInBridgelessMode = value;
}
@@ -34,7 +34,7 @@ typedef id<RCTBridgeModule> (^RCTBridgeModuleProvider)(void);
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED
bundleManager:(RCTBundleManager *)bundleManager
callableJSModules:(RCTCallableJSModules *)callableJSModules NS_DESIGNATED_INITIALIZER;
callableJSModules:(RCTCallableJSModules *)callableJSModules;
- (instancetype)initWithModuleInstance:(id<RCTBridgeModule>)instance
bridge:(RCTBridge *)bridge
@@ -53,21 +53,8 @@ int32_t getUniqueId()
@synthesize instance = _instance;
@synthesize methodQueue = _methodQueue;
- (void)_setUpWithBridge:(RCTBridge *)bridge
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED
bundleManager:(RCTBundleManager *)bundleManager
callableJSModules:(RCTCallableJSModules *)callableJSModules
- (void)setUp
{
// start with the ivars
{
_bridge = bridge;
_moduleRegistry = moduleRegistry;
_viewRegistry_DEPRECATED = viewRegistry_DEPRECATED;
_bundleManager = bundleManager;
_callableJSModules = callableJSModules;
}
_implementsBatchDidComplete = [_moduleClass instancesRespondToSelector:@selector(batchDidComplete)];
// If a module overrides `constantsToExport` and doesn't implement `requiresMainQueueSetup`, then we must assume
@@ -99,17 +86,35 @@ int32_t getUniqueId()
viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED
bundleManager:(RCTBundleManager *)bundleManager
callableJSModules:(RCTCallableJSModules *)callableJSModules
{
return [self _initWithModuleClass:moduleClass
moduleProvider:^id<RCTBridgeModule> {
return [moduleClass new];
}
bridge:bridge
moduleRegistry:moduleRegistry
viewRegistry_DEPRECATED:viewRegistry_DEPRECATED
bundleManager:bundleManager
callableJSModules:callableJSModules];
}
- (instancetype)_initWithModuleClass:(Class)moduleClass
moduleProvider:(RCTBridgeModuleProvider)moduleProvider
bridge:(RCTBridge *)bridge
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED
bundleManager:(RCTBundleManager *)bundleManager
callableJSModules:(RCTCallableJSModules *)callableJSModules
{
if (self = [super init]) {
_bridge = bridge;
_moduleClass = moduleClass;
_moduleProvider = [^id<RCTBridgeModule> {
return [moduleClass new];
} copy];
[self _setUpWithBridge:bridge
moduleRegistry:moduleRegistry
viewRegistry_DEPRECATED:viewRegistry_DEPRECATED
bundleManager:bundleManager
callableJSModules:callableJSModules];
_moduleProvider = [moduleProvider copy];
_moduleRegistry = moduleRegistry;
_viewRegistry_DEPRECATED = viewRegistry_DEPRECATED;
_bundleManager = bundleManager;
_callableJSModules = callableJSModules;
[self setUp];
}
return self;
}
@@ -122,13 +127,14 @@ int32_t getUniqueId()
callableJSModules:(RCTCallableJSModules *)callableJSModules
{
if (self = [super init]) {
_bridge = bridge;
_instance = instance;
_moduleClass = [instance class];
[self _setUpWithBridge:bridge
moduleRegistry:moduleRegistry
viewRegistry_DEPRECATED:viewRegistry_DEPRECATED
bundleManager:bundleManager
callableJSModules:callableJSModules];
_moduleRegistry = moduleRegistry;
_viewRegistry_DEPRECATED = viewRegistry_DEPRECATED;
_bundleManager = bundleManager;
_callableJSModules = callableJSModules;
[self setUp];
}
return self;
}
@@ -239,10 +239,7 @@ NSString *RCTMD5Hash(NSString *string)
{
const char *str = string.UTF8String;
unsigned char result[CC_MD5_DIGEST_LENGTH];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CC_MD5(str, (CC_LONG)strlen(str), result);
#pragma clang diagnostic pop
return [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
result[0],
@@ -39,13 +39,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration;
@property (nonatomic, assign) CGSize minimumSize;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode NS_UNAVAILABLE;
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface NS_DESIGNATED_INITIALIZER;
- (void)cancelTouches;
@@ -53,8 +53,11 @@ static RCTRootViewSizeFlexibility convertToRootViewSizeFlexibility(RCTSurfaceSiz
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
{
return [super initWithSurface:surface
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
if (self = [super initWithSurface:surface
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact]) {
[surface start];
}
return self;
}
RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
@@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)reportJsException:(nullable NSString *)message
stack:(nullable NSArray<NSDictionary *> *)stack
exceptionId:(double)exceptionId
isFatal:(bool)isFatal __attribute__((deprecated));
isFatal:(bool)isFatal;
@property (nonatomic, weak) id<RCTExceptionsManagerDelegate> delegate;
@@ -371,8 +371,7 @@ struct RCTInstanceCallback : public InstanceCallback {
// in case if some other tread resets it.
auto reactInstance = _reactInstance;
if (reactInstance) {
// Memory Pressure Unloading Level 15 represents TRIM_MEMORY_RUNNING_CRITICAL.
int unloadLevel = 15;
int unloadLevel = RCTGetMemoryPressureUnloadLevel();
reactInstance->handleMemoryPressure(unloadLevel);
}
}
@@ -100,6 +100,13 @@ using namespace facebook::react;
const auto &imageRequest = _state->getData().getImageRequest();
auto &observerCoordinator = imageRequest.getObserverCoordinator();
observerCoordinator.removeObserver(_imageResponseObserverProxy);
// Cancelling image request because we are no longer observing it.
// This is not 100% correct place to do this because we may want to
// re-create RCTImageComponentView with the same image and if it
// was cancelled before downloaded, download is not resumed.
// This will only become issue if we decouple life cycle of a
// ShadowNode from ComponentView, which is not something we do now.
imageRequest.cancel();
}
_state = state;
@@ -38,9 +38,6 @@ NS_ASSUME_NONNULL_BEGIN
/** Focus area of newly-activated text input relative to the window to compare against UIKeyboardFrameBegin/End */
@property (nonatomic, assign) CGRect firstResponderFocus;
/** newly-activated text input outside of the scroll view */
@property (nonatomic, weak) UIView *firstResponderViewOutsideScrollView;
/*
* Returns the subview of the scroll view that the component uses to mount all subcomponents into. That's useful to
* separate component views from auxiliary views to be able to reliably implement pull-to-refresh- and RTL-related
@@ -182,7 +182,6 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
UIViewAnimationCurve curve =
(UIViewAnimationCurve)[notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] unsignedIntegerValue];
CGRect keyboardEndFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGRect keyboardBeginFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue];
CGPoint absoluteViewOrigin = [self convertPoint:self.bounds.origin toView:nil];
CGFloat scrollViewLowerY = isInverted ? absoluteViewOrigin.y : absoluteViewOrigin.y + self.bounds.size.height;
@@ -204,24 +203,21 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
from:self
forEvent:nil]) {
if (CGRectEqualToRect(_firstResponderFocus, CGRectNull)) {
UIView *inputAccessoryView = _firstResponderViewOutsideScrollView.inputAccessoryView;
if (inputAccessoryView) {
// Text input view is within the inputAccessoryView.
contentDiff = keyboardEndFrame.origin.y - keyboardBeginFrame.origin.y;
}
} else {
CGRect viewIntersection = CGRectIntersection(self.firstResponderFocus, keyboardEndFrame);
// Text input view is outside of the scroll view.
return;
}
if (CGRectIsNull(viewIntersection)) {
return;
}
CGRect viewIntersection = CGRectIntersection(self.firstResponderFocus, keyboardEndFrame);
// Inner text field focused
CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
if (focusEnd > keyboardEndFrame.origin.y) {
// Text field active region is below visible area with keyboard - update diff to bring into view
contentDiff = keyboardEndFrame.origin.y - focusEnd;
}
if (CGRectIsNull(viewIntersection)) {
return;
}
// Inner text field focused
CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
if (focusEnd > keyboardEndFrame.origin.y) {
// Text field active region is below visible area with keyboard - update diff to bring into view
contentDiff = keyboardEndFrame.origin.y - focusEnd;
}
}
@@ -126,7 +126,6 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
{
if (![self isDescendantOfView:scrollView.scrollView] || !_backedTextInputView.isFirstResponder) {
// View is outside scroll view or it's not a first responder.
scrollView.firstResponderViewOutsideScrollView = _backedTextInputView;
return;
}
@@ -114,6 +114,9 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
- (instancetype)initWithToolbox:(SchedulerToolbox)toolbox
{
if (self = [super init]) {
auto reactNativeConfig =
toolbox.contextContainer->at<std::shared_ptr<const ReactNativeConfig>>("ReactNativeConfig");
_delegateProxy = std::make_unique<SchedulerDelegateProxy>((__bridge void *)self);
if (ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS()) {
@@ -620,22 +620,22 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)act
if (eventEmitter != nil) {
switch (eventType) {
case RCTPointerEventTypeStart: {
eventEmitter->onPointerDown(std::move(pointerEvent));
eventEmitter->onPointerDown(pointerEvent);
break;
}
case RCTPointerEventTypeMove: {
eventEmitter->onPointerMove(std::move(pointerEvent));
eventEmitter->onPointerMove(pointerEvent);
break;
}
case RCTPointerEventTypeEnd: {
eventEmitter->onPointerUp(pointerEvent);
if (pointerEvent.isPrimary && pointerEvent.button == 0 && IsPointerWithinInitialTree(activePointer)) {
eventEmitter->onClick(std::move(pointerEvent));
eventEmitter->onClick(pointerEvent);
}
break;
}
case RCTPointerEventTypeCancel: {
eventEmitter->onPointerCancel(std::move(pointerEvent));
eventEmitter->onPointerCancel(pointerEvent);
break;
}
}
@@ -761,10 +761,10 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)act
if (eventEmitter != nil) {
switch (recognizer.state) {
case UIGestureRecognizerStateEnded:
eventEmitter->onPointerLeave(std::move(event));
eventEmitter->onPointerLeave(event);
break;
default:
eventEmitter->onPointerMove(std::move(event));
eventEmitter->onPointerMove(event);
break;
}
}
@@ -26,6 +26,7 @@
#import <React/RCTSurfaceView.h>
#import <React/RCTUtils.h>
#import <react/config/ReactNativeConfig.h>
#import <react/featureflags/ReactNativeFeatureFlags.h>
#import <react/renderer/componentregistry/ComponentDescriptorFactory.h>
#import <react/renderer/components/text/BaseTextProps.h>
@@ -225,6 +226,8 @@ using namespace facebook::react;
- (RCTScheduler *)_createScheduler
{
auto reactNativeConfig = _contextContainer->at<std::shared_ptr<const ReactNativeConfig>>("ReactNativeConfig");
auto componentRegistryFactory =
[factory = wrapManagedObject(_mountingManager.componentViewRegistry.componentViewFactory)](
const EventDispatcher::Weak &eventDispatcher, const ContextContainer::Shared &contextContainer) {
@@ -1,4 +1,3 @@
// @lint-ignore-every LICENSELINT
/*
* Copyright (c) 2015 Daniel Kirchner
*
@@ -28,6 +27,10 @@
NS_ASSUME_NONNULL_BEGIN
#ifdef __cplusplus
extern "C" {
#endif
/// magic constants :-)
static const uint64_t PRIME1 = 11400714785074694791ULL;
static const uint64_t PRIME2 = 14029467366897019727ULL;
@@ -103,18 +106,13 @@ NS_INLINE uint64_t h32bytes(const char *p, uint64_t len, const uint64_t seed)
return h32bytes_compute(p, len, seed + PRIME1 + PRIME2, seed + PRIME2, seed, seed - PRIME1);
}
/*
Primary APIs
*/
NS_INLINE uint64_t meta_xxhash64(const char *p, uint64_t len, uint64_t seed)
{
return finalize((len >= 32 ? h32bytes(p, len, seed) : seed + PRIME5) + len, p + (len & ~0x1FULL), len & 0x1FULL);
}
NS_INLINE uint64_t FBxxHash64(const char *p, uint64_t len, uint64_t seed)
{
return meta_xxhash64(p, len, seed);
return finalize((len >= 32 ? h32bytes(p, len, seed) : seed + PRIME5) + len, p + (len & ~0x1F), len & 0x1F);
}
#ifdef __cplusplus
}
#endif
NS_ASSUME_NONNULL_END
@@ -9,7 +9,6 @@
#import <AVFoundation/AVFoundation.h>
#import <React/RCTSurfacePresenterStub.h>
#import <react/featureflags/ReactNativeFeatureFlags.h>
#import "RCTAssert.h"
#import "RCTBridge+Private.h"
@@ -1155,10 +1154,10 @@ RCT_EXPORT_METHOD(dispatchViewManagerCommand
return;
}
__weak __typeof(self) weakSelf = self;
__weak typeof(self) weakSelf = self;
void (^mountingBlock)(void) = ^{
__typeof(self) strongSelf = weakSelf;
typeof(self) strongSelf = weakSelf;
@try {
for (RCTViewManagerUIBlock block in previousPendingUIBlocks) {
@@ -1439,7 +1438,7 @@ NSMutableDictionary<NSString *, id> *RCTModuleConstantsForDestructuredComponent(
// lazifyViewManagerConfig function in JS. This fuction uses NativeModules global object that is not available in the
// New Architecture. To make native view configs work in the New Architecture we will populate these properties in
// native.
if (facebook::react::ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode()) {
if (RCTGetUseNativeViewConfigsInBridgelessMode()) {
moduleConstants[@"Commands"] = viewConfig[@"Commands"];
moduleConstants[@"Constants"] = viewConfig[@"Constants"];
}
@@ -121,8 +121,8 @@ using namespace facebook::react;
auto &props = *sharedProps;
props.layoutConstraints = LayoutConstraints{{0, 0}, {500, 500}};
auto &yogaStyle = props.yogaStyle;
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(200));
return sharedProps;
})
.children({
@@ -136,8 +136,8 @@ using namespace facebook::react;
yogaStyle.setPositionType(yoga::PositionType::Absolute);
yogaStyle.setPosition(yoga::Edge::Left, yoga::StyleLength::points(0));
yogaStyle.setPosition(yoga::Edge::Top, yoga::StyleLength::points(0));
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(200));
return sharedProps;
})
.children({
@@ -216,8 +216,8 @@ using namespace facebook::react;
yogaStyle.setPositionType(yoga::PositionType::Absolute);
yogaStyle.setPosition(yoga::Edge::Left, yoga::StyleLength::points(0));
yogaStyle.setPosition(yoga::Edge::Top, yoga::StyleLength::points(30));
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(50));
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(50));
return sharedProps;
})
.children({
@@ -260,8 +260,8 @@ using namespace facebook::react;
yogaStyle.setPositionType(yoga::PositionType::Absolute);
yogaStyle.setPosition(yoga::Edge::Left, yoga::StyleLength::points(0));
yogaStyle.setPosition(yoga::Edge::Top, yoga::StyleLength::points(90));
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(50));
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(50));
return sharedProps;
})
.children({
@@ -418,8 +418,8 @@ static ParagraphShadowNode::ConcreteState::Shared stateWithShadowNode(
auto &props = *sharedProps;
props.layoutConstraints = LayoutConstraints{{0, 0}, {500, 500}};
auto &yogaStyle = props.yogaStyle;
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(200));
return sharedProps;
})
.children({
@@ -434,8 +434,8 @@ static ParagraphShadowNode::ConcreteState::Shared stateWithShadowNode(
yogaStyle.setPositionType(yoga::PositionType::Absolute);
yogaStyle.setPosition(yoga::Edge::Left, yoga::StyleLength::points(0));
yogaStyle.setPosition(yoga::Edge::Top, yoga::StyleLength::points(90));
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleSizeLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleSizeLength::points(20));
yogaStyle.setDimension(yoga::Dimension::Width, yoga::StyleLength::points(200));
yogaStyle.setDimension(yoga::Dimension::Height, yoga::StyleLength::points(20));
return sharedProps;
})
.children({
@@ -19,7 +19,7 @@ BOOL RCTBorderInsetsAreEqual(UIEdgeInsets borderInsets)
BOOL RCTCornerRadiiAreEqualAndSymmetrical(RCTCornerRadii cornerRadii)
{
return cornerRadii.topLeftHorizontal == cornerRadii.topLeftVertical &&
return cornerRadii.topLeftHorizontal == cornerRadii.topLeftHorizontal &&
cornerRadii.topRightHorizontal == cornerRadii.topRightVertical &&
cornerRadii.bottomLeftHorizontal == cornerRadii.bottomLeftVertical &&
cornerRadii.bottomRightHorizontal == cornerRadii.bottomRightVertical &&
@@ -8,7 +8,6 @@
#import "RCTComponentData.h"
#import <objc/message.h>
#import <react/featureflags/ReactNativeFeatureFlags.h>
#import "RCTBridge.h"
#import "RCTBridgeModule.h"
@@ -289,9 +288,9 @@ static RCTPropBlock createNSInvocationSetter(NSMethodSignature *typeSignature, S
case _value: { \
__block BOOL setDefaultValue = NO; \
__block _type defaultValue; \
_type (*convert)(id, SEL, id) = (__typeof(convert))objc_msgSend; \
_type (*get)(id, SEL) = (__typeof(get))objc_msgSend; \
void (*set)(id, SEL, _type) = (__typeof(set))objc_msgSend; \
_type (*convert)(id, SEL, id) = (typeof(convert))objc_msgSend; \
_type (*get)(id, SEL) = (typeof(get))objc_msgSend; \
void (*set)(id, SEL, _type) = (typeof(set))objc_msgSend; \
setterBlock = ^(id target, id json) { \
if (json) { \
if (!setDefaultValue && target) { \
@@ -523,7 +522,7 @@ static RCTPropBlock createNSInvocationSetter(NSMethodSignature *typeSignature, S
@"baseModuleName" : superClass == [NSObject class] ? (id)kCFNull : RCTViewManagerModuleNameForClass(superClass),
}];
if (facebook::react::ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode()) {
if (RCTGetUseNativeViewConfigsInBridgelessMode()) {
result[@"Commands"] = [self commandsForViewMangerClass:managerClass methods:methods methodCount:count];
result[@"Constants"] = [self constantsForViewMangerClass:managerClass];
}
@@ -87,9 +87,6 @@ CGFloat RCTCoreGraphicsFloatFromYogaValue(YGValue value, CGFloat baseFloatValue)
return RCTCoreGraphicsFloatFromYogaFloat(value.value) * baseFloatValue;
case YGUnitAuto:
case YGUnitUndefined:
case YGUnitMaxContent:
case YGUnitFitContent:
case YGUnitStretch:
return baseFloatValue;
}
}
@@ -63,9 +63,6 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
#define RCT_SET_YGVALUE(ygvalue, setter, ...) \
switch (ygvalue.unit) { \
case YGUnitAuto: \
case YGUnitMaxContent: \
case YGUnitFitContent: \
case YGUnitStretch: \
case YGUnitUndefined: \
setter(__VA_ARGS__, YGUndefined); \
break; \
@@ -91,35 +88,6 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
case YGUnitPercent: \
setter##Percent(__VA_ARGS__, ygvalue.value); \
break; \
case YGUnitMaxContent: \
case YGUnitFitContent: \
case YGUnitStretch: \
break; \
}
#define RCT_SET_YGVALUE_AUTO_INTRINSIC(ygvalue, setter, ...) \
switch (ygvalue.unit) { \
case YGUnitAuto: \
setter##Auto(__VA_ARGS__); \
break; \
case YGUnitMaxContent: \
setter##MaxContent(__VA_ARGS__); \
break; \
case YGUnitFitContent: \
setter##FitContent(__VA_ARGS__); \
break; \
case YGUnitStretch: \
setter##Stretch(__VA_ARGS__); \
break; \
case YGUnitUndefined: \
setter(__VA_ARGS__, YGUndefined); \
break; \
case YGUnitPoint: \
setter(__VA_ARGS__, ygvalue.value); \
break; \
case YGUnitPercent: \
setter##Percent(__VA_ARGS__, ygvalue.value); \
break; \
}
static void RCTProcessMetaPropsPadding(const YGValue metaProps[META_PROP_COUNT], YGNodeRef node)
@@ -515,14 +483,14 @@ RCT_BORDER_PROPERTY(Start, START)
RCT_BORDER_PROPERTY(End, END)
// Dimensions
#define RCT_DIMENSION_PROPERTY(setProp, getProp, cssProp) \
-(void)set##setProp : (YGValue)value \
{ \
RCT_SET_YGVALUE_AUTO_INTRINSIC(value, YGNodeStyleSet##cssProp, _yogaNode); \
} \
-(YGValue)getProp \
{ \
return YGNodeStyleGet##cssProp(_yogaNode); \
#define RCT_DIMENSION_PROPERTY(setProp, getProp, cssProp) \
-(void)set##setProp : (YGValue)value \
{ \
RCT_SET_YGVALUE_AUTO(value, YGNodeStyleSet##cssProp, _yogaNode); \
} \
-(YGValue)getProp \
{ \
return YGNodeStyleGet##cssProp(_yogaNode); \
}
#define RCT_MIN_MAX_DIMENSION_PROPERTY(setProp, getProp, cssProp) \
@@ -666,7 +634,7 @@ RCTShadowViewMeasure(YGNodeConstRef node, float width, YGMeasureMode widthMode,
- (void)setFlexBasis:(YGValue)value
{
RCT_SET_YGVALUE_AUTO_INTRINSIC(value, YGNodeStyleSetFlexBasis, _yogaNode);
RCT_SET_YGVALUE_AUTO(value, YGNodeStyleSetFlexBasis, _yogaNode);
}
- (YGValue)flexBasis
@@ -50,8 +50,6 @@
@property (nonatomic, assign) BOOL inverted;
/** Focus area of newly-activated text input relative to the window to compare against UIKeyboardFrameBegin/End */
@property (nonatomic, assign) CGRect firstResponderFocus;
/** newly-activated text input outside of the scroll view */
@property (nonatomic, weak) UIView *firstResponderViewOutsideScrollView;
// NOTE: currently these event props are only declared so we can export the
// event names to JS - we don't call the blocks directly because scroll events
@@ -338,12 +338,6 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
if (!didFocusExternalTextField && focusEnd > endFrame.origin.y) {
// Text field active region is below visible area with keyboard - update diff to bring into view
contentDiff = endFrame.origin.y - focusEnd;
} else {
UIView *inputAccessoryView = _firstResponderViewOutsideScrollView.inputAccessoryView;
if (inputAccessoryView) {
// Text input view is within the inputAccessoryView.
contentDiff = endFrame.origin.y - beginFrame.origin.y;
}
}
} else if (endFrame.origin.y <= beginFrame.origin.y) {
// Keyboard opened for other reason
@@ -1644,6 +1644,13 @@ public final class com/facebook/react/bridge/WritableNativeMap : com/facebook/re
public fun putString (Ljava/lang/String;Ljava/lang/String;)V
}
public class com/facebook/react/bridge/interop/InteropModuleRegistry {
public fun <init> ()V
public fun getInteropModule (Ljava/lang/Class;)Lcom/facebook/react/bridge/JavaScriptModule;
public fun registerInteropModule (Ljava/lang/Class;Ljava/lang/Object;)V
public fun shouldReturnInteropModule (Ljava/lang/Class;)Z
}
public abstract interface class com/facebook/react/bridge/queue/MessageQueueThread {
public abstract fun assertIsOnThread ()V
public abstract fun assertIsOnThread (Ljava/lang/String;)V
@@ -2161,7 +2168,7 @@ public abstract class com/facebook/react/devsupport/DevSupportManagerBase : com/
public fun fetchSplitBundleAndCreateBundleLoader (Ljava/lang/String;Lcom/facebook/react/devsupport/DevSupportManagerBase$CallbackWithBundleLoader;)V
protected fun getApplicationContext ()Landroid/content/Context;
public fun getCurrentActivity ()Landroid/app/Activity;
public fun getCurrentReactContext ()Lcom/facebook/react/bridge/ReactContext;
protected fun getCurrentContext ()Lcom/facebook/react/bridge/ReactContext;
public fun getDevLoadingViewManager ()Lcom/facebook/react/devsupport/interfaces/DevLoadingViewManager;
public fun getDevServerHelper ()Lcom/facebook/react/devsupport/DevServerHelper;
public fun getDevSettings ()Lcom/facebook/react/modules/debug/interfaces/DeveloperSettings;
@@ -2334,7 +2341,6 @@ public class com/facebook/react/devsupport/ReleaseDevSupportManager : com/facebo
public fun destroyRootView (Landroid/view/View;)V
public fun downloadBundleResourceFromUrlSync (Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
public fun getCurrentActivity ()Landroid/app/Activity;
public fun getCurrentReactContext ()Lcom/facebook/react/bridge/ReactContext;
public fun getDevSettings ()Lcom/facebook/react/modules/debug/interfaces/DeveloperSettings;
public fun getDevSupportEnabled ()Z
public fun getDownloadedJSBundleFile ()Ljava/lang/String;
@@ -2471,7 +2477,6 @@ public abstract interface class com/facebook/react/devsupport/interfaces/DevSupp
public abstract fun destroyRootView (Landroid/view/View;)V
public abstract fun downloadBundleResourceFromUrlSync (Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
public abstract fun getCurrentActivity ()Landroid/app/Activity;
public abstract fun getCurrentReactContext ()Lcom/facebook/react/bridge/ReactContext;
public abstract fun getDevSettings ()Lcom/facebook/react/modules/debug/interfaces/DeveloperSettings;
public abstract fun getDevSupportEnabled ()Z
public abstract fun getDownloadedJSBundleFile ()Ljava/lang/String;
@@ -3314,6 +3319,17 @@ public final class com/facebook/react/modules/devloading/DevLoadingModule : com/
public final class com/facebook/react/modules/devloading/DevLoadingModule$Companion {
}
public final class com/facebook/react/modules/devtoolsruntimesettings/ReactDevToolsRuntimeSettingsModule : com/facebook/fbreact/specs/NativeReactDevToolsRuntimeSettingsModuleSpec {
public static final field Companion Lcom/facebook/react/modules/devtoolsruntimesettings/ReactDevToolsRuntimeSettingsModule$Companion;
public static final field NAME Ljava/lang/String;
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun getReloadAndProfileConfig ()Lcom/facebook/react/bridge/WritableMap;
public fun setReloadAndProfileConfig (Lcom/facebook/react/bridge/ReadableMap;)V
}
public final class com/facebook/react/modules/devtoolsruntimesettings/ReactDevToolsRuntimeSettingsModule$Companion {
}
public class com/facebook/react/modules/dialog/AlertFragment : androidx/fragment/app/DialogFragment, android/content/DialogInterface$OnClickListener {
public fun <init> ()V
public fun <init> (Lcom/facebook/react/modules/dialog/DialogModule$AlertFragmentListener;Landroid/os/Bundle;)V
@@ -3361,26 +3377,14 @@ public final class com/facebook/react/modules/fresco/FrescoModule$Companion {
public final fun hasBeenInitialized ()Z
}
public final class com/facebook/react/modules/fresco/ImageCacheControl : java/lang/Enum {
public static final field DEFAULT Lcom/facebook/react/modules/fresco/ImageCacheControl;
public static final field ONLY_IF_CACHED Lcom/facebook/react/modules/fresco/ImageCacheControl;
public static final field RELOAD Lcom/facebook/react/modules/fresco/ImageCacheControl;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Lcom/facebook/react/modules/fresco/ImageCacheControl;
public static fun values ()[Lcom/facebook/react/modules/fresco/ImageCacheControl;
}
public final class com/facebook/react/modules/fresco/ReactNetworkImageRequest : com/facebook/imagepipeline/request/ImageRequest {
public static final field Companion Lcom/facebook/react/modules/fresco/ReactNetworkImageRequest$Companion;
public synthetic fun <init> (Lcom/facebook/imagepipeline/request/ImageRequestBuilder;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/modules/fresco/ImageCacheControl;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Lcom/facebook/imagepipeline/request/ImageRequestBuilder;Lcom/facebook/react/bridge/ReadableMap;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public static final fun fromBuilderWithHeaders (Lcom/facebook/imagepipeline/request/ImageRequestBuilder;Lcom/facebook/react/bridge/ReadableMap;)Lcom/facebook/react/modules/fresco/ReactNetworkImageRequest;
public static final fun fromBuilderWithHeaders (Lcom/facebook/imagepipeline/request/ImageRequestBuilder;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/modules/fresco/ImageCacheControl;)Lcom/facebook/react/modules/fresco/ReactNetworkImageRequest;
}
public final class com/facebook/react/modules/fresco/ReactNetworkImageRequest$Companion {
public final fun fromBuilderWithHeaders (Lcom/facebook/imagepipeline/request/ImageRequestBuilder;Lcom/facebook/react/bridge/ReadableMap;)Lcom/facebook/react/modules/fresco/ReactNetworkImageRequest;
public final fun fromBuilderWithHeaders (Lcom/facebook/imagepipeline/request/ImageRequestBuilder;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/modules/fresco/ImageCacheControl;)Lcom/facebook/react/modules/fresco/ReactNetworkImageRequest;
public static synthetic fun fromBuilderWithHeaders$default (Lcom/facebook/react/modules/fresco/ReactNetworkImageRequest$Companion;Lcom/facebook/imagepipeline/request/ImageRequestBuilder;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/modules/fresco/ImageCacheControl;ILjava/lang/Object;)Lcom/facebook/react/modules/fresco/ReactNetworkImageRequest;
}
public final class com/facebook/react/modules/fresco/SystraceRequestListener : com/facebook/imagepipeline/listener/BaseRequestListener {
@@ -3600,6 +3604,17 @@ public final class com/facebook/react/modules/permissions/PermissionsModule : co
public final class com/facebook/react/modules/permissions/PermissionsModule$Companion {
}
public final class com/facebook/react/modules/reactdevtoolssettings/ReactDevToolsSettingsManagerModule : com/facebook/fbreact/specs/NativeReactDevToolsSettingsManagerSpec {
public static final field Companion Lcom/facebook/react/modules/reactdevtoolssettings/ReactDevToolsSettingsManagerModule$Companion;
public static final field NAME Ljava/lang/String;
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun getGlobalHookSettings ()Ljava/lang/String;
public fun setGlobalHookSettings (Ljava/lang/String;)V
}
public final class com/facebook/react/modules/reactdevtoolssettings/ReactDevToolsSettingsManagerModule$Companion {
}
public final class com/facebook/react/modules/share/ShareModule : com/facebook/fbreact/specs/NativeShareModuleSpec {
public static final field Companion Lcom/facebook/react/modules/share/ShareModule$Companion;
public static final field ERROR_INVALID_CONTENT Ljava/lang/String;
@@ -6692,10 +6707,8 @@ public class com/facebook/react/views/imagehelper/ImageSource {
public fun <init> (Landroid/content/Context;Ljava/lang/String;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;D)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;DD)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;DDLcom/facebook/react/modules/fresco/ImageCacheControl;)V
public synthetic fun <init> (Landroid/content/Context;Ljava/lang/String;DDLcom/facebook/react/modules/fresco/ImageCacheControl;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Landroid/content/Context;Ljava/lang/String;DDILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun equals (Ljava/lang/Object;)Z
public final fun getCacheControl ()Lcom/facebook/react/modules/fresco/ImageCacheControl;
public final fun getSize ()D
public final fun getSource ()Ljava/lang/String;
public static final fun getTransparentBitmapImageSource (Landroid/content/Context;)Lcom/facebook/react/views/imagehelper/ImageSource;
@@ -6946,9 +6959,6 @@ public final class com/facebook/react/views/scroll/ReactHorizontalScrollContaine
public static final field Companion Lcom/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
public synthetic fun createViewInstance (ILcom/facebook/react/uimanager/ThemedReactContext;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Landroid/view/View;
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Lcom/facebook/react/views/view/ReactViewGroup;
public fun getName ()Ljava/lang/String;
}
@@ -8156,6 +8166,30 @@ public abstract interface class com/facebook/react/views/textinput/ScrollWatcher
public abstract fun onScrollChanged (IIII)V
}
public final class com/facebook/react/views/unimplementedview/ReactUnimplementedView : android/widget/LinearLayout {
public fun <init> (Landroid/content/Context;)V
public final fun setName (Ljava/lang/String;)V
}
public final class com/facebook/react/views/unimplementedview/ReactUnimplementedViewManager : com/facebook/react/uimanager/ViewGroupManager {
public static final field Companion Lcom/facebook/react/views/unimplementedview/ReactUnimplementedViewManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun getName ()Ljava/lang/String;
public final fun setName (Lcom/facebook/react/views/unimplementedview/ReactUnimplementedView;Ljava/lang/String;)V
}
public class com/facebook/react/views/unimplementedview/ReactUnimplementedViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/unimplementedview/ReactUnimplementedViewManager;Lcom/facebook/react/views/unimplementedview/ReactUnimplementedView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/unimplementedview/ReactUnimplementedViewManager$Companion {
}
public final class com/facebook/react/views/view/ColorUtil {
public static final field INSTANCE Lcom/facebook/react/views/view/ColorUtil;
public static final fun normalize (DDDD)I
@@ -533,7 +533,9 @@ android {
"-DREACT_BUILD_DIR=$buildDir",
"-DANDROID_STL=c++_shared",
"-DANDROID_TOOLCHAIN=clang",
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON")
// Due to https://github.com/android/ndk/issues/1693 we're losing Android
// specific compilation flags. This can be removed once we moved to NDK 25/26
"-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON")
targets(
"reactnative",
@@ -41,7 +41,7 @@ if (PROJECT_ROOT_DIR)
endif ()
file(GLOB input_SRC CONFIGURE_DEPENDS
${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp
*.cpp
${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp)
add_library(${CMAKE_PROJECT_NAME} SHARED ${input_SRC})
@@ -8,9 +8,7 @@ android.useAndroidX=true
react.internal.disableJavaVersionAlignment=true
# Binary Compatibility Validator properties
binaryCompatibilityValidator.ignoredClasses=com.facebook.react.BuildConfig,\
com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager$$PropsSetter
binaryCompatibilityValidator.ignoredClasses=com.facebook.react.BuildConfig
binaryCompatibilityValidator.ignoredPackages=com.facebook.debug,\
com.facebook.fbreact,\
com.facebook.hermes,\
@@ -228,7 +228,6 @@ android {
"-DHERMES_IS_ANDROID=True",
"-DANDROID_STL=c++_shared",
"-DANDROID_PIE=True",
"-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON",
"-DIMPORT_HERMESC=${File(hermesBuildDir, "ImportHermesc.cmake").toString()}",
"-DJSI_DIR=${jsiDir}",
"-DHERMES_SLOW_DEBUG=False",
@@ -236,7 +235,10 @@ android {
"-DHERMES_RELEASE_VERSION=for RN ${version}",
// We intentionally build Hermes with Intl support only. This is to simplify
// the build setup and to avoid overcomplicating the build-type matrix.
"-DHERMES_ENABLE_INTL=True")
"-DHERMES_ENABLE_INTL=True",
// Due to https://github.com/android/ndk/issues/1693 we're losing Android
// specific compilation flags. This can be removed once we moved to NDK 25/26
"-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON")
targets("libhermes")
}
@@ -260,6 +262,11 @@ android {
// This has the (unlucky) side effect of letting AGP call the build
// tasks `configureCMakeRelease` while is actually building the debug flavor.
arguments("-DCMAKE_BUILD_TYPE=Release")
// Adding -O3 to handle the issue here:
// https://github.com/android/ndk/issues/1740#issuecomment-1198438260
// The old NDK toolchain is not passing -O3 correctly for release CMake builds. This is
// fixed in NDK 25 and can be removed once we're there.
cppFlags("-O3")
}
}
}
@@ -323,11 +330,6 @@ afterEvaluate {
tasks.getByName("preBuild").dependsOn(prepareHeadersForPrefab)
}
tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.add("-Xlint:deprecation,unchecked")
options.compilerArgs.add("-Werror")
}
/* Publishing Configuration */
apply(from = "../publish.gradle")
@@ -0,0 +1,30 @@
/*
* 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.
*/
package com.facebook.debug.debugoverlay.model;
import javax.annotation.concurrent.Immutable;
/** Tag for a debug overlay log message. Name must be unique. */
@Immutable
public class DebugOverlayTag {
/** Name of tag. */
public final String name;
/** Description to display in settings. */
public final String description;
/** Color for tag display. */
public final int color;
public DebugOverlayTag(String name, String description, int color) {
this.name = name;
this.description = description;
this.color = color;
}
}
@@ -1,21 +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.
*/
package com.facebook.debug.debugoverlay.model
/**
* Tag for a debug overlay log message. Name must be unique.
*
* @param name Name of tag.
* @param description Description to display in settings.
* @param color Color for tag display.
*/
internal class DebugOverlayTag(
public val name: String,
public val description: String,
public val color: Int,
)
@@ -10,11 +10,12 @@ package com.facebook.debug.holder
import com.facebook.debug.debugoverlay.model.DebugOverlayTag
/** No-op implementation of [Printer]. */
internal object NoopPrinter : Printer {
public object NoopPrinter : Printer {
override fun logMessage(tag: DebugOverlayTag, message: String, vararg args: Any?): Unit = Unit
public override fun logMessage(tag: DebugOverlayTag, message: String, vararg args: Any?): Unit =
Unit
override fun logMessage(tag: DebugOverlayTag, message: String): Unit = Unit
public override fun logMessage(tag: DebugOverlayTag, message: String): Unit = Unit
override fun shouldDisplayLogMessage(tag: DebugOverlayTag): Boolean = false
public override fun shouldDisplayLogMessage(tag: DebugOverlayTag): Boolean = false
}
@@ -10,11 +10,11 @@ package com.facebook.debug.holder
import com.facebook.debug.debugoverlay.model.DebugOverlayTag
/** Interface to debugging tool. */
internal interface Printer {
public interface Printer {
fun logMessage(tag: DebugOverlayTag, message: String, vararg args: Any?)
public fun logMessage(tag: DebugOverlayTag, message: String, vararg args: Any?)
fun logMessage(tag: DebugOverlayTag, message: String)
public fun logMessage(tag: DebugOverlayTag, message: String)
fun shouldDisplayLogMessage(tag: DebugOverlayTag): Boolean
public fun shouldDisplayLogMessage(tag: DebugOverlayTag): Boolean
}
@@ -8,6 +8,6 @@
package com.facebook.debug.holder
/** Holder for debugging tool instance. */
internal object PrinterHolder {
@JvmStatic var printer: Printer = NoopPrinter
public object PrinterHolder {
@JvmStatic public var printer: Printer = NoopPrinter
}

Some files were not shown because too many files have changed in this diff Show More