mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01315e2a8e | ||
|
|
055aa41284 | ||
|
|
8bac865b5a | ||
|
|
1b5c183bf3 | ||
|
|
cc493fc8ff | ||
|
|
277a075b71 | ||
|
|
03952ba3df | ||
|
|
8ace21f157 | ||
|
|
dffbfe6fd9 | ||
|
|
6da5e66522 | ||
|
|
ba221e1015 | ||
|
|
7d4196cf05 | ||
|
|
495b307ad5 | ||
|
|
cfd06d8f08 | ||
|
|
f21d4151d0 | ||
|
|
fcb86cca4e | ||
|
|
e6e814cfc5 | ||
|
|
1ca723220d | ||
|
|
4c781e4fbd | ||
|
|
5f7542d3a0 | ||
|
|
6526a98d68 | ||
|
|
7404fb620b | ||
|
|
fc65e3e48e | ||
|
|
32effad946 | ||
|
|
df63c608b9 | ||
|
|
6e921b4c9c | ||
|
|
812824cc64 | ||
|
|
aac7dbefe2 | ||
|
|
4bbc344ec8 | ||
|
|
0e6009eecf | ||
|
|
bd94a13c5d | ||
|
|
5976618bf9 |
@@ -179,8 +179,9 @@ jobs:
|
||||
- name: Compress and Rename dSYM
|
||||
if: steps.restore-xcframework.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
tar -cz -f packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz \
|
||||
packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM
|
||||
cd packages/react-native/third-party/Symbols/
|
||||
tar -cz -f ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz .
|
||||
mv ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz ./ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
|
||||
- name: Upload XCFramework Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
@@ -593,7 +593,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: ["24", "22", "20.19.4"]
|
||||
node-version: ["24.4.1", "22", "20.19.4"]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
+4
-4
@@ -26,8 +26,8 @@
|
||||
"set-version": "node ./scripts/releases/set-version.js",
|
||||
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
|
||||
"test-ci": "jest --maxWorkers=2 --ci --reporters=\"default\" --reporters=\"jest-junit\"",
|
||||
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
|
||||
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
|
||||
"test-release-local-clean": "node ./scripts/release-testing/test-release-local-clean.js",
|
||||
"test-release-local": "node ./scripts/release-testing/test-release-local.js",
|
||||
"test-ios": "./scripts/objc-test.sh test",
|
||||
"test-typescript": "tsc -p packages/react-native/types/tsconfig.json",
|
||||
"test-generated-typescript": "tsc -p packages/react-native/types_generated/tsconfig.test.json",
|
||||
@@ -52,8 +52,8 @@
|
||||
"@electron/packager": "^18.3.6",
|
||||
"@jest/create-cache-key-function": "^29.7.0",
|
||||
"@microsoft/api-extractor": "^7.52.2",
|
||||
"@react-native/metro-babel-transformer": "0.81.0-rc.2",
|
||||
"@react-native/metro-config": "0.81.0-rc.2",
|
||||
"@react-native/metro-babel-transformer": "0.81.1",
|
||||
"@react-native/metro-config": "0.81.1",
|
||||
"@tsconfig/node22": "22.0.2",
|
||||
"@types/react": "^19.1.0",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.25.3",
|
||||
"@react-native/codegen": "0.81.0-rc.2"
|
||||
"@react-native/codegen": "0.81.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,7 +22,7 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/dev-middleware": "0.81.0-rc.2",
|
||||
"@react-native/dev-middleware": "0.81.1",
|
||||
"debug": "^4.4.0",
|
||||
"invariant": "^2.2.4",
|
||||
"metro": "^0.83.1",
|
||||
@@ -40,6 +40,9 @@
|
||||
"peerDependenciesMeta": {
|
||||
"@react-native-community/cli": {
|
||||
"optional": true
|
||||
},
|
||||
"@react-native/metro-config": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "React Native CLI library for Frameworks to build on",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.flow.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-frontend",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Debugger frontend for React Native based on Chrome DevTools",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-shell",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/dev-middleware",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Dev server middleware for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -23,7 +23,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@isaacs/ttlcache": "^1.4.1",
|
||||
"@react-native/debugger-frontend": "0.81.0-rc.2",
|
||||
"@react-native/debugger-frontend": "0.81.1",
|
||||
"chrome-launcher": "^0.15.2",
|
||||
"chromium-edge-launcher": "^0.2.0",
|
||||
"connect": "^3.6.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-config",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "ESLint config for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/eslint-parser": "^7.25.1",
|
||||
"@react-native/eslint-plugin": "0.81.0-rc.2",
|
||||
"@react-native/eslint-plugin": "0.81.1",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "ESLint rules for @react-native/eslint-config",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin-specs",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "ESLint rules to validate NativeModule and Component Specs",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,7 +26,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
|
||||
"@react-native/codegen": "0.81.0-rc.2",
|
||||
"@react-native/codegen": "0.81.1",
|
||||
"make-dir": "^2.1.0",
|
||||
"pirates": "^4.0.1",
|
||||
"source-map-support": "0.5.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/gradle-plugin",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Gradle Plugin for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
+16
@@ -26,5 +26,21 @@ class ReactRootProjectPlugin : Plugin<Project> {
|
||||
it.evaluationDependsOn(":app")
|
||||
}
|
||||
}
|
||||
// We need to make sure that `:app:preBuild` task depends on all other subprojects' preBuild
|
||||
// tasks. This is necessary in order to have all the codegen generated code before the CMake
|
||||
// configuration build kicks in.
|
||||
project.gradle.projectsEvaluated {
|
||||
val appProject = project.rootProject.subprojects.find { it.name == "app" }
|
||||
val appPreBuild = appProject?.tasks?.findByName("preBuild")
|
||||
if (appPreBuild != null) {
|
||||
// Find all other subprojects' preBuild tasks
|
||||
val otherPreBuildTasks =
|
||||
project.rootProject.subprojects
|
||||
.filter { it != appProject }
|
||||
.mapNotNull { it.tasks.findByName("preBuild") }
|
||||
// Make :app:preBuild depend on all others
|
||||
appPreBuild.dependsOn(otherPreBuildTasks)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-config",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Metro configuration for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,8 +26,8 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/js-polyfills": "0.81.0-rc.2",
|
||||
"@react-native/metro-babel-transformer": "0.81.0-rc.2",
|
||||
"@react-native/js-polyfills": "0.81.1",
|
||||
"@react-native/metro-babel-transformer": "0.81.1",
|
||||
"metro-config": "^0.83.1",
|
||||
"metro-runtime": "^0.83.1"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/new-app-screen",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "NewAppScreen component for React Native",
|
||||
"keywords": [
|
||||
"react-native"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/normalize-colors",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Color normalization for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/js-polyfills",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Polyfills for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-preset",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Babel preset for React Native applications",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -66,7 +66,7 @@
|
||||
"@babel/plugin-transform-typescript": "^7.25.2",
|
||||
"@babel/plugin-transform-unicode-regex": "^7.24.7",
|
||||
"@babel/template": "^7.25.0",
|
||||
"@react-native/babel-plugin-codegen": "0.81.0-rc.2",
|
||||
"@react-native/babel-plugin-codegen": "0.81.1",
|
||||
"babel-plugin-syntax-hermes-parser": "0.29.1",
|
||||
"babel-plugin-transform-flow-enums": "^0.0.2",
|
||||
"react-refresh": "^0.14.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-babel-transformer",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Babel transformer for React Native applications.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -27,7 +27,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@react-native/babel-preset": "0.81.0-rc.2",
|
||||
"@react-native/babel-preset": "0.81.1",
|
||||
"hermes-parser": "0.29.1",
|
||||
"nullthrows": "^1.1.1"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Code generation tools for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -29,6 +29,8 @@
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/parser": "^7.25.3",
|
||||
"glob": "^7.1.1",
|
||||
"hermes-parser": "0.29.1",
|
||||
"invariant": "^2.2.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/compatibility-check",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "Check a React Native app's boundary between JS and Native for incompatibilities",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -29,7 +29,7 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.81.0-rc.2"
|
||||
"@react-native/codegen": "0.81.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"flow-remove-types": "^2.237.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/popup-menu-android",
|
||||
"version": "0.81.0-rc.2",
|
||||
"version": "0.81.1",
|
||||
"description": "PopupMenu for the Android platform",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@react-native/codegen": "0.81.0-rc.2"
|
||||
"@react-native/codegen": "0.81.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^19.1.0",
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@react-native/babel-preset": "0.81.0-rc.2",
|
||||
"react-native": "0.81.0-rc.2"
|
||||
"@react-native/babel-preset": "0.81.1",
|
||||
"react-native": "0.81.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
@@ -264,7 +264,7 @@ const Switch: component(
|
||||
disabled,
|
||||
onTintColor: trackColorForTrue,
|
||||
style: StyleSheet.compose(
|
||||
{height: 31, width: 51},
|
||||
{alignSelf: 'flex-start' as const},
|
||||
StyleSheet.compose(
|
||||
style,
|
||||
ios_backgroundColor == null
|
||||
|
||||
@@ -618,6 +618,9 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
||||
// so omitting onBlur and onFocus pressability handlers here.
|
||||
const {onBlur, onFocus, ...eventHandlers} = usePressability(config);
|
||||
|
||||
const _accessibilityLabel =
|
||||
props?.['aria-label'] ?? props?.accessibilityLabel;
|
||||
|
||||
let _accessibilityState;
|
||||
if (
|
||||
accessibilityState != null ||
|
||||
@@ -681,6 +684,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
||||
{...otherProps}
|
||||
{...eventHandlers}
|
||||
acceptDragAndDropTypes={props.experimental_acceptDragAndDropTypes}
|
||||
accessibilityLabel={_accessibilityLabel}
|
||||
accessibilityState={_accessibilityState}
|
||||
accessible={accessible}
|
||||
submitBehavior={submitBehavior}
|
||||
@@ -744,8 +748,9 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
||||
{...otherProps}
|
||||
{...colorProps}
|
||||
{...eventHandlers}
|
||||
accessibilityState={_accessibilityState}
|
||||
accessibilityLabel={_accessibilityLabel}
|
||||
accessibilityLabelledBy={_accessibilityLabelledBy}
|
||||
accessibilityState={_accessibilityState}
|
||||
accessible={accessible}
|
||||
acceptDragAndDropTypes={props.experimental_acceptDragAndDropTypes}
|
||||
autoCapitalize={autoCapitalize}
|
||||
|
||||
+1
@@ -432,6 +432,7 @@ jest.unmock('../TextInput');
|
||||
|
||||
expect(instance.toJSON()).toMatchInlineSnapshot(`
|
||||
<RCTSinglelineTextInputView
|
||||
accessibilityLabel="label"
|
||||
accessibilityState={
|
||||
Object {
|
||||
"busy": true,
|
||||
|
||||
@@ -17,6 +17,6 @@ export const version: $ReadOnly<{
|
||||
}> = {
|
||||
major: 0,
|
||||
minor: 81,
|
||||
patch: 0,
|
||||
prerelease: 'rc.2',
|
||||
patch: 1,
|
||||
prerelease: null,
|
||||
};
|
||||
|
||||
@@ -84,7 +84,10 @@ let reactDebug = RNTarget(
|
||||
let jsi = RNTarget(
|
||||
name: .jsi,
|
||||
path: "ReactCommon/jsi",
|
||||
excludedPaths: ["jsi/test", "CMakeLists.txt", "jsi/CMakeLists.txt"],
|
||||
// JSI is a part of hermes-engine. Including them also in react-native will violate the One Definition Rule.
|
||||
// Precompiled binaries are only supported with hermes - so we can safely exclude the jsi.cpp file.
|
||||
// https://github.com/facebook/react-native/issues/53257
|
||||
excludedPaths: ["jsi/test", "jsi/jsi.cpp", "CMakeLists.txt", "jsi/CMakeLists.txt"],
|
||||
dependencies: [.reactNativeDependencies]
|
||||
)
|
||||
|
||||
@@ -421,6 +424,7 @@ let reactFabricComponents = RNTarget(
|
||||
"components/view/platform/android",
|
||||
"components/view/platform/windows",
|
||||
"components/view/platform/macos",
|
||||
"components/switch/iosswitch/react/renderer/components/switch/MacOSSwitchShadowNode.mm",
|
||||
"components/textinput/platform/android",
|
||||
"components/text/platform/android",
|
||||
"components/textinput/platform/macos",
|
||||
@@ -433,7 +437,7 @@ let reactFabricComponents = RNTarget(
|
||||
"conponents/rncore", // this was the old folder where RN Core Components were generated. If you ran codegen in the past, you might have some files in it that might make the build fail.
|
||||
],
|
||||
dependencies: [.reactNativeDependencies, .reactCore, .reactJsiExecutor, .reactTurboModuleCore, .jsi, .logger, .reactDebug, .reactFeatureFlags, .reactUtils, .reactRuntimeScheduler, .reactCxxReact, .yoga, .reactRendererDebug, .reactGraphics, .reactFabric, .reactTurboModuleBridging],
|
||||
sources: ["components/inputaccessory", "components/modal", "components/safeareaview", "components/text", "components/text/platform/cxx", "components/textinput", "components/textinput/platform/ios/", "components/unimplementedview", "components/virtualview", "textlayoutmanager", "textlayoutmanager/platform/ios"]
|
||||
sources: ["components/inputaccessory", "components/modal", "components/safeareaview", "components/text", "components/text/platform/cxx", "components/textinput", "components/textinput/platform/ios/", "components/unimplementedview", "components/virtualview", "textlayoutmanager", "textlayoutmanager/platform/ios", "components/switch/iosswitch"]
|
||||
)
|
||||
|
||||
/// React-FabricImage.podspec
|
||||
|
||||
@@ -54,6 +54,7 @@ RCT_EXTERN CGFloat RCTScreenScale(void);
|
||||
RCT_EXTERN CGFloat RCTFontSizeMultiplier(void);
|
||||
RCT_EXTERN CGSize RCTScreenSize(void);
|
||||
RCT_EXTERN CGSize RCTViewportSize(void);
|
||||
RCT_EXTERN CGSize RCTSwitchSize(void);
|
||||
|
||||
// Round float coordinates to nearest whole screen pixel (not point)
|
||||
RCT_EXTERN CGFloat RCTRoundPixelValue(CGFloat value);
|
||||
|
||||
@@ -426,6 +426,18 @@ CGSize RCTViewportSize(void)
|
||||
return window ? window.bounds.size : RCTScreenSize();
|
||||
}
|
||||
|
||||
CGSize RCTSwitchSize(void)
|
||||
{
|
||||
static CGSize rctSwitchSize;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
RCTUnsafeExecuteOnMainQueueSync(^{
|
||||
rctSwitchSize = [UISwitch new].intrinsicContentSize;
|
||||
});
|
||||
});
|
||||
return rctSwitchSize;
|
||||
}
|
||||
|
||||
CGFloat RCTRoundPixelValue(CGFloat value)
|
||||
{
|
||||
CGFloat scale = RCTScreenScale();
|
||||
|
||||
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(81),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: @"rc.2",
|
||||
RCTVersionPatch: @(1),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
});
|
||||
return __rnVersion;
|
||||
|
||||
+22
@@ -96,6 +96,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
||||
|
||||
@interface RCTModalHostViewComponentView () <RCTFabricModalHostViewControllerDelegate>
|
||||
|
||||
@property (nonatomic, weak) UIView *accessibilityFocusedView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RCTModalHostViewComponentView {
|
||||
@@ -148,6 +150,7 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
||||
{
|
||||
BOOL shouldBePresented = !_isPresented && _shouldPresent && self.window;
|
||||
if (shouldBePresented) {
|
||||
[self saveAccessibilityFocusedView];
|
||||
self.viewController.presentationController.delegate = self;
|
||||
|
||||
_isPresented = YES;
|
||||
@@ -179,6 +182,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
||||
if (eventEmitter) {
|
||||
eventEmitter->onDismiss(ModalHostViewEventEmitter::OnDismiss{});
|
||||
}
|
||||
|
||||
[self restoreAccessibilityFocusedView];
|
||||
}];
|
||||
}
|
||||
}
|
||||
@@ -207,6 +212,23 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
|
||||
[self ensurePresentedOnlyIfNeeded];
|
||||
}
|
||||
|
||||
- (void)saveAccessibilityFocusedView
|
||||
{
|
||||
id focusedElement = UIAccessibilityFocusedElement(nil);
|
||||
if (focusedElement && [focusedElement isKindOfClass:[UIView class]]) {
|
||||
self.accessibilityFocusedView = (UIView *)focusedElement;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)restoreAccessibilityFocusedView
|
||||
{
|
||||
id viewToFocus = self.accessibilityFocusedView;
|
||||
if (viewToFocus) {
|
||||
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, viewToFocus);
|
||||
self.accessibilityFocusedView = nil;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - RCTFabricModalHostViewControllerDelegate
|
||||
|
||||
- (void)boundsDidChange:(CGRect)newBounds
|
||||
|
||||
+1
-1
@@ -9,10 +9,10 @@
|
||||
|
||||
#import <React/RCTConversions.h>
|
||||
|
||||
#import <react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h>
|
||||
#import <react/renderer/components/FBReactNativeSpec/EventEmitters.h>
|
||||
#import <react/renderer/components/FBReactNativeSpec/Props.h>
|
||||
#import <react/renderer/components/FBReactNativeSpec/RCTComponentViewHelpers.h>
|
||||
#import <react/renderer/components/switch/AppleSwitchComponentDescriptor.h>
|
||||
|
||||
#import "RCTFabricComponentsPlugins.h"
|
||||
|
||||
|
||||
+2
-1
@@ -22,6 +22,7 @@
|
||||
#import "RCTTextInputNativeCommands.h"
|
||||
#import "RCTTextInputUtils.h"
|
||||
|
||||
#import <limits>
|
||||
#import "RCTFabricComponentsPlugins.h"
|
||||
|
||||
/** Native iOS text field bottom keyboard offset amount */
|
||||
@@ -447,7 +448,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
}
|
||||
}
|
||||
|
||||
if (props.maxLength) {
|
||||
if (props.maxLength < std::numeric_limits<int>::max()) {
|
||||
NSInteger allowedLength = props.maxLength - _backedTextInputView.attributedText.string.length + range.length;
|
||||
|
||||
if (allowedLength > 0 && text.length > allowedLength) {
|
||||
|
||||
@@ -45,10 +45,7 @@ Pod::Spec.new do |s|
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
|
||||
}
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.header_mappings_dir = 'FBReactNativeSpec'
|
||||
s.module_name = 'React_RCTFBReactNativeSpec'
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: 'FBReactNativeSpec', module_name: "React_RCTFBReactNativeSpec")
|
||||
|
||||
s.dependency "React-jsi"
|
||||
s.dependency "RCTRequired"
|
||||
|
||||
@@ -75,6 +75,7 @@ Pod::Spec.new do |s|
|
||||
"react/renderer/components/scrollview/platform/cxx",
|
||||
"react/renderer/components/text/platform/cxx",
|
||||
"react/renderer/components/textinput/platform/ios",
|
||||
"react/renderer/components/switch/iosswitch",
|
||||
]);
|
||||
|
||||
add_dependency(s, "React-graphics", :additional_framework_paths => ["react/renderer/graphics/platform/ios"])
|
||||
|
||||
@@ -35,9 +35,7 @@ Pod::Spec.new do |s|
|
||||
s.header_dir = header_dir
|
||||
s.module_name = module_name
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.header_mappings_dir = "./"
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "./")
|
||||
|
||||
s.pod_target_xcconfig = {
|
||||
"OTHER_CFLAGS" => "$(inherited) " + new_arch_flags,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=0.81.0-rc.2
|
||||
VERSION_NAME=0.81.1
|
||||
react.internal.publishingGroup=com.facebook.react
|
||||
|
||||
android.useAndroidX=true
|
||||
|
||||
+9
-1
@@ -8,6 +8,7 @@
|
||||
package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.proguard.annotations.DoNotStrip
|
||||
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
|
||||
import java.util.ArrayList
|
||||
import java.util.Arrays
|
||||
import kotlin.jvm.JvmStatic
|
||||
@@ -65,9 +66,16 @@ public open class ReadableNativeArray protected constructor() : NativeArray(), R
|
||||
if (other !is ReadableNativeArray) {
|
||||
return false
|
||||
}
|
||||
return localArray.contentDeepEquals(other.localArray)
|
||||
|
||||
return if (ReactNativeFeatureFlags.useNativeEqualsInNativeReadableArrayAndroid()) {
|
||||
nativeEquals(other)
|
||||
} else {
|
||||
localArray.contentDeepEquals(other.localArray)
|
||||
}
|
||||
}
|
||||
|
||||
private external fun nativeEquals(other: ReadableNativeArray): Boolean
|
||||
|
||||
override fun toArrayList(): ArrayList<Any?> {
|
||||
val arrayList = ArrayList<Any?>()
|
||||
repeat(size()) { i ->
|
||||
|
||||
+13
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<3e4d74a17c15742d35db9e4247f3e1c1>>
|
||||
* @generated SignedSource<<c52f3977ea07f976e36177f13c1ec684>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -342,6 +342,18 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun useFabricInterop(): Boolean = accessor.useFabricInterop()
|
||||
|
||||
/**
|
||||
* Use a native implementation of equals in NativeReadableArray.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun useNativeEqualsInNativeReadableArrayAndroid(): Boolean = accessor.useNativeEqualsInNativeReadableArrayAndroid()
|
||||
|
||||
/**
|
||||
* Use a native implementation of TransformHelper
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun useNativeTransformHelperAndroid(): Boolean = accessor.useNativeTransformHelperAndroid()
|
||||
|
||||
/**
|
||||
* When enabled, the native view configs are used in bridgeless mode.
|
||||
*/
|
||||
|
||||
+21
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<e7c1c6d184681d98320aac2a23c06288>>
|
||||
* @generated SignedSource<<8e0125e82b359e6a175ffc49a4df5537>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -72,6 +72,8 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
|
||||
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
|
||||
private var useFabricInteropCache: Boolean? = null
|
||||
private var useNativeEqualsInNativeReadableArrayAndroidCache: Boolean? = null
|
||||
private var useNativeTransformHelperAndroidCache: Boolean? = null
|
||||
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
|
||||
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
|
||||
private var useRawPropsJsiValueCache: Boolean? = null
|
||||
@@ -548,6 +550,24 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useNativeEqualsInNativeReadableArrayAndroid(): Boolean {
|
||||
var cached = useNativeEqualsInNativeReadableArrayAndroidCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.useNativeEqualsInNativeReadableArrayAndroid()
|
||||
useNativeEqualsInNativeReadableArrayAndroidCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useNativeTransformHelperAndroid(): Boolean {
|
||||
var cached = useNativeTransformHelperAndroidCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.useNativeTransformHelperAndroid()
|
||||
useNativeTransformHelperAndroidCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useNativeViewConfigsInBridgelessMode(): Boolean {
|
||||
var cached = useNativeViewConfigsInBridgelessModeCache
|
||||
if (cached == null) {
|
||||
|
||||
+5
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<ba62d616188ed439c85c66cfd055810d>>
|
||||
* @generated SignedSource<<a5d9d11cc2a6529641243dc47a61f201>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -132,6 +132,10 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useFabricInterop(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useNativeEqualsInNativeReadableArrayAndroid(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useNativeTransformHelperAndroid(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useNativeViewConfigsInBridgelessMode(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun useOptimizedEventBatchingOnAndroid(): Boolean
|
||||
|
||||
+5
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<12c2727291b635ef7c3163d153669c2c>>
|
||||
* @generated SignedSource<<10d708ce4449eede46d750a1ed48d02e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -127,6 +127,10 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun useFabricInterop(): Boolean = true
|
||||
|
||||
override fun useNativeEqualsInNativeReadableArrayAndroid(): Boolean = false
|
||||
|
||||
override fun useNativeTransformHelperAndroid(): Boolean = false
|
||||
|
||||
override fun useNativeViewConfigsInBridgelessMode(): Boolean = false
|
||||
|
||||
override fun useOptimizedEventBatchingOnAndroid(): Boolean = false
|
||||
|
||||
+23
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<3ea9946ef21c8ac8bb9bb63712636e89>>
|
||||
* @generated SignedSource<<b04948c792c5db63decf1df80d3a867e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -76,6 +76,8 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
|
||||
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
|
||||
private var useFabricInteropCache: Boolean? = null
|
||||
private var useNativeEqualsInNativeReadableArrayAndroidCache: Boolean? = null
|
||||
private var useNativeTransformHelperAndroidCache: Boolean? = null
|
||||
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
|
||||
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
|
||||
private var useRawPropsJsiValueCache: Boolean? = null
|
||||
@@ -604,6 +606,26 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useNativeEqualsInNativeReadableArrayAndroid(): Boolean {
|
||||
var cached = useNativeEqualsInNativeReadableArrayAndroidCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.useNativeEqualsInNativeReadableArrayAndroid()
|
||||
accessedFeatureFlags.add("useNativeEqualsInNativeReadableArrayAndroid")
|
||||
useNativeEqualsInNativeReadableArrayAndroidCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useNativeTransformHelperAndroid(): Boolean {
|
||||
var cached = useNativeTransformHelperAndroidCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.useNativeTransformHelperAndroid()
|
||||
accessedFeatureFlags.add("useNativeTransformHelperAndroid")
|
||||
useNativeTransformHelperAndroidCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun useNativeViewConfigsInBridgelessMode(): Boolean {
|
||||
var cached = useNativeViewConfigsInBridgelessModeCache
|
||||
if (cached == null) {
|
||||
|
||||
+5
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<58da46268043f086730132430735b720>>
|
||||
* @generated SignedSource<<0bafb0a2fb79c4220d21f1736894af14>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -24,4 +24,8 @@ public open class ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android :
|
||||
// but that is more expensive than just duplicating the defaults here.
|
||||
|
||||
override fun preventShadowTreeCommitExhaustion(): Boolean = true
|
||||
|
||||
override fun useNativeEqualsInNativeReadableArrayAndroid(): Boolean = true
|
||||
|
||||
override fun useNativeTransformHelperAndroid(): Boolean = true
|
||||
}
|
||||
|
||||
+5
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<1e81de36735c6c9286b228c75c9a0228>>
|
||||
* @generated SignedSource<<21704207ce520def05b05f89dfba1048>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -127,6 +127,10 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun useFabricInterop(): Boolean
|
||||
|
||||
@DoNotStrip public fun useNativeEqualsInNativeReadableArrayAndroid(): Boolean
|
||||
|
||||
@DoNotStrip public fun useNativeTransformHelperAndroid(): Boolean
|
||||
|
||||
@DoNotStrip public fun useNativeViewConfigsInBridgelessMode(): Boolean
|
||||
|
||||
@DoNotStrip public fun useOptimizedEventBatchingOnAndroid(): Boolean
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ public object ReactNativeVersion {
|
||||
public val VERSION: Map<String, Any?> = mapOf(
|
||||
"major" to 0,
|
||||
"minor" to 81,
|
||||
"patch" to 0,
|
||||
"prerelease" to "rc.2"
|
||||
"patch" to 1,
|
||||
"prerelease" to null
|
||||
)
|
||||
}
|
||||
|
||||
+2
-1
@@ -514,7 +514,8 @@ public class ReactHostImpl(
|
||||
internal fun <T : NativeModule> hasNativeModule(nativeModuleInterface: Class<T>): Boolean =
|
||||
reactInstance?.hasNativeModule<T>(nativeModuleInterface) ?: false
|
||||
|
||||
internal val nativeModules: Collection<NativeModule> = reactInstance?.nativeModules ?: listOf()
|
||||
internal val nativeModules: Collection<NativeModule>
|
||||
get() = reactInstance?.nativeModules ?: listOf()
|
||||
|
||||
internal fun <T : NativeModule> getNativeModule(nativeModuleInterface: Class<T>): T? {
|
||||
if (!ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE &&
|
||||
|
||||
+19
@@ -8,10 +8,12 @@
|
||||
package com.facebook.react.uimanager
|
||||
|
||||
import com.facebook.common.logging.FLog
|
||||
import com.facebook.react.bridge.NativeArray
|
||||
import com.facebook.react.bridge.ReadableArray
|
||||
import com.facebook.react.bridge.ReadableMap
|
||||
import com.facebook.react.bridge.ReadableType
|
||||
import com.facebook.react.common.ReactConstants
|
||||
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
|
||||
|
||||
public object TransformHelper {
|
||||
|
||||
@@ -69,6 +71,14 @@ public object TransformHelper {
|
||||
transformOrigin: ReadableArray?,
|
||||
allowPercentageResolution: Boolean
|
||||
) {
|
||||
if (allowPercentageResolution &&
|
||||
ReactNativeFeatureFlags.useNativeTransformHelperAndroid() &&
|
||||
transforms is NativeArray &&
|
||||
transformOrigin is NativeArray?) {
|
||||
nativeProcessTransform(transforms, result, viewWidth, viewHeight, transformOrigin)
|
||||
return
|
||||
}
|
||||
|
||||
val helperMatrix = helperMatrix.get()!!
|
||||
MatrixMathHelper.resetIdentityMatrix(result)
|
||||
val offsets =
|
||||
@@ -220,4 +230,13 @@ public object TransformHelper {
|
||||
|
||||
return doubleArrayOf(newTranslateX, newTranslateY, newTranslateZ)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
private external fun nativeProcessTransform(
|
||||
transforms: NativeArray,
|
||||
result: DoubleArray,
|
||||
viewWidth: Float,
|
||||
viewHeight: Float,
|
||||
transformOrigin: NativeArray?
|
||||
)
|
||||
}
|
||||
|
||||
+29
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<cf7b6ff66c614ca2acc6667a80c5590d>>
|
||||
* @generated SignedSource<<bbad4ee8cacd33099874d0c3078ea716>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -351,6 +351,18 @@ class ReactNativeFeatureFlagsJavaProvider
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool useNativeEqualsInNativeReadableArrayAndroid() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useNativeEqualsInNativeReadableArrayAndroid");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool useNativeTransformHelperAndroid() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useNativeTransformHelperAndroid");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool useNativeViewConfigsInBridgelessMode() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useNativeViewConfigsInBridgelessMode");
|
||||
@@ -657,6 +669,16 @@ bool JReactNativeFeatureFlagsCxxInterop::useFabricInterop(
|
||||
return ReactNativeFeatureFlags::useFabricInterop();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::useNativeEqualsInNativeReadableArrayAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::useNativeEqualsInNativeReadableArrayAndroid();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::useNativeTransformHelperAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::useNativeTransformHelperAndroid();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::useNativeViewConfigsInBridgelessMode(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode();
|
||||
@@ -879,6 +901,12 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"useFabricInterop",
|
||||
JReactNativeFeatureFlagsCxxInterop::useFabricInterop),
|
||||
makeNativeMethod(
|
||||
"useNativeEqualsInNativeReadableArrayAndroid",
|
||||
JReactNativeFeatureFlagsCxxInterop::useNativeEqualsInNativeReadableArrayAndroid),
|
||||
makeNativeMethod(
|
||||
"useNativeTransformHelperAndroid",
|
||||
JReactNativeFeatureFlagsCxxInterop::useNativeTransformHelperAndroid),
|
||||
makeNativeMethod(
|
||||
"useNativeViewConfigsInBridgelessMode",
|
||||
JReactNativeFeatureFlagsCxxInterop::useNativeViewConfigsInBridgelessMode),
|
||||
|
||||
+7
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<dae981c66bf0751fd2863937ecf255d8>>
|
||||
* @generated SignedSource<<57f2dcf4b71512c6b15e8021258d6036>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -186,6 +186,12 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool useFabricInterop(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool useNativeEqualsInNativeReadableArrayAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool useNativeTransformHelperAndroid(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool useNativeViewConfigsInBridgelessMode(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
|
||||
@@ -31,13 +31,14 @@ add_library(
|
||||
OnLoad-common.cpp
|
||||
ReadableNativeArray.cpp
|
||||
ReadableNativeMap.cpp
|
||||
TransformHelper.cpp
|
||||
WritableNativeArray.cpp
|
||||
WritableNativeMap.cpp
|
||||
)
|
||||
target_merge_so(reactnativejni_common)
|
||||
target_include_directories(reactnativejni_common PUBLIC ../../)
|
||||
|
||||
target_link_libraries(reactnativejni_common fbjni folly_runtime react_cxxreact)
|
||||
target_link_libraries(reactnativejni_common fbjni folly_runtime react_cxxreact yoga react_renderer_graphics)
|
||||
target_compile_reactnative_options(reactnativejni_common PRIVATE)
|
||||
target_compile_options(reactnativejni_common PRIVATE -Wno-unused-lambda-capture)
|
||||
|
||||
|
||||
@@ -21,6 +21,10 @@ class NativeArray : public jni::HybridClass<NativeArray> {
|
||||
|
||||
jni::local_ref<jstring> toString();
|
||||
|
||||
const folly::dynamic& getArray() const {
|
||||
return array_;
|
||||
}
|
||||
|
||||
RN_EXPORT folly::dynamic consume();
|
||||
|
||||
// Whether this array has been added to another array or map and no longer
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "JReactMarker.h"
|
||||
#include "NativeArray.h"
|
||||
#include "NativeMap.h"
|
||||
#include "TransformHelper.h"
|
||||
#include "WritableNativeArray.h"
|
||||
#include "WritableNativeMap.h"
|
||||
|
||||
@@ -27,6 +28,7 @@ extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||
ReadableNativeMap::registerNatives();
|
||||
WritableNativeArray::registerNatives();
|
||||
WritableNativeMap::registerNatives();
|
||||
TransformHelper::registerNatives();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -40,10 +40,16 @@ local_ref<JArrayClass<jobject>> ReadableNativeArray::importTypeArray() {
|
||||
return jarray;
|
||||
}
|
||||
|
||||
bool ReadableNativeArray::equals(
|
||||
jni::alias_ref<ReadableNativeArray::javaobject> other) {
|
||||
return array_ == other->cthis()->array_;
|
||||
}
|
||||
|
||||
void ReadableNativeArray::registerNatives() {
|
||||
registerHybrid({
|
||||
makeNativeMethod("importArray", ReadableNativeArray::importArray),
|
||||
makeNativeMethod("importTypeArray", ReadableNativeArray::importTypeArray),
|
||||
makeNativeMethod("nativeEquals", ReadableNativeArray::equals),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ class ReadableNativeArray
|
||||
static void mapException(std::exception_ptr ex);
|
||||
static void registerNatives();
|
||||
|
||||
bool equals(jni::alias_ref<ReadableNativeArray::javaobject> other);
|
||||
jni::local_ref<jni::JArrayClass<jobject>> importArray();
|
||||
jni::local_ref<jni::JArrayClass<jobject>> importTypeArray();
|
||||
};
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include "TransformHelper.h"
|
||||
|
||||
#include <react/renderer/components/view/BaseViewProps.h>
|
||||
#include <react/renderer/components/view/conversions.h>
|
||||
|
||||
#include "NativeArray.h"
|
||||
|
||||
using namespace facebook::jni;
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
namespace {
|
||||
void processTransform(
|
||||
jni::alias_ref<jclass> /*unused*/,
|
||||
NativeArray* jTransforms,
|
||||
jni::alias_ref<jni::JArrayDouble> jResult,
|
||||
float viewWidth,
|
||||
float viewHeight,
|
||||
NativeArray* jTransformOrigin) {
|
||||
// Assuming parsing transforms doesn't require a real PropsParserContext
|
||||
static ContextContainer contextContainer;
|
||||
static PropsParserContext context(0, contextContainer);
|
||||
|
||||
RawValue transformValue(jTransforms->getArray());
|
||||
Transform transform;
|
||||
fromRawValue(context, transformValue, transform);
|
||||
|
||||
TransformOrigin transformOrigin;
|
||||
if (jTransformOrigin != nullptr) {
|
||||
RawValue transformOriginValue(jTransformOrigin->getArray());
|
||||
fromRawValue(context, transformOriginValue, transformOrigin);
|
||||
}
|
||||
|
||||
auto result = BaseViewProps::resolveTransform(
|
||||
Size(viewWidth, viewHeight), transform, transformOrigin);
|
||||
|
||||
// Convert from matrix of floats to double matrix
|
||||
constexpr size_t MatrixSize = std::tuple_size_v<decltype(result.matrix)>;
|
||||
std::array<double, MatrixSize> doubleTransform{};
|
||||
std::copy(
|
||||
result.matrix.begin(), result.matrix.end(), doubleTransform.begin());
|
||||
jResult->setRegion(0, MatrixSize, doubleTransform.data());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void TransformHelper::registerNatives() {
|
||||
javaClassLocal()->registerNatives({
|
||||
makeNativeMethod("nativeProcessTransform", processTransform),
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <fbjni/fbjni.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
class TransformHelper : public jni::JavaClass<TransformHelper> {
|
||||
public:
|
||||
static auto constexpr* kJavaDescriptor =
|
||||
"Lcom/facebook/react/uimanager/TransformHelper;";
|
||||
|
||||
static void registerNatives();
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -32,10 +32,7 @@ Pod::Spec.new do |s|
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"DEFINES_MODULE" => "YES" }
|
||||
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.header_mappings_dir = './'
|
||||
s.module_name = 'React_Fabric'
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "./", module_name: "React_Fabric")
|
||||
|
||||
s.dependency "React-jsiexecutor"
|
||||
s.dependency "RCTRequired"
|
||||
|
||||
@@ -49,10 +49,7 @@ Pod::Spec.new do |s|
|
||||
"HEADER_SEARCH_PATHS" => header_search_path.join(" "),
|
||||
}
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.header_mappings_dir = './'
|
||||
s.module_name = 'React_FabricComponents'
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "./", module_name: "React_FabricComponents")
|
||||
|
||||
s.dependency "React-jsiexecutor"
|
||||
s.dependency "RCTRequired"
|
||||
@@ -127,6 +124,14 @@ Pod::Spec.new do |s|
|
||||
sss.header_dir = "react/renderer/components/iostextinput"
|
||||
end
|
||||
|
||||
ss.subspec "switch" do |sss|
|
||||
sss.source_files = podspec_sources(
|
||||
["react/renderer/components/switch/iosswitch/**/*.{m,mm,cpp,h}"],
|
||||
["react/renderer/components/switch/iosswitch/**/*.h"])
|
||||
sss.exclude_files = "react/renderer/components/switch/iosswitch/**/MacOS*.{m,mm,cpp,h}"
|
||||
sss.header_dir = "react/renderer/components/switch/"
|
||||
end
|
||||
|
||||
ss.subspec "textinput" do |sss|
|
||||
sss.source_files = podspec_sources("react/renderer/components/textinput/*.{m,mm,cpp,h}", "react/renderer/components/textinput/**/*.h")
|
||||
sss.header_dir = "react/renderer/components/textinput"
|
||||
|
||||
@@ -50,10 +50,7 @@ Pod::Spec.new do |s|
|
||||
"HEADER_SEARCH_PATHS" => header_search_path.join(" ")
|
||||
}
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.header_mappings_dir = './'
|
||||
s.module_name = 'React_FabricImage'
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: './', module_name: "React_FabricImage")
|
||||
|
||||
s.dependency "React-jsiexecutor", version
|
||||
s.dependency "RCTRequired", version
|
||||
|
||||
@@ -32,10 +32,7 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => ["\"$(PODS_TARGET_SRCROOT)\""], "USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.header_mappings_dir = './'
|
||||
s.module_name = 'React_Mapbuffer'
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: './', module_name: "React_Mapbuffer")
|
||||
|
||||
add_dependency(s, "React-debug")
|
||||
add_rn_third_party_dependencies(s)
|
||||
|
||||
@@ -32,9 +32,8 @@ Pod::Spec.new do |s|
|
||||
"DEFINES_MODULE" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"GCC_WARN_PEDANTIC" => "YES" }
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.header_mappings_dir = './'
|
||||
end
|
||||
|
||||
resolve_use_frameworks(s, header_mappings_dir: './')
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
|
||||
#define REACT_NATIVE_VERSION_MAJOR 0
|
||||
#define REACT_NATIVE_VERSION_MINOR 81
|
||||
#define REACT_NATIVE_VERSION_PATCH 0
|
||||
#define REACT_NATIVE_VERSION_PATCH 1
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
constexpr struct {
|
||||
int32_t Major = 0;
|
||||
int32_t Minor = 81;
|
||||
int32_t Patch = 0;
|
||||
std::string_view Prerelease = "rc.2";
|
||||
int32_t Patch = 1;
|
||||
std::string_view Prerelease = "";
|
||||
} ReactNativeVersion;
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
@@ -32,10 +32,7 @@ Pod::Spec.new do |s|
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"GCC_WARN_PEDANTIC" => "YES" }
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.header_mappings_dir = './'
|
||||
s.module_name = 'React_jsitracing'
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: './', module_name: "React_jsitracing")
|
||||
|
||||
s.dependency "React-jsi"
|
||||
end
|
||||
|
||||
@@ -33,10 +33,8 @@ Pod::Spec.new do |s|
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
|
||||
}
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.header_mappings_dir = '../'
|
||||
s.module_name = 'React_jserrorhandler'
|
||||
end
|
||||
|
||||
resolve_use_frameworks(s, header_mappings_dir: '../', module_name: "React_jserrorhandler")
|
||||
|
||||
s.dependency "React-jsi"
|
||||
s.dependency "React-cxxreact"
|
||||
|
||||
@@ -44,10 +44,9 @@ Pod::Spec.new do |s|
|
||||
"PUBLIC_HEADERS_FOLDER_PATH" => "#{module_name}.framework/Headers/#{header_dir}"
|
||||
} : {})
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.module_name = module_name
|
||||
end
|
||||
resolve_use_frameworks(s, module_name: module_name)
|
||||
|
||||
add_dependency(s, "React-oscompat") # Needed for USE_FRAMEWORKS=dynamic
|
||||
s.dependency "React-featureflags"
|
||||
add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"])
|
||||
s.dependency "React-jsi"
|
||||
|
||||
+1
-4
@@ -41,10 +41,7 @@ Pod::Spec.new do |s|
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"DEFINES_MODULE" => "YES"}
|
||||
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.module_name = module_name
|
||||
s.header_mappings_dir = "../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: module_name)
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
|
||||
+1
-4
@@ -41,10 +41,7 @@ Pod::Spec.new do |s|
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"DEFINES_MODULE" => "YES"}
|
||||
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.module_name = module_name
|
||||
s.header_mappings_dir = "../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: module_name)
|
||||
|
||||
add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp')
|
||||
add_dependency(s, "React-featureflags")
|
||||
|
||||
+1
-4
@@ -41,10 +41,7 @@ Pod::Spec.new do |s|
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"DEFINES_MODULE" => "YES"}
|
||||
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.module_name = module_name
|
||||
s.header_mappings_dir = "../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: module_name)
|
||||
|
||||
s.dependency "React-oscompat"
|
||||
s.dependency "React-timing"
|
||||
|
||||
@@ -28,10 +28,7 @@ Pod::Spec.new do |s|
|
||||
s.source_files = podspec_sources("react/runtime/*.{cpp,h}", "react/runtime/*.h")
|
||||
s.header_dir = "react/runtime"
|
||||
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.module_name = "JSITooling"
|
||||
s.header_mappings_dir = "./"
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "./", module_name: "JSITooling")
|
||||
|
||||
s.pod_target_xcconfig = {
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
|
||||
@@ -30,8 +30,5 @@ Pod::Spec.new do |s|
|
||||
s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"DEFINES_MODULE" => "YES" }
|
||||
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.module_name = "React_debug"
|
||||
s.header_mappings_dir = "../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_debug")
|
||||
end
|
||||
|
||||
@@ -37,10 +37,7 @@ Pod::Spec.new do |s|
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
|
||||
"DEFINES_MODULE" => "YES" }
|
||||
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.module_name = "React_featureflags"
|
||||
s.header_mappings_dir = "../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_featureflags")
|
||||
|
||||
add_rn_third_party_dependencies(s)
|
||||
add_rncore_dependency(s)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<f73bbcd926a835c09b70d814c6662dbb>>
|
||||
* @generated SignedSource<<2cabd888b74b84201ff027457efc6007>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -234,6 +234,14 @@ bool ReactNativeFeatureFlags::useFabricInterop() {
|
||||
return getAccessor().useFabricInterop();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::useNativeEqualsInNativeReadableArrayAndroid() {
|
||||
return getAccessor().useNativeEqualsInNativeReadableArrayAndroid();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::useNativeTransformHelperAndroid() {
|
||||
return getAccessor().useNativeTransformHelperAndroid();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode() {
|
||||
return getAccessor().useNativeViewConfigsInBridgelessMode();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<da14545268455bfd4cd35e5c2ecf81ee>>
|
||||
* @generated SignedSource<<e26a0c35f1499abf24e46275bbcbe06d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -299,6 +299,16 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool useFabricInterop();
|
||||
|
||||
/**
|
||||
* Use a native implementation of equals in NativeReadableArray.
|
||||
*/
|
||||
RN_EXPORT static bool useNativeEqualsInNativeReadableArrayAndroid();
|
||||
|
||||
/**
|
||||
* Use a native implementation of TransformHelper
|
||||
*/
|
||||
RN_EXPORT static bool useNativeTransformHelperAndroid();
|
||||
|
||||
/**
|
||||
* When enabled, the native view configs are used in bridgeless mode.
|
||||
*/
|
||||
|
||||
+44
-8
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<681bff71eb87886a108f67b3162b030c>>
|
||||
* @generated SignedSource<<7ae9a203a94e3a22197bc9eda69b741c>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -965,6 +965,42 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::useNativeEqualsInNativeReadableArrayAndroid() {
|
||||
auto flagValue = useNativeEqualsInNativeReadableArrayAndroid_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(52, "useNativeEqualsInNativeReadableArrayAndroid");
|
||||
|
||||
flagValue = currentProvider_->useNativeEqualsInNativeReadableArrayAndroid();
|
||||
useNativeEqualsInNativeReadableArrayAndroid_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::useNativeTransformHelperAndroid() {
|
||||
auto flagValue = useNativeTransformHelperAndroid_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(53, "useNativeTransformHelperAndroid");
|
||||
|
||||
flagValue = currentProvider_->useNativeTransformHelperAndroid();
|
||||
useNativeTransformHelperAndroid_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() {
|
||||
auto flagValue = useNativeViewConfigsInBridgelessMode_.load();
|
||||
|
||||
@@ -974,7 +1010,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(52, "useNativeViewConfigsInBridgelessMode");
|
||||
markFlagAsAccessed(54, "useNativeViewConfigsInBridgelessMode");
|
||||
|
||||
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
|
||||
useNativeViewConfigsInBridgelessMode_ = flagValue;
|
||||
@@ -992,7 +1028,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(53, "useOptimizedEventBatchingOnAndroid");
|
||||
markFlagAsAccessed(55, "useOptimizedEventBatchingOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid();
|
||||
useOptimizedEventBatchingOnAndroid_ = flagValue;
|
||||
@@ -1010,7 +1046,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(54, "useRawPropsJsiValue");
|
||||
markFlagAsAccessed(56, "useRawPropsJsiValue");
|
||||
|
||||
flagValue = currentProvider_->useRawPropsJsiValue();
|
||||
useRawPropsJsiValue_ = flagValue;
|
||||
@@ -1028,7 +1064,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(55, "useShadowNodeStateOnClone");
|
||||
markFlagAsAccessed(57, "useShadowNodeStateOnClone");
|
||||
|
||||
flagValue = currentProvider_->useShadowNodeStateOnClone();
|
||||
useShadowNodeStateOnClone_ = flagValue;
|
||||
@@ -1046,7 +1082,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(56, "useTurboModuleInterop");
|
||||
markFlagAsAccessed(58, "useTurboModuleInterop");
|
||||
|
||||
flagValue = currentProvider_->useTurboModuleInterop();
|
||||
useTurboModuleInterop_ = flagValue;
|
||||
@@ -1064,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(57, "useTurboModules");
|
||||
markFlagAsAccessed(59, "useTurboModules");
|
||||
|
||||
flagValue = currentProvider_->useTurboModules();
|
||||
useTurboModules_ = flagValue;
|
||||
@@ -1082,7 +1118,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(58, "virtualViewPrerenderRatio");
|
||||
markFlagAsAccessed(60, "virtualViewPrerenderRatio");
|
||||
|
||||
flagValue = currentProvider_->virtualViewPrerenderRatio();
|
||||
virtualViewPrerenderRatio_ = flagValue;
|
||||
|
||||
+6
-2
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<e5a8a196b35c010d92d3f616979891a9>>
|
||||
* @generated SignedSource<<74560113d0b23c05d7822eeba1c0dee4>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -84,6 +84,8 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool updateRuntimeShadowNodeReferencesOnCommit();
|
||||
bool useAlwaysAvailableJSErrorHandling();
|
||||
bool useFabricInterop();
|
||||
bool useNativeEqualsInNativeReadableArrayAndroid();
|
||||
bool useNativeTransformHelperAndroid();
|
||||
bool useNativeViewConfigsInBridgelessMode();
|
||||
bool useOptimizedEventBatchingOnAndroid();
|
||||
bool useRawPropsJsiValue();
|
||||
@@ -102,7 +104,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 59> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 61> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> animatedShouldSignalBatch_;
|
||||
@@ -156,6 +158,8 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> updateRuntimeShadowNodeReferencesOnCommit_;
|
||||
std::atomic<std::optional<bool>> useAlwaysAvailableJSErrorHandling_;
|
||||
std::atomic<std::optional<bool>> useFabricInterop_;
|
||||
std::atomic<std::optional<bool>> useNativeEqualsInNativeReadableArrayAndroid_;
|
||||
std::atomic<std::optional<bool>> useNativeTransformHelperAndroid_;
|
||||
std::atomic<std::optional<bool>> useNativeViewConfigsInBridgelessMode_;
|
||||
std::atomic<std::optional<bool>> useOptimizedEventBatchingOnAndroid_;
|
||||
std::atomic<std::optional<bool>> useRawPropsJsiValue_;
|
||||
|
||||
+9
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<9832c18e4c7ccf232b7222e2356f99d9>>
|
||||
* @generated SignedSource<<1a54000b8eb51cb91304902c7f722d45>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -235,6 +235,14 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool useNativeEqualsInNativeReadableArrayAndroid() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool useNativeTransformHelperAndroid() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool useNativeViewConfigsInBridgelessMode() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
+19
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<19f0a48bcfa8f8ffaf634e85301adc7e>>
|
||||
* @generated SignedSource<<244db790cc754f31402981967cd902b5>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -513,6 +513,24 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
||||
return ReactNativeFeatureFlagsDefaults::useFabricInterop();
|
||||
}
|
||||
|
||||
bool useNativeEqualsInNativeReadableArrayAndroid() override {
|
||||
auto value = values_["useNativeEqualsInNativeReadableArrayAndroid"];
|
||||
if (!value.isNull()) {
|
||||
return value.getBool();
|
||||
}
|
||||
|
||||
return ReactNativeFeatureFlagsDefaults::useNativeEqualsInNativeReadableArrayAndroid();
|
||||
}
|
||||
|
||||
bool useNativeTransformHelperAndroid() override {
|
||||
auto value = values_["useNativeTransformHelperAndroid"];
|
||||
if (!value.isNull()) {
|
||||
return value.getBool();
|
||||
}
|
||||
|
||||
return ReactNativeFeatureFlagsDefaults::useNativeTransformHelperAndroid();
|
||||
}
|
||||
|
||||
bool useNativeViewConfigsInBridgelessMode() override {
|
||||
auto value = values_["useNativeViewConfigsInBridgelessMode"];
|
||||
if (!value.isNull()) {
|
||||
|
||||
+9
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<f33ea0f19a27ec6124d8dbf1a043b4ce>>
|
||||
* @generated SignedSource<<a045579d42e45fa80831856734a063aa>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -30,6 +30,14 @@ class ReactNativeFeatureFlagsOverridesOSSExperimental : public ReactNativeFeatur
|
||||
bool preventShadowTreeCommitExhaustion() override {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool useNativeEqualsInNativeReadableArrayAndroid() override {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool useNativeTransformHelperAndroid() override {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
+3
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<815769cc8d08e19b2598dd1862ed5060>>
|
||||
* @generated SignedSource<<2387ed12fe46fb5b606ad13a17511f03>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -77,6 +77,8 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool updateRuntimeShadowNodeReferencesOnCommit() = 0;
|
||||
virtual bool useAlwaysAvailableJSErrorHandling() = 0;
|
||||
virtual bool useFabricInterop() = 0;
|
||||
virtual bool useNativeEqualsInNativeReadableArrayAndroid() = 0;
|
||||
virtual bool useNativeTransformHelperAndroid() = 0;
|
||||
virtual bool useNativeViewConfigsInBridgelessMode() = 0;
|
||||
virtual bool useOptimizedEventBatchingOnAndroid() = 0;
|
||||
virtual bool useRawPropsJsiValue() = 0;
|
||||
|
||||
+2
-3
@@ -31,9 +31,8 @@ Pod::Spec.new do |s|
|
||||
"USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"GCC_WARN_PEDANTIC" => "YES" }
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.header_mappings_dir = './'
|
||||
end
|
||||
|
||||
resolve_use_frameworks(s, header_mappings_dir: './')
|
||||
|
||||
s.source_files = podspec_sources("ReactCommon/**/*.{mm,cpp,h}", "ReactCommon/**/*.{h}")
|
||||
|
||||
|
||||
+1
-4
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
|
||||
"OTHER_CFLAGS" => "$(inherited)",
|
||||
"DEFINES_MODULE" => "YES" }
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.module_name = "React_defaultsnativemodule"
|
||||
s.header_mappings_dir = "../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_defaultsnativemodule")
|
||||
|
||||
s.dependency "React-jsi"
|
||||
s.dependency "React-jsiexecutor"
|
||||
|
||||
+1
-4
@@ -40,10 +40,7 @@ Pod::Spec.new do |s|
|
||||
"OTHER_CFLAGS" => "$(inherited)",
|
||||
"DEFINES_MODULE" => "YES" }
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.module_name = "React_domnativemodule"
|
||||
s.header_mappings_dir = "../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_domnativemodule")
|
||||
|
||||
s.dependency "React-jsi"
|
||||
s.dependency "React-jsiexecutor"
|
||||
|
||||
+11
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<474a64af739969acebb4bb9bb1005168>>
|
||||
* @generated SignedSource<<45e1b08fd2438b27af82591b5cfa5744>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -304,6 +304,16 @@ bool NativeReactNativeFeatureFlags::useFabricInterop(
|
||||
return ReactNativeFeatureFlags::useFabricInterop();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::useNativeEqualsInNativeReadableArrayAndroid(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::useNativeEqualsInNativeReadableArrayAndroid();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::useNativeTransformHelperAndroid(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::useNativeTransformHelperAndroid();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode();
|
||||
|
||||
+5
-1
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<bfaa3cc7ab3eeff306337b06b7ae978a>>
|
||||
* @generated SignedSource<<d1862a9ce3cfeda5d140941fcd3b25bc>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -140,6 +140,10 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool useFabricInterop(jsi::Runtime& runtime);
|
||||
|
||||
bool useNativeEqualsInNativeReadableArrayAndroid(jsi::Runtime& runtime);
|
||||
|
||||
bool useNativeTransformHelperAndroid(jsi::Runtime& runtime);
|
||||
|
||||
bool useNativeViewConfigsInBridgelessMode(jsi::Runtime& runtime);
|
||||
|
||||
bool useOptimizedEventBatchingOnAndroid(jsi::Runtime& runtime);
|
||||
|
||||
+1
-4
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
|
||||
"OTHER_CFLAGS" => "$(inherited)",
|
||||
"DEFINES_MODULE" => "YES" }
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.module_name = "React_featureflagsnativemodule"
|
||||
s.header_mappings_dir = "../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_featureflagsnativemodule")
|
||||
|
||||
s.dependency "React-jsi"
|
||||
s.dependency "React-jsiexecutor"
|
||||
|
||||
+1
-4
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
|
||||
"OTHER_CFLAGS" => "$(inherited)",
|
||||
"DEFINES_MODULE" => "YES" }
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.module_name = "idlecallbacksnativemodule"
|
||||
s.header_mappings_dir = "../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "idlecallbacksnativemodule")
|
||||
|
||||
s.dependency "React-jsi"
|
||||
s.dependency "React-jsiexecutor"
|
||||
|
||||
+1
-4
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
|
||||
"DEFINES_MODULE" => "YES" }
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
s.module_name = "React_microtasksnativemodule"
|
||||
s.header_mappings_dir = "../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_microtasksnativemodule")
|
||||
|
||||
s.dependency "React-jsi"
|
||||
s.dependency "React-jsiexecutor"
|
||||
|
||||
+2
@@ -40,6 +40,8 @@ Pod::Spec.new do |s|
|
||||
s.framework = "UIKit"
|
||||
|
||||
if ENV['USE_FRAMEWORKS']
|
||||
# Do not use resolve_use_frameworks here - since we're including source files.
|
||||
# Then it is not needed.
|
||||
s.header_mappings_dir = './'
|
||||
end
|
||||
|
||||
|
||||
+1
-4
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')}
|
||||
|
||||
if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
|
||||
s.module_name = "React_performancetimeline"
|
||||
s.header_mappings_dir = "../../.."
|
||||
end
|
||||
resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_performancetimeline")
|
||||
|
||||
s.dependency "React-featureflags"
|
||||
add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing')
|
||||
|
||||
+30
@@ -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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "AppleSwitchShadowNode.h"
|
||||
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
/*
|
||||
* Descriptor for <Switch> component.
|
||||
*/
|
||||
class SwitchComponentDescriptor final
|
||||
: public ConcreteComponentDescriptor<SwitchShadowNode> {
|
||||
public:
|
||||
SwitchComponentDescriptor(const ComponentDescriptorParameters& parameters)
|
||||
: ConcreteComponentDescriptor(parameters) {}
|
||||
|
||||
void adopt(ShadowNode& shadowNode) const override {
|
||||
ConcreteComponentDescriptor::adopt(shadowNode);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/FBReactNativeSpec/EventEmitters.h>
|
||||
#include <react/renderer/components/FBReactNativeSpec/Props.h>
|
||||
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
extern const char AppleSwitchComponentName[];
|
||||
|
||||
/*
|
||||
* `ShadowNode` for <IOSSwitch> component.
|
||||
*/
|
||||
class SwitchShadowNode final : public ConcreteViewShadowNode<
|
||||
AppleSwitchComponentName,
|
||||
SwitchProps,
|
||||
SwitchEventEmitter> {
|
||||
public:
|
||||
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
||||
|
||||
static ShadowNodeTraits BaseTraits() {
|
||||
auto traits = ConcreteViewShadowNode::BaseTraits();
|
||||
traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
|
||||
traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);
|
||||
return traits;
|
||||
}
|
||||
|
||||
#pragma mark - LayoutableShadowNode
|
||||
|
||||
Size measureContent(
|
||||
const LayoutContext& layoutContext,
|
||||
const LayoutConstraints& layoutConstraints) const override;
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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/RCTUtils.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#include "AppleSwitchShadowNode.h"
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
extern const char AppleSwitchComponentName[] = "Switch";
|
||||
|
||||
#pragma mark - LayoutableShadowNode
|
||||
|
||||
Size SwitchShadowNode::measureContent(
|
||||
const LayoutContext & /*layoutContext*/,
|
||||
const LayoutConstraints & /*layoutConstraints*/) const
|
||||
{
|
||||
CGSize uiSwitchSize = RCTSwitchSize();
|
||||
// Apple has some error when returning the width of the component and it doesn't
|
||||
// account for the borders.
|
||||
return {.width = uiSwitchSize.width + 2, .height = uiSwitchSize.height};
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 <AppKit/AppKit.h>
|
||||
#include "AppleSwitchShadowNode.h"
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
extern const char AppleSwitchComponentName[] = "Switch";
|
||||
|
||||
#pragma mark - LayoutableShadowNode
|
||||
|
||||
Size SwitchShadowNode::measureContent(
|
||||
const LayoutContext & /*layoutContext*/,
|
||||
const LayoutConstraints & /*layoutConstraints*/) const
|
||||
{
|
||||
static CGSize nsSwitchSize = CGSizeZero;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
nsSwitchSize = [NSSwitch new].intrinsicContentSize;
|
||||
});
|
||||
});
|
||||
|
||||
return {.width = nsSwitchSize.width, .height = nsSwitchSize.height};
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
+2
-1
@@ -13,6 +13,7 @@
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -60,7 +61,7 @@ class BaseTextInputProps : public ViewProps, public BaseTextProps {
|
||||
// TODO: Rename to `tintColor` and make universal.
|
||||
SharedColor underlineColorAndroid{};
|
||||
|
||||
int maxLength{};
|
||||
int maxLength = std::numeric_limits<int>::max();
|
||||
|
||||
/*
|
||||
* "Private" (only used by TextInput.js) props
|
||||
|
||||
@@ -550,6 +550,13 @@ BorderMetrics BaseViewProps::resolveBorderMetrics(
|
||||
Transform BaseViewProps::resolveTransform(
|
||||
const LayoutMetrics& layoutMetrics) const {
|
||||
const auto& frameSize = layoutMetrics.frame.size;
|
||||
return resolveTransform(frameSize, transform, transformOrigin);
|
||||
}
|
||||
|
||||
Transform BaseViewProps::resolveTransform(
|
||||
const Size& frameSize,
|
||||
const Transform& transform,
|
||||
const TransformOrigin& transformOrigin) {
|
||||
auto transformMatrix = Transform{};
|
||||
if (frameSize.width == 0 && frameSize.height == 0) {
|
||||
return transformMatrix;
|
||||
@@ -562,8 +569,7 @@ Transform BaseViewProps::resolveTransform(
|
||||
} else {
|
||||
for (const auto& operation : transform.operations) {
|
||||
transformMatrix = transformMatrix *
|
||||
Transform::FromTransformOperation(
|
||||
operation, layoutMetrics.frame.size, transform);
|
||||
Transform::FromTransformOperation(operation, frameSize, transform);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +115,11 @@ class BaseViewProps : public YogaStylableProps, public AccessibilityProps {
|
||||
Transform resolveTransform(const LayoutMetrics& layoutMetrics) const;
|
||||
bool getClipsContentToBounds() const;
|
||||
|
||||
static Transform resolveTransform(
|
||||
const Size& frameSize,
|
||||
const Transform& transform,
|
||||
const TransformOrigin& transformOrigin);
|
||||
|
||||
#if RN_DEBUG_STRING_CONVERTIBLE
|
||||
SharedDebugStringConvertibleList getDebugProps() const override;
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user