From d0fed3adb6ea0524f0e3157d394a06c65aa9ef30 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 31 May 2023 13:02:12 -0700 Subject: [PATCH 001/468] Remove noexcept from UIManager methods that invoke JavaScript callbacks Summary: As far as I'm aware, there's no way to know/guarantee whether a JavaScript callback can throw an exception or not. So, all UIManager methods that synchronously invoke JavaScript callbacks cannot use noexcept. If they do use noexcept, and the JavaScript callback (i.e: product code) throws an exception, the app will crash. Changelog: [Internal] Created from CodeHub with https://fburl.com/edit-in-codehub Reviewed By: javache Differential Revision: D46122985 fbshipit-source-id: 2f4356c7dbab1b3a5e0549f58e73f6de1b626ce9 --- .../react/renderer/uimanager/UIManagerBinding.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp index 885c88da4ab980..f9c0580a228553 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp @@ -249,7 +249,7 @@ jsi::Value UIManagerBinding::get( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t /*count*/) { auto node = shadowNodeFromValue(runtime, arguments[0]); auto locationX = (Float)arguments[1].getNumber(); auto locationY = (Float)arguments[2].getNumber(); @@ -538,7 +538,7 @@ jsi::Value UIManagerBinding::get( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t /*count*/) { auto layoutMetrics = uiManager->getRelativeLayoutMetrics( *shadowNodeFromValue(runtime, arguments[0]), shadowNodeFromValue(runtime, arguments[1]).get(), @@ -574,7 +574,7 @@ jsi::Value UIManagerBinding::get( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t /*count*/) { auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); auto layoutMetrics = uiManager->getRelativeLayoutMetrics( *shadowNode, nullptr, {/* .includeTransform = */ true}); @@ -616,7 +616,7 @@ jsi::Value UIManagerBinding::get( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t /*count*/) { auto layoutMetrics = uiManager->getRelativeLayoutMetrics( *shadowNodeFromValue(runtime, arguments[0]), nullptr, From 70f3a264e2f34fa3a091afb7505b718ee5251ff7 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 31 May 2023 15:20:57 -0700 Subject: [PATCH 002/468] Remove unnecessary dependency on aapt2-linux (#37643) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37643 We needed this change for offline mirrors which we don't use anymore, so we can remove this extra dependency (it will make the build a little faster also which is never bad). Changelog: [Internal] [Changed] - Remove unnecessary dependency on aapt2-linux Reviewed By: mdvacca Differential Revision: D46318725 fbshipit-source-id: a86b43fff6a11844acff88791af0578d79d7fdbf --- packages/react-native/ReactAndroid/build.gradle | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/react-native/ReactAndroid/build.gradle b/packages/react-native/ReactAndroid/build.gradle index d65e409316adf2..25ba3cbcda958c 100644 --- a/packages/react-native/ReactAndroid/build.gradle +++ b/packages/react-native/ReactAndroid/build.gradle @@ -711,12 +711,6 @@ dependencies { androidTestImplementation("androidx.test:runner:${ANDROIDX_TEST_VERSION}") androidTestImplementation("androidx.test:rules:${ANDROIDX_TEST_VERSION}") androidTestImplementation("org.mockito:mockito-core:${MOCKITO_CORE_VERSION}") - - // This compileOnly dependency is needed to be able to update the offline - // mirror from a non-linux machine, while still executing inside a Linux CI - // as we declare a dependency on aap2 @linux so we're sure the linux artifact - // gets downloaded at some point. - compileOnly("com.android.tools.build:aapt2:7.4.2-8841542:linux") } react { From e2d512a1eef9950d3475c95dee8d2474a5723d74 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 31 May 2023 16:13:05 -0700 Subject: [PATCH 003/468] Delete bridge.loadAndExecuteSplitBundleURL Summary: Changelog: [iOS][Removed] - Delete bridge.loadAndExecuteSplitBundleURL Reviewed By: cortinico Differential Revision: D46166549 fbshipit-source-id: a0854e4abcdd11542629f5f6bbce89c45e30e9cd --- packages/react-native/React/Base/RCTBridge.h | 7 ---- packages/react-native/React/Base/RCTBridge.m | 7 ---- .../React/CxxBridge/RCTCxxBridge.mm | 36 ------------------- 3 files changed, 50 deletions(-) diff --git a/packages/react-native/React/Base/RCTBridge.h b/packages/react-native/React/Base/RCTBridge.h index 2a55a8a730d33f..d863f17a7466a7 100644 --- a/packages/react-native/React/Base/RCTBridge.h +++ b/packages/react-native/React/Base/RCTBridge.h @@ -227,11 +227,4 @@ RCT_EXTERN void RCTSetTurboModuleCleanupMode(RCTTurboModuleCleanupMode mode); */ - (BOOL)isBatchActive; -/** - * Loads and executes additional bundles in the VM for development. - */ -- (void)loadAndExecuteSplitBundleURL:(NSURL *)bundleURL - onError:(RCTLoadAndExecuteErrorBlock)onError - onComplete:(dispatch_block_t)onComplete; - @end diff --git a/packages/react-native/React/Base/RCTBridge.m b/packages/react-native/React/Base/RCTBridge.m index b7eb3d7129031d..e9a521ccce0141 100644 --- a/packages/react-native/React/Base/RCTBridge.m +++ b/packages/react-native/React/Base/RCTBridge.m @@ -420,11 +420,4 @@ - (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path [self.batchedBridge registerSegmentWithId:segmentId path:path]; } -- (void)loadAndExecuteSplitBundleURL:(NSURL *)bundleURL - onError:(RCTLoadAndExecuteErrorBlock)onError - onComplete:(dispatch_block_t)onComplete -{ - [self.batchedBridge loadAndExecuteSplitBundleURL:bundleURL onError:onError onComplete:onComplete]; -} - @end diff --git a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm index 2d11205b006d36..a23413895768c1 100644 --- a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm +++ b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm @@ -1089,42 +1089,6 @@ - (void)executeSourceCode:(NSData *)sourceCode withSourceURL:(NSURL *)url sync:( [self.devSettings setupHMRClientWithBundleURL:self.bundleURL]; } -#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY -- (void)loadAndExecuteSplitBundleURL:(NSURL *)bundleURL - onError:(RCTLoadAndExecuteErrorBlock)onError - onComplete:(dispatch_block_t)onComplete -{ - __weak __typeof(self) weakSelf = self; - [RCTJavaScriptLoader loadBundleAtURL:bundleURL - onProgress:^(RCTLoadingProgress *progressData) { -#if (RCT_DEV_MENU | RCT_DEV_MENU) && __has_include() - id loadingView = [weakSelf moduleForName:@"DevLoadingView" - lazilyLoadIfNecessary:YES]; - [loadingView updateProgress:progressData]; -#endif - } - onComplete:^(NSError *error, RCTSource *source) { - if (error) { - onError(error); - return; - } - - [self enqueueApplicationScript:source.data - url:source.url - onComplete:^{ - [self.devSettings setupHMRClientWithAdditionalBundleURL:source.url]; - onComplete(); - }]; - }]; -} -#else -- (void)loadAndExecuteSplitBundleURL:(NSURL *)bundleURL - onError:(RCTLoadAndExecuteErrorBlock)onError - onComplete:(dispatch_block_t)onComplete -{ -} -#endif - - (void)handleError:(NSError *)error { // This is generally called when the infrastructure throws an From 197ed4369782365e57b7035987ed1a94d501e1f5 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 31 May 2023 16:13:05 -0700 Subject: [PATCH 004/468] Export moduleIsInitialized from RCTModuleRegistry Summary: ## Context Product code can query the Bridge, or the TurboModuleManager, to see whether a native module has been initialized or not. But, this API doesn't exist in RCTModuleRegistry. ## Changes This diff exports moduleIsInitialized: from RCTModuleRegistry. That way, RCTBridgeProxy (introduce in D46088752) can more easily implement the moduleIsInitialized: API. Changelog: [iOS][Added] - Introduce RCTModuleRegistry moduleIsInitialized: Reviewed By: cortinico Differential Revision: D46166548 fbshipit-source-id: c9954273e511083276aeb911dd58719cf4a11f10 --- .../react-native/React/Base/RCTBridgeModule.h | 1 + .../react-native/React/Base/RCTModuleRegistry.m | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/react-native/React/Base/RCTBridgeModule.h b/packages/react-native/React/Base/RCTBridgeModule.h index cc429c410f58ab..7e7cf91cd6cfa6 100644 --- a/packages/react-native/React/Base/RCTBridgeModule.h +++ b/packages/react-native/React/Base/RCTBridgeModule.h @@ -390,6 +390,7 @@ RCT_EXTERN_C_END - (id)moduleForName:(const char *)moduleName; - (id)moduleForName:(const char *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoad; +- (BOOL)moduleIsInitialized:(Class)moduleClass; @end typedef UIView * (^RCTBridgelessComponentViewProvider)(NSNumber *); diff --git a/packages/react-native/React/Base/RCTModuleRegistry.m b/packages/react-native/React/Base/RCTModuleRegistry.m index 98dd082fe8ee90..4b2c15e0a5d401 100644 --- a/packages/react-native/React/Base/RCTModuleRegistry.m +++ b/packages/react-native/React/Base/RCTModuleRegistry.m @@ -47,4 +47,21 @@ - (id)moduleForName:(const char *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyL return module; } +- (BOOL)moduleIsInitialized:(Class)moduleClass +{ + RCTBridge *bridge = _bridge; + + if (bridge) { + return [bridge moduleIsInitialized:moduleClass]; + } + + id turboModuleRegistry = _turboModuleRegistry; + if (turboModuleRegistry) { + NSString *moduleName = RCTBridgeModuleNameForClass(moduleClass); + return [turboModuleRegistry moduleIsInitialized:[moduleName UTF8String]]; + } + + return NO; +} + @end From 462c648b58a536cc9437d49b1f644e34d95230a1 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 31 May 2023 16:13:05 -0700 Subject: [PATCH 005/468] Interop: Create gating for the Bridge proxy Summary: The TurboModule interop layer on iOS will ship with a Bridge proxy. The Bridge proxy is an object (see D46084318) that will try to simulate the Bridge's APIs, whenever possible, by delegating to Bridgeless abstractions. ## Changes **Fact:** All FBiOS modules work with/without the bridge. So, let's break down the Interop layer test group (i.e: interop on) into two groups: - interop on, bridge proxy off - interop on, bridge proxy on ## Benefits This will speed up the production test, by allowing us to: 1. Isolate Interop issues to the bridge proxy faster. 2. Stabilize the TurboModule interop layer faster. NOTE: This flag is temporary, and should be removed long-term: The TurboModule interop layer should ship with the bridge proxy enabled by default. Changelog: [Internal] Reviewed By: philIip Differential Revision: D46088752 fbshipit-source-id: 1e161d49382635a44194166645c1a5d56d37b4de --- packages/react-native/React/Base/RCTBridge.h | 4 ++++ packages/react-native/React/Base/RCTBridge.m | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/packages/react-native/React/Base/RCTBridge.h b/packages/react-native/React/Base/RCTBridge.h index d863f17a7466a7..92545c4317ebe5 100644 --- a/packages/react-native/React/Base/RCTBridge.h +++ b/packages/react-native/React/Base/RCTBridge.h @@ -60,6 +60,10 @@ RCT_EXTERN void RCTDisableTurboModuleManagerDelegateLocking(BOOL enabled); RCT_EXTERN BOOL RCTTurboModuleInteropEnabled(void); RCT_EXTERN void RCTEnableTurboModuleInterop(BOOL enabled); +// Turn on TurboModule interop's Bridge proxy +RCT_EXTERN BOOL RCTTurboModuleInteropBridgeProxyEnabled(void); +RCT_EXTERN void RCTEnableTurboModuleInteropBridgeProxy(BOOL enabled); + // Route all TurboModules through TurboModule interop RCT_EXTERN BOOL RCTTurboModuleInteropForAllTurboModulesEnabled(void); RCT_EXTERN void RCTEnableTurboModuleInteropForAllTurboModules(BOOL enabled); diff --git a/packages/react-native/React/Base/RCTBridge.m b/packages/react-native/React/Base/RCTBridge.m index e9a521ccce0141..b8300f27f073b8 100644 --- a/packages/react-native/React/Base/RCTBridge.m +++ b/packages/react-native/React/Base/RCTBridge.m @@ -130,6 +130,17 @@ void RCTEnableTurboModuleInterop(BOOL enabled) turboModuleInteropEnabled = enabled; } +static BOOL turboModuleInteropBridgeProxyEnabled = NO; +BOOL RCTTurboModuleInteropBridgeProxyEnabled(void) +{ + return turboModuleInteropBridgeProxyEnabled; +} + +void RCTEnableTurboModuleInteropBridgeProxy(BOOL enabled) +{ + turboModuleInteropBridgeProxyEnabled = enabled; +} + static BOOL useTurboModuleInteropForAllTurboModules = NO; BOOL RCTTurboModuleInteropForAllTurboModulesEnabled(void) { From ddb8aeadbb0a5f6856abd9c04eb730fb2bb13332 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 31 May 2023 23:23:17 -0700 Subject: [PATCH 006/468] Enable mock-maker-inline for Android JVM tests (#37646) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37646 I'm re-enabling a test that got disabled due to us not using mock-maker-inline in OSS. I'm also adding `mock-maker-inline` for OSS so it will be easier to convert tests to Kotlin as classes in Kotlin are final by default. Changelog: [Internal] [Changed] - Enable mock-maker-inline for Android JVM tests Reviewed By: NickGerleman Differential Revision: D46222913 fbshipit-source-id: b7da0616994888c2800c193a1bb8e233d2c18288 --- .../com/facebook/react/bridgeless/ReactHostDelegateTest.kt | 2 -- .../react/modules/deviceinfo/DeviceInfoModuleTest.java | 3 ++- .../resources/mockito-extensions/org.mockito.plugins.MockMaker | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 packages/react-native/ReactAndroid/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostDelegateTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostDelegateTest.kt index a65823b4165f60..4bc2ed9c6b2b5e 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostDelegateTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostDelegateTest.kt @@ -14,7 +14,6 @@ import com.facebook.react.defaults.DefaultReactHostDelegate import com.facebook.react.turbomodule.core.TurboModuleManagerDelegate import com.facebook.testutils.shadows.ShadowSoLoader import org.assertj.core.api.Assertions.assertThat -import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito @@ -31,7 +30,6 @@ class ReactHostDelegateTest { * API */ @Test - @Ignore fun testDefaultReactHostDelegateCreation() { val jsBundleLoader: JSBundleLoader = Mockito.mock(JSBundleLoader::class.java) val turboModuleManagerDelegateMock: TurboModuleManagerDelegate = diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java index d80a81872038b3..62890cbfe8d64e 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java @@ -126,7 +126,8 @@ public void test_itEmitsMultipleEvents_whenDisplayMetricsChangedBetweenUpdates() } private static void givenDisplayMetricsHolderContains(final WritableMap fakeDisplayMetrics) { - when(DisplayMetricsHolder.getDisplayMetricsWritableMap(1.0)).thenReturn(fakeDisplayMetrics); + when(DisplayMetricsHolder.getDisplayMetricsWritableMap(1.0)) + .thenAnswer(invocation -> fakeDisplayMetrics); } private static void verifyUpdateDimensionsEventsEmitted( diff --git a/packages/react-native/ReactAndroid/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/packages/react-native/ReactAndroid/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 00000000000000..1f0955d450f0dc --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline From daf6e53ae17a5d3724be9e223d7d8af7c6ced18c Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Thu, 1 Jun 2023 00:19:14 -0700 Subject: [PATCH 007/468] Upgrade to Flow v0.207.0 (#37601) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37601 Changelog: [Internal] Reviewed By: pieterv Differential Revision: D46225499 fbshipit-source-id: d7d444d5bd53fd4ddb97f884fa121548a7a923e1 --- .flowconfig | 2 +- .flowconfig.android | 2 +- package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.flowconfig b/.flowconfig index 33da5ca8a7f069..c09b7d604226c4 100644 --- a/.flowconfig +++ b/.flowconfig @@ -75,4 +75,4 @@ untyped-import untyped-type-import [version] -^0.206.0 +^0.207.0 diff --git a/.flowconfig.android b/.flowconfig.android index 618bb734f08468..e9103ee5a650d2 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -75,4 +75,4 @@ untyped-import untyped-type-import [version] -^0.206.0 +^0.207.0 diff --git a/package.json b/package.json index 27e5216b7e6bb8..6bfad30679abb3 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "eslint-plugin-react-native": "^4.0.0", "eslint-plugin-redundant-undefined": "^0.4.0", "eslint-plugin-relay": "^1.8.3", - "flow-bin": "^0.206.0", + "flow-bin": "^0.207.0", "hermes-eslint": "0.8.0", "inquirer": "^7.1.0", "jest": "^29.2.1", diff --git a/yarn.lock b/yarn.lock index 8b76bfad3e0ea3..45cbbc30af4916 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5601,10 +5601,10 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== -flow-bin@^0.206.0: - version "0.206.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.206.0.tgz#a593304be5440a965ae773efcef55071b6d33178" - integrity sha512-cZTEs/OEWcbxfvb8BP+Fw0Cep5wrEyEzQHGpXyjVpQXrAraRA5wZUXvTf1C5YHufQaAYY9YkKY5WAr461JvmOA== +flow-bin@^0.207.0: + version "0.207.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.207.0.tgz#71c6a21214c57f3e36e03b32033dd0358452499b" + integrity sha512-jAet+lhdrvpk4kjonZ6r/v09rkyaPQX+E5gio+HesEBvsOsCWfnuadBRQZihTM4+szjJPWEkITfrCurI/aCqEQ== flow-enums-runtime@^0.0.6: version "0.0.6" From b66ab2c15498d1e236220cb6c94a5f3e807621dd Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 1 Jun 2023 03:24:45 -0700 Subject: [PATCH 008/468] Configure JDK Toolchain to 11 for all the 3rd party libraries. (#37575) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37575 This fixes the behavior reported in https://github.com/reactwg/react-native-releases/discussions/54#discussioncomment-5984629 by forcing all the libraries to compile with JDK 11. This prevents build issues when on Gradle 8 and Kotlin 1.8 Changelog: [Internal] [Changed] - Configure JDK Toolchain to 11 for all the 3rd party libraries Reviewed By: cipolleschi Differential Revision: D46190989 fbshipit-source-id: c88974d24efc2c35b01f28d41af0d0515d63d765 --- .../kotlin/com/facebook/react/ReactPlugin.kt | 4 ++- .../react/utils/JdkConfiguratorUtils.kt | 36 +++++++++++++------ .../com/facebook/react/utils/PropertyUtils.kt | 18 ++++++++++ 3 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PropertyUtils.kt diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt index 8663111ce17768..709f1097142425 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt @@ -66,7 +66,6 @@ class ReactPlugin : Plugin { configureBuildConfigFields(project) configureDevPorts(project) configureBackwardCompatibilityReactMap(project) - configureJavaToolChains(project) project.extensions.getByType(AndroidComponentsExtension::class.java).apply { onVariants(selector().all()) { variant -> @@ -80,6 +79,9 @@ class ReactPlugin : Plugin { project.pluginManager.withPlugin("com.android.library") { configureCodegen(project, extension, rootExtension, isLibrary = true) } + + // Library and App Configurations + configureJavaToolChains(project) } private fun checkJvmVersion(project: Project) { diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/JdkConfiguratorUtils.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/JdkConfiguratorUtils.kt index c86484ab5249c5..b54ea52404f226 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/JdkConfiguratorUtils.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/JdkConfiguratorUtils.kt @@ -8,26 +8,40 @@ package com.facebook.react.utils import com.android.build.api.variant.AndroidComponentsExtension +import com.facebook.react.utils.PropertyUtils.INTERNAL_DISABLE_JAVA_VERSION_ALIGNMENT +import org.gradle.api.Action import org.gradle.api.JavaVersion import org.gradle.api.Project +import org.gradle.api.plugins.AppliedPlugin import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension internal object JdkConfiguratorUtils { /** - * Function that takes care of configuring the JDK toolchain for Application projects. As we do - * decide the JDK version based on the AGP version that RNGP brings over, here we can safely + * Function that takes care of configuring the JDK toolchain for all the projects projects. As we + * do decide the JDK version based on the AGP version that RNGP brings over, here we can safely * configure the toolchain to 11. */ - fun configureJavaToolChains(project: Project) { - project.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext -> - ext.compileOptions.sourceCompatibility = JavaVersion.VERSION_11 - ext.compileOptions.targetCompatibility = JavaVersion.VERSION_11 + fun configureJavaToolChains(input: Project) { + if (input.hasProperty(INTERNAL_DISABLE_JAVA_VERSION_ALIGNMENT)) { + return } - project.pluginManager.withPlugin("org.jetbrains.kotlin.android") { - project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(11) - } - project.pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { - project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(11) + input.rootProject.allprojects { project -> + val action = + Action { + project.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext + -> + ext.compileOptions.sourceCompatibility = JavaVersion.VERSION_11 + ext.compileOptions.targetCompatibility = JavaVersion.VERSION_11 + } + } + project.pluginManager.withPlugin("com.android.application", action) + project.pluginManager.withPlugin("com.android.library", action) + project.pluginManager.withPlugin("org.jetbrains.kotlin.android") { + project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(11) + } + project.pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { + project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(11) + } } } } diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PropertyUtils.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PropertyUtils.kt new file mode 100644 index 00000000000000..3f9b5663d51ddc --- /dev/null +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PropertyUtils.kt @@ -0,0 +1,18 @@ +/* + * 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.react.utils + +/** Collection of all the Gradle Propreties that are accepted by React Native Gradle Plugin. */ +object PropertyUtils { + + /** + * Internal Property that acts as a killswitch to configure the JDK version and align it for app + * and all the libraries. + */ + const val INTERNAL_DISABLE_JAVA_VERSION_ALIGNMENT = "react.internal.disableJavaVersionAlignment" +} From b50874cad41f06519a263fa53d15f76c836fd167 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 1 Jun 2023 04:53:03 -0700 Subject: [PATCH 009/468] Remove missing dependencies from React-Fabric (#37652) Summary: When reverting the runtimescheduler fix, we forgot to remove some lines from the React-Fabric dependencies. This broke pod install and we have a red ci since then. bypass-github-export-checks ## Changelog: [iOS][Fixed] - fix React-Fabric dependencies Pull Request resolved: https://github.com/facebook/react-native/pull/37652 Test Plan: CircleCI is green Reviewed By: cipolleschi Differential Revision: D46349504 Pulled By: sammy-SC fbshipit-source-id: 8fc1bca7838a913adba702033d06dd02b93c31f9 --- .../Libraries/AppDelegate/RCTAppDelegate.mm | 8 +- .../ReactCommon/React-Fabric.podspec | 6 +- packages/rn-tester/RNTester/AppDelegate.mm | 112 ------------------ 3 files changed, 4 insertions(+), 122 deletions(-) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index a6fcb5094765fa..808c315c2f1bf4 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -134,10 +134,10 @@ - (BOOL)runtimeSchedulerEnabled return YES; } +#if RCT_NEW_ARCH_ENABLED #pragma mark - RCTCxxBridgeDelegate - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge { -#if RCT_NEW_ARCH_ENABLED _runtimeScheduler = std::make_shared(RCTRuntimeExecutorFromBridge(bridge)); std::shared_ptr callInvoker = std::make_shared(_runtimeScheduler); @@ -147,12 +147,6 @@ - (BOOL)runtimeSchedulerEnabled _contextContainer->erase("RuntimeScheduler"); _contextContainer->insert("RuntimeScheduler", _runtimeScheduler); return RCTAppSetupDefaultJsExecutorFactory(bridge, turboModuleManager, _runtimeScheduler); -#else - if (self.runtimeSchedulerEnabled) { - _runtimeScheduler = std::make_shared(RCTRuntimeExecutorFromBridge(bridge)); - } - return RCTAppSetupJsExecutorFactoryForOldArch(bridge, _runtimeScheduler); -#endif } #pragma mark - RCTTurboModuleManagerDelegate diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index 9ad649073b39ff..50c8a74168512c 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -51,9 +51,9 @@ Pod::Spec.new do |s| s.dependency "glog" s.dependency "DoubleConversion" s.dependency "React-Core" - s.dependency "React-debug" - s.dependency "React-utils" - s.dependency "React-runtimescheduler" + # s.dependency "React-debug" + # s.dependency "React-utils" + # s.dependency "React-runtimescheduler" s.dependency "React-cxxreact" if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" diff --git a/packages/rn-tester/RNTester/AppDelegate.mm b/packages/rn-tester/RNTester/AppDelegate.mm index d9a5e3ff6cb50b..f4e8d4006c5416 100644 --- a/packages/rn-tester/RNTester/AppDelegate.mm +++ b/packages/rn-tester/RNTester/AppDelegate.mm @@ -9,69 +9,18 @@ #import #import -#import -#import -#import #import #import -#import - #if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC #import #endif -#ifdef RN_FABRIC_ENABLED -#import -#import -#import -#import - -#import -#import -#import -#import -#import -#endif - #if RCT_NEW_ARCH_ENABLED #import #import #endif -#if DEBUG -#ifdef FB_SONARKIT_ENABLED -#import -#import -#import -#import -#import -#import -#import -#endif -#endif - -#import -#import "RNTesterTurboModuleProvider.h" - -@interface AppDelegate () { -#ifdef RN_FABRIC_ENABLED - RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; - std::shared_ptr _reactNativeConfig; - facebook::react::ContextContainer::Shared _contextContainer; - std::shared_ptr _runtimeScheduler; -#endif -} -@end - -#if RCT_NEW_ARCH_ENABLED -/// Declare conformance to `RCTComponentViewFactoryComponentProvider` -@interface AppDelegate () -@end -#endif - -static NSString *const kRNConcurrentRoot = @"concurrentRoot"; - @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions @@ -115,67 +64,6 @@ - (void)loadSourceForBridge:(RCTBridge *)bridge [RCTJavaScriptLoader loadBundleAtURL:[self sourceURLForBridge:bridge] onProgress:onProgress onComplete:loadCallback]; } -#pragma mark - RCTCxxBridgeDelegate - -// This function is called during -// `[[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];` -- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge -{ - std::shared_ptr callInvoker = bridge.jsCallInvoker; - -#ifdef RN_FABRIC_ENABLED - _runtimeScheduler = std::make_shared(RCTRuntimeExecutorFromBridge(bridge)); - _contextContainer->erase("RuntimeScheduler"); - _contextContainer->insert("RuntimeScheduler", _runtimeScheduler); - callInvoker = std::make_shared(_runtimeScheduler); -#endif - - RCTTurboModuleManager *turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge - delegate:self - jsInvoker:callInvoker]; - [bridge setRCTTurboModuleRegistry:turboModuleManager]; - -#if RCT_DEV - /** - * Eagerly initialize RCTDevMenu so CMD + d, CMD + i, and CMD + r work. - * This is a stop gap until we have a system to eagerly init Turbo Modules. - */ - [turboModuleManager moduleForName:"RCTDevMenu"]; -#endif - - __weak __typeof(self) weakSelf = self; - -#if RCT_USE_HERMES - return std::make_unique( -#else - return std::make_unique( -#endif - facebook::react::RCTJSIExecutorRuntimeInstaller([weakSelf, bridge, turboModuleManager]( - facebook::jsi::Runtime &runtime) { - if (!bridge) { - return; - } - -#if RN_FABRIC_ENABLED - __typeof(self) strongSelf = weakSelf; - if (strongSelf && strongSelf->_runtimeScheduler) { - facebook::react::RuntimeSchedulerBinding::createAndInstallIfNeeded(runtime, strongSelf->_runtimeScheduler); - } -#endif - - facebook::react::RuntimeExecutor syncRuntimeExecutor = - [&](std::function &&callback) { callback(runtime); }; - [turboModuleManager installJSBindingWithRuntimeExecutor:syncRuntimeExecutor]; - })); -} - -#pragma mark - RCTTurboModuleManagerDelegate - -- (Class)getModuleClassFromName:(const char *)name -{ - return facebook::react::RNTesterTurboModuleClassProvider(name); -} - - (std::shared_ptr)getTurboModule:(const std::string &)name jsInvoker:(std::shared_ptr)jsInvoker { From dc54334c59e8bcbee531ee032b540fe75a8392c3 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Thu, 1 Jun 2023 11:45:57 -0700 Subject: [PATCH 010/468] Create separate pod for React-debug (#37657) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37657 changelog: [internal] Make React-debug into its own pod to align BUCK and cocoapods. This is needed to reland RuntimeScheduler in the old architecture on iOS. Reviewed By: rickhanlonii Differential Revision: D46357876 fbshipit-source-id: 035aaaee8b4b106f873b4b30c8cb424867be066a --- .../AppDelegate/React-RCTAppDelegate.podspec | 2 + .../React/React-RCTFabric.podspec | 2 + .../ReactCommon/React-Fabric.podspec | 10 +- .../ReactCommon/ReactCommon.podspec | 4 - .../react/debug/React-debug.podspec | 36 ++ .../platform/ios/React-ImageManager.podspec | 2 + .../cocoapods/__tests__/codegen_utils-test.rb | 4 +- .../__tests__/new_architecture-test.rb | 5 +- .../scripts/cocoapods/codegen_utils.rb | 2 + .../scripts/cocoapods/new_architecture.rb | 2 + .../react-native/scripts/react_native_pods.rb | 1 + packages/rn-tester/Podfile.lock | 387 ++++++++++++++---- 12 files changed, 368 insertions(+), 89 deletions(-) create mode 100644 packages/react-native/ReactCommon/react/debug/React-debug.podspec diff --git a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec index a98f3aea404347..3cb77a170bb6af 100644 --- a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec +++ b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec @@ -48,6 +48,7 @@ header_search_paths = [ "$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", "$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", "$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers/", + "$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers/", ] : []).map{|p| "\"#{p}\""}.join(" ") Pod::Spec.new do |s| @@ -91,6 +92,7 @@ Pod::Spec.new do |s| s.dependency "React-Fabric" s.dependency "React-RCTFabric" s.dependency "React-graphics" + s.dependency "React-debug" s.script_phases = { :name => "Generate Legacy Components Interop", diff --git a/packages/react-native/React/React-RCTFabric.podspec b/packages/react-native/React/React-RCTFabric.podspec index 0c399c1797afd3..543f01691cb084 100644 --- a/packages/react-native/React/React-RCTFabric.podspec +++ b/packages/react-native/React/React-RCTFabric.podspec @@ -43,6 +43,7 @@ if ENV['USE_FRAMEWORKS'] header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-ImageManager/React_ImageManager.framework/Headers\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\"" + header_search_paths << "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"" end Pod::Spec.new do |s| @@ -79,6 +80,7 @@ Pod::Spec.new do |s| s.dependency "Yoga" s.dependency "React-RCTText" s.dependency "React-FabricImage" + s.dependency "React-debug" if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" s.dependency "hermes-engine" diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index 50c8a74168512c..96cef2b9e79049 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -51,7 +51,7 @@ Pod::Spec.new do |s| s.dependency "glog" s.dependency "DoubleConversion" s.dependency "React-Core" - # s.dependency "React-debug" + s.dependency "React-debug" # s.dependency "React-utils" # s.dependency "React-runtimescheduler" s.dependency "React-cxxreact" @@ -232,14 +232,6 @@ Pod::Spec.new do |s| end end - s.subspec "debug_core" do |ss| - ss.dependency folly_dep_name, folly_version - ss.compiler_flags = folly_compiler_flags - ss.source_files = "react/debug/**/*.{m,mm,cpp,h}" - ss.exclude_files = "react/debug/tests" - ss.header_dir = "react/debug" - end - s.subspec "debug_renderer" do |ss| ss.dependency folly_dep_name, folly_version ss.compiler_flags = folly_compiler_flags diff --git a/packages/react-native/ReactCommon/ReactCommon.podspec b/packages/react-native/ReactCommon/ReactCommon.podspec index 9ca2ec4b996d5c..448907b3b8f26e 100644 --- a/packages/react-native/ReactCommon/ReactCommon.podspec +++ b/packages/react-native/ReactCommon/ReactCommon.podspec @@ -70,8 +70,4 @@ Pod::Spec.new do |s| sss.source_files = "react/nativemodule/core/ReactCommon/**/*.{cpp,h}" end end - - s.subspec "react_debug_core" do |sss| - sss.source_files = "react/debug/*.{cpp,h}" - end end diff --git a/packages/react-native/ReactCommon/react/debug/React-debug.podspec b/packages/react-native/ReactCommon/react/debug/React-debug.podspec new file mode 100644 index 00000000000000..dab4a31652edfa --- /dev/null +++ b/packages/react-native/ReactCommon/react/debug/React-debug.podspec @@ -0,0 +1,36 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json"))) +version = package['version'] + +source = { :git => 'https://github.com/facebook/react-native.git' } +if version == '1000.0.0' + # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. + source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1") +else + source[:tag] = "v#{version}" +end + +Pod::Spec.new do |s| + s.name = "React-debug" + s.version = version + s.summary = "-" # TODO + s.homepage = "https://reactnative.dev/" + s.license = package["license"] + s.author = "Meta Platforms, Inc. and its affiliates" + s.platforms = { :ios => min_ios_version_supported } + s.source = source + s.source_files = "**/*.{cpp,h}" + s.header_dir = "react/debug" + s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" } + + if ENV['USE_FRAMEWORKS'] + s.module_name = "React_debug" + s.header_mappings_dir = "../.." + end +end diff --git a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec index 0ef251588cc351..a5f2bd21334955 100644 --- a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +++ b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec @@ -48,6 +48,7 @@ Pod::Spec.new do |s| "\"$(PODS_ROOT)/DoubleConversion\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\"", + "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"" ] end @@ -61,5 +62,6 @@ Pod::Spec.new do |s| s.dependency "React-Fabric" s.dependency "React-Core/Default" s.dependency "React-RCTImage" + s.dependency "React-debug" s.dependency "glog" end diff --git a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb index da138e23b86950..b738548d5cf945 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb @@ -577,6 +577,7 @@ def get_podspec_fabric_and_script_phases(script_phases) 'React-graphics': [], 'React-rncore': [], 'React-Fabric': [], + 'React-debug': [], }) @@ -589,11 +590,12 @@ def get_podspec_when_use_frameworks specs = get_podspec_no_fabric_no_script() specs["pod_target_xcconfig"]["FRAMEWORK_SEARCH_PATHS"].concat([]) - specs["pod_target_xcconfig"]["HEADER_SEARCH_PATHS"].concat(" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-FabricImage/React_FabricImage.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers\"") + specs["pod_target_xcconfig"]["HEADER_SEARCH_PATHS"].concat(" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-FabricImage/React_FabricImage.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"") specs[:dependencies].merge!({ 'React-graphics': [], 'React-Fabric': [], + 'React-debug': [], }) return specs diff --git a/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb b/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb index c97349ed15df31..702d02982c2c4b 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb @@ -129,7 +129,7 @@ def test_installModulesDependencies_whenNewArchEnabledAndNewArchAndNoSearchPaths # Assert assert_equal(spec.compiler_flags, NewArchitectureHelper.folly_compiler_flags) - assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\"") + assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"") assert_equal(spec.pod_target_xcconfig["CLANG_CXX_LANGUAGE_STANDARD"], "c++17") assert_equal(spec.pod_target_xcconfig["OTHER_CPLUSPLUSFLAGS"], "$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1") assert_equal( @@ -148,6 +148,7 @@ def test_installModulesDependencies_whenNewArchEnabledAndNewArchAndNoSearchPaths { :dependency_name => "Yoga" }, { :dependency_name => "React-Fabric" }, { :dependency_name => "React-graphics" }, + { :dependency_name => "React-debug" }, { :dependency_name => "hermes-engine" } ]) end @@ -166,7 +167,7 @@ def test_installModulesDependencies_whenNewArchDisabledAndSearchPathsAndCompiler # Assert assert_equal(spec.compiler_flags, "-Wno-nullability-completeness #{NewArchitectureHelper.folly_compiler_flags}") - assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "#{other_flags} \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\"") + assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "#{other_flags} \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"") assert_equal(spec.pod_target_xcconfig["CLANG_CXX_LANGUAGE_STANDARD"], "c++17") assert_equal( spec.dependencies, diff --git a/packages/react-native/scripts/cocoapods/codegen_utils.rb b/packages/react-native/scripts/cocoapods/codegen_utils.rb index c980f05762de45..97715206cf5e17 100644 --- a/packages/react-native/scripts/cocoapods/codegen_utils.rb +++ b/packages/react-native/scripts/cocoapods/codegen_utils.rb @@ -100,6 +100,7 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa "\"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"", "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"", "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers\"", + "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"", ]) end @@ -140,6 +141,7 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa spec[:'dependencies'].merge!({ 'React-graphics': [], 'React-Fabric': [], + 'React-debug': [], }); end diff --git a/packages/react-native/scripts/cocoapods/new_architecture.rb b/packages/react-native/scripts/cocoapods/new_architecture.rb index 7dd43c34d9cea1..3b128b01d29d3d 100644 --- a/packages/react-native/scripts/cocoapods/new_architecture.rb +++ b/packages/react-native/scripts/cocoapods/new_architecture.rb @@ -109,6 +109,7 @@ def self.install_modules_dependencies(spec, new_arch_enabled, folly_version) header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\"" + header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"" end header_search_paths_string = header_search_paths.join(" ") spec.compiler_flags = compiler_flags.empty? ? @@folly_compiler_flags : "#{compiler_flags} #{@@folly_compiler_flags}" @@ -135,6 +136,7 @@ def self.install_modules_dependencies(spec, new_arch_enabled, folly_version) spec.dependency "Yoga" spec.dependency "React-Fabric" spec.dependency "React-graphics" + spec.dependency "React-debug" if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" spec.dependency "hermes-engine" diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index 8b786505cbff8b..cba10765767e47 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -117,6 +117,7 @@ def use_react_native! ( pod 'React-Core/RCTWebSocket', :path => "#{prefix}/" pod 'React-rncore', :path => "#{prefix}/ReactCommon" pod 'React-cxxreact', :path => "#{prefix}/ReactCommon/cxxreact" + pod 'React-debug', :path => "#{prefix}/ReactCommon/react/debug" if hermes_enabled setup_hermes!(:react_native_path => prefix, :fabric_enabled => fabric_enabled) diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index be0ec11b28e079..a9132e6b3dd66c 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -122,12 +122,15 @@ PODS: - React-RCTVibration (= 1000.0.0) - React-callinvoker (1000.0.0) - React-Codegen (1000.0.0): + - DoubleConversion - FBReactNativeSpec + - glog - hermes-engine - RCT-Folly - RCTRequired - RCTTypeSafety - React-Core + - React-debug - React-Fabric - React-graphics - React-jsi @@ -339,10 +342,17 @@ PODS: - React-logger (= 1000.0.0) - React-perflogger (= 1000.0.0) - React-runtimeexecutor (= 1000.0.0) + - React-debug (1000.0.0) - React-Fabric (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-Fabric/animations (= 1000.0.0) - React-Fabric/attributedstring (= 1000.0.0) - React-Fabric/butter (= 1000.0.0) @@ -351,7 +361,6 @@ PODS: - React-Fabric/components (= 1000.0.0) - React-Fabric/config (= 1000.0.0) - React-Fabric/core (= 1000.0.0) - - React-Fabric/debug_core (= 1000.0.0) - React-Fabric/debug_renderer (= 1000.0.0) - React-Fabric/imagemanager (= 1000.0.0) - React-Fabric/leakchecker (= 1000.0.0) @@ -367,53 +376,93 @@ PODS: - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/animations (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/attributedstring (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/butter (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/componentregistry (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/componentregistrynative (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) - - React-Fabric/components/activityindicator (= 1000.0.0) - - React-Fabric/components/image (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-Fabric/components/inputaccessory (= 1000.0.0) - React-Fabric/components/legacyviewmanagerinterop (= 1000.0.0) - React-Fabric/components/modal (= 1000.0.0) @@ -428,233 +477,400 @@ PODS: - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - - ReactCommon/turbomodule/core (= 1000.0.0) - - React-Fabric/components/activityindicator (1000.0.0): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 1000.0.0) - - RCTTypeSafety (= 1000.0.0) - - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) - - React-jsiexecutor (= 1000.0.0) - - ReactCommon/turbomodule/core (= 1000.0.0) - - React-Fabric/components/image (1000.0.0): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 1000.0.0) - - RCTTypeSafety (= 1000.0.0) - - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) - - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/inputaccessory (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/legacyviewmanagerinterop (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/modal (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/rncore (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/root (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/safeareaview (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/scrollview (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/text (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/textinput (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/unimplementedview (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/view (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - Yoga - React-Fabric/config (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/core (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - - ReactCommon/turbomodule/core (= 1000.0.0) - - React-Fabric/debug_core (1000.0.0): - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 1000.0.0) - - RCTTypeSafety (= 1000.0.0) - - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) - - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/debug_renderer (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/imagemanager (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/leakchecker (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/mapbuffer (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/mounting (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/runtimescheduler (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/scheduler (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/telemetry (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/templateprocessor (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/textlayoutmanager (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-Fabric/uimanager - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/uimanager (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/utils (1000.0.0): + - DoubleConversion + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - RCTRequired (= 1000.0.0) - RCTTypeSafety (= 1000.0.0) + - React-Core + - React-cxxreact + - React-debug - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) + - React-logger + - ReactCommon/turbomodule/core (= 1000.0.0) + - React-FabricImage (1000.0.0): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly/Fabric (= 2021.07.22.00) + - RCTRequired (= 1000.0.0) + - RCTTypeSafety (= 1000.0.0) + - React-Fabric + - React-graphics (= 1000.0.0) + - React-ImageManager + - React-jsi (= 1000.0.0) + - React-jsiexecutor (= 1000.0.0) + - React-logger - ReactCommon/turbomodule/core (= 1000.0.0) + - Yoga - React-graphics (1000.0.0): - glog - RCT-Folly/Fabric (= 2021.07.22.00) @@ -671,8 +887,10 @@ PODS: - React-jsinspector (= 1000.0.0) - React-perflogger (= 1000.0.0) - React-ImageManager (1000.0.0): + - glog - RCT-Folly/Fabric - React-Core/Default + - React-debug - React-Fabric - React-RCTImage - React-jsi (1000.0.0): @@ -693,6 +911,7 @@ PODS: - React-logger (1000.0.0): - glog - React-NativeModulesApple (1000.0.0): + - glog - hermes-engine - React-callinvoker - React-Core @@ -716,6 +935,11 @@ PODS: - RCTRequired - RCTTypeSafety - React-Core + - React-CoreModules + - React-hermes + - React-NativeModulesApple + - React-RCTImage + - React-RCTNetwork - ReactCommon/turbomodule/core - React-RCTBlob (1000.0.0): - hermes-engine @@ -727,11 +951,18 @@ PODS: - React-RCTNetwork (= 1000.0.0) - ReactCommon/turbomodule/core (= 1000.0.0) - React-RCTFabric (1000.0.0): + - glog + - hermes-engine - RCT-Folly/Fabric (= 2021.07.22.00) - React-Core (= 1000.0.0) + - React-debug - React-Fabric (= 1000.0.0) + - React-FabricImage + - React-graphics - React-ImageManager - React-RCTImage (= 1000.0.0) + - React-RCTText + - Yoga - React-RCTImage (1000.0.0): - RCT-Folly (= 2021.07.22.00) - RCTTypeSafety (= 1000.0.0) @@ -812,6 +1043,7 @@ PODS: - React-logger (= 1000.0.0) - React-perflogger (= 1000.0.0) - ScreenshotManager (0.0.1): + - glog - RCT-Folly (= 2021.07.22.00) - React-Core - SocketRocket (0.6.0) @@ -845,7 +1077,7 @@ DEPENDENCIES: - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.182.0) - FlipperKit/SKIOSNetworkPlugin (= 0.182.0) - glog (from `../react-native/third-party-podspecs/glog.podspec`) - - hermes-engine (from `../react-native/sdks/hermes/hermes-engine.podspec`) + - hermes-engine (from `../react-native/sdks/hermes-engine/hermes-engine.podspec`) - libevent (~> 2.1.12) - OCMock (~> 3.9.1) - OpenSSL-Universal (= 1.1.1100) @@ -861,7 +1093,9 @@ DEPENDENCIES: - React-Core/RCTWebSocket (from `../react-native/`) - React-CoreModules (from `../react-native/React/CoreModules`) - React-cxxreact (from `../react-native/ReactCommon/cxxreact`) + - React-debug (from `../react-native/ReactCommon/react/debug`) - React-Fabric (from `../react-native/ReactCommon`) + - React-FabricImage (from `../react-native/ReactCommon`) - React-graphics (from `../react-native/ReactCommon/react/renderer/graphics`) - React-hermes (from `../react-native/ReactCommon/hermes`) - React-ImageManager (from `../react-native/ReactCommon/react/renderer/imagemanager/platform/ios`) @@ -921,7 +1155,8 @@ EXTERNAL SOURCES: glog: :podspec: "../react-native/third-party-podspecs/glog.podspec" hermes-engine: - :podspec: "../react-native/sdks/hermes/hermes-engine.podspec" + :podspec: "../react-native/sdks/hermes-engine/hermes-engine.podspec" + :tag: '' RCT-Folly: :podspec: "../react-native/third-party-podspecs/RCT-Folly.podspec" RCTRequired: @@ -940,8 +1175,12 @@ EXTERNAL SOURCES: :path: "../react-native/React/CoreModules" React-cxxreact: :path: "../react-native/ReactCommon/cxxreact" + React-debug: + :path: "../react-native/ReactCommon/react/debug" React-Fabric: :path: "../react-native/ReactCommon" + React-FabricImage: + :path: "../react-native/ReactCommon" React-graphics: :path: "../react-native/ReactCommon/react/renderer/graphics" React-hermes: @@ -1002,9 +1241,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 57d2868c099736d80fcd648bf211b4431e51a558 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 - FBLazyVector: d68947eddece25638eb0f642d1b957c90388afd1 - FBReactNativeSpec: e15126dac01896217e97d3ed3045a67be39e97cd + DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 + FBLazyVector: 9c79ec2238e065a949c9bb7aebdf7cebd6203015 + FBReactNativeSpec: 66b1b6348a3f6c3133e6e437ad50b46f4fef812f Flipper: 6edb735e6c3e332975d1b17956bcc584eccf5818 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 @@ -1014,52 +1253,54 @@ SPEC CHECKSUMS: Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 FlipperKit: 2efad7007d6745a3f95e4034d547be637f89d3f6 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b - hermes-engine: d4e3147fcec14fb95d56cad45f03f126e725a098 + glog: 99bd064df01718db56b8f75e6b5ea3051c7dad0a + hermes-engine: 6085d07261e8a8bfe708e4b0dcd0f3eae72a8e4d libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c - RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 - RCTRequired: 54a4f03dbbebb0cfdb4e2ba8d3b1d0b1258f8c08 - RCTTypeSafety: a41e253b4ed644708899857d912b2f50c7b6214d - React: 2fc6c4c656cccd6753016528ad41199c16fd558e - React-callinvoker: a7d5e883a83bb9bd3985b08be832c5e76451d18f - React-Codegen: ecc7c203dcc86316ff12a865dbfc71190458b367 - React-Core: 6ed76c248f07d2d65d8d15b33a75444ef6ff7938 - React-CoreModules: 9b9060df7f561e9c8f8364333c2ec645d7c698d2 - React-cxxreact: aff243750dad852080636e615d7ae5639381735b - React-Fabric: 6b5c30b6e60a85446cc5d3702fa262fd1fc15619 - React-graphics: e70886fff4b79bec3745de761900a770029591f2 - React-hermes: 7f0e87d44b1c7cfbdd11aa3c070d04435fe75d57 - React-ImageManager: 9fd3521fb8871cd5bea83d2d282da27d6ef91199 - React-jsi: e4c75a1cf727c8761908ac2eeb1084e47ba88a26 - React-jsiexecutor: 8361f78286021782d885e0888bb059a4045c59b9 - React-jsinspector: 9b56a373a6797114e1d89a7dffa98ee98af67a8f - React-logger: 07c9b44040a6f948b8e2033207b23cb623f0b9b4 - React-NativeModulesApple: 47a650ab999a254890d8294581b59761f09d3867 - React-perflogger: b4b9fb2ddd856b78003708ab3cf66ce03e6bc7c4 - React-RCTActionSheet: 1b1501ef80928be10702cd0ce09120358094cd82 - React-RCTAnimation: 6741f7be3e269e057c1426074cc70f34b56e114b - React-RCTAppDelegate: 777164f9f62174c65df37286df4eee43b44a6fb0 - React-RCTBlob: fd1ee93e48aa67b0183346a59754375de93de63d - React-RCTFabric: 179b2203e1b8b89b6ec8fa6104071beb553b1684 - React-RCTImage: 055685a12c88939437f6520d9e7c120cd666cbf1 - React-RCTLinking: b149b3ff1f96fa93fc445230b9c171adb0e5572c - React-RCTNetwork: 21abb4231182651f48b7035beaa011b1ab7ae8f4 - React-RCTPushNotification: f3af966de34c1fe2df8860625d225fb2f581d15e - React-RCTSettings: 64b6acabfddf7f96796229b101bd91f46d14391b - React-RCTTest: 81ebfa8c2e1b0b482effe12485e6486dc0ff70d7 - React-RCTText: 4e5ae05b778a0ed2b22b012af025da5e1a1c4e54 - React-RCTVibration: ecfd04c1886a9c9a4e31a466c0fbcf6b36e92fde - React-rncore: 4c50bd546c117f4024a84bf6de1dd905d5fa3e82 - React-runtimeexecutor: c7b2cd6babf6cc50340398bfbb7a9da13c93093f - ReactCommon: b3e76cb18ee28cd0e3a927f5b53f888312443b6b - ReactCommon-Samples: 7bf1ed1f5d659fae980b40c35c5a431d0ec49189 - ScreenshotManager: 4e5729bfcd19014d277e57eb60e8e75db64b2953 + RCT-Folly: b0d1393cb3763d71efca99db314c65f0072eb0fe + RCTRequired: 40ffd795b32a630f147fcc15247920e5161b6a4e + RCTTypeSafety: fd9d941c329580ea280cad3565bb2e1656969f41 + React: 47363de0e2c161a347eef1cb57cba33f1a4b7377 + React-callinvoker: 28e99e6254975d5be67eafeedbcc3a45bb1ace94 + React-Codegen: 9ecf53f804f4d1d2a5d29bb2154e22a30c381f81 + React-Core: f2a04589df942502db2f3ef84ddc83a35a7086d3 + React-CoreModules: 4fe81e5b80d5daa3e81151dfc9e516ae1a0e575f + React-cxxreact: 1235a3b3d8ea0639f95741cc907ddbb41da4bea3 + React-debug: 9c6d0fd7867cc4a8f435d528e2c5fa8465e9c054 + React-Fabric: b429ac248d619825f97ceb607d1a2d556a49c47c + React-FabricImage: 8136841d81a7005ac3c294623f87497f6bbf8f09 + React-graphics: ed6de536e153c7bc852f9c773a3c9b21c2ee22da + React-hermes: b494c9c833faa6217b2f666d13aa52623c34c2e9 + React-ImageManager: 3e990b6ffbc7634556ddf5b90e5bb1025c397a4c + React-jsi: 00d3c30ce021ff1a074315b824b22108db01131f + React-jsiexecutor: 473c386e219c256066689a334663e8813cdc65ef + React-jsinspector: 25164fdf93d5be275ba455d916e96adb49fa407c + React-logger: a2165169d9c1897c1a139c6b158f6f79090ee174 + React-NativeModulesApple: 5ca2a6989b4549ecf557958c72d514bda071922d + React-perflogger: b5ecf879c705577c80e5299ae678b9375fe2f998 + React-RCTActionSheet: 4a241f444d11926261dd904449a31f35157d4eee + React-RCTAnimation: cf7c9f502e597ee97ce18d1bc4eb8a5836ecf21d + React-RCTAppDelegate: da46fbaa608f201a832d1310bd2e8ce4234642b1 + React-RCTBlob: 48eae02e3f75777da97e9282a5861d04471624a9 + React-RCTFabric: 4b122d0e96f6a581046b8cb950e3277036a5d45a + React-RCTImage: 3efab57255aeb986f89ddc8719fbffd4559954ad + React-RCTLinking: 708dbd9b0aa0845c735e5d6b0e9f7f268008a830 + React-RCTNetwork: d88896f8b7adf85ba366168c5bf1e03d7c235493 + React-RCTPushNotification: dbacfd181137a62deebc62fd386419e707cdcf95 + React-RCTSettings: 17cb468bba42b17b7b0e40ea971d6bd8a78baa3f + React-RCTTest: d7142acb2544c01f53deb2b0543d63df6e214ac2 + React-RCTText: 8cb3ebda2675a02de0cb363a765fafb7d6c31cc1 + React-RCTVibration: c40f0f3e0114354bbf4b418e381c2c96d1d22d48 + React-rncore: 11d8412fb1e339cd1be30aa33cb3b265b46a542b + React-runtimeexecutor: c810e5b7d7500a9ad3ed66b834503e412684936d + ReactCommon: a7972e80473d6ba9bcf3ee53bcc310ac6b944a49 + ReactCommon-Samples: 93c677b30087b6aa82bbccb4458a2028cd6ebd10 + ScreenshotManager: d39b964a374e5012e2b8c143e29ead86b1da6a3c SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: 1b1a12ff3d86a10565ea7cbe057d42f5e5fb2a07 + Yoga: b82f2e3cbeb3d926329278b24d54d798215d4fa3 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 9fa6f105e2187b680e978d57b28e2f700c8bd295 +PODFILE CHECKSUM: bdab6add69d555774de227d7119a8f5ae02a670e COCOAPODS: 1.12.0 From d9b3339ef8df3624295ba6f3ca51757b4b4a003b Mon Sep 17 00:00:00 2001 From: Pieter Vanderwerff Date: Thu, 1 Jun 2023 12:02:07 -0700 Subject: [PATCH 011/468] Upgrade hermes-* packages in xplat and arvr to version 0.12.0 (#37648) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37648 Upgrade hermes parser packages to the latest released versions. Changelog is here: https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md Main differences are improved parser support for new Flow features. Changelog: [Internal] Reviewed By: SamChou19815 Differential Revision: D46303102 fbshipit-source-id: 4989581757df6422174b2d0ddb8fd38be94bfc89 --- package.json | 2 +- yarn.lock | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 6bfad30679abb3..6b6620df0f7a40 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "eslint-plugin-redundant-undefined": "^0.4.0", "eslint-plugin-relay": "^1.8.3", "flow-bin": "^0.207.0", - "hermes-eslint": "0.8.0", + "hermes-eslint": "0.12.0", "inquirer": "^7.1.0", "jest": "^29.2.1", "jest-junit": "^10.0.0", diff --git a/yarn.lock b/yarn.lock index 45cbbc30af4916..0f8426d65d26ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6081,20 +6081,32 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hermes-eslint@0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/hermes-eslint/-/hermes-eslint-0.8.0.tgz#e0a892d3f63f25d0966aa558ed40e373e2d0a065" - integrity sha512-TXbTys9Ssx9kzB8W18TK8m23QTSG6RqI4dOVzG12DslDJGNBU3pJV8AWkiwz8aOyCU6uiWhbVE2855E7g3iXoA== +hermes-eslint@0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/hermes-eslint/-/hermes-eslint-0.12.0.tgz#e0a0ff4c24679650789cee26d0f70fe7ca7915b7" + integrity sha512-I+CqRj8ciokZisoZkHK2xRB5kOnjq/42MWNlW7v1S9tLpi0iuZd1sXsb1TEDgkqk/xDpfNdOrIoesb+9c5MkSw== dependencies: esrecurse "^4.3.0" - hermes-estree "0.8.0" - hermes-parser "0.8.0" + hermes-estree "0.12.0" + hermes-parser "0.12.0" + +hermes-estree@0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.12.0.tgz#8a289f9aee854854422345e6995a48613bac2ca8" + integrity sha512-+e8xR6SCen0wyAKrMT3UD0ZCCLymKhRgjEB5sS28rKiFir/fXgLoeRilRUssFCILmGHb+OvHDUlhxs0+IEyvQw== hermes-estree@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.8.0.tgz#530be27243ca49f008381c1f3e8b18fb26bf9ec0" integrity sha512-W6JDAOLZ5pMPMjEiQGLCXSSV7pIBEgRR5zGkxgmzGSXHOxqV5dC/M1Zevqpbm9TZDE5tu358qZf8Vkzmsc+u7Q== +hermes-parser@0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.12.0.tgz#114dc26697cfb41a6302c215b859b74224383773" + integrity sha512-d4PHnwq6SnDLhYl3LHNHvOg7nQ6rcI7QVil418REYksv0Mh3cEkHDcuhGxNQ3vgnLSLl4QSvDrFCwQNYdpWlzw== + dependencies: + hermes-estree "0.12.0" + hermes-parser@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.8.0.tgz#116dceaba32e45b16d6aefb5c4c830eaeba2d257" From 0191d16712a07b092e932a43e386abff9ca2d514 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Thu, 1 Jun 2023 14:41:00 -0700 Subject: [PATCH 012/468] Fix bad utility type definitions (#37662) Reviewed By: panagosg7 Differential Revision: D46364595 fbshipit-source-id: 5dcd484cd292d5b83b0b114675ec3c8059aefe6b --- .../react-native-codegen/src/CodegenSchema.js | 42 ++++++++++--------- .../GeneratePropsJavaPojo/PojoCollector.js | 8 ++-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/react-native-codegen/src/CodegenSchema.js b/packages/react-native-codegen/src/CodegenSchema.js index f05a4f2e749ab3..1708e8939b4e8b 100644 --- a/packages/react-native-codegen/src/CodegenSchema.js +++ b/packages/react-native-codegen/src/CodegenSchema.js @@ -134,6 +134,27 @@ export type EventTypeAnnotation = elementType: EventTypeAnnotation, }>; +export type ArrayTypeAnnotation = $ReadOnly<{ + type: 'ArrayTypeAnnotation', + elementType: + | BooleanTypeAnnotation + | StringTypeAnnotation + | DoubleTypeAnnotation + | FloatTypeAnnotation + | Int32TypeAnnotation + | $ReadOnly<{ + type: 'StringEnumTypeAnnotation', + default: string, + options: $ReadOnlyArray, + }> + | ObjectTypeAnnotation + | ReservedPropTypeAnnotation + | $ReadOnly<{ + type: 'ArrayTypeAnnotation', + elementType: ObjectTypeAnnotation, + }>, +}>; + export type PropTypeAnnotation = | $ReadOnly<{ type: 'BooleanTypeAnnotation', @@ -167,26 +188,7 @@ export type PropTypeAnnotation = }> | ReservedPropTypeAnnotation | ObjectTypeAnnotation - | $ReadOnly<{ - type: 'ArrayTypeAnnotation', - elementType: - | BooleanTypeAnnotation - | StringTypeAnnotation - | DoubleTypeAnnotation - | FloatTypeAnnotation - | Int32TypeAnnotation - | $ReadOnly<{ - type: 'StringEnumTypeAnnotation', - default: string, - options: $ReadOnlyArray, - }> - | ObjectTypeAnnotation - | ReservedPropTypeAnnotation - | $ReadOnly<{ - type: 'ArrayTypeAnnotation', - elementType: ObjectTypeAnnotation, - }>, - }> + | ArrayTypeAnnotation | MixedTypeAnnotation; export type ReservedPropTypeAnnotation = $ReadOnly<{ diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaPojo/PojoCollector.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaPojo/PojoCollector.js index 81829b99da8467..7aaa6d297bf539 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaPojo/PojoCollector.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaPojo/PojoCollector.js @@ -21,6 +21,7 @@ import type { Int32TypeAnnotation, PropTypeAnnotation, MixedTypeAnnotation, + ArrayTypeAnnotation, } from '../../../CodegenSchema'; const {capitalize} = require('../../Utils'); @@ -110,11 +111,8 @@ class PojoCollector { } case 'ArrayTypeAnnotation': { const arrayTypeAnnotation = typeAnnotation; - // TODO: Flow assumes elementType can be any. Fix this. - const elementType: $PropertyType< - typeof arrayTypeAnnotation, - 'elementType', - > = arrayTypeAnnotation.elementType; + const elementType: $PropertyType = + arrayTypeAnnotation.elementType; const pojoElementType = (() => { switch (elementType.type) { From e25c6632a2360acfb63ceb62258ee1ec18452018 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Thu, 1 Jun 2023 23:17:12 -0700 Subject: [PATCH 013/468] Fix bad type definitions related to utility types (wave 2) Summary: This diff fixes more bad type definitions that are previously hidden but will be exposed in the upcoming Flow 0.208.0 Changelog: [Internal] Reviewed By: panagosg7 Differential Revision: D46382788 fbshipit-source-id: 50337ce5bc0f07ac5916a2d4b75eabf5e8e2e427 --- packages/react-native/Libraries/Core/ExceptionsManager.js | 3 ++- packages/react-native/Libraries/Core/setUpDeveloperTools.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/Core/ExceptionsManager.js b/packages/react-native/Libraries/Core/ExceptionsManager.js index 83cd7f654355da..d1de23cfa023f6 100644 --- a/packages/react-native/Libraries/Core/ExceptionsManager.js +++ b/packages/react-native/Libraries/Core/ExceptionsManager.js @@ -117,7 +117,8 @@ function reportException( } } -declare var console: typeof console & { +declare var console: { + error: typeof console.error, _errorOriginal: typeof console.error, reportErrorsAsExceptions: boolean, ... diff --git a/packages/react-native/Libraries/Core/setUpDeveloperTools.js b/packages/react-native/Libraries/Core/setUpDeveloperTools.js index c964af738112f6..67227191a8b71b 100644 --- a/packages/react-native/Libraries/Core/setUpDeveloperTools.js +++ b/packages/react-native/Libraries/Core/setUpDeveloperTools.js @@ -10,7 +10,7 @@ import Platform from '../Utilities/Platform'; -declare var console: typeof console & {_isPolyfilled: boolean, ...}; +declare var console: {[string]: $FlowFixMe}; /** * Sets up developer tools for React Native. From fd9e295befcd8781190ec26a6a2fc4ef39fb1c15 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Fri, 2 Jun 2023 17:40:52 -0700 Subject: [PATCH 014/468] Publish nightly monorepo packages (#37556) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37556 Changelog: [Internal] Before making this change, we need to publish `nightly` versions of all existing monorepo dependencies. Reviewed By: hoxyq Differential Revision: D46117197 fbshipit-source-id: bcf6364e068579e63ca19e8161dcd32de4353e56 --- scripts/__tests__/publish-npm-test.js | 3 +- ...h-nightly-for-each-changed-package-test.js | 101 +++++++++++++ ...ublish-nightly-for-each-changed-package.js | 135 ++++++++++++++++++ scripts/npm-utils.js | 31 +++- scripts/publish-npm.js | 8 ++ scripts/scm-utils.js | 14 ++ 6 files changed, 289 insertions(+), 3 deletions(-) create mode 100644 scripts/monorepo/__tests__/publish-nightly-for-each-changed-package-test.js create mode 100644 scripts/monorepo/publish-nightly-for-each-changed-package.js diff --git a/scripts/__tests__/publish-npm-test.js b/scripts/__tests__/publish-npm-test.js index 2b4825bdf42c1e..32bc613ff98628 100644 --- a/scripts/__tests__/publish-npm-test.js +++ b/scripts/__tests__/publish-npm-test.js @@ -32,7 +32,8 @@ jest .mock('./../release-utils', () => ({ generateAndroidArtifacts: jest.fn(), publishAndroidArtifactsToMaven: publishAndroidArtifactsToMavenMock, - })); + })) + .mock('../monorepo/publish-nightly-for-each-changed-package'); const date = new Date('2023-04-20T23:52:39.543Z'); diff --git a/scripts/monorepo/__tests__/publish-nightly-for-each-changed-package-test.js b/scripts/monorepo/__tests__/publish-nightly-for-each-changed-package-test.js new file mode 100644 index 00000000000000..b7d420809bfec6 --- /dev/null +++ b/scripts/monorepo/__tests__/publish-nightly-for-each-changed-package-test.js @@ -0,0 +1,101 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +const publishNightlyForEachChangedPackage = require('../publish-nightly-for-each-changed-package'); + +const mockPackages = [ + { + packageManifest: {name: 'packageA', version: 'local-version'}, + packageAbsolutePath: '/some/place/packageA', + packageRelativePathFromRoot: './place/packageA', + }, +]; + +const execMock = jest.fn(); +const writeFileSyncMock = jest.fn(); +const diffPackagesMock = jest.fn(); +const publishPackageMock = jest.fn(); + +jest + .mock('shelljs', () => ({ + exec: execMock, + rm: jest.fn(), + })) + .mock('fs', () => ({ + writeFileSync: writeFileSyncMock, + })) + .mock('../for-each-package', () => callback => { + mockPackages.forEach( + ({packageManifest, packageAbsolutePath, packageRelativePathFromRoot}) => + callback( + packageAbsolutePath, + packageRelativePathFromRoot, + packageManifest, + ), + ); + }) + .mock('../../scm-utils', () => ({ + restore: jest.fn(), + })) + .mock('../../npm-utils', () => ({ + getPackageVersionStrByTag: () => 'published-nightly-version', + diffPackages: diffPackagesMock, + publishPackage: publishPackageMock, + pack: jest.fn(), + })); + +describe('publishNightlyForEachChangedPackage', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('publishes because there are changes', () => { + const nightlyVersion = '0.73.0-nightly-202108-shortcommit'; + publishPackageMock.mockImplementationOnce(() => ({code: 0})); + diffPackagesMock.mockImplementationOnce(() => 'some-file-name.js\n'); + + publishNightlyForEachChangedPackage(nightlyVersion); + + // ensure we set the version of the last published nightly (for diffing) + expect(writeFileSyncMock.mock.calls[0][1]).toBe( + '{\n "name": "packageA",\n "version": "published-nightly-version"\n}\n', + ); + + expect(diffPackagesMock).toBeCalledWith( + 'packageA@nightly', + 'packageA-published-nightly-version.tgz', + { + cwd: '/some/place/packageA', + }, + ); + + // when determining that we DO want to publish, ensure we update the version to the provded nightly version we want to use + expect(writeFileSyncMock.mock.calls[1][1]).toBe( + `{\n "name": "packageA",\n "version": "${nightlyVersion}"\n}\n`, + ); + + expect(publishPackageMock).toBeCalled(); + }); + + it('doesnt publish because no changes', () => { + const nightlyVersion = '0.73.0-nightly-202108-shortcommit'; + diffPackagesMock.mockImplementationOnce(() => '\n'); + + publishNightlyForEachChangedPackage(nightlyVersion); + + expect(writeFileSyncMock.mock.calls[0][1]).toBe( + '{\n "name": "packageA",\n "version": "published-nightly-version"\n}\n', + ); + + // in this test, we expect there to be no differences between last published nightly and local + // so we never update the version and we don't publish + expect(writeFileSyncMock.mock.calls.length).toBe(1); + expect(publishPackageMock).not.toBeCalled(); + }); +}); diff --git a/scripts/monorepo/publish-nightly-for-each-changed-package.js b/scripts/monorepo/publish-nightly-for-each-changed-package.js new file mode 100644 index 00000000000000..1c04d722180011 --- /dev/null +++ b/scripts/monorepo/publish-nightly-for-each-changed-package.js @@ -0,0 +1,135 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @oncall react_native + */ + +const forEachPackage = require('./for-each-package'); +const {rm} = require('shelljs'); +const { + getPackageVersionStrByTag, + diffPackages, + publishPackage, + pack, +} = require('../npm-utils'); +const {restore} = require('../scm-utils'); +const path = require('path'); +const {writeFileSync} = require('fs'); + +function hasChanges( + currentNightlyVersion, + packageManifest, + packageAbsolutePath, +) { + // Set local package to same nightly version so diff is comparable + writeFileSync( + path.join(packageAbsolutePath, 'package.json'), + JSON.stringify( + {...packageManifest, version: currentNightlyVersion}, + null, + 2, + ) + '\n', + 'utf-8', + ); + + // prepare local package + pack(packageAbsolutePath); + + // ex. react-native-codegen-0.73.0-nightly-20230530-730ca3540.tgz + const localTarballName = `${packageManifest.name + .replace('@', '') + .replace('/', '-')}-${currentNightlyVersion}.tgz`; + + // npm diff --diff=@nightly --diff=. --diff-name-only + const diff = diffPackages( + `${packageManifest.name}@nightly`, + localTarballName, + { + cwd: packageAbsolutePath, + }, + ); + + // delete tarball and restore package.json changes + rm({cwd: packageAbsolutePath}, localTarballName); + restore(packageAbsolutePath); + + return diff.trim().length !== 0; +} + +/** + * Publish nightlies for monorepo packages that changed since last publish. + * This is called by `react-native`'s nightly job. + * + * Note: This does not publish `package/react-native`'s nightly. That is handled in `publish-npm`. + */ +function publishNightlyForEachChangedPackage(nightlyVersion) { + forEachPackage( + (packageAbsolutePath, packageRelativePathFromRoot, packageManifest) => { + if (packageManifest.private) { + console.log(`\u23ED Skipping private package ${packageManifest.name}`); + + return; + } + + let lastPublishedNightlyVersion; + let shouldPublishNightly = false; + console.log( + `\n---- Attempting to publish nightly for ${packageManifest.name}`, + ); + try { + lastPublishedNightlyVersion = getPackageVersionStrByTag( + packageManifest.name, + 'nightly', + ); + shouldPublishNightly = hasChanges( + lastPublishedNightlyVersion, + packageManifest, + packageAbsolutePath, + ); + } catch (e) { + console.error( + `Unable to verify if ${packageManifest.name} has changes due to error:`, + ); + console.error(e.message); + console.log(`\u23ED Skipping package ${packageManifest.name}`); + return; + } + + if (!shouldPublishNightly) { + console.log( + `Detected no changes in ${packageManifest.name}@nightly since last publish. Skipping.`, + ); + return; + } + + // Set the local package to the updated nightly version + writeFileSync( + path.join(packageAbsolutePath, 'package.json'), + JSON.stringify({...packageManifest, version: nightlyVersion}, null, 2) + + '\n', + 'utf-8', + ); + + const result = publishPackage(packageAbsolutePath, { + tag: 'nightly', + otp: process.env.NPM_CONFIG_OTP, + }); + if (result.code !== 0) { + console.log( + `\u274c Failed to publish version ${nightlyVersion} of ${packageManifest.name}. npm publish exited with code ${result.code}:`, + ); + console.error(result.stderr); + } else { + console.log( + `\u2705 Successfully published new version of ${packageManifest.name}`, + ); + } + }, + ); +} + +module.exports = publishNightlyForEachChangedPackage; diff --git a/scripts/npm-utils.js b/scripts/npm-utils.js index 15752a340eb66c..5586d7e3372952 100644 --- a/scripts/npm-utils.js +++ b/scripts/npm-utils.js @@ -12,10 +12,10 @@ const {exec} = require('shelljs'); function getPackageVersionStrByTag(packageName, tag) { - const result = exec(`npm view ${packageName}@${tag} version`); + const result = exec(`npm view ${packageName}@${tag} version`, {silent: true}); if (result.code) { - throw `Failed to get ${tag} version from npm\n${result.stderr}`; + throw new Error(`Failed to get ${tag} version from npm\n${result.stderr}`); } return result.stdout.trim(); } @@ -31,7 +31,34 @@ function publishPackage(packagePath, packageOptions, execOptions) { return exec(`npm publish${tagFlag}${otpFlag}`, options); } +function diffPackages(packageSpecA, packageSpecB, options) { + const result = exec( + `npm diff --diff=${packageSpecA} --diff=${packageSpecB} --diff-name-only`, + options, + ); + + if (result.code) { + throw new Error( + `Failed to diff ${packageSpecA} and ${packageSpecB}\n${result.stderr}`, + ); + } + + return result.stdout; +} + +function pack(packagePath) { + const result = exec('npm pack', { + cwd: packagePath, + }); + + if (result.code !== 0) { + throw new Error(result.stderr); + } +} + module.exports = { getPackageVersionStrByTag, publishPackage, + diffPackages, + pack, }; diff --git a/scripts/publish-npm.js b/scripts/publish-npm.js index 275407ad621aa6..653a3782c56925 100755 --- a/scripts/publish-npm.js +++ b/scripts/publish-npm.js @@ -17,6 +17,7 @@ const { getCurrentCommit, isTaggedLatest, } = require('./scm-utils'); +const publishNightlyForEachChangedPackage = require('./monorepo/publish-nightly-for-each-changed-package'); const { generateAndroidArtifacts, publishAndroidArtifactsToMaven, @@ -136,6 +137,7 @@ function publishNpm(buildType) { // Set version number in various files (package.json, gradle.properties etc) // For non-nightly, non-dry-run, CircleCI job `prepare_package_for_release` does this if (buildType === 'nightly' || buildType === 'dry-run') { + // Sets the version for package/react-native if ( exec( `node scripts/set-rn-version.js --to-version ${version} --build-type ${buildType}`, @@ -146,6 +148,11 @@ function publishNpm(buildType) { } } + // set and publish the relevant monorepo packages + if (buildType === 'nightly') { + publishNightlyForEachChangedPackage(version); + } + generateAndroidArtifacts(version); // Write version number to the build folder @@ -166,6 +173,7 @@ function publishNpm(buildType) { tag, otp: process.env.NPM_CONFIG_OTP, }); + if (result.code) { echo('Failed to publish package to npm'); return exit(1); diff --git a/scripts/scm-utils.js b/scripts/scm-utils.js index 11810e6470c44e..eab057bd5f44c8 100644 --- a/scripts/scm-utils.js +++ b/scripts/scm-utils.js @@ -85,6 +85,19 @@ function revertFiles(filePaths, tmpFolder) { } } +// git restore for local path +function restore(repoPath) { + const result = exec('git restore .', { + cwd: repoPath, + }); + + if (result.code !== 0) { + throw new Error(result.stderr); + } + + return; +} + module.exports = { exitIfNotOnGit, getCurrentCommit, @@ -92,4 +105,5 @@ module.exports = { isTaggedLatest, revertFiles, saveFiles, + restore, }; From d54f486fe66d01450d3c7a04fb0a025319a3014c Mon Sep 17 00:00:00 2001 From: Daniel Leong Date: Sun, 4 Jun 2023 00:03:01 -0700 Subject: [PATCH 015/468] Fix: a11y crash when an accessible link is ellipsized away (#37050) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: If an accessible link is ellipsized out of being rendered, the AccessibilityDelegate will still attempt to populate an accessibility node for it; doing so results in an invalid request to a TextLayout API, however, causing a crash. This crash occurs as soon as the element is rendered, so long as a Screen Reader (or app using similar a11y APIs) is enabled. This change uses a technique similar to those existing to make the node "blank" in such cases, so Talkback can filter it out—and, more importantly, not crash. ## Changelog: [Android] [Fixed] - Fix links hidden via ellipsis crashing screen readers Pull Request resolved: https://github.com/facebook/react-native/pull/37050 Test Plan: - Added a block to the "Accessibility Android APIs" page in the rn-tester app. Without the changes to `ReactAccessibilityDelegate`, this component crashes the app; with the changes, the component renders without problem. - You can also see the crash "in the wild" using [this Expo Snack](https://snack.expo.dev/dhleong/2d1407) that I put together when trying to isolate this issue. Reviewed By: rshest Differential Revision: D46206673 Pulled By: NickGerleman fbshipit-source-id: 0eb3e735202ee6be5f931bbb4bb92c24e7458ea6 --- .../uimanager/ReactAccessibilityDelegate.java | 25 ++++++++++++++++--- .../AccessibilityAndroidExample.android.js | 14 +++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java index 531e4591ba6a99..b8b08c9bf74e8c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java @@ -786,9 +786,18 @@ protected void onPopulateNodeForVirtualView( return; } + // NOTE: The span may not actually have visible bounds within its parent, + // due to line limits, etc. + final Rect bounds = getBoundsInParent(accessibleTextSpan); + if (bounds == null) { + node.setContentDescription(""); + node.setBoundsInParent(new Rect(0, 0, 1, 1)); + return; + } + node.setContentDescription(accessibleTextSpan.description); node.addAction(AccessibilityNodeInfoCompat.ACTION_CLICK); - node.setBoundsInParent(getBoundsInParent(accessibleTextSpan)); + node.setBoundsInParent(bounds); node.setRoleDescription(mView.getResources().getString(R.string.link_description)); node.setClassName(AccessibilityRole.getValue(AccessibilityRole.BUTTON)); } @@ -805,10 +814,19 @@ private Rect getBoundsInParent(AccessibilityLinks.AccessibleLink accessibleLink) return new Rect(0, 0, textView.getWidth(), textView.getHeight()); } - Rect rootRect = new Rect(); - double startOffset = accessibleLink.start; double endOffset = accessibleLink.end; + + // Ensure the link hasn't been ellipsized away; in such cases, + // getPrimaryHorizontal will crash (and the link isn't rendered anyway). + int startOffsetLineNumber = textViewLayout.getLineForOffset((int) startOffset); + int lineEndOffset = textViewLayout.getLineEnd(startOffsetLineNumber); + if (startOffset > lineEndOffset) { + return null; + } + + Rect rootRect = new Rect(); + double startXCoordinates = textViewLayout.getPrimaryHorizontal((int) startOffset); final Paint paint = new Paint(); @@ -818,7 +836,6 @@ private Rect getBoundsInParent(AccessibilityLinks.AccessibleLink accessibleLink) paint.setTextSize(textSize); int textWidth = (int) Math.ceil(paint.measureText(accessibleLink.description)); - int startOffsetLineNumber = textViewLayout.getLineForOffset((int) startOffset); int endOffsetLineNumber = textViewLayout.getLineForOffset((int) endOffset); boolean isMultiline = startOffsetLineNumber != endOffsetLineNumber; textViewLayout.getLineBounds(startOffsetLineNumber, rootRect); diff --git a/packages/rn-tester/js/examples/Accessibility/AccessibilityAndroidExample.android.js b/packages/rn-tester/js/examples/Accessibility/AccessibilityAndroidExample.android.js index 2daf0ba27c6709..f5da9efc20e3c8 100644 --- a/packages/rn-tester/js/examples/Accessibility/AccessibilityAndroidExample.android.js +++ b/packages/rn-tester/js/examples/Accessibility/AccessibilityAndroidExample.android.js @@ -65,6 +65,20 @@ class AccessibilityAndroidExample extends React.Component< render(): React.Node { return ( + + + + Bacon {this.state.count} Ipsum{'\n'} + + Dolor sit amet{'\n'} + Eggsecetur{'\n'} + {'\n'} + + http://github.com + + + + From 2d07d5f160efdd25f5b3dbfa65c13884df9f3117 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Sun, 4 Jun 2023 03:48:45 -0700 Subject: [PATCH 016/468] Native ARIA Roles: iOS Paper + Fabric (#37309) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37309 ### Stack ARIA roles in React Native are implemented on top of accessibilityRole. This is lossy because there are many more ARIA roles than accessibilityRole. This is especially true for RN on desktop where accessibilityRole was designed around accessibility APIs only available on mobile. This series of changes aims to change this implementation to instead pass the ARIA role to native, alongside any existing accessibilityRole. This gives the platform more control in exactly how to map an ARIA role to native behavior. As an example, this would allow mapping any ARIA role to AutomationControlType on Windows without needing to fork to add new options to accessibilityRole. It also allows greater implementation flexibility for other platforms down the line, but for now, iOS and Android behave the same as before (though with their implementation living in native). ### Diff This enables the `role` prop in iOS. ARIA role strings become convertible to `UIAccessibilityTrait`, which is the sink of most of the roles. We keep a list of traits derived from `role` vs `accessibilityRole` on the view, then inval and apply the result any time the prop for either is set. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D45432530 fbshipit-source-id: ced5be06e319c0b967d7511293e14e05147e5759 --- .../View/RCTViewComponentView.mm | 4 +- packages/react-native/React/Views/RCTView.m | 6 +- .../react-native/React/Views/RCTViewManager.m | 132 +++++++++++++----- .../react-native/React/Views/UIView+React.h | 3 + .../react-native/React/Views/UIView+React.m | 37 +++++ .../components/view/AccessibilityProps.cpp | 40 +++--- .../view/accessibilityPropsConversions.h | 4 +- .../RCTAttributedTextUtils.h | 2 + .../RCTAttributedTextUtils.mm | 131 +---------------- 9 files changed, 178 insertions(+), 181 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index ecfe8bc408fd95..97feafc4c10fe1 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -17,6 +17,7 @@ #import #import #import +#import #ifdef RCT_DYNAMIC_FRAMEWORKS #import @@ -722,7 +723,8 @@ - (NSString *)accessibilityValue } NSMutableArray *valueComponents = [NSMutableArray new]; - NSString *roleString = [NSString stringWithUTF8String:props.accessibilityRole.c_str()]; + NSString *roleString = (props.role != Role::None) ? [NSString stringWithUTF8String:toString(props.role).c_str()] + : [NSString stringWithUTF8String:props.accessibilityRole.c_str()]; // In iOS, checkbox and radio buttons aren't recognized as traits. However, // because our apps use checkbox and radio buttons often, we should announce diff --git a/packages/react-native/React/Views/RCTView.m b/packages/react-native/React/Views/RCTView.m index fc678c2577af5e..66c6c5978f8a40 100644 --- a/packages/react-native/React/Views/RCTView.m +++ b/packages/react-native/React/Views/RCTView.m @@ -332,7 +332,11 @@ - (NSString *)accessibilityValue } } NSMutableArray *valueComponents = [NSMutableArray new]; - NSString *roleDescription = self.accessibilityRole ? rolesAndStatesDescription[self.accessibilityRole] : nil; + + // TODO: This logic makes VoiceOver describe some AccessibilityRole which do not have a backing UIAccessibilityTrait. + // It does not run on Fabric. + NSString *role = self.role ?: self.accessibilityRole; + NSString *roleDescription = role ? rolesAndStatesDescription[role] : nil; if (roleDescription) { [valueComponents addObject:roleDescription]; } diff --git a/packages/react-native/React/Views/RCTViewManager.m b/packages/react-native/React/Views/RCTViewManager.m index 2b8f2c0a33ab4f..9a0af4e74cecb9 100644 --- a/packages/react-native/React/Views/RCTViewManager.m +++ b/packages/react-native/React/Views/RCTViewManager.m @@ -26,54 +26,97 @@ @implementation RCTConvert (UIAccessibilityTraits) RCT_MULTI_ENUM_CONVERTER( UIAccessibilityTraits, (@{ - @"none" : @(UIAccessibilityTraitNone), + @"adjustable" : @(UIAccessibilityTraitAdjustable), + @"alert" : @(UIAccessibilityTraitNone), + @"alertdialog" : @(UIAccessibilityTraitNone), + @"allowsDirectInteraction" : @(UIAccessibilityTraitAllowsDirectInteraction), + @"application" : @(UIAccessibilityTraitNone), + @"article" : @(UIAccessibilityTraitNone), + @"banner" : @(UIAccessibilityTraitNone), @"button" : @(UIAccessibilityTraitButton), + @"cell" : @(UIAccessibilityTraitNone), + @"checkbox" : @(UIAccessibilityTraitNone), + @"columnheader" : @(UIAccessibilityTraitNone), + @"combobox" : @(UIAccessibilityTraitNone), + @"complementary" : @(UIAccessibilityTraitNone), + @"contentinfo" : @(UIAccessibilityTraitNone), + @"definition" : @(UIAccessibilityTraitNone), + @"dialog" : @(UIAccessibilityTraitNone), + @"directory" : @(UIAccessibilityTraitNone), + @"disabled" : @(UIAccessibilityTraitNotEnabled), + @"document" : @(UIAccessibilityTraitNone), + @"drawerlayout" : @(UIAccessibilityTraitNone), @"dropdownlist" : @(UIAccessibilityTraitNone), - @"togglebutton" : @(UIAccessibilityTraitButton), - @"link" : @(UIAccessibilityTraitLink), + @"feed" : @(UIAccessibilityTraitNone), + @"figure" : @(UIAccessibilityTraitNone), + @"form" : @(UIAccessibilityTraitNone), + @"frequentUpdates" : @(UIAccessibilityTraitUpdatesFrequently), + @"grid" : @(UIAccessibilityTraitNone), + @"group" : @(UIAccessibilityTraitNone), @"header" : @(UIAccessibilityTraitHeader), - @"search" : @(UIAccessibilityTraitSearchField), + @"heading" : @(UIAccessibilityTraitHeader), + @"horizontalscrollview" : @(UIAccessibilityTraitNone), + @"iconmenu" : @(UIAccessibilityTraitNone), @"image" : @(UIAccessibilityTraitImage), @"imagebutton" : @(UIAccessibilityTraitImage | UIAccessibilityTraitButton), - @"selected" : @(UIAccessibilityTraitSelected), - @"plays" : @(UIAccessibilityTraitPlaysSound), + @"img" : @(UIAccessibilityTraitImage), @"key" : @(UIAccessibilityTraitKeyboardKey), @"keyboardkey" : @(UIAccessibilityTraitKeyboardKey), - @"text" : @(UIAccessibilityTraitStaticText), - @"summary" : @(UIAccessibilityTraitSummaryElement), - @"disabled" : @(UIAccessibilityTraitNotEnabled), - @"frequentUpdates" : @(UIAccessibilityTraitUpdatesFrequently), - @"startsMedia" : @(UIAccessibilityTraitStartsMediaSession), - @"adjustable" : @(UIAccessibilityTraitAdjustable), - @"allowsDirectInteraction" : @(UIAccessibilityTraitAllowsDirectInteraction), - @"pageTurn" : @(UIAccessibilityTraitCausesPageTurn), - @"alert" : @(UIAccessibilityTraitNone), - @"checkbox" : @(UIAccessibilityTraitNone), - @"combobox" : @(UIAccessibilityTraitNone), + @"link" : @(UIAccessibilityTraitLink), + @"list" : @(UIAccessibilityTraitNone), + @"listitem" : @(UIAccessibilityTraitNone), + @"log" : @(UIAccessibilityTraitNone), + @"main" : @(UIAccessibilityTraitNone), + @"marquee" : @(UIAccessibilityTraitNone), + @"math" : @(UIAccessibilityTraitNone), @"menu" : @(UIAccessibilityTraitNone), @"menubar" : @(UIAccessibilityTraitNone), @"menuitem" : @(UIAccessibilityTraitNone), + @"meter" : @(UIAccessibilityTraitNone), + @"navigation" : @(UIAccessibilityTraitNone), + @"none" : @(UIAccessibilityTraitNone), + @"note" : @(UIAccessibilityTraitNone), + @"option" : @(UIAccessibilityTraitNone), + @"pager" : @(UIAccessibilityTraitNone), + @"pageTurn" : @(UIAccessibilityTraitCausesPageTurn), + @"plays" : @(UIAccessibilityTraitPlaysSound), + @"presentation" : @(UIAccessibilityTraitNone), @"progressbar" : @(UIAccessibilityTraitUpdatesFrequently), @"radio" : @(UIAccessibilityTraitNone), @"radiogroup" : @(UIAccessibilityTraitNone), + @"region" : @(UIAccessibilityTraitNone), + @"row" : @(UIAccessibilityTraitNone), + @"rowgroup" : @(UIAccessibilityTraitNone), + @"rowheader" : @(UIAccessibilityTraitNone), @"scrollbar" : @(UIAccessibilityTraitNone), + @"scrollview" : @(UIAccessibilityTraitNone), + @"search" : @(UIAccessibilityTraitSearchField), + @"searchbox" : @(UIAccessibilityTraitNone), + @"selected" : @(UIAccessibilityTraitSelected), + @"separator" : @(UIAccessibilityTraitNone), + @"slider" : @(UIAccessibilityTraitNone), + @"slidingdrawer" : @(UIAccessibilityTraitNone), @"spinbutton" : @(UIAccessibilityTraitNone), + @"startsMedia" : @(UIAccessibilityTraitStartsMediaSession), + @"status" : @(UIAccessibilityTraitNone), + @"summary" : @(UIAccessibilityTraitSummaryElement), @"switch" : @(SwitchAccessibilityTrait), @"tab" : @(UIAccessibilityTraitNone), @"tabbar" : @(UIAccessibilityTraitTabBar), + @"table" : @(UIAccessibilityTraitNone), @"tablist" : @(UIAccessibilityTraitNone), + @"tabpanel" : @(UIAccessibilityTraitNone), + @"term" : @(UIAccessibilityTraitNone), + @"text" : @(UIAccessibilityTraitStaticText), @"timer" : @(UIAccessibilityTraitNone), + @"togglebutton" : @(UIAccessibilityTraitButton), @"toolbar" : @(UIAccessibilityTraitNone), - @"pager" : @(UIAccessibilityTraitNone), - @"scrollview" : @(UIAccessibilityTraitNone), - @"horizontalscrollview" : @(UIAccessibilityTraitNone), + @"tooltip" : @(UIAccessibilityTraitNone), + @"tree" : @(UIAccessibilityTraitNone), + @"treegrid" : @(UIAccessibilityTraitNone), + @"treeitem" : @(UIAccessibilityTraitNone), @"viewgroup" : @(UIAccessibilityTraitNone), @"webview" : @(UIAccessibilityTraitNone), - @"drawerlayout" : @(UIAccessibilityTraitNone), - @"slidingdrawer" : @(UIAccessibilityTraitNone), - @"iconmenu" : @(UIAccessibilityTraitNone), - @"list" : @(UIAccessibilityTraitNone), - @"grid" : @(UIAccessibilityTraitNone), }), UIAccessibilityTraitNone, unsignedLongLongValue) @@ -182,22 +225,41 @@ - (RCTShadowView *)shadowView } RCT_CUSTOM_VIEW_PROPERTY(accessibilityRole, UIAccessibilityTraits, RCTView) +{ + UIAccessibilityTraits accessibilityRoleTraits = + json ? [RCTConvert UIAccessibilityTraits:json] : UIAccessibilityTraitNone; + if (view.reactAccessibilityElement.accessibilityRoleTraits != accessibilityRoleTraits) { + view.accessibilityRoleTraits = accessibilityRoleTraits; + view.reactAccessibilityElement.accessibilityRole = json ? [RCTConvert NSString:json] : nil; + [self updateAccessibilityTraitsForRole:view withDefaultView:defaultView]; + } +} + +RCT_CUSTOM_VIEW_PROPERTY(role, UIAccessibilityTraits, RCTView) +{ + UIAccessibilityTraits roleTraits = json ? [RCTConvert UIAccessibilityTraits:json] : UIAccessibilityTraitNone; + if (view.reactAccessibilityElement.roleTraits != roleTraits) { + view.roleTraits = roleTraits; + view.reactAccessibilityElement.role = json ? [RCTConvert NSString:json] : nil; + [self updateAccessibilityTraitsForRole:view withDefaultView:defaultView]; + } +} + +- (void)updateAccessibilityTraitsForRole:(RCTView *)view withDefaultView:(RCTView *)defaultView { const UIAccessibilityTraits AccessibilityRolesMask = UIAccessibilityTraitNone | UIAccessibilityTraitButton | UIAccessibilityTraitLink | UIAccessibilityTraitSearchField | UIAccessibilityTraitImage | UIAccessibilityTraitKeyboardKey | UIAccessibilityTraitStaticText | UIAccessibilityTraitAdjustable | UIAccessibilityTraitHeader | UIAccessibilityTraitSummaryElement | UIAccessibilityTraitTabBar | UIAccessibilityTraitUpdatesFrequently | SwitchAccessibilityTrait; - view.reactAccessibilityElement.accessibilityTraits = - view.reactAccessibilityElement.accessibilityTraits & ~AccessibilityRolesMask; - UIAccessibilityTraits newTraits = json ? [RCTConvert UIAccessibilityTraits:json] : defaultView.accessibilityTraits; - if (newTraits != UIAccessibilityTraitNone) { - UIAccessibilityTraits maskedTraits = newTraits & AccessibilityRolesMask; - view.reactAccessibilityElement.accessibilityTraits |= maskedTraits; - } else { - NSString *role = json ? [RCTConvert NSString:json] : @""; - view.reactAccessibilityElement.accessibilityRole = role; - } + + // Clear any existing traits set for AccessibilityRole + view.reactAccessibilityElement.accessibilityTraits &= ~(AccessibilityRolesMask); + + view.reactAccessibilityElement.accessibilityTraits |= view.reactAccessibilityElement.role + ? view.reactAccessibilityElement.roleTraits + : view.reactAccessibilityElement.accessibilityRole ? view.reactAccessibilityElement.accessibilityRoleTraits + : (defaultView.accessibilityTraits & AccessibilityRolesMask); } RCT_CUSTOM_VIEW_PROPERTY(accessibilityState, NSDictionary, RCTView) diff --git a/packages/react-native/React/Views/UIView+React.h b/packages/react-native/React/Views/UIView+React.h index 21a70337d7ac9c..d378a8320ba1d3 100644 --- a/packages/react-native/React/Views/UIView+React.h +++ b/packages/react-native/React/Views/UIView+React.h @@ -117,10 +117,13 @@ * Accessibility properties */ @property (nonatomic, copy) NSString *accessibilityRole; +@property (nonatomic, copy) NSString *role; @property (nonatomic, copy) NSDictionary *accessibilityState; @property (nonatomic, copy) NSArray *accessibilityActions; @property (nonatomic, copy) NSDictionary *accessibilityValueInternal; @property (nonatomic, copy) NSString *accessibilityLanguage; +@property (nonatomic) UIAccessibilityTraits accessibilityRoleTraits; +@property (nonatomic) UIAccessibilityTraits roleTraits; /** * Used in debugging to get a description of the view hierarchy rooted at diff --git a/packages/react-native/React/Views/UIView+React.m b/packages/react-native/React/Views/UIView+React.m index 94ad951e7179d7..7c6c71829ff69d 100644 --- a/packages/react-native/React/Views/UIView+React.m +++ b/packages/react-native/React/Views/UIView+React.m @@ -336,6 +336,16 @@ - (void)setAccessibilityRole:(NSString *)accessibilityRole objc_setAssociatedObject(self, @selector(accessibilityRole), accessibilityRole, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } +- (NSString *)role +{ + return objc_getAssociatedObject(self, _cmd); +} + +- (void)setRole:(NSString *)role +{ + objc_setAssociatedObject(self, @selector(role), role, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + - (NSDictionary *)accessibilityState { return objc_getAssociatedObject(self, _cmd); @@ -356,6 +366,33 @@ - (void)setAccessibilityValueInternal:(NSDictionary *)accessibil self, @selector(accessibilityValueInternal), accessibilityValue, OBJC_ASSOCIATION_RETAIN_NONATOMIC); } +- (UIAccessibilityTraits)accessibilityRoleTraits +{ + NSNumber *traitsAsNumber = objc_getAssociatedObject(self, _cmd); + return traitsAsNumber ? [traitsAsNumber unsignedLongLongValue] : UIAccessibilityTraitNone; +} + +- (void)setAccessibilityRoleTraits:(UIAccessibilityTraits)accessibilityRoleTraits +{ + objc_setAssociatedObject( + self, + @selector(accessibilityRoleTraits), + [NSNumber numberWithUnsignedLongLong:accessibilityRoleTraits], + OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (UIAccessibilityTraits)roleTraits +{ + NSNumber *traitsAsNumber = objc_getAssociatedObject(self, _cmd); + return traitsAsNumber ? [traitsAsNumber unsignedLongLongValue] : UIAccessibilityTraitNone; +} + +- (void)setRoleTraits:(UIAccessibilityTraits)roleTraits +{ + objc_setAssociatedObject( + self, @selector(roleTraits), [NSNumber numberWithUnsignedLongLong:roleTraits], OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + #pragma mark - Debug - (void)react_addRecursiveDescriptionToString:(NSMutableString *)string atLevel:(NSUInteger)level { diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp index ad6cf1ce83d8ac..d9ebf62e9b5330 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp @@ -171,14 +171,6 @@ AccessibilityProps::AccessibilityProps( "importantForAccessibility", sourceProps.importantForAccessibility, ImportantForAccessibility::Auto)), - role( - CoreFeatures::enablePropIteratorSetter ? sourceProps.role - : convertRawProp( - context, - rawProps, - "role", - sourceProps.role, - {})), testId( CoreFeatures::enablePropIteratorSetter ? sourceProps.testId : convertRawProp( @@ -195,19 +187,31 @@ AccessibilityProps::AccessibilityProps( // to work around here, and (2) would require very careful work to address // this case and not regress the more common cases. if (!CoreFeatures::enablePropIteratorSetter) { - const auto *rawPropValue = + auto *accessibilityRoleValue = rawProps.at("accessibilityRole", nullptr, nullptr); - AccessibilityTraits traits; - std::string roleString; - if (rawPropValue == nullptr || !rawPropValue->hasValue()) { - traits = sourceProps.accessibilityTraits; - roleString = sourceProps.accessibilityRole; + auto *roleValue = rawProps.at("role", nullptr, nullptr); + + auto *precedentRoleValue = + roleValue != nullptr ? roleValue : accessibilityRoleValue; + + if (accessibilityRoleValue == nullptr || + !accessibilityRoleValue->hasValue()) { + accessibilityRole = sourceProps.accessibilityRole; + } else { + fromRawValue(context, *accessibilityRoleValue, accessibilityRole); + } + + if (roleValue == nullptr || !roleValue->hasValue()) { + role = sourceProps.role; + } else { + fromRawValue(context, *roleValue, role); + } + + if (precedentRoleValue == nullptr || !precedentRoleValue->hasValue()) { + accessibilityTraits = sourceProps.accessibilityTraits; } else { - fromRawValue(context, *rawPropValue, traits); - fromRawValue(context, *rawPropValue, roleString); + fromRawValue(context, *precedentRoleValue, accessibilityTraits); } - accessibilityTraits = traits; - accessibilityRole = roleString; } } diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h b/packages/react-native/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h index 9ee16674181ede..1690113e239fcc 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/accessibilityPropsConversions.h @@ -30,7 +30,7 @@ inline void fromString(const std::string &string, AccessibilityTraits &result) { result = AccessibilityTraits::Link; return; } - if (string == "image") { + if (string == "image" || string == "img") { result = AccessibilityTraits::Image; return; } @@ -78,7 +78,7 @@ inline void fromString(const std::string &string, AccessibilityTraits &result) { result = AccessibilityTraits::CausesPageTurn; return; } - if (string == "header") { + if (string == "header" || string == "heading") { result = AccessibilityTraits::Header; return; } diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h index b09fd7115ebe65..fe0adae88f4a5e 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h @@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN NSString *const RCTAttributedStringIsHighlightedAttributeName = @"IsHighlighted"; NSString *const RCTAttributedStringEventEmitterKey = @"EventEmitter"; + +// String representation of either `role` or `accessibilityRole` NSString *const RCTTextAttributesAccessibilityRoleAttributeName = @"AccessibilityRole"; /* diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm index 68388d1c839880..7db4677a329f4f 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm @@ -7,6 +7,7 @@ #import "RCTAttributedTextUtils.h" +#include #include #include #include @@ -288,130 +289,12 @@ inline static CGFloat RCTEffectiveFontSizeMultiplierFromTextAttributes(const Tex attributes[RCTAttributedStringIsHighlightedAttributeName] = @YES; } - if (textAttributes.accessibilityRole.has_value()) { - auto accessibilityRole = textAttributes.accessibilityRole.value(); - switch (accessibilityRole) { - case AccessibilityRole::None: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("none"); - break; - case AccessibilityRole::Button: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("button"); - break; - case AccessibilityRole::Dropdownlist: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("dropdownlist"); - break; - case AccessibilityRole::Togglebutton: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("togglebutton"); - break; - case AccessibilityRole::Link: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("link"); - break; - case AccessibilityRole::Search: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("search"); - break; - case AccessibilityRole::Image: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("image"); - break; - case AccessibilityRole::Keyboardkey: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("keyboardkey"); - break; - case AccessibilityRole::Text: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("text"); - break; - case AccessibilityRole::Adjustable: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("adjustable"); - break; - case AccessibilityRole::Imagebutton: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("imagebutton"); - break; - case AccessibilityRole::Header: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("header"); - break; - case AccessibilityRole::Summary: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("summary"); - break; - case AccessibilityRole::Alert: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("alert"); - break; - case AccessibilityRole::Checkbox: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("checkbox"); - break; - case AccessibilityRole::Combobox: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("combobox"); - break; - case AccessibilityRole::Menu: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("menu"); - break; - case AccessibilityRole::Menubar: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("menubar"); - break; - case AccessibilityRole::Menuitem: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("menuitem"); - break; - case AccessibilityRole::Progressbar: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("progressbar"); - break; - case AccessibilityRole::Radio: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("radio"); - break; - case AccessibilityRole::Radiogroup: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("radiogroup"); - break; - case AccessibilityRole::Scrollbar: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("scrollbar"); - break; - case AccessibilityRole::Spinbutton: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("spinbutton"); - break; - case AccessibilityRole::Switch: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("switch"); - break; - case AccessibilityRole::Tab: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("tab"); - break; - case AccessibilityRole::Tabbar: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("tabbar"); - break; - case AccessibilityRole::Tablist: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("tablist"); - break; - case AccessibilityRole::Timer: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("timer"); - break; - case AccessibilityRole::List: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("list"); - break; - case AccessibilityRole::Toolbar: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("toolbar"); - break; - case AccessibilityRole::Grid: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("grid"); - break; - case AccessibilityRole::Pager: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("pager"); - break; - case AccessibilityRole::Scrollview: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("scrollview"); - break; - case AccessibilityRole::Horizontalscrollview: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("horizontalscrollview"); - break; - case AccessibilityRole::Viewgroup: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("viewgroup"); - break; - case AccessibilityRole::Webview: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("webview"); - break; - case AccessibilityRole::Drawerlayout: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("drawerlayout"); - break; - case AccessibilityRole::Slidingdrawer: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("slidingdrawer"); - break; - case AccessibilityRole::Iconmenu: - attributes[RCTTextAttributesAccessibilityRoleAttributeName] = @("iconmenu"); - break; - }; + if (textAttributes.role.has_value()) { + std::string roleStr = toString(textAttributes.role.value()); + attributes[RCTTextAttributesAccessibilityRoleAttributeName] = [NSString stringWithCString:roleStr.c_str()]; + } else if (textAttributes.accessibilityRole.has_value()) { + std::string roleStr = toString(textAttributes.accessibilityRole.value()); + attributes[RCTTextAttributesAccessibilityRoleAttributeName] = [NSString stringWithCString:roleStr.c_str()]; } return [attributes copy]; From 7a1229ea0f5d19cd692097a7bf093e122fbbcc15 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 5 Jun 2023 02:18:38 -0700 Subject: [PATCH 017/468] Backport Hermes release fix on `main` (#37685) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37685 I'm backporting this comming `60a452b4853dc5651c465867344904dd6fc86703` from the release branch of 0.72-stable to main which fixes this issue in the Android NDK: https://github.com/android/ndk/issues/1740#issuecomment-1198438260 Changelog: [Internal] [Changed] - Backport Hermes release fix on `main` Reviewed By: mdvacca Differential Revision: D46398346 fbshipit-source-id: 593ca9523cb223e7c2d9fe6cccc1abb3ed331203 --- packages/react-native/ReactAndroid/hermes-engine/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native/ReactAndroid/hermes-engine/build.gradle b/packages/react-native/ReactAndroid/hermes-engine/build.gradle index ce03961aefa3d8..c1fceaaeec7747 100644 --- a/packages/react-native/ReactAndroid/hermes-engine/build.gradle +++ b/packages/react-native/ReactAndroid/hermes-engine/build.gradle @@ -181,6 +181,9 @@ 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" } } } From 805604d1e30f32224156ea4643f2eefe8b12f615 Mon Sep 17 00:00:00 2001 From: Aymane Missouri Date: Mon, 5 Jun 2023 02:19:26 -0700 Subject: [PATCH 018/468] use TripleEqual instead of doubleEqual when comparing two string (#37673) Summary: It is generally recommended to use "===" instead of "==" when comparing two strings Pull Request resolved: https://github.com/facebook/react-native/pull/37673 Test Plan: ## Changelog: [Internal] [Changed] - use TripleEqual instead of doubleEqual when comparing two string Reviewed By: cipolleschi Differential Revision: D46434681 Pulled By: cortinico fbshipit-source-id: 70522a28799699854d2a4ab814e34ce796082025 --- .github/workflow-scripts/verifyVersion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflow-scripts/verifyVersion.js b/.github/workflow-scripts/verifyVersion.js index b91efe898eed6e..744f148c90ec33 100644 --- a/.github/workflow-scripts/verifyVersion.js +++ b/.github/workflow-scripts/verifyVersion.js @@ -11,7 +11,7 @@ module.exports = async (github, context) => { const issue = context.payload.issue; // Ignore issues using upgrade template (they use a special label) - if (issue.labels.find(label => label.name == 'Type: Upgrade Issue')) { + if (issue.labels.find(label => label.name === 'Type: Upgrade Issue')) { return; } From 41d5f4bce2850d3a81c0c02961c0768026dd353e Mon Sep 17 00:00:00 2001 From: Blake Friedman Date: Mon, 5 Jun 2023 03:00:32 -0700 Subject: [PATCH 019/468] Prevent DEBUG React Native builds idling out (#37681) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37681 User who run their applications using `npx react-native ios` have the application going into the background if there is inactivity on the device. This is common for users developing on device (why touch the device if you're tweaking background colours, etc...). If the application is build with Xcode directly, this is already managed. This change prevents the idle timer from running in DEBUG builds. ## Changelog: [iOS][Fixed] - Debug builds from cli disable idle to stop application going into background Reviewed By: cipolleschi Differential Revision: D46427401 fbshipit-source-id: 45969cd506a1b76bde3be81d27808bf0e792a817 --- .../react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm index c7701867ecf9c7..fa96ea3b03a045 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm @@ -55,6 +55,12 @@ void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled) #if RCT_NEW_ARCH_ENABLED RCTEnableTurboModule(turboModuleEnabled); #endif + +#if DEBUG + // Disable idle timer in dev builds to avoid putting application in background and complicating + // Metro reconnection logic. Users only need this when running the application using our CLI tooling. + application.idleTimerDisabled = YES; +#endif } UIView * From 34c19232d36190650a7d2d1596ac4f9d4a725777 Mon Sep 17 00:00:00 2001 From: shubham0142 Date: Mon, 5 Jun 2023 05:11:19 -0700 Subject: [PATCH 020/468] refactor(codegen): extract getCommandProperties to parsers-common (#37666) Summary: part of codegen issue https://github.com/facebook/react-native/issues/34872 > Extract the buildCommandProperties function ([Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/index.js#L76-L80), [TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/index.js#L64-L113)) from the index.js's files to the parsers-commons.js file. ## Changelog: [Internal][Added]: Extract getCommandProperties to parsers-common Pull Request resolved: https://github.com/facebook/react-native/pull/37666 Test Plan: yarn test react-native-codegen Reviewed By: cipolleschi Differential Revision: D46437431 Pulled By: rshest fbshipit-source-id: 578b94b9d9fec90ac91fa2a56c707abc46b05b99 --- .../src/parsers/flow/components/index.js | 52 +------------------ .../src/parsers/parsers-commons.js | 51 ++++++++++++++++++ .../parsers/typescript/components/index.js | 51 +----------------- 3 files changed, 53 insertions(+), 101 deletions(-) diff --git a/packages/react-native-codegen/src/parsers/flow/components/index.js b/packages/react-native-codegen/src/parsers/flow/components/index.js index 3e72daa195cc06..ee91c02e15059c 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/index.js +++ b/packages/react-native-codegen/src/parsers/flow/components/index.js @@ -15,62 +15,12 @@ import type {ComponentSchemaBuilderConfig} from '../../schema.js'; const {getCommands} = require('./commands'); const {getEvents} = require('./events'); const {getProperties} = require('./componentsUtils.js'); -const {throwIfTypeAliasIsNotInterface} = require('../../error-utils'); const { - propertyNames, - getCommandOptions, getOptions, findComponentConfig, + getCommandProperties, } = require('../../parsers-commons'); -function getCommandProperties(ast: $FlowFixMe, parser: Parser) { - const {commandTypeName, commandOptionsExpression} = findComponentConfig( - ast, - parser, - ); - - if (commandTypeName == null) { - return []; - } - const types = parser.getTypes(ast); - - const typeAlias = types[commandTypeName]; - - throwIfTypeAliasIsNotInterface(typeAlias, parser); - - const properties = parser.bodyProperties(typeAlias); - if (!properties) { - throw new Error( - `Failed to find type definition for "${commandTypeName}", please check that you have a valid codegen flow file`, - ); - } - - const flowPropertyNames = propertyNames(properties); - - const commandOptions = getCommandOptions(commandOptionsExpression); - - if (commandOptions == null || commandOptions.supportedCommands == null) { - throw new Error( - 'codegenNativeCommands must be given an options object with supportedCommands array', - ); - } - - if ( - commandOptions.supportedCommands.length !== flowPropertyNames.length || - !commandOptions.supportedCommands.every(supportedCommand => - flowPropertyNames.includes(supportedCommand), - ) - ) { - throw new Error( - `codegenNativeCommands expected the same supportedCommands specified in the ${commandTypeName} interface: ${flowPropertyNames.join( - ', ', - )}`, - ); - } - - return properties; -} - // $FlowFixMe[signature-verification-failure] there's no flowtype for AST function buildComponentSchema( ast: $FlowFixMe, diff --git a/packages/react-native-codegen/src/parsers/parsers-commons.js b/packages/react-native-codegen/src/parsers/parsers-commons.js index 4ebe10fac4f4d5..1a7112d61d86ea 100644 --- a/packages/react-native-codegen/src/parsers/parsers-commons.js +++ b/packages/react-native-codegen/src/parsers/parsers-commons.js @@ -59,6 +59,7 @@ const { throwIfMoreThanOneCodegenNativecommands, throwIfConfigNotfound, throwIfMoreThanOneConfig, + throwIfTypeAliasIsNotInterface, } = require('./error-utils'); const { @@ -933,6 +934,55 @@ function findComponentConfig(ast: $FlowFixMe, parser: Parser) { return createComponentConfig(foundConfig, commandsTypeNames); } +// $FlowFixMe[signature-verification-failure] there's no flowtype for AST +function getCommandProperties(ast: $FlowFixMe, parser: Parser) { + const {commandTypeName, commandOptionsExpression} = findComponentConfig( + ast, + parser, + ); + + if (commandTypeName == null) { + return []; + } + const types = parser.getTypes(ast); + + const typeAlias = types[commandTypeName]; + + throwIfTypeAliasIsNotInterface(typeAlias, parser); + + const properties = parser.bodyProperties(typeAlias); + if (!properties) { + throw new Error( + `Failed to find type definition for "${commandTypeName}", please check that you have a valid codegen file`, + ); + } + + const commandPropertyNames = propertyNames(properties); + + const commandOptions = getCommandOptions(commandOptionsExpression); + + if (commandOptions == null || commandOptions.supportedCommands == null) { + throw new Error( + 'codegenNativeCommands must be given an options object with supportedCommands array', + ); + } + + if ( + commandOptions.supportedCommands.length !== commandPropertyNames.length || + !commandOptions.supportedCommands.every(supportedCommand => + commandPropertyNames.includes(supportedCommand), + ) + ) { + throw new Error( + `codegenNativeCommands expected the same supportedCommands specified in the ${commandTypeName} interface: ${commandPropertyNames.join( + ', ', + )}`, + ); + } + + return properties; +} + module.exports = { wrapModuleSchema, unwrapNullable, @@ -956,4 +1006,5 @@ module.exports = { buildPropSchema, getEventArgument, findComponentConfig, + getCommandProperties, }; diff --git a/packages/react-native-codegen/src/parsers/typescript/components/index.js b/packages/react-native-codegen/src/parsers/typescript/components/index.js index 1c8e9526152be0..2ff3290ede7e19 100644 --- a/packages/react-native-codegen/src/parsers/typescript/components/index.js +++ b/packages/react-native-codegen/src/parsers/typescript/components/index.js @@ -16,61 +16,12 @@ const {getCommands} = require('./commands'); const {getEvents} = require('./events'); const {categorizeProps} = require('./extends'); const {getProperties} = require('./componentsUtils.js'); -const {throwIfTypeAliasIsNotInterface} = require('../../error-utils'); const { - propertyNames, - getCommandOptions, getOptions, findComponentConfig, + getCommandProperties, } = require('../../parsers-commons'); -function getCommandProperties(ast: $FlowFixMe, parser: Parser) { - const {commandTypeName, commandOptionsExpression} = findComponentConfig( - ast, - parser, - ); - if (commandTypeName == null) { - return []; - } - - const types = parser.getTypes(ast); - const typeAlias = types[commandTypeName]; - - throwIfTypeAliasIsNotInterface(typeAlias, parser); - - const properties = parser.bodyProperties(typeAlias); - if (!properties) { - throw new Error( - `Failed to find type definition for "${commandTypeName}", please check that you have a valid codegen typescript file`, - ); - } - - const typeScriptPropertyNames = propertyNames(properties); - - const commandOptions = getCommandOptions(commandOptionsExpression); - if (commandOptions == null || commandOptions.supportedCommands == null) { - throw new Error( - 'codegenNativeCommands must be given an options object with supportedCommands array', - ); - } - - if ( - commandOptions.supportedCommands.length !== - typeScriptPropertyNames.length || - !commandOptions.supportedCommands.every(supportedCommand => - typeScriptPropertyNames.includes(supportedCommand), - ) - ) { - throw new Error( - `codegenNativeCommands expected the same supportedCommands specified in the ${commandTypeName} interface: ${typeScriptPropertyNames.join( - ', ', - )}`, - ); - } - - return properties; -} - // $FlowFixMe[unclear-type] TODO(T108222691): Use flow-types for @babel/parser type PropsAST = Object; From 52154e54a29f0fc0e5dd73102bd384298a3ce460 Mon Sep 17 00:00:00 2001 From: ahmadao2214 Date: Mon, 5 Jun 2023 07:48:22 -0700 Subject: [PATCH 021/468] Create emitInt32Prop function (#37663) Summary: Create a function emitInt32Prop(name: string, optional: boolean) in parser-primitives.js. Factor out the code from [Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/events.js#L53-L59) and [TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/events.js#L63-L69) into that function. Use that function in the original call site. ## Changelog: [INTERNAL][ADDED] - emitInt32Prop in parser-primitves [Internal][Added]: Add enterKeyHint in TextInput type declaration Pull Request resolved: https://github.com/facebook/react-native/pull/37624 Reviewed By: cortinico, NickGerleman Differential Revision: D46292040 Pulled By: lunaleaps fbshipit-source-id: a037b7f8dd0d60880dcf1aec64749546fa54a95d --- .../Libraries/Components/TextInput/TextInput.d.ts | 15 +++++++++++++++ .../Libraries/Components/TextInput/TextInput.js | 9 ++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts b/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts index ff029fb29b5f8c..8badb2a9d39de5 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts @@ -70,6 +70,15 @@ export type ReturnKeyTypeOptions = | ReturnKeyTypeAndroid | ReturnKeyTypeIOS; +export type EnterKeyHintTypeAndroid = 'previous'; +export type EnterKeyHintTypeIOS = 'enter'; +export type EnterKeyHintType = 'done' | 'go' | 'next' | 'search' | 'send'; + +export type EnterKeyHintTypeOptions = + | EnterKeyHintType + | EnterKeyHintTypeAndroid + | EnterKeyHintTypeIOS; + type DataDetectorTypes = | 'phoneNumber' | 'link' @@ -779,6 +788,12 @@ export interface TextInputProps */ returnKeyType?: ReturnKeyTypeOptions | undefined; + /** + * Determines what text should be shown to the return key on virtual keyboards. + * Has precedence over the returnKeyType prop. + */ + enterKeyHint?: EnterKeyHintTypeOptions | undefined; + /** * If true, the text input obscures the text entered so that sensitive text like passwords stay secure. * The default value is false. diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.js b/packages/react-native/Libraries/Components/TextInput/TextInput.js index df890974ece66c..67ad18c0c19b42 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.js +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.js @@ -223,13 +223,16 @@ export type TextContentType = | 'oneTimeCode'; export type enterKeyHintType = - | 'enter' + // Cross Platform | 'done' | 'go' | 'next' - | 'previous' | 'search' - | 'send'; + | 'send' + // Android-only + | 'previous' + // iOS-only + | 'enter'; type PasswordRules = string; From 7b763cd3dbf0c46dedd87f85529bfc6b04e58e87 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Mon, 5 Jun 2023 19:48:29 -0700 Subject: [PATCH 029/468] clean up comments and imports in RCTHost header Summary: Changelog: [Internal] now that we've wrapped up the first iteration of the venice stable apis, let's clean up old comments and reorganize things to prepare this header for documentation. bypass-github-export-checks Reviewed By: mdvacca Differential Revision: D46334662 fbshipit-source-id: 68d6d2e41d7f7c5b1c69f3bb72482c418e771f72 --- .../bridgeless/platform/ios/Core/RCTHost.h | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h index b5a3f18ca85fe1..634106b36474ef 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h @@ -10,7 +10,6 @@ #import #import #import -#import #import #import "RCTInstance.h" @@ -21,11 +20,10 @@ NS_ASSUME_NONNULL_BEGIN @class RCTHost; @class RCTJSThreadManager; @class RCTModuleRegistry; -@protocol RCTInstanceDelegate; FB_RUNTIME_PROTOCOL @protocol RCTTurboModuleManagerDelegate; -typedef std::shared_ptr (^RCTHostJSEngineProvider)(void); +// Runtime API @protocol RCTHostDelegate @@ -34,15 +32,13 @@ typedef std::shared_ptr (^RCTHostJSEngineProv message:(NSString *)message exceptionId:(NSUInteger)exceptionId isFatal:(BOOL)isFatal; + - (void)hostDidStart:(RCTHost *)host; @end -/** - * RCTHost is an object which is responsible for managing the lifecycle of a single RCTInstance. - * RCTHost is long lived, while an instance may be deallocated and re-initialized. Some examples of when this happens: - * CMD+R reload in DEV or a JS crash. The host should be the single owner of an RCTInstance. - */ +typedef std::shared_ptr (^RCTHostJSEngineProvider)(void); + @interface RCTHost : NSObject - (instancetype)initWithBundleURL:(NSURL *)bundleURL @@ -50,13 +46,12 @@ typedef std::shared_ptr (^RCTHostJSEngineProv turboModuleManagerDelegate:(id)turboModuleManagerDelegate jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider NS_DESIGNATED_INITIALIZER FB_OBJC_DIRECT; -/** - * This function initializes an RCTInstance if one does not yet exist. This function is currently only called on the - * main thread, but it should be threadsafe. - * TODO T74233481 - Verify if this function is threadsafe. - */ - (void)start; +- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args; + +// Renderer API + - (RCTFabricSurface *)createSurfaceWithModuleName:(NSString *)moduleName mode:(facebook::react::DisplayMode)displayMode initialProperties:(NSDictionary *)properties FB_OBJC_DIRECT; @@ -64,15 +59,11 @@ typedef std::shared_ptr (^RCTHostJSEngineProv - (RCTFabricSurface *)createSurfaceWithModuleName:(NSString *)moduleName initialProperties:(NSDictionary *)properties FB_OBJC_DIRECT; -- (RCTModuleRegistry *)getModuleRegistry FB_OBJC_DIRECT; - - (RCTSurfacePresenter *)getSurfacePresenter FB_OBJC_DIRECT; -/** - * Calls a method on a JS module that has been registered with `registerCallableModule`. Used to invoke a JS function - * from platform code. - */ -- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args; +// Native module API + +- (RCTModuleRegistry *)getModuleRegistry FB_OBJC_DIRECT; @end From 80134f72114543f327f96e246af4f769ad3b25ac Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 5 Jun 2023 20:48:09 -0700 Subject: [PATCH 030/468] Revert changes on ReactHostDelegate (#37712) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37712 This diff is reverting a change on ReactHostDelegate (D45662329) that caused MobileConfig to not being properly initialize in fb4a. bypass-github-export-checks changelog: [internal] internal Reviewed By: NickGerleman Differential Revision: D46468413 fbshipit-source-id: 4013ba1b5bdfa50e4cf500bb1524e92303826d90 --- .../java/com/facebook/react/bridgeless/ReactHostDelegate.kt | 6 +++--- .../java/com/facebook/react/bridgeless/ReactInstance.java | 2 +- .../com/facebook/react/defaults/DefaultReactHostDelegate.kt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHostDelegate.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHostDelegate.kt index e198af4fc83438..3d9ab63ad5afd5 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHostDelegate.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHostDelegate.kt @@ -11,9 +11,9 @@ import com.facebook.infer.annotation.ThreadSafe import com.facebook.react.ReactPackage import com.facebook.react.bridge.JSBundleLoader import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.bridge.ReactContext import com.facebook.react.common.annotations.UnstableReactNativeAPI import com.facebook.react.fabric.ReactNativeConfig +import com.facebook.react.turbomodule.core.TurboModuleManager import com.facebook.react.turbomodule.core.TurboModuleManagerDelegate /** @@ -61,7 +61,7 @@ interface ReactHostDelegate { * ReactNative Configuration that allows to customize the behavior of key/value pairs used by the * framework to enable/disable experimental capabilities */ - fun getReactNativeConfig(context: ReactContext): ReactNativeConfig + fun getReactNativeConfig(turboModuleManager: TurboModuleManager): ReactNativeConfig @UnstableReactNativeAPI class ReactHostDelegateBase( @@ -79,7 +79,7 @@ interface ReactHostDelegate { override fun getTurboModuleManagerDelegate(context: ReactApplicationContext) = turboModuleManagerDelegate(context) - override fun getReactNativeConfig(context: ReactContext) = reactNativeConfig + override fun getReactNativeConfig(turboModuleManager: TurboModuleManager) = reactNativeConfig override fun handleInstanceException(error: Exception) = exceptionHandler(error) } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java index 9552cee95a5d45..85dbe4abe0601f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java @@ -225,7 +225,7 @@ public Collection getViewManagerNames() { mFabricUIManager = new FabricUIManager(mBridgelessReactContext, viewManagerRegistry, eventBeatManager); - ReactNativeConfig config = mDelegate.getReactNativeConfig(mBridgelessReactContext); + ReactNativeConfig config = mDelegate.getReactNativeConfig(mTurboModuleManager); // Misc initialization that needs to be done before Fabric init DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(mBridgelessReactContext); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt index ba09e91f590ae9..c56417f35f8b86 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt @@ -11,13 +11,13 @@ import com.facebook.jni.annotations.DoNotStrip import com.facebook.react.ReactPackage import com.facebook.react.bridge.JSBundleLoader import com.facebook.react.bridge.ReactApplicationContext -import com.facebook.react.bridge.ReactContext import com.facebook.react.bridgeless.BindingsInstaller import com.facebook.react.bridgeless.JSEngineInstance import com.facebook.react.bridgeless.ReactHostDelegate import com.facebook.react.bridgeless.hermes.HermesInstance import com.facebook.react.common.annotations.UnstableReactNativeAPI import com.facebook.react.fabric.ReactNativeConfig +import com.facebook.react.turbomodule.core.TurboModuleManager import com.facebook.react.turbomodule.core.TurboModuleManagerDelegate /** @@ -55,7 +55,7 @@ class DefaultReactHostDelegate( override fun getTurboModuleManagerDelegate(context: ReactApplicationContext) = turboModuleManagerDelegate(context) - override fun getReactNativeConfig(context: ReactContext) = reactNativeConfig + override fun getReactNativeConfig(turboModuleManager: TurboModuleManager) = reactNativeConfig override fun handleInstanceException(error: Exception) = exceptionHandler(error) } From b6b247b874cbdc6ff05066586ad1f6fbef863562 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Mon, 5 Jun 2023 21:31:29 -0700 Subject: [PATCH 031/468] move host:didInitializeRuntime: to public api Summary: Changelog: [Internal] it appears that having some access to jsi in userland will be necessary for framework developers, so i'm moving this API to the public header. bypass-github-export-checks Reviewed By: mdvacca Differential Revision: D46385184 fbshipit-source-id: 7261c0a8ba8c8c9302f65d440a3a3fb2782c0666 --- .../bridgeless/platform/ios/Core/RCTHost+Internal.h | 8 -------- .../react/bridgeless/platform/ios/Core/RCTHost.h | 9 ++++++++- .../react/bridgeless/platform/ios/Core/RCTHost.mm | 8 +------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost+Internal.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost+Internal.h index bedae4a3d98b56..64883331a818b1 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost+Internal.h +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost+Internal.h @@ -8,21 +8,13 @@ #import "RCTHost.h" #import -#import typedef NSURL * (^RCTHostBundleURLProvider)(void); -@protocol RCTHostRuntimeDelegate - -- (void)hostDidInitializeRuntime:(facebook::jsi::Runtime &)runtime; - -@end - @interface RCTHost (Internal) - (void)registerSegmentWithId:(NSNumber *)segmentId path:(NSString *)path; - (void)setBundleURLProvider:(RCTHostBundleURLProvider)bundleURLProvider; -- (void)setRuntimeDelegate:(id)runtimeDelegate; - (void)setContextContainerHandler:(id)contextContainerHandler; @end diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h index 634106b36474ef..12e16a9e407216 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.h @@ -18,7 +18,6 @@ NS_ASSUME_NONNULL_BEGIN @class RCTFabricSurface; @class RCTHost; -@class RCTJSThreadManager; @class RCTModuleRegistry; FB_RUNTIME_PROTOCOL @protocol RCTTurboModuleManagerDelegate; @@ -37,6 +36,12 @@ FB_RUNTIME_PROTOCOL @end +@protocol RCTHostRuntimeDelegate + +- (void)host:(RCTHost *)host didInitializeRuntime:(facebook::jsi::Runtime &)runtime; + +@end + typedef std::shared_ptr (^RCTHostJSEngineProvider)(void); @interface RCTHost : NSObject @@ -46,6 +51,8 @@ typedef std::shared_ptr (^RCTHostJSEngineProv turboModuleManagerDelegate:(id)turboModuleManagerDelegate jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider NS_DESIGNATED_INITIALIZER FB_OBJC_DIRECT; +@property (nonatomic, weak, nullable) id runtimeDelegate; + - (void)start; - (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args; diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm index 104b51e8ab8b7b..d7d8c274af17a5 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm @@ -28,7 +28,6 @@ @implementation RCTHost { __weak id _hostDelegate; __weak id _turboModuleManagerDelegate; - __weak id _runtimeDelegate; __weak id _contextContainerHandler; NSURL *_oldDelegateBundleURL; @@ -257,7 +256,7 @@ - (void)instance:(RCTInstance *)instance didReceiveErrorMap:(facebook::react::Ma - (void)instance:(RCTInstance *)instance didInitializeRuntime:(facebook::jsi::Runtime &)runtime { - [_runtimeDelegate hostDidInitializeRuntime:runtime]; + [self.runtimeDelegate host:self didInitializeRuntime:runtime]; } #pragma mark - RCTContextContainerHandling @@ -279,11 +278,6 @@ - (void)setBundleURLProvider:(RCTHostBundleURLProvider)bundleURLProvider _bundleURLProvider = [bundleURLProvider copy]; } -- (void)setRuntimeDelegate:(id)runtimeDelegate -{ - _runtimeDelegate = runtimeDelegate; -} - - (void)setContextContainerHandler:(id)contextContainerHandler { _contextContainerHandler = contextContainerHandler; From cf27e246ce24be72330cce4dd68a463dba8bf529 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Mon, 5 Jun 2023 23:25:18 -0700 Subject: [PATCH 032/468] Fix rm (#37706) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37706 Changelog: [Internal] Fix wrong usage of shelljs `rm` Reviewed By: NickGerleman Differential Revision: D46450762 fbshipit-source-id: 9e519222642421b596827675af38f643fa84c9f7 --- scripts/monorepo/publish-nightly-for-each-changed-package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/monorepo/publish-nightly-for-each-changed-package.js b/scripts/monorepo/publish-nightly-for-each-changed-package.js index 1c04d722180011..38ee594e7e4075 100644 --- a/scripts/monorepo/publish-nightly-for-each-changed-package.js +++ b/scripts/monorepo/publish-nightly-for-each-changed-package.js @@ -54,7 +54,7 @@ function hasChanges( ); // delete tarball and restore package.json changes - rm({cwd: packageAbsolutePath}, localTarballName); + rm(path.join(packageAbsolutePath, localTarballName)); restore(packageAbsolutePath); return diff.trim().length !== 0; From 0af806e96c20c826f5a4bd55a3f73f512d6bb5af Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Mon, 5 Jun 2023 23:31:10 -0700 Subject: [PATCH 033/468] Fixing line truncation issue when numberOfLines = {1} (#37667) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37667 Changelog: [Android][Fixed] - Fixing line truncation issue in Text containing /n when numberOfLines = {1} When the text has multiple lines (with new line characters \n to hard-break the lines), and the first line is short enough to fit, Text component with `numberOfLines = {1}` doesn't display "..." at the end and rather disrespects the /n character. With `numberOfLines = {1}`, On iOS it translates to `line 1`, on Android & Web it translates to `line 1 line 2...` **Expected Behavior :** `line 1...` Reviewed By: javache, NickGerleman Differential Revision: D46175963 fbshipit-source-id: 3377c38ab65e6801bddb1f262432f8d156a2641f --- .../main/java/com/facebook/react/views/text/ReactTextView.java | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java index 6cda1af267c0e0..43ffc0d31dc2a7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java @@ -577,7 +577,6 @@ public boolean hasOverlappingRendering() { public void setNumberOfLines(int numberOfLines) { mNumberOfLines = numberOfLines == 0 ? ViewDefaults.NUMBER_OF_LINES : numberOfLines; - setSingleLine(mNumberOfLines == 1); setMaxLines(mNumberOfLines); } From 8ffaede05a72973805f668e1dda41060ee054dc4 Mon Sep 17 00:00:00 2001 From: tarunrajput Date: Tue, 6 Jun 2023 02:31:51 -0700 Subject: [PATCH 034/468] add handleGenericTypeAnnotation in parser-commons (#37525) Summary: Part of https://github.com/facebook/react-native/issues/34872 Move the switch construct from [parsers/typescript/utils.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/typescript/utils.js#L59-L93) and [parsers/flow/utils.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/flow/utils.js#L56-L81) to the parsers-commons.js file, in a handleGenericTypeAnnotation function. Use that function in place of the switch. ## Changelog: [Internal][Added]: Added handleGenericTypeAnnotation in parsers-commons Pull Request resolved: https://github.com/facebook/react-native/pull/37525 Test Plan: `yarn test` Reviewed By: cortinico Differential Revision: D46264650 Pulled By: cipolleschi fbshipit-source-id: a315ee8cad24d91c9e98e5533d4cdc8b43ebc9a0 --- .../parsers/__tests__/parsers-commons-test.js | 119 ++++++++++++++++++ .../src/parsers/flow/parser.js | 52 ++++---- .../src/parsers/parser.js | 15 +++ .../src/parsers/parserMock.js | 12 ++ .../src/parsers/parsers-commons.js | 74 ++++++++++- .../src/parsers/typescript/parser.js | 56 +++------ 6 files changed, 263 insertions(+), 65 deletions(-) diff --git a/packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js b/packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js index 047bb00d8a545f..bd62076f6e3d40 100644 --- a/packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js +++ b/packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js @@ -25,6 +25,8 @@ import { getCommandOptions, getOptions, getCommandTypeNameAndOptionsExpression, + getTypeResolutionStatus, + handleGenericTypeAnnotation, } from '../parsers-commons'; import type {ParserType} from '../errors'; @@ -1544,3 +1546,120 @@ describe('getCommandTypeNameAndOptionsExpression', () => { }); }); }); + +describe('getTypeResolutionStatus', () => { + it('returns type resolution status for a type declaration', () => { + const typeAnnotation = { + id: { + name: 'TypeAnnotationName', + }, + }; + expect( + getTypeResolutionStatus('alias', typeAnnotation, flowParser), + ).toEqual({ + successful: true, + type: 'alias', + name: 'TypeAnnotationName', + }); + }); + + it('returns type resolution status for an enum declaration', () => { + const typeAnnotation = { + id: { + name: 'TypeAnnotationName', + }, + }; + expect(getTypeResolutionStatus('enum', typeAnnotation, flowParser)).toEqual( + { + successful: true, + type: 'enum', + name: 'TypeAnnotationName', + }, + ); + }); +}); + +describe('handleGenericTypeAnnotation', () => { + it('returns when TypeAnnotation is a type declaration', () => { + const typeAnnotation = { + id: { + name: 'TypeAnnotationName', + }, + }; + const resolvedTypeAnnotation = { + type: 'TypeAlias', + right: { + type: 'TypeAnnotation', + }, + }; + expect( + handleGenericTypeAnnotation( + typeAnnotation, + resolvedTypeAnnotation, + flowParser, + ), + ).toEqual({ + typeAnnotation: { + type: 'TypeAnnotation', + }, + typeResolutionStatus: { + successful: true, + type: 'alias', + name: 'TypeAnnotationName', + }, + }); + }); + + it('returns when TypeAnnotation is an enum declaration', () => { + const typeAnnotation = { + id: { + name: 'TypeAnnotationName', + }, + }; + const resolvedTypeAnnotation = { + type: 'EnumDeclaration', + body: { + type: 'TypeAnnotation', + }, + }; + expect( + handleGenericTypeAnnotation( + typeAnnotation, + resolvedTypeAnnotation, + flowParser, + ), + ).toEqual({ + typeAnnotation: { + type: 'TypeAnnotation', + }, + typeResolutionStatus: { + successful: true, + type: 'enum', + name: 'TypeAnnotationName', + }, + }); + }); + + it('throws when the non GenericTypeAnnotation is unsupported', () => { + const typeAnnotation = { + type: 'UnsupportedTypeAnnotation', + id: { + name: 'UnsupportedType', + }, + }; + const resolvedTypeAnnotation = { + type: 'UnsupportedTypeAnnotation', + }; + expect(() => + handleGenericTypeAnnotation( + typeAnnotation, + resolvedTypeAnnotation, + flowParser, + ), + ).toThrow( + new Error( + parser.genericTypeAnnotationErrorMessage(resolvedTypeAnnotation), + ), + ); + }); +}); diff --git a/packages/react-native-codegen/src/parsers/flow/parser.js b/packages/react-native-codegen/src/parsers/flow/parser.js index ef7dc90227e0eb..02a02e49b34dd2 100644 --- a/packages/react-native-codegen/src/parsers/flow/parser.js +++ b/packages/react-native-codegen/src/parsers/flow/parser.js @@ -55,11 +55,15 @@ const {flowTranslateTypeAnnotation} = require('./modules'); // $FlowFixMe[untyped-import] there's no flowtype flow-parser const flowParser = require('flow-parser'); -const {buildSchema, buildPropSchema} = require('../parsers-commons'); +const { + buildSchema, + buildPropSchema, + buildModuleSchema, + handleGenericTypeAnnotation, +} = require('../parsers-commons'); const {Visitor} = require('../parsers-primitives'); const {buildComponentSchema} = require('./components'); const {wrapComponentSchema} = require('../schema.js'); -const {buildModuleSchema} = require('../parsers-commons.js'); const fs = require('fs'); @@ -411,36 +415,16 @@ class FlowParser implements Parser { break; } - const resolvedTypeAnnotation = types[node.id.name]; + const typeAnnotationName = this.nameForGenericTypeAnnotation(node); + const resolvedTypeAnnotation = types[typeAnnotationName]; if (resolvedTypeAnnotation == null) { break; } - switch (resolvedTypeAnnotation.type) { - case parser.typeAlias: { - typeResolutionStatus = { - successful: true, - type: 'alias', - name: node.id.name, - }; - node = resolvedTypeAnnotation.right; - break; - } - case parser.enumDeclaration: { - typeResolutionStatus = { - successful: true, - type: 'enum', - name: node.id.name, - }; - node = resolvedTypeAnnotation.body; - break; - } - default: { - throw new TypeError( - `A non GenericTypeAnnotation must be a type declaration ('${parser.typeAlias}') or enum ('${parser.enumDeclaration}'). Instead, got the unsupported ${resolvedTypeAnnotation.type}.`, - ); - } - } + const {typeAnnotation: typeAnnotationNode, typeResolutionStatus: status} = + handleGenericTypeAnnotation(node, resolvedTypeAnnotation, this); + typeResolutionStatus = status; + node = typeAnnotationNode; } return { @@ -531,6 +515,18 @@ class FlowParser implements Parser { ); } } + + nextNodeForTypeAlias(typeAnnotation: $FlowFixMe): $FlowFixMe { + return typeAnnotation.right; + } + + nextNodeForEnum(typeAnnotation: $FlowFixMe): $FlowFixMe { + return typeAnnotation.body; + } + + genericTypeAnnotationErrorMessage(typeAnnotation: $FlowFixMe): string { + return `A non GenericTypeAnnotation must be a type declaration ('${this.typeAlias}') or enum ('${this.enumDeclaration}'). Instead, got the unsupported ${typeAnnotation.type}.`; + } } module.exports = { diff --git a/packages/react-native-codegen/src/parsers/parser.js b/packages/react-native-codegen/src/parsers/parser.js index 79fe566e55272d..77a6243736b37a 100644 --- a/packages/react-native-codegen/src/parsers/parser.js +++ b/packages/react-native-codegen/src/parsers/parser.js @@ -378,4 +378,19 @@ export interface Parser { }; getProperties(typeName: string, types: TypeDeclarationMap): $FlowFixMe; + + /** + * Given a typeAlias, it returns the next node. + */ + nextNodeForTypeAlias(typeAnnotation: $FlowFixMe): $FlowFixMe; + + /** + * Given an enum Declaration, it returns the next node. + */ + nextNodeForEnum(typeAnnotation: $FlowFixMe): $FlowFixMe; + + /** + * Given a unsupported typeAnnotation, returns an error message. + */ + genericTypeAnnotationErrorMessage(typeAnnotation: $FlowFixMe): string; } diff --git a/packages/react-native-codegen/src/parsers/parserMock.js b/packages/react-native-codegen/src/parsers/parserMock.js index 45a1aa0429d6c7..cc936dc185c132 100644 --- a/packages/react-native-codegen/src/parsers/parserMock.js +++ b/packages/react-native-codegen/src/parsers/parserMock.js @@ -456,4 +456,16 @@ export class MockedParser implements Parser { ); } } + + nextNodeForTypeAlias(typeAnnotation: $FlowFixMe): $FlowFixMe { + return typeAnnotation.right; + } + + nextNodeForEnum(typeAnnotation: $FlowFixMe): $FlowFixMe { + return typeAnnotation.body; + } + + genericTypeAnnotationErrorMessage(typeAnnotation: $FlowFixMe): string { + return `A non GenericTypeAnnotation must be a type declaration ('${this.typeAlias}') or enum ('${this.enumDeclaration}'). Instead, got the unsupported ${typeAnnotation.type}.`; + } } diff --git a/packages/react-native-codegen/src/parsers/parsers-commons.js b/packages/react-native-codegen/src/parsers/parsers-commons.js index 1a7112d61d86ea..41f135329425ed 100644 --- a/packages/react-native-codegen/src/parsers/parsers-commons.js +++ b/packages/react-native-codegen/src/parsers/parsers-commons.js @@ -30,7 +30,12 @@ import type { import type {Parser} from './parser'; import type {ParserType} from './errors'; -import type {ParserErrorCapturer, TypeDeclarationMap, PropAST} from './utils'; +import type { + ParserErrorCapturer, + TypeDeclarationMap, + PropAST, + TypeResolutionStatus, +} from './utils'; import type {ComponentSchemaBuilderConfig} from './schema.js'; const { @@ -983,6 +988,71 @@ function getCommandProperties(ast: $FlowFixMe, parser: Parser) { return properties; } +function getTypeResolutionStatus( + type: 'alias' | 'enum', + typeAnnotation: $FlowFixMe, + parser: Parser, +): TypeResolutionStatus { + return { + successful: true, + type, + name: parser.nameForGenericTypeAnnotation(typeAnnotation), + }; +} + +function handleGenericTypeAnnotation( + typeAnnotation: $FlowFixMe, + resolvedTypeAnnotation: TypeDeclarationMap, + parser: Parser, +): { + typeAnnotation: $FlowFixMe, + typeResolutionStatus: TypeResolutionStatus, +} { + let typeResolutionStatus; + let node; + + switch (resolvedTypeAnnotation.type) { + case parser.typeAlias: { + typeResolutionStatus = getTypeResolutionStatus( + 'alias', + typeAnnotation, + parser, + ); + node = parser.nextNodeForTypeAlias(resolvedTypeAnnotation); + break; + } + case parser.enumDeclaration: { + typeResolutionStatus = getTypeResolutionStatus( + 'enum', + typeAnnotation, + parser, + ); + node = parser.nextNodeForEnum(resolvedTypeAnnotation); + break; + } + // parser.interfaceDeclaration is not used here because for flow it should fall through to default case and throw an error + case 'TSInterfaceDeclaration': { + typeResolutionStatus = getTypeResolutionStatus( + 'alias', + typeAnnotation, + parser, + ); + node = resolvedTypeAnnotation; + break; + } + default: { + throw new TypeError( + parser.genericTypeAnnotationErrorMessage(resolvedTypeAnnotation), + ); + } + } + + return { + typeAnnotation: node, + typeResolutionStatus, + }; +} + module.exports = { wrapModuleSchema, unwrapNullable, @@ -1007,4 +1077,6 @@ module.exports = { getEventArgument, findComponentConfig, getCommandProperties, + handleGenericTypeAnnotation, + getTypeResolutionStatus, }; diff --git a/packages/react-native-codegen/src/parsers/typescript/parser.js b/packages/react-native-codegen/src/parsers/typescript/parser.js index f75e6f5cc7780e..ab46d18121a004 100644 --- a/packages/react-native-codegen/src/parsers/typescript/parser.js +++ b/packages/react-native-codegen/src/parsers/typescript/parser.js @@ -43,14 +43,15 @@ const {typeScriptTranslateTypeAnnotation} = require('./modules'); // $FlowFixMe[untyped-import] Use flow-types for @babel/parser const babelParser = require('@babel/parser'); -const {buildSchema} = require('../parsers-commons'); const {Visitor} = require('../parsers-primitives'); const {buildComponentSchema} = require('./components'); const {wrapComponentSchema} = require('../schema.js'); const { + buildSchema, buildModuleSchema, extendsForProp, buildPropSchema, + handleGenericTypeAnnotation, } = require('../parsers-commons.js'); const {parseTopLevelType} = require('./parseTopLevelType'); @@ -408,45 +409,16 @@ class TypeScriptParser implements Parser { break; } - const resolvedTypeAnnotation = types[node.typeName.name]; + const typeAnnotationName = this.nameForGenericTypeAnnotation(node); + const resolvedTypeAnnotation = types[typeAnnotationName]; if (resolvedTypeAnnotation == null) { break; } - switch (resolvedTypeAnnotation.type) { - case parser.typeAlias: { - typeResolutionStatus = { - successful: true, - type: 'alias', - name: node.typeName.name, - }; - node = resolvedTypeAnnotation.typeAnnotation; - break; - } - case parser.interfaceDeclaration: { - typeResolutionStatus = { - successful: true, - type: 'alias', - name: node.typeName.name, - }; - node = resolvedTypeAnnotation; - break; - } - case parser.enumDeclaration: { - typeResolutionStatus = { - successful: true, - type: 'enum', - name: node.typeName.name, - }; - node = resolvedTypeAnnotation; - break; - } - default: { - throw new TypeError( - `A non GenericTypeAnnotation must be a type declaration ('${parser.typeAlias}'), an interface ('${parser.interfaceDeclaration}'), or enum ('${parser.enumDeclaration}'). Instead, got the unsupported ${resolvedTypeAnnotation.type}.`, - ); - } - } + const {typeAnnotation: typeAnnotationNode, typeResolutionStatus: status} = + handleGenericTypeAnnotation(node, resolvedTypeAnnotation, this); + typeResolutionStatus = status; + node = typeAnnotationNode; } return { @@ -559,6 +531,18 @@ class TypeScriptParser implements Parser { ); } } + + nextNodeForTypeAlias(typeAnnotation: $FlowFixMe): $FlowFixMe { + return typeAnnotation.typeAnnotation; + } + + nextNodeForEnum(typeAnnotation: $FlowFixMe): $FlowFixMe { + return typeAnnotation; + } + + genericTypeAnnotationErrorMessage(typeAnnotation: $FlowFixMe): string { + return `A non GenericTypeAnnotation must be a type declaration ('${this.typeAlias}'), an interface ('${this.interfaceDeclaration}'), or enum ('${this.enumDeclaration}'). Instead, got the unsupported ${typeAnnotation.type}.`; + } } module.exports = { From 663a0187094b12d423742e65523c20e778925973 Mon Sep 17 00:00:00 2001 From: MaeIg Date: Tue, 6 Jun 2023 02:31:51 -0700 Subject: [PATCH 035/468] Extract getTypeAnnotationFromProperty from buildPropertiesForEvent into specific parsers (#37573) Summary: This PR aims to remove the duplicated logic in [flow|typescript]/components/events.js files to move it in specific parsers. It is a task of https://github.com/facebook/react-native/issues/34872: > [Codegen 114 - Assigned to MaeIg] Add a function getTypeAnnotationFromProperty(property) in the Parser object and implement it in FlowParser and TypeScriptParser, using the implementation you can find in the [parsers/flow/components/events.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/flow/components/events.js#L174-L177) and parsers/typescript/components/events.js. Use the parsers in the buildPropertiesForEvent. ## Changelog: [Internal] [Changed] - Extract getTypeAnnotationFromProperty from buildPropertiesForEvent into specific parsers [INTERNAL] [CHANGED] `BlobModuleTest` class migrated from Java to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37719 Test Plan: Tests should pass ```sh ./gradlew :packages:react-native:ReactAndroid:test ``` Reviewed By: yungsters Differential Revision: D46485981 Pulled By: cortinico fbshipit-source-id: 69858fedfd84b59d6c1c2aca99f6fa9c0a8832fa --- .../react/modules/blob/BlobModuleTest.java | 156 ------------------ .../react/modules/blob/BlobModuleTest.kt | 155 +++++++++++++++++ 2 files changed, 155 insertions(+), 156 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/blob/BlobModuleTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/blob/BlobModuleTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/blob/BlobModuleTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/blob/BlobModuleTest.java deleted file mode 100644 index 39606f804c944a..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/blob/BlobModuleTest.java +++ /dev/null @@ -1,156 +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.react.modules.blob; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; - -import android.net.Uri; -import com.facebook.react.bridge.Arguments; -import com.facebook.react.bridge.JavaOnlyArray; -import com.facebook.react.bridge.JavaOnlyMap; -import com.facebook.react.bridge.ReactTestHelper; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.util.Arrays; -import java.util.Random; -import java.util.UUID; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.rule.PowerMockRule; -import org.robolectric.RobolectricTestRunner; -import org.robolectric.annotation.Config; - -@PrepareForTest({Arguments.class}) -@RunWith(RobolectricTestRunner.class) -@PowerMockIgnore({"org.mockito.*", "org.robolectric.*", "androidx.*", "android.*"}) -@Config(manifest = Config.NONE) -public class BlobModuleTest { - - private byte[] mBytes; - private String mBlobId; - private BlobModule mBlobModule; - - @Rule public PowerMockRule rule = new PowerMockRule(); - - @Before - public void prepareModules() throws Exception { - PowerMockito.mockStatic(Arguments.class); - Mockito.when(Arguments.createMap()) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - return new JavaOnlyMap(); - } - }); - - mBytes = new byte[120]; - new Random().nextBytes(mBytes); - - mBlobModule = new BlobModule(ReactTestHelper.createCatalystContextForTest()); - mBlobId = mBlobModule.store(mBytes); - } - - @After - public void cleanUp() { - mBlobModule.remove(mBlobId); - } - - @Test - public void testResolve() { - assertArrayEquals(mBytes, mBlobModule.resolve(mBlobId, 0, mBytes.length)); - byte[] expectedRange = Arrays.copyOfRange(mBytes, 30, mBytes.length); - assertArrayEquals(expectedRange, mBlobModule.resolve(mBlobId, 30, mBytes.length - 30)); - } - - @Test - public void testResolveUri() { - Uri uri = - new Uri.Builder() - .appendPath(mBlobId) - .appendQueryParameter("offset", "0") - .appendQueryParameter("size", String.valueOf(mBytes.length)) - .build(); - - assertArrayEquals(mBytes, mBlobModule.resolve(uri)); - } - - @Test - public void testResolveMap() { - JavaOnlyMap blob = new JavaOnlyMap(); - blob.putString("blobId", mBlobId); - blob.putInt("offset", 0); - blob.putInt("size", mBytes.length); - - assertArrayEquals(mBytes, mBlobModule.resolve(blob)); - } - - @Test - public void testRemove() { - assertNotNull(mBlobModule.resolve(mBlobId, 0, mBytes.length)); - - mBlobModule.remove(mBlobId); - - assertNull(mBlobModule.resolve(mBlobId, 0, mBytes.length)); - } - - @Test - public void testCreateFromParts() { - String id = UUID.randomUUID().toString(); - - JavaOnlyMap blobData = new JavaOnlyMap(); - blobData.putString("blobId", mBlobId); - blobData.putInt("offset", 0); - blobData.putInt("size", mBytes.length); - JavaOnlyMap blob = new JavaOnlyMap(); - blob.putMap("data", blobData); - blob.putString("type", "blob"); - - String stringData = "i \u2665 dogs"; - byte[] stringBytes = stringData.getBytes(Charset.forName("UTF-8")); - JavaOnlyMap string = new JavaOnlyMap(); - string.putString("data", stringData); - string.putString("type", "string"); - - JavaOnlyArray parts = new JavaOnlyArray(); - parts.pushMap(blob); - parts.pushMap(string); - - mBlobModule.createFromParts(parts, id); - - int resultSize = mBytes.length + stringBytes.length; - - byte[] result = mBlobModule.resolve(id, 0, resultSize); - - ByteBuffer buffer = ByteBuffer.allocate(resultSize); - buffer.put(mBytes); - buffer.put(stringBytes); - - assertArrayEquals(result, buffer.array()); - } - - @Test - public void testRelease() { - assertNotNull(mBlobModule.resolve(mBlobId, 0, mBytes.length)); - - mBlobModule.release(mBlobId); - - assertNull(mBlobModule.resolve(mBlobId, 0, mBytes.length)); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/blob/BlobModuleTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/blob/BlobModuleTest.kt new file mode 100644 index 00000000000000..979b74b68859df --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/blob/BlobModuleTest.kt @@ -0,0 +1,155 @@ +/* + * 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.react.modules.blob + +import android.net.Uri +import com.facebook.react.bridge.Arguments +import com.facebook.react.bridge.JavaOnlyArray +import com.facebook.react.bridge.JavaOnlyMap +import com.facebook.react.bridge.ReactTestHelper +import java.nio.ByteBuffer +import java.util.UUID +import kotlin.random.Random +import org.junit.After +import org.junit.Assert.assertArrayEquals +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertNull +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.powermock.api.mockito.PowerMockito.mockStatic +import org.powermock.api.mockito.PowerMockito.`when` as whenever +import org.powermock.core.classloader.annotations.PowerMockIgnore +import org.powermock.core.classloader.annotations.PrepareForTest +import org.powermock.modules.junit4.rule.PowerMockRule +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +@PrepareForTest(Arguments::class) +@RunWith(RobolectricTestRunner::class) +@PowerMockIgnore("org.mockito.*", "org.robolectric.*", "androidx.*", "android.*") +@Config(manifest = Config.NONE) +class BlobModuleTest { + private lateinit var bytes: ByteArray + private lateinit var blobId: String + private lateinit var blobModule: BlobModule + + @get:Rule var rule = PowerMockRule() + + @Before + fun prepareModules() { + mockStatic(Arguments::class.java) + whenever(Arguments.createMap()).thenAnswer { JavaOnlyMap() } + + bytes = ByteArray(120) + Random.Default.nextBytes(bytes) + + blobModule = BlobModule(ReactTestHelper.createCatalystContextForTest()) + blobId = blobModule.store(bytes) + } + + @After + fun cleanUp() { + blobModule.remove(blobId) + } + + @Test + fun testResolve() { + assertArrayEquals(bytes, blobModule.resolve(blobId, 0, bytes.size)) + val expectedRange = bytes.copyOfRange(30, bytes.size) + assertArrayEquals(expectedRange, blobModule.resolve(blobId, 30, bytes.size - 30)) + } + + @Test + fun testResolveUri() { + val uri = + Uri.Builder() + .appendPath(blobId) + .appendQueryParameter("offset", "0") + .appendQueryParameter("size", bytes.size.toString()) + .build() + + assertArrayEquals(bytes, blobModule.resolve(uri)) + } + + @Test + fun testResolveMap() { + val blob = + JavaOnlyMap().apply { + putString("blobId", blobId) + putInt("offset", 0) + putInt("size", bytes.size) + } + + assertArrayEquals(bytes, blobModule.resolve(blob)) + } + + @Test + fun testRemove() { + assertNotNull(blobModule.resolve(blobId, 0, bytes.size)) + + blobModule.remove(blobId) + + assertNull(blobModule.resolve(blobId, 0, bytes.size)) + } + + @Test + fun testCreateFromParts() { + val id = UUID.randomUUID().toString() + + val blobData = + JavaOnlyMap().apply { + putString("blobId", blobId) + putInt("offset", 0) + putInt("size", bytes.size) + } + val blob = + JavaOnlyMap().apply { + putMap("data", blobData) + putString("type", "blob") + } + + val stringData = "i \u2665 dogs" + val stringBytes = stringData.encodeToByteArray() + val string = + JavaOnlyMap().apply { + putString("data", stringData) + putString("type", "string") + } + + val parts = + JavaOnlyArray().apply { + pushMap(blob) + pushMap(string) + } + + blobModule.createFromParts(parts, id) + + val resultSize = bytes.size + stringBytes.size + + val result = blobModule.resolve(id, 0, resultSize) + + val buffer = + ByteBuffer.allocate(resultSize).apply { + put(bytes) + put(stringBytes) + } + + assertArrayEquals(result, buffer.array()) + } + + @Test + fun testRelease() { + assertNotNull(blobModule.resolve(blobId, 0, bytes.size)) + + blobModule.release(blobId) + + assertNull(blobModule.resolve(blobId, 0, bytes.size)) + } +} From 7b686a5d9c2e551ae89a982854a0aac01b71b78b Mon Sep 17 00:00:00 2001 From: Agata Kosior Date: Wed, 7 Jun 2023 04:23:42 -0700 Subject: [PATCH 044/468] Convert StackTraceHelperTest to Kotlin (#37741) Summary: Converts StackTraceHelperTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708 ## Changelog: [Internal] [Changed] - Convert StackTraceHelperTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37741 Test Plan: Tests pass: `./gradlew :packages:react-native:ReactAndroid:test` Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: cortinico Differential Revision: D46498064 Pulled By: mdvacca fbshipit-source-id: d0d62097edfa8fe3649e2c72acb4ae8b3d20a89a --- .../devsupport/StackTraceHelperTest.java | 65 ------------------- .../react/devsupport/StackTraceHelperTest.kt | 61 +++++++++++++++++ 2 files changed, 61 insertions(+), 65 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/StackTraceHelperTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/StackTraceHelperTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/StackTraceHelperTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/StackTraceHelperTest.java deleted file mode 100644 index a0e26087336374..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/StackTraceHelperTest.java +++ /dev/null @@ -1,65 +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.react.devsupport; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.facebook.react.devsupport.interfaces.StackFrame; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; - -@RunWith(RobolectricTestRunner.class) -public class StackTraceHelperTest { - - @Test - public void testParseAlternateFormatStackFrameWithMethod() { - final StackFrame frame = - StackTraceHelper.convertJsStackTrace("at func1 (/path/to/file.js:2:18)")[0]; - assertThat(frame.getMethod()).isEqualTo("func1"); - assertThat(frame.getFileName()).isEqualTo("file.js"); - assertThat(frame.getLine()).isEqualTo(2); - assertThat(frame.getColumn()).isEqualTo(18); - } - - @Test - public void testParseStackFrameWithMethod() { - final StackFrame frame = StackTraceHelper.convertJsStackTrace("render@Test.bundle:1:2000")[0]; - assertThat(frame.getMethod()).isEqualTo("render"); - assertThat(frame.getFileName()).isEqualTo("Test.bundle"); - assertThat(frame.getLine()).isEqualTo(1); - assertThat(frame.getColumn()).isEqualTo(2000); - } - - @Test - public void testParseStackFrameWithoutMethod() { - final StackFrame frame = StackTraceHelper.convertJsStackTrace("Test.bundle:1:2000")[0]; - assertThat(frame.getMethod()).isEqualTo("(unknown)"); - assertThat(frame.getFileName()).isEqualTo("Test.bundle"); - assertThat(frame.getLine()).isEqualTo(1); - assertThat(frame.getColumn()).isEqualTo(2000); - } - - @Test - public void testParseStackFrameWithInvalidFrame() { - final StackFrame frame = StackTraceHelper.convertJsStackTrace("Test.bundle:ten:twenty")[0]; - assertThat(frame.getMethod()).isEqualTo("Test.bundle:ten:twenty"); - assertThat(frame.getFileName()).isEqualTo(""); - assertThat(frame.getLine()).isEqualTo(-1); - assertThat(frame.getColumn()).isEqualTo(-1); - } - - @Test - public void testParseStackFrameWithNativeCodeFrame() { - final StackFrame frame = StackTraceHelper.convertJsStackTrace("forEach@[native code]")[0]; - assertThat(frame.getMethod()).isEqualTo("forEach@[native code]"); - assertThat(frame.getFileName()).isEqualTo(""); - assertThat(frame.getLine()).isEqualTo(-1); - assertThat(frame.getColumn()).isEqualTo(-1); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/StackTraceHelperTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/StackTraceHelperTest.kt new file mode 100644 index 00000000000000..8a0c3d8d869d77 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/StackTraceHelperTest.kt @@ -0,0 +1,61 @@ +/* + * 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.react.devsupport + +import org.assertj.core.api.Assertions.assertThat +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner + +@RunWith(RobolectricTestRunner::class) +class StackTraceHelperTest { + @Test + fun testParseAlternateFormatStackFrameWithMethod() { + val frame = StackTraceHelper.convertJsStackTrace("at func1 (/path/to/file.js:2:18)").get(0) + assertThat(frame.method).isEqualTo("func1") + assertThat(frame.fileName).isEqualTo("file.js") + assertThat(frame.line).isEqualTo(2) + assertThat(frame.column).isEqualTo(18) + } + + @Test + fun testParseStackFrameWithMethod() { + val frame = StackTraceHelper.convertJsStackTrace("render@Test.bundle:1:2000").get(0) + assertThat(frame.method).isEqualTo("render") + assertThat(frame.fileName).isEqualTo("Test.bundle") + assertThat(frame.line).isEqualTo(1) + assertThat(frame.column).isEqualTo(2000) + } + + @Test + fun testParseStackFrameWithoutMethod() { + val frame = StackTraceHelper.convertJsStackTrace("Test.bundle:1:2000").get(0) + assertThat(frame.method).isEqualTo("(unknown)") + assertThat(frame.fileName).isEqualTo("Test.bundle") + assertThat(frame.line).isEqualTo(1) + assertThat(frame.column).isEqualTo(2000) + } + + @Test + fun testParseStackFrameWithInvalidFrame() { + val frame = StackTraceHelper.convertJsStackTrace("Test.bundle:ten:twenty").get(0) + assertThat(frame.method).isEqualTo("Test.bundle:ten:twenty") + assertThat(frame.fileName).isEqualTo("") + assertThat(frame.line).isEqualTo(-1) + assertThat(frame.column).isEqualTo(-1) + } + + @Test + fun testParseStackFrameWithNativeCodeFrame() { + val frame = StackTraceHelper.convertJsStackTrace("forEach@[native code]").get(0) + assertThat(frame.method).isEqualTo("forEach@[native code]") + assertThat(frame.fileName).isEqualTo("") + assertThat(frame.line).isEqualTo(-1) + assertThat(frame.column).isEqualTo(-1) + } +} From e944bd711573aab12cccf097daeaae3766d82297 Mon Sep 17 00:00:00 2001 From: Pranav Yadav Date: Wed, 7 Jun 2023 04:42:32 -0700 Subject: [PATCH 045/468] Bump `autorebase.yml` to `v1.8` (#37584) Summary: `cirrus-actions/rebase` `v.1.8` fixes number of bugs. `v1.8` Changelog: https://github.com/cirrus-actions/rebase/releases/tag/1.8 See: https://github.com/cirrus-actions/rebase ## Changelog: [GENERAL] [SECURITY] - [Actions] Bump `autorebase.yml` to `v1.8` Pull Request resolved: https://github.com/facebook/react-native/pull/37584 Test Plan: - `/rebase` comment should rebase the PR as usual. Reviewed By: rshest Differential Revision: D46264711 Pulled By: cipolleschi fbshipit-source-id: 49974e5c1841c0af3637cf5bdbcde9e79ea0e671 --- .github/workflows/autorebase.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/autorebase.yml b/.github/workflows/autorebase.yml index c17389eb168298..f52439bbcb0742 100644 --- a/.github/workflows/autorebase.yml +++ b/.github/workflows/autorebase.yml @@ -1,4 +1,7 @@ name: Automatic Rebase +# This workflow is used to automatically rebase a PR when a comment is made +# containing the text "/rebase". It uses the cirrus-actions/rebase action. +# See https://github.com/cirrus-actions/rebase on: issue_comment: types: [created] @@ -6,12 +9,12 @@ permissions: contents: read jobs: rebase: - permissions: - contents: write # for cirrus-actions/rebase to push code to rebase - pull-requests: read # for cirrus-actions/rebase to get info about PR name: Rebase - if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') + permissions: + contents: write # for cirrus-actions/rebase to push code to rebase + pull-requests: read # for cirrus-actions/rebase to get info about PR runs-on: ubuntu-latest + if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') steps: - name: Checkout the latest code uses: actions/checkout@v3 @@ -19,6 +22,6 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 # otherwise, you will fail to push refs to dest repo - name: Automatic Rebase - uses: cirrus-actions/rebase@1.7 + uses: cirrus-actions/rebase@1.8 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ecfbabf532a81f5212f93e8c764a0aa1e363535c Mon Sep 17 00:00:00 2001 From: David Angulo Date: Wed, 7 Jun 2023 05:53:54 -0700 Subject: [PATCH 046/468] Convert InteropModuleRegistryTest to Kotlin (#37735) Summary: Converts InteropModuleRegistryTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708 ## Changelog: [Internal] [Changed] - Convert InteropModuleRegistryTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37735 Test Plan: Tests pass: `./gradlew :packages:react-native:ReactAndroid:test` Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: cortinico, yungsters Differential Revision: D46492704 Pulled By: mdvacca fbshipit-source-id: ce924c33a43129ce70a1590b72bf8428a7d0a8b3 --- .../interop/InteropModuleRegistryTest.java | 92 ------------------- .../interop/InteropModuleRegistryTest.kt | 91 ++++++++++++++++++ 2 files changed, 91 insertions(+), 92 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/InteropModuleRegistryTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/InteropModuleRegistryTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/InteropModuleRegistryTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/InteropModuleRegistryTest.java deleted file mode 100644 index 158598078480d2..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/InteropModuleRegistryTest.java +++ /dev/null @@ -1,92 +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.react.bridge.interop; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import com.facebook.react.config.ReactFeatureFlags; -import com.facebook.react.modules.core.JSTimers; -import com.facebook.react.uimanager.events.RCTEventEmitter; -import org.junit.Before; -import org.junit.Test; - -public class InteropModuleRegistryTest { - - InteropModuleRegistry underTest; - - @Before - public void setup() { - underTest = new InteropModuleRegistry(); - } - - @Test - public void shouldReturnInteropModule_withFabricDisabled_returnsFalse() { - ReactFeatureFlags.enableFabricRenderer = false; - - assertFalse(underTest.shouldReturnInteropModule(RCTEventEmitter.class)); - } - - @Test - public void shouldReturnInteropModule_withFabricInteropDisabled_returnsFalse() { - ReactFeatureFlags.enableFabricRenderer = true; - ReactFeatureFlags.unstable_useFabricInterop = false; - - assertFalse(underTest.shouldReturnInteropModule(RCTEventEmitter.class)); - } - - @Test - public void shouldReturnInteropModule_withUnregisteredClass_returnsFalse() { - ReactFeatureFlags.enableFabricRenderer = true; - ReactFeatureFlags.unstable_useFabricInterop = true; - - assertFalse(underTest.shouldReturnInteropModule(JSTimers.class)); - } - - @Test - public void shouldReturnInteropModule_withRegisteredClass_returnsTrue() { - ReactFeatureFlags.enableFabricRenderer = true; - ReactFeatureFlags.unstable_useFabricInterop = true; - - underTest.registerInteropModule(RCTEventEmitter.class, new FakeRCTEventEmitter()); - - assertTrue(underTest.shouldReturnInteropModule(RCTEventEmitter.class)); - } - - @Test - public void getInteropModule_withRegisteredClassAndInvalidFlags_returnsNull() { - ReactFeatureFlags.enableFabricRenderer = false; - ReactFeatureFlags.unstable_useFabricInterop = false; - underTest.registerInteropModule(RCTEventEmitter.class, new FakeRCTEventEmitter()); - - RCTEventEmitter interopModule = underTest.getInteropModule(RCTEventEmitter.class); - - assertNull(interopModule); - } - - @Test - public void getInteropModule_withRegisteredClassAndValidFlags_returnsInteropModule() { - ReactFeatureFlags.enableFabricRenderer = true; - ReactFeatureFlags.unstable_useFabricInterop = true; - underTest.registerInteropModule(RCTEventEmitter.class, new FakeRCTEventEmitter()); - - RCTEventEmitter interopModule = underTest.getInteropModule(RCTEventEmitter.class); - - assertTrue(interopModule instanceof FakeRCTEventEmitter); - } - - @Test - public void getInteropModule_withUnregisteredClass_returnsNull() { - ReactFeatureFlags.enableFabricRenderer = true; - ReactFeatureFlags.unstable_useFabricInterop = true; - JSTimers missingModule = underTest.getInteropModule(JSTimers.class); - - assertNull(missingModule); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/InteropModuleRegistryTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/InteropModuleRegistryTest.kt new file mode 100644 index 00000000000000..df20bfbead1057 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/InteropModuleRegistryTest.kt @@ -0,0 +1,91 @@ +/* + * 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.react.bridge.interop + +import com.facebook.react.config.ReactFeatureFlags +import com.facebook.react.modules.core.JSTimers +import com.facebook.react.uimanager.events.RCTEventEmitter +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test + +class InteropModuleRegistryTest { + + lateinit var underTest: InteropModuleRegistry + + @Before + fun setup() { + underTest = InteropModuleRegistry() + } + + @Test + fun shouldReturnInteropModule_withFabricDisabled_returnsFalse() { + ReactFeatureFlags.enableFabricRenderer = false + + assertFalse(underTest.shouldReturnInteropModule(RCTEventEmitter::class.java)) + } + + @Test + fun shouldReturnInteropModule_withFabricInteropDisabled_returnsFalse() { + ReactFeatureFlags.enableFabricRenderer = true + ReactFeatureFlags.unstable_useFabricInterop = false + + assertFalse(underTest.shouldReturnInteropModule(RCTEventEmitter::class.java)) + } + + @Test + fun shouldReturnInteropModule_withUnregisteredClass_returnsFalse() { + ReactFeatureFlags.enableFabricRenderer = true + ReactFeatureFlags.unstable_useFabricInterop = true + + assertFalse(underTest.shouldReturnInteropModule(JSTimers::class.java)) + } + + @Test + fun shouldReturnInteropModule_withRegisteredClass_returnsTrue() { + ReactFeatureFlags.enableFabricRenderer = true + ReactFeatureFlags.unstable_useFabricInterop = true + + underTest.registerInteropModule(RCTEventEmitter::class.java, FakeRCTEventEmitter()) + + assertTrue(underTest.shouldReturnInteropModule(RCTEventEmitter::class.java)) + } + + @Test + fun getInteropModule_withRegisteredClassAndInvalidFlags_returnsNull() { + ReactFeatureFlags.enableFabricRenderer = false + ReactFeatureFlags.unstable_useFabricInterop = false + underTest.registerInteropModule(RCTEventEmitter::class.java, FakeRCTEventEmitter()) + + val interopModule = underTest.getInteropModule(RCTEventEmitter::class.java) + + assertNull(interopModule) + } + + @Test + fun getInteropModule_withRegisteredClassAndValidFlags_returnsInteropModule() { + ReactFeatureFlags.enableFabricRenderer = true + ReactFeatureFlags.unstable_useFabricInterop = true + underTest.registerInteropModule(RCTEventEmitter::class.java, FakeRCTEventEmitter()) + + val interopModule = underTest.getInteropModule(RCTEventEmitter::class.java) + + assertTrue(interopModule is FakeRCTEventEmitter) + } + + @Test + fun getInteropModule_withUnregisteredClass_returnsNull() { + ReactFeatureFlags.enableFabricRenderer = true + ReactFeatureFlags.unstable_useFabricInterop = true + val missingModule = underTest.getInteropModule(JSTimers::class.java) + + assertNull(missingModule) + } +} From e4497067a98720fa1f9e32810999702df0a8dd09 Mon Sep 17 00:00:00 2001 From: David Angulo Date: Wed, 7 Jun 2023 05:59:08 -0700 Subject: [PATCH 047/468] Convert FakeRCTEventEmitter to Kotlin (#37733) Summary: Converts FakeRCTEventEmitter from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708 ## Changelog: [Internal] [Changed] - Convert FakeRCTEventEmitter to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37733 Test Plan: Tests pass: `./gradlew :packages:react-native:ReactAndroid:test` Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: rshest Differential Revision: D46513891 Pulled By: cortinico fbshipit-source-id: 4ad70242d88cc89f8f8033fd437d43df2283c4a1 --- .../bridge/interop/FakeRCTEventEmitter.java | 23 ------------------- .../bridge/interop/FakeRCTEventEmitter.kt | 23 +++++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/FakeRCTEventEmitter.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/FakeRCTEventEmitter.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/FakeRCTEventEmitter.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/FakeRCTEventEmitter.java deleted file mode 100644 index 8a2dc19f869c3c..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/FakeRCTEventEmitter.java +++ /dev/null @@ -1,23 +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.react.bridge.interop; - -import androidx.annotation.Nullable; -import com.facebook.react.bridge.WritableArray; -import com.facebook.react.bridge.WritableMap; -import com.facebook.react.uimanager.events.RCTEventEmitter; - -public class FakeRCTEventEmitter implements RCTEventEmitter { - - @Override - public void receiveEvent(int targetReactTag, String eventName, @Nullable WritableMap event) {} - - @Override - public void receiveTouches( - String eventName, WritableArray touches, WritableArray changedIndices) {} -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/FakeRCTEventEmitter.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/FakeRCTEventEmitter.kt new file mode 100644 index 00000000000000..39872e4b238877 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/interop/FakeRCTEventEmitter.kt @@ -0,0 +1,23 @@ +/* + * 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.react.bridge.interop + +import com.facebook.react.bridge.WritableArray +import com.facebook.react.bridge.WritableMap +import com.facebook.react.uimanager.events.RCTEventEmitter + +class FakeRCTEventEmitter : RCTEventEmitter { + + override fun receiveEvent(targetReactTag: Int, eventName: String, event: WritableMap?) {} + + override fun receiveTouches( + eventName: String, + touches: WritableArray, + changedIndices: WritableArray + ) {} +} From 5048ef65fba1555a13debb85f7dba71fbb805ab6 Mon Sep 17 00:00:00 2001 From: tarunrajput Date: Wed, 7 Jun 2023 10:02:56 -0700 Subject: [PATCH 048/468] Convert FakeEventDispatcher to kotlin (#37739) Summary: Part of https://github.com/facebook/react-native/issues/37708 Convert FakeEventDispatcher to Kotlin ## Changelog: [Internal][Changed]: Convert FakeEventDispatcher to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37739 Test Plan: ``` ./gradlew :packages:react-native:ReactAndroid:test ``` Reviewed By: rshest Differential Revision: D46514164 Pulled By: cortinico fbshipit-source-id: 355f568ad9b36073aa9f1981472a2c7567e7ab2d --- .../fabric/interop/FakeEventDispatcher.java | 55 ------------------- .../fabric/interop/FakeEventDispatcher.kt | 46 ++++++++++++++++ .../interop/InteropEventEmitterTest.java | 9 +-- 3 files changed, 51 insertions(+), 59 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/FakeEventDispatcher.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/FakeEventDispatcher.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/FakeEventDispatcher.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/FakeEventDispatcher.java deleted file mode 100644 index f747845b1533e4..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/FakeEventDispatcher.java +++ /dev/null @@ -1,55 +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.react.fabric.interop; - -import com.facebook.react.uimanager.events.BatchEventDispatchedListener; -import com.facebook.react.uimanager.events.Event; -import com.facebook.react.uimanager.events.EventDispatcher; -import com.facebook.react.uimanager.events.EventDispatcherListener; -import com.facebook.react.uimanager.events.RCTEventEmitter; -import com.facebook.react.uimanager.events.RCTModernEventEmitter; -import java.util.ArrayList; -import java.util.List; - -@SuppressWarnings("rawtypes") -public class FakeEventDispatcher implements EventDispatcher { - - List recordedDispatchedEvents = new ArrayList<>(); - - @Override - public void dispatchEvent(Event event) { - recordedDispatchedEvents.add(event); - } - - @Override - public void dispatchAllEvents() {} - - @Override - public void addListener(EventDispatcherListener listener) {} - - @Override - public void removeListener(EventDispatcherListener listener) {} - - @Override - public void addBatchEventDispatchedListener(BatchEventDispatchedListener listener) {} - - @Override - public void removeBatchEventDispatchedListener(BatchEventDispatchedListener listener) {} - - @Override - public void registerEventEmitter(int uiManagerType, RCTEventEmitter eventEmitter) {} - - @Override - public void registerEventEmitter(int uiManagerType, RCTModernEventEmitter eventEmitter) {} - - @Override - public void unregisterEventEmitter(int uiManagerType) {} - - @Override - public void onCatalystInstanceDestroyed() {} -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/FakeEventDispatcher.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/FakeEventDispatcher.kt new file mode 100644 index 00000000000000..af3af4a4b52c77 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/FakeEventDispatcher.kt @@ -0,0 +1,46 @@ +/* + * 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.react.fabric.interop + +import com.facebook.react.uimanager.events.BatchEventDispatchedListener +import com.facebook.react.uimanager.events.Event +import com.facebook.react.uimanager.events.EventDispatcher +import com.facebook.react.uimanager.events.EventDispatcherListener +import com.facebook.react.uimanager.events.RCTEventEmitter +import com.facebook.react.uimanager.events.RCTModernEventEmitter + +@SuppressWarnings("rawtypes") +class FakeEventDispatcher : EventDispatcher { + private val recordedDispatchedEvents = mutableListOf>() + + fun getRecordedDispatchedEvents(): List> { + return recordedDispatchedEvents + } + + override fun dispatchEvent(event: Event<*>) { + recordedDispatchedEvents.add(event) + } + + override fun dispatchAllEvents() {} + + override fun addListener(listener: EventDispatcherListener) {} + + override fun removeListener(listener: EventDispatcherListener) {} + + override fun addBatchEventDispatchedListener(listener: BatchEventDispatchedListener) {} + + override fun removeBatchEventDispatchedListener(listener: BatchEventDispatchedListener) {} + + override fun registerEventEmitter(uiManagerType: Int, eventEmitter: RCTEventEmitter) {} + + override fun registerEventEmitter(uiManagerType: Int, eventEmitter: RCTModernEventEmitter) {} + + override fun unregisterEventEmitter(uiManagerType: Int) {} + + override fun onCatalystInstanceDestroyed() {} +} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/InteropEventEmitterTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/InteropEventEmitterTest.java index c26e9b36ac13fd..5e86e029ef02b6 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/InteropEventEmitterTest.java +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/interop/InteropEventEmitterTest.java @@ -39,9 +39,10 @@ public void receiveEvent_dispatchesCorrectly() { eventEmitter.receiveEvent(42, "onTest", null); - assertEquals(1, mEventDispatcher.recordedDispatchedEvents.size()); - assertEquals("onTest", mEventDispatcher.recordedDispatchedEvents.get(0).getEventName()); - assertEquals(InteropEvent.class, mEventDispatcher.recordedDispatchedEvents.get(0).getClass()); + assertEquals(1, mEventDispatcher.getRecordedDispatchedEvents().size()); + assertEquals("onTest", mEventDispatcher.getRecordedDispatchedEvents().get(0).getEventName()); + assertEquals( + InteropEvent.class, mEventDispatcher.getRecordedDispatchedEvents().get(0).getClass()); } @Test @@ -52,7 +53,7 @@ public void receiveEvent_dataIsPreserved() { eventEmitter.receiveEvent(42, "onTest", eventData); - InteropEvent event = (InteropEvent) mEventDispatcher.recordedDispatchedEvents.get(0); + InteropEvent event = (InteropEvent) mEventDispatcher.getRecordedDispatchedEvents().get(0); WritableMap dispatchedEventData = event.getEventData(); assertNotNull(dispatchedEventData); assertEquals("indigo", dispatchedEventData.getString("color")); From 2fba8706b44049bf8190dc6d766f8c41a4f8c37b Mon Sep 17 00:00:00 2001 From: Gijs Weterings Date: Wed, 7 Jun 2023 10:11:08 -0700 Subject: [PATCH 049/468] Add license header to SetSpanOperation.java Summary: SetSpanOperation.java doesn't have the required licence header, causing a compliance failure for OSS repo checkup. This diff adds the header. Reviewed By: cortinico Differential Revision: D46505914 fbshipit-source-id: 278021ff08b30b4f051a0f0a6a7dec580e012225 --- .../com/facebook/react/views/text/SetSpanOperation.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/SetSpanOperation.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/SetSpanOperation.java index cccbe58d904e95..5df16e4e283822 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/SetSpanOperation.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/SetSpanOperation.java @@ -1,3 +1,10 @@ +/* + * 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.react.views.text; import android.text.Spannable; From 34dd7255be2cd2b3218d2cfb926d5a2d4bbb2dbd Mon Sep 17 00:00:00 2001 From: M0Coding Date: Wed, 7 Jun 2023 10:11:13 -0700 Subject: [PATCH 050/468] Convert CompositeReactPackageTest to Kotlin (#37734) Summary: Converts CompositeReactPackageTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708 ## Changelog: [Internal] [Changed] - Convert CompositeReactPackageTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37734 Test Plan: Tests pass: `./gradlew :packages:react-native:ReactAndroid:test` Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: rshest Differential Revision: D46515364 Pulled By: cortinico fbshipit-source-id: e310199f744f36e735ac78124bc7d40798421303 --- .../react/CompositeReactPackageTest.java | 156 ------------------ .../react/CompositeReactPackageTest.kt | 134 +++++++++++++++ 2 files changed, 134 insertions(+), 156 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/CompositeReactPackageTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/CompositeReactPackageTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/CompositeReactPackageTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/CompositeReactPackageTest.java deleted file mode 100644 index e641e254e3f0de..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/CompositeReactPackageTest.java +++ /dev/null @@ -1,156 +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.react; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import com.facebook.react.bridge.NativeModule; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.uimanager.ViewManager; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.modules.junit4.rule.PowerMockRule; -import org.robolectric.RobolectricTestRunner; - -@RunWith(RobolectricTestRunner.class) -@PowerMockIgnore({"org.mockito.*", "org.robolectric.*", "androidx.*", "android.*"}) -public class CompositeReactPackageTest { - - @Rule public PowerMockRule rule = new PowerMockRule(); - - @Mock ReactPackage packageNo1; - @Mock ReactPackage packageNo2; - @Mock ReactPackage packageNo3; - - @Mock ReactApplicationContext reactContext; - - @Before - public void initMocks() { - MockitoAnnotations.initMocks(this); - } - - @Test - public void testThatCreateNativeModulesIsCalledOnAllPackages() { - // Given - CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2, packageNo3); - - // When - composite.createNativeModules(reactContext); - - // Then - verify(packageNo1).createNativeModules(reactContext); - verify(packageNo2).createNativeModules(reactContext); - verify(packageNo3).createNativeModules(reactContext); - } - - @Test - public void testThatCreateViewManagersIsCalledOnAllPackages() { - // Given - CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2, packageNo3); - - // When - composite.createViewManagers(reactContext); - - // Then - verify(packageNo1).createViewManagers(reactContext); - verify(packageNo2).createViewManagers(reactContext); - verify(packageNo3).createViewManagers(reactContext); - } - - @Test - public void testThatCompositeReturnsASumOfNativeModules() { - // Given - CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2); - - NativeModule moduleNo1 = mock(NativeModule.class); - when(moduleNo1.getName()).thenReturn("ModuleNo1"); - - // module2 and module3 will share same name, composite should return only the latter one - final String sameModuleName = "SameModuleName"; - - NativeModule moduleNo2 = mock(NativeModule.class); - when(moduleNo2.getName()).thenReturn(sameModuleName); - - NativeModule moduleNo3 = mock(NativeModule.class); - when(moduleNo3.getName()).thenReturn(sameModuleName); - - NativeModule moduleNo4 = mock(NativeModule.class); - when(moduleNo4.getName()).thenReturn("ModuleNo4"); - - when(packageNo1.createNativeModules(reactContext)) - .thenReturn(Arrays.asList(new NativeModule[] {moduleNo1, moduleNo2})); - - when(packageNo2.createNativeModules(reactContext)) - .thenReturn(Arrays.asList(new NativeModule[] {moduleNo3, moduleNo4})); - - // When - List compositeModules = composite.createNativeModules(reactContext); - - // Then - - // Wrapping lists into sets to be order-independent. - // Note that there should be no module2 returned. - Set expected = - new HashSet<>(Arrays.asList(new NativeModule[] {moduleNo1, moduleNo3, moduleNo4})); - Set actual = new HashSet<>(compositeModules); - - assertEquals(expected, actual); - } - - @Test - public void testThatCompositeReturnsASumOfViewManagers() { - // Given - CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2); - - ViewManager managerNo1 = mock(ViewManager.class); - when(managerNo1.getName()).thenReturn("ManagerNo1"); - - // managerNo2 and managerNo3 will share same name, composite should return only the latter one - final String sameModuleName = "SameModuleName"; - - ViewManager managerNo2 = mock(ViewManager.class); - when(managerNo2.getName()).thenReturn(sameModuleName); - - ViewManager managerNo3 = mock(ViewManager.class); - when(managerNo3.getName()).thenReturn(sameModuleName); - - ViewManager managerNo4 = mock(ViewManager.class); - when(managerNo4.getName()).thenReturn("ManagerNo4"); - - when(packageNo1.createViewManagers(reactContext)) - .thenReturn(Arrays.asList(new ViewManager[] {managerNo1, managerNo2})); - - when(packageNo2.createViewManagers(reactContext)) - .thenReturn(Arrays.asList(new ViewManager[] {managerNo3, managerNo4})); - - // When - List compositeModules = composite.createViewManagers(reactContext); - - // Then - - // Wrapping lists into sets to be order-independent. - // Note that there should be no managerNo2 returned. - Set expected = - new HashSet<>(Arrays.asList(new ViewManager[] {managerNo1, managerNo3, managerNo4})); - Set actual = new HashSet<>(compositeModules); - - assertEquals(expected, actual); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/CompositeReactPackageTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/CompositeReactPackageTest.kt new file mode 100644 index 00000000000000..15ec555c495bb3 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/CompositeReactPackageTest.kt @@ -0,0 +1,134 @@ +/* + * 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.react + +import com.facebook.react.bridge.NativeModule +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.uimanager.ViewManager +import java.util.* +import org.junit.Assert +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.Mock +import org.mockito.Mockito.mock +import org.mockito.Mockito.verify +import org.mockito.Mockito.`when` as whenever +import org.mockito.MockitoAnnotations +import org.powermock.core.classloader.annotations.PowerMockIgnore +import org.powermock.modules.junit4.rule.PowerMockRule +import org.robolectric.RobolectricTestRunner + +@RunWith(RobolectricTestRunner::class) +@PowerMockIgnore("org.mockito.*", "org.robolectric.*", "androidx.*", "android.*") +class CompositeReactPackageTest { + @get:Rule var rule = PowerMockRule() + + @Mock lateinit var packageNo1: ReactPackage + + @Mock lateinit var packageNo2: ReactPackage + + @Mock lateinit var packageNo3: ReactPackage + + @Mock lateinit var reactContext: ReactApplicationContext + + @Before + fun initMocks() { + MockitoAnnotations.initMocks(this) + } + + @Test + fun testThatCreateNativeModulesIsCalledOnAllPackages() { + // Given + val composite = CompositeReactPackage(packageNo1, packageNo2, packageNo3) + + // When + composite.createNativeModules(reactContext) + + // Then + verify(packageNo1).createNativeModules(reactContext) + verify(packageNo2).createNativeModules(reactContext) + verify(packageNo3).createNativeModules(reactContext) + } + + @Test + fun testThatCreateViewManagersIsCalledOnAllPackages() { + // Given + val composite = CompositeReactPackage(packageNo1, packageNo2, packageNo3) + + // When + composite.createViewManagers(reactContext) + + // Then + verify(packageNo1).createViewManagers(reactContext) + verify(packageNo2).createViewManagers(reactContext) + verify(packageNo3).createViewManagers(reactContext) + } + + @Test + fun testThatCompositeReturnsASumOfNativeModules() { + // Given + val composite = CompositeReactPackage(packageNo1, packageNo2) + val moduleNo1 = mock(NativeModule::class.java) + whenever(moduleNo1.name).thenReturn("ModuleNo1") + + // module2 and module3 will share same name, composite should return only the latter one + val sameModuleName = "SameModuleName" + val moduleNo2 = mock(NativeModule::class.java) + whenever(moduleNo2.name).thenReturn(sameModuleName) + val moduleNo3 = mock(NativeModule::class.java) + whenever(moduleNo3.name).thenReturn(sameModuleName) + val moduleNo4 = mock(NativeModule::class.java) + whenever(moduleNo4.name).thenReturn("ModuleNo4") + whenever(packageNo1.createNativeModules(reactContext)).thenReturn(listOf(moduleNo1, moduleNo2)) + whenever(packageNo2.createNativeModules(reactContext)).thenReturn(listOf(moduleNo3, moduleNo4)) + + // When + val compositeModules = composite.createNativeModules(reactContext) + + // Then + + // Wrapping lists into sets to be order-independent. + // Note that there should be no module2 returned. + val expected: Set = setOf(moduleNo1, moduleNo3, moduleNo4) + val actual: Set = compositeModules.toSet() + Assert.assertEquals(expected, actual) + } + + @Test + fun testThatCompositeReturnsASumOfViewManagers() { + // Given + val composite = CompositeReactPackage(packageNo1, packageNo2) + val managerNo1 = mock(ViewManager::class.java) + whenever(managerNo1.name).thenReturn("ManagerNo1") + + // managerNo2 and managerNo3 will share same name, composite should return only the latter + // one + val sameModuleName = "SameModuleName" + val managerNo2 = mock(ViewManager::class.java) + whenever(managerNo2.name).thenReturn(sameModuleName) + val managerNo3 = mock(ViewManager::class.java) + whenever(managerNo3.name).thenReturn(sameModuleName) + val managerNo4 = mock(ViewManager::class.java) + whenever(managerNo4.name).thenReturn("ManagerNo4") + whenever(packageNo1.createViewManagers(reactContext)).thenReturn(listOf(managerNo1, managerNo2)) + whenever(packageNo2.createViewManagers(reactContext)).thenReturn(listOf(managerNo3, managerNo4)) + + // When + val compositeModules = composite.createViewManagers(reactContext) + + // Then + + // Wrapping lists into sets to be order-independent. + // Note that there should be no managerNo2 returned. + val expected: Set> = setOf(managerNo1, managerNo3, managerNo4) + val actual: Set> = compositeModules.toSet() + Assert.assertEquals(expected, actual) + } +} From c6d895bec9507ccc88c200553d1bff688ce0f41c Mon Sep 17 00:00:00 2001 From: arslandogar Date: Wed, 7 Jun 2023 10:50:34 -0700 Subject: [PATCH 051/468] Remove InstanceHandleHelper as unused (#37740) Summary: Converts InstanceHandleHelper from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708 ## Changelog: [Internal] [Changed] - Convert InstanceHandleHelper to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37740 Test Plan: Tests pass: `./gradlew :packages:react-native:ReactAndroid:test` Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: rshest Differential Revision: D46515395 Pulled By: cortinico fbshipit-source-id: 5091d1932c2ad623f063972661ec82ceb4c74089 --- .../react/bridge/InstanceHandleHelper.java | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/InstanceHandleHelper.java diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/InstanceHandleHelper.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/InstanceHandleHelper.java deleted file mode 100644 index 1b56926b2dc31c..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/InstanceHandleHelper.java +++ /dev/null @@ -1,19 +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.react.bridge; - -import java.util.Random; - -public class InstanceHandleHelper { - - private static final Random random = new Random(); - - public static long randomInstanceHandle() { - return random.nextLong(); - } -} From 3edd5138d274a0077318381dcf502248ac828a5f Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 7 Jun 2023 11:14:49 -0700 Subject: [PATCH 052/468] Reduce visibility in React Context (#37695) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37695 In this diff I'm reducing visibility of RCTDeviceEventEmitter interface in ReactContext. This is an internal interface that has no usages externally (neither at Meta or github source) changelog: [internal] internal Reviewed By: cortinico, luluwu2032 Differential Revision: D46241623 fbshipit-source-id: 297256b7394768c54b24125ad91f7b3fabbd42d0 --- .../com/facebook/react/bridge/queue/MessageQueueThreadSpec.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadSpec.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadSpec.java index ed9ab389cd094f..0bc022003b2241 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadSpec.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadSpec.java @@ -16,7 +16,7 @@ public class MessageQueueThreadSpec { // The Thread constructor interprets zero the same as not specifying a stack size public static final long DEFAULT_STACK_SIZE_BYTES = 0; - protected static enum ThreadType { + protected enum ThreadType { MAIN_UI, NEW_BACKGROUND, } From 57e79faf5837e6932e42d7bd8408971946ac50f3 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 7 Jun 2023 11:14:49 -0700 Subject: [PATCH 053/468] Reduce visibility of ReactHost.destroy() method (#37693) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37693 This diff reduces the visibility of ReactHost.destroy() method changelog: [internal] internal Reviewed By: philIip, luluwu2032 Differential Revision: D46293388 fbshipit-source-id: 42a8fae5ef51a7ecbdca520ce0db9f67f62c1588 --- .../java/com/facebook/react/bridgeless/ReactHost.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java index 83b8ab31a00fc5..10a6d03e79db80 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java @@ -1209,12 +1209,12 @@ private Task new_getOrCreateReloadTask(String reason) { * Entrypoint to destroy the ReactInstance. If the ReactInstance is reloading, will wait until * reload is finished, before destroying. * + * @param reason {@link String} describing why ReactHost is being destroyed (e.g. memmory + * pressure) + * @param ex {@link Exception} exception that caused the trigger to destroy ReactHost (or null) + * This exception will be used to log properly the cause of destroy operation. * @return A task that completes when React Native gets destroyed. */ - public Task destroy(String reason) { - return destroy(reason, null); - } - public Task destroy(String reason, @Nullable Exception ex) { final String method = "destroy()"; if (ReactFeatureFlags.enableBridgelessArchitectureNewCreateReloadDestroy) { From 4002a251a582248b8fa2b91b3a4b5ffd6948e673 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 7 Jun 2023 11:14:49 -0700 Subject: [PATCH 054/468] Update documentation of ReactHost.reload method (#37691) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37691 Update documentation of ReactHost.reload method changelog: [internal] internal Reviewed By: cortinico, philIip Differential Revision: D46293519 fbshipit-source-id: 38372ca1016c50d5d74ec7a6e7f9e44238c4899b --- .../src/main/java/com/facebook/react/bridgeless/ReactHost.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java index 10a6d03e79db80..0a6b5edfca0769 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java @@ -1017,6 +1017,8 @@ private void log(String method) { * Entrypoint to reload the ReactInstance. If the ReactInstance is destroying, will wait until * destroy is finished, before reloading. * + * @param reason {@link String} describing why ReactHost is being reloaded (e.g. js error, user + * tap on reload button) * @return A task that completes when React Native reloads */ public Task reload(String reason) { From 84200fe9f54b091d256e25ca45458a8ee4d3ac06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jim=C3=A9nez=20Serra?= Date: Wed, 7 Jun 2023 13:31:11 -0700 Subject: [PATCH 055/468] Convert InterpolatorTypeTest to Kotlin (#37724) Summary: Converts InterpolatorTypeTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708 ## Changelog: [Internal] [Changed] - Convert InterpolatorTypeTest to Kotlin [INTERNAL] [CHANGED] - Migrate JSPackagerClientTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37747 Test Plan: Tests pass: ./gradlew :packages:react-native:ReactAndroid:test Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: cortinico Differential Revision: D46514210 Pulled By: rshest fbshipit-source-id: ecec18a69b1401214e22c6cbea34d49528da1a79 --- .../JSPackagerClientTest.java | 144 ----------------- .../JSPackagerClientTest.kt | 150 ++++++++++++++++++ 2 files changed, 150 insertions(+), 144 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.java deleted file mode 100644 index 3ba3bb27a02fe1..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.java +++ /dev/null @@ -1,144 +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.react.packagerconnection; - -import static org.mockito.Mockito.*; - -import com.facebook.react.packagerconnection.ReconnectingWebSocket.ConnectionCallback; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import okio.ByteString; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; - -@RunWith(RobolectricTestRunner.class) -public class JSPackagerClientTest { - private static Map createRH(String action, RequestHandler handler) { - Map m = new HashMap(); - m.put(action, handler); - return m; - } - - private PackagerConnectionSettings mSettings; - - @Before - public void setUp() { - mSettings = mock(PackagerConnectionSettings.class); - when(mSettings.getDebugServerHost()).thenReturn("ws://not_needed"); - when(mSettings.getPackageName()).thenReturn("my_test_package"); - } - - @Test - public void test_onMessage_ShouldTriggerNotification() throws IOException { - RequestHandler handler = mock(RequestHandler.class); - final JSPackagerClient client = - new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); - - client.onMessage("{\"version\": 2, \"method\": \"methodValue\", \"params\": \"paramsValue\"}"); - verify(handler).onNotification(eq("paramsValue")); - verify(handler, never()).onRequest(any(), any(Responder.class)); - } - - @Test - public void test_onMessage_ShouldTriggerRequest() throws IOException { - RequestHandler handler = mock(RequestHandler.class); - final JSPackagerClient client = - new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); - - client.onMessage( - "{\"version\": 2, \"id\": \"idValue\", \"method\": \"methodValue\", \"params\": \"paramsValue\"}"); - verify(handler, never()).onNotification(any()); - verify(handler).onRequest(eq("paramsValue"), any(Responder.class)); - } - - @Test - public void test_onMessage_WithoutParams_ShouldTriggerNotification() throws IOException { - RequestHandler handler = mock(RequestHandler.class); - final JSPackagerClient client = - new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); - - client.onMessage("{\"version\": 2, \"method\": \"methodValue\"}"); - verify(handler).onNotification(eq(null)); - verify(handler, never()).onRequest(any(), any(Responder.class)); - } - - @Test - public void test_onMessage_WithInvalidContentType_ShouldNotTriggerCallback() throws IOException { - RequestHandler handler = mock(RequestHandler.class); - final JSPackagerClient client = - new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); - - client.onMessage(ByteString.encodeUtf8("{\"version\": 2, \"method\": \"methodValue\"}")); - verify(handler, never()).onNotification(any()); - verify(handler, never()).onRequest(any(), any(Responder.class)); - } - - @Test - public void test_onMessage_WithoutMethod_ShouldNotTriggerCallback() throws IOException { - RequestHandler handler = mock(RequestHandler.class); - final JSPackagerClient client = - new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); - - client.onMessage("{\"version\": 2}"); - verify(handler, never()).onNotification(any()); - verify(handler, never()).onRequest(any(), any(Responder.class)); - } - - @Test - public void test_onMessage_With_Null_Action_ShouldNotTriggerCallback() throws IOException { - RequestHandler handler = mock(RequestHandler.class); - final JSPackagerClient client = - new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); - - client.onMessage("{\"version\": 2, \"method\": null}"); - verify(handler, never()).onNotification(any()); - verify(handler, never()).onRequest(any(), any(Responder.class)); - } - - @Test - public void test_onMessage_WithInvalidMethod_ShouldNotTriggerCallback() throws IOException { - RequestHandler handler = mock(RequestHandler.class); - final JSPackagerClient client = - new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); - - client.onMessage(ByteString.EMPTY); - verify(handler, never()).onNotification(any()); - verify(handler, never()).onRequest(any(), any(Responder.class)); - } - - @Test - public void test_onMessage_WrongVersion_ShouldNotTriggerCallback() throws IOException { - RequestHandler handler = mock(RequestHandler.class); - final JSPackagerClient client = - new JSPackagerClient("test_client", mSettings, createRH("methodValue", handler)); - - client.onMessage("{\"version\": 1, \"method\": \"methodValue\"}"); - verify(handler, never()).onNotification(any()); - verify(handler, never()).onRequest(any(), any(Responder.class)); - } - - @Test - public void test_onDisconnection_ShouldTriggerDisconnectionCallback() throws IOException { - ConnectionCallback connectionHandler = mock(ConnectionCallback.class); - RequestHandler handler = mock(RequestHandler.class); - final JSPackagerClient client = - new JSPackagerClient( - "test_client", mSettings, new HashMap(), connectionHandler); - - client.close(); - - verify(connectionHandler, never()).onConnected(); - verify(connectionHandler, times(1)).onDisconnected(); - - verify(handler, never()).onNotification(any()); - verify(handler, never()).onRequest(any(), any(Responder.class)); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.kt new file mode 100644 index 00000000000000..bb329c89c42f16 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/packagerconnection/JSPackagerClientTest.kt @@ -0,0 +1,150 @@ +/* + * 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.react.packagerconnection + +import com.facebook.react.packagerconnection.ReconnectingWebSocket.ConnectionCallback +import java.io.IOException +import okio.ByteString +import okio.ByteString.encodeUtf8 +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.ArgumentMatchers +import org.mockito.Mockito.* +import org.mockito.Mockito.`when` as whenever +import org.robolectric.RobolectricTestRunner + +@RunWith(RobolectricTestRunner::class) +class JSPackagerClientTest { + + private lateinit var settings: PackagerConnectionSettings + + @Before + fun setup() { + settings = mock(PackagerConnectionSettings::class.java) + whenever(settings.debugServerHost).thenReturn("ws://not_needed") + whenever(settings.packageName).thenReturn("my_test_package") + } + + @Test + @Throws(IOException::class) + fun test_onMessage_ShouldTriggerNotification() { + val handler = mock(RequestHandler::class.java) + val client = getClient(createRequestHandler("methodValue", handler)) + + client.onMessage("""{"version": 2, "method": "methodValue", "params": "paramsValue"}""") + verify(handler).onNotification(eq("paramsValue")) + verify(handler, never()).onRequest(any(), any(Responder::class.java)) + } + + @Test + @Throws(IOException::class) + fun test_onMessage_ShouldTriggerRequest() { + val handler = mock(RequestHandler::class.java) + val client = getClient(createRequestHandler("methodValue", handler)) + + client.onMessage( + """{"version": 2, "id": "idValue", "method": "methodValue", "params": "paramsValue"}""") + verify(handler, never()).onNotification(any()) + verify(handler).onRequest(eq("paramsValue"), any(Responder::class.java)) + } + + @Test + @Throws(IOException::class) + fun test_onMessage_WithoutParams_ShouldTriggerNotification() { + val handler = mock(RequestHandler::class.java) + val client = getClient(createRequestHandler("methodValue", handler)) + + client.onMessage("""{"version": 2, "method": "methodValue"}""") + verify(handler).onNotification(ArgumentMatchers.isNull()) + verify(handler, never()).onRequest(any(), any(Responder::class.java)) + } + + @Test + @Throws(IOException::class) + fun test_onMessage_WithInvalidContentType_ShouldNotTriggerCallback() { + val handler = mock(RequestHandler::class.java) + val client = getClient(createRequestHandler("methodValue", handler)) + + client.onMessage(encodeUtf8("""{"version": 2, "method": "methodValue"}""")) + verify(handler, never()).onNotification(any()) + verify(handler, never()).onRequest(any(), any(Responder::class.java)) + } + + @Test + @Throws(IOException::class) + fun test_onMessage_WithoutMethod_ShouldNotTriggerCallback() { + val handler = mock(RequestHandler::class.java) + val client = getClient(createRequestHandler("methodValue", handler)) + + client.onMessage("""{"version": 2}""") + verify(handler, never()).onNotification(any()) + verify(handler, never()).onRequest(any(), any(Responder::class.java)) + } + + @Test + @Throws(IOException::class) + fun test_onMessage_With_Null_Action_ShouldNotTriggerCallback() { + val handler = mock(RequestHandler::class.java) + val client = getClient(createRequestHandler("methodValue", handler)) + + client.onMessage("""{"version": 2, "method": null}""") + verify(handler, never()).onNotification(any()) + verify(handler, never()).onRequest(any(), any(Responder::class.java)) + } + + @Test + @Throws(IOException::class) + fun test_onMessage_WithInvalidMethod_ShouldNotTriggerCallback() { + val handler = mock(RequestHandler::class.java) + val client = getClient(createRequestHandler("methodValue", handler)) + + client.onMessage(ByteString.EMPTY) + verify(handler, never()).onNotification(any()) + verify(handler, never()).onRequest(any(), any(Responder::class.java)) + } + + @Test + @Throws(IOException::class) + fun test_onMessage_WrongVersion_ShouldNotTriggerCallback() { + val handler = mock(RequestHandler::class.java) + val client = getClient(createRequestHandler("methodValue", handler)) + + client.onMessage("""{"version": 1, "method": "methodValue"}""") + verify(handler, never()).onNotification(any()) + verify(handler, never()).onRequest(any(), any(Responder::class.java)) + } + + @Test + @Throws(IOException::class) + fun test_onDisconnection_ShouldTriggerDisconnectionCallback() { + val connectionHandler = mock(ConnectionCallback::class.java) + val handler = mock(RequestHandler::class.java) + val client = getClient(requestHandlers = emptyMap(), connectionCallback = connectionHandler) + + client.close() + + verify(connectionHandler, never()).onConnected() + verify(connectionHandler, times(1)).onDisconnected() + + verify(handler, never()).onNotification(any()) + verify(handler, never()).onRequest(any(), any(Responder::class.java)) + } + + private fun getClient( + requestHandlers: Map, + clientId: String = "test_client", + settings: PackagerConnectionSettings = this.settings, + connectionCallback: ConnectionCallback? = null + ): JSPackagerClient = JSPackagerClient(clientId, settings, requestHandlers, connectionCallback) + + private fun createRequestHandler( + action: String, + handler: RequestHandler + ): Map = mapOf(action to handler) +} From e5dfe9964f60a0210ea3ee8a86af75f017c0649a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Wed, 7 Jun 2023 19:00:18 -0700 Subject: [PATCH 060/468] Convert FallbackJSBundleLoaderTest to Kotlin (#37750) Summary: This PR converts FallbackJSBundleLoaderTest.java to Kotlin as requested in [this issue](https://github.com/facebook/react-native/issues/37708). ## Changelog: [INTERNAL] [CHANGED] - Convert FallbackJSBundleLoaderTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37750 Test Plan: 1. Run `./gradlew :packages:react-native:ReactAndroid:test`. 2. All tests should pass. Reviewed By: cortinico Differential Revision: D46513866 Pulled By: rshest fbshipit-source-id: fecdb38243e0195c4099a5c0bb54d2e61ca08e79 --- .../bridge/FallbackJSBundleLoaderTest.java | 176 ------------------ .../bridge/FallbackJSBundleLoaderTest.kt | 153 +++++++++++++++ 2 files changed, 153 insertions(+), 176 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/FallbackJSBundleLoaderTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/FallbackJSBundleLoaderTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/FallbackJSBundleLoaderTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/FallbackJSBundleLoaderTest.java deleted file mode 100644 index 7c877bff8423b0..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/FallbackJSBundleLoaderTest.java +++ /dev/null @@ -1,176 +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.react.bridge; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import com.facebook.common.logging.FLog; -import com.facebook.common.logging.FakeLoggingDelegate; -import java.util.ArrayList; -import java.util.Arrays; -import org.junit.Before; -import org.junit.Test; - -public class FallbackJSBundleLoaderTest { - - private static final String UNRECOVERABLE; - - static { - String prefix = FallbackJSBundleLoader.RECOVERABLE; - char first = prefix.charAt(0); - - UNRECOVERABLE = prefix.replace(first, (char) (first + 1)); - } - - private FakeLoggingDelegate mLoggingDelegate; - - @Before - public void setup() { - mLoggingDelegate = new FakeLoggingDelegate(); - FLog.setLoggingDelegate(mLoggingDelegate); - } - - @Test - public void firstLoaderSucceeds() { - JSBundleLoader delegates[] = - new JSBundleLoader[] {successfulLoader("url1"), successfulLoader("url2")}; - - FallbackJSBundleLoader fallbackLoader = - new FallbackJSBundleLoader(new ArrayList<>(Arrays.asList(delegates))); - - assertThat(fallbackLoader.loadScript(null)).isEqualTo("url1"); - - verify(delegates[0], times(1)).loadScript(null); - verify(delegates[1], never()).loadScript(null); - - assertThat( - mLoggingDelegate.logContains(FakeLoggingDelegate.WTF, FallbackJSBundleLoader.TAG, null)) - .isFalse(); - } - - @Test - public void fallingBackSuccessfully() { - JSBundleLoader delegates[] = - new JSBundleLoader[] { - recoverableLoader("url1", "error1"), successfulLoader("url2"), successfulLoader("url3") - }; - - FallbackJSBundleLoader fallbackLoader = - new FallbackJSBundleLoader(new ArrayList<>(Arrays.asList(delegates))); - - assertThat(fallbackLoader.loadScript(null)).isEqualTo("url2"); - - verify(delegates[0], times(1)).loadScript(null); - verify(delegates[1], times(1)).loadScript(null); - verify(delegates[2], never()).loadScript(null); - - assertThat( - mLoggingDelegate.logContains( - FakeLoggingDelegate.WTF, FallbackJSBundleLoader.TAG, recoverableMsg("error1"))) - .isTrue(); - } - - @Test - public void fallingbackUnsuccessfully() { - JSBundleLoader delegates[] = - new JSBundleLoader[] { - recoverableLoader("url1", "error1"), recoverableLoader("url2", "error2") - }; - - FallbackJSBundleLoader fallbackLoader = - new FallbackJSBundleLoader(new ArrayList<>(Arrays.asList(delegates))); - - try { - fallbackLoader.loadScript(null); - fail("expect throw"); - } catch (Exception e) { - assertThat(e).isInstanceOf(RuntimeException.class); - - Throwable cause = e.getCause(); - ArrayList msgs = new ArrayList<>(); - while (cause != null) { - msgs.add(cause.getMessage()); - cause = cause.getCause(); - } - - assertThat(msgs).containsExactly(recoverableMsg("error1"), recoverableMsg("error2")); - } - - verify(delegates[0], times(1)).loadScript(null); - verify(delegates[1], times(1)).loadScript(null); - - assertThat( - mLoggingDelegate.logContains( - FakeLoggingDelegate.WTF, FallbackJSBundleLoader.TAG, recoverableMsg("error1"))) - .isTrue(); - - assertThat( - mLoggingDelegate.logContains( - FakeLoggingDelegate.WTF, FallbackJSBundleLoader.TAG, recoverableMsg("error2"))) - .isTrue(); - } - - @Test - public void unrecoverable() { - JSBundleLoader delegates[] = - new JSBundleLoader[] {fatalLoader("url1", "error1"), recoverableLoader("url2", "error2")}; - - FallbackJSBundleLoader fallbackLoader = - new FallbackJSBundleLoader(new ArrayList(Arrays.asList(delegates))); - - try { - fallbackLoader.loadScript(null); - fail("expect throw"); - } catch (Exception e) { - assertThat(e.getMessage()).isEqualTo(fatalMsg("error1")); - } - - verify(delegates[0], times(1)).loadScript(null); - verify(delegates[1], never()).loadScript(null); - - assertThat( - mLoggingDelegate.logContains(FakeLoggingDelegate.WTF, FallbackJSBundleLoader.TAG, null)) - .isFalse(); - } - - private static JSBundleLoader successfulLoader(String url) { - JSBundleLoader loader = mock(JSBundleLoader.class); - when(loader.loadScript(null)).thenReturn(url); - - return loader; - } - - private static String recoverableMsg(String errMsg) { - return FallbackJSBundleLoader.RECOVERABLE + errMsg; - } - - private static JSBundleLoader recoverableLoader(String url, String errMsg) { - JSBundleLoader loader = mock(JSBundleLoader.class); - when(loader.loadScript(null)) - .thenThrow(new RuntimeException(FallbackJSBundleLoader.RECOVERABLE + errMsg)); - - return loader; - } - - private static String fatalMsg(String errMsg) { - return UNRECOVERABLE + errMsg; - } - - private static JSBundleLoader fatalLoader(String url, String errMsg) { - JSBundleLoader loader = mock(JSBundleLoader.class); - when(loader.loadScript(null)).thenThrow(new RuntimeException(UNRECOVERABLE + errMsg)); - - return loader; - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/FallbackJSBundleLoaderTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/FallbackJSBundleLoaderTest.kt new file mode 100644 index 00000000000000..62c0b4d46ba333 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/FallbackJSBundleLoaderTest.kt @@ -0,0 +1,153 @@ +/* + * 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.react.bridge + +import com.facebook.common.logging.FLog +import com.facebook.common.logging.FakeLoggingDelegate +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.api.Assertions.fail +import org.junit.Before +import org.junit.Test +import org.mockito.Mockito.* +import org.mockito.Mockito.`when` as whenever + +class FallbackJSBundleLoaderTest { + private lateinit var UNRECOVERABLE: String + private lateinit var loggingDelegate: FakeLoggingDelegate + + @Before + fun setup() { + val prefix = FallbackJSBundleLoader.RECOVERABLE + val first = prefix[0] + UNRECOVERABLE = prefix.replace(first, (first.code + 1).toChar()) + + loggingDelegate = FakeLoggingDelegate() + FLog.setLoggingDelegate(loggingDelegate) + } + + @Test + fun firstLoaderSucceeds() { + val delegates = arrayOf(successfulLoader("url1"), successfulLoader("url2")) + + val fallbackLoader = FallbackJSBundleLoader(listOf(*delegates)) + + assertThat(fallbackLoader.loadScript(null)).isEqualTo("url1") + + verify(delegates[0], times(1)).loadScript(null) + verify(delegates[1], never()).loadScript(null) + + assertThat( + loggingDelegate.logContains(FakeLoggingDelegate.WTF, FallbackJSBundleLoader.TAG, null)) + .isFalse + } + + @Test + fun fallingBackSuccessfully() { + val delegates = + arrayOf( + recoverableLoader("url1", "error1"), successfulLoader("url2"), successfulLoader("url3")) + + val fallbackLoader = FallbackJSBundleLoader(listOf(*delegates)) + + assertThat(fallbackLoader.loadScript(null)).isEqualTo("url2") + + verify(delegates[0], times(1)).loadScript(null) + verify(delegates[1], times(1)).loadScript(null) + verify(delegates[2], never()).loadScript(null) + + assertThat( + loggingDelegate.logContains( + FakeLoggingDelegate.WTF, FallbackJSBundleLoader.TAG, recoverableMsg("error1"))) + .isTrue + } + + @Test + fun fallingbackUnsuccessfully() { + val delegates = + arrayOf(recoverableLoader("url1", "error1"), recoverableLoader("url2", "error2")) + + val fallbackLoader = FallbackJSBundleLoader(listOf(*delegates)) + + try { + fallbackLoader.loadScript(null) + fail("expect throw") + } catch (e: Exception) { + assertThat(e).isInstanceOf(RuntimeException::class.java) + + var cause = e.cause + val msgs = mutableListOf() + + while (cause != null) { + msgs.add(cause.message) + cause = cause.cause + } + + assertThat(msgs).containsExactly(recoverableMsg("error1"), recoverableMsg("error2")) + } + + verify(delegates[0], times(1)).loadScript(null) + verify(delegates[1], times(1)).loadScript(null) + + assertThat( + loggingDelegate.logContains( + FakeLoggingDelegate.WTF, FallbackJSBundleLoader.TAG, recoverableMsg("error1"))) + .isTrue + + assertThat( + loggingDelegate.logContains( + FakeLoggingDelegate.WTF, FallbackJSBundleLoader.TAG, recoverableMsg("error2"))) + .isTrue + } + + @Test + fun unrecoverable() { + val delegates = arrayOf(fatalLoader("url1", "error1"), recoverableLoader("url2", "error2")) + + val fallbackLoader = FallbackJSBundleLoader(listOf(*delegates)) + + try { + fallbackLoader.loadScript(null) + fail("expect throw") + } catch (e: Exception) { + assertThat(e.message).isEqualTo(fatalMsg("error1")) + } + + verify(delegates[0], times(1)).loadScript(null) + verify(delegates[1], never()).loadScript(null) + + assertThat( + loggingDelegate.logContains(FakeLoggingDelegate.WTF, FallbackJSBundleLoader.TAG, null)) + .isFalse + } + + private fun successfulLoader(url: String): JSBundleLoader { + val loader = mock(JSBundleLoader::class.java) + whenever(loader.loadScript(null)).thenReturn(url) + + return loader + } + + private fun recoverableMsg(errMsg: String): String = FallbackJSBundleLoader.RECOVERABLE + errMsg + + private fun recoverableLoader(url: String, errMsg: String): JSBundleLoader { + val loader = mock(JSBundleLoader::class.java) + whenever(loader.loadScript(null)) + .thenThrow(RuntimeException(FallbackJSBundleLoader.RECOVERABLE + errMsg)) + + return loader + } + + private fun fatalMsg(errMsg: String): String = UNRECOVERABLE + errMsg + + private fun fatalLoader(url: String, errMsg: String): JSBundleLoader { + val loader = mock(JSBundleLoader::class.java) + whenever(loader.loadScript(null)).thenThrow(RuntimeException(UNRECOVERABLE + errMsg)) + + return loader + } +} From 29ee917a0ee930815c86e1f89db435413f157af7 Mon Sep 17 00:00:00 2001 From: M0Coding Date: Thu, 8 Jun 2023 01:10:44 -0700 Subject: [PATCH 061/468] Convert TouchEventDispatchTest to Kotlin (#37725) Summary: Converts TouchEventDispatchTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708 ## Changelog: [Internal] [Changed] - Convert TouchEventDispatchTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37725 Test Plan: Tests pass: `./gradlew :packages:react-native:ReactAndroid:test` Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: cortinico Differential Revision: D46486161 Pulled By: mdvacca fbshipit-source-id: ab7872347b42871416a3d8f23b001c564ff8c18a --- .../fabric/events/TouchEventDispatchTest.java | 612 ------------------ .../fabric/events/TouchEventDispatchTest.kt | 600 +++++++++++++++++ 2 files changed, 600 insertions(+), 612 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/events/TouchEventDispatchTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/events/TouchEventDispatchTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/events/TouchEventDispatchTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/events/TouchEventDispatchTest.java deleted file mode 100644 index 03ab6bc78100df..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/events/TouchEventDispatchTest.java +++ /dev/null @@ -1,612 +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.react.fabric.events; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.anyBoolean; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.*; -import static org.mockito.Mockito.times; - -import android.util.DisplayMetrics; -import android.view.MotionEvent; -import android.view.MotionEvent.PointerCoords; -import com.facebook.react.bridge.Arguments; -import com.facebook.react.bridge.JavaOnlyArray; -import com.facebook.react.bridge.JavaOnlyMap; -import com.facebook.react.bridge.ReadableMap; -import com.facebook.react.bridge.WritableMap; -import com.facebook.react.fabric.FabricUIManager; -import com.facebook.react.uimanager.DisplayMetricsHolder; -import com.facebook.react.uimanager.events.TouchEvent; -import com.facebook.react.uimanager.events.TouchEventCoalescingKeyHelper; -import com.facebook.react.uimanager.events.TouchEventType; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; -import org.powermock.modules.junit4.rule.PowerMockRule; -import org.robolectric.RobolectricTestRunner; - -@PrepareForTest({Arguments.class, FabricUIManager.class}) -@SuppressStaticInitializationFor("com.facebook.react.fabric.FabricUIManager") -@RunWith(RobolectricTestRunner.class) -@PowerMockIgnore({"org.mockito.*", "org.robolectric.*", "androidx.*", "android.*"}) -public class TouchEventDispatchTest { - - private static final int SURFACE_ID = 121; - private static final int TARGET_VIEW_ID = 42; - private static final int GESTURE_START_TIME = 1; - - @Rule public PowerMockRule rule = new PowerMockRule(); - - private final TouchEventCoalescingKeyHelper mTouchEventCoalescingKeyHelper = - new TouchEventCoalescingKeyHelper(); - - /** Events (1 pointer): START -> MOVE -> MOVE -> UP */ - private final TouchEvent[] mStartMoveEndSequence = - new TouchEvent[] { - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_DOWN, - 0, - new int[] {0}, - new PointerCoords[] {pointerCoords(1f, 1f)}), - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_MOVE, - 0, - new int[] {0}, - new PointerCoords[] {pointerCoords(1f, 2f)}), - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_MOVE, - 0, - new int[] {0}, - new PointerCoords[] {pointerCoords(1f, 3f)}), - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_UP, - 0, - new int[] {0}, - new PointerCoords[] {pointerCoords(1f, 3f)}) - }; - - /** Expected values for {@link #mStartMoveEndSequence} */ - private final List mStartMoveEndExpectedSequence = - listOf( - /* - * START event for touch 1: - * { - * touches: [touch1], - * changed: [touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 1f, - 1f, - GESTURE_START_TIME, - 0, - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0)), - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0))), - /* - * MOVE event for touch 1: - * { - * touches: [touch1], - * changed: [touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 1f, - 2f, - GESTURE_START_TIME, - 0, - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0)), - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0))), - /* - * MOVE event for touch 1: - * { - * touches: [touch1], - * changed: [touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 1f, - 3f, - GESTURE_START_TIME, - 0, - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 3f, GESTURE_START_TIME, 0)), - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 3f, GESTURE_START_TIME, 0))), - /* - * END event for touch 1: - * { - * touches: [], - * changed: [touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 1f, - 3f, - GESTURE_START_TIME, - 0, - Collections.emptyList(), - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 3f, GESTURE_START_TIME, 0)))); - - /** Events (2 pointer): START 1st -> START 2nd -> MOVE 1st -> UP 2st -> UP 1st */ - private final TouchEvent[] mStartPointerMoveUpSequence = - new TouchEvent[] { - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_DOWN, - 0, - new int[] {0}, - new PointerCoords[] {pointerCoords(1f, 1f)}), - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_POINTER_DOWN, - 1, - new int[] {0, 1}, - new PointerCoords[] {pointerCoords(1f, 1f), pointerCoords(2f, 1f)}), - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_MOVE, - 0, - new int[] {0, 1}, - new PointerCoords[] {pointerCoords(1f, 2f), pointerCoords(2f, 1f)}), - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_POINTER_UP, - 1, - new int[] {0, 1}, - new PointerCoords[] {pointerCoords(1f, 2f), pointerCoords(2f, 1f)}), - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_POINTER_UP, - 0, - new int[] {0}, - new PointerCoords[] {pointerCoords(1f, 2f)}) - }; - - /** Expected values for {@link #mStartPointerMoveUpSequence} */ - private final List mStartPointerMoveUpExpectedSequence = - listOf( - /* - * START event for touch 1: - * { - * touch: 0, - * touches: [touch1], - * changed: [touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 1f, - 1f, - GESTURE_START_TIME, - 0, - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0)), - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0))), - /* - * START event for touch 2: - * { - * touch: 1, - * touches: [touch0, touch1], - * changed: [touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 2f, - 1f, - GESTURE_START_TIME, - 1, - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), - /* - * MOVE event for touch 1: - * { - * touch: 0, - * touches: [touch0, touch1], - * changed: [touch0, touch1] - * } - * { - * touch: 1, - * touches: [touch0, touch1], - * changed: [touch0, touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 1f, - 2f, - GESTURE_START_TIME, - 0, - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 2f, - 1f, - GESTURE_START_TIME, - 1, - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), - /* - * UP event pointer 1: - * { - * touch: 1, - * touches: [touch0], - * changed: [touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 2f, - 1f, - GESTURE_START_TIME, - 1, - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0)), - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), - /* - * UP event pointer 0: - * { - * touch: 0, - * touches: [], - * changed: [touch0] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 1f, - 2f, - GESTURE_START_TIME, - 0, - Collections.emptyList(), - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0)))); - - /** Events (2 pointer): START 1st -> START 2nd -> MOVE 1st -> CANCEL */ - private final TouchEvent[] mStartMoveCancelSequence = - new TouchEvent[] { - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_DOWN, - 0, - new int[] {0}, - new PointerCoords[] {pointerCoords(1f, 1f)}), - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_POINTER_DOWN, - 1, - new int[] {0, 1}, - new PointerCoords[] {pointerCoords(1f, 1f), pointerCoords(2f, 1f)}), - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_MOVE, - 0, - new int[] {0, 1}, - new PointerCoords[] {pointerCoords(1f, 2f), pointerCoords(2f, 1f)}), - createTouchEvent( - GESTURE_START_TIME, - MotionEvent.ACTION_CANCEL, - 0, - new int[] {0, 1}, - new PointerCoords[] {pointerCoords(1f, 3f), pointerCoords(2f, 1f)}) - }; - - /** Expected values for {@link #mStartMoveCancelSequence} */ - private final List mStartMoveCancelExpectedSequence = - listOf( - /* - * START event for touch 1: - * { - * touch: 0, - * touches: [touch1], - * changed: [touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 1f, - 1f, - GESTURE_START_TIME, - 0, - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0)), - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0))), - /* - * START event for touch 2: - * { - * touch: 1, - * touches: [touch0, touch1], - * changed: [touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 2f, - 1f, - GESTURE_START_TIME, - 1, - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), - listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), - /* - * MOVE event for touch 1: - * { - * touch: 0, - * touches: [touch0, touch1], - * changed: [touch0, touch1] - * } - * { - * touch: 1, - * touches: [touch0, touch1], - * changed: [touch0, touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 1f, - 2f, - GESTURE_START_TIME, - 0, - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 2f, - 1f, - GESTURE_START_TIME, - 1, - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), - /* - * CANCEL event: - * { - * touch: 0, - * touches: [], - * changed: [touch0, touch1] - * } - * { - * touch: 1, - * touches: [], - * changed: [touch0, touch1] - * } - */ - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 1f, - 3f, - GESTURE_START_TIME, - 0, - Collections.emptyList(), - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 3f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), - buildGestureEvent( - SURFACE_ID, - TARGET_VIEW_ID, - 2f, - 1f, - GESTURE_START_TIME, - 1, - Collections.emptyList(), - listOf( - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 3f, GESTURE_START_TIME, 0), - buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)))); - - List mDispatchedEvents; - FabricEventEmitter mEventEmitter; - - FabricUIManager mUIManager; - - @Before - public void setUp() { - PowerMockito.mockStatic(Arguments.class); - PowerMockito.mockStatic(FabricUIManager.class); - PowerMockito.when(Arguments.createArray()) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) { - return new JavaOnlyArray(); - } - }); - PowerMockito.when(Arguments.createMap()) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) { - return new JavaOnlyMap(); - } - }); - - DisplayMetrics metrics = new DisplayMetrics(); - metrics.xdpi = 1f; - metrics.ydpi = 1f; - metrics.density = 1f; - DisplayMetricsHolder.setWindowDisplayMetrics(metrics); - - mUIManager = Mockito.mock(FabricUIManager.class); - mEventEmitter = new FabricEventEmitter(mUIManager); - } - - @Test - public void testFabric_startMoveEnd() { - for (TouchEvent event : mStartMoveEndSequence) { - event.dispatchModern(mEventEmitter); - } - ArgumentCaptor argument = ArgumentCaptor.forClass(WritableMap.class); - verify(mUIManager, times(4)) - .receiveEvent( - anyInt(), anyInt(), anyString(), anyBoolean(), anyInt(), argument.capture(), anyInt()); - - assertEquals(mStartMoveEndExpectedSequence, argument.getAllValues()); - } - - @Test - public void testFabric_startMoveCancel() { - for (TouchEvent event : mStartMoveCancelSequence) { - event.dispatchModern(mEventEmitter); - } - ArgumentCaptor argument = ArgumentCaptor.forClass(WritableMap.class); - verify(mUIManager, times(6)) - .receiveEvent( - anyInt(), anyInt(), anyString(), anyBoolean(), anyInt(), argument.capture(), anyInt()); - - assertEquals(mStartMoveCancelExpectedSequence, argument.getAllValues()); - } - - @Test - public void testFabric_startPointerUpCancel() { - for (TouchEvent event : mStartPointerMoveUpSequence) { - event.dispatchModern(mEventEmitter); - } - ArgumentCaptor argument = ArgumentCaptor.forClass(WritableMap.class); - verify(mUIManager, times(6)) - .receiveEvent( - anyInt(), anyInt(), anyString(), anyBoolean(), anyInt(), argument.capture(), anyInt()); - - assertEquals(mStartPointerMoveUpExpectedSequence, argument.getAllValues()); - } - - private TouchEvent createTouchEvent( - int gestureTime, int action, int pointerId, int[] pointerIds, PointerCoords[] pointerCoords) { - mTouchEventCoalescingKeyHelper.addCoalescingKey(gestureTime); - action |= pointerId << MotionEvent.ACTION_POINTER_INDEX_SHIFT; - return TouchEvent.obtain( - SURFACE_ID, - TARGET_VIEW_ID, - getType(action), - MotionEvent.obtain( - gestureTime, - gestureTime, - action, - pointerIds.length, - pointerIds, - pointerCoords, - 0, - 0f, - 0f, - 0, - 0, - 0, - 0), - gestureTime, - pointerCoords[0].x, - pointerCoords[0].y, - mTouchEventCoalescingKeyHelper); - } - - private static TouchEventType getType(int action) { - action &= ~MotionEvent.ACTION_POINTER_INDEX_MASK; - switch (action) { - case MotionEvent.ACTION_DOWN: - case MotionEvent.ACTION_POINTER_DOWN: - return TouchEventType.START; - case MotionEvent.ACTION_UP: - case MotionEvent.ACTION_POINTER_UP: - return TouchEventType.END; - case MotionEvent.ACTION_MOVE: - return TouchEventType.MOVE; - case MotionEvent.ACTION_CANCEL: - return TouchEventType.CANCEL; - } - - return TouchEventType.START; - } - - private static ReadableMap buildGestureEvent( - int surfaceId, - int viewTag, - float locationX, - float locationY, - int time, - int pointerId, - List touches, - List changedTouches) { - WritableMap gesture = buildGesture(surfaceId, viewTag, locationX, locationY, time, pointerId); - gesture.putArray("changedTouches", JavaOnlyArray.from(changedTouches)); - gesture.putArray("touches", JavaOnlyArray.from(touches)); - return gesture; - } - - private static WritableMap buildGesture( - int surfaceId, int viewTag, float locationX, float locationY, int time, int pointerId) { - WritableMap map = new JavaOnlyMap(); - map.putInt("targetSurface", surfaceId); - map.putInt("target", viewTag); - map.putDouble("locationX", locationX); - map.putDouble("locationY", locationY); - map.putDouble("pageX", locationX); - map.putDouble("pageY", locationY); - map.putDouble("identifier", pointerId); - map.putDouble("timestamp", time); - return map; - } - - @SafeVarargs - private static List listOf(E... args) { - return Arrays.asList(args); - } - - private static PointerCoords pointerCoords(float x, float y) { - PointerCoords pointerCoords = new PointerCoords(); - pointerCoords.x = x; - pointerCoords.y = y; - return pointerCoords; - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/events/TouchEventDispatchTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/events/TouchEventDispatchTest.kt new file mode 100644 index 00000000000000..950ddd5ee40d03 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/fabric/events/TouchEventDispatchTest.kt @@ -0,0 +1,600 @@ +/* + * 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.react.fabric.events + +import android.util.DisplayMetrics +import android.view.MotionEvent +import com.facebook.react.bridge.* +import com.facebook.react.fabric.FabricUIManager +import com.facebook.react.uimanager.DisplayMetricsHolder +import com.facebook.react.uimanager.events.TouchEvent +import com.facebook.react.uimanager.events.TouchEventCoalescingKeyHelper +import com.facebook.react.uimanager.events.TouchEventType +import org.junit.Assert +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.ArgumentCaptor +import org.mockito.ArgumentMatchers.* +import org.mockito.Mockito.mock +import org.mockito.Mockito.times +import org.mockito.Mockito.verify +import org.powermock.api.mockito.PowerMockito.mockStatic +import org.powermock.api.mockito.PowerMockito.`when` as whenever +import org.powermock.core.classloader.annotations.PowerMockIgnore +import org.powermock.core.classloader.annotations.PrepareForTest +import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor +import org.powermock.modules.junit4.rule.PowerMockRule +import org.robolectric.RobolectricTestRunner + +@PrepareForTest(Arguments::class, FabricUIManager::class) +@SuppressStaticInitializationFor("com.facebook.react.fabric.FabricUIManager") +@RunWith(RobolectricTestRunner::class) +@PowerMockIgnore("org.mockito.*", "org.robolectric.*", "androidx.*", "android.*") +class TouchEventDispatchTest { + @get:Rule var rule = PowerMockRule() + private val touchEventCoalescingKeyHelper = TouchEventCoalescingKeyHelper() + + /** Events (1 pointer): START -> MOVE -> MOVE -> UP */ + private val startMoveEndSequence = + listOf( + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_DOWN, + pointerId = 0, + pointerIds = intArrayOf(0), + pointerCoords = arrayOf(pointerCoords(1f, 1f))), + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_MOVE, + pointerId = 0, + pointerIds = intArrayOf(0), + pointerCoords = arrayOf(pointerCoords(1f, 2f))), + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_MOVE, + pointerId = 0, + pointerIds = intArrayOf(0), + pointerCoords = arrayOf(pointerCoords(1f, 3f))), + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_UP, + pointerId = 0, + pointerIds = intArrayOf(0), + pointerCoords = arrayOf(pointerCoords(1f, 3f)))) + + /** Expected values for [startMoveEndSequence] */ + private val startMoveEndExpectedSequence = + listOf( + /* + * START event for touch 1: + * { + * touches: [touch1], + * changed: [touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 1f, + locationY = 1f, + time = GESTURE_START_TIME, + pointerId = 0, + touches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0)), + changedTouches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0))), + /* + * MOVE event for touch 1: + * { + * touches: [touch1], + * changed: [touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 1f, + locationY = 2f, + time = GESTURE_START_TIME, + pointerId = 0, + touches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0)), + changedTouches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0))), + /* + * MOVE event for touch 1: + * { + * touches: [touch1], + * changed: [touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 1f, + locationY = 3f, + time = GESTURE_START_TIME, + pointerId = 0, + touches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 3f, GESTURE_START_TIME, 0)), + changedTouches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 3f, GESTURE_START_TIME, 0))), + /* + * END event for touch 1: + * { + * touches: [], + * changed: [touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 1f, + locationY = 3f, + time = GESTURE_START_TIME, + pointerId = 0, + touches = emptyList(), + changedTouches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 3f, GESTURE_START_TIME, 0)))) + + /** Events (2 pointer): START 1st -> START 2nd -> MOVE 1st -> UP 2st -> UP 1st */ + private val startPointerMoveUpSequence = + listOf( + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_DOWN, + pointerId = 0, + pointerIds = intArrayOf(0), + pointerCoords = arrayOf(pointerCoords(1f, 1f))), + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_POINTER_DOWN, + pointerId = 1, + pointerIds = intArrayOf(0, 1), + pointerCoords = arrayOf(pointerCoords(1f, 1f), pointerCoords(2f, 1f))), + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_MOVE, + pointerId = 0, + pointerIds = intArrayOf(0, 1), + pointerCoords = arrayOf(pointerCoords(1f, 2f), pointerCoords(2f, 1f))), + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_POINTER_UP, + pointerId = 1, + pointerIds = intArrayOf(0, 1), + pointerCoords = arrayOf(pointerCoords(1f, 2f), pointerCoords(2f, 1f))), + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_POINTER_UP, + pointerId = 0, + pointerIds = intArrayOf(0), + pointerCoords = arrayOf(pointerCoords(1f, 2f)))) + + /** Expected values for [startPointerMoveUpSequence] */ + private val startPointerMoveUpExpectedSequence = + listOf( + /* + * START event for touch 1: + * { + * touch: 0, + * touches: [touch1], + * changed: [touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 1f, + locationY = 1f, + time = GESTURE_START_TIME, + pointerId = 0, + touches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0)), + changedTouches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0))), + /* + * START event for touch 2: + * { + * touch: 1, + * touches: [touch0, touch1], + * changed: [touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 2f, + locationY = 1f, + time = GESTURE_START_TIME, + pointerId = 1, + touches = + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), + changedTouches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), + /* + * MOVE event for touch 1: + * { + * touch: 0, + * touches: [touch0, touch1], + * changed: [touch0, touch1] + * } + * { + * touch: 1, + * touches: [touch0, touch1], + * changed: [touch0, touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 1f, + locationY = 2f, + time = GESTURE_START_TIME, + pointerId = 0, + touches = + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), + changedTouches = + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 2f, + locationY = 1f, + time = GESTURE_START_TIME, + pointerId = 1, + touches = + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), + changedTouches = + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), + /* + * UP event pointer 1: + * { + * touch: 1, + * touches: [touch0], + * changed: [touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 2f, + locationY = 1f, + time = GESTURE_START_TIME, + pointerId = 1, + touches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0)), + changedTouches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), + /* + * UP event pointer 0: + * { + * touch: 0, + * touches: [], + * changed: [touch0] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 1f, + locationY = 2f, + time = GESTURE_START_TIME, + pointerId = 0, + touches = emptyList(), + changedTouches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0)))) + + /** Events (2 pointer): START 1st -> START 2nd -> MOVE 1st -> CANCEL */ + private val startMoveCancelSequence = + listOf( + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_DOWN, + pointerId = 0, + pointerIds = intArrayOf(0), + pointerCoords = arrayOf(pointerCoords(1f, 1f))), + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_POINTER_DOWN, + pointerId = 1, + pointerIds = intArrayOf(0, 1), + pointerCoords = arrayOf(pointerCoords(1f, 1f), pointerCoords(2f, 1f))), + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_MOVE, + pointerId = 0, + pointerIds = intArrayOf(0, 1), + pointerCoords = arrayOf(pointerCoords(1f, 2f), pointerCoords(2f, 1f))), + createTouchEvent( + gestureTime = GESTURE_START_TIME, + action = MotionEvent.ACTION_CANCEL, + pointerId = 0, + pointerIds = intArrayOf(0, 1), + pointerCoords = arrayOf(pointerCoords(1f, 3f), pointerCoords(2f, 1f)))) + + /** Expected values for [startMoveCancelSequence] */ + private val startMoveCancelExpectedSequence = + listOf( + /* + * START event for touch 1: + * { + * touch: 0, + * touches: [touch1], + * changed: [touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 1f, + locationY = 1f, + time = GESTURE_START_TIME, + pointerId = 0, + touches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0)), + changedTouches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0))), + /* + * START event for touch 2: + * { + * touch: 1, + * touches: [touch0, touch1], + * changed: [touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 2f, + locationY = 1f, + time = GESTURE_START_TIME, + pointerId = 1, + touches = + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 1f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), + changedTouches = + listOf(buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), + /* + * MOVE event for touch 1: + * { + * touch: 0, + * touches: [touch0, touch1], + * changed: [touch0, touch1] + * } + * { + * touch: 1, + * touches: [touch0, touch1], + * changed: [touch0, touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 1f, + locationY = 2f, + time = GESTURE_START_TIME, + pointerId = 0, + touches = + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), + changedTouches = + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), + buildGestureEvent( + SURFACE_ID, + TARGET_VIEW_ID, + 2f, + 1f, + GESTURE_START_TIME, + 1, + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)), + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 2f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), + /* + * CANCEL event: + * { + * touch: 0, + * touches: [], + * changed: [touch0, touch1] + * } + * { + * touch: 1, + * touches: [], + * changed: [touch0, touch1] + * } + */ + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 1f, + locationY = 3f, + time = GESTURE_START_TIME, + pointerId = 0, + touches = emptyList(), + changedTouches = + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 3f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1))), + buildGestureEvent( + surfaceId = SURFACE_ID, + viewTag = TARGET_VIEW_ID, + locationX = 2f, + locationY = 1f, + time = GESTURE_START_TIME, + pointerId = 1, + touches = emptyList(), + changedTouches = + listOf( + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 1f, 3f, GESTURE_START_TIME, 0), + buildGesture(SURFACE_ID, TARGET_VIEW_ID, 2f, 1f, GESTURE_START_TIME, 1)))) + private var dispatchedEvents: List = emptyList() + private lateinit var eventEmitter: FabricEventEmitter + private lateinit var uiManager: FabricUIManager + + @Before + fun setUp() { + mockStatic(Arguments::class.java) + mockStatic(FabricUIManager::class.java) + whenever(Arguments.createArray()).thenAnswer { JavaOnlyArray() } + whenever(Arguments.createMap()).thenAnswer { JavaOnlyMap() } + val metrics = DisplayMetrics() + metrics.xdpi = 1f + metrics.ydpi = 1f + metrics.density = 1f + DisplayMetricsHolder.setWindowDisplayMetrics(metrics) + uiManager = mock(FabricUIManager::class.java) + eventEmitter = FabricEventEmitter(uiManager) + } + + @Test + fun testFabric_startMoveEnd() { + for (event in startMoveEndSequence) { + event.dispatchModern(eventEmitter) + } + val argument = ArgumentCaptor.forClass(WritableMap::class.java) + verify(uiManager, times(4)) + .receiveEvent( + anyInt(), anyInt(), anyString(), anyBoolean(), anyInt(), argument.capture(), anyInt()) + Assert.assertEquals(startMoveEndExpectedSequence, argument.allValues) + } + + @Test + fun testFabric_startMoveCancel() { + for (event in startMoveCancelSequence) { + event.dispatchModern(eventEmitter) + } + val argument = ArgumentCaptor.forClass(WritableMap::class.java) + verify(uiManager, times(6)) + .receiveEvent( + anyInt(), anyInt(), anyString(), anyBoolean(), anyInt(), argument.capture(), anyInt()) + Assert.assertEquals(startMoveCancelExpectedSequence, argument.allValues) + } + + @Test + fun testFabric_startPointerUpCancel() { + for (event in startPointerMoveUpSequence) { + event.dispatchModern(eventEmitter) + } + val argument = ArgumentCaptor.forClass(WritableMap::class.java) + verify(uiManager, times(6)) + .receiveEvent( + anyInt(), anyInt(), anyString(), anyBoolean(), anyInt(), argument.capture(), anyInt()) + Assert.assertEquals(startPointerMoveUpExpectedSequence, argument.allValues) + } + + private fun createTouchEvent( + gestureTime: Int, + action: Int, + pointerId: Int, + pointerIds: IntArray, + pointerCoords: Array + ): TouchEvent { + touchEventCoalescingKeyHelper.addCoalescingKey(gestureTime.toLong()) + val action = action or (pointerId shl MotionEvent.ACTION_POINTER_INDEX_SHIFT) + return TouchEvent.obtain( + SURFACE_ID, + TARGET_VIEW_ID, + getType(action), + MotionEvent.obtain( + gestureTime.toLong(), + gestureTime.toLong(), + action, + pointerIds.size, + pointerIds, + pointerCoords, + 0, + 0f, + 0f, + 0, + 0, + 0, + 0), + gestureTime.toLong(), + pointerCoords[0].x, + pointerCoords[0].y, + touchEventCoalescingKeyHelper) + } + + companion object { + private const val SURFACE_ID = 121 + private const val TARGET_VIEW_ID = 42 + private const val GESTURE_START_TIME = 1 + + private fun getType(action: Int): TouchEventType { + val action = action and MotionEvent.ACTION_POINTER_INDEX_MASK.inv() + when (action) { + MotionEvent.ACTION_DOWN, + MotionEvent.ACTION_POINTER_DOWN -> return TouchEventType.START + MotionEvent.ACTION_UP, + MotionEvent.ACTION_POINTER_UP -> return TouchEventType.END + MotionEvent.ACTION_MOVE -> return TouchEventType.MOVE + MotionEvent.ACTION_CANCEL -> return TouchEventType.CANCEL + } + return TouchEventType.START + } + + private fun buildGestureEvent( + surfaceId: Int, + viewTag: Int, + locationX: Float, + locationY: Float, + time: Int, + pointerId: Int, + touches: List, + changedTouches: List + ): ReadableMap = + buildGesture(surfaceId, viewTag, locationX, locationY, time, pointerId).apply { + putArray("changedTouches", JavaOnlyArray.from(changedTouches)) + putArray("touches", JavaOnlyArray.from(touches)) + } + + private fun buildGesture( + surfaceId: Int, + viewTag: Int, + locationX: Float, + locationY: Float, + time: Int, + pointerId: Int + ): WritableMap = + JavaOnlyMap().apply { + putInt("targetSurface", surfaceId) + putInt("target", viewTag) + putDouble("locationX", locationX.toDouble()) + putDouble("locationY", locationY.toDouble()) + putDouble("pageX", locationX.toDouble()) + putDouble("pageY", locationY.toDouble()) + putDouble("identifier", pointerId.toDouble()) + putDouble("timestamp", time.toDouble()) + } + + private fun pointerCoords(x: Float, y: Float): MotionEvent.PointerCoords = + MotionEvent.PointerCoords().apply { + this.x = x + this.y = y + } + } +} From 84a3b898d50d36e8995425ca7bb962bfba5fac91 Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 8 Jun 2023 01:11:06 -0700 Subject: [PATCH 062/468] Convert UIManagerModuleConstantsHelperTest to Kotlin (#37732) Summary: Converts UIManagerModuleConstantsHelperTest from Java to Kotlin, as per issue https://github.com/facebook/react-native/issues/37708 ## Changelog: [Internal] [Changed] - Convert UIManagerModuleConstantsHelperTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37732 Test Plan: Tests pass: `./gradlew :packages:react-native:ReactAndroid:test` Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: cortinico Differential Revision: D46493160 Pulled By: mdvacca fbshipit-source-id: c7522c016e0ef36b12d1b77f37171a72c188edd0 --- .../UIManagerModuleConstantsHelperTest.java | 89 ------------------- .../UIManagerModuleConstantsHelperTest.kt | 78 ++++++++++++++++ 2 files changed, 78 insertions(+), 89 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelperTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelperTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelperTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelperTest.java deleted file mode 100644 index 78ba487e519c91..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelperTest.java +++ /dev/null @@ -1,89 +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.react.uimanager; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import com.facebook.react.common.MapBuilder; -import java.util.Map; -import org.junit.Test; - -public class UIManagerModuleConstantsHelperTest { - - @Test - public void normalizeEventTypes_withNull_doesNothing() { - UIManagerModuleConstantsHelper.normalizeEventTypes(null); - } - - @Test - public void normalizeEventTypes_withEmptyMap_doesNothing() { - Map emptyMap = MapBuilder.builder().build(); - - UIManagerModuleConstantsHelper.normalizeEventTypes(emptyMap); - - assertTrue(emptyMap.isEmpty()); - } - - @Test - public void normalizeEventTypes_withOnEvent_doesNormalize() { - Map onClickMap = MapBuilder.builder().put("onClick", "¯\\_(ツ)_/¯").build(); - - UIManagerModuleConstantsHelper.normalizeEventTypes(onClickMap); - - assertTrue(onClickMap.containsKey("topOnClick")); - assertTrue(onClickMap.containsKey("onClick")); - } - - @Test - public void normalizeEventTypes_withTopEvent_doesNormalize() { - Map onClickMap = MapBuilder.builder().put("topOnClick", "¯\\_(ツ)_/¯").build(); - - UIManagerModuleConstantsHelper.normalizeEventTypes(onClickMap); - - assertTrue(onClickMap.containsKey("topOnClick")); - assertFalse(onClickMap.containsKey("onClick")); - } - - @SuppressWarnings("unchecked") - @Test - public void normalizeEventTypes_withNestedObjects_doesNotLoseThem() { - Map nestedObjects = - MapBuilder.builder() - .put( - "onColorChanged", - MapBuilder.of( - "phasedRegistrationNames", - MapBuilder.of( - "bubbled", "onColorChanged", "captured", "onColorChangedCapture"))) - .build(); - - UIManagerModuleConstantsHelper.normalizeEventTypes(nestedObjects); - - assertTrue(nestedObjects.containsKey("topOnColorChanged")); - Map innerMap = (Map) nestedObjects.get("topOnColorChanged"); - assertNotNull(innerMap); - assertTrue(innerMap.containsKey("phasedRegistrationNames")); - Map innerInnerMap = - (Map) innerMap.get("phasedRegistrationNames"); - assertNotNull(innerInnerMap); - assertEquals("onColorChanged", innerInnerMap.get("bubbled")); - assertEquals("onColorChangedCapture", innerInnerMap.get("captured")); - - assertTrue(nestedObjects.containsKey("onColorChanged")); - innerMap = (Map) nestedObjects.get("topOnColorChanged"); - assertNotNull(innerMap); - assertTrue(innerMap.containsKey("phasedRegistrationNames")); - innerInnerMap = (Map) innerMap.get("phasedRegistrationNames"); - assertNotNull(innerInnerMap); - assertEquals("onColorChanged", innerInnerMap.get("bubbled")); - assertEquals("onColorChangedCapture", innerInnerMap.get("captured")); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelperTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelperTest.kt new file mode 100644 index 00000000000000..c4e004242858cc --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelperTest.kt @@ -0,0 +1,78 @@ +/* + * 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.react.uimanager + +import com.facebook.react.common.MapBuilder +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertTrue +import org.junit.Test + +class UIManagerModuleConstantsHelperTest { + @Test + fun normalizeEventTypes_withNull_doesNothing() { + UIManagerModuleConstantsHelper.normalizeEventTypes(null) + } + + @Test + fun normalizeEventTypes_withEmptyMap_doesNothing() { + val emptyMap: Map = MapBuilder.builder().build() + UIManagerModuleConstantsHelper.normalizeEventTypes(emptyMap) + assertTrue(emptyMap.isEmpty()) + } + + @Test + fun normalizeEventTypes_withOnEvent_doesNormalize() { + val onClickMap: Map = + MapBuilder.builder().put("onClick", "¯\\_(ツ)_/¯").build() + UIManagerModuleConstantsHelper.normalizeEventTypes(onClickMap) + assertTrue(onClickMap.containsKey("topOnClick")) + assertTrue(onClickMap.containsKey("onClick")) + } + + @Test + fun normalizeEventTypes_withTopEvent_doesNormalize() { + val onClickMap: Map = + MapBuilder.builder().put("topOnClick", "¯\\_(ツ)_/¯").build() + UIManagerModuleConstantsHelper.normalizeEventTypes(onClickMap) + assertTrue(onClickMap.containsKey("topOnClick")) + assertFalse(onClickMap.containsKey("onClick")) + } + + @Suppress("UNCHECKED_CAST") + @Test + fun normalizeEventTypes_withNestedObjects_doesNotLoseThem() { + val nestedObjects: Map = + MapBuilder.builder() + .put( + "onColorChanged", + MapBuilder.of( + "phasedRegistrationNames", + MapBuilder.of( + "bubbled", "onColorChanged", "captured", "onColorChangedCapture"))) + .build() + UIManagerModuleConstantsHelper.normalizeEventTypes(nestedObjects) + assertTrue(nestedObjects.containsKey("topOnColorChanged")) + var innerMap = nestedObjects["topOnColorChanged"] as? Map + assertNotNull(innerMap) + assertTrue(innerMap!!.containsKey("phasedRegistrationNames")) + var innerInnerMap = innerMap.get("phasedRegistrationNames") as? Map + assertNotNull(innerInnerMap) + assertEquals("onColorChanged", innerInnerMap!!.get("bubbled")) + assertEquals("onColorChangedCapture", innerInnerMap.get("captured")) + assertTrue(nestedObjects.containsKey("onColorChanged")) + innerMap = nestedObjects.get("topOnColorChanged") as? Map + assertNotNull(innerMap) + assertTrue(innerMap!!.containsKey("phasedRegistrationNames")) + innerInnerMap = innerMap.get("phasedRegistrationNames") as? Map + assertNotNull(innerInnerMap) + assertEquals("onColorChanged", innerInnerMap!!.get("bubbled")) + assertEquals("onColorChangedCapture", innerInnerMap.get("captured")) + } +} From 767b97c4dae609e71ed4beaa2698a941e37aedd8 Mon Sep 17 00:00:00 2001 From: hurali97 Date: Thu, 8 Jun 2023 01:15:43 -0700 Subject: [PATCH 063/468] refactor: re-write clipboard module test to kotlin (#37726) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Migrates the **ClipboardModuleTest** Java class to Kotlin. It also changes the import for **ClipboardManager** from `android.text.ClipboardManager` to `android.content.ClipboardManager`. Since the import from `android.text` is deprecated and in the [ClipboardManager.java](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/clipboard/ClipboardModule.java) the import refers to `android.content`, so it's safe to update the import in test file as well. It's a sub-task of the umbrella issue [here](https://github.com/facebook/react-native/issues/37708) ## Changelog: [INTERNAL] [CHANGED] ClipboardModuleTest class migrated from Java to Kotlin + واکنش منوی (%1$s) انحراف محلی اجرای %1$s From 5662faa7085db83978ae3a678de511f1386e9fc4 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 8 Jun 2023 08:44:56 -0700 Subject: [PATCH 074/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907895447666 Sandcastle Job Instance ID: 31525198359258666 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46561431 fbshipit-source-id: a843a88714bbf6d3f0d1559feef07d6d35568002 --- .../ReactAndroid/src/main/res/devsupport/values-bs/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/devsupport/values-bs/strings.xml b/packages/react-native/ReactAndroid/src/main/res/devsupport/values-bs/strings.xml index 6360c5c0799ee6..488326305ad906 100644 --- a/packages/react-native/ReactAndroid/src/main/res/devsupport/values-bs/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/devsupport/values-bs/strings.xml @@ -3,4 +3,5 @@ + Prikazuje %1$s From 108309e4070fe1f896c61e19c6dc07f71445e035 Mon Sep 17 00:00:00 2001 From: Amr Yousef Date: Thu, 8 Jun 2023 09:43:50 -0700 Subject: [PATCH 075/468] Convert and re-enable TimingModuleTest (#37763) Summary: As part of the effort to Kotlin-fy React Native tests, I've converted [TimingModuleTest](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.java) to Kotlin. I noticed the test suite was ignored and it was failing locally but managed to get all the tests to pass except one which I kept ignored. ## Changelog: [Internal] [Changed] - Convert TimingModuleTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37763 Test Plan: Tests pass: ./gradlew :packages:react-native:ReactAndroid:test Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: cortinico Differential Revision: D46543718 Pulled By: rshest fbshipit-source-id: 761b778a6d07417c9c83457c2777ee87f198f158 --- .../modules/timing/TimingModuleTest.java | 307 ------------------ .../react/modules/timing/TimingModuleTest.kt | 261 +++++++++++++++ 2 files changed, 261 insertions(+), 307 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.java deleted file mode 100644 index 613fb81773b0a1..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.java +++ /dev/null @@ -1,307 +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.react.modules.timing; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.*; - -import com.facebook.react.bridge.Arguments; -import com.facebook.react.bridge.CatalystInstance; -import com.facebook.react.bridge.JavaOnlyArray; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.common.SystemClock; -import com.facebook.react.devsupport.interfaces.DevSupportManager; -import com.facebook.react.modules.core.ChoreographerCompat; -import com.facebook.react.modules.core.JSTimers; -import com.facebook.react.modules.core.ReactChoreographer; -import com.facebook.react.modules.core.TimingModule; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.rule.PowerMockRule; -import org.robolectric.RobolectricTestRunner; - -/** Tests for {@link TimingModule}. */ -// DISABLED, BROKEN https://circleci.com/gh/facebook/react-native/12068 -@PrepareForTest({Arguments.class, SystemClock.class, ReactChoreographer.class}) -@PowerMockIgnore({"org.mockito.*", "org.robolectric.*", "androidx.*", "android.*"}) -@RunWith(RobolectricTestRunner.class) -@Ignore // TODO T13905097 -public class TimingModuleTest { - - private static final long FRAME_TIME_NS = 17 * 1000 * 1000; // 17 ms - - private TimingModule mTimingModule; - private ReactChoreographer mReactChoreographerMock; - private PostFrameCallbackHandler mPostFrameCallbackHandler; - private PostFrameIdleCallbackHandler mIdlePostFrameCallbackHandler; - private long mCurrentTimeNs; - private JSTimers mJSTimersMock; - - @Rule public PowerMockRule rule = new PowerMockRule(); - - @Before - public void prepareModules() { - PowerMockito.mockStatic(Arguments.class); - when(Arguments.createArray()) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - return new JavaOnlyArray(); - } - }); - - PowerMockito.mockStatic(SystemClock.class); - when(SystemClock.uptimeMillis()).thenReturn(mCurrentTimeNs / 1000000); - when(SystemClock.currentTimeMillis()).thenReturn(mCurrentTimeNs / 1000000); - when(SystemClock.nanoTime()).thenReturn(mCurrentTimeNs); - - mReactChoreographerMock = mock(ReactChoreographer.class); - PowerMockito.mockStatic(ReactChoreographer.class); - when(ReactChoreographer.getInstance()).thenReturn(mReactChoreographerMock); - - CatalystInstance reactInstance = mock(CatalystInstance.class); - ReactApplicationContext reactContext = mock(ReactApplicationContext.class); - when(reactContext.getCatalystInstance()).thenReturn(reactInstance); - when(reactContext.hasActiveReactInstance()).thenReturn(true); - - mCurrentTimeNs = 0; - mPostFrameCallbackHandler = new PostFrameCallbackHandler(); - mIdlePostFrameCallbackHandler = new PostFrameIdleCallbackHandler(); - - doAnswer(mPostFrameCallbackHandler) - .when(mReactChoreographerMock) - .postFrameCallback( - eq(ReactChoreographer.CallbackType.TIMERS_EVENTS), - any(ChoreographerCompat.FrameCallback.class)); - - doAnswer(mIdlePostFrameCallbackHandler) - .when(mReactChoreographerMock) - .postFrameCallback( - eq(ReactChoreographer.CallbackType.IDLE_EVENT), - any(ChoreographerCompat.FrameCallback.class)); - - mTimingModule = new TimingModule(reactContext, mock(DevSupportManager.class)); - mJSTimersMock = mock(JSTimers.class); - when(reactContext.getJSModule(JSTimers.class)).thenReturn(mJSTimersMock); - - doAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - ((Runnable) invocation.getArguments()[0]).run(); - return null; - } - }) - .when(reactContext) - .runOnJSQueueThread(any(Runnable.class)); - - mTimingModule.initialize(); - } - - private void stepChoreographerFrame() { - ChoreographerCompat.FrameCallback callback = - mPostFrameCallbackHandler.getAndResetFrameCallback(); - ChoreographerCompat.FrameCallback idleCallback = - mIdlePostFrameCallbackHandler.getAndResetFrameCallback(); - - mCurrentTimeNs += FRAME_TIME_NS; - when(SystemClock.uptimeMillis()).thenReturn(mCurrentTimeNs / 1000000); - if (callback != null) { - callback.doFrame(mCurrentTimeNs); - } - - if (idleCallback != null) { - idleCallback.doFrame(mCurrentTimeNs); - } - } - - @Test - public void testSimpleTimer() { - mTimingModule.onHostResume(); - mTimingModule.createTimer(1, 1, 0, false); - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(1.0)); - reset(mJSTimersMock); - stepChoreographerFrame(); - verifyNoMoreInteractions(mJSTimersMock); - } - - @Test - public void testSimpleRecurringTimer() { - mTimingModule.createTimer(100, 1, 0, true); - mTimingModule.onHostResume(); - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(100.0)); - - reset(mJSTimersMock); - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(100.0)); - } - - @Test - public void testCancelRecurringTimer() { - mTimingModule.onHostResume(); - mTimingModule.createTimer(105, 1, 0, true); - - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(105.0)); - - reset(mJSTimersMock); - mTimingModule.deleteTimer(105); - stepChoreographerFrame(); - verifyNoMoreInteractions(mJSTimersMock); - } - - @Test - public void testPausingAndResuming() { - mTimingModule.onHostResume(); - mTimingModule.createTimer(41, 1, 0, true); - - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41.0)); - - reset(mJSTimersMock); - mTimingModule.onHostPause(); - stepChoreographerFrame(); - verifyNoMoreInteractions(mJSTimersMock); - - reset(mJSTimersMock); - mTimingModule.onHostResume(); - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41.0)); - } - - @Test - public void testHeadlessJsTaskInBackground() { - mTimingModule.onHostPause(); - mTimingModule.onHeadlessJsTaskStart(42); - mTimingModule.createTimer(41, 1, 0, true); - - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41.0)); - - reset(mJSTimersMock); - mTimingModule.onHeadlessJsTaskFinish(42); - stepChoreographerFrame(); - verifyNoMoreInteractions(mJSTimersMock); - } - - @Test - public void testHeadlessJsTaskInForeground() { - mTimingModule.onHostResume(); - mTimingModule.onHeadlessJsTaskStart(42); - mTimingModule.createTimer(41, 1, 0, true); - - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41.0)); - - reset(mJSTimersMock); - mTimingModule.onHeadlessJsTaskFinish(42); - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41.0)); - - reset(mJSTimersMock); - mTimingModule.onHostPause(); - verifyNoMoreInteractions(mJSTimersMock); - } - - @Test - public void testHeadlessJsTaskIntertwine() { - mTimingModule.onHostResume(); - mTimingModule.onHeadlessJsTaskStart(42); - mTimingModule.createTimer(41, 1, 0, true); - mTimingModule.onHostPause(); - - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41.0)); - - reset(mJSTimersMock); - mTimingModule.onHostResume(); - mTimingModule.onHeadlessJsTaskFinish(42); - stepChoreographerFrame(); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(41.0)); - - reset(mJSTimersMock); - mTimingModule.onHostPause(); - stepChoreographerFrame(); - verifyNoMoreInteractions(mJSTimersMock); - } - - @Test - public void testSetTimeoutZero() { - mTimingModule.createTimer(100, 0, 0, false); - verify(mJSTimersMock).callTimers(JavaOnlyArray.of(100.0)); - } - - @Test - public void testIdleCallback() { - mTimingModule.onHostResume(); - mTimingModule.setSendIdleEvents(true); - - stepChoreographerFrame(); - verify(mJSTimersMock).callIdleCallbacks(SystemClock.currentTimeMillis()); - } - - @Test - public void testActiveTimersInRange() { - mTimingModule.onHostResume(); - assertThat(mTimingModule.hasActiveTimersInRange(100)).isFalse(); - - mTimingModule.createTimer(41, 1, 0, true); - assertThat(mTimingModule.hasActiveTimersInRange(100)).isFalse(); // Repeating - - mTimingModule.createTimer(42, 150, 0, false); - assertThat(mTimingModule.hasActiveTimersInRange(100)).isFalse(); // Out of range - assertThat(mTimingModule.hasActiveTimersInRange(200)).isTrue(); // In range - } - - private static class PostFrameIdleCallbackHandler implements Answer { - - private ChoreographerCompat.FrameCallback mFrameCallback; - - @Override - public Void answer(InvocationOnMock invocation) throws Throwable { - Object[] args = invocation.getArguments(); - mFrameCallback = (ChoreographerCompat.FrameCallback) args[1]; - return null; - } - - public ChoreographerCompat.FrameCallback getAndResetFrameCallback() { - ChoreographerCompat.FrameCallback callback = mFrameCallback; - mFrameCallback = null; - return callback; - } - } - - private static class PostFrameCallbackHandler implements Answer { - - private ChoreographerCompat.FrameCallback mFrameCallback; - - @Override - public Void answer(InvocationOnMock invocation) throws Throwable { - Object[] args = invocation.getArguments(); - mFrameCallback = (ChoreographerCompat.FrameCallback) args[1]; - return null; - } - - public ChoreographerCompat.FrameCallback getAndResetFrameCallback() { - ChoreographerCompat.FrameCallback callback = mFrameCallback; - mFrameCallback = null; - return callback; - } - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.kt new file mode 100644 index 00000000000000..86f295da5786b4 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/timing/TimingModuleTest.kt @@ -0,0 +1,261 @@ +/* + * 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.react.modules.timing + +import com.facebook.react.bridge.Arguments +import com.facebook.react.bridge.CatalystInstance +import com.facebook.react.bridge.JavaOnlyArray +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.common.SystemClock +import com.facebook.react.devsupport.interfaces.DevSupportManager +import com.facebook.react.modules.core.ChoreographerCompat.FrameCallback +import com.facebook.react.modules.core.JSTimers +import com.facebook.react.modules.core.ReactChoreographer +import com.facebook.react.modules.core.ReactChoreographer.CallbackType +import com.facebook.react.modules.core.TimingModule +import org.assertj.core.api.Assertions.assertThat +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.ArgumentMatchers.any +import org.mockito.ArgumentMatchers.eq +import org.mockito.Mockito.mock +import org.mockito.Mockito.reset +import org.mockito.Mockito.verify +import org.mockito.Mockito.verifyNoMoreInteractions +import org.mockito.Mockito.`when` as whenever +import org.mockito.invocation.InvocationOnMock +import org.mockito.stubbing.Answer +import org.powermock.api.mockito.PowerMockito +import org.powermock.core.classloader.annotations.PowerMockIgnore +import org.powermock.core.classloader.annotations.PrepareForTest +import org.powermock.modules.junit4.rule.PowerMockRule +import org.robolectric.RobolectricTestRunner + +@PrepareForTest(Arguments::class, SystemClock::class, ReactChoreographer::class) +@PowerMockIgnore("org.mockito.*", "org.robolectric.*", "androidx.*", "android.*") +@RunWith(RobolectricTestRunner::class) +class TimingModuleTest { + companion object { + const val FRAME_TIME_NS = 17 * 1000 * 1000 + } + + private lateinit var timingModule: TimingModule + private lateinit var reactChoreographerMock: ReactChoreographer + private lateinit var postFrameCallbackHandler: PostFrameCallbackHandler + private lateinit var idlePostFrameCallbackHandler: PostFrameCallbackHandler + private var currentTimeNs = 0L + private lateinit var jSTimersMock: JSTimers + + @get:Rule val powerMockRule = PowerMockRule() + + @Before + fun prepareModules() { + PowerMockito.mockStatic(Arguments::class.java) + whenever(Arguments.createArray()).thenAnswer { + return@thenAnswer JavaOnlyArray() + } + + PowerMockito.mockStatic(SystemClock::class.java) + whenever(SystemClock.uptimeMillis()).thenAnswer { + return@thenAnswer currentTimeNs / 1000000 + } + whenever(SystemClock.currentTimeMillis()).thenAnswer { + return@thenAnswer currentTimeNs / 1000000 + } + whenever(SystemClock.nanoTime()).thenAnswer { + return@thenAnswer currentTimeNs + } + + reactChoreographerMock = mock(ReactChoreographer::class.java) + PowerMockito.mockStatic(ReactChoreographer::class.java) + whenever(ReactChoreographer.getInstance()).thenAnswer { reactChoreographerMock } + + val reactInstance = mock(CatalystInstance::class.java) + val reactContext = mock(ReactApplicationContext::class.java) + whenever(reactContext.catalystInstance).thenReturn(reactInstance) + whenever(reactContext.hasActiveReactInstance()).thenReturn(true) + + postFrameCallbackHandler = PostFrameCallbackHandler() + idlePostFrameCallbackHandler = PostFrameCallbackHandler() + + whenever( + reactChoreographerMock.postFrameCallback( + eq(CallbackType.TIMERS_EVENTS), any(FrameCallback::class.java))) + .thenAnswer { + return@thenAnswer postFrameCallbackHandler.answer(it) + } + + whenever( + reactChoreographerMock.postFrameCallback( + eq(CallbackType.IDLE_EVENT), any(FrameCallback::class.java))) + .thenAnswer { + return@thenAnswer idlePostFrameCallbackHandler.answer(it) + } + + timingModule = TimingModule(reactContext, mock(DevSupportManager::class.java)) + jSTimersMock = mock(JSTimers::class.java) + whenever(reactContext.getJSModule(JSTimers::class.java)).thenReturn(jSTimersMock) + whenever(reactContext.runOnJSQueueThread(any(Runnable::class.java))).thenAnswer { invocation -> + (invocation.arguments[0] as Runnable).run() + return@thenAnswer true + } + + timingModule.initialize() + } + + private fun stepChoreographerFrame() { + val callback = postFrameCallbackHandler.getAndResetFrameCallback() + val idleCallback = idlePostFrameCallbackHandler.getAndResetFrameCallback() + currentTimeNs += FRAME_TIME_NS + whenever(SystemClock.uptimeMillis()).thenAnswer { + return@thenAnswer currentTimeNs / 1000000 + } + callback?.doFrame(currentTimeNs) + idleCallback?.doFrame(currentTimeNs) + } + + @Test + fun testSimpleTimer() { + timingModule.onHostResume() + timingModule.createTimer(1.0, 1.0, 0.0, false) + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(1.0)) + reset(jSTimersMock) + stepChoreographerFrame() + verifyNoMoreInteractions(jSTimersMock) + } + + @Test + fun testSimpleRecurringTimer() { + timingModule.createTimer(100.0, 1.0, 0.0, true) + timingModule.onHostResume() + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(100.0)) + reset(jSTimersMock) + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(100.0)) + } + + @Test + fun testCancelRecurringTimer() { + timingModule.onHostResume() + timingModule.createTimer(105.0, 1.0, 0.0, true) + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(105.0)) + reset(jSTimersMock) + timingModule.deleteTimer(105.0) + stepChoreographerFrame() + verifyNoMoreInteractions(jSTimersMock) + } + + @Test + fun testPausingAndResuming() { + timingModule.onHostResume() + timingModule.createTimer(41.0, 1.0, 0.0, true) + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(41.0)) + reset(jSTimersMock) + timingModule.onHostPause() + stepChoreographerFrame() + verifyNoMoreInteractions(jSTimersMock) + reset(jSTimersMock) + timingModule.onHostResume() + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(41.0)) + } + + @Test + fun testHeadlessJsTaskInBackground() { + timingModule.onHostPause() + timingModule.onHeadlessJsTaskStart(42) + timingModule.createTimer(41.0, 1.0, 0.0, true) + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(41.0)) + reset(jSTimersMock) + timingModule.onHeadlessJsTaskFinish(42) + stepChoreographerFrame() + verifyNoMoreInteractions(jSTimersMock) + } + + @Test + fun testHeadlessJsTaskInForeground() { + timingModule.onHostResume() + timingModule.onHeadlessJsTaskStart(42) + timingModule.createTimer(41.0, 1.0, 0.0, true) + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(41.0)) + reset(jSTimersMock) + timingModule.onHeadlessJsTaskFinish(42) + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(41.0)) + reset(jSTimersMock) + timingModule.onHostPause() + verifyNoMoreInteractions(jSTimersMock) + } + + @Test + fun testHeadlessJsTaskIntertwine() { + timingModule.onHostResume() + timingModule.onHeadlessJsTaskStart(42) + timingModule.createTimer(41.0, 1.0, 0.0, true) + timingModule.onHostPause() + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(41.0)) + reset(jSTimersMock) + timingModule.onHostResume() + timingModule.onHeadlessJsTaskFinish(42) + stepChoreographerFrame() + verify(jSTimersMock).callTimers(JavaOnlyArray.of(41.0)) + reset(jSTimersMock) + timingModule.onHostPause() + stepChoreographerFrame() + verifyNoMoreInteractions(jSTimersMock) + } + + @Test + fun testSetTimeoutZero() { + timingModule.createTimer(100.0, 0.0, 0.0, false) + verify(jSTimersMock).callTimers(JavaOnlyArray.of(100.0)) + } + + @Test + fun testActiveTimersInRange() { + timingModule.onHostResume() + assertThat(timingModule.hasActiveTimersInRange(100)).isFalse + timingModule.createTimer(41.0, 1.0, 0.0, true) + assertThat(timingModule.hasActiveTimersInRange(100)).isFalse // Repeating + timingModule.createTimer(42.0, 150.0, 0.0, false) + assertThat(timingModule.hasActiveTimersInRange(100)).isFalse // Out of range + assertThat(timingModule.hasActiveTimersInRange(200)).isTrue // In range + } + + @Test + fun testIdleCallback() { + timingModule.setSendIdleEvents(true) + timingModule.onHostResume() + stepChoreographerFrame() + verify(jSTimersMock).callIdleCallbacks(SystemClock.currentTimeMillis().toDouble()) + } + + private class PostFrameCallbackHandler : Answer { + + private var frameCallback: FrameCallback? = null + + override fun answer(invocation: InvocationOnMock) { + invocation.arguments[1]?.let { frameCallback = it as FrameCallback } + } + + fun getAndResetFrameCallback(): FrameCallback? { + val callback = frameCallback + frameCallback = null + return callback + } + } +} From 9821d966e96d05e775138af8400903d4955218d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Thu, 8 Jun 2023 10:39:24 -0700 Subject: [PATCH 076/468] Convert NativeAnimatedInterpolationTest to Kotlin (#37742) Summary: This PR converts NativeAnimatedInterpolationTest.java to Kotlin as requested in [this issue](https://github.com/facebook/react-native/issues/37708). ## Changelog: [INTERNAL] [CHANGED] - Convert NativeAnimatedInterpolationTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37742 Test Plan: 1. Run `./gradlew :packages:react-native:ReactAndroid:test`. 2. All tests should pass. Reviewed By: cortinico, yungsters Differential Revision: D46499088 Pulled By: mdvacca fbshipit-source-id: 06efb2451760f7e02751b521af8590a6f49236a9 --- .../NativeAnimatedInterpolationTest.java | 161 ------------------ .../NativeAnimatedInterpolationTest.kt | 158 +++++++++++++++++ 2 files changed, 158 insertions(+), 161 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.java deleted file mode 100644 index 5fdb2e9bc72edf..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.java +++ /dev/null @@ -1,161 +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.react.animated; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; - -/** - * Tests method used by {@link InterpolationAnimatedNode} to interpolate value of the input nodes. - */ -@RunWith(RobolectricTestRunner.class) -public class NativeAnimatedInterpolationTest { - - private double simpleInterpolation(double value, double[] input, double[] output) { - return InterpolationAnimatedNode.interpolate( - value, - input, - output, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_EXTEND, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_EXTEND); - } - - @Test - public void testSimpleOneToOneMapping() { - double[] input = new double[] {0d, 1d}; - double[] output = new double[] {0d, 1d}; - assertThat(simpleInterpolation(0, input, output)).isEqualTo(0); - assertThat(simpleInterpolation(0.5, input, output)).isEqualTo(0.5); - assertThat(simpleInterpolation(0.8, input, output)).isEqualTo(0.8); - assertThat(simpleInterpolation(1, input, output)).isEqualTo(1); - } - - @Test - public void testWiderOutputRange() { - double[] input = new double[] {0d, 1d}; - double[] output = new double[] {100d, 200d}; - assertThat(simpleInterpolation(0, input, output)).isEqualTo(100); - assertThat(simpleInterpolation(0.5, input, output)).isEqualTo(150); - assertThat(simpleInterpolation(0.8, input, output)).isEqualTo(180); - assertThat(simpleInterpolation(1, input, output)).isEqualTo(200); - } - - @Test - public void testWiderInputRange() { - double[] input = new double[] {2000d, 3000d}; - double[] output = new double[] {1d, 2d}; - assertThat(simpleInterpolation(2000, input, output)).isEqualTo(1); - assertThat(simpleInterpolation(2250, input, output)).isEqualTo(1.25); - assertThat(simpleInterpolation(2800, input, output)).isEqualTo(1.8); - assertThat(simpleInterpolation(3000, input, output)).isEqualTo(2); - } - - @Test - public void testManySegments() { - double[] input = new double[] {-1d, 1d, 5d}; - double[] output = new double[] {0, 10d, 20d}; - assertThat(simpleInterpolation(-1, input, output)).isEqualTo(0); - assertThat(simpleInterpolation(0, input, output)).isEqualTo(5); - assertThat(simpleInterpolation(1, input, output)).isEqualTo(10); - assertThat(simpleInterpolation(2, input, output)).isEqualTo(12.5); - assertThat(simpleInterpolation(5, input, output)).isEqualTo(20); - } - - @Test - public void testExtendExtrapolate() { - double[] input = new double[] {10d, 20d}; - double[] output = new double[] {0d, 1d}; - assertThat(simpleInterpolation(30d, input, output)).isEqualTo(2); - assertThat(simpleInterpolation(5d, input, output)).isEqualTo(-0.5); - } - - @Test - public void testClampExtrapolate() { - double[] input = new double[] {10d, 20d}; - double[] output = new double[] {0d, 1d}; - assertThat( - InterpolationAnimatedNode.interpolate( - 30d, - input, - output, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP)) - .isEqualTo(1); - assertThat( - InterpolationAnimatedNode.interpolate( - 5d, - input, - output, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP)) - .isEqualTo(0); - } - - @Test - public void testIdentityExtrapolate() { - double[] input = new double[] {10d, 20d}; - double[] output = new double[] {0d, 1d}; - assertThat( - InterpolationAnimatedNode.interpolate( - 30d, - input, - output, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY)) - .isEqualTo(30); - assertThat( - InterpolationAnimatedNode.interpolate( - 5d, - input, - output, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY)) - .isEqualTo(5); - } - - @Test - public void testInterpolateColor() { - double[] input = new double[] {0, 1}; - int[] output = new int[] {0xFF000000, 0xFFFF0000}; - assertThat(InterpolationAnimatedNode.interpolateColor(0, input, output)).isEqualTo(0xFF000000); - assertThat(InterpolationAnimatedNode.interpolateColor(0.5, input, output)) - .isEqualTo(0xFF7F0000); - } - - @Test - public void testInterpolateString() { - double[] input = new double[] {0, 1}; - double[][] output = - new double[][] { - new double[] {20, 20, 20, 80, 80, 80, 80, 20}, - new double[] {40, 40, 33, 60, 60, 60, 65, 40}, - }; - String pattern = "M20,20L20,80L80,80L80,20Z"; - assertThat( - InterpolationAnimatedNode.interpolateString( - pattern, - 0, - input, - output, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY)) - .isEqualTo("M20,20L20,80L80,80L80,20Z"); - assertThat( - InterpolationAnimatedNode.interpolateString( - pattern, - 0.5, - input, - output, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY, - InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY)) - .isEqualTo("M30,30L26.5,70L70,70L72.5,30Z"); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.kt new file mode 100644 index 00000000000000..0c131c7b04dbc3 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.kt @@ -0,0 +1,158 @@ +/* + * 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.react.animated + +import org.assertj.core.api.Assertions.assertThat +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner + +/** Tests method used by [InterpolationAnimatedNode] to interpolate value of the input nodes. */ +@RunWith(RobolectricTestRunner::class) +class NativeAnimatedInterpolationTest { + + @Test + fun testSimpleOneToOneMapping() { + val input = doubleArrayOf(0.0, 1.0) + val output = doubleArrayOf(0.0, 1.0) + assertThat(simpleInterpolation(0.0, input, output)).isEqualTo(0.0) + assertThat(simpleInterpolation(0.5, input, output)).isEqualTo(0.5) + assertThat(simpleInterpolation(0.8, input, output)).isEqualTo(0.8) + assertThat(simpleInterpolation(1.0, input, output)).isEqualTo(1.0) + } + + @Test + fun testWiderOutputRange() { + val input = doubleArrayOf(0.0, 1.0) + val output = doubleArrayOf(100.0, 200.0) + assertThat(simpleInterpolation(0.0, input, output)).isEqualTo(100.0) + assertThat(simpleInterpolation(0.5, input, output)).isEqualTo(150.0) + assertThat(simpleInterpolation(0.8, input, output)).isEqualTo(180.0) + assertThat(simpleInterpolation(1.0, input, output)).isEqualTo(200.0) + } + + @Test + fun testWiderInputRange() { + val input = doubleArrayOf(2000.0, 3000.0) + val output = doubleArrayOf(1.0, 2.0) + assertThat(simpleInterpolation(2000.0, input, output)).isEqualTo(1.0) + assertThat(simpleInterpolation(2250.0, input, output)).isEqualTo(1.25) + assertThat(simpleInterpolation(2800.0, input, output)).isEqualTo(1.8) + assertThat(simpleInterpolation(3000.0, input, output)).isEqualTo(2.0) + } + + @Test + fun testManySegments() { + val input = doubleArrayOf(-1.0, 1.0, 5.0) + val output = doubleArrayOf(0.0, 10.0, 20.0) + assertThat(simpleInterpolation(-1.0, input, output)).isEqualTo(0.0) + assertThat(simpleInterpolation(0.0, input, output)).isEqualTo(5.0) + assertThat(simpleInterpolation(1.0, input, output)).isEqualTo(10.0) + assertThat(simpleInterpolation(2.0, input, output)).isEqualTo(12.5) + assertThat(simpleInterpolation(5.0, input, output)).isEqualTo(20.0) + } + + @Test + fun testExtendExtrapolate() { + val input = doubleArrayOf(10.0, 20.0) + val output = doubleArrayOf(0.0, 1.0) + assertThat(simpleInterpolation(30.0, input, output)).isEqualTo(2.0) + assertThat(simpleInterpolation(5.0, input, output)).isEqualTo(-0.5) + } + + @Test + fun testClampExtrapolate() { + val input = doubleArrayOf(10.0, 20.0) + val output = doubleArrayOf(0.0, 1.0) + assertThat( + InterpolationAnimatedNode.interpolate( + 30.0, + input, + output, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP)) + .isEqualTo(1.0) + assertThat( + InterpolationAnimatedNode.interpolate( + 5.0, + input, + output, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_CLAMP)) + .isEqualTo(0.0) + } + + @Test + fun testIdentityExtrapolate() { + val input = doubleArrayOf(10.0, 20.0) + val output = doubleArrayOf(0.0, 1.0) + assertThat( + InterpolationAnimatedNode.interpolate( + 30.0, + input, + output, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY)) + .isEqualTo(30.0) + assertThat( + InterpolationAnimatedNode.interpolate( + 5.0, + input, + output, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY)) + .isEqualTo(5.0) + } + + @Test + fun testInterpolateColor() { + val input = doubleArrayOf(0.0, 1.0) + val output = intArrayOf(0xFF000000.toInt(), 0xFFFF0000.toInt()) + assertThat(InterpolationAnimatedNode.interpolateColor(0.0, input, output)) + .isEqualTo(0xFF000000.toInt()) + assertThat(InterpolationAnimatedNode.interpolateColor(0.5, input, output)) + .isEqualTo(0xFF7F0000.toInt()) + } + + @Test + fun testInterpolateString() { + val input = doubleArrayOf(0.0, 1.0) + val output = + arrayOf( + doubleArrayOf(20.0, 20.0, 20.0, 80.0, 80.0, 80.0, 80.0, 20.0), + doubleArrayOf(40.0, 40.0, 33.0, 60.0, 60.0, 60.0, 65.0, 40.0)) + val pattern = "M20,20L20,80L80,80L80,20Z" + assertThat( + InterpolationAnimatedNode.interpolateString( + pattern, + 0.0, + input, + output, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY)) + .isEqualTo("M20,20L20,80L80,80L80,20Z") + assertThat( + InterpolationAnimatedNode.interpolateString( + pattern, + 0.5, + input, + output, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_IDENTITY)) + .isEqualTo("M30,30L26.5,70L70,70L72.5,30Z") + } + + private fun simpleInterpolation(value: Double, input: DoubleArray, output: DoubleArray): Double = + InterpolationAnimatedNode.interpolate( + value, + input, + output, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_EXTEND, + InterpolationAnimatedNode.EXTRAPOLATE_TYPE_EXTEND) +} From 09e152e00491c3e0a7a0ef53a5a2fb69ac2ca512 Mon Sep 17 00:00:00 2001 From: Lorenzo Sciandra Date: Thu, 8 Jun 2023 11:42:42 -0700 Subject: [PATCH 077/468] add 0.70.10 and 0.69.11 changelog (#37781) Summary: Adds changelog for new patches. ## Changelog: [Internal] [Changed] - add changelog entry for 0.70.10 and 0.69.11 Pull Request resolved: https://github.com/facebook/react-native/pull/37781 Test Plan: N/A Reviewed By: NickGerleman Differential Revision: D46564493 Pulled By: cipolleschi fbshipit-source-id: c850e057d34f8862488b769076e36ebb5132f6cf --- CHANGELOG.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 315c44efb08823..c3fff0ce8b372a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -606,6 +606,22 @@ Read the [announcement blogpost here](https://reactnative.dev/blog/2023/01/12/ve - Bump terser minor version to mitigate CVE-2022-25858 ([743f9ff63b](https://github.com/facebook/react-native/commit/743f9ff63bf1e3825a1788978a9f6bad8ebddc0d) by [@GijsWeterings](https://github.com/GijsWeterings)) +## v0.70.10 + +### Fixed + +#### Android specific + +- Prevent crash on OnePlus/Oppo devices in runAnimationStep ([c05d822f7d](https://github.com/facebook/react-native/commit/c05d822f7daa92e8af2ec2cd97a9897425624cc2) by [@hsource](https://github.com/hsource)) + +#### iOS specific + +- USE_HERMES envvar check fixed in react-native-xcode.sh. ([61106ac680](https://github.com/facebook/react-native/commit/61106ac6805cddef97e16e473b155abdad701797)) by [@kidroca](https://github.com/kidroca)) +- USE_HERMES envvar check fixed in react-native-xcode.sh. Now source maps are generated by default. ([8ad63714](https://github.com/facebook/react-native/commit/8ad63714ed3070aa9fdf95b702d89ef8fb423d9d)) by [@dmytrorykun](https://github.com/dmytrorykun)) +- USE_HERMES envvar check fixed in react-native-xcode.sh. ([4108b3](https://github.com/facebook/react-native/commit/4108b374385f1ede69e82ca0f8ca6d6585aee8c4)) by [@dmytrorykun](https://github.com/dmytrorykun)) +- When source maps are enabled, clean up temporary files from the build directory. Reduces bundle size by at least 1MB. ([bad3949](https://github.com/facebook/react-native/commit/bad39493b976b425fdf72cd8cf1543a375d612ab)) by [@dmytrorykun](https://github.com/dmytrorykun)) +- Make 0.70 compatible with Xcode 15 (thanks to @AlexanderEggers for the commit in main) ([c5e549e694](https://github.com/facebook/react-native/commit/c5e549e694607cd576be8fcb5ed909fec2ed6dce)) + ## v0.70.9 ### Changed @@ -953,6 +969,14 @@ Read the [announcement blogpost here](https://reactnative.dev/blog/2023/01/12/ve - Add GitHub token permissions for workflows ([3da3d82320](https://github.com/facebook/react-native/commit/3da3d82320bd035c6bd361a82ea12a70dba4e851) by [@varunsh-coder](https://github.com/varunsh-coder)) - Bump RCT-Folly to 2021-07-22 ([68f3a42fc7](https://github.com/facebook/react-native/commit/68f3a42fc7380051714253f43b42175de361f8bd) by [@luissantana](https://github.com/luissantana)) +## v0.69.11 + +### Fixed + +#### iOS specific + +- Make 0.69 compatible with Xcode 15 (thanks to @AlexanderEggers for the commit in main) ([37e8df1cdc](https://github.com/facebook/react-native/commit/37e8df1cdce4a66763c720b1b0768d049def9518)) + ## v0.69.10 ### Fixed From 6b62f12ce957a6eea47f4abc1ead23f64d883ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Thu, 8 Jun 2023 12:06:15 -0700 Subject: [PATCH 078/468] Add smartInsertDelete prop to TextInput component (#36111) Summary: This PR add support to configure the `smartInsertDeleteType` property in iOS inputs [as described here](https://developer.apple.com/documentation/uikit/uitextinputtraits/2865828-smartinsertdeletetype), making possible toggle this autoformatting behavior. PR for the docs update: https://github.com/facebook/react-native-website/pull/3560 ## Changelog: [IOS] [ADDED] - Add `smartInsertDelete` prop to `TextInput` component Pull Request resolved: https://github.com/facebook/react-native/pull/36111 Test Plan: * Added an example in the RNTester app to test this behavior in iOS. * If the `smartInsertDelete` prop is `true` or `undefined`, the system will use the default autoformatting behavior. * If the `smartInsertDelete` prop is `false`, the system will disable the autoformatting behavior. https://user-images.githubusercontent.com/20051562/217862828-70c20344-d687-4824-8f5d-d591eff856ef.mp4 Reviewed By: javache Differential Revision: D46546277 Pulled By: NickGerleman fbshipit-source-id: 3172b14fb196876d9ee0030186540608204b96de --- .../TextInput/RCTTextInputViewConfig.js | 1 + .../Components/TextInput/TextInput.d.ts | 8 ++++++++ .../Components/TextInput/TextInput.flow.js | 10 ++++++++++ .../Components/TextInput/TextInput.js | 10 ++++++++++ .../Libraries/Text/RCTConvert+Text.h | 1 + .../Libraries/Text/RCTConvert+Text.m | 7 +++++++ .../TextInput/RCTBaseTextInputViewManager.m | 1 + .../TextInput/RCTTextInputComponentView.mm | 7 +++++++ .../TextInput/RCTTextInputUtils.h | 2 ++ .../TextInput/RCTTextInputUtils.mm | 11 +++++++++++ .../components/iostextinput/primitives.h | 9 +++++++++ .../iostextinput/propsConversions.h | 6 ++++++ .../TextInput/TextInputExample.ios.js | 19 +++++++++++++++++++ 13 files changed, 92 insertions(+) diff --git a/packages/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js b/packages/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js index 6f693295320eb4..88d3cc8fe756e5 100644 --- a/packages/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js +++ b/packages/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js @@ -156,6 +156,7 @@ const RCTTextInputViewConfig = { showSoftInputOnFocus: true, autoFocus: true, lineBreakStrategyIOS: true, + smartInsertDelete: true, ...ConditionallyIgnoredEventHandlers({ onChange: true, onSelectionChange: true, diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts b/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts index 8badb2a9d39de5..97fe9371065419 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts @@ -291,6 +291,14 @@ export interface TextInputIOSProps { | 'hangul-word' | 'push-out' | undefined; + + /** + * If `false`, the iOS system will not insert an extra space after a paste operation + * neither delete one or two spaces after a cut or delete operation. + * + * The default value is `true`. + */ + smartInsertDelete?: boolean | undefined; } /** diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.flow.js b/packages/react-native/Libraries/Components/TextInput/TextInput.flow.js index 7ed4579d4d87c8..be702737024815 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.flow.js +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.flow.js @@ -295,6 +295,16 @@ type IOSProps = $ReadOnly<{| * @platform ios */ lineBreakStrategyIOS?: ?('none' | 'standard' | 'hangul-word' | 'push-out'), + + /** + * If `false`, the iOS system will not insert an extra space after a paste operation + * neither delete one or two spaces after a cut or delete operation. + * + * The default value is `true`. + * + * @platform ios + */ + smartInsertDelete?: ?boolean, |}>; type AndroidProps = $ReadOnly<{| diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.js b/packages/react-native/Libraries/Components/TextInput/TextInput.js index 67ad18c0c19b42..657145ef2ad781 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.js +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.js @@ -339,6 +339,16 @@ type IOSProps = $ReadOnly<{| * @platform ios */ lineBreakStrategyIOS?: ?('none' | 'standard' | 'hangul-word' | 'push-out'), + + /** + * If `false`, the iOS system will not insert an extra space after a paste operation + * neither delete one or two spaces after a cut or delete operation. + * + * The default value is `true`. + * + * @platform ios + */ + smartInsertDelete?: ?boolean, |}>; type AndroidProps = $ReadOnly<{| diff --git a/packages/react-native/Libraries/Text/RCTConvert+Text.h b/packages/react-native/Libraries/Text/RCTConvert+Text.h index b7c411a2a69366..4425cc2ccfa8e3 100644 --- a/packages/react-native/Libraries/Text/RCTConvert+Text.h +++ b/packages/react-native/Libraries/Text/RCTConvert+Text.h @@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN + (UITextAutocorrectionType)UITextAutocorrectionType:(nullable id)json; + (UITextSpellCheckingType)UITextSpellCheckingType:(nullable id)json; + (RCTTextTransform)RCTTextTransform:(nullable id)json; ++ (UITextSmartInsertDeleteType)UITextSmartInsertDeleteType:(nullable id)json; @end diff --git a/packages/react-native/Libraries/Text/RCTConvert+Text.m b/packages/react-native/Libraries/Text/RCTConvert+Text.m index aa6e5e30a59082..3ab3cc656d0b63 100644 --- a/packages/react-native/Libraries/Text/RCTConvert+Text.m +++ b/packages/react-native/Libraries/Text/RCTConvert+Text.m @@ -34,4 +34,11 @@ + (UITextSpellCheckingType)UITextSpellCheckingType:(id)json RCTTextTransformUndefined, integerValue) ++ (UITextSmartInsertDeleteType)UITextSmartInsertDeleteType:(id)json +{ + return json == nil ? UITextSmartInsertDeleteTypeDefault + : [RCTConvert BOOL:json] ? UITextSmartInsertDeleteTypeYes + : UITextSmartInsertDeleteTypeNo; +} + @end diff --git a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m index 47da2cefee5926..a19b55569e8d71 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +++ b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m @@ -47,6 +47,7 @@ @implementation RCTBaseTextInputViewManager { RCT_REMAP_VIEW_PROPERTY(clearButtonMode, backedTextInputView.clearButtonMode, UITextFieldViewMode) RCT_REMAP_VIEW_PROPERTY(scrollEnabled, backedTextInputView.scrollEnabled, BOOL) RCT_REMAP_VIEW_PROPERTY(secureTextEntry, backedTextInputView.secureTextEntry, BOOL) +RCT_REMAP_VIEW_PROPERTY(smartInsertDelete, backedTextInputView.smartInsertDeleteType, UITextSmartInsertDeleteType) RCT_EXPORT_VIEW_PROPERTY(autoFocus, BOOL) RCT_EXPORT_VIEW_PROPERTY(submitBehavior, NSString) RCT_EXPORT_VIEW_PROPERTY(clearTextOnFocus, BOOL) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index 9e41f9d3b5f20b..17a38ca7858d07 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -181,6 +181,13 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & _backedTextInputView.passwordRules = RCTUITextInputPasswordRulesFromString(newTextInputProps.traits.passwordRules); } + if (newTextInputProps.traits.smartInsertDelete != oldTextInputProps.traits.smartInsertDelete) { + if (@available(iOS 11.0, *)) { + _backedTextInputView.smartInsertDeleteType = + RCTUITextSmartInsertDeleteTypeFromOptionalBool(newTextInputProps.traits.smartInsertDelete); + } + } + // Traits `blurOnSubmit`, `clearTextOnFocus`, and `selectTextOnFocus` were omitted intentionally here // because they are being checked on-demand. diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h index 2a89399964a4d5..70c55719262be0 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h @@ -39,4 +39,6 @@ UITextContentType RCTUITextContentTypeFromString(std::string const &contentType) UITextInputPasswordRules *RCTUITextInputPasswordRulesFromString(std::string const &passwordRules); +UITextSmartInsertDeleteType RCTUITextSmartInsertDeleteTypeFromOptionalBool(std::optional smartInsertDelete); + NS_ASSUME_NONNULL_END diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm index 532c29e59e3bdd..a79ddff152fa91 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm @@ -44,6 +44,10 @@ void RCTCopyBackedTextInput( toTextInput.keyboardType = fromTextInput.keyboardType; toTextInput.textContentType = fromTextInput.textContentType; + if (@available(iOS 11.0, *)) { + toTextInput.smartInsertDeleteType = fromTextInput.smartInsertDeleteType; + } + toTextInput.passwordRules = fromTextInput.passwordRules; [toTextInput setSelectedTextRange:fromTextInput.selectedTextRange notifyDelegate:NO]; @@ -226,3 +230,10 @@ UITextContentType RCTUITextContentTypeFromString(std::string const &contentType) { return [UITextInputPasswordRules passwordRulesWithDescriptor:RCTNSStringFromStringNilIfEmpty(passwordRules)]; } + +UITextSmartInsertDeleteType RCTUITextSmartInsertDeleteTypeFromOptionalBool(std::optional smartInsertDelete) +{ + return smartInsertDelete.has_value() + ? (*smartInsertDelete ? UITextSmartInsertDeleteTypeYes : UITextSmartInsertDeleteTypeNo) + : UITextSmartInsertDeleteTypeDefault; +} diff --git a/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/primitives.h b/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/primitives.h index 9fadc3d23ed959..664c0ccf0496ac 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/primitives.h +++ b/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/primitives.h @@ -222,6 +222,15 @@ class TextInputTraits final { * Default value: `` (no rules). */ std::string passwordRules{}; + + /* + * If `false`, the iOS system will not insert an extra space after a paste + * operation neither delete one or two spaces after a cut or delete operation. + * iOS-only (inherently iOS-specific) + * Can be empty (`null` in JavaScript) which means `default`. + * Default value: `empty` (`null`). + */ + std::optional smartInsertDelete{}; }; } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/propsConversions.h b/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/propsConversions.h index f498ed385191fe..885d9e50d11c80 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/propsConversions.h +++ b/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/propsConversions.h @@ -141,6 +141,12 @@ static TextInputTraits convertRawProp( "passwordRules", sourceTraits.passwordRules, defaultTraits.passwordRules); + traits.smartInsertDelete = convertRawProp( + context, + rawProps, + "smartInsertDelete", + sourceTraits.smartInsertDelete, + defaultTraits.smartInsertDelete); return traits; } diff --git a/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js b/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js index b0563e0d2f384d..9daea74eb4b796 100644 --- a/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js +++ b/packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js @@ -906,4 +906,23 @@ exports.examples = ([ ); }, }, + { + title: 'iOS autoformatting behaviors', + render: function (): React.Node { + return ( + + + + + + + + + ); + }, + }, ]: Array); From 2674d9bf7c8b9d668d1a4fe072346b0534bb0f1d Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 8 Jun 2023 12:06:38 -0700 Subject: [PATCH 079/468] Exclude trailing whitespace on measuring text width (#37590) Summary: Multiline text in Android shows some extra space. It's easily noticeable when you set the text `alignSelf` to `flex-start`. This is because we are using `layout.getLineWidth` which will include trailing whitespace. image Based on Android doc, `getLineMax` exclude trailing whitespace. image ## Changelog: [ANDROID] [FIXED] - Exclude trailing whitespace from newline character on measuring text line width Pull Request resolved: https://github.com/facebook/react-native/pull/37590 Test Plan: After applying the changes: image Code snippet: ``` 1{'\n'} ``` Reviewed By: rshest Differential Revision: D46501420 Pulled By: NickGerleman fbshipit-source-id: fba4acd38747f09791ce8af4439ee88ab12ac827 --- .../com/facebook/react/views/text/FontMetricsUtil.java | 4 +++- .../facebook/react/views/text/ReactTextShadowNode.java | 4 +++- .../java/com/facebook/react/views/text/ReactTextView.java | 4 +++- .../com/facebook/react/views/text/TextLayoutManager.java | 8 ++++++-- .../react/views/text/TextLayoutManagerMapBuffer.java | 8 ++++++-- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java index f19a1b0425888d..af97ee9cb91f08 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java @@ -42,12 +42,14 @@ public static WritableArray getFontMetrics( X_HEIGHT_MEASUREMENT_TEXT, 0, X_HEIGHT_MEASUREMENT_TEXT.length(), xHeightBounds); double xHeight = xHeightBounds.height() / AMPLIFICATION_FACTOR / dm.density; for (int i = 0; i < layout.getLineCount(); i++) { + boolean endsWithNewLine = text.charAt(layout.getLineEnd(i) - 1) == '\n'; + float lineWidth = endsWithNewLine ? layout.getLineMax(i) : layout.getLineWidth(i); Rect bounds = new Rect(); layout.getLineBounds(i, bounds); WritableMap line = Arguments.createMap(); line.putDouble("x", layout.getLineLeft(i) / dm.density); line.putDouble("y", bounds.top / dm.density); - line.putDouble("width", layout.getLineWidth(i) / dm.density); + line.putDouble("width", lineWidth / dm.density); line.putDouble("height", bounds.height() / dm.density); line.putDouble("descender", layout.getLineDescent(i) / dm.density); line.putDouble("ascender", -layout.getLineAscent(i) / dm.density); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java index 2e237f01970fb5..1e4d1f0b1f3b7d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java @@ -135,7 +135,9 @@ public long measure( layoutWidth = width; } else { for (int lineIndex = 0; lineIndex < lineCount; lineIndex++) { - float lineWidth = layout.getLineWidth(lineIndex); + boolean endsWithNewLine = text.charAt(layout.getLineEnd(lineIndex) - 1) == '\n'; + float lineWidth = + endsWithNewLine ? layout.getLineMax(lineIndex) : layout.getLineWidth(lineIndex); if (lineWidth > layoutWidth) { layoutWidth = lineWidth; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java index 43ffc0d31dc2a7..402244d022d723 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java @@ -267,11 +267,13 @@ protected void onLayout( // the last offset in the layout will result in an endless loop. Work around // this bug by avoiding getPrimaryHorizontal in that case. if (start == text.length() - 1) { + boolean endsWithNewLine = text.charAt(layout.getLineEnd(line) - 1) == '\n'; + float lineWidth = endsWithNewLine ? layout.getLineMax(line) : layout.getLineWidth(line); placeholderHorizontalPosition = isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? textViewWidth - (int) layout.getLineWidth(line) + ? textViewWidth - (int) lineWidth : (int) layout.getLineRight(line) - width; } else { // The direction of the paragraph may not be exactly the direction the string is heading diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index 25bfe983255cc7..baee29108b8514 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -407,7 +407,9 @@ public static long measureText( calculatedWidth = width; } else { for (int lineIndex = 0; lineIndex < calculatedLineCount; lineIndex++) { - float lineWidth = layout.getLineWidth(lineIndex); + boolean endsWithNewLine = text.charAt(layout.getLineEnd(lineIndex) - 1) == '\n'; + float lineWidth = + endsWithNewLine ? layout.getLineMax(lineIndex) : layout.getLineWidth(lineIndex); if (lineWidth > calculatedWidth) { calculatedWidth = lineWidth; } @@ -462,11 +464,13 @@ public static long measureText( // the last offset in the layout will result in an endless loop. Work around // this bug by avoiding getPrimaryHorizontal in that case. if (start == text.length() - 1) { + boolean endsWithNewLine = text.charAt(layout.getLineEnd(line) - 1) == '\n'; + float lineWidth = endsWithNewLine ? layout.getLineMax(line) : layout.getLineWidth(line); placeholderLeftPosition = isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? calculatedWidth - layout.getLineWidth(line) + ? calculatedWidth - lineWidth : layout.getLineRight(line) - placeholderWidth; } else { // The direction of the paragraph may not be exactly the direction the string is heading diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java index 71703755597285..f0107204f8b962 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java @@ -429,7 +429,9 @@ public static long measureText( calculatedWidth = width; } else { for (int lineIndex = 0; lineIndex < calculatedLineCount; lineIndex++) { - float lineWidth = layout.getLineWidth(lineIndex); + boolean endsWithNewLine = text.charAt(layout.getLineEnd(lineIndex) - 1) == '\n'; + float lineWidth = + endsWithNewLine ? layout.getLineMax(lineIndex) : layout.getLineWidth(lineIndex); if (lineWidth > calculatedWidth) { calculatedWidth = lineWidth; } @@ -484,12 +486,14 @@ public static long measureText( // the last offset in the layout will result in an endless loop. Work around // this bug by avoiding getPrimaryHorizontal in that case. if (start == text.length() - 1) { + boolean endsWithNewLine = text.charAt(layout.getLineEnd(line) - 1) == '\n'; + float lineWidth = endsWithNewLine ? layout.getLineMax(line) : layout.getLineWidth(line); placeholderLeftPosition = isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns // incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? calculatedWidth - layout.getLineWidth(line) + ? calculatedWidth - lineWidth : layout.getLineRight(line) - placeholderWidth; } else { // The direction of the paragraph may not be exactly the direction the string is From f3c86364dadd3883aaf5670c1d6e2798a8a85312 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 8 Jun 2023 13:14:47 -0700 Subject: [PATCH 080/468] Create a Debug manifest inside React Native Android (#37771) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37771 While working on debugging tools, I noticed that we ask in every template app to - Add a "com.facebook.react.devsupport.DevSettingsActivity" activity - Add the This is error prone and can be cleanup as we now distribute React Native that is variant aware (debug/release). So I'm creating a manifest inside `src/debug` that contains those directive so we don't need to ask users to add them (I'm removing them from the template). Changelog: [Internal] [Changed] - Create a Debug manifest inside React Native Android Reviewed By: cipolleschi Differential Revision: D46556884 fbshipit-source-id: 10034a6b245bf419dfa663bc998c4d1ad5d24a90 --- .../ReactAndroid/src/debug/AndroidManifest.xml | 15 +++++++++++++++ .../react/devsupport/BridgeDevSupportManager.java | 5 ----- .../android/app/src/debug/AndroidManifest.xml | 6 +----- .../android/app/src/main/AndroidManifest.xml | 1 - 4 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 packages/react-native/ReactAndroid/src/debug/AndroidManifest.xml diff --git a/packages/react-native/ReactAndroid/src/debug/AndroidManifest.xml b/packages/react-native/ReactAndroid/src/debug/AndroidManifest.xml new file mode 100644 index 00000000000000..ac05d07ff6274a --- /dev/null +++ b/packages/react-native/ReactAndroid/src/debug/AndroidManifest.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java index 6b57090f41cbe5..9b3a7d7486ac34 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgeDevSupportManager.java @@ -57,11 +57,6 @@ * instance manager recreates it (through {@link #onNewReactContextCreated). Also, instance manager * is responsible for enabling/disabling dev support in case when app is backgrounded or when all * the views has been detached from the instance (through {@link #setDevSupportEnabled} method). - * - * IMPORTANT: In order for developer support to work correctly it is required that the - * manifest of your application contain the following entries: - * {@code } - * {@code } */ public final class BridgeDevSupportManager extends DevSupportManagerBase { private boolean mIsSamplingProfilerEnabled = false; diff --git a/packages/react-native/template/android/app/src/debug/AndroidManifest.xml b/packages/react-native/template/android/app/src/debug/AndroidManifest.xml index 4b185bc1597eb7..eb98c01afd79a6 100644 --- a/packages/react-native/template/android/app/src/debug/AndroidManifest.xml +++ b/packages/react-native/template/android/app/src/debug/AndroidManifest.xml @@ -2,12 +2,8 @@ - - - - + tools:ignore="GoogleAppIndexingWarning"/> diff --git a/packages/rn-tester/android/app/src/main/AndroidManifest.xml b/packages/rn-tester/android/app/src/main/AndroidManifest.xml index 14257864c5fbc6..7707683c667d0b 100644 --- a/packages/rn-tester/android/app/src/main/AndroidManifest.xml +++ b/packages/rn-tester/android/app/src/main/AndroidManifest.xml @@ -60,7 +60,6 @@ - Date: Thu, 8 Jun 2023 14:38:00 -0700 Subject: [PATCH 081/468] Remove references to ShadowNodeFamilyFragment from ComponentKit shadow node wrappers (#37773) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37773 Changelog: [internal] Reviewed By: sammy-SC Differential Revision: D46190383 fbshipit-source-id: e85948fbfeaaa4e057e6ff736734da0de2c06d0f --- .../ReactCommon/react/renderer/core/ShadowNodeFamily.cpp | 4 ++++ .../ReactCommon/react/renderer/core/ShadowNodeFamily.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp index 2c86a2555e6c50..8883a033b9b429 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp @@ -48,6 +48,10 @@ SurfaceId ShadowNodeFamily::getSurfaceId() const { return surfaceId_; } +SharedEventEmitter ShadowNodeFamily::getEventEmitter() const { + return eventEmitter_; +} + ComponentName ShadowNodeFamily::getComponentName() const { return componentName_; } diff --git a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h index 32c7eb3033241e..09b0300c40390f 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h @@ -73,6 +73,8 @@ class ShadowNodeFamily final { SurfaceId getSurfaceId() const; + SharedEventEmitter getEventEmitter() const; + /* * Sets and gets the most recent state. */ From a88c0edbd3b152239ce782763918d72ea09e003c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Thu, 8 Jun 2023 14:38:00 -0700 Subject: [PATCH 082/468] Remove references to ShadowNodeFamilyFragment when not used to create new instances of ShadowNodeFamily (#37772) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37772 Changelog: [internal] `ShadowNodeFragment` is used in multiple places as a general definition for the fragment, but it lacks information that's going to be constructed in the fragment itself in the future (like `eventEmitter` in D46149084). This migrates some of the usages of this fragment to the `ShadowNodeFamily` directly (as they already have access to it). Reviewed By: javache, sammy-SC Differential Revision: D46190382 fbshipit-source-id: 3a879861106594d66a2580410d4d83523c288314 --- .../components/image/ImageShadowNode.h | 3 +- .../scrollview/ScrollViewShadowNode.cpp | 2 +- .../scrollview/ScrollViewShadowNode.h | 3 +- .../core/ConcreteComponentDescriptor.h | 3 +- .../react/renderer/core/ConcreteShadowNode.h | 5 +- .../react/renderer/core/ShadowNodeFamily.h | 20 ++++++- .../core/ShadowNodeFamilyFragment.cpp | 34 ------------ .../renderer/core/ShadowNodeFamilyFragment.h | 53 ------------------- .../react/renderer/element/ComponentBuilder.h | 1 - 9 files changed, 27 insertions(+), 97 deletions(-) delete mode 100644 packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.cpp delete mode 100644 packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.h diff --git a/packages/react-native/ReactCommon/react/renderer/components/image/ImageShadowNode.h b/packages/react-native/ReactCommon/react/renderer/components/image/ImageShadowNode.h index be233e807b1898..55d56df694b3e3 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/image/ImageShadowNode.h +++ b/packages/react-native/ReactCommon/react/renderer/components/image/ImageShadowNode.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -42,7 +43,7 @@ class ImageShadowNode final : public ConcreteViewShadowNode< static ImageState initialStateData( Props::Shared const &props, - ShadowNodeFamilyFragment const &familyFragment, + ShadowNodeFamily::Shared const & /*family*/, ComponentDescriptor const &componentDescriptor) { auto imageSource = ImageSource{ImageSource::Type::Invalid}; return {imageSource, {imageSource, nullptr}, 0}; diff --git a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp index 7fe5a502133b0b..d47ec1355861e3 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.cpp @@ -50,7 +50,7 @@ void ScrollViewShadowNode::updateScrollContentOffsetIfNeeded() { ScrollViewState ScrollViewShadowNode::initialStateData( Props::Shared const &props, - const ShadowNodeFamilyFragment & /*familyFragment*/, + const ShadowNodeFamily::Shared & /*family*/, const ComponentDescriptor & /*componentDescriptor*/) { return {static_cast(*props).contentOffset, {}, 0}; } diff --git a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.h b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.h index 3d2447fe3d9035..387a22687198d5 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.h +++ b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewShadowNode.h @@ -12,6 +12,7 @@ #include #include #include +#include namespace facebook::react { @@ -30,7 +31,7 @@ class ScrollViewShadowNode final : public ConcreteViewShadowNode< static ScrollViewState initialStateData( Props::Shared const &props, - ShadowNodeFamilyFragment const &familyFragment, + ShadowNodeFamily::Shared const &family, ComponentDescriptor const &componentDescriptor); #pragma mark - LayoutableShadowNode diff --git a/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h index 6a063b6265016d..f6fbcb9029e52d 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h @@ -160,8 +160,7 @@ class ConcreteComponentDescriptor : public ComponentDescriptor { return std::make_shared( std::make_shared( - ConcreteShadowNode::initialStateData( - props, ShadowNodeFamilyFragment::build(*family), *this)), + ConcreteShadowNode::initialStateData(props, family, *this)), family); } diff --git a/packages/react-native/ReactCommon/react/renderer/core/ConcreteShadowNode.h b/packages/react-native/ReactCommon/react/renderer/core/ConcreteShadowNode.h index b55d30fc4b51c9..e23a9ae3877d86 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ConcreteShadowNode.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ConcreteShadowNode.h @@ -13,6 +13,7 @@ #include #include #include +#include #include namespace facebook::react { @@ -87,8 +88,8 @@ class ConcreteShadowNode : public BaseShadowNodeT { static ConcreteStateData initialStateData( Props::Shared const & /*props*/, - ShadowNodeFamilyFragment const &familyFragment, - ComponentDescriptor const &componentDescriptor) { + ShadowNodeFamily::Shared const & /*family*/, + ComponentDescriptor const & /*componentDescriptor*/) { return {}; } diff --git a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h index 09b0300c40390f..c2220a2e57fd46 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h @@ -14,7 +14,6 @@ #include #include -#include namespace facebook::react { @@ -22,6 +21,24 @@ class ComponentDescriptor; class ShadowNode; class State; +/* + * This is a collection of fields serving as a specification to create new + * `ShadowNodeFamily` instances. + * + * Do not use this class as a general purpose container to share information + * about a `ShadowNodeFamily`. Pelase define specific purpose containers in + * those cases. + * + * Note: All of the fields are `const &` references (essentially just raw + * pointers) which means that the Fragment does not copy/store them nor + * retain ownership of them. + */ +struct ShadowNodeFamilyFragment { + Tag const tag; + SurfaceId const surfaceId; + EventEmitter::Shared const &eventEmitter; +}; + /* * Represents all things that shadow nodes from the same family have in common. * To be used inside `ShadowNode` class *only*. @@ -96,7 +113,6 @@ class ShadowNodeFamily final { private: friend ShadowNode; - friend ShadowNodeFamilyFragment; friend State; /* diff --git a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.cpp b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.cpp deleted file mode 100644 index 3f27ab9bfefee2..00000000000000 --- a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.cpp +++ /dev/null @@ -1,34 +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. - */ - -#include "ShadowNodeFamilyFragment.h" - -#include - -namespace facebook::react { - -ShadowNodeFamilyFragment ShadowNodeFamilyFragment::build( - ShadowNodeFamily const &family) { - return { - family.tag_, - family.surfaceId_, - family.eventEmitter_, - }; -} - -using Value = ShadowNodeFamilyFragment::Value; - -Value::Value(ShadowNodeFamilyFragment const &fragment) - : tag(fragment.tag), - surfaceId(fragment.surfaceId), - eventEmitter(fragment.eventEmitter) {} - -Value::operator ShadowNodeFamilyFragment() const { - return ShadowNodeFamilyFragment{tag, surfaceId, eventEmitter}; -} - -} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.h b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.h deleted file mode 100644 index 0de0e60ebe3bb4..00000000000000 --- a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamilyFragment.h +++ /dev/null @@ -1,53 +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. - */ - -#pragma once - -#include -#include - -namespace facebook::react { - -class ShadowNodeFamily; - -/* - * Note: All of the fields are `const &` references (essentially just raw - * pointers) which means that the Fragment does not copy/store them nor - * retain ownership of them. - */ -class ShadowNodeFamilyFragment final { - public: - static ShadowNodeFamilyFragment build(ShadowNodeFamily const &family); - - Tag const tag; - SurfaceId const surfaceId; - EventEmitter::Shared const &eventEmitter; - - /* - * `ShadowNodeFamilyFragment` is not owning data-structure, it only stores raw - * pointers to the data. `ShadowNodeFamilyFragment::Value` is a convenient - * owning counterpart of that. - */ - class Value final { - public: - /* - * Creates an object with given `ShadowNodeFragment`. - */ - Value(ShadowNodeFamilyFragment const &fragment); - - /* - * Creates a `ShadowNodeFragment` from the object. - */ - explicit operator ShadowNodeFamilyFragment() const; - - Tag tag; - SurfaceId surfaceId; - EventEmitter::Shared eventEmitter; - }; -}; - -} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/element/ComponentBuilder.h b/packages/react-native/ReactCommon/react/renderer/element/ComponentBuilder.h index 6a0251fab9f82e..ae082320a84520 100644 --- a/packages/react-native/ReactCommon/react/renderer/element/ComponentBuilder.h +++ b/packages/react-native/ReactCommon/react/renderer/element/ComponentBuilder.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #include From 325072575a425cc79aa0c13b23042cef0eaa0df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Thu, 8 Jun 2023 14:38:00 -0700 Subject: [PATCH 083/468] Expose instance handles from shadow nodes directly, instead of from event emitters/targets (#37553) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37553 ## Context I added some getters in EventTarget/EventEmitter to access the React instance handle for a given shadow node/shadow node family in https://github.com/facebook/react-native/commit/43864a1d6025bfc4483dded115d51f7613018199 (D44022477), so I could implement DOM traversal methods easily. I wanted to reuse that method to implement `MutationObserver` and `IntersectionObserver`, but unfortunately `EventEmitter`/`EventTarget` only allow access to the instance handle as long as the shadow node is mounted. That makes sense for events, but not for this use case, as with `MutationObserver` we intentionally want to have access to unmounted nodes when creating the list of `addedNodes` and `removedNodes` for the `MutationRecord` (depending on when exactly we generate this list, either `addedNodes` or `removedNodes` wouldn't be mounted). ## Changes This reverts my original change and adds a new field in `ShadowNodeFamily` to provide access to the `InstanceHandle` at any point (even if the node isn't mounted). This provides the same guarantees as the original method, keeping weak references to the handles to avoid memory leaks. Changelog: [internal] Reviewed By: sammy-SC Differential Revision: D46149084 fbshipit-source-id: f76abae50134a5d55a98cab42eebeb62084024f9 --- .../animations/tests/LayoutAnimationTest.cpp | 4 +- .../ComponentDescriptorRegistry.cpp | 7 ++- .../ComponentDescriptorRegistry.h | 3 +- .../react/renderer/core/ComponentDescriptor.h | 11 +++- .../core/ConcreteComponentDescriptor.h | 13 ++-- .../react/renderer/core/EventEmitter.cpp | 5 -- .../react/renderer/core/EventEmitter.h | 3 - .../react/renderer/core/EventTarget.cpp | 15 ++--- .../react/renderer/core/EventTarget.h | 9 ++- .../react/renderer/core/InstanceHandle.cpp | 28 +++++++++ .../react/renderer/core/InstanceHandle.h | 41 +++++++++++++ .../react/renderer/core/ReactPrimitives.h | 2 - .../react/renderer/core/ShadowNode.cpp | 9 +++ .../react/renderer/core/ShadowNode.h | 1 + .../react/renderer/core/ShadowNodeFamily.cpp | 4 +- .../react/renderer/core/ShadowNodeFamily.h | 8 ++- .../core/tests/ComponentDescriptorTest.cpp | 60 ++++++++----------- .../renderer/core/tests/ShadowNodeTest.cpp | 18 +++--- .../renderer/element/ComponentBuilder.cpp | 6 +- .../react/renderer/mounting/ShadowTree.cpp | 8 +-- .../renderer/mounting/tests/MountingTest.cpp | 18 +++--- .../tests/ShadowTreeLifeCycleTest.cpp | 12 ++-- .../react/renderer/uimanager/UIManager.cpp | 8 +-- .../react/renderer/uimanager/UIManager.h | 3 +- .../renderer/uimanager/UIManagerBinding.cpp | 14 ++--- .../react/renderer/uimanager/primitives.h | 29 +++------ .../react/test_utils/shadowTreeGeneration.h | 4 +- 27 files changed, 195 insertions(+), 148 deletions(-) create mode 100644 packages/react-native/ReactCommon/react/renderer/core/InstanceHandle.cpp create mode 100644 packages/react-native/ReactCommon/react/renderer/core/InstanceHandle.h diff --git a/packages/react-native/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp b/packages/react-native/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp index 53fe2d986c43a9..85775d70ad5681 100644 --- a/packages/react-native/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp @@ -56,8 +56,6 @@ static void testShadowNodeTreeLifeCycleLayoutAnimations( ViewComponentDescriptor(componentDescriptorParameters); auto rootComponentDescriptor = RootComponentDescriptor(componentDescriptorParameters); - auto noopEventEmitter = - std::make_shared(nullptr, -1, eventDispatcher); PropsParserContext parserContext{-1, *contextContainer}; @@ -95,7 +93,7 @@ static void testShadowNodeTreeLifeCycleLayoutAnimations( auto surfaceId = SurfaceId(surfaceIdInt); auto family = rootComponentDescriptor.createFamily( - {Tag(surfaceIdInt), surfaceId, nullptr}, nullptr); + {Tag(surfaceIdInt), surfaceId, nullptr}); // Creating an initial root shadow node. auto emptyRootNode = std::const_pointer_cast( diff --git a/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp b/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp index 892464bc9cc122..f6db0dd8a9d7d0 100644 --- a/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +++ b/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp @@ -126,12 +126,13 @@ ShadowNode::Shared ComponentDescriptorRegistry::createNode( std::string const &viewName, SurfaceId surfaceId, folly::dynamic const &propsDynamic, - SharedEventTarget const &eventTarget) const { + InstanceHandle::Shared const &instanceHandle) const { auto unifiedComponentName = componentNameByReactViewName(viewName); auto const &componentDescriptor = this->at(unifiedComponentName); - auto const fragment = ShadowNodeFamilyFragment{tag, surfaceId, nullptr}; - auto family = componentDescriptor.createFamily(fragment, eventTarget); + auto const fragment = + ShadowNodeFamilyFragment{tag, surfaceId, instanceHandle}; + auto family = componentDescriptor.createFamily(fragment); auto const props = componentDescriptor.cloneProps( PropsParserContext{surfaceId, *contextContainer_.get()}, nullptr, diff --git a/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.h b/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.h index 8c5cfe31009169..93f18c1168a1ce 100644 --- a/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.h +++ b/packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.h @@ -14,6 +14,7 @@ #include #include +#include #include namespace facebook::react { @@ -59,7 +60,7 @@ class ComponentDescriptorRegistry { std::string const &viewName, SurfaceId surfaceId, folly::dynamic const &props, - SharedEventTarget const &eventTarget) const; + InstanceHandle::Shared const &instanceHandle) const; void setFallbackComponentDescriptor( const SharedComponentDescriptor &descriptor); diff --git a/packages/react-native/ReactCommon/react/renderer/core/ComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/core/ComponentDescriptor.h index c7ced77e41b652..8b3fabe9e2e27d 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ComponentDescriptor.h @@ -8,6 +8,8 @@ #pragma once #include +#include +#include #include #include #include @@ -136,8 +138,13 @@ class ComponentDescriptor { * Creates a shadow node family for particular node. */ virtual ShadowNodeFamily::Shared createFamily( - ShadowNodeFamilyFragment const &fragment, - SharedEventTarget eventTarget) const = 0; + ShadowNodeFamilyFragment const &fragment) const = 0; + + /* + * Creates an event emitter for particular node. + */ + virtual SharedEventEmitter createEventEmitter( + InstanceHandle::Shared const &instanceHandle) const = 0; protected: EventDispatcher::Weak eventDispatcher_; diff --git a/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h index f6fbcb9029e52d..3315e745ab82d1 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h @@ -180,17 +180,20 @@ class ConcreteComponentDescriptor : public ComponentDescriptor { } ShadowNodeFamily::Shared createFamily( - ShadowNodeFamilyFragment const &fragment, - SharedEventTarget eventTarget) const override { - auto eventEmitter = std::make_shared( - std::move(eventTarget), fragment.tag, eventDispatcher_); + ShadowNodeFamilyFragment const &fragment) const override { return std::make_shared( ShadowNodeFamilyFragment{ - fragment.tag, fragment.surfaceId, eventEmitter}, + fragment.tag, fragment.surfaceId, fragment.instanceHandle}, eventDispatcher_, *this); } + SharedEventEmitter createEventEmitter( + InstanceHandle::Shared const &instanceHandle) const override { + return std::make_shared( + std::make_shared(instanceHandle), eventDispatcher_); + } + protected: /* * Called immediately after `ShadowNode` is created or cloned. diff --git a/packages/react-native/ReactCommon/react/renderer/core/EventEmitter.cpp b/packages/react-native/ReactCommon/react/renderer/core/EventEmitter.cpp index 2426cea3ca23ce..22a12a2ffb43fe 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/EventEmitter.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/EventEmitter.cpp @@ -43,7 +43,6 @@ ValueFactory EventEmitter::defaultPayloadFactory() { EventEmitter::EventEmitter( SharedEventTarget eventTarget, - Tag /*tag*/, EventDispatcher::Weak eventDispatcher) : eventTarget_(std::move(eventTarget)), eventDispatcher_(std::move(eventDispatcher)) {} @@ -131,8 +130,4 @@ void EventEmitter::setEnabled(bool enabled) const { } } -const SharedEventTarget &EventEmitter::getEventTarget() const { - return eventTarget_; -} - } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/core/EventEmitter.h b/packages/react-native/ReactCommon/react/renderer/core/EventEmitter.h index 36eae1ad1ffead..c02d605b43b77d 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/EventEmitter.h +++ b/packages/react-native/ReactCommon/react/renderer/core/EventEmitter.h @@ -38,7 +38,6 @@ class EventEmitter { EventEmitter( SharedEventTarget eventTarget, - Tag tag, EventDispatcher::Weak eventDispatcher); virtual ~EventEmitter() = default; @@ -55,8 +54,6 @@ class EventEmitter { */ void setEnabled(bool enabled) const; - SharedEventTarget const &getEventTarget() const; - protected: #ifdef ANDROID // We need this temporarily due to lack of Java-counterparts for particular diff --git a/packages/react-native/ReactCommon/react/renderer/core/EventTarget.cpp b/packages/react-native/ReactCommon/react/renderer/core/EventTarget.cpp index 38e78e500f84b9..82118ceee8b89e 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/EventTarget.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/EventTarget.cpp @@ -13,14 +13,9 @@ namespace facebook::react { using Tag = EventTarget::Tag; -EventTarget::EventTarget( - jsi::Runtime &runtime, - jsi::Value const &instanceHandle, - Tag tag) - : weakInstanceHandle_( - jsi::WeakObject(runtime, instanceHandle.asObject(runtime))), - strongInstanceHandle_(jsi::Value::null()), - tag_(tag) {} +EventTarget::EventTarget(InstanceHandle::Shared instanceHandle) + : instanceHandle_(std::move(instanceHandle)), + strongInstanceHandle_(jsi::Value::null()) {} void EventTarget::setEnabled(bool enabled) const { enabled_ = enabled; @@ -31,7 +26,7 @@ void EventTarget::retain(jsi::Runtime &runtime) const { return; } - strongInstanceHandle_ = weakInstanceHandle_.lock(runtime); + strongInstanceHandle_ = instanceHandle_->getInstanceHandle(runtime); // Having a `null` or `undefined` object here indicates that // `weakInstanceHandle_` was already deallocated. This should *not* happen by @@ -62,7 +57,7 @@ jsi::Value EventTarget::getInstanceHandle(jsi::Runtime &runtime) const { } Tag EventTarget::getTag() const { - return tag_; + return instanceHandle_->getTag(); } } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/core/EventTarget.h b/packages/react-native/ReactCommon/react/renderer/core/EventTarget.h index f6b29947805b64..1b023dc65105e8 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/EventTarget.h +++ b/packages/react-native/ReactCommon/react/renderer/core/EventTarget.h @@ -7,9 +7,9 @@ #pragma once -#include - #include +#include +#include namespace facebook::react { @@ -34,7 +34,7 @@ class EventTarget { /* * Constructs an EventTarget from a weak instance handler and a tag. */ - EventTarget(jsi::Runtime &runtime, jsi::Value const &instanceHandle, Tag tag); + explicit EventTarget(InstanceHandle::Shared instanceHandle); /* * Sets the `enabled` flag that allows creating a strong instance handle from @@ -65,10 +65,9 @@ class EventTarget { Tag getTag() const; private: + const InstanceHandle::Shared instanceHandle_; mutable bool enabled_{false}; // Protected by `EventEmitter::DispatchMutex()`. - mutable jsi::WeakObject weakInstanceHandle_; // Protected by `jsi::Runtime &`. mutable jsi::Value strongInstanceHandle_; // Protected by `jsi::Runtime &`. - Tag tag_; }; using SharedEventTarget = std::shared_ptr; diff --git a/packages/react-native/ReactCommon/react/renderer/core/InstanceHandle.cpp b/packages/react-native/ReactCommon/react/renderer/core/InstanceHandle.cpp new file mode 100644 index 00000000000000..9d7ccef277e57a --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/core/InstanceHandle.cpp @@ -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. + */ + +#include "InstanceHandle.h" + +namespace facebook::react { + +InstanceHandle::InstanceHandle( + jsi::Runtime &runtime, + jsi::Value const &instanceHandle, + Tag tag) + : weakInstanceHandle_( + jsi::WeakObject(runtime, instanceHandle.asObject(runtime))), + tag_(tag) {} + +jsi::Value InstanceHandle::getInstanceHandle(jsi::Runtime &runtime) const { + return weakInstanceHandle_.lock(runtime); +} + +Tag InstanceHandle::getTag() const { + return tag_; +} + +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/core/InstanceHandle.h b/packages/react-native/ReactCommon/react/renderer/core/InstanceHandle.h new file mode 100644 index 00000000000000..171d03011e975a --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/core/InstanceHandle.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +namespace facebook::react { + +class InstanceHandle { + public: + using Shared = std::shared_ptr; + + InstanceHandle( + jsi::Runtime &runtime, + jsi::Value const &instanceHandle, + Tag tag); + + /* + * Creates and returns the `instanceHandle`. + * Returns `null` if the `instanceHandle` is not retained at this moment. + */ + jsi::Value getInstanceHandle(jsi::Runtime &runtime) const; + + /* + * Deprecated. Do not use. + */ + Tag getTag() const; + + private: + const jsi::WeakObject weakInstanceHandle_; // Protected by `jsi::Runtime &`. + const Tag tag_; +}; + +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/core/ReactPrimitives.h b/packages/react-native/ReactCommon/react/renderer/core/ReactPrimitives.h index d77ac5971329bf..93cadde558d1b5 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ReactPrimitives.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ReactPrimitives.h @@ -17,8 +17,6 @@ namespace facebook::react { * `Tag` and `InstanceHandle` are used to address React Native components. */ using Tag = int32_t; -using InstanceHandle = struct InstanceHandleDummyStruct { -} *; /* * An id of a running Surface instance that is used to refer to the instance. diff --git a/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp index 6068eb3e822aec..ba8da5d6f1eda8 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp @@ -174,6 +174,15 @@ const SharedEventEmitter &ShadowNode::getEventEmitter() const { return family_->eventEmitter_; } +jsi::Value ShadowNode::getInstanceHandle(jsi::Runtime &runtime) const { + auto instanceHandle = family_->instanceHandle_; + if (instanceHandle == nullptr) { + return jsi::Value::null(); + } + + return instanceHandle->getInstanceHandle(runtime); +} + Tag ShadowNode::getTag() const { return family_->tag_; } diff --git a/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.h b/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.h index 265dc9a921e56c..4e428b25997985 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.h @@ -123,6 +123,7 @@ class ShadowNode : public Sealable, Props::Shared const &getProps() const; ListOfShared const &getChildren() const; SharedEventEmitter const &getEventEmitter() const; + jsi::Value getInstanceHandle(jsi::Runtime &runtime) const; Tag getTag() const; SurfaceId getSurfaceId() const; diff --git a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp index 8883a033b9b429..5035656acebbd5 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.cpp @@ -25,7 +25,9 @@ ShadowNodeFamily::ShadowNodeFamily( : eventDispatcher_(std::move(eventDispatcher)), tag_(fragment.tag), surfaceId_(fragment.surfaceId), - eventEmitter_(fragment.eventEmitter), + instanceHandle_(fragment.instanceHandle), + eventEmitter_( + componentDescriptor.createEventEmitter(fragment.instanceHandle)), componentDescriptor_(componentDescriptor), componentHandle_(componentDescriptor.getComponentHandle()), componentName_(componentDescriptor.getComponentName()) {} diff --git a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h index c2220a2e57fd46..401686bc806568 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h @@ -13,6 +13,7 @@ #include #include +#include #include namespace facebook::react { @@ -36,7 +37,7 @@ class State; struct ShadowNodeFamilyFragment { Tag const tag; SurfaceId const surfaceId; - EventEmitter::Shared const &eventEmitter; + InstanceHandle::Shared const &instanceHandle; }; /* @@ -137,6 +138,11 @@ class ShadowNodeFamily final { */ SurfaceId const surfaceId_; + /* + * Weak reference to the React instance handle + */ + InstanceHandle::Shared const instanceHandle_; + /* * `EventEmitter` associated with all nodes of the family. */ diff --git a/packages/react-native/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp b/packages/react-native/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp index 33bd463ab3f2eb..021f62b4f58a8e 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp @@ -29,13 +29,11 @@ TEST(ComponentDescriptorTest, createShadowNode) { const auto &raw = RawProps(folly::dynamic::object("nativeID", "abc")); Props::Shared props = descriptor->cloneProps(parserContext, nullptr, raw); - auto family = descriptor->createFamily( - ShadowNodeFamilyFragment{ - /* .tag = */ 9, - /* .surfaceId = */ 1, - /* .eventEmitter = */ nullptr, - }, - nullptr); + auto family = descriptor->createFamily(ShadowNodeFamilyFragment{ + /* .tag = */ 9, + /* .surfaceId = */ 1, + /* .instanceHandle = */ nullptr, + }); ShadowNode::Shared node = descriptor->createShadowNode( ShadowNodeFragment{ @@ -62,13 +60,11 @@ TEST(ComponentDescriptorTest, cloneShadowNode) { const auto &raw = RawProps(folly::dynamic::object("nativeID", "abc")); Props::Shared props = descriptor->cloneProps(parserContext, nullptr, raw); - auto family = descriptor->createFamily( - ShadowNodeFamilyFragment{ - /* .tag = */ 9, - /* .surfaceId = */ 1, - /* .eventEmitter = */ nullptr, - }, - nullptr); + auto family = descriptor->createFamily(ShadowNodeFamilyFragment{ + /* .tag = */ 9, + /* .surfaceId = */ 1, + /* .instanceHandle = */ nullptr, + }); ShadowNode::Shared node = descriptor->createShadowNode( ShadowNodeFragment{ /* .props = */ props, @@ -97,37 +93,31 @@ TEST(ComponentDescriptorTest, appendChild) { const auto &raw = RawProps(folly::dynamic::object("nativeID", "abc")); Props::Shared props = descriptor->cloneProps(parserContext, nullptr, raw); - auto family1 = descriptor->createFamily( - ShadowNodeFamilyFragment{ - /* .tag = */ 1, - /* .surfaceId = */ 1, - /* .eventEmitter = */ nullptr, - }, - nullptr); + auto family1 = descriptor->createFamily(ShadowNodeFamilyFragment{ + /* .tag = */ 1, + /* .surfaceId = */ 1, + /* .instanceHandle = */ nullptr, + }); ShadowNode::Shared node1 = descriptor->createShadowNode( ShadowNodeFragment{ /* .props = */ props, }, family1); - auto family2 = descriptor->createFamily( - ShadowNodeFamilyFragment{ - /* .tag = */ 2, - /* .surfaceId = */ 1, - /* .eventEmitter = */ nullptr, - }, - nullptr); + auto family2 = descriptor->createFamily(ShadowNodeFamilyFragment{ + /* .tag = */ 2, + /* .surfaceId = */ 1, + /* .instanceHandle = */ nullptr, + }); ShadowNode::Shared node2 = descriptor->createShadowNode( ShadowNodeFragment{ /* .props = */ props, }, family2); - auto family3 = descriptor->createFamily( - ShadowNodeFamilyFragment{ - /* .tag = */ 3, - /* .surfaceId = */ 1, - /* .eventEmitter = */ nullptr, - }, - nullptr); + auto family3 = descriptor->createFamily(ShadowNodeFamilyFragment{ + /* .tag = */ 3, + /* .surfaceId = */ 1, + /* .instanceHandle = */ nullptr, + }); ShadowNode::Shared node3 = descriptor->createShadowNode( ShadowNodeFragment{ /* .props = */ props, diff --git a/packages/react-native/ReactCommon/react/renderer/core/tests/ShadowNodeTest.cpp b/packages/react-native/ReactCommon/react/renderer/core/tests/ShadowNodeTest.cpp index 65e6705cb582a5..2513d84a5d5db9 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/tests/ShadowNodeTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/tests/ShadowNodeTest.cpp @@ -41,7 +41,7 @@ class ShadowNodeTest : public ::testing::Test { ShadowNodeFamilyFragment{ /* .tag = */ 11, /* .surfaceId = */ surfaceId_, - /* .eventEmitter = */ nullptr, + /* .instanceHandle = */ nullptr, }, eventDispatcher_, componentDescriptor_); @@ -57,7 +57,7 @@ class ShadowNodeTest : public ::testing::Test { ShadowNodeFamilyFragment{ /* .tag = */ 12, /* .surfaceId = */ surfaceId_, - /* .eventEmitter = */ nullptr, + /* .instanceHandle = */ nullptr, }, eventDispatcher_, componentDescriptor_); @@ -73,7 +73,7 @@ class ShadowNodeTest : public ::testing::Test { ShadowNodeFamilyFragment{ /* .tag = */ 13, /* .surfaceId = */ surfaceId_, - /* .eventEmitter = */ nullptr, + /* .instanceHandle = */ nullptr, }, eventDispatcher_, componentDescriptor_); @@ -92,7 +92,7 @@ class ShadowNodeTest : public ::testing::Test { ShadowNodeFamilyFragment{ /* .tag = */ 15, /* .surfaceId = */ surfaceId_, - /* .eventEmitter = */ nullptr, + /* .instanceHandle = */ nullptr, }, eventDispatcher_, componentDescriptor_); @@ -108,7 +108,7 @@ class ShadowNodeTest : public ::testing::Test { ShadowNodeFamilyFragment{ /* .tag = */ 16, /* .surfaceId = */ surfaceId_, - /* .eventEmitter = */ nullptr, + /* .instanceHandle = */ nullptr, }, eventDispatcher_, componentDescriptor_); @@ -127,7 +127,7 @@ class ShadowNodeTest : public ::testing::Test { ShadowNodeFamilyFragment{ /* .tag = */ 17, /* .surfaceId = */ surfaceId_, - /* .eventEmitter = */ nullptr, + /* .instanceHandle = */ nullptr, }, eventDispatcher_, componentDescriptor_); @@ -143,7 +143,7 @@ class ShadowNodeTest : public ::testing::Test { ShadowNodeFamilyFragment{ /* .tag = */ 18, /* .surfaceId = */ surfaceId_, - /* .eventEmitter = */ nullptr, + /* .instanceHandle = */ nullptr, }, eventDispatcher_, componentDescriptor_); @@ -174,7 +174,7 @@ TEST_F(ShadowNodeTest, handleShadowNodeCreation) { EXPECT_STREQ(nodeZ_->getComponentName(), "Test"); EXPECT_EQ(nodeZ_->getTag(), 18); EXPECT_EQ(nodeZ_->getSurfaceId(), surfaceId_); - EXPECT_EQ(nodeZ_->getEventEmitter(), nullptr); + EXPECT_NE(nodeZ_->getEventEmitter(), nullptr); EXPECT_EQ(nodeZ_->getChildren().size(), 0); } @@ -238,7 +238,7 @@ TEST_F(ShadowNodeTest, handleState) { ShadowNodeFamilyFragment{ /* .tag = */ 9, /* .surfaceId = */ surfaceId_, - /* .eventEmitter = */ nullptr, + /* .instanceHandle = */ nullptr, }, eventDispatcher_, componentDescriptor_); diff --git a/packages/react-native/ReactCommon/react/renderer/element/ComponentBuilder.cpp b/packages/react-native/ReactCommon/react/renderer/element/ComponentBuilder.cpp index 35973c49a2b3b2..10d061cb858008 100644 --- a/packages/react-native/ReactCommon/react/renderer/element/ComponentBuilder.cpp +++ b/packages/react-native/ReactCommon/react/renderer/element/ComponentBuilder.cpp @@ -26,10 +26,8 @@ ShadowNode::Unshared ComponentBuilder::build( children.push_back(build(childFragment)); } - auto family = componentDescriptor.createFamily( - ShadowNodeFamilyFragment{ - elementFragment.tag, elementFragment.surfaceId, nullptr}, - nullptr); + auto family = componentDescriptor.createFamily(ShadowNodeFamilyFragment{ + elementFragment.tag, elementFragment.surfaceId, nullptr}); auto initialState = componentDescriptor.createInitialState(elementFragment.props, family); diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp index 0b9106bbb5d2b0..f504c986b5c418 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp @@ -225,9 +225,6 @@ ShadowTree::ShadowTree( ShadowTreeDelegate const &delegate, ContextContainer const &contextContainer) : surfaceId_(surfaceId), delegate_(delegate) { - const auto noopEventEmitter = std::make_shared( - nullptr, -1, std::shared_ptr()); - static auto globalRootComponentDescriptor = std::make_unique( ComponentDescriptorParameters{ @@ -239,9 +236,8 @@ ShadowTree::ShadowTree( layoutConstraints, layoutContext); - auto const fragment = - ShadowNodeFamilyFragment{surfaceId, surfaceId, noopEventEmitter}; - auto family = globalRootComponentDescriptor->createFamily(fragment, nullptr); + auto const fragment = ShadowNodeFamilyFragment{surfaceId, surfaceId, nullptr}; + auto family = globalRootComponentDescriptor->createFamily(fragment); auto rootShadowNode = std::static_pointer_cast( globalRootComponentDescriptor->createShadowNode( diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/tests/MountingTest.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/tests/MountingTest.cpp index 75945738a5af8a..2ecd5413846d68 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/tests/MountingTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/tests/MountingTest.cpp @@ -53,7 +53,7 @@ static ShadowNode::Shared makeNode( return componentDescriptor.createShadowNode( ShadowNodeFragment{ props, std::make_shared(children)}, - componentDescriptor.createFamily({tag, SurfaceId(1), nullptr}, nullptr)); + componentDescriptor.createFamily({tag, SurfaceId(1), nullptr})); } /** @@ -79,8 +79,8 @@ TEST(MountingTest, testReorderingInstructionGeneration) { auto rootComponentDescriptor = RootComponentDescriptor(componentDescriptorParameters); - auto rootFamily = rootComponentDescriptor.createFamily( - {Tag(1), SurfaceId(1), nullptr}, nullptr); + auto rootFamily = + rootComponentDescriptor.createFamily({Tag(1), SurfaceId(1), nullptr}); // Creating an initial root shadow node. auto emptyRootNode = std::const_pointer_cast( @@ -110,8 +110,8 @@ TEST(MountingTest, testReorderingInstructionGeneration) { auto childJ = makeNode(viewComponentDescriptor, 109, {}); auto childK = makeNode(viewComponentDescriptor, 110, {}); - auto family = viewComponentDescriptor.createFamily( - {10, SurfaceId(1), nullptr}, nullptr); + auto family = + viewComponentDescriptor.createFamily({10, SurfaceId(1), nullptr}); // Construct "identical" shadow nodes: they differ only in children. auto shadowNodeV1 = viewComponentDescriptor.createShadowNode( @@ -390,8 +390,8 @@ TEST(MountingTest, testViewReparentingInstructionGeneration) { auto rootComponentDescriptor = RootComponentDescriptor(componentDescriptorParameters); - auto rootFamily = rootComponentDescriptor.createFamily( - {Tag(1), SurfaceId(1), nullptr}, nullptr); + auto rootFamily = + rootComponentDescriptor.createFamily({Tag(1), SurfaceId(1), nullptr}); // Creating an initial root shadow node. auto emptyRootNode = std::const_pointer_cast( @@ -422,8 +422,8 @@ TEST(MountingTest, testViewReparentingInstructionGeneration) { auto childJ = makeNode(viewComponentDescriptor, 109, {}); auto childK = makeNode(viewComponentDescriptor, 110, {}); - auto family = viewComponentDescriptor.createFamily( - {10, SurfaceId(1), nullptr}, nullptr); + auto family = + viewComponentDescriptor.createFamily({10, SurfaceId(1), nullptr}); auto reparentedViewA = makeNode( viewComponentDescriptor, diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp index 0e53a7ad9b70d8..02607035ad4e50 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp @@ -42,8 +42,6 @@ static void testShadowNodeTreeLifeCycle( ViewComponentDescriptor(componentDescriptorParameters); auto rootComponentDescriptor = RootComponentDescriptor(componentDescriptorParameters); - auto noopEventEmitter = - std::make_shared(nullptr, -1, eventDispatcher); PropsParserContext parserContext{-1, *contextContainer}; @@ -52,8 +50,8 @@ static void testShadowNodeTreeLifeCycle( for (int i = 0; i < repeats; i++) { allNodes.clear(); - auto family = rootComponentDescriptor.createFamily( - {Tag(1), SurfaceId(1), nullptr}, nullptr); + auto family = + rootComponentDescriptor.createFamily({Tag(1), SurfaceId(1), nullptr}); // Creating an initial root shadow node. auto emptyRootNode = std::const_pointer_cast( @@ -195,8 +193,6 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( ViewComponentDescriptor(componentDescriptorParameters); auto rootComponentDescriptor = RootComponentDescriptor(componentDescriptorParameters); - auto noopEventEmitter = - std::make_shared(nullptr, -1, eventDispatcher); PropsParserContext parserContext{-1, *contextContainer}; @@ -205,8 +201,8 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( for (int i = 0; i < repeats; i++) { allNodes.clear(); - auto family = rootComponentDescriptor.createFamily( - {Tag(1), SurfaceId(1), nullptr}, nullptr); + auto family = + rootComponentDescriptor.createFamily({Tag(1), SurfaceId(1), nullptr}); // Creating an initial root shadow node. auto emptyRootNode = std::const_pointer_cast( diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp index 291195057caf79..355a3a1dad82fb 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp @@ -68,7 +68,7 @@ ShadowNode::Shared UIManager::createNode( std::string const &name, SurfaceId surfaceId, const RawProps &rawProps, - SharedEventTarget eventTarget) const { + const InstanceHandle::Shared &instanceHandle) const { SystraceSection s("UIManager::createNode"); auto &componentDescriptor = componentDescriptorRegistry_->at(name); @@ -77,9 +77,9 @@ ShadowNode::Shared UIManager::createNode( PropsParserContext propsParserContext{surfaceId, *contextContainer_.get()}; - auto const fragment = ShadowNodeFamilyFragment{tag, surfaceId, nullptr}; - auto family = - componentDescriptor.createFamily(fragment, std::move(eventTarget)); + auto const fragment = + ShadowNodeFamilyFragment{tag, surfaceId, instanceHandle}; + auto family = componentDescriptor.createFamily(fragment); auto const props = componentDescriptor.cloneProps(propsParserContext, nullptr, rawProps); auto const state = componentDescriptor.createInitialState(props, family); diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.h b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.h index 97db13c7927742..31db46be2c0eee 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.h +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.h @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -134,7 +135,7 @@ class UIManager final : public ShadowTreeDelegate { std::string const &componentName, SurfaceId surfaceId, const RawProps &props, - SharedEventTarget eventTarget) const; + const InstanceHandle::Shared &instanceHandle) const; ShadowNode::Shared cloneNode( ShadowNode const &shadowNode, diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp index f9c0580a228553..54485334feb9ca 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp @@ -186,12 +186,13 @@ jsi::Value UIManagerBinding::get( jsi::Value const & /*thisValue*/, jsi::Value const *arguments, size_t /*count*/) noexcept -> jsi::Value { - auto eventTarget = - eventTargetFromValue(runtime, arguments[4], arguments[0]); - if (!eventTarget) { + auto instanceHandle = + instanceHandleFromValue(runtime, arguments[4], arguments[0]); + if (!instanceHandle) { react_native_assert(false); return jsi::Value::undefined(); } + return valueFromShadowNode( runtime, uiManager->createNode( @@ -199,7 +200,7 @@ jsi::Value UIManagerBinding::get( stringFromValue(runtime, arguments[1]), surfaceIdFromValue(runtime, arguments[2]), RawProps(runtime, arguments[3]), - eventTarget)); + instanceHandle)); }); } @@ -798,7 +799,7 @@ jsi::Value UIManagerBinding::get( return jsi::Value::null(); } - return getInstanceHandleFromShadowNode(parentShadowNode, runtime); + return (*parentShadowNode).getInstanceHandle(runtime); }); } @@ -1006,8 +1007,7 @@ jsi::Value UIManagerBinding::get( return jsi::Array::createWithElements( runtime, - getInstanceHandleFromShadowNode( - newestParentOfShadowNode, runtime), + (*newestParentOfShadowNode).getInstanceHandle(runtime), jsi::Value{runtime, (double)offsetTop}, jsi::Value{runtime, (double)offsetLeft}); }); diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/primitives.h b/packages/react-native/ReactCommon/react/renderer/uimanager/primitives.h index 6c4893dccf58f6..629a37b658934a 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/primitives.h +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/primitives.h @@ -142,16 +142,16 @@ inline static Tag tagFromValue(jsi::Value const &value) { return (Tag)value.getNumber(); } -inline static SharedEventTarget eventTargetFromValue( +inline static InstanceHandle::Shared instanceHandleFromValue( jsi::Runtime &runtime, - jsi::Value const &eventTargetValue, + jsi::Value const &instanceHandleValue, jsi::Value const &tagValue) { - react_native_assert(!eventTargetValue.isNull()); - if (eventTargetValue.isNull()) { + react_native_assert(!instanceHandleValue.isNull()); + if (instanceHandleValue.isNull()) { return nullptr; } - return std::make_shared( - runtime, eventTargetValue, tagFromValue(tagValue)); + return std::make_shared( + runtime, instanceHandleValue, tagFromValue(tagValue)); } inline static SurfaceId surfaceIdFromValue( @@ -185,21 +185,6 @@ inline static folly::dynamic commandArgsFromValue( return jsi::dynamicFromValue(runtime, value); } -inline static jsi::Value getInstanceHandleFromShadowNode( - ShadowNode::Shared shadowNode, - jsi::Runtime &runtime) { - auto eventTarget = shadowNode->getEventEmitter()->getEventTarget(); - // shadowNode is probably a RootShadowNode and they don't have - // event targets. - if (eventTarget == nullptr) { - return jsi::Value::null(); - } - eventTarget->retain(runtime); - auto instanceHandle = eventTarget->getInstanceHandle(runtime); - eventTarget->release(runtime); - return instanceHandle; -} - inline static jsi::Value getArrayOfInstanceHandlesFromShadowNodes( ShadowNode::ListOfShared const &nodes, jsi::Runtime &runtime) { @@ -209,7 +194,7 @@ inline static jsi::Value getArrayOfInstanceHandlesFromShadowNodes( std::vector nonNullInstanceHandles; nonNullInstanceHandles.reserve(nodes.size()); for (auto const &shadowNode : nodes) { - auto instanceHandle = getInstanceHandleFromShadowNode(shadowNode, runtime); + auto instanceHandle = (*shadowNode).getInstanceHandle(runtime); if (!instanceHandle.isNull()) { nonNullInstanceHandles.push_back(std::move(instanceHandle)); } diff --git a/packages/react-native/ReactCommon/react/test_utils/shadowTreeGeneration.h b/packages/react-native/ReactCommon/react/test_utils/shadowTreeGeneration.h index 65307403d8e649..da8aa09e1682bc 100644 --- a/packages/react-native/ReactCommon/react/test_utils/shadowTreeGeneration.h +++ b/packages/react-native/ReactCommon/react/test_utils/shadowTreeGeneration.h @@ -290,7 +290,7 @@ static inline ShadowNode::Shared generateShadowNodeTree( int deviation = 3) { if (size <= 1) { auto family = componentDescriptor.createFamily( - {generateReactTag(), SurfaceId(1), nullptr}, nullptr); + {generateReactTag(), SurfaceId(1), nullptr}); return componentDescriptor.createShadowNode( ShadowNodeFragment{generateDefaultProps(componentDescriptor)}, family); } @@ -306,7 +306,7 @@ static inline ShadowNode::Shared generateShadowNodeTree( } auto family = componentDescriptor.createFamily( - {generateReactTag(), SurfaceId(1), nullptr}, nullptr); + {generateReactTag(), SurfaceId(1), nullptr}); return componentDescriptor.createShadowNode( ShadowNodeFragment{ generateDefaultProps(componentDescriptor), From 942bd615d17a60c44792af7318d3e0838eceadc0 Mon Sep 17 00:00:00 2001 From: tarunrajput Date: Thu, 8 Jun 2023 14:39:28 -0700 Subject: [PATCH 084/468] extract buildPropertiesForEvent to parsers-commons (#37714) Summary: ## Changelog: Part of https://github.com/facebook/react-native/issues/34872 > Extract buildPropertiesForEvent into parsers-commons.js file. Use the code from either [Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/events.js#L258-L272) or [TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/events.js#L277-L288) which now should be equal. Delete the original ones and use the newly created method instead of those. [Internal][Changed]: Extract buildPropertiesForEvent and update callsites Pull Request resolved: https://github.com/facebook/react-native/pull/37714 Test Plan: `yarn test` Reviewed By: cipolleschi Differential Revision: D46514046 Pulled By: rshest fbshipit-source-id: 120e9a09180735f8eeb0419b16eac566d5dcc6ba --- .../src/parsers/flow/components/events.js | 26 ++++++----------- .../src/parsers/parsers-commons.js | 28 ++++++++++++++++--- .../parsers/typescript/components/events.js | 26 ++++++----------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/packages/react-native-codegen/src/parsers/flow/components/events.js b/packages/react-native-codegen/src/parsers/flow/components/events.js index 71c865dce29d12..78321272efb22c 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/events.js +++ b/packages/react-native-codegen/src/parsers/flow/components/events.js @@ -22,7 +22,10 @@ const { throwIfBubblingTypeIsNull, throwIfArgumentPropsAreNull, } = require('../../error-utils'); -const {getEventArgument} = require('../../parsers-commons'); +const { + getEventArgument, + buildPropertiesForEvent, +} = require('../../parsers-commons'); const { emitBoolProp, emitDoubleProp, @@ -67,7 +70,7 @@ function getPropertyType( typeAnnotation: { type: 'ObjectTypeAnnotation', properties: typeAnnotation.properties.map(member => - buildPropertiesForEvent(member, parser), + buildPropertiesForEvent(member, parser, getPropertyType), ), }, }; @@ -126,7 +129,7 @@ function extractArrayElementType( return { type: 'ObjectTypeAnnotation', properties: typeAnnotation.properties.map(member => - buildPropertiesForEvent(member, parser), + buildPropertiesForEvent(member, parser, getPropertyType), ), }; case 'ArrayTypeAnnotation': @@ -229,19 +232,6 @@ function findEventArgumentsAndType( } } -function buildPropertiesForEvent( - /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's - * LTI update could not be added via codemod */ - property, - parser: Parser, -): NamedShape { - const name = property.key.name; - const optional = parser.isOptionalProperty(property); - const typeAnnotation = parser.getTypeAnnotationFromProperty(property); - - return getPropertyType(name, optional, typeAnnotation, parser); -} - function buildEventSchema( types: TypeMap, property: EventTypeAST, @@ -283,8 +273,8 @@ function buildEventSchema( type: 'EventTypeAnnotation', argument: getEventArgument( nonNullableArgumentProps, - buildPropertiesForEvent, parser, + getPropertyType, ), }, }; @@ -298,8 +288,8 @@ function buildEventSchema( type: 'EventTypeAnnotation', argument: getEventArgument( nonNullableArgumentProps, - buildPropertiesForEvent, parser, + getPropertyType, ), }, }; diff --git a/packages/react-native-codegen/src/parsers/parsers-commons.js b/packages/react-native-codegen/src/parsers/parsers-commons.js index 41f135329425ed..9629c5121d371b 100644 --- a/packages/react-native-codegen/src/parsers/parsers-commons.js +++ b/packages/react-native-codegen/src/parsers/parsers-commons.js @@ -894,16 +894,18 @@ function buildPropSchema( * LTI update could not be added via codemod */ function getEventArgument( argumentProps: PropAST, - buildPropertiesForEvent: ( - property: PropAST, + parser: Parser, + getPropertyType: ( + name: $FlowFixMe, + optional: boolean, + typeAnnotation: $FlowFixMe, parser: Parser, ) => NamedShape, - parser: Parser, ): ObjectTypeAnnotation { return { type: 'ObjectTypeAnnotation', properties: argumentProps.map(member => - buildPropertiesForEvent(member, parser), + buildPropertiesForEvent(member, parser, getPropertyType), ), }; } @@ -1053,6 +1055,23 @@ function handleGenericTypeAnnotation( }; } +function buildPropertiesForEvent( + property: $FlowFixMe, + parser: Parser, + getPropertyType: ( + name: $FlowFixMe, + optional: boolean, + typeAnnotation: $FlowFixMe, + parser: Parser, + ) => NamedShape, +): NamedShape { + const name = property.key.name; + const optional = parser.isOptionalProperty(property); + const typeAnnotation = parser.getTypeAnnotationFromProperty(property); + + return getPropertyType(name, optional, typeAnnotation, parser); +} + module.exports = { wrapModuleSchema, unwrapNullable, @@ -1079,4 +1098,5 @@ module.exports = { getCommandProperties, handleGenericTypeAnnotation, getTypeResolutionStatus, + buildPropertiesForEvent, }; diff --git a/packages/react-native-codegen/src/parsers/typescript/components/events.js b/packages/react-native-codegen/src/parsers/typescript/components/events.js index 5d12804238e1b1..fc0bc5530ae4de 100644 --- a/packages/react-native-codegen/src/parsers/typescript/components/events.js +++ b/packages/react-native-codegen/src/parsers/typescript/components/events.js @@ -24,7 +24,10 @@ const { throwIfBubblingTypeIsNull, throwIfArgumentPropsAreNull, } = require('../../error-utils'); -const {getEventArgument} = require('../../parsers-commons'); +const { + getEventArgument, + buildPropertiesForEvent, +} = require('../../parsers-commons'); const { emitBoolProp, emitDoubleProp, @@ -69,7 +72,7 @@ function getPropertyType( typeAnnotation: { type: 'ObjectTypeAnnotation', properties: typeAnnotation.members.map(member => - buildPropertiesForEvent(member, parser), + buildPropertiesForEvent(member, parser, getPropertyType), ), }, }; @@ -136,7 +139,7 @@ function extractArrayElementType( return { type: 'ObjectTypeAnnotation', properties: typeAnnotation.members.map(member => - buildPropertiesForEvent(member, parser), + buildPropertiesForEvent(member, parser, getPropertyType), ), }; case 'TSArrayType': @@ -247,19 +250,6 @@ function findEventArgumentsAndType( } } -function buildPropertiesForEvent( - /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's - * LTI update could not be added via codemod */ - property, - parser: Parser, -): NamedShape { - const name = property.key.name; - const optional = parser.isOptionalProperty(property); - const typeAnnotation = parser.getTypeAnnotationFromProperty(property); - - return getPropertyType(name, optional, typeAnnotation, parser); -} - // $FlowFixMe[unclear-type] TODO(T108222691): Use flow-types for @babel/parser type EventTypeAST = Object; @@ -296,8 +286,8 @@ function buildEventSchema( type: 'EventTypeAnnotation', argument: getEventArgument( nonNullableArgumentProps, - buildPropertiesForEvent, parser, + getPropertyType, ), }, }; @@ -311,8 +301,8 @@ function buildEventSchema( type: 'EventTypeAnnotation', argument: getEventArgument( nonNullableArgumentProps, - buildPropertiesForEvent, parser, + getPropertyType, ), }, }; From 67eb4946e3ce92824aa923dd84cb9584d429e56d Mon Sep 17 00:00:00 2001 From: Randall71 <51382079+Randall71@users.noreply.github.com> Date: Thu, 8 Jun 2023 14:58:15 -0700 Subject: [PATCH 085/468] (codegen 133) - Parser extractTypeFromTypeAnnotation (#37752) Summary: > [Codegen 133 - Assigned to Randall71] Create an extractTypeFromTypeAnnotation(typeAnnotation) function in the Parser base class. Implement it using [this code for Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/events.js#L193-L197) and [this code for TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/events.js#L189-L193). Replace the invocation of that function with the one from the parser This is part of https://github.com/facebook/react-native/issues/34872 ## Changelog: + Darbojas %1$s From 96225cec2b94caf6a668ab9805d03788f5b5fca5 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 8 Jun 2023 15:53:10 -0700 Subject: [PATCH 087/468] Rename FrameMetrics to CellMetrics (#37778) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37778 These functions describe how to get the metrics of a specific cell. "Frame" here seems non-descriptive and redundant to the "Metrics" part. Renaming this before a larger refactor. Changelog: [Internal] Reviewed By: philIip Differential Revision: D46427058 fbshipit-source-id: e9ad9cf15e1adfd07604eb11526de0ed8cf99000 --- .../virtualized-lists/Lists/FillRateHelper.js | 20 +-- .../Lists/ViewabilityHelper.js | 26 ++-- .../Lists/VirtualizeUtils.js | 20 +-- .../Lists/VirtualizedList.js | 60 ++++----- .../Lists/VirtualizedListProps.js | 2 +- .../Lists/VirtualizedSectionList.js | 2 +- .../Lists/__tests__/FillRateHelper-test.js | 12 +- .../Lists/__tests__/ViewabilityHelper-test.js | 124 +++++++++--------- .../Lists/__tests__/VirtualizeUtils-test.js | 8 +- 9 files changed, 134 insertions(+), 140 deletions(-) diff --git a/packages/virtualized-lists/Lists/FillRateHelper.js b/packages/virtualized-lists/Lists/FillRateHelper.js index 87482e73f6be3e..aa4a331741c4c5 100644 --- a/packages/virtualized-lists/Lists/FillRateHelper.js +++ b/packages/virtualized-lists/Lists/FillRateHelper.js @@ -10,7 +10,7 @@ 'use strict'; -import type {FrameMetricProps} from './VirtualizedListProps'; +import type {CellMetricProps} from './VirtualizedListProps'; export type FillRateInfo = Info; @@ -27,7 +27,7 @@ class Info { sample_count: number = 0; } -type FrameMetrics = { +type CellMetrics = { inLayout?: boolean, length: number, offset: number, @@ -51,7 +51,7 @@ let _sampleRate = DEBUG ? 1 : null; class FillRateHelper { _anyBlankStartTime: ?number = null; _enabled = false; - _getFrameMetrics: (index: number, props: FrameMetricProps) => ?FrameMetrics; + _getCellMetrics: (index: number, props: CellMetricProps) => ?CellMetrics; _info: Info = new Info(); _mostlyBlankStartTime: ?number = null; _samplesStartTime: ?number = null; @@ -80,9 +80,9 @@ class FillRateHelper { } constructor( - getFrameMetrics: (index: number, props: FrameMetricProps) => ?FrameMetrics, + getCellMetrics: (index: number, props: CellMetricProps) => ?CellMetrics, ) { - this._getFrameMetrics = getFrameMetrics; + this._getCellMetrics = getCellMetrics; this._enabled = (_sampleRate || 0) > Math.random(); this._resetData(); } @@ -139,7 +139,7 @@ class FillRateHelper { computeBlankness( props: { - ...FrameMetricProps, + ...CellMetricProps, initialNumToRender?: ?number, ... }, @@ -186,12 +186,12 @@ class FillRateHelper { let blankTop = 0; let first = cellsAroundViewport.first; - let firstFrame = this._getFrameMetrics(first, props); + let firstFrame = this._getCellMetrics(first, props); while ( first <= cellsAroundViewport.last && (!firstFrame || !firstFrame.inLayout) ) { - firstFrame = this._getFrameMetrics(first, props); + firstFrame = this._getCellMetrics(first, props); first++; } // Only count blankTop if we aren't rendering the first item, otherwise we will count the header @@ -204,12 +204,12 @@ class FillRateHelper { } let blankBottom = 0; let last = cellsAroundViewport.last; - let lastFrame = this._getFrameMetrics(last, props); + let lastFrame = this._getCellMetrics(last, props); while ( last >= cellsAroundViewport.first && (!lastFrame || !lastFrame.inLayout) ) { - lastFrame = this._getFrameMetrics(last, props); + lastFrame = this._getCellMetrics(last, props); last--; } // Only count blankBottom if we aren't rendering the last item, otherwise we will count the diff --git a/packages/virtualized-lists/Lists/ViewabilityHelper.js b/packages/virtualized-lists/Lists/ViewabilityHelper.js index 33a9811825affd..d0d1a5f82502fc 100644 --- a/packages/virtualized-lists/Lists/ViewabilityHelper.js +++ b/packages/virtualized-lists/Lists/ViewabilityHelper.js @@ -10,7 +10,7 @@ 'use strict'; -import type {FrameMetricProps} from './VirtualizedListProps'; +import type {CellMetricProps} from './VirtualizedListProps'; const invariant = require('invariant'); @@ -101,12 +101,12 @@ class ViewabilityHelper { * Determines which items are viewable based on the current metrics and config. */ computeViewableItems( - props: FrameMetricProps, + props: CellMetricProps, scrollOffset: number, viewportHeight: number, - getFrameMetrics: ( + getCellMetrics: ( index: number, - props: FrameMetricProps, + props: CellMetricProps, ) => ?{ length: number, offset: number, @@ -146,7 +146,7 @@ class ViewabilityHelper { return []; } for (let idx = first; idx <= last; idx++) { - const metrics = getFrameMetrics(idx, props); + const metrics = getCellMetrics(idx, props); if (!metrics) { continue; } @@ -178,12 +178,12 @@ class ViewabilityHelper { * `onViewableItemsChanged` as appropriate. */ onUpdate( - props: FrameMetricProps, + props: CellMetricProps, scrollOffset: number, viewportHeight: number, - getFrameMetrics: ( + getCellMetrics: ( index: number, - props: FrameMetricProps, + props: CellMetricProps, ) => ?{ length: number, offset: number, @@ -192,7 +192,7 @@ class ViewabilityHelper { createViewToken: ( index: number, isViewable: boolean, - props: FrameMetricProps, + props: CellMetricProps, ) => ViewToken, onViewableItemsChanged: ({ viewableItems: Array, @@ -210,7 +210,7 @@ class ViewabilityHelper { if ( (this._config.waitForInteraction && !this._hasInteracted) || itemCount === 0 || - !getFrameMetrics(0, props) + !getCellMetrics(0, props) ) { return; } @@ -220,7 +220,7 @@ class ViewabilityHelper { props, scrollOffset, viewportHeight, - getFrameMetrics, + getCellMetrics, renderRange, ); } @@ -275,7 +275,7 @@ class ViewabilityHelper { } _onUpdateSync( - props: FrameMetricProps, + props: CellMetricProps, viewableIndicesToCheck: Array, onViewableItemsChanged: ({ changed: Array, @@ -285,7 +285,7 @@ class ViewabilityHelper { createViewToken: ( index: number, isViewable: boolean, - props: FrameMetricProps, + props: CellMetricProps, ) => ViewToken, ) { // Filter out indices that have gone out of view since this call was scheduled. diff --git a/packages/virtualized-lists/Lists/VirtualizeUtils.js b/packages/virtualized-lists/Lists/VirtualizeUtils.js index 3a70d9f683091e..36295aa0deb50b 100644 --- a/packages/virtualized-lists/Lists/VirtualizeUtils.js +++ b/packages/virtualized-lists/Lists/VirtualizeUtils.js @@ -10,7 +10,7 @@ 'use strict'; -import type {FrameMetricProps} from './VirtualizedListProps'; +import type {CellMetricProps} from './VirtualizedListProps'; /** * Used to find the indices of the frames that overlap the given offsets. Useful for finding the @@ -19,10 +19,10 @@ import type {FrameMetricProps} from './VirtualizedListProps'; */ export function elementsThatOverlapOffsets( offsets: Array, - props: FrameMetricProps, - getFrameMetrics: ( + props: CellMetricProps, + getCellMetrics: ( index: number, - props: FrameMetricProps, + props: CellMetricProps, ) => { length: number, offset: number, @@ -40,7 +40,7 @@ export function elementsThatOverlapOffsets( while (left <= right) { // eslint-disable-next-line no-bitwise const mid = left + ((right - left) >>> 1); - const frame = getFrameMetrics(mid, props); + const frame = getCellMetrics(mid, props); const scaledOffsetStart = frame.offset * zoomScale; const scaledOffsetEnd = (frame.offset + frame.length) * zoomScale; @@ -99,16 +99,16 @@ export function newRangeCount( * biased in the direction of scroll. */ export function computeWindowedRenderLimits( - props: FrameMetricProps, + props: CellMetricProps, maxToRenderPerBatch: number, windowSize: number, prev: { first: number, last: number, }, - getFrameMetricsApprox: ( + getCellMetricsApprox: ( index: number, - props: FrameMetricProps, + props: CellMetricProps, ) => { length: number, offset: number, @@ -152,7 +152,7 @@ export function computeWindowedRenderLimits( const overscanEnd = Math.max(0, visibleEnd + leadFactor * overscanLength); const lastItemOffset = - getFrameMetricsApprox(itemCount - 1, props).offset * zoomScale; + getCellMetricsApprox(itemCount - 1, props).offset * zoomScale; if (lastItemOffset < overscanBegin) { // Entire list is before our overscan window return { @@ -165,7 +165,7 @@ export function computeWindowedRenderLimits( let [overscanFirst, first, last, overscanLast] = elementsThatOverlapOffsets( [overscanBegin, visibleBegin, visibleEnd, overscanEnd], props, - getFrameMetricsApprox, + getCellMetricsApprox, zoomScale, ); overscanFirst = overscanFirst == null ? 0 : overscanFirst; diff --git a/packages/virtualized-lists/Lists/VirtualizedList.js b/packages/virtualized-lists/Lists/VirtualizedList.js index 8a23e81cbef1a6..efc98eaf9e9172 100644 --- a/packages/virtualized-lists/Lists/VirtualizedList.js +++ b/packages/virtualized-lists/Lists/VirtualizedList.js @@ -16,7 +16,7 @@ import type { } from 'react-native/Libraries/Types/CoreEventTypes'; import type {ViewToken} from './ViewabilityHelper'; import type { - FrameMetricProps, + CellMetricProps, Item, Props, RenderItemProps, @@ -176,7 +176,7 @@ class VirtualizedList extends StateSafePureComponent { if (veryLast < 0) { return; } - const frame = this.__getFrameMetricsApprox(veryLast, this.props); + const frame = this.__getCellMetricsApprox(veryLast, this.props); const offset = Math.max( 0, frame.offset + @@ -250,7 +250,7 @@ class VirtualizedList extends StateSafePureComponent { }); return; } - const frame = this.__getFrameMetricsApprox(Math.floor(index), this.props); + const frame = this.__getCellMetricsApprox(Math.floor(index), this.props); const offset = Math.max( 0, @@ -427,7 +427,7 @@ class VirtualizedList extends StateSafePureComponent { super(props); this._checkProps(props); - this._fillRateHelper = new FillRateHelper(this._getFrameMetrics); + this._fillRateHelper = new FillRateHelper(this._getCellMetrics); this._updateCellsToRenderBatcher = new Batchinator( this._updateCellsToRender, this.props.updateCellsBatchingPeriod ?? 50, @@ -683,7 +683,7 @@ class VirtualizedList extends StateSafePureComponent { maxToRenderPerBatchOrDefault(props.maxToRenderPerBatch), windowSizeOrDefault(props.windowSize), cellsAroundViewport, - this.__getFrameMetricsApprox, + this.__getCellMetricsApprox, this._scrollMetrics, ); invariant( @@ -1041,11 +1041,11 @@ class VirtualizedList extends StateSafePureComponent { ) : section.last; - const firstMetrics = this.__getFrameMetricsApprox( + const firstMetrics = this.__getCellMetricsApprox( section.first, this.props, ); - const lastMetrics = this.__getFrameMetricsApprox(last, this.props); + const lastMetrics = this.__getCellMetricsApprox(last, this.props); const spacerSize = lastMetrics.offset + lastMetrics.length - firstMetrics.offset; cells.push( @@ -1467,7 +1467,7 @@ class VirtualizedList extends StateSafePureComponent { const framesInLayout = []; const itemCount = this.props.getItemCount(this.props.data); for (let ii = 0; ii < itemCount; ii++) { - const frame = this.__getFrameMetricsApprox(ii, this.props); + const frame = this.__getCellMetricsApprox(ii, this.props); /* $FlowFixMe[prop-missing] (>=0.68.0 site=react_native_fb) This comment * suppresses an error found when Flow v0.68 was deployed. To see the * error delete this comment and run Flow. */ @@ -1475,11 +1475,11 @@ class VirtualizedList extends StateSafePureComponent { framesInLayout.push(frame); } } - const windowTop = this.__getFrameMetricsApprox( + const windowTop = this.__getCellMetricsApprox( this.state.cellsAroundViewport.first, this.props, ).offset; - const frameLast = this.__getFrameMetricsApprox( + const frameLast = this.__getCellMetricsApprox( this.state.cellsAroundViewport.last, this.props, ); @@ -1774,7 +1774,7 @@ class VirtualizedList extends StateSafePureComponent { // But only if there are items before the first rendered item if (first > 0) { const distTop = - offset - this.__getFrameMetricsApprox(first, this.props).offset; + offset - this.__getCellMetricsApprox(first, this.props).offset; hiPri = distTop < 0 || (velocity < -2 && @@ -1785,7 +1785,7 @@ class VirtualizedList extends StateSafePureComponent { // But only if there are items after the last rendered item if (!hiPri && last >= 0 && last < itemCount - 1) { const distBottom = - this.__getFrameMetricsApprox(last, this.props).offset - + this.__getCellMetricsApprox(last, this.props).offset - (offset + visibleLength); hiPri = distBottom < 0 || @@ -1885,7 +1885,7 @@ class VirtualizedList extends StateSafePureComponent { _createViewToken = ( index: number, isViewable: boolean, - props: FrameMetricProps, + props: CellMetricProps, // $FlowFixMe[missing-local-annot] ) => { const {data, getItem} = props; @@ -1902,28 +1902,25 @@ class VirtualizedList extends StateSafePureComponent { * Gets an approximate offset to an item at a given index. Supports * fractional indices. */ - _getOffsetApprox = (index: number, props: FrameMetricProps): number => { + _getOffsetApprox = (index: number, props: CellMetricProps): number => { if (Number.isInteger(index)) { - return this.__getFrameMetricsApprox(index, props).offset; + return this.__getCellMetricsApprox(index, props).offset; } else { - const frameMetrics = this.__getFrameMetricsApprox( - Math.floor(index), - props, - ); + const CellMetrics = this.__getCellMetricsApprox(Math.floor(index), props); const remainder = index - Math.floor(index); - return frameMetrics.offset + remainder * frameMetrics.length; + return CellMetrics.offset + remainder * CellMetrics.length; } }; - __getFrameMetricsApprox: ( + __getCellMetricsApprox: ( index: number, - props: FrameMetricProps, + props: CellMetricProps, ) => { length: number, offset: number, ... } = (index, props) => { - const frame = this._getFrameMetrics(index, props); + const frame = this._getCellMetrics(index, props); if (frame && frame.index === index) { // check for invalid frames due to row re-ordering return frame; @@ -1944,9 +1941,9 @@ class VirtualizedList extends StateSafePureComponent { } }; - _getFrameMetrics = ( + _getCellMetrics = ( index: number, - props: FrameMetricProps, + props: CellMetricProps, ): ?{ length: number, offset: number, @@ -1972,7 +1969,7 @@ class VirtualizedList extends StateSafePureComponent { }; _getNonViewportRenderRegions = ( - props: FrameMetricProps, + props: CellMetricProps, ): $ReadOnlyArray<{ first: number, last: number, @@ -2008,7 +2005,7 @@ class VirtualizedList extends StateSafePureComponent { i-- ) { first--; - heightOfCellsBeforeFocused += this.__getFrameMetricsApprox( + heightOfCellsBeforeFocused += this.__getCellMetricsApprox( i, props, ).length; @@ -2023,17 +2020,14 @@ class VirtualizedList extends StateSafePureComponent { i++ ) { last++; - heightOfCellsAfterFocused += this.__getFrameMetricsApprox( - i, - props, - ).length; + heightOfCellsAfterFocused += this.__getCellMetricsApprox(i, props).length; } return [{first, last}]; }; _updateViewableItems( - props: FrameMetricProps, + props: CellMetricProps, cellsAroundViewport: {first: number, last: number}, ) { // If we have any pending scroll updates it means that the scroll metrics @@ -2046,7 +2040,7 @@ class VirtualizedList extends StateSafePureComponent { props, this._scrollMetrics.offset, this._scrollMetrics.visibleLength, - this._getFrameMetrics, + this._getCellMetrics, this._createViewToken, tuple.onViewableItemsChanged, cellsAroundViewport, diff --git a/packages/virtualized-lists/Lists/VirtualizedListProps.js b/packages/virtualized-lists/Lists/VirtualizedListProps.js index 3e196a9a9bac6a..1988ef753bb508 100644 --- a/packages/virtualized-lists/Lists/VirtualizedListProps.js +++ b/packages/virtualized-lists/Lists/VirtualizedListProps.js @@ -296,7 +296,7 @@ export type Props = {| /** * Subset of properties needed to calculate frame metrics */ -export type FrameMetricProps = { +export type CellMetricProps = { data: RequiredProps['data'], getItemCount: RequiredProps['getItemCount'], getItem: RequiredProps['getItem'], diff --git a/packages/virtualized-lists/Lists/VirtualizedSectionList.js b/packages/virtualized-lists/Lists/VirtualizedSectionList.js index d217bcde8c5259..b5bbd84597e88f 100644 --- a/packages/virtualized-lists/Lists/VirtualizedSectionList.js +++ b/packages/virtualized-lists/Lists/VirtualizedSectionList.js @@ -139,7 +139,7 @@ class VirtualizedSectionList< return; } if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) { - const frame = this._listRef.__getFrameMetricsApprox( + const frame = this._listRef.__getCellMetricsApprox( index - params.itemIndex, this._listRef.props, ); diff --git a/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js b/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js index c74915a20ee547..3f29f3fff849b4 100644 --- a/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js +++ b/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js @@ -21,7 +21,7 @@ const dataGlobal = [ {key: 'd'}, {key: 'footer'}, ]; -function getFrameMetrics(index: number) { +function getCellMetrics(index: number) { const frame = rowFramesGlobal[dataGlobal[index].key]; return {length: frame.height, offset: frame.y, inLayout: frame.inLayout}; } @@ -47,7 +47,7 @@ describe('computeBlankness', function () { }); it('computes correct blankness of viewport', function () { - const helper = new FillRateHelper(getFrameMetrics); + const helper = new FillRateHelper(getCellMetrics); rowFramesGlobal = { header: {y: 0, height: 0, inLayout: true}, a: {y: 0, height: 50, inLayout: true}, @@ -66,7 +66,7 @@ describe('computeBlankness', function () { }); it('skips frames that are not in layout', function () { - const helper = new FillRateHelper(getFrameMetrics); + const helper = new FillRateHelper(getCellMetrics); rowFramesGlobal = { header: {y: 0, height: 0, inLayout: false}, a: {y: 0, height: 10, inLayout: false}, @@ -80,7 +80,7 @@ describe('computeBlankness', function () { }); it('sampling rate can disable', function () { - let helper = new FillRateHelper(getFrameMetrics); + let helper = new FillRateHelper(getCellMetrics); rowFramesGlobal = { header: {y: 0, height: 0, inLayout: true}, a: {y: 0, height: 40, inLayout: true}, @@ -91,7 +91,7 @@ describe('computeBlankness', function () { FillRateHelper.setSampleRate(0); - helper = new FillRateHelper(getFrameMetrics); + helper = new FillRateHelper(getCellMetrics); blankness = computeResult({helper}); expect(blankness).toBe(0); }); @@ -102,7 +102,7 @@ describe('computeBlankness', function () { FillRateHelper.addListener(listener), ); subscriptions[1].remove(); - const helper = new FillRateHelper(getFrameMetrics); + const helper = new FillRateHelper(getCellMetrics); rowFramesGlobal = { header: {y: 0, height: 0, inLayout: true}, a: {y: 0, height: 40, inLayout: true}, diff --git a/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js b/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js index 1d755eac39b8a5..2737c2a298423e 100644 --- a/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js +++ b/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js @@ -18,7 +18,7 @@ const props = { data, getItemCount: () => data.length, }; -function getFrameMetrics(index: number) { +function getCellMetrics(index: number) { const frame = rowFrames[data[index].key]; return {length: frame.height, offset: frame.y}; } @@ -38,9 +38,9 @@ describe('computeViewableItems', function () { d: {y: 150, height: 50}, }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; - expect(helper.computeViewableItems(props, 0, 200, getFrameMetrics)).toEqual( - [0, 1, 2, 3], - ); + expect(helper.computeViewableItems(props, 0, 200, getCellMetrics)).toEqual([ + 0, 1, 2, 3, + ]); }); it('returns top 2 rows as viewable (1. entirely visible and 2. majority)', function () { @@ -54,9 +54,9 @@ describe('computeViewableItems', function () { d: {y: 250, height: 50}, }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; - expect(helper.computeViewableItems(props, 0, 200, getFrameMetrics)).toEqual( - [0, 1], - ); + expect(helper.computeViewableItems(props, 0, 200, getCellMetrics)).toEqual([ + 0, 1, + ]); }); it('returns only 2nd row as viewable (majority)', function () { @@ -70,9 +70,9 @@ describe('computeViewableItems', function () { d: {y: 250, height: 50}, }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; - expect( - helper.computeViewableItems(props, 25, 200, getFrameMetrics), - ).toEqual([1]); + expect(helper.computeViewableItems(props, 25, 200, getCellMetrics)).toEqual( + [1], + ); }); it('handles empty input', function () { @@ -81,7 +81,7 @@ describe('computeViewableItems', function () { }); rowFrames = {}; data = []; - expect(helper.computeViewableItems(props, 0, 200, getFrameMetrics)).toEqual( + expect(helper.computeViewableItems(props, 0, 200, getCellMetrics)).toEqual( [], ); }); @@ -96,40 +96,40 @@ describe('computeViewableItems', function () { data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; let helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 0}); - expect(helper.computeViewableItems(props, 0, 50, getFrameMetrics)).toEqual([ + expect(helper.computeViewableItems(props, 0, 50, getCellMetrics)).toEqual([ 0, ]); - expect(helper.computeViewableItems(props, 1, 50, getFrameMetrics)).toEqual([ + expect(helper.computeViewableItems(props, 1, 50, getCellMetrics)).toEqual([ 0, 1, ]); - expect( - helper.computeViewableItems(props, 199, 50, getFrameMetrics), - ).toEqual([1, 2]); - expect( - helper.computeViewableItems(props, 250, 50, getFrameMetrics), - ).toEqual([2]); - - helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 100}); - expect(helper.computeViewableItems(props, 0, 200, getFrameMetrics)).toEqual( - [0, 1], + expect(helper.computeViewableItems(props, 199, 50, getCellMetrics)).toEqual( + [1, 2], ); - expect(helper.computeViewableItems(props, 1, 200, getFrameMetrics)).toEqual( - [1], + expect(helper.computeViewableItems(props, 250, 50, getCellMetrics)).toEqual( + [2], ); + + helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 100}); + expect(helper.computeViewableItems(props, 0, 200, getCellMetrics)).toEqual([ + 0, 1, + ]); + expect(helper.computeViewableItems(props, 1, 200, getCellMetrics)).toEqual([ + 1, + ]); expect( - helper.computeViewableItems(props, 400, 200, getFrameMetrics), + helper.computeViewableItems(props, 400, 200, getCellMetrics), ).toEqual([2]); expect( - helper.computeViewableItems(props, 600, 200, getFrameMetrics), + helper.computeViewableItems(props, 600, 200, getCellMetrics), ).toEqual([3]); helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 10}); - expect( - helper.computeViewableItems(props, 30, 200, getFrameMetrics), - ).toEqual([0, 1, 2]); - expect( - helper.computeViewableItems(props, 31, 200, getFrameMetrics), - ).toEqual([1, 2]); + expect(helper.computeViewableItems(props, 30, 200, getCellMetrics)).toEqual( + [0, 1, 2], + ); + expect(helper.computeViewableItems(props, 31, 200, getCellMetrics)).toEqual( + [1, 2], + ); }); it('handles different item visible percent thresholds', function () { @@ -141,31 +141,31 @@ describe('computeViewableItems', function () { }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; let helper = new ViewabilityHelper({itemVisiblePercentThreshold: 0}); - expect(helper.computeViewableItems(props, 0, 50, getFrameMetrics)).toEqual([ + expect(helper.computeViewableItems(props, 0, 50, getCellMetrics)).toEqual([ 0, ]); - expect(helper.computeViewableItems(props, 1, 50, getFrameMetrics)).toEqual([ + expect(helper.computeViewableItems(props, 1, 50, getCellMetrics)).toEqual([ 0, 1, ]); helper = new ViewabilityHelper({itemVisiblePercentThreshold: 100}); - expect(helper.computeViewableItems(props, 0, 250, getFrameMetrics)).toEqual( - [0, 1, 2], + expect(helper.computeViewableItems(props, 0, 250, getCellMetrics)).toEqual([ + 0, 1, 2, + ]); + expect(helper.computeViewableItems(props, 1, 250, getCellMetrics)).toEqual([ + 1, 2, + ]); + + helper = new ViewabilityHelper({itemVisiblePercentThreshold: 10}); + expect(helper.computeViewableItems(props, 184, 20, getCellMetrics)).toEqual( + [1], ); - expect(helper.computeViewableItems(props, 1, 250, getFrameMetrics)).toEqual( + expect(helper.computeViewableItems(props, 185, 20, getCellMetrics)).toEqual( [1, 2], ); - - helper = new ViewabilityHelper({itemVisiblePercentThreshold: 10}); - expect( - helper.computeViewableItems(props, 184, 20, getFrameMetrics), - ).toEqual([1]); - expect( - helper.computeViewableItems(props, 185, 20, getFrameMetrics), - ).toEqual([1, 2]); - expect( - helper.computeViewableItems(props, 186, 20, getFrameMetrics), - ).toEqual([2]); + expect(helper.computeViewableItems(props, 186, 20, getCellMetrics)).toEqual( + [2], + ); }); }); @@ -181,7 +181,7 @@ describe('onUpdate', function () { props, 0, 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -195,7 +195,7 @@ describe('onUpdate', function () { props, 0, 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -204,7 +204,7 @@ describe('onUpdate', function () { props, 100, 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -228,7 +228,7 @@ describe('onUpdate', function () { props, 0, 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -242,7 +242,7 @@ describe('onUpdate', function () { props, 100, 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -260,7 +260,7 @@ describe('onUpdate', function () { props, 200, 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -287,7 +287,7 @@ describe('onUpdate', function () { props, 0, 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -321,7 +321,7 @@ describe('onUpdate', function () { props, 0, 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -329,7 +329,7 @@ describe('onUpdate', function () { props, 300, // scroll past item 'a' 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -362,7 +362,7 @@ describe('onUpdate', function () { props, 0, 100, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -374,7 +374,7 @@ describe('onUpdate', function () { props, 20, 100, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -401,7 +401,7 @@ describe('onUpdate', function () { props, 0, 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); @@ -426,7 +426,7 @@ describe('onUpdate', function () { props, 0, 200, - getFrameMetrics, + getCellMetrics, createViewToken, onViewableItemsChanged, ); diff --git a/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js b/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js index 29f169eb63048f..da59c0764a8a65 100644 --- a/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js +++ b/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js @@ -42,14 +42,14 @@ describe('newRangeCount', function () { describe('elementsThatOverlapOffsets', function () { it('handles fixed length', function () { const offsets = [0, 250, 350, 450]; - function getFrameMetrics(index: number) { + function getCellMetrics(index: number) { return { length: 100, offset: 100 * index, }; } expect( - elementsThatOverlapOffsets(offsets, fakeProps(100), getFrameMetrics, 1), + elementsThatOverlapOffsets(offsets, fakeProps(100), getCellMetrics, 1), ).toEqual([0, 2, 3, 4]); }); it('handles variable length', function () { @@ -72,14 +72,14 @@ describe('elementsThatOverlapOffsets', function () { }); it('handles frame boundaries', function () { const offsets = [0, 100, 200, 300]; - function getFrameMetrics(index: number) { + function getCellMetrics(index: number) { return { length: 100, offset: 100 * index, }; } expect( - elementsThatOverlapOffsets(offsets, fakeProps(100), getFrameMetrics, 1), + elementsThatOverlapOffsets(offsets, fakeProps(100), getCellMetrics, 1), ).toEqual([0, 0, 1, 2]); }); it('handles out of bounds', function () { From 8f7f0bf2a39d86dbbde1a57ad4b1459c70d9350e Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 8 Jun 2023 15:53:10 -0700 Subject: [PATCH 088/468] Extract logic to CellMetricsAggregator (#37777) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37777 This extracts the state and logic VirtualizedList uses to query information related to cell metrics. We will need to modify this (and other places) when fixing up RTL support for horizontal FlatList. Changelog: [Internal] Reviewed By: javache Differential Revision: D46427052 fbshipit-source-id: 0a23f6c726447de0f20c583b4d507003efd6a754 --- .../virtualized-lists/Lists/FillRateHelper.js | 30 ++- .../Lists/ListMetricsAggregator.js | 179 +++++++++++++++++ .../Lists/ViewabilityHelper.js | 27 +-- .../Lists/VirtualizeUtils.js | 30 +-- .../Lists/VirtualizedList.js | 184 +++++------------- .../Lists/VirtualizedListProps.js | 12 -- .../Lists/VirtualizedSectionList.js | 8 +- .../Lists/__tests__/FillRateHelper-test.js | 42 ++-- .../Lists/__tests__/ViewabilityHelper-test.js | 140 ++++++------- .../Lists/__tests__/VirtualizeUtils-test.js | 22 ++- 10 files changed, 367 insertions(+), 307 deletions(-) create mode 100644 packages/virtualized-lists/Lists/ListMetricsAggregator.js diff --git a/packages/virtualized-lists/Lists/FillRateHelper.js b/packages/virtualized-lists/Lists/FillRateHelper.js index aa4a331741c4c5..c5bfadf962ca3c 100644 --- a/packages/virtualized-lists/Lists/FillRateHelper.js +++ b/packages/virtualized-lists/Lists/FillRateHelper.js @@ -10,7 +10,8 @@ 'use strict'; -import type {CellMetricProps} from './VirtualizedListProps'; +import type {CellMetricProps} from './ListMetricsAggregator'; +import ListMetricsAggregator from './ListMetricsAggregator'; export type FillRateInfo = Info; @@ -27,13 +28,6 @@ class Info { sample_count: number = 0; } -type CellMetrics = { - inLayout?: boolean, - length: number, - offset: number, - ... -}; - const DEBUG = false; let _listeners: Array<(Info) => void> = []; @@ -51,7 +45,7 @@ let _sampleRate = DEBUG ? 1 : null; class FillRateHelper { _anyBlankStartTime: ?number = null; _enabled = false; - _getCellMetrics: (index: number, props: CellMetricProps) => ?CellMetrics; + _listMetrics: ListMetricsAggregator; _info: Info = new Info(); _mostlyBlankStartTime: ?number = null; _samplesStartTime: ?number = null; @@ -79,10 +73,8 @@ class FillRateHelper { _minSampleCount = minSampleCount; } - constructor( - getCellMetrics: (index: number, props: CellMetricProps) => ?CellMetrics, - ) { - this._getCellMetrics = getCellMetrics; + constructor(listMetrics: ListMetricsAggregator) { + this._listMetrics = listMetrics; this._enabled = (_sampleRate || 0) > Math.random(); this._resetData(); } @@ -186,12 +178,12 @@ class FillRateHelper { let blankTop = 0; let first = cellsAroundViewport.first; - let firstFrame = this._getCellMetrics(first, props); + let firstFrame = this._listMetrics.getCellMetrics(first, props); while ( first <= cellsAroundViewport.last && - (!firstFrame || !firstFrame.inLayout) + (!firstFrame || !firstFrame.isMounted) ) { - firstFrame = this._getCellMetrics(first, props); + firstFrame = this._listMetrics.getCellMetrics(first, props); first++; } // Only count blankTop if we aren't rendering the first item, otherwise we will count the header @@ -204,12 +196,12 @@ class FillRateHelper { } let blankBottom = 0; let last = cellsAroundViewport.last; - let lastFrame = this._getCellMetrics(last, props); + let lastFrame = this._listMetrics.getCellMetrics(last, props); while ( last >= cellsAroundViewport.first && - (!lastFrame || !lastFrame.inLayout) + (!lastFrame || !lastFrame.isMounted) ) { - lastFrame = this._getCellMetrics(last, props); + lastFrame = this._listMetrics.getCellMetrics(last, props); last--; } // Only count blankBottom if we aren't rendering the last item, otherwise we will count the diff --git a/packages/virtualized-lists/Lists/ListMetricsAggregator.js b/packages/virtualized-lists/Lists/ListMetricsAggregator.js new file mode 100644 index 00000000000000..3fcb051525114b --- /dev/null +++ b/packages/virtualized-lists/Lists/ListMetricsAggregator.js @@ -0,0 +1,179 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +import type {Props as VirtualizedListProps} from './VirtualizedListProps'; +import {keyExtractor as defaultKeyExtractor} from './VirtualizeUtils'; + +import invariant from 'invariant'; + +export type CellMetrics = { + /** + * Index of the item in the list + */ + index: number, + /** + * Length of the cell along the scrolling axis + */ + length: number, + /** + * Offset to the cell along the scrolling axis + */ + offset: number, + /** + * Whether the cell is last known to be mounted + */ + isMounted: boolean, +}; + +/** + * Subset of VirtualizedList props needed to calculate cell metrics + */ +export type CellMetricProps = { + data: VirtualizedListProps['data'], + getItemCount: VirtualizedListProps['getItemCount'], + getItem: VirtualizedListProps['getItem'], + getItemLayout?: VirtualizedListProps['getItemLayout'], + keyExtractor?: VirtualizedListProps['keyExtractor'], + ... +}; + +/** + * Provides an interface to query information about the metrics of a list and its cells. + */ +export default class ListMetricsAggregator { + _averageCellLength = 0; + _frames: {[string]: CellMetrics} = {}; + _highestMeasuredCellIndex = 0; + _totalCellLength = 0; + _totalCellsMeasured = 0; + + /** + * Notify the ListMetricsAggregator that a cell has been laid out. + * + * @returns whether the cell layout has changed since last notification + */ + notifyCellLayout( + cellKey: string, + index: number, + length: number, + offset: number, + ): boolean { + const next: CellMetrics = { + offset, + length, + index, + isMounted: true, + }; + const curr = this._frames[cellKey]; + if ( + !curr || + next.offset !== curr.offset || + next.length !== curr.length || + index !== curr.index + ) { + this._totalCellLength += next.length - (curr ? curr.length : 0); + this._totalCellsMeasured += curr ? 0 : 1; + this._averageCellLength = + this._totalCellLength / this._totalCellsMeasured; + this._frames[cellKey] = next; + this._highestMeasuredCellIndex = Math.max( + this._highestMeasuredCellIndex, + index, + ); + return true; + } else { + this._frames[cellKey].isMounted = true; + return false; + } + } + + /** + * Notify ListMetricsAggregator that a cell has been unmounted. + */ + notifyCellUnmounted(cellKey: string): void { + const curr = this._frames[cellKey]; + if (curr) { + this._frames[cellKey] = {...curr, isMounted: false}; + } + } + + /** + * Return the average length of the cells which have been measured + */ + getAverageCellLength(): number { + return this._averageCellLength; + } + + /** + * Return the highest measured cell index + */ + getHighestMeasuredCellIndex(): number { + return this._highestMeasuredCellIndex; + } + + /** + * Returns the exact metrics of a cell if it has already been laid out, + * otherwise an estimate based on the average length of previously measured + * cells + */ + getCellMetricsApprox(index: number, props: CellMetricProps): CellMetrics { + const frame = this.getCellMetrics(index, props); + if (frame && frame.index === index) { + // check for invalid frames due to row re-ordering + return frame; + } else { + const {data, getItemCount} = props; + invariant( + index >= 0 && index < getItemCount(data), + 'Tried to get frame for out of range index ' + index, + ); + return { + length: this._averageCellLength, + offset: this._averageCellLength * index, + index, + isMounted: false, + }; + } + } + + /** + * Returns the exact metrics of a cell if it has already been laid out + */ + getCellMetrics(index: number, props: CellMetricProps): ?CellMetrics { + const {data, getItem, getItemCount, getItemLayout} = props; + invariant( + index >= 0 && index < getItemCount(data), + 'Tried to get frame for out of range index ' + index, + ); + const keyExtractor = props.keyExtractor ?? defaultKeyExtractor; + const frame = this._frames[keyExtractor(getItem(data, index), index)]; + if (!frame || frame.index !== index) { + if (getItemLayout) { + const {length, offset} = getItemLayout(data, index); + return {index, length, offset, isMounted: true}; + } + } + return frame; + } + + /** + * Gets an approximate offset to an item at a given index. Supports + * fractional indices. + */ + getCellOffsetApprox(index: number, props: CellMetricProps): number { + if (Number.isInteger(index)) { + return this.getCellMetricsApprox(index, props).offset; + } else { + const frameMetrics = this.getCellMetricsApprox(Math.floor(index), props); + const remainder = index - Math.floor(index); + return frameMetrics.offset + remainder * frameMetrics.length; + } + } +} diff --git a/packages/virtualized-lists/Lists/ViewabilityHelper.js b/packages/virtualized-lists/Lists/ViewabilityHelper.js index d0d1a5f82502fc..cae7c0bd685572 100644 --- a/packages/virtualized-lists/Lists/ViewabilityHelper.js +++ b/packages/virtualized-lists/Lists/ViewabilityHelper.js @@ -10,7 +10,8 @@ 'use strict'; -import type {CellMetricProps} from './VirtualizedListProps'; +import type {CellMetricProps} from './ListMetricsAggregator'; +import ListMetricsAggregator from './ListMetricsAggregator'; const invariant = require('invariant'); @@ -104,14 +105,7 @@ class ViewabilityHelper { props: CellMetricProps, scrollOffset: number, viewportHeight: number, - getCellMetrics: ( - index: number, - props: CellMetricProps, - ) => ?{ - length: number, - offset: number, - ... - }, + listMetrics: ListMetricsAggregator, // Optional optimization to reduce the scan size renderRange?: { first: number, @@ -146,7 +140,7 @@ class ViewabilityHelper { return []; } for (let idx = first; idx <= last; idx++) { - const metrics = getCellMetrics(idx, props); + const metrics = listMetrics.getCellMetrics(idx, props); if (!metrics) { continue; } @@ -181,14 +175,7 @@ class ViewabilityHelper { props: CellMetricProps, scrollOffset: number, viewportHeight: number, - getCellMetrics: ( - index: number, - props: CellMetricProps, - ) => ?{ - length: number, - offset: number, - ... - }, + listMetrics: ListMetricsAggregator, createViewToken: ( index: number, isViewable: boolean, @@ -210,7 +197,7 @@ class ViewabilityHelper { if ( (this._config.waitForInteraction && !this._hasInteracted) || itemCount === 0 || - !getCellMetrics(0, props) + !listMetrics.getCellMetrics(0, props) ) { return; } @@ -220,7 +207,7 @@ class ViewabilityHelper { props, scrollOffset, viewportHeight, - getCellMetrics, + listMetrics, renderRange, ); } diff --git a/packages/virtualized-lists/Lists/VirtualizeUtils.js b/packages/virtualized-lists/Lists/VirtualizeUtils.js index 36295aa0deb50b..3dd88d607590bf 100644 --- a/packages/virtualized-lists/Lists/VirtualizeUtils.js +++ b/packages/virtualized-lists/Lists/VirtualizeUtils.js @@ -10,7 +10,8 @@ 'use strict'; -import type {CellMetricProps} from './VirtualizedListProps'; +import type {CellMetricProps} from './ListMetricsAggregator'; +import ListMetricsAggregator from './ListMetricsAggregator'; /** * Used to find the indices of the frames that overlap the given offsets. Useful for finding the @@ -20,14 +21,7 @@ import type {CellMetricProps} from './VirtualizedListProps'; export function elementsThatOverlapOffsets( offsets: Array, props: CellMetricProps, - getCellMetrics: ( - index: number, - props: CellMetricProps, - ) => { - length: number, - offset: number, - ... - }, + listMetrics: ListMetricsAggregator, zoomScale: number = 1, ): Array { const itemCount = props.getItemCount(props.data); @@ -38,9 +32,8 @@ export function elementsThatOverlapOffsets( let right = itemCount - 1; while (left <= right) { - // eslint-disable-next-line no-bitwise - const mid = left + ((right - left) >>> 1); - const frame = getCellMetrics(mid, props); + const mid = left + Math.floor((right - left) / 2); + const frame = listMetrics.getCellMetricsApprox(mid, props); const scaledOffsetStart = frame.offset * zoomScale; const scaledOffsetEnd = (frame.offset + frame.length) * zoomScale; @@ -106,14 +99,7 @@ export function computeWindowedRenderLimits( first: number, last: number, }, - getCellMetricsApprox: ( - index: number, - props: CellMetricProps, - ) => { - length: number, - offset: number, - ... - }, + listMetrics: ListMetricsAggregator, scrollMetrics: { dt: number, offset: number, @@ -152,7 +138,7 @@ export function computeWindowedRenderLimits( const overscanEnd = Math.max(0, visibleEnd + leadFactor * overscanLength); const lastItemOffset = - getCellMetricsApprox(itemCount - 1, props).offset * zoomScale; + listMetrics.getCellMetricsApprox(itemCount - 1, props).offset * zoomScale; if (lastItemOffset < overscanBegin) { // Entire list is before our overscan window return { @@ -165,7 +151,7 @@ export function computeWindowedRenderLimits( let [overscanFirst, first, last, overscanLast] = elementsThatOverlapOffsets( [overscanBegin, visibleBegin, visibleEnd, overscanEnd], props, - getCellMetricsApprox, + listMetrics, zoomScale, ); overscanFirst = overscanFirst == null ? 0 : overscanFirst; diff --git a/packages/virtualized-lists/Lists/VirtualizedList.js b/packages/virtualized-lists/Lists/VirtualizedList.js index efc98eaf9e9172..0c078e085957c3 100644 --- a/packages/virtualized-lists/Lists/VirtualizedList.js +++ b/packages/virtualized-lists/Lists/VirtualizedList.js @@ -16,13 +16,13 @@ import type { } from 'react-native/Libraries/Types/CoreEventTypes'; import type {ViewToken} from './ViewabilityHelper'; import type { - CellMetricProps, Item, Props, RenderItemProps, RenderItemType, Separators, } from './VirtualizedListProps'; +import type {CellMetricProps} from './ListMetricsAggregator'; import { RefreshControl, @@ -37,6 +37,7 @@ import infoLog from '../Utilities/infoLog'; import {CellRenderMask} from './CellRenderMask'; import ChildListCollection from './ChildListCollection'; import FillRateHelper from './FillRateHelper'; +import ListMetricsAggregator from './ListMetricsAggregator'; import StateSafePureComponent from './StateSafePureComponent'; import ViewabilityHelper from './ViewabilityHelper'; import CellRenderer from './VirtualizedListCellRenderer'; @@ -176,7 +177,7 @@ class VirtualizedList extends StateSafePureComponent { if (veryLast < 0) { return; } - const frame = this.__getCellMetricsApprox(veryLast, this.props); + const frame = this._listMetrics.getCellMetricsApprox(veryLast, this.props); const offset = Math.max( 0, frame.offset + @@ -237,24 +238,31 @@ class VirtualizedList extends StateSafePureComponent { getItemCount(data) - 1 }`, ); - if (!getItemLayout && index > this._highestMeasuredFrameIndex) { + if ( + !getItemLayout && + index > this._listMetrics.getHighestMeasuredCellIndex() + ) { invariant( !!onScrollToIndexFailed, 'scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, ' + 'otherwise there is no way to know the location of offscreen indices or handle failures.', ); onScrollToIndexFailed({ - averageItemLength: this._averageCellLength, - highestMeasuredFrameIndex: this._highestMeasuredFrameIndex, + averageItemLength: this._listMetrics.getAverageCellLength(), + highestMeasuredFrameIndex: + this._listMetrics.getHighestMeasuredCellIndex(), index, }); return; } - const frame = this.__getCellMetricsApprox(Math.floor(index), this.props); + const frame = this._listMetrics.getCellMetricsApprox( + Math.floor(index), + this.props, + ); const offset = Math.max( 0, - this._getOffsetApprox(index, this.props) - + this._listMetrics.getCellOffsetApprox(index, this.props) - (viewPosition || 0) * (this._scrollMetrics.visibleLength - frame.length), ) - (viewOffset || 0); @@ -427,7 +435,7 @@ class VirtualizedList extends StateSafePureComponent { super(props); this._checkProps(props); - this._fillRateHelper = new FillRateHelper(this._getCellMetrics); + this._fillRateHelper = new FillRateHelper(this._listMetrics); this._updateCellsToRenderBatcher = new Batchinator( this._updateCellsToRender, this.props.updateCellsBatchingPeriod ?? 50, @@ -683,7 +691,7 @@ class VirtualizedList extends StateSafePureComponent { maxToRenderPerBatchOrDefault(props.maxToRenderPerBatch), windowSizeOrDefault(props.windowSize), cellsAroundViewport, - this.__getCellMetricsApprox, + this._listMetrics, this._scrollMetrics, ); invariant( @@ -1037,15 +1045,18 @@ class VirtualizedList extends StateSafePureComponent { ? clamp( section.first - 1, section.last, - this._highestMeasuredFrameIndex, + this._listMetrics.getHighestMeasuredCellIndex(), ) : section.last; - const firstMetrics = this.__getCellMetricsApprox( + const firstMetrics = this._listMetrics.getCellMetricsApprox( section.first, this.props, ); - const lastMetrics = this.__getCellMetricsApprox(last, this.props); + const lastMetrics = this._listMetrics.getCellMetricsApprox( + last, + this.props, + ); const spacerSize = lastMetrics.offset + lastMetrics.length - firstMetrics.offset; cells.push( @@ -1223,17 +1234,9 @@ class VirtualizedList extends StateSafePureComponent { } } - _averageCellLength = 0; _cellRefs: {[string]: null | CellRenderer} = {}; _fillRateHelper: FillRateHelper; - _frames: { - [string]: { - inLayout?: boolean, - index: number, - length: number, - offset: number, - }, - } = {}; + _listMetrics: ListMetricsAggregator = new ListMetricsAggregator(); _footerLength = 0; // Used for preventing scrollToIndex from being called multiple times for initialScrollIndex _hasTriggeredInitialScrollToIndex = false; @@ -1242,7 +1245,6 @@ class VirtualizedList extends StateSafePureComponent { _hasWarned: {[string]: boolean} = {}; _headerLength = 0; _hiPriInProgress: boolean = false; // flag to prevent infinite hiPri cell limit update - _highestMeasuredFrameIndex = 0; _indicesToKeys: Map = new Map(); _lastFocusedCellKey: ?string = null; _nestedChildLists: ChildListCollection = @@ -1263,8 +1265,6 @@ class VirtualizedList extends StateSafePureComponent { _scrollRef: ?React.ElementRef = null; _sentStartForContentLength = 0; _sentEndForContentLength = 0; - _totalCellLength = 0; - _totalCellsMeasured = 0; _updateCellsToRenderBatcher: Batchinator; _viewabilityTuples: Array = []; @@ -1324,31 +1324,17 @@ class VirtualizedList extends StateSafePureComponent { _onCellLayout = (e: LayoutEvent, cellKey: string, index: number): void => { const layout = e.nativeEvent.layout; - const next = { - offset: this._selectOffset(layout), - length: this._selectLength(layout), + const offset = this._selectOffset(layout); + const length = this._selectLength(layout); + + const layoutHasChanged = this._listMetrics.notifyCellLayout( + cellKey, index, - inLayout: true, - }; - const curr = this._frames[cellKey]; - if ( - !curr || - next.offset !== curr.offset || - next.length !== curr.length || - index !== curr.index - ) { - this._totalCellLength += next.length - (curr ? curr.length : 0); - this._totalCellsMeasured += curr ? 0 : 1; - this._averageCellLength = - this._totalCellLength / this._totalCellsMeasured; - this._frames[cellKey] = next; - this._highestMeasuredFrameIndex = Math.max( - this._highestMeasuredFrameIndex, - index, - ); + length, + offset, + ); + if (layoutHasChanged) { this._scheduleCellsToRenderUpdate(); - } else { - this._frames[cellKey].inLayout = true; } this._triggerRemeasureForChildListsInCell(cellKey); @@ -1364,10 +1350,7 @@ class VirtualizedList extends StateSafePureComponent { _onCellUnmount = (cellKey: string) => { delete this._cellRefs[cellKey]; - const curr = this._frames[cellKey]; - if (curr) { - this._frames[cellKey] = {...curr, inLayout: false}; - } + this._listMetrics.notifyCellUnmounted(cellKey); }; _triggerRemeasureForChildListsInCell(cellKey: string): void { @@ -1467,19 +1450,16 @@ class VirtualizedList extends StateSafePureComponent { const framesInLayout = []; const itemCount = this.props.getItemCount(this.props.data); for (let ii = 0; ii < itemCount; ii++) { - const frame = this.__getCellMetricsApprox(ii, this.props); - /* $FlowFixMe[prop-missing] (>=0.68.0 site=react_native_fb) This comment - * suppresses an error found when Flow v0.68 was deployed. To see the - * error delete this comment and run Flow. */ - if (frame.inLayout) { + const frame = this._listMetrics.getCellMetricsApprox(ii, this.props); + if (frame.isMounted) { framesInLayout.push(frame); } } - const windowTop = this.__getCellMetricsApprox( + const windowTop = this._listMetrics.getCellMetricsApprox( this.state.cellsAroundViewport.first, this.props, ).offset; - const frameLast = this.__getCellMetricsApprox( + const frameLast = this._listMetrics.getCellMetricsApprox( this.state.cellsAroundViewport.last, this.props, ); @@ -1774,7 +1754,8 @@ class VirtualizedList extends StateSafePureComponent { // But only if there are items before the first rendered item if (first > 0) { const distTop = - offset - this.__getCellMetricsApprox(first, this.props).offset; + offset - + this._listMetrics.getCellMetricsApprox(first, this.props).offset; hiPri = distTop < 0 || (velocity < -2 && @@ -1785,7 +1766,7 @@ class VirtualizedList extends StateSafePureComponent { // But only if there are items after the last rendered item if (!hiPri && last >= 0 && last < itemCount - 1) { const distBottom = - this.__getCellMetricsApprox(last, this.props).offset - + this._listMetrics.getCellMetricsApprox(last, this.props).offset - (offset + visibleLength); hiPri = distBottom < 0 || @@ -1802,7 +1783,7 @@ class VirtualizedList extends StateSafePureComponent { // We shouldn't do another hipri cellToRenderUpdate if ( hiPri && - (this._averageCellLength || this.props.getItemLayout) && + (this._listMetrics.getAverageCellLength() || this.props.getItemLayout) && !this._hiPriInProgress ) { this._hiPriInProgress = true; @@ -1898,75 +1879,9 @@ class VirtualizedList extends StateSafePureComponent { }; }; - /** - * Gets an approximate offset to an item at a given index. Supports - * fractional indices. - */ - _getOffsetApprox = (index: number, props: CellMetricProps): number => { - if (Number.isInteger(index)) { - return this.__getCellMetricsApprox(index, props).offset; - } else { - const CellMetrics = this.__getCellMetricsApprox(Math.floor(index), props); - const remainder = index - Math.floor(index); - return CellMetrics.offset + remainder * CellMetrics.length; - } - }; - - __getCellMetricsApprox: ( - index: number, - props: CellMetricProps, - ) => { - length: number, - offset: number, - ... - } = (index, props) => { - const frame = this._getCellMetrics(index, props); - if (frame && frame.index === index) { - // check for invalid frames due to row re-ordering - return frame; - } else { - const {data, getItemCount, getItemLayout} = props; - invariant( - index >= 0 && index < getItemCount(data), - 'Tried to get frame for out of range index ' + index, - ); - invariant( - !getItemLayout, - 'Should not have to estimate frames when a measurement metrics function is provided', - ); - return { - length: this._averageCellLength, - offset: this._averageCellLength * index, - }; - } - }; - - _getCellMetrics = ( - index: number, - props: CellMetricProps, - ): ?{ - length: number, - offset: number, - index: number, - inLayout?: boolean, - ... - } => { - const {data, getItemCount, getItemLayout} = props; - invariant( - index >= 0 && index < getItemCount(data), - 'Tried to get frame for out of range index ' + index, - ); - const frame = this._frames[VirtualizedList._getItemKey(props, index)]; - if (!frame || frame.index !== index) { - if (getItemLayout) { - /* $FlowFixMe[prop-missing] (>=0.63.0 site=react_native_fb) This comment - * suppresses an error found when Flow v0.63 was deployed. To see the error - * delete this comment and run Flow. */ - return getItemLayout(data, index); - } - } - return frame; - }; + __getListMetrics(): ListMetricsAggregator { + return this._listMetrics; + } _getNonViewportRenderRegions = ( props: CellMetricProps, @@ -2005,7 +1920,7 @@ class VirtualizedList extends StateSafePureComponent { i-- ) { first--; - heightOfCellsBeforeFocused += this.__getCellMetricsApprox( + heightOfCellsBeforeFocused += this._listMetrics.getCellMetricsApprox( i, props, ).length; @@ -2020,7 +1935,10 @@ class VirtualizedList extends StateSafePureComponent { i++ ) { last++; - heightOfCellsAfterFocused += this.__getCellMetricsApprox(i, props).length; + heightOfCellsAfterFocused += this._listMetrics.getCellMetricsApprox( + i, + props, + ).length; } return [{first, last}]; @@ -2040,7 +1958,7 @@ class VirtualizedList extends StateSafePureComponent { props, this._scrollMetrics.offset, this._scrollMetrics.visibleLength, - this._getCellMetrics, + this._listMetrics, this._createViewToken, tuple.onViewableItemsChanged, cellsAroundViewport, diff --git a/packages/virtualized-lists/Lists/VirtualizedListProps.js b/packages/virtualized-lists/Lists/VirtualizedListProps.js index 1988ef753bb508..d1ec579b3a09df 100644 --- a/packages/virtualized-lists/Lists/VirtualizedListProps.js +++ b/packages/virtualized-lists/Lists/VirtualizedListProps.js @@ -292,15 +292,3 @@ export type Props = {| ...RequiredProps, ...OptionalProps, |}; - -/** - * Subset of properties needed to calculate frame metrics - */ -export type CellMetricProps = { - data: RequiredProps['data'], - getItemCount: RequiredProps['getItemCount'], - getItem: RequiredProps['getItem'], - getItemLayout?: OptionalProps['getItemLayout'], - keyExtractor?: OptionalProps['keyExtractor'], - ... -}; diff --git a/packages/virtualized-lists/Lists/VirtualizedSectionList.js b/packages/virtualized-lists/Lists/VirtualizedSectionList.js index b5bbd84597e88f..0f6b2a360b33bf 100644 --- a/packages/virtualized-lists/Lists/VirtualizedSectionList.js +++ b/packages/virtualized-lists/Lists/VirtualizedSectionList.js @@ -138,11 +138,11 @@ class VirtualizedSectionList< if (this._listRef == null) { return; } + const listRef = this._listRef; if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) { - const frame = this._listRef.__getCellMetricsApprox( - index - params.itemIndex, - this._listRef.props, - ); + const frame = listRef + .__getListMetrics() + .getCellMetricsApprox(index - params.itemIndex, listRef.props); viewOffset += frame.length; } const toIndexParams = { diff --git a/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js b/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js index 3f29f3fff849b4..58d47ba68d8c90 100644 --- a/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js +++ b/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js @@ -23,7 +23,7 @@ const dataGlobal = [ ]; function getCellMetrics(index: number) { const frame = rowFramesGlobal[dataGlobal[index].key]; - return {length: frame.height, offset: frame.y, inLayout: frame.inLayout}; + return {length: frame.height, offset: frame.y, isMounted: frame.isMounted}; } function computeResult({helper, props, state, scroll}): number { @@ -47,11 +47,11 @@ describe('computeBlankness', function () { }); it('computes correct blankness of viewport', function () { - const helper = new FillRateHelper(getCellMetrics); + const helper = new FillRateHelper({getCellMetrics}); rowFramesGlobal = { - header: {y: 0, height: 0, inLayout: true}, - a: {y: 0, height: 50, inLayout: true}, - b: {y: 50, height: 50, inLayout: true}, + header: {y: 0, height: 0, isMounted: true}, + a: {y: 0, height: 50, isMounted: true}, + b: {y: 50, height: 50, isMounted: true}, }; let blankness = computeResult({helper}); expect(blankness).toBe(0); @@ -66,32 +66,32 @@ describe('computeBlankness', function () { }); it('skips frames that are not in layout', function () { - const helper = new FillRateHelper(getCellMetrics); + const helper = new FillRateHelper({getCellMetrics}); rowFramesGlobal = { - header: {y: 0, height: 0, inLayout: false}, - a: {y: 0, height: 10, inLayout: false}, - b: {y: 10, height: 30, inLayout: true}, - c: {y: 40, height: 40, inLayout: true}, - d: {y: 80, height: 20, inLayout: false}, - footer: {y: 100, height: 0, inLayout: false}, + header: {y: 0, height: 0, isMounted: false}, + a: {y: 0, height: 10, isMounted: false}, + b: {y: 10, height: 30, isMounted: true}, + c: {y: 40, height: 40, isMounted: true}, + d: {y: 80, height: 20, isMounted: false}, + footer: {y: 100, height: 0, isMounted: false}, }; const blankness = computeResult({helper, state: {last: 4}}); expect(blankness).toBe(0.3); }); it('sampling rate can disable', function () { - let helper = new FillRateHelper(getCellMetrics); + let helper = new FillRateHelper({getCellMetrics}); rowFramesGlobal = { - header: {y: 0, height: 0, inLayout: true}, - a: {y: 0, height: 40, inLayout: true}, - b: {y: 40, height: 40, inLayout: true}, + header: {y: 0, height: 0, isMounted: true}, + a: {y: 0, height: 40, isMounted: true}, + b: {y: 40, height: 40, isMounted: true}, }; let blankness = computeResult({helper}); expect(blankness).toBe(0.2); FillRateHelper.setSampleRate(0); - helper = new FillRateHelper(getCellMetrics); + helper = new FillRateHelper({getCellMetrics}); blankness = computeResult({helper}); expect(blankness).toBe(0); }); @@ -102,11 +102,11 @@ describe('computeBlankness', function () { FillRateHelper.addListener(listener), ); subscriptions[1].remove(); - const helper = new FillRateHelper(getCellMetrics); + const helper = new FillRateHelper({getCellMetrics}); rowFramesGlobal = { - header: {y: 0, height: 0, inLayout: true}, - a: {y: 0, height: 40, inLayout: true}, - b: {y: 40, height: 40, inLayout: true}, + header: {y: 0, height: 0, isMounted: true}, + a: {y: 0, height: 40, isMounted: true}, + b: {y: 40, height: 40, isMounted: true}, }; const blankness = computeResult({helper}); expect(blankness).toBe(0.2); diff --git a/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js b/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js index 2737c2a298423e..08423c52cc275a 100644 --- a/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js +++ b/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js @@ -38,9 +38,9 @@ describe('computeViewableItems', function () { d: {y: 150, height: 50}, }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; - expect(helper.computeViewableItems(props, 0, 200, getCellMetrics)).toEqual([ - 0, 1, 2, 3, - ]); + expect( + helper.computeViewableItems(props, 0, 200, {getCellMetrics}), + ).toEqual([0, 1, 2, 3]); }); it('returns top 2 rows as viewable (1. entirely visible and 2. majority)', function () { @@ -54,9 +54,9 @@ describe('computeViewableItems', function () { d: {y: 250, height: 50}, }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; - expect(helper.computeViewableItems(props, 0, 200, getCellMetrics)).toEqual([ - 0, 1, - ]); + expect( + helper.computeViewableItems(props, 0, 200, {getCellMetrics}), + ).toEqual([0, 1]); }); it('returns only 2nd row as viewable (majority)', function () { @@ -70,9 +70,9 @@ describe('computeViewableItems', function () { d: {y: 250, height: 50}, }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; - expect(helper.computeViewableItems(props, 25, 200, getCellMetrics)).toEqual( - [1], - ); + expect( + helper.computeViewableItems(props, 25, 200, {getCellMetrics}), + ).toEqual([1]); }); it('handles empty input', function () { @@ -81,9 +81,9 @@ describe('computeViewableItems', function () { }); rowFrames = {}; data = []; - expect(helper.computeViewableItems(props, 0, 200, getCellMetrics)).toEqual( - [], - ); + expect( + helper.computeViewableItems(props, 0, 200, {getCellMetrics}), + ).toEqual([]); }); it('handles different view area coverage percent thresholds', function () { @@ -96,40 +96,40 @@ describe('computeViewableItems', function () { data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; let helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 0}); - expect(helper.computeViewableItems(props, 0, 50, getCellMetrics)).toEqual([ - 0, - ]); - expect(helper.computeViewableItems(props, 1, 50, getCellMetrics)).toEqual([ - 0, 1, - ]); - expect(helper.computeViewableItems(props, 199, 50, getCellMetrics)).toEqual( - [1, 2], + expect(helper.computeViewableItems(props, 0, 50, {getCellMetrics})).toEqual( + [0], ); - expect(helper.computeViewableItems(props, 250, 50, getCellMetrics)).toEqual( - [2], + expect(helper.computeViewableItems(props, 1, 50, {getCellMetrics})).toEqual( + [0, 1], ); + expect( + helper.computeViewableItems(props, 199, 50, {getCellMetrics}), + ).toEqual([1, 2]); + expect( + helper.computeViewableItems(props, 250, 50, {getCellMetrics}), + ).toEqual([2]); helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 100}); - expect(helper.computeViewableItems(props, 0, 200, getCellMetrics)).toEqual([ - 0, 1, - ]); - expect(helper.computeViewableItems(props, 1, 200, getCellMetrics)).toEqual([ - 1, - ]); expect( - helper.computeViewableItems(props, 400, 200, getCellMetrics), + helper.computeViewableItems(props, 0, 200, {getCellMetrics}), + ).toEqual([0, 1]); + expect( + helper.computeViewableItems(props, 1, 200, {getCellMetrics}), + ).toEqual([1]); + expect( + helper.computeViewableItems(props, 400, 200, {getCellMetrics}), ).toEqual([2]); expect( - helper.computeViewableItems(props, 600, 200, getCellMetrics), + helper.computeViewableItems(props, 600, 200, {getCellMetrics}), ).toEqual([3]); helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 10}); - expect(helper.computeViewableItems(props, 30, 200, getCellMetrics)).toEqual( - [0, 1, 2], - ); - expect(helper.computeViewableItems(props, 31, 200, getCellMetrics)).toEqual( - [1, 2], - ); + expect( + helper.computeViewableItems(props, 30, 200, {getCellMetrics}), + ).toEqual([0, 1, 2]); + expect( + helper.computeViewableItems(props, 31, 200, {getCellMetrics}), + ).toEqual([1, 2]); }); it('handles different item visible percent thresholds', function () { @@ -141,31 +141,31 @@ describe('computeViewableItems', function () { }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; let helper = new ViewabilityHelper({itemVisiblePercentThreshold: 0}); - expect(helper.computeViewableItems(props, 0, 50, getCellMetrics)).toEqual([ - 0, - ]); - expect(helper.computeViewableItems(props, 1, 50, getCellMetrics)).toEqual([ - 0, 1, - ]); + expect(helper.computeViewableItems(props, 0, 50, {getCellMetrics})).toEqual( + [0], + ); + expect(helper.computeViewableItems(props, 1, 50, {getCellMetrics})).toEqual( + [0, 1], + ); helper = new ViewabilityHelper({itemVisiblePercentThreshold: 100}); - expect(helper.computeViewableItems(props, 0, 250, getCellMetrics)).toEqual([ - 0, 1, 2, - ]); - expect(helper.computeViewableItems(props, 1, 250, getCellMetrics)).toEqual([ - 1, 2, - ]); + expect( + helper.computeViewableItems(props, 0, 250, {getCellMetrics}), + ).toEqual([0, 1, 2]); + expect( + helper.computeViewableItems(props, 1, 250, {getCellMetrics}), + ).toEqual([1, 2]); helper = new ViewabilityHelper({itemVisiblePercentThreshold: 10}); - expect(helper.computeViewableItems(props, 184, 20, getCellMetrics)).toEqual( - [1], - ); - expect(helper.computeViewableItems(props, 185, 20, getCellMetrics)).toEqual( - [1, 2], - ); - expect(helper.computeViewableItems(props, 186, 20, getCellMetrics)).toEqual( - [2], - ); + expect( + helper.computeViewableItems(props, 184, 20, {getCellMetrics}), + ).toEqual([1]); + expect( + helper.computeViewableItems(props, 185, 20, {getCellMetrics}), + ).toEqual([1, 2]); + expect( + helper.computeViewableItems(props, 186, 20, {getCellMetrics}), + ).toEqual([2]); }); }); @@ -181,7 +181,7 @@ describe('onUpdate', function () { props, 0, 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -195,7 +195,7 @@ describe('onUpdate', function () { props, 0, 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -204,7 +204,7 @@ describe('onUpdate', function () { props, 100, 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -228,7 +228,7 @@ describe('onUpdate', function () { props, 0, 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -242,7 +242,7 @@ describe('onUpdate', function () { props, 100, 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -260,7 +260,7 @@ describe('onUpdate', function () { props, 200, 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -287,7 +287,7 @@ describe('onUpdate', function () { props, 0, 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -321,7 +321,7 @@ describe('onUpdate', function () { props, 0, 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -329,7 +329,7 @@ describe('onUpdate', function () { props, 300, // scroll past item 'a' 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -362,7 +362,7 @@ describe('onUpdate', function () { props, 0, 100, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -374,7 +374,7 @@ describe('onUpdate', function () { props, 20, 100, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -401,7 +401,7 @@ describe('onUpdate', function () { props, 0, 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); @@ -426,7 +426,7 @@ describe('onUpdate', function () { props, 0, 200, - getCellMetrics, + {getCellMetrics}, createViewToken, onViewableItemsChanged, ); diff --git a/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js b/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js index da59c0764a8a65..9af659dac5ba9d 100644 --- a/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js +++ b/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js @@ -42,14 +42,19 @@ describe('newRangeCount', function () { describe('elementsThatOverlapOffsets', function () { it('handles fixed length', function () { const offsets = [0, 250, 350, 450]; - function getCellMetrics(index: number) { + function getCellMetricsApprox(index: number) { return { length: 100, offset: 100 * index, }; } expect( - elementsThatOverlapOffsets(offsets, fakeProps(100), getCellMetrics, 1), + elementsThatOverlapOffsets( + offsets, + fakeProps(100), + {getCellMetricsApprox}, + 1, + ), ).toEqual([0, 2, 3, 4]); }); it('handles variable length', function () { @@ -65,21 +70,26 @@ describe('elementsThatOverlapOffsets', function () { elementsThatOverlapOffsets( offsets, fakeProps(frames.length), - ii => frames[ii], + {getCellMetricsApprox: ii => frames[ii]}, 1, ), ).toEqual([1, 1, 3]); }); it('handles frame boundaries', function () { const offsets = [0, 100, 200, 300]; - function getCellMetrics(index: number) { + function getCellMetricsApprox(index: number) { return { length: 100, offset: 100 * index, }; } expect( - elementsThatOverlapOffsets(offsets, fakeProps(100), getCellMetrics, 1), + elementsThatOverlapOffsets( + offsets, + fakeProps(100), + {getCellMetricsApprox}, + 1, + ), ).toEqual([0, 0, 1, 2]); }); it('handles out of bounds', function () { @@ -93,7 +103,7 @@ describe('elementsThatOverlapOffsets', function () { elementsThatOverlapOffsets( offsets, fakeProps(frames.length), - ii => frames[ii], + {getCellMetricsApprox: ii => frames[ii]}, 1, ), ).toEqual([undefined, 1]); From 4b54c0b1faf8233986bf9232e1a18a1c5067ad3a Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Thu, 8 Jun 2023 16:53:34 -0700 Subject: [PATCH 089/468] return final animation values to JS when animation completes (#37782) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37782 Pull Request resolved: https://github.com/facebook/react-native/pull/36731 When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect **This diff:** - Returning the final values from the native side, at the same place it sets the "finished" flag. This gets sent to JS in `animated/animations/Animation.js`. In this diff I'm passing the value when 'hasFinishedAnimations' is true, but in a follow up diff I will look into other cases such as cancelled animations Next: 2. Update the Animated.Value to reflect the new values 3. Call the onEnd function if there is one set 4. Pass the new values down for layout calculations and the correct Pressability responder region Changelog: [General][Changed] - return animated values to JS for natively driven animations Reviewed By: javache Differential Revision: D44110833 fbshipit-source-id: ce8c09fbe20c0c155260ce9561a67f7dfba30515 --- .../Libraries/Animated/AnimatedImplementation.js | 2 +- .../react-native/Libraries/Animated/NativeAnimatedModule.js | 2 +- .../Libraries/Animated/NativeAnimatedTurboModule.js | 2 +- .../react-native/Libraries/Animated/animations/Animation.js | 2 +- .../facebook/react/animated/NativeAnimatedNodesManager.java | 6 ++++++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/react-native/Libraries/Animated/AnimatedImplementation.js b/packages/react-native/Libraries/Animated/AnimatedImplementation.js index 7e25c65f2a461e..e516115733360b 100644 --- a/packages/react-native/Libraries/Animated/AnimatedImplementation.js +++ b/packages/react-native/Libraries/Animated/AnimatedImplementation.js @@ -378,7 +378,7 @@ const parallel = function ( } animations.forEach((animation, idx) => { - const cb = function (endResult: EndResult | {finished: boolean}) { + const cb = function (endResult: EndResult) { hasEnded[idx] = true; doneCount++; if (doneCount === animations.length) { diff --git a/packages/react-native/Libraries/Animated/NativeAnimatedModule.js b/packages/react-native/Libraries/Animated/NativeAnimatedModule.js index a080eb4d66eb0f..5094739f4fd90d 100644 --- a/packages/react-native/Libraries/Animated/NativeAnimatedModule.js +++ b/packages/react-native/Libraries/Animated/NativeAnimatedModule.js @@ -13,7 +13,7 @@ import type {TurboModule} from '../TurboModule/RCTExport'; import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; import shouldUseTurboAnimatedModule from './shouldUseTurboAnimatedModule'; -type EndResult = {finished: boolean, ...}; +type EndResult = {finished: boolean, value?: number, ...}; type EndCallback = (result: EndResult) => void; type SaveValueCallback = (value: number) => void; diff --git a/packages/react-native/Libraries/Animated/NativeAnimatedTurboModule.js b/packages/react-native/Libraries/Animated/NativeAnimatedTurboModule.js index f9ea5881232273..35a4ffa16bf576 100644 --- a/packages/react-native/Libraries/Animated/NativeAnimatedTurboModule.js +++ b/packages/react-native/Libraries/Animated/NativeAnimatedTurboModule.js @@ -13,7 +13,7 @@ import type {TurboModule} from '../TurboModule/RCTExport'; import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; import shouldUseTurboAnimatedModule from './shouldUseTurboAnimatedModule'; -type EndResult = {finished: boolean, ...}; +type EndResult = {finished: boolean, value?: number, ...}; type EndCallback = (result: EndResult) => void; type SaveValueCallback = (value: number) => void; diff --git a/packages/react-native/Libraries/Animated/animations/Animation.js b/packages/react-native/Libraries/Animated/animations/Animation.js index f3d2ac6d3ac234..d71a86b5137d7d 100644 --- a/packages/react-native/Libraries/Animated/animations/Animation.js +++ b/packages/react-native/Libraries/Animated/animations/Animation.js @@ -15,7 +15,7 @@ import type AnimatedValue from '../nodes/AnimatedValue'; import NativeAnimatedHelper from '../NativeAnimatedHelper'; -export type EndResult = {finished: boolean, ...}; +export type EndResult = {finished: boolean, value?: number, ...}; export type EndCallback = (result: EndResult) => void; export type AnimationConfig = { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java index 4ca3aa3a180c3d..79805825767cb2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java @@ -302,6 +302,7 @@ private void stopAnimationsForNode(AnimatedNode animatedNode) { // Invoke animation end callback with {finished: false} WritableMap endCallbackResponse = Arguments.createMap(); endCallbackResponse.putBoolean("finished", false); + endCallbackResponse.putDouble("value", animation.mAnimatedValue.mValue); animation.mEndCallback.invoke(endCallbackResponse); } else if (mReactApplicationContext != null) { // If no callback is passed in, this /may/ be an animation set up by the single-op @@ -310,6 +311,7 @@ private void stopAnimationsForNode(AnimatedNode animatedNode) { WritableMap params = Arguments.createMap(); params.putInt("animationId", animation.mId); params.putBoolean("finished", false); + params.putDouble("value", animation.mAnimatedValue.mValue); mReactApplicationContext.emitDeviceEvent( "onNativeAnimatedModuleAnimationFinished", params); } @@ -332,6 +334,7 @@ public void stopAnimation(int animationId) { // Invoke animation end callback with {finished: false} WritableMap endCallbackResponse = Arguments.createMap(); endCallbackResponse.putBoolean("finished", false); + endCallbackResponse.putDouble("value", animation.mAnimatedValue.mValue); animation.mEndCallback.invoke(endCallbackResponse); } else if (mReactApplicationContext != null) { // If no callback is passed in, this /may/ be an animation set up by the single-op @@ -340,6 +343,7 @@ public void stopAnimation(int animationId) { WritableMap params = Arguments.createMap(); params.putInt("animationId", animation.mId); params.putBoolean("finished", false); + params.putDouble("value", animation.mAnimatedValue.mValue); mReactApplicationContext.emitDeviceEvent( "onNativeAnimatedModuleAnimationFinished", params); } @@ -645,6 +649,7 @@ public void runUpdates(long frameTimeNanos) { if (animation.mEndCallback != null) { WritableMap endCallbackResponse = Arguments.createMap(); endCallbackResponse.putBoolean("finished", true); + endCallbackResponse.putDouble("value", animation.mAnimatedValue.mValue); animation.mEndCallback.invoke(endCallbackResponse); } else if (mReactApplicationContext != null) { // If no callback is passed in, this /may/ be an animation set up by the single-op @@ -653,6 +658,7 @@ public void runUpdates(long frameTimeNanos) { WritableMap params = Arguments.createMap(); params.putInt("animationId", animation.mId); params.putBoolean("finished", true); + params.putDouble("value", animation.mAnimatedValue.mValue); mReactApplicationContext.emitDeviceEvent( "onNativeAnimatedModuleAnimationFinished", params); } From 48c0e41d061599f94887058373d15c7e54b80918 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 8 Jun 2023 18:38:55 -0700 Subject: [PATCH 090/468] Revert D46501420: Exclude trailing whitespace on measuring text width Differential Revision: D46501420 Original commit changeset: fba4acd38747 Original Phabricator Diff: D46501420 fbshipit-source-id: 64c76b96d0e12f9bd7edd4640904de9fce3b44e6 --- .../com/facebook/react/views/text/FontMetricsUtil.java | 4 +--- .../facebook/react/views/text/ReactTextShadowNode.java | 4 +--- .../java/com/facebook/react/views/text/ReactTextView.java | 4 +--- .../com/facebook/react/views/text/TextLayoutManager.java | 8 ++------ .../react/views/text/TextLayoutManagerMapBuffer.java | 8 ++------ 5 files changed, 7 insertions(+), 21 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java index af97ee9cb91f08..f19a1b0425888d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java @@ -42,14 +42,12 @@ public static WritableArray getFontMetrics( X_HEIGHT_MEASUREMENT_TEXT, 0, X_HEIGHT_MEASUREMENT_TEXT.length(), xHeightBounds); double xHeight = xHeightBounds.height() / AMPLIFICATION_FACTOR / dm.density; for (int i = 0; i < layout.getLineCount(); i++) { - boolean endsWithNewLine = text.charAt(layout.getLineEnd(i) - 1) == '\n'; - float lineWidth = endsWithNewLine ? layout.getLineMax(i) : layout.getLineWidth(i); Rect bounds = new Rect(); layout.getLineBounds(i, bounds); WritableMap line = Arguments.createMap(); line.putDouble("x", layout.getLineLeft(i) / dm.density); line.putDouble("y", bounds.top / dm.density); - line.putDouble("width", lineWidth / dm.density); + line.putDouble("width", layout.getLineWidth(i) / dm.density); line.putDouble("height", bounds.height() / dm.density); line.putDouble("descender", layout.getLineDescent(i) / dm.density); line.putDouble("ascender", -layout.getLineAscent(i) / dm.density); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java index 1e4d1f0b1f3b7d..2e237f01970fb5 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java @@ -135,9 +135,7 @@ public long measure( layoutWidth = width; } else { for (int lineIndex = 0; lineIndex < lineCount; lineIndex++) { - boolean endsWithNewLine = text.charAt(layout.getLineEnd(lineIndex) - 1) == '\n'; - float lineWidth = - endsWithNewLine ? layout.getLineMax(lineIndex) : layout.getLineWidth(lineIndex); + float lineWidth = layout.getLineWidth(lineIndex); if (lineWidth > layoutWidth) { layoutWidth = lineWidth; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java index 402244d022d723..43ffc0d31dc2a7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java @@ -267,13 +267,11 @@ protected void onLayout( // the last offset in the layout will result in an endless loop. Work around // this bug by avoiding getPrimaryHorizontal in that case. if (start == text.length() - 1) { - boolean endsWithNewLine = text.charAt(layout.getLineEnd(line) - 1) == '\n'; - float lineWidth = endsWithNewLine ? layout.getLineMax(line) : layout.getLineWidth(line); placeholderHorizontalPosition = isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? textViewWidth - (int) lineWidth + ? textViewWidth - (int) layout.getLineWidth(line) : (int) layout.getLineRight(line) - width; } else { // The direction of the paragraph may not be exactly the direction the string is heading diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index baee29108b8514..25bfe983255cc7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -407,9 +407,7 @@ public static long measureText( calculatedWidth = width; } else { for (int lineIndex = 0; lineIndex < calculatedLineCount; lineIndex++) { - boolean endsWithNewLine = text.charAt(layout.getLineEnd(lineIndex) - 1) == '\n'; - float lineWidth = - endsWithNewLine ? layout.getLineMax(lineIndex) : layout.getLineWidth(lineIndex); + float lineWidth = layout.getLineWidth(lineIndex); if (lineWidth > calculatedWidth) { calculatedWidth = lineWidth; } @@ -464,13 +462,11 @@ public static long measureText( // the last offset in the layout will result in an endless loop. Work around // this bug by avoiding getPrimaryHorizontal in that case. if (start == text.length() - 1) { - boolean endsWithNewLine = text.charAt(layout.getLineEnd(line) - 1) == '\n'; - float lineWidth = endsWithNewLine ? layout.getLineMax(line) : layout.getLineWidth(line); placeholderLeftPosition = isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? calculatedWidth - lineWidth + ? calculatedWidth - layout.getLineWidth(line) : layout.getLineRight(line) - placeholderWidth; } else { // The direction of the paragraph may not be exactly the direction the string is heading diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java index f0107204f8b962..71703755597285 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java @@ -429,9 +429,7 @@ public static long measureText( calculatedWidth = width; } else { for (int lineIndex = 0; lineIndex < calculatedLineCount; lineIndex++) { - boolean endsWithNewLine = text.charAt(layout.getLineEnd(lineIndex) - 1) == '\n'; - float lineWidth = - endsWithNewLine ? layout.getLineMax(lineIndex) : layout.getLineWidth(lineIndex); + float lineWidth = layout.getLineWidth(lineIndex); if (lineWidth > calculatedWidth) { calculatedWidth = lineWidth; } @@ -486,14 +484,12 @@ public static long measureText( // the last offset in the layout will result in an endless loop. Work around // this bug by avoiding getPrimaryHorizontal in that case. if (start == text.length() - 1) { - boolean endsWithNewLine = text.charAt(layout.getLineEnd(line) - 1) == '\n'; - float lineWidth = endsWithNewLine ? layout.getLineMax(line) : layout.getLineWidth(line); placeholderLeftPosition = isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns // incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? calculatedWidth - lineWidth + ? calculatedWidth - layout.getLineWidth(line) : layout.getLineRight(line) - placeholderWidth; } else { // The direction of the paragraph may not be exactly the direction the string is From 5cc8ceeae210f2f23ef18ded7b7b614682f0d67b Mon Sep 17 00:00:00 2001 From: Lorenzo Sciandra Date: Thu, 8 Jun 2023 21:53:05 -0700 Subject: [PATCH 091/468] add 0.71.9 and 0.71.10 changelog (#37760) Summary: Adds changelog for new patch. ## Changelog: [Internal] [Changed] - add changelog entry for 0.71.9 and 0.71.10 Pull Request resolved: https://github.com/facebook/react-native/pull/37760 Test Plan: N/A Reviewed By: NickGerleman, cipolleschi Differential Revision: D46525847 Pulled By: lunaleaps fbshipit-source-id: 044e6c9f62db29c26754ab6981adf5cbeabf67b1 --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3fff0ce8b372a..2e57237ddd9f03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## v0.71.10 + +### Fixed + +#### Android specific + +- Bump RNGP to 0.71.19 ([3be3a7d1a2](https://github.com/facebook/react-native/commit/3be3a7d1a2840a045892ddd8e5f2263028e15127) by [@kelset](https://github.com/kelset)) + - contains: RNGP dependency substitutions for fork with different Maven group ([012e4bd654](https://github.com/facebook/react-native/commit/012e4bd654f1eee2b00a066ba50a7f9c44cc305b) by [@douglowder](https://github.com/douglowder)) + +## v0.71.9 + +### Fixed + +- VirtualizedList scrollToEnd with no data ([98009ad94b](https://github.com/facebook/react-native/commit/98009ad94b92320307f2721ee39dbeb9152c0a58) by [@Andarius](https://github.com/Andarius)) +- Allow string `transform` style in TypeScript ([2558c3d4f5](https://github.com/facebook/react-native/commit/2558c3d4f56776699602b116aff8c22b8bfa176a) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix autoComplete type for TextInput ([94356e14ec](https://github.com/facebook/react-native/commit/94356e14ec0562a1fd5a208d93021f102ba9565e) by [@iRoachie](https://github.com/iRoachie)) + ## v0.71.8 ### Fixed From 0aa330801b8fb94d6a794bcada20df428a51ab91 Mon Sep 17 00:00:00 2001 From: brunohensel Date: Fri, 9 Jun 2023 06:18:18 -0700 Subject: [PATCH 092/468] Migrate MultipartStreamReaderTest to Kotlin (#37743) Summary: Migrate [MultipartStreamReaderTest.java](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.java) to Kotlin. See https://github.com/facebook/react-native/issues/37708 ## Changelog: [INTERNAL] [CHANGED] - Migrate MultipartStreamReaderTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37743 Test Plan: Tests pass: ./gradlew :packages:react-native:ReactAndroid:test Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: mdvacca Differential Revision: D46559844 Pulled By: cortinico fbshipit-source-id: 4cc7b0cb9819930567c4021dace0c48e93be333c --- .../devsupport/MultipartStreamReaderTest.java | 151 ------------------ .../devsupport/MultipartStreamReaderTest.kt | 140 ++++++++++++++++ 2 files changed, 140 insertions(+), 151 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.java deleted file mode 100644 index 63612bc66d5ff4..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.java +++ /dev/null @@ -1,151 +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.react.devsupport; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.IOException; -import java.util.Map; -import okio.Buffer; -import okio.ByteString; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; - -@RunWith(RobolectricTestRunner.class) -public class MultipartStreamReaderTest { - - class CallCountTrackingChunkCallback implements MultipartStreamReader.ChunkListener { - private int mCount = 0; - - @Override - public void onChunkComplete(Map headers, Buffer body, boolean done) - throws IOException { - mCount++; - } - - @Override - public void onChunkProgress(Map headers, long loaded, long total) - throws IOException {} - - public int getCallCount() { - return mCount; - } - } - - @Test - public void testSimpleCase() throws IOException { - ByteString response = - ByteString.encodeUtf8( - "preable, should be ignored\r\n" - + "--sample_boundary\r\n" - + "Content-Type: application/json; charset=utf-8\r\n" - + "Content-Length: 2\r\n\r\n" - + "{}\r\n" - + "--sample_boundary--\r\n" - + "epilogue, should be ignored"); - - Buffer source = new Buffer(); - source.write(response); - - MultipartStreamReader reader = new MultipartStreamReader(source, "sample_boundary"); - - CallCountTrackingChunkCallback callback = - new CallCountTrackingChunkCallback() { - @Override - public void onChunkComplete(Map headers, Buffer body, boolean done) - throws IOException { - super.onChunkComplete(headers, body, done); - - assertThat(done).isTrue(); - assertThat(headers.get("Content-Type")).isEqualTo("application/json; charset=utf-8"); - assertThat(body.readUtf8()).isEqualTo("{}"); - } - }; - boolean success = reader.readAllParts(callback); - - assertThat(callback.getCallCount()).isEqualTo(1); - assertThat(success).isTrue(); - } - - @Test - public void testMultipleParts() throws IOException { - ByteString response = - ByteString.encodeUtf8( - "preable, should be ignored\r\n" - + "--sample_boundary\r\n" - + "1\r\n" - + "--sample_boundary\r\n" - + "2\r\n" - + "--sample_boundary\r\n" - + "3\r\n" - + "--sample_boundary--\r\n" - + "epilogue, should be ignored"); - - Buffer source = new Buffer(); - source.write(response); - - MultipartStreamReader reader = new MultipartStreamReader(source, "sample_boundary"); - - CallCountTrackingChunkCallback callback = - new CallCountTrackingChunkCallback() { - @Override - public void onChunkComplete(Map headers, Buffer body, boolean done) - throws IOException { - super.onChunkComplete(headers, body, done); - - assertThat(done).isEqualTo(getCallCount() == 3); - assertThat(body.readUtf8()).isEqualTo(String.valueOf(getCallCount())); - } - }; - boolean success = reader.readAllParts(callback); - - assertThat(callback.getCallCount()).isEqualTo(3); - assertThat(success).isTrue(); - } - - @Test - public void testNoDelimiter() throws IOException { - ByteString response = ByteString.encodeUtf8("Yolo"); - - Buffer source = new Buffer(); - source.write(response); - - MultipartStreamReader reader = new MultipartStreamReader(source, "sample_boundary"); - - CallCountTrackingChunkCallback callback = new CallCountTrackingChunkCallback(); - boolean success = reader.readAllParts(callback); - - assertThat(callback.getCallCount()).isEqualTo(0); - assertThat(success).isFalse(); - } - - @Test - public void testNoCloseDelimiter() throws IOException { - ByteString response = - ByteString.encodeUtf8( - "preable, should be ignored\r\n" - + "--sample_boundary\r\n" - + "Content-Type: application/json; charset=utf-8\r\n" - + "Content-Length: 2\r\n\r\n" - + "{}\r\n" - + "--sample_boundary\r\n" - + "incomplete message..."); - - Buffer source = new Buffer(); - source.write(response); - - MultipartStreamReader reader = new MultipartStreamReader(source, "sample_boundary"); - - CallCountTrackingChunkCallback callback = new CallCountTrackingChunkCallback(); - boolean success = reader.readAllParts(callback); - - assertThat(callback.getCallCount()).isEqualTo(1); - assertThat(success).isFalse(); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.kt new file mode 100644 index 00000000000000..87e37867cf749d --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/MultipartStreamReaderTest.kt @@ -0,0 +1,140 @@ +/* + * 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.react.devsupport + +import okio.Buffer +import okio.ByteString +import org.assertj.core.api.Assertions.assertThat +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner + +@RunWith(RobolectricTestRunner::class) +class MultipartStreamReaderTest { + + @Test + fun testSimpleCase() { + val response: ByteString = + encodeUtf8( + "preamble, should be ignored\r\n" + + "--sample_boundary\r\n" + + "Content-Type: application/json; charset=utf-8\r\n" + + "Content-Length: 2\r\n\r\n" + + "{}\r\n" + + "--sample_boundary--\r\n" + + "epilogue, should be ignored") + + val source = Buffer() + source.write(response) + + val reader = MultipartStreamReader(source, "sample_boundary") + + val callback: CallCountTrackingChunkCallback = + object : CallCountTrackingChunkCallback() { + override fun onChunkComplete(headers: Map?, body: Buffer, done: Boolean) { + super.onChunkComplete(headers, body, done) + + assertThat(done).isTrue + assertThat(headers!!["Content-Type"]).isEqualTo("application/json; charset=utf-8") + assertThat(body.readUtf8()).isEqualTo("{}") + } + } + val success = reader.readAllParts(callback) + + assertThat(callback.callCount).isEqualTo(1) + assertThat(success).isTrue + } + + @Test + fun testMultipleParts() { + val response: ByteString = + encodeUtf8( + "preamble, should be ignored\r\n" + + "--sample_boundary\r\n" + + "1\r\n" + + "--sample_boundary\r\n" + + "2\r\n" + + "--sample_boundary\r\n" + + "3\r\n" + + "--sample_boundary--\r\n" + + "epilogue, should be ignored") + + val source = Buffer() + source.write(response) + + val reader = MultipartStreamReader(source, "sample_boundary") + + val callback: CallCountTrackingChunkCallback = + object : CallCountTrackingChunkCallback() { + override fun onChunkComplete(headers: Map?, body: Buffer, done: Boolean) { + super.onChunkComplete(headers, body, done) + + assertThat(done).isEqualTo(callCount == 3) + assertThat(body.readUtf8()).isEqualTo("$callCount") + } + } + val success = reader.readAllParts(callback) + + assertThat(callback.callCount).isEqualTo(3) + assertThat(success).isTrue + } + + @Test + fun testNoDelimiter() { + val response: ByteString = encodeUtf8("Yolo") + + val source = Buffer() + source.write(response) + + val reader = MultipartStreamReader(source, "sample_boundary") + + val callback = CallCountTrackingChunkCallback() + val success = reader.readAllParts(callback) + + assertThat(callback.callCount).isEqualTo(0) + assertThat(success).isFalse + } + + @Test + fun testNoCloseDelimiter() { + val response: ByteString = + encodeUtf8( + "preamble, should be ignored\r\n" + + "--sample_boundary\r\n" + + "Content-Type: application/json; charset=utf-8\r\n" + + "Content-Length: 2\r\n\r\n" + + "{}\r\n" + + "--sample_boundary\r\n" + + "incomplete message...") + + val source = Buffer() + source.write(response) + + val reader = MultipartStreamReader(source, "sample_boundary") + + val callback = CallCountTrackingChunkCallback() + val success = reader.readAllParts(callback) + + assertThat(callback.callCount).isEqualTo(1) + assertThat(success).isFalse + } + + internal open class CallCountTrackingChunkCallback : MultipartStreamReader.ChunkListener { + var callCount = 0 + private set + + override fun onChunkComplete(headers: Map?, body: Buffer, done: Boolean) { + callCount++ + } + + override fun onChunkProgress(headers: Map, loaded: Long, total: Long) {} + } + + private fun encodeUtf8(input: String): ByteString = + ByteString.of(*input.toByteArray(Charsets.UTF_8)) +} From 6ebee63ab78daa3f0863a2ae4e2f2b05dbcdd965 Mon Sep 17 00:00:00 2001 From: Abdennour JEBBAR Date: Fri, 9 Jun 2023 07:08:08 -0700 Subject: [PATCH 093/468] Convert ReactTestHelper (#37768) Summary: As part of the effort to Kotlin-fy React Native tests, I've converted [ReactTestHelper](https://github.com/facebook/react-native/tree/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.java) to Kotlin. ## Changelog: [Internal] [Changed] - Convert ReactTestHelper to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37768 Test Plan: Tests pass: ./gradlew :packages:react-native:ReactAndroid:test Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: rshest Differential Revision: D46587427 Pulled By: cortinico fbshipit-source-id: 82d08d01cf4c7cb7c05a63696e1acdacf60b1ad5 --- .../react/bridge/ReactTestHelper.java | 59 ------------------- .../facebook/react/bridge/ReactTestHelper.kt | 48 +++++++++++++++ 2 files changed, 48 insertions(+), 59 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.java deleted file mode 100644 index 717b689a2b04af..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.java +++ /dev/null @@ -1,59 +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.react.bridge; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -import com.facebook.react.bridge.queue.MessageQueueThreadSpec; -import com.facebook.react.bridge.queue.QueueThreadExceptionHandler; -import com.facebook.react.bridge.queue.ReactQueueConfiguration; -import com.facebook.react.bridge.queue.ReactQueueConfigurationImpl; -import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec; -import com.facebook.react.uimanager.UIManagerModule; -import org.robolectric.RuntimeEnvironment; - -/** Utility for creating pre-configured instances of core react components for tests. */ -public class ReactTestHelper { - - /** - * @return a ReactApplicationContext that has a CatalystInstance mock returned by {@link - * #createMockCatalystInstance} - */ - public static ReactApplicationContext createCatalystContextForTest() { - ReactApplicationContext context = new ReactApplicationContext(RuntimeEnvironment.application); - context.initializeWithInstance(createMockCatalystInstance()); - return context; - } - - /** @return a CatalystInstance mock that has a default working ReactQueueConfiguration. */ - public static CatalystInstance createMockCatalystInstance() { - ReactQueueConfigurationSpec spec = - ReactQueueConfigurationSpec.builder() - .setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec()) - .setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec()) - .build(); - ReactQueueConfiguration ReactQueueConfiguration = - ReactQueueConfigurationImpl.create( - spec, - new QueueThreadExceptionHandler() { - @Override - public void handleException(Exception e) { - throw new RuntimeException(e); - } - }); - - CatalystInstance reactInstance = mock(CatalystInstance.class); - when(reactInstance.getReactQueueConfiguration()).thenReturn(ReactQueueConfiguration); - when(reactInstance.getNativeModule(UIManagerModule.class)) - .thenReturn(mock(UIManagerModule.class)); - when(reactInstance.isDestroyed()).thenReturn(false); - - return reactInstance; - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.kt new file mode 100644 index 00000000000000..18a49fb04a003c --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/ReactTestHelper.kt @@ -0,0 +1,48 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.react.bridge + +import com.facebook.react.bridge.queue.MessageQueueThreadSpec +import com.facebook.react.bridge.queue.ReactQueueConfiguration +import com.facebook.react.bridge.queue.ReactQueueConfigurationImpl +import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec +import com.facebook.react.uimanager.UIManagerModule +import org.mockito.Mockito.mock +import org.mockito.Mockito.`when` as whenever +import org.robolectric.RuntimeEnvironment + +/** Utility for creating pre-configured instances of core react components for tests. */ +object ReactTestHelper { + /** + * @return a ReactApplicationContext that has a CatalystInstance mock returned by + * [createMockCatalystInstance] + */ + @JvmStatic + fun createCatalystContextForTest(): ReactApplicationContext = + ReactApplicationContext(RuntimeEnvironment.application).apply { + initializeWithInstance(createMockCatalystInstance()) + } + + /** @return a CatalystInstance mock that has a default working ReactQueueConfiguration. */ + @JvmStatic + fun createMockCatalystInstance(): CatalystInstance { + val spec: ReactQueueConfigurationSpec = + ReactQueueConfigurationSpec.builder() + .setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec()) + .setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec()) + .build() + val reactQueueConfiguration: ReactQueueConfiguration = + ReactQueueConfigurationImpl.create(spec) { e -> throw RuntimeException(e) } + val reactInstance: CatalystInstance = mock(CatalystInstance::class.java) + whenever(reactInstance.getReactQueueConfiguration()).thenReturn(reactQueueConfiguration) + whenever(reactInstance.getNativeModule(UIManagerModule::class.java)) + .thenReturn(mock(UIManagerModule::class.java)) + whenever(reactInstance.isDestroyed()).thenReturn(false) + return reactInstance + } +} From b63efe202774ab843e8d96581dc3b3ec977492cd Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 9 Jun 2023 07:44:52 -0700 Subject: [PATCH 094/468] Remove dependency from PRODUCTION flag from React-hermes (#37723) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37723 React-hermes pod sets the `GCC_PREPROCESSOR_DEFINITIONS` flag for Debug config only, by leveraging the `PRODUCTION=1` flag. This flag is not standard for iOS, therefore we want to remove it from the condebase to simplify the build APIs. This change moves the setting of the `GCC_PREPROCESSOR_DEFINITIONS` flag from the podspec xcconfig (which can't distinguish between Debug and Release configurations) to a post install hook (which can). ## Changelog: [internal] - Remove dependency on PRODUCTION=1 from React-hermes podspec Reviewed By: dmytrorykun Differential Revision: D46316662 fbshipit-source-id: b5764e1bf60f2e71ff171556bccbc00c0c0c62aa --- .../ReactCommon/hermes/React-hermes.podspec | 3 +- .../scripts/cocoapods/__tests__/utils-test.rb | 34 +++++++++++++++++++ .../react-native/scripts/cocoapods/utils.rb | 16 +++++++++ .../react-native/scripts/react_native_pods.rb | 4 +++ 4 files changed, 55 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/hermes/React-hermes.podspec b/packages/react-native/ReactCommon/hermes/React-hermes.podspec index e89b85829f663c..72f16d96d388d7 100644 --- a/packages/react-native/ReactCommon/hermes/React-hermes.podspec +++ b/packages/react-native/ReactCommon/hermes/React-hermes.podspec @@ -6,7 +6,6 @@ require "json" # Whether Hermes is built for Release or Debug is determined by the PRODUCTION envvar. -build_type = ENV['PRODUCTION'] == "1" ? :release : :debug # package.json package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json"))) @@ -42,7 +41,7 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/hermes-engine/destroot/include\" \"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/libevent/include\"", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" - }.merge!(build_type == :debug ? { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } : {}) + } s.header_dir = "reacthermes" s.dependency "React-cxxreact", version s.dependency "React-jsiexecutor", version diff --git a/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb index c18b7a78de2c5c..44fb7c6c557b38 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb @@ -174,6 +174,40 @@ def test_hasPod_whenInstallerHasPod_returnTrue assert_equal(result, true) end + # ======================================================== # + # Test - Set GCC Preprocessor Definition for React-hermes # + # ======================================================== # + + def test_SetGCCPreprocessorDefinitionForReactHermes_itSetsThePreprocessorForDebug + # Arrange + react_hermes_name = "React-hermes" + react_core_name = "React-Core" + react_hermes_debug_config = BuildConfigurationMock.new("Debug") + react_hermes_release_config = BuildConfigurationMock.new("Release") + react_core_debug_config = BuildConfigurationMock.new("Debug") + react_core_release_config = BuildConfigurationMock.new("Release") + react_hermes_target = TargetMock.new(react_hermes_name, [react_hermes_debug_config, react_hermes_release_config]) + react_core_target = TargetMock.new(react_core_name, [react_core_debug_config, react_core_release_config]) + + installer = InstallerMock.new( + :pod_target_installation_results => { + react_hermes_name => TargetInstallationResultMock.new(react_hermes_target, react_hermes_target), + react_core_name => TargetInstallationResultMock.new(react_core_target, react_core_target), + } + ) + + # Act + ReactNativePodsUtils.set_gcc_preprocessor_definition_for_React_hermes(installer) + + # Assert + build_setting = "GCC_PREPROCESSOR_DEFINITIONS" + expected_value = "HERMES_ENABLE_DEBUGGER=1" + assert_equal(expected_value, react_hermes_debug_config.build_settings[build_setting]) + assert_nil(react_hermes_release_config.build_settings[build_setting]) + assert_nil(react_core_debug_config.build_settings[build_setting]) + assert_nil(react_core_release_config.build_settings[build_setting]) + end + # ============================ # # Test - Exclude Architectures # # ============================ # diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index 17b9cef479bb09..91c638f50afb4e 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -39,6 +39,10 @@ def self.has_pod(installer, name) installer.pods_project.pod_group(name) != nil end + def self.set_gcc_preprocessor_definition_for_React_hermes(installer) + self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-hermes", "Debug") + end + def self.turn_off_resource_bundle_react_core(installer) # this is needed for Xcode 14, see more details here https://github.com/facebook/react-native/issues/34673 # we should be able to remove this once CocoaPods catches up to it, see more details here https://github.com/CocoaPods/CocoaPods/issues/11402 @@ -144,6 +148,18 @@ def self.apply_flags_for_fabric(installer, fabric_enabled: false) private + def self.add_build_settings_to_pod(installer, settings_name, settings_value, target_pod_name, configuration) + installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result| + if pod_name.to_s == target_pod_name + target_installation_result.native_target.build_configurations.each do |config| + if configuration == nil || (configuration != nil && configuration == config.name) + config.build_settings[settings_name] = settings_value + end + end + end + end + end + def self.fix_library_search_path(config) lib_search_paths = config.build_settings["LIBRARY_SEARCH_PATHS"] diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index b3128401896609..cee3065b2ef64e 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -237,6 +237,10 @@ def react_native_post_install( fabric_enabled = ReactNativePodsUtils.has_pod(installer, 'React-Fabric') + if ReactNativePodsUtils.has_pod(installer, "React-hermes") + ReactNativePodsUtils.set_gcc_preprocessor_definition_for_React_hermes(installer) + end + ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer) ReactNativePodsUtils.fix_library_search_paths(installer) ReactNativePodsUtils.update_search_paths(installer) From 72eadcf76937d743728d2e2017cfbd8642ea7aa4 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005325672 Date: Fri, 9 Jun 2023 08:31:35 -0700 Subject: [PATCH 095/468] Daily `arc lint --take KTFMT` (#37803) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37803 Reviewed By: bigfootjon Differential Revision: D46587932 fbshipit-source-id: acb9c4ba33cc980904996f4af54ed366abe66c70 --- .../facebook/react/animated/NativeAnimatedInterpolationTest.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.kt index 0c131c7b04dbc3..32355ae5fb650d 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedInterpolationTest.kt @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ - package com.facebook.react.animated import org.assertj.core.api.Assertions.assertThat From 96fd107d61da9b195928a2a6cfdc39fc095767b4 Mon Sep 17 00:00:00 2001 From: Alex Danoff Date: Fri, 9 Jun 2023 08:42:27 -0700 Subject: [PATCH 096/468] W3CPointerEvents: fix NPE due to null targetView (#37785) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37785 Changelog: [Android] [Fixed] - W3CPointerEvents: fix NPE due to null targetView For reasons not entirely understood, we sometimes end up with a null `targetView` in this code path during the dispatch of an `ACTION_CANCEL`. This results in an NPE during the call to `getChildOffsetRelativeToRoot`. This change adds a null check before the call to avoid the crash. Reviewed By: cortinico Differential Revision: D46562263 fbshipit-source-id: fe60fe08929ed29a570a860d49915b6f5ae4a542 --- .../java/com/facebook/react/uimanager/JSPointerDispatcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java index 0f1a206ba0bfaa..eb970dfbfb443f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java @@ -615,7 +615,7 @@ private void dispatchCancelEventForTarget( int activePointerId = eventState.getActivePointerId(); List activeHitPath = eventState.getHitPathByPointerId().get(activePointerId); - if (!activeHitPath.isEmpty()) { + if (!activeHitPath.isEmpty() && targetView != null) { boolean listeningForCancel = isAnyoneListeningForBubblingEvent(activeHitPath, EVENT.CANCEL, EVENT.CANCEL_CAPTURE); if (listeningForCancel) { From ee3a8a495a2aed696b686a46cb768ae4917c8b5c Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Date: Fri, 9 Jun 2023 09:06:37 -0700 Subject: [PATCH 097/468] Fix loading NODE_BINARY inside Generate Legacy Components Interop (#37802) Summary: When trying to build an app using 0.72.0-RC.5 inside a project that uses `.xcode.env.local` the `[CP-User] Generate Legacy Components Interop` Phase script fails to run due to a `Permission denied` error. That's because `.xcode.env.local` is not being loaded, resulting in `NODE_BINARY=" "` and then the `React-RCTAppDelegate` script tries to run `generate-legacy-interop-components.js` directly. E.g ![image](https://github.com/facebook/react-native/assets/11707729/ce72d7d1-69ab-4477-a754-10cd52bb21a2) In order to fix this we should run the `with-environment.sh` script instead of directly loading `.${PODS_ROOT}/../.xcode.env` ## Changelog: [IOS] [FIXED] - Fix loading `NODE_BINARY` inside Generate Legacy Components Interop Pull Request resolved: https://github.com/facebook/react-native/pull/37802 Test Plan: Make sure you don't have a `.xcode.env` file and run locally a project that uses React-RCTAppDelegate Reviewed By: cortinico Differential Revision: D46596246 Pulled By: cipolleschi fbshipit-source-id: 5616395f39b0fae7b2fa9e59bd72c70f39198b4d --- .../Libraries/AppDelegate/React-RCTAppDelegate.podspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec index 3cb77a170bb6af..9888ded6fb3b8e 100644 --- a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec +++ b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec @@ -97,7 +97,8 @@ Pod::Spec.new do |s| s.script_phases = { :name => "Generate Legacy Components Interop", :script => " -. ${PODS_ROOT}/../.xcode.env +WITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\" +source $WITH_ENVIRONMENT ${NODE_BINARY} ${REACT_NATIVE_PATH}/scripts/codegen/generate-legacy-interop-components.js -p #{ENV['APP_PATH']} -o ${REACT_NATIVE_PATH}/Libraries/AppDelegate ", :execution_position => :before_compile, From 7bcff07f139a4529c4d4193f4ea7c31ac01f6775 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Fri, 9 Jun 2023 09:20:08 -0700 Subject: [PATCH 098/468] Refactor nightly monorepo publish script (#37707) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37707 Changelog: [Internal] - Refactor nightly monorepo publish script to also return a map of packages and their current nightly version and rename to reflect. This may refer to a nightly version that was just published (if we detect changes) or the nightly tag on npm if no changes. In subsequent diffs, will update the react-native nightly script to use this map to set the versions for nightly react-native versions. Reviewed By: hoxyq Differential Revision: D46450703 fbshipit-source-id: c4e425924aa6cfdcf10e932e1b151ba05d9b7237 --- scripts/__tests__/publish-npm-test.js | 2 +- ...st.js => get-and-update-nightlies-test.js} | 58 +++++++++++++++---- ...package.js => get-and-update-nightlies.js} | 14 +++-- scripts/publish-npm.js | 4 +- 4 files changed, 60 insertions(+), 18 deletions(-) rename scripts/monorepo/__tests__/{publish-nightly-for-each-changed-package-test.js => get-and-update-nightlies-test.js} (54%) rename scripts/monorepo/{publish-nightly-for-each-changed-package.js => get-and-update-nightlies.js} (88%) diff --git a/scripts/__tests__/publish-npm-test.js b/scripts/__tests__/publish-npm-test.js index 32bc613ff98628..3f2b88626a8728 100644 --- a/scripts/__tests__/publish-npm-test.js +++ b/scripts/__tests__/publish-npm-test.js @@ -33,7 +33,7 @@ jest generateAndroidArtifacts: jest.fn(), publishAndroidArtifactsToMaven: publishAndroidArtifactsToMavenMock, })) - .mock('../monorepo/publish-nightly-for-each-changed-package'); + .mock('../monorepo/get-and-update-nightlies'); const date = new Date('2023-04-20T23:52:39.543Z'); diff --git a/scripts/monorepo/__tests__/publish-nightly-for-each-changed-package-test.js b/scripts/monorepo/__tests__/get-and-update-nightlies-test.js similarity index 54% rename from scripts/monorepo/__tests__/publish-nightly-for-each-changed-package-test.js rename to scripts/monorepo/__tests__/get-and-update-nightlies-test.js index b7d420809bfec6..5453b0c7344997 100644 --- a/scripts/monorepo/__tests__/publish-nightly-for-each-changed-package-test.js +++ b/scripts/monorepo/__tests__/get-and-update-nightlies-test.js @@ -7,11 +7,12 @@ * @format */ -const publishNightlyForEachChangedPackage = require('../publish-nightly-for-each-changed-package'); +const getAndUpdateNightlies = require('../get-and-update-nightlies'); +const NPM_NIGHTLY_VERSION = 'published-nightly-version'; const mockPackages = [ { - packageManifest: {name: 'packageA', version: 'local-version'}, + packageManifest: {name: '@react-native/packageA', version: 'local-version'}, packageAbsolutePath: '/some/place/packageA', packageRelativePathFromRoot: './place/packageA', }, @@ -44,13 +45,13 @@ jest restore: jest.fn(), })) .mock('../../npm-utils', () => ({ - getPackageVersionStrByTag: () => 'published-nightly-version', + getPackageVersionStrByTag: () => NPM_NIGHTLY_VERSION, diffPackages: diffPackagesMock, publishPackage: publishPackageMock, pack: jest.fn(), })); -describe('publishNightlyForEachChangedPackage', () => { +describe('getAndUpdateNightlies', () => { beforeEach(() => { jest.clearAllMocks(); }); @@ -60,16 +61,16 @@ describe('publishNightlyForEachChangedPackage', () => { publishPackageMock.mockImplementationOnce(() => ({code: 0})); diffPackagesMock.mockImplementationOnce(() => 'some-file-name.js\n'); - publishNightlyForEachChangedPackage(nightlyVersion); + const latestNightlies = getAndUpdateNightlies(nightlyVersion); // ensure we set the version of the last published nightly (for diffing) expect(writeFileSyncMock.mock.calls[0][1]).toBe( - '{\n "name": "packageA",\n "version": "published-nightly-version"\n}\n', + '{\n "name": "@react-native/packageA",\n "version": "published-nightly-version"\n}\n', ); expect(diffPackagesMock).toBeCalledWith( - 'packageA@nightly', - 'packageA-published-nightly-version.tgz', + '@react-native/packageA@nightly', + 'react-native-packageA-published-nightly-version.tgz', { cwd: '/some/place/packageA', }, @@ -77,25 +78,60 @@ describe('publishNightlyForEachChangedPackage', () => { // when determining that we DO want to publish, ensure we update the version to the provded nightly version we want to use expect(writeFileSyncMock.mock.calls[1][1]).toBe( - `{\n "name": "packageA",\n "version": "${nightlyVersion}"\n}\n`, + `{\n "name": "@react-native/packageA",\n "version": "${nightlyVersion}"\n}\n`, ); expect(publishPackageMock).toBeCalled(); + + // Expect the map returned to accurately list the latest nightly version + expect(latestNightlies).toEqual({ + '@react-native/packageA': '0.73.0-nightly-202108-shortcommit', + }); + }); + describe('fails to publish', () => { + let consoleError; + beforeEach(() => { + consoleError = console.error; + console.error = jest.fn(); + }); + + afterEach(() => { + console.error = consoleError; + }); + + it('doesnt update nightly version when fails to publish', () => { + const nightlyVersion = '0.73.0-nightly-202108-shortcommit'; + publishPackageMock.mockImplementationOnce(() => ({ + code: 1, + stderr: 'Some error about it failing to publish', + })); + diffPackagesMock.mockImplementationOnce(() => 'some-file-name.js\n'); + + const latestNightlies = getAndUpdateNightlies(nightlyVersion); + + // Expect the map returned to accurately list the latest nightly version + expect(latestNightlies).toEqual({}); + }); }); it('doesnt publish because no changes', () => { const nightlyVersion = '0.73.0-nightly-202108-shortcommit'; diffPackagesMock.mockImplementationOnce(() => '\n'); - publishNightlyForEachChangedPackage(nightlyVersion); + const latestNightlies = getAndUpdateNightlies(nightlyVersion); expect(writeFileSyncMock.mock.calls[0][1]).toBe( - '{\n "name": "packageA",\n "version": "published-nightly-version"\n}\n', + '{\n "name": "@react-native/packageA",\n "version": "published-nightly-version"\n}\n', ); // in this test, we expect there to be no differences between last published nightly and local // so we never update the version and we don't publish expect(writeFileSyncMock.mock.calls.length).toBe(1); expect(publishPackageMock).not.toBeCalled(); + + // Since we don't update, we expect the map to list the latest nightly on npm + expect(latestNightlies).toEqual({ + '@react-native/packageA': 'published-nightly-version', + }); }); }); diff --git a/scripts/monorepo/publish-nightly-for-each-changed-package.js b/scripts/monorepo/get-and-update-nightlies.js similarity index 88% rename from scripts/monorepo/publish-nightly-for-each-changed-package.js rename to scripts/monorepo/get-and-update-nightlies.js index 38ee594e7e4075..c38c79a705351d 100644 --- a/scripts/monorepo/publish-nightly-for-each-changed-package.js +++ b/scripts/monorepo/get-and-update-nightlies.js @@ -61,12 +61,15 @@ function hasChanges( } /** - * Publish nightlies for monorepo packages that changed since last publish. - * This is called by `react-native`'s nightly job. + * Get the latest nightly version of each monorepo package and publishes a new nightly if there have been updates. + * Returns a map of monorepo packages and its latest nightly version. * + * This is called by `react-native`'s nightly job. * Note: This does not publish `package/react-native`'s nightly. That is handled in `publish-npm`. */ -function publishNightlyForEachChangedPackage(nightlyVersion) { +function getAndUpdateNightlies(nightlyVersion) { + const nightlyVersions = {}; + forEachPackage( (packageAbsolutePath, packageRelativePathFromRoot, packageManifest) => { if (packageManifest.private) { @@ -103,6 +106,7 @@ function publishNightlyForEachChangedPackage(nightlyVersion) { console.log( `Detected no changes in ${packageManifest.name}@nightly since last publish. Skipping.`, ); + nightlyVersions[packageManifest.name] = lastPublishedNightlyVersion; return; } @@ -127,9 +131,11 @@ function publishNightlyForEachChangedPackage(nightlyVersion) { console.log( `\u2705 Successfully published new version of ${packageManifest.name}`, ); + nightlyVersions[packageManifest.name] = nightlyVersion; } }, ); + return nightlyVersions; } -module.exports = publishNightlyForEachChangedPackage; +module.exports = getAndUpdateNightlies; diff --git a/scripts/publish-npm.js b/scripts/publish-npm.js index 653a3782c56925..e0223288059e34 100755 --- a/scripts/publish-npm.js +++ b/scripts/publish-npm.js @@ -17,7 +17,7 @@ const { getCurrentCommit, isTaggedLatest, } = require('./scm-utils'); -const publishNightlyForEachChangedPackage = require('./monorepo/publish-nightly-for-each-changed-package'); +const getAndUpdateNightlies = require('./monorepo/get-and-update-nightlies'); const { generateAndroidArtifacts, publishAndroidArtifactsToMaven, @@ -150,7 +150,7 @@ function publishNpm(buildType) { // set and publish the relevant monorepo packages if (buildType === 'nightly') { - publishNightlyForEachChangedPackage(version); + getAndUpdateNightlies(version); } generateAndroidArtifacts(version); From c5e0e2d169162e9f87ee21ad7510886be6f0c26a Mon Sep 17 00:00:00 2001 From: fathonyfath Date: Fri, 9 Jun 2023 13:18:36 -0700 Subject: [PATCH 099/468] Convert DialogModuleTest to Kotlin (#37795) Summary: This PR converts DialogModuleTest into Kotlin as requested in [this issue](https://github.com/facebook/react-native/issues/37708). ## Changelog: [INTERNAL] [CHANGED] - Convert DialogModuleTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37795 Test Plan: 1. Run `./gradlew :packages:react-native:ReactAndroid:test`. 2. All tests should pass. Reviewed By: cortinico Differential Revision: D46596235 Pulled By: mdvacca fbshipit-source-id: ef4184664ad885ebd2e8c1d51ca5bb7dc48f0610 --- .../modules/dialog/DialogModuleTest.java | 176 ------------------ .../react/modules/dialog/DialogModuleTest.kt | 161 ++++++++++++++++ 2 files changed, 161 insertions(+), 176 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.java deleted file mode 100644 index d93357166e415d..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.java +++ /dev/null @@ -1,176 +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.react.modules.dialog; - -import static android.os.Looper.getMainLooper; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.when; -import static org.robolectric.Shadows.shadowOf; - -import android.app.AlertDialog; -import android.content.DialogInterface; -import androidx.fragment.app.FragmentActivity; -import com.facebook.react.bridge.Callback; -import com.facebook.react.bridge.JavaOnlyMap; -import com.facebook.react.bridge.ReactApplicationContext; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.robolectric.Robolectric; -import org.robolectric.RobolectricTestRunner; -import org.robolectric.android.controller.ActivityController; - -@RunWith(RobolectricTestRunner.class) -public class DialogModuleTest { - - private ActivityController mActivityController; - private FragmentActivity mActivity; - private DialogModule mDialogModule; - - static final class SimpleCallback implements Callback { - private Object[] mArgs; - private int mCalls; - - @Override - public void invoke(Object... args) { - mCalls++; - mArgs = args; - } - - public int getCalls() { - return mCalls; - } - - public Object[] getArgs() { - return mArgs; - } - } - - @Before - public void setUp() throws Exception { - mActivityController = Robolectric.buildActivity(FragmentActivity.class); - mActivity = mActivityController.create().start().resume().get(); - - final ReactApplicationContext context = Mockito.mock(ReactApplicationContext.class); - when(context.hasActiveReactInstance()).thenReturn(true); - when(context.getCurrentActivity()).thenReturn(mActivity); - - mDialogModule = new DialogModule(context); - mDialogModule.onHostResume(); - } - - @After - public void tearDown() { - mActivityController.pause().stop().destroy(); - - mActivityController = null; - mDialogModule = null; - } - - @Test - public void testAllOptions() { - final JavaOnlyMap options = new JavaOnlyMap(); - options.putString("title", "Title"); - options.putString("message", "Message"); - options.putString("buttonPositive", "OK"); - options.putString("buttonNegative", "Cancel"); - options.putString("buttonNeutral", "Later"); - options.putBoolean("cancelable", false); - - mDialogModule.showAlert(options, null, null); - shadowOf(getMainLooper()).idle(); - - final AlertFragment fragment = getFragment(); - - assertNotNull("Fragment was not displayed", fragment); - assertFalse(fragment.isCancelable()); - - final AlertDialog dialog = (AlertDialog) fragment.getDialog(); - assertEquals("OK", dialog.getButton(DialogInterface.BUTTON_POSITIVE).getText().toString()); - assertEquals("Cancel", dialog.getButton(DialogInterface.BUTTON_NEGATIVE).getText().toString()); - assertEquals("Later", dialog.getButton(DialogInterface.BUTTON_NEUTRAL).getText().toString()); - } - - @Test - public void testCallbackPositive() { - final JavaOnlyMap options = new JavaOnlyMap(); - options.putString("buttonPositive", "OK"); - - final SimpleCallback actionCallback = new SimpleCallback(); - mDialogModule.showAlert(options, null, actionCallback); - shadowOf(getMainLooper()).idle(); - - final AlertDialog dialog = (AlertDialog) getFragment().getDialog(); - dialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick(); - shadowOf(getMainLooper()).idle(); - - assertEquals(1, actionCallback.getCalls()); - assertEquals(DialogModule.ACTION_BUTTON_CLICKED, actionCallback.getArgs()[0]); - assertEquals(DialogInterface.BUTTON_POSITIVE, actionCallback.getArgs()[1]); - } - - @Test - public void testCallbackNegative() { - final JavaOnlyMap options = new JavaOnlyMap(); - options.putString("buttonNegative", "Cancel"); - - final SimpleCallback actionCallback = new SimpleCallback(); - mDialogModule.showAlert(options, null, actionCallback); - shadowOf(getMainLooper()).idle(); - - final AlertDialog dialog = (AlertDialog) getFragment().getDialog(); - dialog.getButton(DialogInterface.BUTTON_NEGATIVE).performClick(); - shadowOf(getMainLooper()).idle(); - - assertEquals(1, actionCallback.getCalls()); - assertEquals(DialogModule.ACTION_BUTTON_CLICKED, actionCallback.getArgs()[0]); - assertEquals(DialogInterface.BUTTON_NEGATIVE, actionCallback.getArgs()[1]); - } - - @Test - public void testCallbackNeutral() { - final JavaOnlyMap options = new JavaOnlyMap(); - options.putString("buttonNeutral", "Later"); - - final SimpleCallback actionCallback = new SimpleCallback(); - mDialogModule.showAlert(options, null, actionCallback); - shadowOf(getMainLooper()).idle(); - - final AlertDialog dialog = (AlertDialog) getFragment().getDialog(); - dialog.getButton(DialogInterface.BUTTON_NEUTRAL).performClick(); - shadowOf(getMainLooper()).idle(); - - assertEquals(1, actionCallback.getCalls()); - assertEquals(DialogModule.ACTION_BUTTON_CLICKED, actionCallback.getArgs()[0]); - assertEquals(DialogInterface.BUTTON_NEUTRAL, actionCallback.getArgs()[1]); - } - - @Test - public void testCallbackDismiss() { - final JavaOnlyMap options = new JavaOnlyMap(); - - final SimpleCallback actionCallback = new SimpleCallback(); - mDialogModule.showAlert(options, null, actionCallback); - shadowOf(getMainLooper()).idle(); - - getFragment().getDialog().dismiss(); - shadowOf(getMainLooper()).idle(); - - assertEquals(1, actionCallback.getCalls()); - assertEquals(DialogModule.ACTION_DISMISSED, actionCallback.getArgs()[0]); - } - - private AlertFragment getFragment() { - return (AlertFragment) - mActivity.getSupportFragmentManager().findFragmentByTag(DialogModule.FRAGMENT_TAG); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.kt new file mode 100644 index 00000000000000..94d4d63e664646 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/dialog/DialogModuleTest.kt @@ -0,0 +1,161 @@ +/* + * 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.react.modules.dialog + +import android.app.AlertDialog +import android.content.DialogInterface +import android.os.Looper.getMainLooper +import androidx.fragment.app.FragmentActivity +import com.facebook.react.bridge.Callback +import com.facebook.react.bridge.JavaOnlyMap +import com.facebook.react.bridge.ReactApplicationContext +import org.junit.* +import org.junit.Assert.* +import org.junit.runner.RunWith +import org.mockito.Mockito.mock +import org.powermock.api.mockito.PowerMockito.`when` as whenever +import org.robolectric.Robolectric +import org.robolectric.RobolectricTestRunner +import org.robolectric.Shadows.shadowOf +import org.robolectric.android.controller.ActivityController + +@RunWith(RobolectricTestRunner::class) +class DialogModuleTest { + + private lateinit var activityController: ActivityController + private lateinit var activity: FragmentActivity + private lateinit var dialogModule: DialogModule + + class SimpleCallback : Callback { + var args: Array? = null + private set + + var calls: Int = 0 + private set + + override fun invoke(vararg args: Any?) { + this.calls++ + this.args = args + } + } + + @Before + fun setUp() { + activityController = Robolectric.buildActivity(FragmentActivity::class.java) + activity = activityController.create().start().resume().get() + + val context: ReactApplicationContext = mock(ReactApplicationContext::class.java) + whenever(context.hasActiveReactInstance()).thenReturn(true) + whenever(context.currentActivity).thenReturn(activity) + + dialogModule = DialogModule(context) + dialogModule.onHostResume() + } + + @After + fun tearDown() { + activityController.pause().stop().destroy() + } + + @Test + fun testAllOptions() { + val options = + JavaOnlyMap().apply { + putString("title", "Title") + putString("message", "Message") + putString("buttonPositive", "OK") + putString("buttonNegative", "Cancel") + putString("buttonNeutral", "Later") + putBoolean("cancelable", false) + } + + dialogModule.showAlert(options, null, null) + shadowOf(getMainLooper()).idle() + + val fragment = getFragment() + + assertNotNull("Fragment was not displayed", fragment) + assertFalse(fragment!!.isCancelable) + + val dialog = fragment.dialog as AlertDialog + assertEquals("OK", dialog.getButton(DialogInterface.BUTTON_POSITIVE).text.toString()) + assertEquals("Cancel", dialog.getButton(DialogInterface.BUTTON_NEGATIVE).text.toString()) + assertEquals("Later", dialog.getButton(DialogInterface.BUTTON_NEUTRAL).text.toString()) + } + + @Test + fun testCallbackPositive() { + val options = JavaOnlyMap().apply { putString("buttonPositive", "OK") } + + val actionCallback = SimpleCallback() + dialogModule.showAlert(options, null, actionCallback) + shadowOf(getMainLooper()).idle() + + val dialog = getFragment()!!.dialog as AlertDialog + dialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick() + shadowOf(getMainLooper()).idle() + + assertEquals(1, actionCallback.calls) + assertEquals(DialogModule.ACTION_BUTTON_CLICKED, actionCallback.args!![0]) + assertEquals(DialogInterface.BUTTON_POSITIVE, actionCallback.args!![1]) + } + + @Test + fun testCallbackNegative() { + val options = JavaOnlyMap().apply { putString("buttonNegative", "Cancel") } + + val actionCallback = SimpleCallback() + dialogModule.showAlert(options, null, actionCallback) + shadowOf(getMainLooper()).idle() + + val dialog = getFragment()!!.dialog as AlertDialog + dialog.getButton(DialogInterface.BUTTON_NEGATIVE).performClick() + shadowOf(getMainLooper()).idle() + + assertEquals(1, actionCallback.calls) + assertEquals(DialogModule.ACTION_BUTTON_CLICKED, actionCallback.args!![0]) + assertEquals(DialogInterface.BUTTON_NEGATIVE, actionCallback.args!![1]) + } + + @Test + fun testCallbackNeutral() { + val options = JavaOnlyMap().apply { putString("buttonNeutral", "Later") } + + val actionCallback = SimpleCallback() + dialogModule.showAlert(options, null, actionCallback) + shadowOf(getMainLooper()).idle() + + val dialog = getFragment()!!.dialog as AlertDialog + dialog.getButton(DialogInterface.BUTTON_NEUTRAL).performClick() + shadowOf(getMainLooper()).idle() + + assertEquals(1, actionCallback.calls) + assertEquals(DialogModule.ACTION_BUTTON_CLICKED, actionCallback.args!![0]) + assertEquals(DialogInterface.BUTTON_NEUTRAL, actionCallback.args!![1]) + } + + @Test + fun testCallbackDismiss() { + val options = JavaOnlyMap() + + val actionCallback = SimpleCallback() + dialogModule.showAlert(options, null, actionCallback) + shadowOf(getMainLooper()).idle() + + getFragment()!!.dialog!!.dismiss() + shadowOf(getMainLooper()).idle() + + assertEquals(1, actionCallback.calls) + assertEquals(DialogModule.ACTION_DISMISSED, actionCallback.args!![0]) + } + + private fun getFragment(): AlertFragment? { + return activity.supportFragmentManager.findFragmentByTag(DialogModule.FRAGMENT_TAG) + as? AlertFragment + } +} From 51cea49be73250f5b346db9882a2da522cd508d8 Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Fri, 9 Jun 2023 15:09:58 -0700 Subject: [PATCH 100/468] Sync AnimatedValue JS node value when animation completes (#37779) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37779 For natively driven animations, we now get the final value of the animation on JS side in the animation end callback. We sync this value into the JS-side AnimatedValue node. Changelog: [General][Changed] - Sync AnimatedValue JS node value when animation completes Differential Revision: D46498320 fbshipit-source-id: 550a3bbbd5323f917c175801b6414a721aa69be5 --- .../Libraries/Animated/animations/Animation.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/Animated/animations/Animation.js b/packages/react-native/Libraries/Animated/animations/Animation.js index d71a86b5137d7d..6a14a87fabde3e 100644 --- a/packages/react-native/Libraries/Animated/animations/Animation.js +++ b/packages/react-native/Libraries/Animated/animations/Animation.js @@ -37,6 +37,7 @@ export default class Animation { __nativeId: number; __onEnd: ?EndCallback; __iterations: number; + start( fromValue: number, onUpdate: (value: number) => void, @@ -44,22 +45,26 @@ export default class Animation { previousAnimation: ?Animation, animatedValue: AnimatedValue, ): void {} + stop(): void { if (this.__nativeId) { NativeAnimatedHelper.API.stopAnimation(this.__nativeId); } } + __getNativeAnimationConfig(): any { // Subclasses that have corresponding animation implementation done in native // should override this method throw new Error('This animation type cannot be offloaded to native'); } + // Helper function for subclasses to make sure onEnd is only called once. __debouncedOnEnd(result: EndResult): void { const onEnd = this.__onEnd; this.__onEnd = null; onEnd && onEnd(result); } + __startNativeAnimation(animatedValue: AnimatedValue): void { const startNativeAnimationWaitId = `${startNativeAnimationNextId}:startAnimation`; startNativeAnimationNextId += 1; @@ -74,8 +79,17 @@ export default class Animation { this.__nativeId, animatedValue.__getNativeTag(), config, - // $FlowFixMe[method-unbinding] added when improving typing for this parameters - this.__debouncedOnEnd.bind(this), + result => { + this.__debouncedOnEnd(result); + + // When using natively driven animations, once the animation completes, + // we need to ensure that the JS side nodes are synced with the updated + // values. + const {value} = result; + if (value != null) { + animatedValue.__onAnimatedValueUpdateReceived(value); + } + }, ); } catch (e) { throw e; From 03f70bf995379f08a77abcf96bb0e31ff75ca8c3 Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Fri, 9 Jun 2023 18:28:39 -0700 Subject: [PATCH 101/468] When animating using native driver, trigger rerender on animation completion (#37786) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37786 When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect. Prior diffs ensure that upon completion of natively driven animations, the final values are synced to the JS side AnimatedValue nodes. In this diff, on completion of a natively driven animation, AnimatedProps.update() is called, which in turn calls the value update callback on AnimatedProps, which [triggers a rerender (via setState)](https://www.internalfb.com/code/fbsource/[566daad5db45807260a8af1f85385ca86aebf894]/xplat/js/react-native-github/packages/react-native/Libraries/Animated/useAnimatedProps.js?lines=80) which has the effect of pushing the latest animated values to Fabric. Alternative considered was using setNativeProps, but that approach was dropped as setNativeProps was only introduced to make migration easier and should not be used for new code, as per sammy-SC. Changelog: [General][Fixed] - When animating using native driver, trigger rerender on animation completion in order to update Pressability responder regions Reviewed By: rshest Differential Revision: D46574511 fbshipit-source-id: 185471b28f5f7e3ba9d62d2ac196e9b65b07a86e --- .../Animated/animations/Animation.js | 21 +++++++++++++++++++ .../Libraries/Animated/useAnimatedProps.js | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/Animated/animations/Animation.js b/packages/react-native/Libraries/Animated/animations/Animation.js index 6a14a87fabde3e..1c9513902f1323 100644 --- a/packages/react-native/Libraries/Animated/animations/Animation.js +++ b/packages/react-native/Libraries/Animated/animations/Animation.js @@ -11,9 +11,11 @@ 'use strict'; import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import type AnimatedNode from '../nodes/AnimatedNode'; import type AnimatedValue from '../nodes/AnimatedValue'; import NativeAnimatedHelper from '../NativeAnimatedHelper'; +import AnimatedProps from '../nodes/AnimatedProps'; export type EndResult = {finished: boolean, value?: number, ...}; export type EndCallback = (result: EndResult) => void; @@ -65,6 +67,21 @@ export default class Animation { onEnd && onEnd(result); } + __findAnimatedPropsNode(node: AnimatedNode): ?AnimatedProps { + if (node instanceof AnimatedProps) { + return node; + } + + for (const child of node.__getChildren()) { + const result = this.__findAnimatedPropsNode(child); + if (result) { + return result; + } + } + + return null; + } + __startNativeAnimation(animatedValue: AnimatedValue): void { const startNativeAnimationWaitId = `${startNativeAnimationNextId}:startAnimation`; startNativeAnimationNextId += 1; @@ -89,6 +106,10 @@ export default class Animation { if (value != null) { animatedValue.__onAnimatedValueUpdateReceived(value); } + + // Once the JS side node is synced with the updated values, trigger an + // update on the AnimatedProps node to call any registered callbacks. + this.__findAnimatedPropsNode(animatedValue)?.update(); }, ); } catch (e) { diff --git a/packages/react-native/Libraries/Animated/useAnimatedProps.js b/packages/react-native/Libraries/Animated/useAnimatedProps.js index 865bddd8ca3cbe..2afe52f232c673 100644 --- a/packages/react-native/Libraries/Animated/useAnimatedProps.js +++ b/packages/react-native/Libraries/Animated/useAnimatedProps.js @@ -66,7 +66,9 @@ export default function useAnimatedProps( // changes), but `setNativeView` already optimizes for that. node.setNativeView(instance); - // NOTE: This callback is only used by the JavaScript animation driver. + // NOTE: When using the JS animation driver, this callback is called on + // every animation frame. When using the native driver, this callback is + // called when the animation completes. onUpdateRef.current = () => { if ( process.env.NODE_ENV === 'test' || From ef5d92f648670f5b32aacd73d9a9e278520ba743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Mon, 12 Jun 2023 08:00:44 -0700 Subject: [PATCH 102/468] Convert DeviceInfoModuleTest to Kotlin (#37805) Summary: This PR converts DeviceInfoModuleTest into Kotlin as requested in https://github.com/facebook/react-native/issues/37708. ## Changelog: [INTERNAL] [CHANGED] - Convert DeviceInfoModuleTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37805 Test Plan: 1. Run `./gradlew :packages:react-native:ReactAndroid:test`. 2. All tests should pass. Reviewed By: cortinico Differential Revision: D46614375 Pulled By: rshest fbshipit-source-id: 3fc390069628e3ce188121f3e775b28e88875af8 --- .../deviceinfo/DeviceInfoModuleTest.java | 163 ------------------ .../deviceinfo/DeviceInfoModuleTest.kt | 138 +++++++++++++++ 2 files changed, 138 insertions(+), 163 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java deleted file mode 100644 index 62890cbfe8d64e..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java +++ /dev/null @@ -1,163 +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.react.modules.deviceinfo; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.powermock.api.mockito.PowerMockito.mockStatic; - -import com.facebook.react.bridge.Arguments; -import com.facebook.react.bridge.CatalystInstance; -import com.facebook.react.bridge.JavaOnlyMap; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactTestHelper; -import com.facebook.react.bridge.WritableMap; -import com.facebook.react.uimanager.DisplayMetricsHolder; -import java.util.Arrays; -import java.util.List; -import junit.framework.TestCase; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.rule.PowerMockRule; -import org.robolectric.RobolectricTestRunner; -import org.robolectric.RuntimeEnvironment; - -@RunWith(RobolectricTestRunner.class) -@PrepareForTest({Arguments.class, DisplayMetricsHolder.class}) -@PowerMockIgnore({"org.mockito.*", "org.robolectric.*", "androidx.*", "android.*"}) -public class DeviceInfoModuleTest extends TestCase { - - @Rule public PowerMockRule rule = new PowerMockRule(); - - private DeviceInfoModule mDeviceInfoModule; - - private WritableMap fakePortraitDisplayMetrics; - private WritableMap fakeLandscapeDisplayMetrics; - - private ReactApplicationContext mContext; - - @Before - public void setUp() { - initTestData(); - - mockStatic(DisplayMetricsHolder.class); - mContext = spy(new ReactApplicationContext(RuntimeEnvironment.application)); - CatalystInstance catalystInstanceMock = ReactTestHelper.createMockCatalystInstance(); - mContext.initializeWithInstance(catalystInstanceMock); - - mDeviceInfoModule = new DeviceInfoModule(mContext); - } - - @After - public void teardown() { - DisplayMetricsHolder.setWindowDisplayMetrics(null); - DisplayMetricsHolder.setScreenDisplayMetrics(null); - } - - @Test - public void test_itDoesNotEmitAnEvent_whenDisplayMetricsNotChanged() { - givenDisplayMetricsHolderContains(fakePortraitDisplayMetrics); - - mDeviceInfoModule.getTypedExportedConstants(); - mDeviceInfoModule.emitUpdateDimensionsEvent(); - - verify(mContext, times(0)).emitDeviceEvent(anyString(), any()); - } - - @Test - public void test_itEmitsOneEvent_whenDisplayMetricsChangedOnce() { - givenDisplayMetricsHolderContains(fakePortraitDisplayMetrics); - - mDeviceInfoModule.getTypedExportedConstants(); - givenDisplayMetricsHolderContains(fakeLandscapeDisplayMetrics); - mDeviceInfoModule.emitUpdateDimensionsEvent(); - - verifyUpdateDimensionsEventsEmitted(mContext, fakeLandscapeDisplayMetrics); - } - - @Test - public void test_itEmitsJustOneEvent_whenUpdateRequestedMultipleTimes() { - givenDisplayMetricsHolderContains(fakePortraitDisplayMetrics); - mDeviceInfoModule.getTypedExportedConstants(); - givenDisplayMetricsHolderContains(fakeLandscapeDisplayMetrics); - mDeviceInfoModule.emitUpdateDimensionsEvent(); - mDeviceInfoModule.emitUpdateDimensionsEvent(); - - verifyUpdateDimensionsEventsEmitted(mContext, fakeLandscapeDisplayMetrics); - } - - @Test - public void test_itEmitsMultipleEvents_whenDisplayMetricsChangedBetweenUpdates() { - givenDisplayMetricsHolderContains(fakePortraitDisplayMetrics); - - mDeviceInfoModule.getTypedExportedConstants(); - mDeviceInfoModule.emitUpdateDimensionsEvent(); - givenDisplayMetricsHolderContains(fakeLandscapeDisplayMetrics); - mDeviceInfoModule.emitUpdateDimensionsEvent(); - givenDisplayMetricsHolderContains(fakePortraitDisplayMetrics); - mDeviceInfoModule.emitUpdateDimensionsEvent(); - givenDisplayMetricsHolderContains(fakeLandscapeDisplayMetrics); - mDeviceInfoModule.emitUpdateDimensionsEvent(); - - verifyUpdateDimensionsEventsEmitted( - mContext, - fakeLandscapeDisplayMetrics, - fakePortraitDisplayMetrics, - fakeLandscapeDisplayMetrics); - } - - private static void givenDisplayMetricsHolderContains(final WritableMap fakeDisplayMetrics) { - when(DisplayMetricsHolder.getDisplayMetricsWritableMap(1.0)) - .thenAnswer(invocation -> fakeDisplayMetrics); - } - - private static void verifyUpdateDimensionsEventsEmitted( - ReactApplicationContext context, WritableMap... expectedEvents) { - List expectedEventList = Arrays.asList(expectedEvents); - ArgumentCaptor captor = ArgumentCaptor.forClass(WritableMap.class); - verify(context, times(expectedEventList.size())) - .emitDeviceEvent(eq("didUpdateDimensions"), captor.capture()); - - List actualEvents = captor.getAllValues(); - assertThat(actualEvents).isEqualTo(expectedEventList); - } - - private void initTestData() { - mockStatic(Arguments.class); - when(Arguments.createMap()) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - return new JavaOnlyMap(); - } - }); - - fakePortraitDisplayMetrics = Arguments.createMap(); - fakePortraitDisplayMetrics.putInt("width", 100); - fakePortraitDisplayMetrics.putInt("height", 200); - - fakeLandscapeDisplayMetrics = Arguments.createMap(); - fakeLandscapeDisplayMetrics.putInt("width", 200); - fakeLandscapeDisplayMetrics.putInt("height", 100); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.kt new file mode 100644 index 00000000000000..252a8a26478d4e --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.kt @@ -0,0 +1,138 @@ +/* + * 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.react.modules.deviceinfo + +import com.facebook.react.bridge.Arguments +import com.facebook.react.bridge.JavaOnlyMap +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.bridge.ReactContext +import com.facebook.react.bridge.ReactTestHelper +import com.facebook.react.bridge.WritableMap +import com.facebook.react.uimanager.DisplayMetricsHolder +import junit.framework.TestCase +import org.assertj.core.api.Assertions +import org.junit.After +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.ArgumentCaptor +import org.mockito.ArgumentMatchers +import org.mockito.Mockito.* +import org.powermock.api.mockito.PowerMockito +import org.powermock.api.mockito.PowerMockito.`when` as whenever +import org.powermock.core.classloader.annotations.PowerMockIgnore +import org.powermock.core.classloader.annotations.PrepareForTest +import org.powermock.modules.junit4.rule.PowerMockRule +import org.robolectric.RobolectricTestRunner +import org.robolectric.RuntimeEnvironment + +@RunWith(RobolectricTestRunner::class) +@PrepareForTest(Arguments::class, DisplayMetricsHolder::class) +@PowerMockIgnore("org.mockito.*", "org.robolectric.*", "androidx.*", "android.*") +class DeviceInfoModuleTest : TestCase() { + @get:Rule var rule = PowerMockRule() + + private lateinit var deviceInfoModule: DeviceInfoModule + private lateinit var fakePortraitDisplayMetrics: WritableMap + private lateinit var fakeLandscapeDisplayMetrics: WritableMap + private lateinit var reactContext: ReactApplicationContext + + @Before + public override fun setUp() { + initTestData() + PowerMockito.mockStatic(DisplayMetricsHolder::class.java) + reactContext = spy(ReactApplicationContext(RuntimeEnvironment.application)) + val catalystInstanceMock = ReactTestHelper.createMockCatalystInstance() + reactContext.initializeWithInstance(catalystInstanceMock) + deviceInfoModule = DeviceInfoModule(reactContext) + } + + @After + fun teardown() { + DisplayMetricsHolder.setWindowDisplayMetrics(null) + DisplayMetricsHolder.setScreenDisplayMetrics(null) + } + + @Test + fun test_itDoesNotEmitAnEvent_whenDisplayMetricsNotChanged() { + givenDisplayMetricsHolderContains(fakePortraitDisplayMetrics) + deviceInfoModule.typedExportedConstants + deviceInfoModule.emitUpdateDimensionsEvent() + verify(reactContext, times(0)) + ?.emitDeviceEvent(ArgumentMatchers.anyString(), ArgumentMatchers.any()) + } + + @Test + fun test_itEmitsOneEvent_whenDisplayMetricsChangedOnce() { + givenDisplayMetricsHolderContains(fakePortraitDisplayMetrics) + deviceInfoModule.typedExportedConstants + givenDisplayMetricsHolderContains(fakeLandscapeDisplayMetrics) + deviceInfoModule.emitUpdateDimensionsEvent() + verifyUpdateDimensionsEventsEmitted(reactContext, fakeLandscapeDisplayMetrics) + } + + @Test + fun test_itEmitsJustOneEvent_whenUpdateRequestedMultipleTimes() { + givenDisplayMetricsHolderContains(fakePortraitDisplayMetrics) + deviceInfoModule.typedExportedConstants + givenDisplayMetricsHolderContains(fakeLandscapeDisplayMetrics) + deviceInfoModule.emitUpdateDimensionsEvent() + deviceInfoModule.emitUpdateDimensionsEvent() + verifyUpdateDimensionsEventsEmitted(reactContext, fakeLandscapeDisplayMetrics) + } + + @Test + fun test_itEmitsMultipleEvents_whenDisplayMetricsChangedBetweenUpdates() { + givenDisplayMetricsHolderContains(fakePortraitDisplayMetrics) + deviceInfoModule.typedExportedConstants + deviceInfoModule.emitUpdateDimensionsEvent() + givenDisplayMetricsHolderContains(fakeLandscapeDisplayMetrics) + deviceInfoModule.emitUpdateDimensionsEvent() + givenDisplayMetricsHolderContains(fakePortraitDisplayMetrics) + deviceInfoModule.emitUpdateDimensionsEvent() + givenDisplayMetricsHolderContains(fakeLandscapeDisplayMetrics) + deviceInfoModule.emitUpdateDimensionsEvent() + verifyUpdateDimensionsEventsEmitted( + reactContext, + fakeLandscapeDisplayMetrics, + fakePortraitDisplayMetrics, + fakeLandscapeDisplayMetrics) + } + + private fun initTestData() { + PowerMockito.mockStatic(Arguments::class.java) + whenever(Arguments.createMap()).thenAnswer { JavaOnlyMap() } + fakePortraitDisplayMetrics = Arguments.createMap() + fakePortraitDisplayMetrics.putInt("width", 100) + fakePortraitDisplayMetrics.putInt("height", 200) + fakeLandscapeDisplayMetrics = Arguments.createMap() + fakeLandscapeDisplayMetrics.putInt("width", 200) + fakeLandscapeDisplayMetrics.putInt("height", 100) + } + + companion object { + private fun givenDisplayMetricsHolderContains(fakeDisplayMetrics: WritableMap?) { + whenever(DisplayMetricsHolder.getDisplayMetricsWritableMap(1.0)).thenAnswer { + fakeDisplayMetrics + } + } + + private fun verifyUpdateDimensionsEventsEmitted( + context: ReactContext?, + vararg expectedEvents: WritableMap + ) { + val expectedEventList = listOf(*expectedEvents) + val captor = ArgumentCaptor.forClass(WritableMap::class.java) + verify(context, times(expectedEventList.size)) + ?.emitDeviceEvent(ArgumentMatchers.eq("didUpdateDimensions"), captor.capture()) + val actualEvents = captor.allValues + Assertions.assertThat(actualEvents).isEqualTo(expectedEventList) + } + } +} From 33b9c8e9e2e2ecf538fd3966a38dc62958cd0db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 12 Jun 2023 09:11:58 -0700 Subject: [PATCH 103/468] Create module to set up PerformanceObserver (#37807) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37807 We implemented `PerformanceObserver` but didn't create a `setUp*` module for it like we did for the rest of globals in RN. This creates the module but doesn't enable it by default (until stable in OSS). We'll require this in a case by case basis for testing. Changelog: [internal] Reviewed By: rshest Differential Revision: D46597766 fbshipit-source-id: 661d009754f4310c6b83483188ed020fc1d4d63b --- .../Libraries/Core/setUpPerformanceObserver.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/react-native/Libraries/Core/setUpPerformanceObserver.js diff --git a/packages/react-native/Libraries/Core/setUpPerformanceObserver.js b/packages/react-native/Libraries/Core/setUpPerformanceObserver.js new file mode 100644 index 00000000000000..20e0f32f5c991c --- /dev/null +++ b/packages/react-native/Libraries/Core/setUpPerformanceObserver.js @@ -0,0 +1,16 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +import {polyfillGlobal} from '../Utilities/PolyfillFunctions'; + +polyfillGlobal( + 'PerformanceObserver', + () => require('../WebPerformance/PerformanceObserver').default, +); From d71da6190a2b20ebf8aa1b833daf1253f6fdcdd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 12 Jun 2023 09:11:58 -0700 Subject: [PATCH 104/468] Define toJSON method in PerformanceEventTiming to show all fields properly when using console.log (#37808) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37808 When passing entries of type "event" to `console.log` we only see the fields defined in the base `PerformanceEntry` class because it defines a `toJSON` method but the `PerformanceEventTiming` subclass doesn't. This implements the method in that class too to improve debuggability (while also making it more spec compliant). Changelog: [internal] Reviewed By: rshest Differential Revision: D46597764 fbshipit-source-id: ca6fba3fdbb74a4f767eebc647681e5b65ba65d8 --- .../WebPerformance/PerformanceEntry.js | 15 +++++++++------ .../WebPerformance/PerformanceEventTiming.js | 19 ++++++++++++++++++- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/packages/react-native/Libraries/WebPerformance/PerformanceEntry.js b/packages/react-native/Libraries/WebPerformance/PerformanceEntry.js index bc2cadff20209d..9c855422af86fc 100644 --- a/packages/react-native/Libraries/WebPerformance/PerformanceEntry.js +++ b/packages/react-native/Libraries/WebPerformance/PerformanceEntry.js @@ -11,6 +11,14 @@ export type HighResTimeStamp = number; export type PerformanceEntryType = 'mark' | 'measure' | 'event'; +export type PerformanceEntryJSON = { + name: string, + entryType: PerformanceEntryType, + startTime: HighResTimeStamp, + duration: HighResTimeStamp, + ... +}; + export const ALWAYS_LOGGED_ENTRY_TYPES: $ReadOnlyArray = [ 'mark', 'measure', @@ -34,12 +42,7 @@ export class PerformanceEntry { this.duration = init.duration; } - toJSON(): { - name: string, - entryType: PerformanceEntryType, - startTime: HighResTimeStamp, - duration: HighResTimeStamp, - } { + toJSON(): PerformanceEntryJSON { return { name: this.name, entryType: this.entryType, diff --git a/packages/react-native/Libraries/WebPerformance/PerformanceEventTiming.js b/packages/react-native/Libraries/WebPerformance/PerformanceEventTiming.js index a741f494856657..609f5bc1041857 100644 --- a/packages/react-native/Libraries/WebPerformance/PerformanceEventTiming.js +++ b/packages/react-native/Libraries/WebPerformance/PerformanceEventTiming.js @@ -8,10 +8,18 @@ * @flow strict */ -import type {HighResTimeStamp} from './PerformanceEntry'; +import type {HighResTimeStamp, PerformanceEntryJSON} from './PerformanceEntry'; import {PerformanceEntry} from './PerformanceEntry'; +export type PerformanceEventTimingJSON = { + ...PerformanceEntryJSON, + processingStart: HighResTimeStamp, + processingEnd: HighResTimeStamp, + interactionId: number, + ... +}; + export class PerformanceEventTiming extends PerformanceEntry { processingStart: HighResTimeStamp; processingEnd: HighResTimeStamp; @@ -35,4 +43,13 @@ export class PerformanceEventTiming extends PerformanceEntry { this.processingEnd = init.processingEnd ?? 0; this.interactionId = init.interactionId ?? 0; } + + toJSON(): PerformanceEventTimingJSON { + return { + ...super.toJSON(), + processingStart: this.processingStart, + processingEnd: this.processingEnd, + interactionId: this.interactionId, + }; + } } From 7d1f7f3f5fbc9e659757f17fae98fa8778ffdbb6 Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Date: Mon, 12 Jun 2023 10:08:52 -0700 Subject: [PATCH 105/468] Fix Android border clip check (#37828) Summary: Instead of requiring all types of border color values to be present we should only take into consideration the left, top, right, bottom, and allEdges values and inject block values into colorBottom and colorTop. This PR only addresses the first issue described here (https://github.com/facebook/react-native/issues/37753#issuecomment-1587196793) by kelset ## Changelog: [ANDROID] [FIXED] - Fix border clip check Pull Request resolved: https://github.com/facebook/react-native/pull/37828 Test Plan: Test through rn-tester if border color is being applied image Reviewed By: lunaleaps Differential Revision: D46643773 Pulled By: cipolleschi fbshipit-source-id: efb1ea81bf2462c14767a2554880eb7c44989975 --- .../views/view/ReactViewBackgroundDrawable.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java index c2a1b9d29ded8f..31a4523569c5c5 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java @@ -564,19 +564,28 @@ private void updatePath() { int colorRight = getBorderColor(Spacing.RIGHT); int colorBottom = getBorderColor(Spacing.BOTTOM); int borderColor = getBorderColor(Spacing.ALL); + int colorBlock = getBorderColor(Spacing.BLOCK); int colorBlockStart = getBorderColor(Spacing.BLOCK_START); int colorBlockEnd = getBorderColor(Spacing.BLOCK_END); + if (isBorderColorDefined(Spacing.BLOCK)) { + colorBottom = colorBlock; + colorTop = colorBlock; + } + if (isBorderColorDefined(Spacing.BLOCK_END)) { + colorBottom = colorBlockEnd; + } + if (isBorderColorDefined(Spacing.BLOCK_START)) { + colorTop = colorBlockStart; + } + // Clip border ONLY if its color is non transparent if (Color.alpha(colorLeft) != 0 && Color.alpha(colorTop) != 0 && Color.alpha(colorRight) != 0 && Color.alpha(colorBottom) != 0 - && Color.alpha(borderColor) != 0 - && Color.alpha(colorBlock) != 0 - && Color.alpha(colorBlockStart) != 0 - && Color.alpha(colorBlockEnd) != 0) { + && Color.alpha(borderColor) != 0) { mInnerClipTempRectForBorderRadius.top += borderWidth.top; mInnerClipTempRectForBorderRadius.bottom -= borderWidth.bottom; From 08948810cbac8dc85b11abc462a3ea2750ff8693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 12 Jun 2023 11:02:22 -0700 Subject: [PATCH 106/468] Implement scrollTop and scrollLeft (#37754) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37754 This adds a new method in Fabric to get the scroll position for an element, and uses it to implement the following methods as defined in as defined in https://github.com/react-native-community/discussions-and-proposals/pull/607 : * `scrollTop`: indicates the number of pixels (in device independent pixels) from the content that have moved in the vertical axis in the scroll container. * `scrollLeft`: indicates the number of pixels (in device independent pixels) from the content that have moved in the horizontal axis in the scroll container. These API can provide decimal values. Changelog: [internal] Reviewed By: javache Differential Revision: D44757811 fbshipit-source-id: e1b58db8d9f61e823b62d54620a9a0deaae1566b --- .../Libraries/DOM/Nodes/ReadOnlyElement.js | 30 +++++++-- .../Libraries/ReactNative/FabricUIManager.js | 11 ++-- .../ReactNative/__mocks__/FabricUIManager.js | 27 ++++++++ .../renderer/uimanager/UIManagerBinding.cpp | 65 +++++++++++++++++++ 4 files changed, 125 insertions(+), 8 deletions(-) diff --git a/packages/react-native/Libraries/DOM/Nodes/ReadOnlyElement.js b/packages/react-native/Libraries/DOM/Nodes/ReadOnlyElement.js index 163deca45fdc58..b6ecccb0c844f3 100644 --- a/packages/react-native/Libraries/DOM/Nodes/ReadOnlyElement.js +++ b/packages/react-native/Libraries/DOM/Nodes/ReadOnlyElement.js @@ -91,19 +91,41 @@ export default class ReadOnlyElement extends ReadOnlyNode { } get scrollHeight(): number { - throw new TypeError('Unimplemented'); + throw new Error('Unimplemented'); } get scrollLeft(): number { - throw new TypeError('Unimplemented'); + const node = getShadowNode(this); + + if (node != null) { + const scrollPosition = nullthrows(getFabricUIManager()).getScrollPosition( + node, + ); + if (scrollPosition != null) { + return scrollPosition[0]; + } + } + + return 0; } get scrollTop(): number { - throw new TypeError('Unimplemented'); + const node = getShadowNode(this); + + if (node != null) { + const scrollPosition = nullthrows(getFabricUIManager()).getScrollPosition( + node, + ); + if (scrollPosition != null) { + return scrollPosition[1]; + } + } + + return 0; } get scrollWidth(): number { - throw new TypeError('Unimplemented'); + throw new Error('Unimplemented'); } get tagName(): string { diff --git a/packages/react-native/Libraries/ReactNative/FabricUIManager.js b/packages/react-native/Libraries/ReactNative/FabricUIManager.js index e0c062fb85498b..68372d8b44ef7a 100644 --- a/packages/react-native/Libraries/ReactNative/FabricUIManager.js +++ b/packages/react-native/Libraries/ReactNative/FabricUIManager.js @@ -74,10 +74,10 @@ export type Spec = {| +getBoundingClientRect: ( node: Node, ) => ?[ - /* x:*/ number, - /* y:*/ number, - /* width:*/ number, - /* height:*/ number, + /* x: */ number, + /* y: */ number, + /* width: */ number, + /* height: */ number, ], +getOffset: ( node: Node, @@ -86,6 +86,9 @@ export type Spec = {| /* offsetTop: */ number, /* offsetLeft: */ number, ], + +getScrollPosition: ( + node: Node, + ) => ?[/* scrollLeft: */ number, /* scrollTop: */ number], |}; // This is exposed as a getter because apps using the legacy renderer AND diff --git a/packages/react-native/Libraries/ReactNative/__mocks__/FabricUIManager.js b/packages/react-native/Libraries/ReactNative/__mocks__/FabricUIManager.js index 34cf9f828713bb..0e9a67dccb0ba3 100644 --- a/packages/react-native/Libraries/ReactNative/__mocks__/FabricUIManager.js +++ b/packages/react-native/Libraries/ReactNative/__mocks__/FabricUIManager.js @@ -431,6 +431,33 @@ const FabricUIManagerMock: FabricUIManager = { ]; }, ), + getScrollPosition: jest.fn( + (node: Node): ?[/* scrollLeft: */ number, /* scrollTop: */ number] => { + ensureHostNode(node); + + const nodeInCurrentTree = getNodeInCurrentTree(node); + const currentProps = + nodeInCurrentTree != null ? fromNode(nodeInCurrentTree).props : null; + if (currentProps == null) { + return null; + } + + const scrollForTests: ?{ + scrollLeft: number, + scrollTop: number, + ... + } = + // $FlowExpectedError[prop-missing] + currentProps.__scrollForTests; + + if (scrollForTests == null) { + return null; + } + + const {scrollLeft, scrollTop} = scrollForTests; + return [scrollLeft, scrollTop]; + }, + ), }; global.nativeFabricUIManager = FabricUIManagerMock; diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp index 54485334feb9ca..96cae3169e0a9c 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp @@ -1013,6 +1013,71 @@ jsi::Value UIManagerBinding::get( }); } + if (methodName == "getScrollPosition") { + // This is a method to access scroll information for React Native nodes, to + // implement these methods: + // * `Element.prototype.scrollLeft`: see + // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft. + // * `Element.prototype.scrollTop`: see + // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTop. + + // It uses the version of the shadow node that is present in the current + // revision of the shadow tree. If the node is not present or is not + // displayed (because any of its ancestors or itself have 'display: none'), + // it returns undefined. Otherwise, it returns the scroll position. + + // getScrollPosition(shadowNode: ShadowNode): + // ?[ + // /* scrollLeft: */ number, + // /* scrollTop: */ number, + // ] + return jsi::Function::createFromHostFunction( + runtime, + name, + 1, + [uiManager]( + jsi::Runtime &runtime, + jsi::Value const & /*thisValue*/, + jsi::Value const *arguments, + size_t /*count*/) noexcept -> jsi::Value { + auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); + + auto newestCloneOfShadowNode = + uiManager->getNewestCloneOfShadowNode(*shadowNode); + // The node is no longer part of an active shadow tree, or it is the + // root node + if (newestCloneOfShadowNode == nullptr) { + return jsi::Value::undefined(); + } + + // If the node is not displayed (itself or any of its ancestors has + // "display: none", it returns an empty layout metrics object. + auto layoutMetrics = uiManager->getRelativeLayoutMetrics( + *shadowNode, nullptr, {/* .includeTransform = */ true}); + if (layoutMetrics == EmptyLayoutMetrics) { + return jsi::Value::undefined(); + } + + auto layoutableShadowNode = traitCast( + newestCloneOfShadowNode.get()); + // This should never happen + if (layoutableShadowNode == nullptr) { + return jsi::Value::undefined(); + } + + auto scrollPosition = layoutableShadowNode->getContentOriginOffset(); + + return jsi::Array::createWithElements( + runtime, + jsi::Value{ + runtime, + scrollPosition.x == 0 ? 0 : (double)-scrollPosition.x}, + jsi::Value{ + runtime, + scrollPosition.y == 0 ? 0 : (double)-scrollPosition.y}); + }); + } + return jsi::Value::undefined(); } From 87c11bc3ad8c86c91b79e657d960b88b70f6a86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 12 Jun 2023 11:02:22 -0700 Subject: [PATCH 107/468] Implement id property in ReadOnlyElement (#37755) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37755 This implements the `id` property in `ReadOnlyElement` as an alias for the `id` or `nativeID` props of the element. This is currently implemented using an internal API in React but we should find an alternative solution for this in Fabric in the near future. Adding this now because it's useful for debugging. Changelog: [internal] Reviewed By: javache Differential Revision: D46518381 fbshipit-source-id: 1a72fe0349c248744f49b795022b6fdb3359885d --- .../Libraries/DOM/Nodes/ReadOnlyElement.js | 12 ++++++++++-- .../react-native/Libraries/DOM/Nodes/ReadOnlyNode.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/react-native/Libraries/DOM/Nodes/ReadOnlyElement.js b/packages/react-native/Libraries/DOM/Nodes/ReadOnlyElement.js index b6ecccb0c844f3..321bf45402789b 100644 --- a/packages/react-native/Libraries/DOM/Nodes/ReadOnlyElement.js +++ b/packages/react-native/Libraries/DOM/Nodes/ReadOnlyElement.js @@ -15,7 +15,11 @@ import type HTMLCollection from '../OldStyleCollections/HTMLCollection'; import {getFabricUIManager} from '../../ReactNative/FabricUIManager'; import DOMRect from '../Geometry/DOMRect'; import {createHTMLCollection} from '../OldStyleCollections/HTMLCollection'; -import ReadOnlyNode, {getChildNodes, getShadowNode} from './ReadOnlyNode'; +import ReadOnlyNode, { + getChildNodes, + getInstanceHandle, + getShadowNode, +} from './ReadOnlyNode'; import {getElementSibling} from './Utilities/Traversal'; import nullthrows from 'nullthrows'; @@ -55,7 +59,11 @@ export default class ReadOnlyElement extends ReadOnlyNode { } get id(): string { - throw new TypeError('Unimplemented'); + const instanceHandle = getInstanceHandle(this); + // TODO: migrate off this private React API + // $FlowExpectedError[incompatible-use] + const props = instanceHandle?.stateNode?.canonical?.currentProps; + return props?.id ?? props?.nativeID ?? ''; } get lastElementChild(): ReadOnlyElement | null { diff --git a/packages/react-native/Libraries/DOM/Nodes/ReadOnlyNode.js b/packages/react-native/Libraries/DOM/Nodes/ReadOnlyNode.js index e92a298be913e8..8a95751f8e4798 100644 --- a/packages/react-native/Libraries/DOM/Nodes/ReadOnlyNode.js +++ b/packages/react-native/Libraries/DOM/Nodes/ReadOnlyNode.js @@ -293,7 +293,7 @@ export default class ReadOnlyNode { const INSTANCE_HANDLE_KEY = Symbol('internalInstanceHandle'); -function getInstanceHandle(node: ReadOnlyNode): InternalInstanceHandle { +export function getInstanceHandle(node: ReadOnlyNode): InternalInstanceHandle { // $FlowExpectedError[prop-missing] return node[INSTANCE_HANDLE_KEY]; } From 5fa1d8287d79616f55d77e3f9fc445c77f953464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 12 Jun 2023 11:02:22 -0700 Subject: [PATCH 108/468] Validate number of arguments passed to UIManagerBinding methods (#37783) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37783 We're not checking the number of arguments received before accessing the `arguments` array in JSI methods in `UIManagerBinding`, which could cause access to garbage values. This fixes that by adding a check in all methods to ensure the number of arguments received is at least the arity of the function. Changelog: [internal] Reviewed By: rshest Differential Revision: D46564580 fbshipit-source-id: 7012e0d6fb12c5024e4d6a4c0fb7a8c00263ccac --- .../renderer/uimanager/UIManagerBinding.cpp | 282 ++++++++++++------ 1 file changed, 190 insertions(+), 92 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp index 96cae3169e0a9c..2e4db8f6e19b27 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp @@ -140,6 +140,19 @@ void UIManagerBinding::invalidate() const { uiManager_->setDelegate(nullptr); } +static void validateArgumentCount( + jsi::Runtime &runtime, + std::string const &methodName, + size_t expected, + size_t actual) { + if (actual < expected) { + throw jsi::JSError( + runtime, + methodName + " requires " + std::to_string(expected) + + " arguments, but only " + std::to_string(actual) + " were passed"); + } +} + jsi::Value UIManagerBinding::get( jsi::Runtime &runtime, jsi::PropNameID const &name) { @@ -177,15 +190,18 @@ jsi::Value UIManagerBinding::get( // Semantic: Creates a new node with given pieces. if (methodName == "createNode") { + auto paramCount = 5; return jsi::Function::createFromHostFunction( runtime, name, - 5, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto instanceHandle = instanceHandleFromValue(runtime, arguments[4], arguments[0]); if (!instanceHandle) { @@ -206,15 +222,18 @@ jsi::Value UIManagerBinding::get( // Semantic: Clones the node with *same* props and *same* children. if (methodName == "cloneNode") { + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + return valueFromShadowNode( runtime, uiManager->cloneNode( @@ -223,15 +242,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "setIsJSResponder") { + auto paramCount = 3; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + uiManager->setIsJSResponder( shadowNodeFromValue(runtime, arguments[0]), arguments[1].getBool(), @@ -242,15 +264,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "findNodeAtPoint") { + auto paramCount = 4; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) { + size_t count) { + validateArgumentCount(runtime, methodName, paramCount, count); + auto node = shadowNodeFromValue(runtime, arguments[0]); auto locationX = (Float)arguments[1].getNumber(); auto locationY = (Float)arguments[2].getNumber(); @@ -273,15 +298,18 @@ jsi::Value UIManagerBinding::get( // Semantic: Clones the node with *same* props and *empty* children. if (methodName == "cloneNodeWithNewChildren") { + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + return valueFromShadowNode( runtime, uiManager->cloneNode( @@ -292,15 +320,18 @@ jsi::Value UIManagerBinding::get( // Semantic: Clones the node with *given* props and *same* children. if (methodName == "cloneNodeWithNewProps") { + auto paramCount = 2; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto const &rawProps = RawProps(runtime, arguments[1]); return valueFromShadowNode( runtime, @@ -313,15 +344,18 @@ jsi::Value UIManagerBinding::get( // Semantic: Clones the node with *given* props and *empty* children. if (methodName == "cloneNodeWithNewChildrenAndProps") { + auto paramCount = 2; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto const &rawProps = RawProps(runtime, arguments[1]); return valueFromShadowNode( runtime, @@ -333,15 +367,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "appendChild") { + auto paramCount = 2; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + uiManager->appendChild( shadowNodeFromValue(runtime, arguments[0]), shadowNodeFromValue(runtime, arguments[1])); @@ -353,11 +390,11 @@ jsi::Value UIManagerBinding::get( return jsi::Function::createFromHostFunction( runtime, name, - 1, + 0, [](jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const * /*arguments*/, - size_t /*count*/) noexcept -> jsi::Value { + size_t /*count*/) -> jsi::Value { auto shadowNodeList = std::make_shared( ShadowNode::ListOfShared({})); return valueFromShadowNodeList(runtime, shadowNodeList); @@ -365,14 +402,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "appendChildToSet") { + auto paramCount = 2; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [](jsi::Runtime &runtime, - jsi::Value const & /*thisValue*/, - jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + paramCount, + [methodName, paramCount]( + jsi::Runtime &runtime, + jsi::Value const & /*thisValue*/, + jsi::Value const *arguments, + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNodeList = shadowNodeListFromValue(runtime, arguments[0]); auto shadowNode = shadowNodeFromValue(runtime, arguments[1]); shadowNodeList->push_back(shadowNode); @@ -381,18 +422,21 @@ jsi::Value UIManagerBinding::get( } if (methodName == "completeRoot") { + auto paramCount = 2; std::weak_ptr weakUIManager = uiManager_; // Enhanced version of the method that uses `backgroundExecutor` and // captures a shared pointer to `UIManager`. return jsi::Function::createFromHostFunction( runtime, name, - 2, - [weakUIManager, uiManager]( + paramCount, + [weakUIManager, uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto runtimeSchedulerBinding = RuntimeSchedulerBinding::getBinding(runtime); auto surfaceId = surfaceIdFromValue(runtime, arguments[0]); @@ -449,15 +493,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "registerEventHandler") { + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [this]( + paramCount, + [this, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto eventHandler = arguments[0].getObject(runtime).getFunction(runtime); eventHandler_ = @@ -467,15 +514,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "getRelativeLayoutMetrics") { + auto paramCount = 2; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto layoutMetrics = uiManager->getRelativeLayoutMetrics( *shadowNodeFromValue(runtime, arguments[0]), shadowNodeFromValue(runtime, arguments[1]).get(), @@ -491,15 +541,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "dispatchCommand") { + auto paramCount = 3; return jsi::Function::createFromHostFunction( runtime, name, - 3, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); if (shadowNode) { uiManager->dispatchCommand( @@ -512,15 +565,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "setNativeProps") { + auto paramCount = 2; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, const jsi::Value &, const jsi::Value *arguments, - size_t) -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + uiManager->setNativeProps_DEPRECATED( shadowNodeFromValue(runtime, arguments[0]), RawProps(runtime, arguments[1])); @@ -531,15 +587,18 @@ jsi::Value UIManagerBinding::get( // Legacy API if (methodName == "measureLayout") { + auto paramCount = 4; return jsi::Function::createFromHostFunction( runtime, name, - 4, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) { + size_t count) { + validateArgumentCount(runtime, methodName, paramCount, count); + auto layoutMetrics = uiManager->getRelativeLayoutMetrics( *shadowNodeFromValue(runtime, arguments[0]), shadowNodeFromValue(runtime, arguments[1]).get(), @@ -567,15 +626,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "measure") { + auto paramCount = 2; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) { + size_t count) { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); auto layoutMetrics = uiManager->getRelativeLayoutMetrics( *shadowNode, nullptr, {/* .includeTransform = */ true}); @@ -609,15 +671,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "measureInWindow") { + auto paramCount = 2; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) { + size_t count) { + validateArgumentCount(runtime, methodName, paramCount, count); + auto layoutMetrics = uiManager->getRelativeLayoutMetrics( *shadowNodeFromValue(runtime, arguments[0]), nullptr, @@ -644,15 +709,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "sendAccessibilityEvent") { + auto paramCount = 2; return jsi::Function::createFromHostFunction( runtime, name, - 2, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + uiManager->sendAccessibilityEvent( shadowNodeFromValue(runtime, arguments[0]), stringFromValue(runtime, arguments[1])); @@ -662,15 +730,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "configureNextLayoutAnimation") { + auto paramCount = 3; return jsi::Function::createFromHostFunction( runtime, name, - 3, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + uiManager->configureNextLayoutAnimation( runtime, // TODO: pass in JSI value instead of folly::dynamic to RawValue @@ -687,10 +758,10 @@ jsi::Value UIManagerBinding::get( name, 0, [this]( - jsi::Runtime &, - jsi::Value const &, - jsi::Value const *, - size_t) noexcept -> jsi::Value { + jsi::Runtime & /*runtime*/, + jsi::Value const & /*thisValue*/, + jsi::Value const * /*arguments*/, + size_t /*count*/) -> jsi::Value { return {serialize(currentEventPriority_)}; }); } @@ -704,15 +775,18 @@ jsi::Value UIManagerBinding::get( } if (methodName == "findShadowNodeByTag_DEPRECATED") { + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const &, jsi::Value const *arguments, - size_t) -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNode = uiManager->findShadowNodeByTag_DEPRECATED( tagFromValue(arguments[0])); @@ -743,15 +817,18 @@ jsi::Value UIManagerBinding::get( // /* width: */ number, // /* height: */ number // ] + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto layoutMetrics = uiManager->getRelativeLayoutMetrics( *shadowNodeFromValue(runtime, arguments[0]), nullptr, @@ -781,15 +858,18 @@ jsi::Value UIManagerBinding::get( // Otherwise, it returns null. // getParent(shadowNode: ShadowNode): ?InstanceHandle + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); auto parentShadowNode = uiManager->getNewestParentOfShadowNode(*shadowNode); @@ -812,15 +892,18 @@ jsi::Value UIManagerBinding::get( // children. Otherwise, it returns an empty array. // getChildren(shadowNode: ShadowNode): Array + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); auto newestCloneOfShadowNode = @@ -845,15 +928,18 @@ jsi::Value UIManagerBinding::get( // the current revision of an active shadow tree. // isConnected(shadowNode: ShadowNode): boolean + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); auto newestCloneOfShadowNode = @@ -874,15 +960,18 @@ jsi::Value UIManagerBinding::get( // compareDocumentPosition(shadowNode: ShadowNode, otherShadowNode: // ShadowNode): number + auto paramCount = 2; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); auto otherShadowNode = shadowNodeFromValue(runtime, arguments[1]); @@ -908,15 +997,18 @@ jsi::Value UIManagerBinding::get( // not need any traversal. // getTextContent(shadowNode: ShadowNode): string + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); auto textContent = @@ -950,15 +1042,18 @@ jsi::Value UIManagerBinding::get( // /* top: */ number, // /* left: */ number, // ] + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); auto newestCloneOfShadowNode = @@ -1031,15 +1126,18 @@ jsi::Value UIManagerBinding::get( // /* scrollLeft: */ number, // /* scrollTop: */ number, // ] + auto paramCount = 1; return jsi::Function::createFromHostFunction( runtime, name, - 1, - [uiManager]( + paramCount, + [uiManager, methodName, paramCount]( jsi::Runtime &runtime, jsi::Value const & /*thisValue*/, jsi::Value const *arguments, - size_t /*count*/) noexcept -> jsi::Value { + size_t count) -> jsi::Value { + validateArgumentCount(runtime, methodName, paramCount, count); + auto shadowNode = shadowNodeFromValue(runtime, arguments[0]); auto newestCloneOfShadowNode = From c97dcc2de56dd22b1a72de1265ebfcd150d33dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 12 Jun 2023 11:02:22 -0700 Subject: [PATCH 109/468] Cache properties in global.nativeFabricUIManager when accessed through FabricUIManager.getFabricUIManager (#37796) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37796 Changelog: [internal] `global.nativeFabricUIManager` is defined as a host object in https://github.com/facebook/react-native/blob/5cc8ceeae210f2f23ef18ded7b7b614682f0d67b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp and every time a property of that object is accessed, the value is recreated by the host object (like in https://github.com/facebook/react-native/blob/5cc8ceeae210f2f23ef18ded7b7b614682f0d67b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp#L179). This is problematic because we're continuously creating copies of those methods every time we access them. As a quick solution (until we migrate the whole native implementation to a regular object with eagerly defined properties or to a TurboModule), this creates a proxy object in JavaScript to cache all properties. Reviewed By: rshest Differential Revision: D46592010 fbshipit-source-id: 38f233becd2ca130fa331d61f99ba54fbf706e13 --- .../Libraries/ReactNative/FabricUIManager.js | 64 ++++++++++++++++- .../__tests__/FabricUIManager-test.js | 68 +++++++++++++++++++ 2 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 packages/react-native/Libraries/ReactNative/__tests__/FabricUIManager-test.js diff --git a/packages/react-native/Libraries/ReactNative/FabricUIManager.js b/packages/react-native/Libraries/ReactNative/FabricUIManager.js index 68372d8b44ef7a..dbdd96cae7fe9a 100644 --- a/packages/react-native/Libraries/ReactNative/FabricUIManager.js +++ b/packages/react-native/Libraries/ReactNative/FabricUIManager.js @@ -20,6 +20,8 @@ import type { } from '../Renderer/shims/ReactNativeTypes'; import type {RootTag} from '../Types/RootTagTypes'; +import defineLazyObjectProperty from '../Utilities/defineLazyObjectProperty'; + export type NodeSet = Array; export type NodeProps = {...}; export type Spec = {| @@ -91,9 +93,69 @@ export type Spec = {| ) => ?[/* scrollLeft: */ number, /* scrollTop: */ number], |}; +let nativeFabricUIManagerProxy: ?Spec; + +// This is a list of all the methods in global.nativeFabricUIManager that we'll +// cache in JavaScript, as the current implementation of the binding +// creates a new host function every time methods are accessed. +const CACHED_PROPERTIES = [ + 'createNode', + 'cloneNode', + 'cloneNodeWithNewChildren', + 'cloneNodeWithNewProps', + 'cloneNodeWithNewChildrenAndProps', + 'createChildSet', + 'appendChild', + 'appendChildToSet', + 'completeRoot', + 'measure', + 'measureInWindow', + 'measureLayout', + 'configureNextLayoutAnimation', + 'sendAccessibilityEvent', + 'findShadowNodeByTag_DEPRECATED', + 'setNativeProps', + 'dispatchCommand', + 'getParentNode', + 'getChildNodes', + 'isConnected', + 'compareDocumentPosition', + 'getTextContent', + 'getBoundingClientRect', + 'getOffset', + 'getScrollPosition', +]; + // This is exposed as a getter because apps using the legacy renderer AND // Fabric can define the binding lazily. If we evaluated the global and cached // it in the module we might be caching an `undefined` value before it is set. export function getFabricUIManager(): ?Spec { - return global.nativeFabricUIManager; + if ( + nativeFabricUIManagerProxy == null && + global.nativeFabricUIManager != null + ) { + nativeFabricUIManagerProxy = createProxyWithCachedProperties( + global.nativeFabricUIManager, + CACHED_PROPERTIES, + ); + } + return nativeFabricUIManagerProxy; +} + +/** + * + * Returns an object that caches the specified properties the first time they + * are accessed, and falls back to the original object for other properties. + */ +function createProxyWithCachedProperties( + implementation: Spec, + propertiesToCache: $ReadOnlyArray, +): Spec { + const proxy = Object.create(implementation); + for (const propertyName of propertiesToCache) { + defineLazyObjectProperty(proxy, propertyName, { + get: () => implementation[propertyName], + }); + } + return proxy; } diff --git a/packages/react-native/Libraries/ReactNative/__tests__/FabricUIManager-test.js b/packages/react-native/Libraries/ReactNative/__tests__/FabricUIManager-test.js new file mode 100644 index 00000000000000..e9d1d49c291633 --- /dev/null +++ b/packages/react-native/Libraries/ReactNative/__tests__/FabricUIManager-test.js @@ -0,0 +1,68 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + * @oncall react_native + */ + +// flowlint unsafe-getters-setters:off + +describe('FabricUIManager', () => { + let getFabricUIManager; + + beforeEach(() => { + jest.resetModules(); + delete global.nativeFabricUIManager; + getFabricUIManager = require('../FabricUIManager').getFabricUIManager; + }); + + describe('getFabricUIManager', () => { + it('should return undefined if the global binding is not set', () => { + expect(getFabricUIManager()).toBeUndefined(); + }); + + it('should return an object with the same properties as the global binding', () => { + const createNode = jest.fn(); + const customProp = 'some prop'; + global.nativeFabricUIManager = { + createNode, + customProp, + }; + const fabricUIManager = getFabricUIManager(); + + expect(fabricUIManager).toEqual(expect.any(Object)); + expect(fabricUIManager?.createNode).toBe(createNode); + // $FlowExpectedError[prop-missing] + expect(fabricUIManager?.customProp).toBe(customProp); + }); + + it('should only access the cached properties of global binding once', () => { + let incrementingProp = 0; + global.nativeFabricUIManager = { + get createNode() { + return jest.fn(); + }, + get incrementingProp() { + return incrementingProp++; + }, + }; + + const fabricUIManager = getFabricUIManager(); + + expect(fabricUIManager).toEqual(expect.any(Object)); + const firstCreateNode = fabricUIManager?.createNode; + const secondCreateNode = fabricUIManager?.createNode; + // In the original object, the getter creates a new function every time. + expect(firstCreateNode).toBe(secondCreateNode); + + // $FlowExpectedError[prop-missing] + expect(fabricUIManager?.incrementingProp).toBe(0); + // $FlowExpectedError[prop-missing] + expect(fabricUIManager?.incrementingProp).toBe(1); + }); + }); +}); From 48cdc603f5be87309d202ace5035e1b40ad85b53 Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Mon, 12 Jun 2023 12:09:45 -0700 Subject: [PATCH 110/468] Back out "When animating using native driver, trigger rerender on animation completion" (#37820) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37820 Original commit changeset: 185471b28f5f Original Phabricator Diff: D46574511 Changelog: [internal] Reviewed By: jehartzog Differential Revision: D46629553 fbshipit-source-id: 7c8bc7970006643459a3b9c8613009614dcd3886 --- .../Animated/animations/Animation.js | 21 ------------------- .../Libraries/Animated/useAnimatedProps.js | 4 +--- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/packages/react-native/Libraries/Animated/animations/Animation.js b/packages/react-native/Libraries/Animated/animations/Animation.js index 1c9513902f1323..6a14a87fabde3e 100644 --- a/packages/react-native/Libraries/Animated/animations/Animation.js +++ b/packages/react-native/Libraries/Animated/animations/Animation.js @@ -11,11 +11,9 @@ 'use strict'; import type {PlatformConfig} from '../AnimatedPlatformConfig'; -import type AnimatedNode from '../nodes/AnimatedNode'; import type AnimatedValue from '../nodes/AnimatedValue'; import NativeAnimatedHelper from '../NativeAnimatedHelper'; -import AnimatedProps from '../nodes/AnimatedProps'; export type EndResult = {finished: boolean, value?: number, ...}; export type EndCallback = (result: EndResult) => void; @@ -67,21 +65,6 @@ export default class Animation { onEnd && onEnd(result); } - __findAnimatedPropsNode(node: AnimatedNode): ?AnimatedProps { - if (node instanceof AnimatedProps) { - return node; - } - - for (const child of node.__getChildren()) { - const result = this.__findAnimatedPropsNode(child); - if (result) { - return result; - } - } - - return null; - } - __startNativeAnimation(animatedValue: AnimatedValue): void { const startNativeAnimationWaitId = `${startNativeAnimationNextId}:startAnimation`; startNativeAnimationNextId += 1; @@ -106,10 +89,6 @@ export default class Animation { if (value != null) { animatedValue.__onAnimatedValueUpdateReceived(value); } - - // Once the JS side node is synced with the updated values, trigger an - // update on the AnimatedProps node to call any registered callbacks. - this.__findAnimatedPropsNode(animatedValue)?.update(); }, ); } catch (e) { diff --git a/packages/react-native/Libraries/Animated/useAnimatedProps.js b/packages/react-native/Libraries/Animated/useAnimatedProps.js index 2afe52f232c673..865bddd8ca3cbe 100644 --- a/packages/react-native/Libraries/Animated/useAnimatedProps.js +++ b/packages/react-native/Libraries/Animated/useAnimatedProps.js @@ -66,9 +66,7 @@ export default function useAnimatedProps( // changes), but `setNativeView` already optimizes for that. node.setNativeView(instance); - // NOTE: When using the JS animation driver, this callback is called on - // every animation frame. When using the native driver, this callback is - // called when the animation completes. + // NOTE: This callback is only used by the JavaScript animation driver. onUpdateRef.current = () => { if ( process.env.NODE_ENV === 'test' || From 3a246ed024da04c6f4b8e5f2a776337f83d50664 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 12 Jun 2023 12:46:00 -0700 Subject: [PATCH 111/468] Remove CallInvoker parameter from toJs method in Codegen (#37832) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37832 This parameter is currently unused and is causing Android builds to fail as they compile with `-Wall` This is a follow-up to https://github.com/facebook/react-native/pull/37454/ as that PR updated only the `fromJs` and not the `toJs` method as well. Changelog: [Internal] [Changed] - Remove CallInvoker parameter from toJs method in Codegen Reviewed By: rshest Differential Revision: D46647110 fbshipit-source-id: 1f3e22aca7a3df11ac02b5c4b89c9311b8b1798c --- .../__snapshots__/GenerateModuleH-test.js.snap | 16 ++++++++-------- .../src/generators/modules/GenerateModuleH.js | 2 +- .../__snapshots__/GenerateModuleH-test.js.snap | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/react-native-codegen/e2e/__tests__/modules/__snapshots__/GenerateModuleH-test.js.snap b/packages/react-native-codegen/e2e/__tests__/modules/__snapshots__/GenerateModuleH-test.js.snap index cee8760bb3bbef..e7d50c7f5c1f9c 100644 --- a/packages/react-native-codegen/e2e/__tests__/modules/__snapshots__/GenerateModuleH-test.js.snap +++ b/packages/react-native-codegen/e2e/__tests__/modules/__snapshots__/GenerateModuleH-test.js.snap @@ -206,7 +206,7 @@ struct Bridging { } } - static jsi::String toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusRegularEnum value, const std::shared_ptr &jsInvoker) { + static jsi::String toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusRegularEnum value) { if (value == NativeEnumTurboModuleStatusRegularEnum::Active) { return bridging::toJs(rt, \\"Active\\"); } else if (value == NativeEnumTurboModuleStatusRegularEnum::Paused) { @@ -238,7 +238,7 @@ struct Bridging { } } - static jsi::String toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusStrEnum value, const std::shared_ptr &jsInvoker) { + static jsi::String toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusStrEnum value) { if (value == NativeEnumTurboModuleStatusStrEnum::Active) { return bridging::toJs(rt, \\"active\\"); } else if (value == NativeEnumTurboModuleStatusStrEnum::Paused) { @@ -270,7 +270,7 @@ struct Bridging { } } - static jsi::Value toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusNumEnum value, const std::shared_ptr &jsInvoker) { + static jsi::Value toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusNumEnum value) { if (value == NativeEnumTurboModuleStatusNumEnum::Active) { return bridging::toJs(rt, 2); } else if (value == NativeEnumTurboModuleStatusNumEnum::Paused) { @@ -302,7 +302,7 @@ struct Bridging { } } - static jsi::Value toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusFractionEnum value, const std::shared_ptr &jsInvoker) { + static jsi::Value toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusFractionEnum value) { if (value == NativeEnumTurboModuleStatusFractionEnum::Active) { return bridging::toJs(rt, 0.2f); } else if (value == NativeEnumTurboModuleStatusFractionEnum::Paused) { @@ -2149,7 +2149,7 @@ struct Bridging { } } - static jsi::String toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusRegularEnum value, const std::shared_ptr &jsInvoker) { + static jsi::String toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusRegularEnum value) { if (value == NativeEnumTurboModuleStatusRegularEnum::Active) { return bridging::toJs(rt, \\"Active\\"); } else if (value == NativeEnumTurboModuleStatusRegularEnum::Paused) { @@ -2181,7 +2181,7 @@ struct Bridging { } } - static jsi::String toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusStrEnum value, const std::shared_ptr &jsInvoker) { + static jsi::String toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusStrEnum value) { if (value == NativeEnumTurboModuleStatusStrEnum::Active) { return bridging::toJs(rt, \\"active\\"); } else if (value == NativeEnumTurboModuleStatusStrEnum::Paused) { @@ -2213,7 +2213,7 @@ struct Bridging { } } - static jsi::Value toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusNumEnum value, const std::shared_ptr &jsInvoker) { + static jsi::Value toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusNumEnum value) { if (value == NativeEnumTurboModuleStatusNumEnum::Active) { return bridging::toJs(rt, 2); } else if (value == NativeEnumTurboModuleStatusNumEnum::Paused) { @@ -2245,7 +2245,7 @@ struct Bridging { } } - static jsi::Value toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusFractionEnum value, const std::shared_ptr &jsInvoker) { + static jsi::Value toJs(jsi::Runtime &rt, NativeEnumTurboModuleStatusFractionEnum value) { if (value == NativeEnumTurboModuleStatusFractionEnum::Active) { return bridging::toJs(rt, 0.2f); } else if (value == NativeEnumTurboModuleStatusFractionEnum::Paused) { diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js index 8cd7acf64c8230..e4d8f53b5b5d60 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js @@ -343,7 +343,7 @@ struct Bridging<${enumName}> { ${fromCases} } - static ${toValue} toJs(jsi::Runtime &rt, ${enumName} value, const std::shared_ptr &jsInvoker) { + static ${toValue} toJs(jsi::Runtime &rt, ${enumName} value) { ${toCases} } };`; diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap index 040a3e9613672c..be1d454013a153 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap @@ -222,7 +222,7 @@ struct Bridging { } } - static jsi::Value toJs(jsi::Runtime &rt, SampleTurboModuleCxxNumEnum value, const std::shared_ptr &jsInvoker) { + static jsi::Value toJs(jsi::Runtime &rt, SampleTurboModuleCxxNumEnum value) { if (value == SampleTurboModuleCxxNumEnum::ONE) { return bridging::toJs(rt, 1); } else if (value == SampleTurboModuleCxxNumEnum::TWO) { @@ -252,7 +252,7 @@ struct Bridging { } } - static jsi::Value toJs(jsi::Runtime &rt, SampleTurboModuleCxxFloatEnum value, const std::shared_ptr &jsInvoker) { + static jsi::Value toJs(jsi::Runtime &rt, SampleTurboModuleCxxFloatEnum value) { if (value == SampleTurboModuleCxxFloatEnum::POINT_ZERO) { return bridging::toJs(rt, 0.0f); } else if (value == SampleTurboModuleCxxFloatEnum::POINT_ONE) { @@ -282,7 +282,7 @@ struct Bridging { } } - static jsi::String toJs(jsi::Runtime &rt, SampleTurboModuleCxxStringEnum value, const std::shared_ptr &jsInvoker) { + static jsi::String toJs(jsi::Runtime &rt, SampleTurboModuleCxxStringEnum value) { if (value == SampleTurboModuleCxxStringEnum::HELLO) { return bridging::toJs(rt, \\"hello\\"); } else if (value == SampleTurboModuleCxxStringEnum::GoodBye) { @@ -1220,7 +1220,7 @@ struct Bridging { } } - static jsi::Value toJs(jsi::Runtime &rt, SampleTurboModuleNumEnum value, const std::shared_ptr &jsInvoker) { + static jsi::Value toJs(jsi::Runtime &rt, SampleTurboModuleNumEnum value) { if (value == SampleTurboModuleNumEnum::ONE) { return bridging::toJs(rt, 1); } else if (value == SampleTurboModuleNumEnum::TWO) { @@ -1250,7 +1250,7 @@ struct Bridging { } } - static jsi::Value toJs(jsi::Runtime &rt, SampleTurboModuleFloatEnum value, const std::shared_ptr &jsInvoker) { + static jsi::Value toJs(jsi::Runtime &rt, SampleTurboModuleFloatEnum value) { if (value == SampleTurboModuleFloatEnum::POINT_ZERO) { return bridging::toJs(rt, 0.0f); } else if (value == SampleTurboModuleFloatEnum::POINT_ONE) { @@ -1280,7 +1280,7 @@ struct Bridging { } } - static jsi::String toJs(jsi::Runtime &rt, SampleTurboModuleStringEnum value, const std::shared_ptr &jsInvoker) { + static jsi::String toJs(jsi::Runtime &rt, SampleTurboModuleStringEnum value) { if (value == SampleTurboModuleStringEnum::HELLO) { return bridging::toJs(rt, \\"hello\\"); } else if (value == SampleTurboModuleStringEnum::GoodBye) { From 466742c9ce61428199e3760798613932ddc0f800 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Mon, 12 Jun 2023 13:37:39 -0700 Subject: [PATCH 112/468] rename ReactInstanceTest directory from hermes to cxx (#37812) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37812 Changelog: [Internal] I would like to add iOS unit tests, but this testing directory has a subdirectory based on features and not platform, which makes the organization challenging, so i'm moving it to a more aptly named directory. Reviewed By: javache Differential Revision: D46467041 fbshipit-source-id: f2ba714dc79ecb509b86b4708320c68235354240 --- .../react/bridgeless/tests/{hermes => cxx}/ReactInstanceTest.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/react-native/ReactCommon/react/bridgeless/tests/{hermes => cxx}/ReactInstanceTest.cpp (100%) diff --git a/packages/react-native/ReactCommon/react/bridgeless/tests/hermes/ReactInstanceTest.cpp b/packages/react-native/ReactCommon/react/bridgeless/tests/cxx/ReactInstanceTest.cpp similarity index 100% rename from packages/react-native/ReactCommon/react/bridgeless/tests/hermes/ReactInstanceTest.cpp rename to packages/react-native/ReactCommon/react/bridgeless/tests/cxx/ReactInstanceTest.cpp From ee38c4a40c9d301c30fad4d127e8d020a6100b8e Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Mon, 12 Jun 2023 13:37:39 -0700 Subject: [PATCH 113/468] introduce build boilerplate for ios unit tests (#37811) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37811 Changelog: [Internal] i am looking to add ios unit tests to venice and this is the first unit test suite that will test native ios code in the new architecture afaik, so i wanted to open this up to discussion. currently, all `XCTest` in `react-native-github` are coupled with the `RNTester` target. my main qualm with this is i am concerned that it won't scale well. currently we have only ~30ish tests but ultimately if we want a proper testing suite, surely this count will be in the hundreds and that won't be able to reasonably live in a single test target. however, the trade is that this test will not show up in RNTester. i have added a unit test to RNTester before in D31949237, however the experience was extremely painful as i had to manually update the `project.pbxproj` to include my file, and i had to manually determine what hex value was the next one (for whatever reason, this doesn't increment at the endian...). i am wondering if we can treat the current unit testing experience in RNTester as pretty much maintenance mode and start thinking of a improved version starting with something more modular like this. Reviewed By: cipolleschi Differential Revision: D46467229 fbshipit-source-id: 09de9cf8bc5f8b9c86abcaf7750a6f63686d8d1a --- .../react/bridgeless/iostests/RCTHostTests.mm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm diff --git a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm new file mode 100644 index 00000000000000..13fcf49f16add0 --- /dev/null +++ b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm @@ -0,0 +1,19 @@ +/* + * 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 + +@interface RCTHostTests : XCTestCase +@end + +@implementation RCTHostTests + +- (void)testHost +{ +} + +@end From a300a35f285260b5e8fd8927c2a8da7545c1e703 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Mon, 12 Jun 2023 13:37:39 -0700 Subject: [PATCH 114/468] introduce RCTTestUtils (#37810) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37810 Changelog: [Internal] in this change, i introduce a helper file for swizzling selectors that can be used for building custom shims and fakes. i tried putting this in the cxx target, but i struggled a lot with managing the dependencies and understanding the extra behavior that was happening from being in a `rn_xplat_cxx_library`. this file is also not obj-c++, so i feel like we should decouple if possible. it does seem like this is a new practice i'm introducing, so let me know if there's something that i'm missing. Reviewed By: cipolleschi Differential Revision: D46507803 fbshipit-source-id: 9be63d992b9838e9a98ee0c1c6d684fc59c3fc80 --- .../react/test_utils/ios/RCTSwizzleHelpers.h | 19 +++++++++++++++++++ .../react/test_utils/ios/RCTSwizzleHelpers.m | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.h create mode 100644 packages/react-native/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.m diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.h b/packages/react-native/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.h new file mode 100644 index 00000000000000..79ca15d2a6558d --- /dev/null +++ b/packages/react-native/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.h @@ -0,0 +1,19 @@ +/* + * 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 + +#import + +RCT_EXTERN_C_BEGIN + +void RCTSwizzleInstanceSelector( + Class targetClass, + Class swizzleClass, + SEL selector); + +RCT_EXTERN_C_END diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.m b/packages/react-native/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.m new file mode 100644 index 00000000000000..989a3474b73b27 --- /dev/null +++ b/packages/react-native/ReactCommon/react/test_utils/ios/RCTSwizzleHelpers.m @@ -0,0 +1,17 @@ +/* + * 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 "RCTSwizzleHelpers.h" + +#import + +void RCTSwizzleInstanceSelector(Class targetClass, Class swizzleClass, SEL selector) +{ + Method originalMethod = class_getInstanceMethod(targetClass, selector); + Method swizzleMethod = class_getInstanceMethod(swizzleClass, selector); + method_exchangeImplementations(originalMethod, swizzleMethod); +} From 2eba6ab5acdb2e706a56df7f1cc84acaac559eb5 Mon Sep 17 00:00:00 2001 From: Facebook Community Bot Date: Mon, 12 Jun 2023 14:34:52 -0700 Subject: [PATCH 115/468] Re-sync with internal repository (#37831) Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com> --- .circleci/config.yml | 4 +- scripts/__tests__/npm-utils-test.js | 47 +++++++++++++++++++- scripts/__tests__/publish-npm-test.js | 39 +++++++++-------- scripts/__tests__/set-rn-version-test.js | 56 ++++++++++++------------ scripts/npm-utils.js | 28 ++++++++++++ scripts/publish-npm.js | 30 ++++++------- scripts/run-ci-e2e-tests.js | 2 +- scripts/set-rn-template-version.js | 33 -------------- scripts/set-rn-version.js | 55 ++++++++++++++++------- scripts/test-e2e-local.js | 5 ++- scripts/update-template-package.js | 54 +++++++++++++++++++++++ 11 files changed, 238 insertions(+), 115 deletions(-) delete mode 100755 scripts/set-rn-template-version.js create mode 100755 scripts/update-template-package.js diff --git a/.circleci/config.yml b/.circleci/config.yml index 8a7d38a0b3f1df..96523f6d3a1f91 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -795,7 +795,7 @@ jobs: name: Create Android template project command: | REPO_ROOT=$(pwd) - node ./scripts/set-rn-template-version.js "file:$REPO_ROOT/build/$(cat build/react-native-package-version)" + node ./scripts/update-template-package.js "{\"react-native\":\"file:$REPO_ROOT/build/$(cat build/react-native-package-version)\"}" node ./scripts/template/initialize.js --reactNativeRootPath $REPO_ROOT --templateName $PROJECT_NAME --templateConfigPath "$REPO_ROOT/packages/react-native" --directory "/tmp/$PROJECT_NAME" - run: name: Build the template application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine. @@ -879,7 +879,7 @@ jobs: REPO_ROOT=$(pwd) PACKAGE=$(cat build/react-native-package-version) PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE" - node ./scripts/set-rn-template-version.js "file:$PATH_TO_PACKAGE" + node ./scripts/update-template-package.js "{\"react-native\":\"file:$PATH_TO_PACKAGE\"}" node ./scripts/template/initialize.js --reactNativeRootPath $REPO_ROOT --templateName $PROJECT_NAME --templateConfigPath "$REPO_ROOT/packages/react-native" --directory "/tmp/$PROJECT_NAME" - run: name: Install iOS dependencies - Configuration << parameters.flavor >>; New Architecture << parameters.architecture >>; JS Engine << parameters.jsengine>>; Flipper << parameters.flipper >> diff --git a/scripts/__tests__/npm-utils-test.js b/scripts/__tests__/npm-utils-test.js index bcf10031df3a85..b8013fcebd3e74 100644 --- a/scripts/__tests__/npm-utils-test.js +++ b/scripts/__tests__/npm-utils-test.js @@ -7,7 +7,11 @@ * @format */ -const {getPackageVersionStrByTag, publishPackage} = require('../npm-utils'); +const { + applyPackageVersions, + getPackageVersionStrByTag, + publishPackage, +} = require('../npm-utils'); const execMock = jest.fn(); jest.mock('shelljs', () => ({ @@ -20,6 +24,47 @@ describe('npm-utils', () => { jest.resetAllMocks(); }); + describe('applyPackageVersions', () => { + it('should replace package.json with dependencies', () => { + const originalPackageJson = { + name: 'my-package', + dependencies: { + 'my-dependency-a': 'nightly', + 'my-dependency-b': '^1.2.3', + }, + devDependencies: { + 'my-dev-dependency-a': 'nightly', + 'my-dev-dependency-b': '^1.2.3', + }, + someOtherField: { + 'my-dependency-a': 'should-be-untouched', + }, + }; + + const dependencies = { + 'my-dependency-a': '0.72.0-nightly-shortcommit', + 'my-dev-dependency-a': 'updated-version', + 'my-non-existant-dep': 'some-version', + }; + + const package = applyPackageVersions(originalPackageJson, dependencies); + expect(package).toEqual({ + name: 'my-package', + dependencies: { + 'my-dependency-a': '0.72.0-nightly-shortcommit', + 'my-dependency-b': '^1.2.3', + }, + devDependencies: { + 'my-dev-dependency-a': 'updated-version', + 'my-dev-dependency-b': '^1.2.3', + }, + someOtherField: { + 'my-dependency-a': 'should-be-untouched', + }, + }); + }); + }); + describe('getPackageVersionStrByTag', () => { it('should return package version string', () => { execMock.mockImplementationOnce(() => ({code: 0, stdout: '0.34.2 \n'})); diff --git a/scripts/__tests__/publish-npm-test.js b/scripts/__tests__/publish-npm-test.js index 3f2b88626a8728..3af1fa8bb3473e 100644 --- a/scripts/__tests__/publish-npm-test.js +++ b/scripts/__tests__/publish-npm-test.js @@ -10,7 +10,9 @@ const execMock = jest.fn(); const echoMock = jest.fn(); const exitMock = jest.fn(); +const consoleErrorMock = jest.fn(); const isTaggedLatestMock = jest.fn(); +const setReactNativeVersionMock = jest.fn(); const publishAndroidArtifactsToMavenMock = jest.fn(); const env = process.env; @@ -33,11 +35,13 @@ jest generateAndroidArtifacts: jest.fn(), publishAndroidArtifactsToMaven: publishAndroidArtifactsToMavenMock, })) + .mock('./../set-rn-version', () => setReactNativeVersionMock) .mock('../monorepo/get-and-update-nightlies'); const date = new Date('2023-04-20T23:52:39.543Z'); const publishNpm = require('../publish-npm'); +let consoleError; describe('publish-npm', () => { beforeAll(() => { @@ -47,8 +51,14 @@ describe('publish-npm', () => { afterAll(() => { jest.useRealTimers(); }); + beforeEach(() => { + consoleError = console.error; + console.error = consoleErrorMock; + }); + afterEach(() => { process.env = env; + console.error = consoleError; }); afterEach(() => { @@ -58,8 +68,6 @@ describe('publish-npm', () => { describe('dry-run', () => { it('should set version and not publish', () => { - execMock.mockReturnValueOnce({code: 0}); - publishNpm('dry-run'); expect(exitMock).toHaveBeenCalledWith(0); @@ -67,10 +75,11 @@ describe('publish-npm', () => { expect(echoMock).toHaveBeenCalledWith( 'Skipping `npm publish` because --dry-run is set.', ); - expect(execMock).toHaveBeenCalledWith( - 'node scripts/set-rn-version.js --to-version 1000.0.0-currentco --build-type dry-run', + expect(setReactNativeVersionMock).toBeCalledWith( + '1000.0.0-currentco', + null, + 'dry-run', ); - expect(execMock.mock.calls).toHaveLength(1); }); }); @@ -78,7 +87,6 @@ describe('publish-npm', () => { it('should publish', () => { execMock .mockReturnValueOnce({stdout: '0.81.0-rc.1\n', code: 0}) - .mockReturnValueOnce({code: 0}) .mockReturnValueOnce({code: 0}); const expectedVersion = '0.82.0-nightly-20230420-currentco'; @@ -91,22 +99,19 @@ describe('publish-npm', () => { expect(execMock.mock.calls[0][0]).toBe( `npm view react-native@next version`, ); - expect(execMock.mock.calls[1][0]).toBe( - `node scripts/set-rn-version.js --to-version ${expectedVersion} --build-type nightly`, - ); - expect(execMock.mock.calls[2][0]).toBe('npm publish --tag nightly'); + expect(execMock.mock.calls[1][0]).toBe('npm publish --tag nightly'); expect(echoMock).toHaveBeenCalledWith( `Published to npm ${expectedVersion}`, ); expect(exitMock).toHaveBeenCalledWith(0); - expect(execMock.mock.calls).toHaveLength(3); }); it('should fail to set version', () => { - execMock - .mockReturnValueOnce({stdout: '0.81.0-rc.1\n', code: 0}) - .mockReturnValueOnce({code: 1}); + execMock.mockReturnValueOnce({stdout: '0.81.0-rc.1\n', code: 0}); const expectedVersion = '0.82.0-nightly-20230420-currentco'; + setReactNativeVersionMock.mockImplementation(() => { + throw new Error('something went wrong'); + }); publishNpm('nightly'); @@ -114,14 +119,10 @@ describe('publish-npm', () => { expect(execMock.mock.calls[0][0]).toBe( `npm view react-native@next version`, ); - expect(execMock.mock.calls[1][0]).toBe( - `node scripts/set-rn-version.js --to-version ${expectedVersion} --build-type nightly`, - ); - expect(echoMock).toHaveBeenCalledWith( + expect(consoleErrorMock).toHaveBeenCalledWith( `Failed to set version number to ${expectedVersion}`, ); expect(exitMock).toHaveBeenCalledWith(1); - expect(execMock.mock.calls).toHaveLength(2); }); }); diff --git a/scripts/__tests__/set-rn-version-test.js b/scripts/__tests__/set-rn-version-test.js index b913e4638b9a3f..5c83cb002ee945 100644 --- a/scripts/__tests__/set-rn-version-test.js +++ b/scripts/__tests__/set-rn-version-test.js @@ -9,19 +9,19 @@ const execMock = jest.fn(); const echoMock = jest.fn(); -const exitMock = jest.fn(); const catMock = jest.fn(); const sedMock = jest.fn(); const writeFileSyncMock = jest.fn(); +const updateTemplatePackageMock = jest.fn(); jest .mock('shelljs', () => ({ exec: execMock, echo: echoMock, - exit: exitMock, cat: catMock, sed: sedMock, })) + .mock('./../update-template-package', () => updateTemplatePackageMock) .mock('./../scm-utils', () => ({ saveFiles: jest.fn(), })) @@ -45,7 +45,7 @@ describe('set-rn-version', () => { it('should set nightly version', () => { catMock.mockImplementation(path => { if (path === 'packages/react-native/package.json') { - return '{"name": "myPackage", "version": 2}'; + return '{"name": "myPackage", "version": 2, "dependencies": {"@react-native/package-a": "nightly", "@react-native/package-b": "^0.73.0"}}'; } else if ( path === 'scripts/versiontemplates/ReactNativeVersion.java.template' || path === 'scripts/versiontemplates/RCTVersion.m.template' || @@ -58,13 +58,14 @@ describe('set-rn-version', () => { } }); - execMock - .mockReturnValueOnce({code: 0}) - .mockReturnValueOnce({stdout: 'line1\nline2\nline3\n'}); + execMock.mockReturnValueOnce({stdout: 'line1\nline2\nline3\n'}); sedMock.mockReturnValueOnce({code: 0}); const version = '0.81.0-nightly-29282302-abcd1234'; - setReactNativeVersion(version, 'nightly'); + const nightlyVersions = { + '@react-native/package-a': version, + }; + setReactNativeVersion(version, nightlyVersions, 'nightly'); expect(sedMock).toHaveBeenCalledWith( '-i', @@ -91,14 +92,19 @@ describe('set-rn-version', () => { expect(writeFileSyncMock.mock.calls[4][0]).toBe( 'packages/react-native/package.json', ); - expect(writeFileSyncMock.mock.calls[4][1]).toBe( - `{\n "name": "myPackage",\n "version": "${version}"\n}`, - ); - - expect(exitMock.mock.calls[0][0]).toBe(0); - expect(execMock.mock.calls[0][0]).toBe( - `node scripts/set-rn-template-version.js ${version}`, - ); + expect(writeFileSyncMock.mock.calls[4][1]).toBe(`{ + "name": "myPackage", + "version": "${version}", + "dependencies": { + "@react-native/package-a": "0.81.0-nightly-29282302-abcd1234", + "@react-native/package-b": "^0.73.0" + } +}`); + + expect(updateTemplatePackageMock).toHaveBeenCalledWith({ + '@react-native/package-a': '0.81.0-nightly-29282302-abcd1234', + 'react-native': version, + }); }); it('should set release version', () => { @@ -109,13 +115,11 @@ describe('set-rn-version', () => { return 'exports.version = {major: ${major}, minor: ${minor}, patch: ${patch}, prerelease: ${prerelease}}'; }); - execMock - .mockReturnValueOnce({code: 0}) - .mockReturnValueOnce({stdout: 'line1\nline2\nline3\n'}); + execMock.mockReturnValueOnce({stdout: 'line1\nline2\nline3\n'}); sedMock.mockReturnValueOnce({code: 0}); const version = '0.81.0'; - setReactNativeVersion(version, 'release'); + setReactNativeVersion(version, null, 'release'); expect(sedMock).toHaveBeenCalledWith( '-i', @@ -137,11 +141,10 @@ describe('set-rn-version', () => { `{\n "name": "myPackage",\n "version": "${version}"\n}`, ); - expect(exitMock.mock.calls[0][0]).toBe(0); + expect(updateTemplatePackageMock).toHaveBeenCalledWith({ + 'react-native': version, + }); expect(execMock.mock.calls[0][0]).toBe( - `node scripts/set-rn-template-version.js ${version}`, - ); - expect(execMock.mock.calls[1][0]).toBe( `diff -r ./rn-set-version/ . | grep '^[>]' | grep -c ${version} `, ); }); @@ -149,9 +152,7 @@ describe('set-rn-version', () => { it('should fail validation', () => { catMock.mockReturnValue('{}'); - execMock - .mockReturnValueOnce({code: 0}) - .mockReturnValueOnce({stdout: 'line1\nline2\n'}); + execMock.mockReturnValueOnce({stdout: 'line1\nline2\n'}); sedMock.mockReturnValueOnce({code: 0}); const filesToValidate = [ 'packages/react-native/package.json', @@ -160,9 +161,8 @@ describe('set-rn-version', () => { ]; const version = '0.81.0'; - setReactNativeVersion(version, 'release'); + setReactNativeVersion(version, null, 'release'); - expect(exitMock).toHaveBeenCalledWith(0); expect(echoMock).toHaveBeenNthCalledWith( 1, 'The tmp versioning folder is ./rn-set-version/', diff --git a/scripts/npm-utils.js b/scripts/npm-utils.js index 5586d7e3372952..d92de469014203 100644 --- a/scripts/npm-utils.js +++ b/scripts/npm-utils.js @@ -56,7 +56,35 @@ function pack(packagePath) { } } +/** + * `package` is an object form of package.json + * `dependencies` is a map of dependency to version string + * + * This replaces both dependencies and devDependencies in package.json + */ +function applyPackageVersions(originalPackageJson, packageVersions) { + const packageJson = {...originalPackageJson}; + + for (const name of Object.keys(packageVersions)) { + if ( + packageJson.dependencies != null && + packageJson.dependencies[name] != null + ) { + packageJson.dependencies[name] = packageVersions[name]; + } + + if ( + packageJson.devDependencies != null && + packageJson.devDependencies[name] != null + ) { + packageJson.devDependencies[name] = packageVersions[name]; + } + } + return packageJson; +} + module.exports = { + applyPackageVersions, getPackageVersionStrByTag, publishPackage, diffPackages, diff --git a/scripts/publish-npm.js b/scripts/publish-npm.js index e0223288059e34..b6cb1a12525a8c 100755 --- a/scripts/publish-npm.js +++ b/scripts/publish-npm.js @@ -9,7 +9,7 @@ 'use strict'; -const {exec, echo, exit} = require('shelljs'); +const {echo, exit} = require('shelljs'); const {parseVersion} = require('./version-utils'); const {getPackageVersionStrByTag, publishPackage} = require('./npm-utils'); const { @@ -18,6 +18,7 @@ const { isTaggedLatest, } = require('./scm-utils'); const getAndUpdateNightlies = require('./monorepo/get-and-update-nightlies'); +const setReactNativeVersion = require('./set-rn-version'); const { generateAndroidArtifacts, publishAndroidArtifactsToMaven, @@ -134,25 +135,24 @@ function getNpmInfo(buildType) { function publishNpm(buildType) { const {version, tag} = getNpmInfo(buildType); - // Set version number in various files (package.json, gradle.properties etc) - // For non-nightly, non-dry-run, CircleCI job `prepare_package_for_release` does this + // Here we update the react-native package and template package with the right versions + // For releases, CircleCI job `prepare_package_for_release` handles this if (buildType === 'nightly' || buildType === 'dry-run') { - // Sets the version for package/react-native - if ( - exec( - `node scripts/set-rn-version.js --to-version ${version} --build-type ${buildType}`, - ).code - ) { - echo(`Failed to set version number to ${version}`); + // Publish monorepo nightlies if there are updates, returns nightly versions for each + const monorepoNightlyVersions = + buildType === 'nightly' ? getAndUpdateNightlies(version) : null; + + try { + // Update the react-native and template packages with the react-native version + // and nightly versions of monorepo deps + setReactNativeVersion(version, monorepoNightlyVersions, buildType); + } catch (e) { + console.error(`Failed to set version number to ${version}`); + console.error(e); return exit(1); } } - // set and publish the relevant monorepo packages - if (buildType === 'nightly') { - getAndUpdateNightlies(version); - } - generateAndroidArtifacts(version); // Write version number to the build folder diff --git a/scripts/run-ci-e2e-tests.js b/scripts/run-ci-e2e-tests.js index 050577579e4895..56550cc262b822 100644 --- a/scripts/run-ci-e2e-tests.js +++ b/scripts/run-ci-e2e-tests.js @@ -64,7 +64,7 @@ try { } describe('Create react-native package'); - if (exec('node ./scripts/set-rn-version.js --version 1000.0.0').code) { + if (exec('node ./scripts/set-rn-version.js --to-version 1000.0.0').code) { echo('Failed to set version and update package.json ready for release'); exitCode = 1; throw Error(exitCode); diff --git a/scripts/set-rn-template-version.js b/scripts/set-rn-template-version.js deleted file mode 100755 index de8e00f745537f..00000000000000 --- a/scripts/set-rn-template-version.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - */ - -'use strict'; - -const fs = require('fs'); -const path = require('path'); - -const version = process.argv[2]; - -if (!version) { - console.error('Please provide a react-native version.'); - process.exit(1); -} - -const jsonPath = path.join( - __dirname, - '../packages/react-native/template/package.json', -); - -let templatePackageJson = require(jsonPath); -templatePackageJson.dependencies['react-native'] = version; -fs.writeFileSync( - jsonPath, - JSON.stringify(templatePackageJson, null, 2) + '\n', - 'utf-8', -); diff --git a/scripts/set-rn-version.js b/scripts/set-rn-version.js index a5f99213740ab0..ad8603471b4fe3 100755 --- a/scripts/set-rn-version.js +++ b/scripts/set-rn-version.js @@ -16,6 +16,8 @@ const {cat, echo, exec, exit, sed} = require('shelljs'); const yargs = require('yargs'); const {parseVersion, validateBuildType} = require('./version-utils'); const {saveFiles} = require('./scm-utils'); +const updateTemplatePackage = require('./update-template-package'); +const {applyPackageVersions} = require('./npm-utils'); /** * This script updates relevant React Native files with supplied version: @@ -31,13 +33,31 @@ if (require.main === module) { type: 'string', required: true, }) + .option('d', { + alias: 'dependency-versions', + type: 'string', + describe: + 'JSON string of package versions. Ex. "{"react-native":"0.64.1"}"', + default: null, + }) + .coerce('d', dependencyVersions => { + if (dependencyVersions == null) { + return null; + } + return JSON.parse(dependencyVersions); + }) .option('b', { alias: 'build-type', type: 'string', required: true, }).argv; - setReactNativeVersion(argv.toVersion, argv.buildType); + setReactNativeVersion( + argv.toVersion, + argv.dependencyVersions, + argv.buildType, + ); + exit(0); } function setSource({major, minor, patch, prerelease}) { @@ -108,8 +128,15 @@ function setGradle({version}) { } } -function setPackage({version}) { - const packageJson = JSON.parse(cat('packages/react-native/package.json')); +function setPackage({version}, dependencyVersions) { + const originalPackageJson = JSON.parse( + cat('packages/react-native/package.json'), + ); + const packageJson = + dependencyVersions != null + ? applyPackageVersions(originalPackageJson, dependencyVersions) + : originalPackageJson; + packageJson.version = version; fs.writeFileSync( @@ -119,15 +146,7 @@ function setPackage({version}) { ); } -function setTemplatePackage({version}) { - const result = exec(`node scripts/set-rn-template-version.js ${version}`); - if (result.code) { - echo("Failed to update React Native template's version of React Native"); - throw result.stderr; - } -} - -function setReactNativeVersion(argVersion, buildType) { +function setReactNativeVersion(argVersion, dependencyVersions, buildType) { validateBuildType(buildType); const version = parseVersion(argVersion, buildType); @@ -145,8 +164,14 @@ function setReactNativeVersion(argVersion, buildType) { saveFiles(tmpVersioningFolder); setSource(version); - setPackage(version); - setTemplatePackage(version); + setPackage(version, dependencyVersions); + + const templateDependencyVersions = { + 'react-native': version.version, + ...(dependencyVersions != null ? dependencyVersions : {}), + }; + updateTemplatePackage(templateDependencyVersions); + setGradle(version); // Validate changes @@ -170,7 +195,7 @@ function setReactNativeVersion(argVersion, buildType) { echo(`These files already had version ${version.version} set.`); } - return exit(0); + return; } module.exports = setReactNativeVersion; diff --git a/scripts/test-e2e-local.js b/scripts/test-e2e-local.js index a6a891df5ac62b..d88349290a0d50 100644 --- a/scripts/test-e2e-local.js +++ b/scripts/test-e2e-local.js @@ -17,6 +17,7 @@ */ const {exec, exit, pushd, popd, pwd, cd, cp} = require('shelljs'); +const updateTemplatePackage = require('../scripts/update-template-package'); const yargs = require('yargs'); const fs = require('fs'); @@ -208,7 +209,9 @@ if (argv.target === 'RNTester') { ); const localNodeTGZPath = `${reactNativePackagePath}/react-native-${releaseVersion}.tgz`; - exec(`node scripts/set-rn-template-version.js "file:${localNodeTGZPath}"`); + updateTemplatePackage({ + 'react-native': `file:${localNodeTGZPath}`, + }); // create locally the node module exec('npm pack', {cwd: reactNativePackagePath}); diff --git a/scripts/update-template-package.js b/scripts/update-template-package.js new file mode 100755 index 00000000000000..9443707db562e8 --- /dev/null +++ b/scripts/update-template-package.js @@ -0,0 +1,54 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const {applyPackageVersions} = require('./npm-utils'); + +/** + * Updates the react-native template package.json with + * dependencies in `dependencyMap`. + * + * `dependencyMap` is a dict of package name to its version + * ex. {"react-native": "0.23.0", "other-dep": "nightly"} + */ +function updateTemplatePackage(dependencyMap) { + const jsonPath = path.join( + __dirname, + '../packages/react-native/template/package.json', + ); + const templatePackageJson = require(jsonPath); + + const updatedPackageJson = applyPackageVersions( + templatePackageJson, + dependencyMap, + ); + + fs.writeFileSync( + jsonPath, + JSON.stringify(updatedPackageJson, null, 2) + '\n', + 'utf-8', + ); +} + +if (require.main === module) { + const dependencyMapStr = process.argv[2]; + if (!dependencyMapStr) { + console.error( + 'Please provide a json string of package name and their version. Ex. \'{"packageName":"0.23.0"}\'', + ); + process.exit(1); + } + + updateTemplatePackage(JSON.parse(dependencyMapStr)); +} + +module.exports = updateTemplatePackage; From 15bdaefe7ba9ee0da3abc900ce3be5a66eea4f9a Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 12 Jun 2023 15:22:05 -0700 Subject: [PATCH 116/468] RCTLocalizedString: Dirsync FBXXHashUtils to OSS (#37676) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37676 ## Stack React Native on iOS adds strings to Voiceover interactions to supply more information to users . Internally, and out-of-the-box externally, these are today always announced in English instead of being localized. This stack adds a limited new internal API, `RCTLocalizedString(string, description)` to allow auto-translated strings which are consumed by both Meta and OSS. Reviewed By: javache Differential Revision: D46399962 fbshipit-source-id: 2188a1faba9339cff00f897990b727febc178361 --- .../React/I18n/.clang-format-ignore | 2 + .../react-native/React/I18n/FBXXHashUtils.h | 118 ++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 packages/react-native/React/I18n/.clang-format-ignore create mode 100644 packages/react-native/React/I18n/FBXXHashUtils.h diff --git a/packages/react-native/React/I18n/.clang-format-ignore b/packages/react-native/React/I18n/.clang-format-ignore new file mode 100644 index 00000000000000..63b7f47b0fb0a2 --- /dev/null +++ b/packages/react-native/React/I18n/.clang-format-ignore @@ -0,0 +1,2 @@ +# Synced externally +FBXXHashUtils.h diff --git a/packages/react-native/React/I18n/FBXXHashUtils.h b/packages/react-native/React/I18n/FBXXHashUtils.h new file mode 100644 index 00000000000000..abfa11a8c5f3af --- /dev/null +++ b/packages/react-native/React/I18n/FBXXHashUtils.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2015 Daniel Kirchner + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Based on implementation: https://github.com/ekpyron/xxhashct/blob/master/xxh64.hpp +// To generate string hash at compile time, the original file has been slightly modified by i18n team. + +#import + +NS_ASSUME_NONNULL_BEGIN + +#ifdef __cplusplus +extern "C" { +#endif + +/// magic constants :-) +static const uint64_t PRIME1 = 11400714785074694791ULL; +static const uint64_t PRIME2 = 14029467366897019727ULL; +static const uint64_t PRIME3 = 1609587929392839161ULL; +static const uint64_t PRIME4 = 9650029242287828579ULL; +static const uint64_t PRIME5 = 2870177450012600261ULL; + +NS_INLINE uint64_t rotl(uint64_t x, int r) +{ + return ((x << r) | (x >> (64 - r))); +} + +NS_INLINE uint64_t mix1(const uint64_t h, const uint64_t prime, int rshift) +{ + return (h ^ (h >> rshift)) * prime; +} + +NS_INLINE uint64_t mix2(const uint64_t p, const uint64_t v) +{ + return rotl(v + p * PRIME2, 31) * PRIME1; +} + +NS_INLINE uint64_t mix3(const uint64_t h, const uint64_t v) +{ + return (h ^ mix2(v, 0)) * PRIME1 + PRIME4; +} + +NS_INLINE uint32_t endian32(const char *v) +{ + return (uint32_t)((uint8_t)(v[0])) | ((uint32_t)((uint8_t)(v[1])) << 8) + | ((uint32_t)((uint8_t)(v[2])) << 16) | ((uint32_t)((uint8_t)(v[3])) << 24); +} + +NS_INLINE uint64_t endian64(const char *v) +{ + return (uint64_t)((uint8_t)(v[0])) | ((uint64_t)((uint8_t)(v[1])) << 8) + | ((uint64_t)((uint8_t)(v[2])) << 16) | ((uint64_t)((uint8_t)(v[3])) << 24) + | ((uint64_t)((uint8_t)(v[4])) << 32) | ((uint64_t)((uint8_t)(v[5])) << 40) + | ((uint64_t)((uint8_t)(v[6])) << 48) | ((uint64_t)((uint8_t)(v[7])) << 56); +} + +NS_INLINE uint64_t fetch64(const char *p, const uint64_t v) +{ + return mix2(endian64(p), v); +} + +NS_INLINE uint64_t fetch32(const char *p) +{ + return (uint64_t)(endian32(p)) * PRIME1; +} + +NS_INLINE uint64_t fetch8(const char *p) +{ + return (uint8_t)(*p) * PRIME5; +} + +NS_INLINE uint64_t finalize(const uint64_t h, const char *p, uint64_t len) +{ + return (len >= 8) ? (finalize(rotl(h ^ fetch64(p, 0), 27) * PRIME1 + PRIME4, p + 8, len - 8)) + : ((len >= 4) ? (finalize(rotl(h ^ fetch32(p), 23) * PRIME2 + PRIME3, p + 4, len - 4)) + : ((len > 0) ? (finalize(rotl(h ^ fetch8(p), 11) * PRIME1, p + 1, len - 1)) + : (mix1(mix1(mix1(h, PRIME2, 33), PRIME3, 29), 1, 32)))); +} + +NS_INLINE uint64_t h32bytes_compute(const char *p, uint64_t len, const uint64_t v1, const uint64_t v2, const uint64_t v3, const uint64_t v4) +{ + return (len >= 32) ? h32bytes_compute(p + 32, len - 32, fetch64(p, v1), fetch64(p + 8, v2), fetch64(p + 16, v3), fetch64(p + 24, v4)) + : mix3(mix3(mix3(mix3(rotl(v1, 1) + rotl(v2, 7) + rotl(v3, 12) + rotl(v4, 18), v1), v2), v3), v4); +} + +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); +} + +NS_INLINE uint64_t FBxxHash64(const char *p, uint64_t len, uint64_t seed) +{ + return finalize((len >= 32 ? h32bytes(p, len, seed) : seed + PRIME5) + len, p + (len & ~0x1F), len & 0x1F); +} + +#ifdef __cplusplus +} +#endif + +NS_ASSUME_NONNULL_END From 9b47148dd8f819b3548bea8034efee276baf5c89 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 12 Jun 2023 15:22:05 -0700 Subject: [PATCH 117/468] RCTLocalizedString: Add RCTLocalizedString (#37677) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37677 ## Stack React Native on iOS adds strings to Voiceover interactions to supply more information to users . Internally, and out-of-the-box externally, these are today always announced in English instead of being localized. This stack adds a limited new internal API, `RCTLocalizedString(string, description)` to allow auto-translated strings which are consumed by both Meta and OSS. Reviewed By: shwanton Differential Revision: D46414631 fbshipit-source-id: 567a3500d39c1cb830e050edb1a644e3d8d502d3 --- .../React/I18n/RCTLocalizedString.h | 26 ++++++++++++ .../React/I18n/RCTLocalizedString.mm | 42 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 packages/react-native/React/I18n/RCTLocalizedString.h create mode 100644 packages/react-native/React/I18n/RCTLocalizedString.mm diff --git a/packages/react-native/React/I18n/RCTLocalizedString.h b/packages/react-native/React/I18n/RCTLocalizedString.h new file mode 100644 index 00000000000000..a190fccdab271d --- /dev/null +++ b/packages/react-native/React/I18n/RCTLocalizedString.h @@ -0,0 +1,26 @@ +/* + * 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. + */ + +#if WITH_FBI18N + +#import +#define RCTLocalizedString(string, description) FBT(string, description) + +#else + +#import + +uint64_t FBcoreLocalexxHash48(const char *input, uint64_t length, uint64_t seed); +NSString *RCTLocalizedStringFromKey(uint64_t key, NSString *defaultValue); + +#define RCTLocalizedStringKey(string, description) \ + FBcoreLocalexxHash48(string "|" description, strlen(string) + strlen(description) + 1, 0) + +#define RCTLocalizedString(string, description) \ + RCTLocalizedStringFromKey(RCTLocalizedStringKey(string, description), @"" string) + +#endif diff --git a/packages/react-native/React/I18n/RCTLocalizedString.mm b/packages/react-native/React/I18n/RCTLocalizedString.mm new file mode 100644 index 00000000000000..ae2e05dd276c4d --- /dev/null +++ b/packages/react-native/React/I18n/RCTLocalizedString.mm @@ -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. + */ + +#import "RCTLocalizedString.h" + +#if !defined(WITH_FBI18N) || !(WITH_FBI18N) + +static NSString *FBTStringByConvertingIntegerToBase64(uint64_t number) +{ + const NSUInteger base = 64; + const char *symbols = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"; + char converted[9]; // output will take at most 8 symbols + char *p = converted + sizeof(converted) - 1; + *p = 0; + do { + *--p = symbols[number % base]; + number = number / base; + } while (number > 0); + return [[NSString alloc] initWithCString:p encoding:NSASCIIStringEncoding]; +} + +__attribute__((noinline)) uint64_t FBcoreLocalexxHash48(const char *input, uint64_t length, uint64_t seed) +{ + const uint64_t k48BitsMask = 0xffffffffffffL; + return FBxxHash64(input, length, seed) & k48BitsMask; +} + +NSString *RCTLocalizedStringFromKey(uint64_t key, NSString *defaultValue) +{ + static NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"RCTI18nStrings" + ofType:@"bundle"]]; + if (bundle == nil) { + return defaultValue; + } else { + return [bundle localizedStringForKey:FBTStringByConvertingIntegerToBase64(key) value:defaultValue table:nil]; + } +} +#endif From f83ca12c4049180969e1a755f70e29deae5d8a42 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 12 Jun 2023 15:22:05 -0700 Subject: [PATCH 118/468] RCTLocalizedString: Extract FBTs to bundle for CocoaPods (#37678) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37678 ## Stack React Native on iOS adds strings to Voiceover interactions to supply more information to users . Internally, and out-of-the-box externally, these are today always announced in English instead of being localized. This stack adds a limited new internal API, `RCTLocalizedString(string, description)` to allow auto-translated strings which are consumed by both Meta and OSS. Reviewed By: cipolleschi Differential Revision: D46414630 fbshipit-source-id: 1137182dbbd89d959b3d143ce534229968bdb8f7 --- packages/react-native/React-Core.podspec | 2 +- .../en.lproj/Localizable.strings | 26 ------------------- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 packages/react-native/React/AccessibilityResources/en.lproj/Localizable.strings diff --git a/packages/react-native/React-Core.podspec b/packages/react-native/React-Core.podspec index 720e115e0b76b0..fe840820e65520 100644 --- a/packages/react-native/React-Core.podspec +++ b/packages/react-native/React-Core.podspec @@ -69,7 +69,7 @@ Pod::Spec.new do |s| s.author = "Meta Platforms, Inc. and its affiliates" s.platforms = { :ios => min_ios_version_supported } s.source = source - s.resource_bundle = { "AccessibilityResources" => ["React/AccessibilityResources/*.lproj"]} + s.resource_bundle = { "RCTI18nStrings" => ["React/I18n/strings/*.lproj"]} s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags s.header_dir = "React" s.framework = "JavaScriptCore" diff --git a/packages/react-native/React/AccessibilityResources/en.lproj/Localizable.strings b/packages/react-native/React/AccessibilityResources/en.lproj/Localizable.strings deleted file mode 100644 index ee35fc3e5fe25d..00000000000000 --- a/packages/react-native/React/AccessibilityResources/en.lproj/Localizable.strings +++ /dev/null @@ -1,26 +0,0 @@ -/* - Localizable.strings - React -*/ -"alert"="alert"; -"checkbox"="checkbox"; -"combobox"="combo box"; -"menu"="menu"; -"menubar"="menu bar"; -"menuitem"="menu item"; -"progressbar"="progress bar"; -"radio"="radio button"; -"radiogroup"="radio group"; -"scrollbar"="scroll bar"; -"spinbutton"="spin button"; -"switch"="switch"; -"tab"="tab"; -"tablist"="tab list"; -"timer"="timer"; -"toolbar"="tool bar"; -"checked"="checked"; -"unchecked"="not checked"; -"busy"="busy"; -"expanded"="expanded"; -"collapsed"="collapsed"; -"mixed"="mixed"; From 0e99b192577d1ac5c73fdc55902fea1d79d247b7 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 12 Jun 2023 15:22:05 -0700 Subject: [PATCH 119/468] RCTLocalizedString: Replace usages of AccessibilityResources (#37680) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37680 Changelog: [iOS][Fixed] - Localize Voiceover strings in Paper ## Stack React Native on iOS adds strings to Voiceover interactions to supply more information to users . Internally, and out-of-the-box externally, these are today always announced in English instead of being localized. This stack adds a limited new internal API, `RCTLocalizedString(string, description)` to allow auto-translated strings which are consumed by both Meta and OSS. Reviewed By: cipolleschi Differential Revision: D46415273 fbshipit-source-id: 4174e38cef4eee251fa2d59e10763cde8e8681ad --- packages/react-native/React/Views/RCTView.m | 74 +++++++++++---------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/packages/react-native/React/Views/RCTView.m b/packages/react-native/React/Views/RCTView.m index 66c6c5978f8a40..5464e06124d7e6 100644 --- a/packages/react-native/React/Views/RCTView.m +++ b/packages/react-native/React/Views/RCTView.m @@ -14,6 +14,7 @@ #import "RCTBorderCurve.h" #import "RCTBorderDrawing.h" #import "RCTI18nUtil.h" +#import "RCTLocalizedString.h" #import "RCTLog.h" #import "RCTViewUtils.h" #import "UIView+React.h" @@ -282,41 +283,44 @@ - (NSString *)accessibilityValue static NSDictionary *rolesAndStatesDescription = nil; dispatch_once(&onceToken, ^{ - NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"AccessibilityResources" ofType:@"bundle"]; - NSBundle *bundle = [NSBundle bundleWithPath:bundlePath]; - - if (bundle) { - NSURL *url = [bundle URLForResource:@"Localizable" withExtension:@"strings"]; - rolesAndStatesDescription = [NSDictionary dictionaryWithContentsOfURL:url error:nil]; - } - if (rolesAndStatesDescription == nil) { - // Falling back to hardcoded English list. - NSLog(@"Cannot load localized accessibility strings."); - rolesAndStatesDescription = @{ - @"alert" : @"alert", - @"checkbox" : @"checkbox", - @"combobox" : @"combo box", - @"menu" : @"menu", - @"menubar" : @"menu bar", - @"menuitem" : @"menu item", - @"progressbar" : @"progress bar", - @"radio" : @"radio button", - @"radiogroup" : @"radio group", - @"scrollbar" : @"scroll bar", - @"spinbutton" : @"spin button", - @"switch" : @"switch", - @"tab" : @"tab", - @"tablist" : @"tab list", - @"timer" : @"timer", - @"toolbar" : @"tool bar", - @"checked" : @"checked", - @"unchecked" : @"unchecked", - @"busy" : @"busy", - @"expanded" : @"expanded", - @"collapsed" : @"collapsed", - @"mixed" : @"mixed", - }; - } + rolesAndStatesDescription = @{ + @"alert" : RCTLocalizedString("alert", "important, and usually time-sensitive, information"), + @"busy" : RCTLocalizedString("busy", "an element currently being updated or modified"), + @"checkbox" : RCTLocalizedString("checkbox", "checkable interactive control"), + @"combobox" : RCTLocalizedString( + "combo box", + "input that controls another element that can pop up to help the user set the value of that input"), + @"menu" : RCTLocalizedString("menu", "offers a list of choices to the user"), + @"menubar" : RCTLocalizedString( + "menu bar", "presentation of menu that usually remains visible and is usually presented horizontally"), + @"menuitem" : RCTLocalizedString("menu item", "an option in a set of choices contained by a menu or menubar"), + @"progressbar" : + RCTLocalizedString("progress bar", "displays the progress status for tasks that take a long time"), + @"radio" : RCTLocalizedString( + "radio button", + "a checkable input that when associated with other radio buttons, only one of which can be checked at a time"), + @"radiogroup" : RCTLocalizedString("radio group", "a group of radio buttons"), + @"scrollbar" : RCTLocalizedString("scroll bar", "controls the scrolling of content within a viewing area"), + @"spinbutton" : RCTLocalizedString( + "spin button", "defines a type of range that expects the user to select a value from among discrete choices"), + @"switch" : RCTLocalizedString("switch", "represents the states 'on' and 'off'"), + @"tab" : RCTLocalizedString("tab", "an interactive element inside a tablist"), + @"tablist" : RCTLocalizedString("tab list", "container for a set of tabs"), + @"timer" : RCTLocalizedString( + "timer", + "a numerical counter listing the amount of elapsed time from a starting point or the remaining time until an end point"), + @"toolbar" : RCTLocalizedString( + "tool bar", + "a collection of commonly used function buttons or controls represented in a compact visual form"), + @"checked" : RCTLocalizedString("checked", "a checkbox, radio button, or other widget which is checked"), + @"unchecked" : RCTLocalizedString("unchecked", "a checkbox, radio button, or other widget which is unchecked"), + @"expanded" : + RCTLocalizedString("expanded", "a menu, dialog, accordian panel, or other widget which is expanded"), + @"collapsed" : + RCTLocalizedString("collapsed", "a menu, dialog, accordian panel, or other widget which is collapsed"), + @"mixed" : + RCTLocalizedString("mixed", "a checkbox, radio button, or other widget which is both checked and unchecked"), + }; }); // Handle Switch. From 1f45459414d683a4baa740f9bbd051073472dab2 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 12 Jun 2023 15:22:05 -0700 Subject: [PATCH 120/468] Localize Voiceover strings in Fabric (#37679) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37679 This reuses the localizations from the last diff on the stack, on top of the new logic added with D45797554. Changelog: [iOS][Fixed] - Localize Voiceover strings in Fabric Reviewed By: philIip Differential Revision: D46426571 fbshipit-source-id: 7e6adc9eff5e6387299e95b6ea5eba8e2607386a --- .../View/RCTViewComponentView.mm | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index 97feafc4c10fe1..33da37d1f0a65a 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -14,6 +14,7 @@ #import #import #import +#import #import #import #import @@ -731,28 +732,38 @@ - (NSString *)accessibilityValue // these to screenreader users. (They should already be familiar with them // from using web). if ([roleString isEqualToString:@"checkbox"]) { - [valueComponents addObject:@"checkbox"]; + [valueComponents addObject:RCTLocalizedString("checkbox", "checkable interactive control")]; } if ([roleString isEqualToString:@"radio"]) { - [valueComponents addObject:@"radio button"]; + [valueComponents + addObject: + RCTLocalizedString( + "radio button", + "a checkable input that when associated with other radio buttons, only one of which can be checked at a time")]; } // Handle states which haven't already been handled. if (props.accessibilityState.checked == AccessibilityState::Checked) { - [valueComponents addObject:@"checked"]; + [valueComponents + addObject:RCTLocalizedString("checked", "a checkbox, radio button, or other widget which is checked")]; } if (props.accessibilityState.checked == AccessibilityState::Unchecked) { - [valueComponents addObject:@"unchecked"]; + [valueComponents + addObject:RCTLocalizedString("unchecked", "a checkbox, radio button, or other widget which is unchecked")]; } if (props.accessibilityState.checked == AccessibilityState::Mixed) { - [valueComponents addObject:@"mixed"]; + [valueComponents + addObject:RCTLocalizedString( + "mixed", "a checkbox, radio button, or other widget which is both checked and unchecked")]; } if (props.accessibilityState.expanded) { - [valueComponents addObject:@"expanded"]; + [valueComponents + addObject:RCTLocalizedString("expanded", "a menu, dialog, accordian panel, or other widget which is expanded")]; } + if (props.accessibilityState.busy) { - [valueComponents addObject:@"busy"]; + [valueComponents addObject:RCTLocalizedString("busy", "an element currently being updated or modified")]; } if (valueComponents.count > 0) { From 83d7a48a46c00b99c52a8ac5897c013924e10152 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Mon, 12 Jun 2023 15:28:56 -0700 Subject: [PATCH 121/468] Resubmit D46501420 (#37790) Summary: Multiline text in Android shows some extra space. It's easily noticeable when you set the text `alignSelf` to `flex-start`. This is because we are using `layout.getLineWidth` which will include trailing whitespace. image Based on Android doc, `getLineMax` exclude trailing whitespace. image ## Changelog: [ANDROID] [FIXED] - Exclude trailing whitespace from newline character on measuring text line width Pull Request resolved: https://github.com/facebook/react-native/pull/37790 Test Plan: After applying the changes: image Code snippet: ``` 1{'\n'} ``` Reviewed By: cortinico Differential Revision: D46586516 Pulled By: NickGerleman fbshipit-source-id: 3ea9c150ad92082f9b4d1da453ba0ef04b09ce51 --- .../com/facebook/react/views/text/FontMetricsUtil.java | 4 +++- .../facebook/react/views/text/ReactTextShadowNode.java | 5 ++++- .../com/facebook/react/views/text/ReactTextView.java | 5 ++++- .../facebook/react/views/text/TextLayoutManager.java | 10 ++++++++-- .../react/views/text/TextLayoutManagerMapBuffer.java | 10 ++++++++-- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java index f19a1b0425888d..84dc328edab3af 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/FontMetricsUtil.java @@ -42,12 +42,14 @@ public static WritableArray getFontMetrics( X_HEIGHT_MEASUREMENT_TEXT, 0, X_HEIGHT_MEASUREMENT_TEXT.length(), xHeightBounds); double xHeight = xHeightBounds.height() / AMPLIFICATION_FACTOR / dm.density; for (int i = 0; i < layout.getLineCount(); i++) { + boolean endsWithNewLine = text.length() > 0 && text.charAt(layout.getLineEnd(i) - 1) == '\n'; + float lineWidth = endsWithNewLine ? layout.getLineMax(i) : layout.getLineWidth(i); Rect bounds = new Rect(); layout.getLineBounds(i, bounds); WritableMap line = Arguments.createMap(); line.putDouble("x", layout.getLineLeft(i) / dm.density); line.putDouble("y", bounds.top / dm.density); - line.putDouble("width", layout.getLineWidth(i) / dm.density); + line.putDouble("width", lineWidth / dm.density); line.putDouble("height", bounds.height() / dm.density); line.putDouble("descender", layout.getLineDescent(i) / dm.density); line.putDouble("ascender", -layout.getLineAscent(i) / dm.density); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java index 2e237f01970fb5..b69452d9384fcf 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java @@ -135,7 +135,10 @@ public long measure( layoutWidth = width; } else { for (int lineIndex = 0; lineIndex < lineCount; lineIndex++) { - float lineWidth = layout.getLineWidth(lineIndex); + boolean endsWithNewLine = + text.length() > 0 && text.charAt(layout.getLineEnd(lineIndex) - 1) == '\n'; + float lineWidth = + endsWithNewLine ? layout.getLineMax(lineIndex) : layout.getLineWidth(lineIndex); if (lineWidth > layoutWidth) { layoutWidth = lineWidth; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java index 43ffc0d31dc2a7..4af57295d9aac6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java @@ -267,11 +267,14 @@ protected void onLayout( // the last offset in the layout will result in an endless loop. Work around // this bug by avoiding getPrimaryHorizontal in that case. if (start == text.length() - 1) { + boolean endsWithNewLine = + text.length() > 0 && text.charAt(layout.getLineEnd(line) - 1) == '\n'; + float lineWidth = endsWithNewLine ? layout.getLineMax(line) : layout.getLineWidth(line); placeholderHorizontalPosition = isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? textViewWidth - (int) layout.getLineWidth(line) + ? textViewWidth - (int) lineWidth : (int) layout.getLineRight(line) - width; } else { // The direction of the paragraph may not be exactly the direction the string is heading diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index 25bfe983255cc7..ffd5b2f1a5c4c2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -407,7 +407,10 @@ public static long measureText( calculatedWidth = width; } else { for (int lineIndex = 0; lineIndex < calculatedLineCount; lineIndex++) { - float lineWidth = layout.getLineWidth(lineIndex); + boolean endsWithNewLine = + text.length() > 0 && text.charAt(layout.getLineEnd(lineIndex) - 1) == '\n'; + float lineWidth = + endsWithNewLine ? layout.getLineMax(lineIndex) : layout.getLineWidth(lineIndex); if (lineWidth > calculatedWidth) { calculatedWidth = lineWidth; } @@ -462,11 +465,14 @@ public static long measureText( // the last offset in the layout will result in an endless loop. Work around // this bug by avoiding getPrimaryHorizontal in that case. if (start == text.length() - 1) { + boolean endsWithNewLine = + text.length() > 0 && text.charAt(layout.getLineEnd(line) - 1) == '\n'; + float lineWidth = endsWithNewLine ? layout.getLineMax(line) : layout.getLineWidth(line); placeholderLeftPosition = isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? calculatedWidth - layout.getLineWidth(line) + ? calculatedWidth - lineWidth : layout.getLineRight(line) - placeholderWidth; } else { // The direction of the paragraph may not be exactly the direction the string is heading diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java index 71703755597285..8cd576494a1c24 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java @@ -429,7 +429,10 @@ public static long measureText( calculatedWidth = width; } else { for (int lineIndex = 0; lineIndex < calculatedLineCount; lineIndex++) { - float lineWidth = layout.getLineWidth(lineIndex); + boolean endsWithNewLine = + text.length() > 0 && text.charAt(layout.getLineEnd(lineIndex) - 1) == '\n'; + float lineWidth = + endsWithNewLine ? layout.getLineMax(lineIndex) : layout.getLineWidth(lineIndex); if (lineWidth > calculatedWidth) { calculatedWidth = lineWidth; } @@ -484,12 +487,15 @@ public static long measureText( // the last offset in the layout will result in an endless loop. Work around // this bug by avoiding getPrimaryHorizontal in that case. if (start == text.length() - 1) { + boolean endsWithNewLine = + text.length() > 0 && text.charAt(layout.getLineEnd(line) - 1) == '\n'; + float lineWidth = endsWithNewLine ? layout.getLineMax(line) : layout.getLineWidth(line); placeholderLeftPosition = isRtlParagraph // Equivalent to `layout.getLineLeft(line)` but `getLineLeft` returns // incorrect // values when the paragraph is RTL and `setSingleLine(true)`. - ? calculatedWidth - layout.getLineWidth(line) + ? calculatedWidth - lineWidth : layout.getLineRight(line) - placeholderWidth; } else { // The direction of the paragraph may not be exactly the direction the string is From 1ae1cc01ab29f65dddc0f1c636db66738df356c5 Mon Sep 17 00:00:00 2001 From: Vincent Riemer Date: Mon, 12 Jun 2023 19:27:14 -0700 Subject: [PATCH 122/468] Add plumbing/boilerplate for an iOS implementation of the `gotpointercapture` and `lostpointercapture` events (#37602) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37602 Changelog: [Internal] - Add plumbing/boilerplate for an iOS implementation of the `gotpointercapture` and `lostpointercapture` events This diff simply adds the boilerplate necessary to hook up the `gotpointercapture` and `lostpointercapture` events to the fabric iOS touch handler. This diff does not contain any actual implementation of their behavior as that will occur in future diffs. Reviewed By: yungsters Differential Revision: D44977499 fbshipit-source-id: c9da5691d399f612f1980c7692c4ca62877901a9 --- .../Components/View/ViewPropTypes.js | 2 ++ .../NativeComponent/BaseViewConfig.ios.js | 14 +++++++++++ packages/react-native/React/Views/RCTView.h | 2 ++ .../react-native/React/Views/RCTViewManager.m | 2 ++ .../components/view/TouchEventEmitter.cpp | 16 +++++++++++++ .../components/view/TouchEventEmitter.h | 2 ++ .../renderer/components/view/primitives.h | 4 ++++ .../components/view/propsConversions.h | 24 +++++++++++++++++++ 8 files changed, 66 insertions(+) diff --git a/packages/react-native/Libraries/Components/View/ViewPropTypes.js b/packages/react-native/Libraries/Components/View/ViewPropTypes.js index 1a37bd3206b286..06672257cc73e6 100644 --- a/packages/react-native/Libraries/Components/View/ViewPropTypes.js +++ b/packages/react-native/Libraries/Components/View/ViewPropTypes.js @@ -105,6 +105,8 @@ type PointerEventProps = $ReadOnly<{| onPointerOverCapture?: ?(e: PointerEvent) => void, onPointerOut?: ?(e: PointerEvent) => void, onPointerOutCapture?: ?(e: PointerEvent) => void, + onGotPointerCapture?: ?(e: PointerEvent) => void, + onLostPointerCapture?: ?(e: PointerEvent) => void, |}>; type FocusEventProps = $ReadOnly<{| diff --git a/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js b/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js index bb13443bf44a2d..92b2959aad14d6 100644 --- a/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js +++ b/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js @@ -144,6 +144,18 @@ const bubblingEventTypes = { bubbled: 'onPointerOut', }, }, + topGotPointerCapture: { + phasedRegistrationNames: { + captured: 'onGotPointerCaptureCapture', + bubbled: 'onGotPointerCapture', + }, + }, + topLostPointerCapture: { + phasedRegistrationNames: { + captured: 'onLostPointerCaptureCapture', + bubbled: 'onLostPointerCapture', + }, + }, }; const directEventTypes = { @@ -366,6 +378,8 @@ const validAttributesForEventProps = ConditionallyIgnoredEventHandlers({ onPointerLeave: true, onPointerOver: true, onPointerOut: true, + onGotPointerCapture: true, + onLostPointerCapture: true, }); /** diff --git a/packages/react-native/React/Views/RCTView.h b/packages/react-native/React/Views/RCTView.h index fc5e2217cf5266..200d8b451bf59e 100644 --- a/packages/react-native/React/Views/RCTView.h +++ b/packages/react-native/React/Views/RCTView.h @@ -132,5 +132,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait; @property (nonatomic, assign) RCTCapturingEventBlock onPointerLeave; @property (nonatomic, assign) RCTBubblingEventBlock onPointerOver; @property (nonatomic, assign) RCTBubblingEventBlock onPointerOut; +@property (nonatomic, assign) RCTBubblingEventBlock onGotPointerCapture; +@property (nonatomic, assign) RCTBubblingEventBlock onLostPointerCapture; @end diff --git a/packages/react-native/React/Views/RCTViewManager.m b/packages/react-native/React/Views/RCTViewManager.m index 9a0af4e74cecb9..eb3ff9c00d882e 100644 --- a/packages/react-native/React/Views/RCTViewManager.m +++ b/packages/react-native/React/Views/RCTViewManager.m @@ -549,5 +549,7 @@ - (void)updateAccessibilityTraitsForRole:(RCTView *)view withDefaultView:(RCTVie RCT_EXPORT_VIEW_PROPERTY(onPointerLeave, RCTCapturingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onPointerOver, RCTBubblingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onPointerOut, RCTBubblingEventBlock) +RCT_EXPORT_VIEW_PROPERTY(onGotPointerCapture, RCTBubblingEventBlock) +RCT_EXPORT_VIEW_PROPERTY(onLostPointerCapture, RCTBubblingEventBlock) @end diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp index 747dedcf7dd3ae..d0c4fc399c2cd5 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp @@ -223,4 +223,20 @@ void TouchEventEmitter::onPointerOut(const PointerEvent &event) const { RawEvent::Category::ContinuousStart); } +void TouchEventEmitter::onGotPointerCapture(const PointerEvent &event) const { + dispatchPointerEvent( + "gotPointerCapture", + event, + EventPriority::AsynchronousBatched, + RawEvent::Category::ContinuousStart); +} + +void TouchEventEmitter::onLostPointerCapture(const PointerEvent &event) const { + dispatchPointerEvent( + "lostPointerCapture", + event, + EventPriority::AsynchronousBatched, + RawEvent::Category::ContinuousEnd); +} + } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h index ad42dfa7674eac..ef2e11b95481a7 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h @@ -38,6 +38,8 @@ class TouchEventEmitter : public EventEmitter { void onPointerLeave(PointerEvent const &event) const; void onPointerOver(PointerEvent const &event) const; void onPointerOut(PointerEvent const &event) const; + void onGotPointerCapture(PointerEvent const &event) const; + void onLostPointerCapture(PointerEvent const &event) const; private: void dispatchTouchEvent( diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h b/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h index 04daf6e3367070..70ebe7f2d920e4 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h @@ -60,6 +60,10 @@ struct ViewEvents { PointerOutCapture = 29, Click = 30, ClickCapture = 31, + GotPointerCapture = 32, + GotPointerCaptureCapture = 33, + LostPointerCapture = 34, + LostPointerCaptureCapture = 35, }; constexpr bool operator[](const Offset offset) const { diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h b/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h index 704a00f404c6c9..0139cd25202205 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h @@ -616,6 +616,30 @@ static inline ViewEvents convertRawProp( "onClickCapture", sourceValue[Offset::ClickCapture], defaultValue[Offset::ClickCapture]); + result[Offset::GotPointerCapture] = convertRawProp( + context, + rawProps, + "onGotPointerCapture", + sourceValue[Offset::GotPointerCapture], + defaultValue[Offset::GotPointerCapture]); + result[Offset::GotPointerCaptureCapture] = convertRawProp( + context, + rawProps, + "onGotPointerCaptureCapture", + sourceValue[Offset::GotPointerCaptureCapture], + defaultValue[Offset::GotPointerCaptureCapture]); + result[Offset::LostPointerCapture] = convertRawProp( + context, + rawProps, + "onLostPointerCapture", + sourceValue[Offset::LostPointerCapture], + defaultValue[Offset::LostPointerCapture]); + result[Offset::LostPointerCaptureCapture] = convertRawProp( + context, + rawProps, + "onLostPointerCaptureCapture", + sourceValue[Offset::LostPointerCaptureCapture], + defaultValue[Offset::LostPointerCaptureCapture]); // PanResponder callbacks result[Offset::MoveShouldSetResponder] = convertRawProp( From 001e182f088ed5032728cf36022d0ad3ba1d8098 Mon Sep 17 00:00:00 2001 From: Vincent Riemer Date: Mon, 12 Jun 2023 19:27:14 -0700 Subject: [PATCH 123/468] Add PointerEventCaptureMouse WPT test (#37603) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37603 Changelog: [Internal] - Add PointerEventCaptureMouse WPT test This diff introduces a port of the wpt test "pointerevent_capture_mouse" (https://github.com/web-platform-tests/wpt/blob/master/pointerevents/pointerevent_capture_mouse.html) in preparation of validating our pointer capture implementation. Reviewed By: adanoff Differential Revision: D46230497 fbshipit-source-id: ebdfaad23935b96d35da98e30bd326ae1b50759a --- .../PointerEventCaptureMouse.js | 213 ++++++++++++++++++ .../Experimental/W3CPointerEventsExample.js | 8 + 2 files changed, 221 insertions(+) create mode 100644 packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js diff --git a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js new file mode 100644 index 00000000000000..680cbb259e8202 --- /dev/null +++ b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js @@ -0,0 +1,213 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @flow + */ + +import type {PlatformTestComponentBaseProps} from '../PlatformTest/RNTesterPlatformTestTypes'; +import type {PointerEvent} from 'react-native/Libraries/Types/CoreEventTypes'; + +import * as React from 'react'; +import {useCallback, useRef} from 'react'; +import {StyleSheet, View, Text} from 'react-native'; +import RNTesterPlatformTest from '../PlatformTest/RNTesterPlatformTest'; +import type {ElementRef} from 'react'; + +// adapted from https://github.com/web-platform-tests/wpt/blob/master/pointerevents/pointerevent_capture_mouse.html +function PointerEventCaptureMouseTestCase( + props: PlatformTestComponentBaseProps, +) { + const {harness} = props; + + const target0Ref = useRef | null>(null); + const target1Ref = useRef | null>(null); + + const isPointerCaptureRef = useRef(false); + const pointermoveNoCaptureGot0Ref = useRef(false); + const pointermoveCaptureGot0Ref = useRef(false); + const pointermoveNoCaptureGot1Ref = useRef(false); + const ownEventForTheCapturedTargetGotRef = useRef(false); + + const testGotPointerCapture = harness.useAsyncTest( + 'gotpointercapture event received"', + ); + const testLostPointerCapture = harness.useAsyncTest( + 'lostpointercapture event received"', + ); + + const handleCaptureButtonDown = useCallback((evt: PointerEvent) => { + const target0 = target0Ref.current; + if (target0 != null && isPointerCaptureRef.current === false) { + isPointerCaptureRef.current = true; + try { + // $FlowFixMe[prop-missing] + target0.setPointerCapture(evt.nativeEvent.pointerId); + } catch (e) {} + } + }, []); + + const handleTarget0GotPointerCapture = useCallback( + (evt: PointerEvent) => { + testGotPointerCapture.done(); + }, + [testGotPointerCapture], + ); + + const handleTarget0LostPointerCapture = useCallback( + (evt: PointerEvent) => { + testLostPointerCapture.done(); + isPointerCaptureRef.current = false; + }, + [testLostPointerCapture], + ); + + const testPointerMove0 = harness.useAsyncTest( + 'pointerover event for black rectangle received', + ); + const testPointerMove1 = harness.useAsyncTest( + 'pointerover event for purple rectangle received', + ); + + const handleTarget0PointerMove = useCallback( + (evt: PointerEvent) => { + const target0 = target0Ref.current; + if (!pointermoveNoCaptureGot0Ref.current) { + testPointerMove0.done(); + pointermoveNoCaptureGot0Ref.current = true; + } + if (isPointerCaptureRef.current && target0 != null) { + const {clientX, clientY} = evt.nativeEvent; + const {left, right, top, bottom} = + // $FlowFixMe[prop-missing] + target0.getBoundingClientRect(); + + if (!pointermoveCaptureGot0Ref.current) { + harness.test( + ({assert_equals}) => { + assert_equals( + evt.nativeEvent.relatedTarget, + null, + 'relatedTarget is null when the capture is set', + ); + }, + 'relatedTarget is null when the capture is set.', + {skip: true}, + ); + harness.test(({assert_true}) => { + assert_true( + clientX < left || + clientX > right || + clientY < top || + clientY > bottom, + 'pointermove received for captured element while out of it', + ); + }, 'pointermove received for captured element while out of it'); + pointermoveCaptureGot0Ref.current = true; + } + if ( + clientX > left && + clientX < right && + clientY > top && + clientY < bottom && + !ownEventForTheCapturedTargetGotRef.current + ) { + harness.test(({assert_true}) => { + assert_true( + true, + 'pointermove received for captured element while inside of it', + ); + }, 'pointermove received for captured element while inside of it'); + ownEventForTheCapturedTargetGotRef.current = true; + } + } + }, + [harness, testPointerMove0], + ); + + const handleTarget1PointerMove = useCallback( + (evt: PointerEvent) => { + harness.test(({assert_equals}) => { + assert_equals( + isPointerCaptureRef.current, + false, + "pointermove shouldn't trigger for this target when capture is enabled", + ); + }, "pointermove shouldn't trigger for the purple rectangle while the black rectangle has capture"); + + if (!pointermoveNoCaptureGot1Ref.current) { + testPointerMove1.done(); + pointermoveNoCaptureGot1Ref.current = true; + } + }, + [harness, testPointerMove1], + ); + + return ( + + + + + Set Capture + + + ); +} + +const styles = StyleSheet.create({ + captureButton: { + alignSelf: 'flex-start', + backgroundColor: 'lightblue', + paddingHorizontal: 32, + paddingVertical: 16, + borderRadius: 8, + }, + container: {}, + target0: { + backgroundColor: 'black', + padding: 32, + marginBottom: 16, + }, + target1: { + backgroundColor: 'purple', + padding: 32, + marginBottom: 16, + }, +}); + +type Props = $ReadOnly<{}>; +export default function PointerEventCaptureMouse( + props: Props, +): React.MixedElement { + return ( + + ); +} diff --git a/packages/rn-tester/js/examples/Experimental/W3CPointerEventsExample.js b/packages/rn-tester/js/examples/Experimental/W3CPointerEventsExample.js index c21e32a029ebe4..8891b4b29bc5d1 100644 --- a/packages/rn-tester/js/examples/Experimental/W3CPointerEventsExample.js +++ b/packages/rn-tester/js/examples/Experimental/W3CPointerEventsExample.js @@ -26,6 +26,7 @@ import PointerEventLayoutChangeShouldFirePointerOver from './W3CPointerEventPlat import PointerEventPointerCancelTouch from './W3CPointerEventPlatformTests/PointerEventPointerCancelTouch'; import PointerEventClickTouch from './W3CPointerEventPlatformTests/PointerEventClickTouch'; import PointerEventClickTouchHierarchy from './W3CPointerEventPlatformTests/PointerEventClickTouchHierarchy'; +import PointerEventCaptureMouse from './W3CPointerEventPlatformTests/PointerEventCaptureMouse'; import EventfulView from './W3CPointerEventsEventfulView'; import ManyPointersPropertiesExample from './Compatibility/ManyPointersPropertiesExample'; import PointerEventClickTouchHierarchyPointerEvents from './W3CPointerEventPlatformTests/PointerEventClickTouchHierarchyPointerEvents'; @@ -240,6 +241,13 @@ export default { return ; }, }, + { + name: 'pointerevent_caapture_mouse', + title: 'WPT 12: Pointer Events capture test', + render(): React.Node { + return ; + }, + }, { name: 'pointerevent_click_touch', title: 'Pointer Events: basic click test', From 579d11ca9e321909c284a5ed97df29128fe63342 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 12 Jun 2023 20:19:06 -0700 Subject: [PATCH 124/468] Rename ReactHost.preload -> ReactHost.start (#37694) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37694 Rename ReactHost.preload -> ReactHost.start to adhere to stable api bypass-github-export-checks changelog: [internal] internal Reviewed By: RSNara Differential Revision: D46294685 fbshipit-source-id: 683683a557c28759db8925e0c0dd6629463511eb --- .../facebook/react/bridgeless/ReactHost.java | 106 +++++++++--------- .../react/bridgeless/ReactHostTest.java | 2 +- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java index 0a6b5edfca0769..1eee44cf0c705c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java @@ -196,30 +196,30 @@ public LifecycleState getLifecycleState() { * errors occur during initialization, and will be cancelled if ReactHost.destroy() is called * before it completes. */ - public Task preload() { + public Task start() { if (ReactFeatureFlags.enableBridgelessArchitectureNewCreateReloadDestroy) { - return new_preload(); + return newStart(); } - return old_preload(); + return oldStart(); } @ThreadConfined("ReactHost") - private @Nullable Task mPreloadTask = null; + private @Nullable Task mStartTask = null; - private Task old_preload() { - final String method = "old_preload()"; + private Task oldStart() { + final String method = "oldPreload()"; return Task.call( () -> { - if (mPreloadTask == null) { + if (mStartTask == null) { log(method, "Schedule"); - mPreloadTask = + mStartTask = getOrCreateReactInstanceTask() .continueWithTask( task -> { if (task.isFaulted()) { destroy( - "old_preload() failure: " + task.getError().getMessage(), + "oldPreload() failure: " + task.getError().getMessage(), task.getError()); mReactHostDelegate.handleInstanceException(task.getError()); } @@ -229,27 +229,27 @@ private Task old_preload() { mBGExecutor) .makeVoid(); } - return mPreloadTask; + return mStartTask; }, mBGExecutor) .continueWithTask(Task::getResult); } - private Task new_preload() { - final String method = "new_preload()"; + private Task newStart() { + final String method = "newPreload()"; return Task.call( () -> { - if (mPreloadTask == null) { + if (mStartTask == null) { log(method, "Schedule"); - mPreloadTask = - waitThen_new_getOrCreateReactInstanceTask() + mStartTask = + waitThenCallNewGetOrCreateReactInstanceTask() .continueWithTask( (task) -> { if (task.isFaulted()) { mReactHostDelegate.handleInstanceException(task.getError()); // Wait for destroy to finish - return new_getOrCreateDestroyTask( - "new_preload() failure: " + task.getError().getMessage(), + return newGetOrCreateDestroyTask( + "newPreload() failure: " + task.getError().getMessage(), task.getError()) .continueWithTask(destroyTask -> Task.forError(task.getError())) .makeVoid(); @@ -258,7 +258,7 @@ private Task new_preload() { }, mBGExecutor); } - return mPreloadTask; + return mStartTask; }, mBGExecutor) .continueWithTask(Task::getResult); @@ -714,22 +714,22 @@ private BridgelessReactContext getOrCreateReactContext() { */ private Task getOrCreateReactInstanceTask() { if (ReactFeatureFlags.enableBridgelessArchitectureNewCreateReloadDestroy) { - return Task.call(this::waitThen_new_getOrCreateReactInstanceTask, mBGExecutor) + return Task.call(this::waitThenCallNewGetOrCreateReactInstanceTask, mBGExecutor) .continueWithTask(Task::getResult); } - return old_getOrCreateReactInstanceTask(); + return oldGetOrCreateReactInstanceTask(); } @ThreadConfined("ReactHost") - private Task waitThen_new_getOrCreateReactInstanceTask() { - return waitThen_new_getOrCreateReactInstanceTaskWithRetries(0, 4); + private Task waitThenCallNewGetOrCreateReactInstanceTask() { + return waitThenCallNewGetOrCreateReactInstanceTaskWithRetries(0, 4); } @ThreadConfined("ReactHost") - private Task waitThen_new_getOrCreateReactInstanceTaskWithRetries( + private Task waitThenCallNewGetOrCreateReactInstanceTaskWithRetries( int tryNum, int maxTries) { - final String method = "waitThen_new_getOrCreateReactInstanceTaskWithRetries"; + final String method = "waitThenCallNewGetOrCreateReactInstanceTaskWithRetries"; if (mReloadTask != null) { log(method, "React Native is reloading. Return reload task."); return mReloadTask; @@ -745,7 +745,7 @@ private Task waitThen_new_getOrCreateReactInstanceTaskWithRetries + tryNum + ")."); return mDestroyTask.onSuccessTask( - (task) -> waitThen_new_getOrCreateReactInstanceTaskWithRetries(tryNum + 1, maxTries), + (task) -> waitThenCallNewGetOrCreateReactInstanceTaskWithRetries(tryNum + 1, maxTries), mBGExecutor); } @@ -754,12 +754,12 @@ private Task waitThen_new_getOrCreateReactInstanceTaskWithRetries "React Native is tearing down. Not wait for teardown to finish: reached max retries."); } - return new_getOrCreateReactInstanceTask(); + return newGetOrCreateReactInstanceTask(); } @ThreadConfined("ReactHost") - private Task new_getOrCreateReactInstanceTask() { - final String method = "new_getOrCreateReactInstanceTask()"; + private Task newGetOrCreateReactInstanceTask() { + final String method = "newGetOrCreateReactInstanceTask()"; log(method); return mReactInstanceTaskRef.getOrCreate( @@ -852,8 +852,8 @@ class Result { }); } - private Task old_getOrCreateReactInstanceTask() { - final String method = "old_getOrCreateReactInstanceTask()"; + private Task oldGetOrCreateReactInstanceTask() { + final String method = "oldGetOrCreateReactInstanceTask()"; log(method); return mReactInstanceTaskRef.getOrCreate( @@ -1031,17 +1031,17 @@ public Task reload(String reason) { method, "Destroying React Native. Waiting for destroy to finish, before reloading React Native."); return mDestroyTask - .continueWithTask(task -> new_getOrCreateReloadTask(reason), mBGExecutor) + .continueWithTask(task -> newGetOrCreateReloadTask(reason), mBGExecutor) .makeVoid(); } - return new_getOrCreateReloadTask(reason).makeVoid(); + return newGetOrCreateReloadTask(reason).makeVoid(); }, mBGExecutor) .continueWithTask(Task::getResult); } - return old_reload(reason); + return oldReload(reason); } @ThreadConfined("ReactHost") @@ -1056,8 +1056,8 @@ public Task reload(String reason) { * ReactInstance task work throws an exception. */ @ThreadConfined("ReactHost") - private Task new_getOrCreateReloadTask(String reason) { - final String method = "new_getOrCreateReloadTask()"; + private Task newGetOrCreateReloadTask(String reason) { + final String method = "newGetOrCreateReloadTask()"; log(method); // Log how React Native is destroyed @@ -1159,10 +1159,10 @@ private Task new_getOrCreateReloadTask(String reason) { mReactInstanceTaskRef.reset(); log(method, "Resetting preload task ref"); - mPreloadTask = null; + mStartTask = null; // Kickstart a new ReactInstance create - return new_getOrCreateReactInstanceTask(); + return newGetOrCreateReactInstanceTask(); }, mBGExecutor) .onSuccess( @@ -1227,15 +1227,15 @@ public Task destroy(String reason, @Nullable Exception ex) { method, "Reloading React Native. Waiting for reload to finish before destroying React Native."); return mReloadTask.continueWithTask( - task -> new_getOrCreateDestroyTask(reason, ex), mBGExecutor); + task -> newGetOrCreateDestroyTask(reason, ex), mBGExecutor); } - return new_getOrCreateDestroyTask(reason, ex); + return newGetOrCreateDestroyTask(reason, ex); }, mBGExecutor) .continueWithTask(Task::getResult); } - old_destroy(reason, ex); + oldDestroy(reason, ex); return Task.forResult(nullsafeFIXME(null, "Empty Destroy Task")); } @@ -1251,8 +1251,8 @@ public Task destroy(String reason, @Nullable Exception ex) { * ReactInstance task work throws an exception. */ @ThreadConfined("ReactHost") - private Task new_getOrCreateDestroyTask(final String reason, @Nullable Exception ex) { - final String method = "new_getOrCreateDestroyTask()"; + private Task newGetOrCreateDestroyTask(final String reason, @Nullable Exception ex) { + final String method = "newGetOrCreateDestroyTask()"; log(method); // Log how React Native is destroyed @@ -1335,7 +1335,7 @@ private Task new_getOrCreateDestroyTask(final String reason, @Nullable Exc mReactInstanceTaskRef.reset(); log(method, "Resetting Preload task ref"); - mPreloadTask = null; + mStartTask = null; log(method, "Resetting destroy task ref"); mDestroyTask = null; @@ -1348,8 +1348,8 @@ private Task new_getOrCreateDestroyTask(final String reason, @Nullable Exc } /** Destroy and recreate the ReactInstance and context. */ - private Task old_reload(String reason) { - final String method = "old_reload()"; + private Task oldReload(String reason) { + final String method = "oldReload()"; log(method); // Log how React Native is destroyed @@ -1358,7 +1358,7 @@ private Task old_reload(String reason) { synchronized (mReactInstanceTaskRef) { mMemoryPressureRouter.removeMemoryPressureListener(mMemoryPressureListener); - old_destroyReactInstanceAndContext(method, reason); + oldDestroyReactInstanceAndContext(method, reason); return callAfterGetOrCreateReactInstance( method, @@ -1375,8 +1375,8 @@ private Task old_reload(String reason) { } /** Destroy the specified instance and context. */ - private void old_destroy(String reason, @Nullable Exception ex) { - final String method = "old_destroy()"; + private void oldDestroy(String reason, @Nullable Exception ex) { + final String method = "oldDestroy()"; log(method); // Log how React Native is destroyed @@ -1391,7 +1391,7 @@ private void old_destroy(String reason, @Nullable Exception ex) { mMemoryPressureRouter.destroy(reactContext); } - old_destroyReactInstanceAndContext(method, reason); + oldDestroyReactInstanceAndContext(method, reason); // Remove all attached surfaces log(method, "Clearing attached surfaces"); @@ -1409,8 +1409,8 @@ private void old_destroy(String reason, @Nullable Exception ex) { } } - private void old_destroyReactInstanceAndContext(final String callingMethod, final String reason) { - final String method = "old_destroyReactInstanceAndContext(" + callingMethod + ")"; + private void oldDestroyReactInstanceAndContext(final String callingMethod, final String reason) { + final String method = "oldDestroyReactInstanceAndContext(" + callingMethod + ")"; log(method); synchronized (mReactInstanceTaskRef) { @@ -1454,7 +1454,7 @@ private void old_destroyReactInstanceAndContext(final String callingMethod, fina // Re-enable preloads log(method, "Resetting Preload task ref"); - mPreloadTask = null; + mStartTask = null; }); } else { raiseSoftException( @@ -1469,7 +1469,7 @@ private void old_destroyReactInstanceAndContext(final String callingMethod, fina mBGExecutor.execute( () -> { log(method, "Resetting Preload task ref"); - mPreloadTask = null; + mStartTask = null; }); } } diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostTest.java index 8c0218e07a2924..21950e7c54c1ea 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostTest.java +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostTest.java @@ -119,7 +119,7 @@ public void testPreload() throws Exception { assertThat(mReactHost.isInstanceInitialized()).isFalse(); - mReactHost.preload().waitForCompletion(); + mReactHost.start().waitForCompletion(); assertThat(mReactHost.isInstanceInitialized()).isTrue(); assertThat(mReactHost.getCurrentReactContext()).isNotNull(); From f821797e515661b42bb1d82157face618f91e837 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 12 Jun 2023 20:19:06 -0700 Subject: [PATCH 125/468] Reduce visibility of NativeModule methods in ReactHost (#37692) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37692 In this diff I'm reducing visibility of NativeModule methods in ReactHost (from public to package) bypass-github-export-checks changelog: [internal] ineternal Reviewed By: cortinico, philIip, RSNara Differential Revision: D46296987 fbshipit-source-id: d50ff9f855c71ee9565f0bc81ffe8be2fd0e2368 --- .../main/java/com/facebook/react/bridgeless/ReactHost.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java index 1eee44cf0c705c..88dd19ed42968f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java @@ -452,7 +452,7 @@ FabricUIManager getUIManager() { return reactInstance.getUIManager(); } - public boolean hasNativeModule(Class nativeModuleInterface) { + /* package */ boolean hasNativeModule(Class nativeModuleInterface) { final ReactInstance reactInstance = mReactInstanceTaskRef.get().getResult(); if (reactInstance != null) { return reactInstance.hasNativeModule(nativeModuleInterface); @@ -460,7 +460,7 @@ public boolean hasNativeModule(Class nativeModuleInt return false; } - public Collection getNativeModules() { + /* package */ Collection getNativeModules() { final ReactInstance reactInstance = mReactInstanceTaskRef.get().getResult(); if (reactInstance != null) { return reactInstance.getNativeModules(); @@ -468,7 +468,8 @@ public Collection getNativeModules() { return new ArrayList<>(); } - public @Nullable T getNativeModule(Class nativeModuleInterface) { + /* package */ @Nullable + T getNativeModule(Class nativeModuleInterface) { if (nativeModuleInterface == UIManagerModule.class) { ReactSoftExceptionLogger.logSoftExceptionVerbose( TAG, From 8351b08088c265d4018561ff9ca0a501ceff0a19 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 12 Jun 2023 20:19:06 -0700 Subject: [PATCH 126/468] Fix lint warnings (#37699) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37699 Fix lint warnings bypass-github-export-checks changelog: [internal] internal Reviewed By: cortinico, philIip Differential Revision: D46407027 fbshipit-source-id: 80acd2a811f712be6a4b228ec3450dcbdf0d3ce3 --- .../com/facebook/react/bridgeless/BridgelessReactContext.java | 2 +- .../facebook/react/devsupport/InspectorPackagerConnection.java | 2 +- .../facebook/react/devsupport/interfaces/DevSupportManager.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BridgelessReactContext.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BridgelessReactContext.java index b8ee4f666babaa..bf65d685dfb443 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BridgelessReactContext.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/BridgelessReactContext.java @@ -115,7 +115,7 @@ public BridgelessJSModuleInvocationHandler( } @Override - public @Nullable Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + public @Nullable Object invoke(Object proxy, Method method, @Nullable Object[] args) { NativeArray jsArgs = args != null ? Arguments.fromJavaArgs(args) : new WritableNativeArray(); mReactHost.callFunctionOnModule( JavaScriptModuleRegistry.getJSModuleName(mJSModuleInterface), method.getName(), jsArgs); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorPackagerConnection.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorPackagerConnection.java index 75b5865371759b..5f535b7044d6fa 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorPackagerConnection.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorPackagerConnection.java @@ -333,6 +333,6 @@ public BundleStatus() { } public interface BundleStatusProvider { - public BundleStatus getBundleStatus(); + BundleStatus getBundleStatus(); } } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java index 5380de4a32df4e..84c756550cfed8 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSupportManager.java @@ -111,7 +111,7 @@ public interface DevSupportManager extends JSExceptionHandler { * determined right before loading the packager. Your customizer must call |callback|, as loading * will be blocked waiting for it to resolve. */ - public interface PackagerLocationCustomizer { + interface PackagerLocationCustomizer { void run(Runnable callback); } From 3f7507bae955a59e33a3220fe41a9fe76303ef1e Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 12 Jun 2023 20:19:06 -0700 Subject: [PATCH 127/468] Move BridgelessReactPackage to com.facebook.react package (#37697) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37697 Move BridgelessReactPackage to com.facebook.react package. This is necessary because BridgelessReactPackage is a core package that needs to be part of RN (and should not be re-defined by all apps) I will revisit naming in a later diff bypass-github-export-checks changelog: [internal] internal Reviewed By: cortinico, philIip Differential Revision: D46408934 fbshipit-source-id: ac172d22a6d70c9d33d2e119da93b25736d85383 --- .../react/BridgelessReactPackage.java | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java new file mode 100644 index 00000000000000..97d24ec0ed8aa5 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java @@ -0,0 +1,70 @@ +/* + * 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.react; + +import com.facebook.infer.annotation.Nullsafe; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.devsupport.LogBoxModule; +import com.facebook.react.devsupport.interfaces.DevSupportManager; +import com.facebook.react.module.annotations.ReactModuleList; +import com.facebook.react.module.model.ReactModuleInfoProvider; +import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; +import com.facebook.react.modules.core.DeviceEventManagerModule; +import com.facebook.react.modules.debug.DevSettingsModule; +import com.facebook.react.modules.debug.SourceCodeModule; +import com.facebook.react.modules.deviceinfo.DeviceInfoModule; +import com.facebook.react.modules.systeminfo.AndroidInfoModule; + +@Nullsafe(Nullsafe.Mode.LOCAL) +@ReactModuleList( + nativeModules = { + AndroidInfoModule.class, + DeviceInfoModule.class, + DevSettingsModule.class, + SourceCodeModule.class, + LogBoxModule.class, + DeviceEventManagerModule.class, + }) +public class BridgelessReactPackage extends TurboReactPackage { + + private DevSupportManager mDevSupportManager; + private DefaultHardwareBackBtnHandler mHardwareBackBtnHandler; + + public BridgelessReactPackage( + DevSupportManager devSupportManager, DefaultHardwareBackBtnHandler hardwareBackBtnHandler) { + mDevSupportManager = devSupportManager; + mHardwareBackBtnHandler = hardwareBackBtnHandler; + } + + @Override + public NativeModule getModule(String name, ReactApplicationContext reactContext) { + switch (name) { + case AndroidInfoModule.NAME: + return new AndroidInfoModule(reactContext); + case DeviceInfoModule.NAME: + return new DeviceInfoModule(reactContext); + case SourceCodeModule.NAME: + return new SourceCodeModule(reactContext); + case DevSettingsModule.NAME: + return new DevSettingsModule(reactContext, mDevSupportManager); + case DeviceEventManagerModule.NAME: + return new DeviceEventManagerModule(reactContext, mHardwareBackBtnHandler); + case LogBoxModule.NAME: + return new LogBoxModule(reactContext, mDevSupportManager); + default: + throw new IllegalArgumentException( + "In BridgelessReactPackage, could not find Native module for " + name); + } + } + + @Override + public ReactModuleInfoProvider getReactModuleInfoProvider() { + return new BridgelessReactPackage$$ReactModuleInfoProvider(); + } +} From efc5f73f27de1cc63c7182811293a87de4436359 Mon Sep 17 00:00:00 2001 From: TatianaKapos Date: Tue, 13 Jun 2023 05:30:16 -0700 Subject: [PATCH 128/468] Specify float value in ParagraphLayoutManager (#37660) Summary: React-Native-Windows had to override this file because we treat certain warning as errors. This fix adds in the "f suffix" to remove the unspecified float error. ## Changelog: [GENERAL] [FIXED] - Specify float value in ParagraphLayoutManager Pull Request resolved: https://github.com/facebook/react-native/pull/37660 Test Plan: Tested with RNW tests Reviewed By: NickGerleman Differential Revision: D46560099 Pulled By: javache fbshipit-source-id: de593cbe60677533f5194ab8fd7e650607b5829e --- .../react/renderer/components/text/ParagraphLayoutManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphLayoutManager.cpp b/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphLayoutManager.cpp index c4a5e886c70d66..41720767d228f4 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphLayoutManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphLayoutManager.cpp @@ -58,7 +58,7 @@ bool ParagraphLayoutManager::shoudMeasureString( bool hasMaximumSizeChanged = layoutConstraints.maximumSize.width != lastAvailableWidth_; - Float threshold = 0.01; + Float threshold = 0.01f; bool doesMaximumSizeMatchLastMeasurement = std::abs( layoutConstraints.maximumSize.width - From 3006a33bafc64a1fd699d8895c74fadac84654ad Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 13 Jun 2023 05:30:20 -0700 Subject: [PATCH 129/468] Remove unused CookieHandler from ForwardingCookieHandler (#37775) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37775 Most of this code was made irrelevant when we dropped support for API < 21 in D24548084. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D46557892 fbshipit-source-id: 6af85a24d476fe1010eb62126b4c5e9df14a0ea2 --- .../network/ForwardingCookieHandler.java | 83 +------------------ 1 file changed, 1 insertion(+), 82 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java index 180bfec3635464..75255ca79a8acc 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java @@ -7,16 +7,10 @@ package com.facebook.react.modules.network; -import android.content.Context; -import android.os.Handler; -import android.os.Looper; -import android.os.Message; import android.text.TextUtils; import android.webkit.CookieManager; -import android.webkit.ValueCallback; import androidx.annotation.Nullable; import com.facebook.react.bridge.Callback; -import com.facebook.react.bridge.GuardedAsyncTask; import com.facebook.react.bridge.ReactContext; import java.io.IOException; import java.net.CookieHandler; @@ -36,13 +30,11 @@ public class ForwardingCookieHandler extends CookieHandler { private static final String VERSION_ONE_HEADER = "Set-cookie2"; private static final String COOKIE_HEADER = "Cookie"; - private final CookieSaver mCookieSaver; private final ReactContext mContext; private @Nullable CookieManager mCookieManager; public ForwardingCookieHandler(ReactContext context) { mContext = context; - mCookieSaver = new CookieSaver(); } @Override @@ -71,20 +63,9 @@ public void put(URI uri, Map> headers) throws IOException { } public void clearCookies(final Callback callback) { - clearCookiesAsync(callback); - } - - private void clearCookiesAsync(final Callback callback) { CookieManager cookieManager = getCookieManager(); if (cookieManager != null) { - cookieManager.removeAllCookies( - new ValueCallback() { - @Override - public void onReceiveValue(Boolean value) { - mCookieSaver.onCookiesModified(); - callback.invoke(value); - } - }); + cookieManager.removeAllCookies(value -> callback.invoke(value)); } } @@ -98,7 +79,6 @@ public void addCookies(final String url, final List cookies) { addCookieAsync(url, cookie); } cookieManager.flush(); - mCookieSaver.onCookiesModified(); } private void addCookieAsync(String url, String cookie) { @@ -112,22 +92,12 @@ private static boolean isCookieHeader(String name) { return name.equalsIgnoreCase(VERSION_ZERO_HEADER) || name.equalsIgnoreCase(VERSION_ONE_HEADER); } - private void runInBackground(final Runnable runnable) { - new GuardedAsyncTask(mContext) { - @Override - protected void doInBackgroundGuarded(Void... params) { - runnable.run(); - } - }.execute(); - } - /** * Instantiating CookieManager will load the Chromium task taking a 100ish ms so we do it lazily * to make sure it's done on a background thread as needed. */ private @Nullable CookieManager getCookieManager() { if (mCookieManager == null) { - possiblyWorkaroundSyncManager(mContext); try { mCookieManager = CookieManager.getInstance(); } catch (IllegalArgumentException ex) { @@ -151,55 +121,4 @@ protected void doInBackgroundGuarded(Void... params) { return mCookieManager; } - - private static void possiblyWorkaroundSyncManager(Context context) {} - - /** - * Responsible for flushing cookies to disk. Flushes to disk with a maximum delay of 30 seconds. - * This class is only active if we are on API < 21. - */ - private class CookieSaver { - private static final int MSG_PERSIST_COOKIES = 1; - - private static final int TIMEOUT = 30 * 1000; // 30 seconds - - private final Handler mHandler; - - public CookieSaver() { - mHandler = - new Handler( - Looper.getMainLooper(), - new Handler.Callback() { - @Override - public boolean handleMessage(Message msg) { - if (msg.what == MSG_PERSIST_COOKIES) { - persistCookies(); - return true; - } else { - return false; - } - } - }); - } - - public void onCookiesModified() {} - - public void persistCookies() { - mHandler.removeMessages(MSG_PERSIST_COOKIES); - runInBackground( - new Runnable() { - @Override - public void run() { - flush(); - } - }); - } - - private void flush() { - CookieManager cookieManager = getCookieManager(); - if (cookieManager != null) { - cookieManager.flush(); - } - } - } } From 9c9945a5bfb2e9c9da0810c57e81922ad1dd83c8 Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Date: Tue, 13 Jun 2023 07:29:02 -0700 Subject: [PATCH 130/468] Revert "fix: border width top/bottom not matching the border radius" (#37840) Summary: In an effort to fix https://github.com/facebook/react-native/issues/37753, this PR reverts the changes introduced by https://github.com/facebook/react-native/commit/cd6a91343ee24af83c7437b3f2449b41e97760e9 and https://github.com/facebook/react-native/commit/1d5103227851ab92de889d5e7e910393b5d8743a so border-radius width calculations work as expected ## Changelog: [ANDROID] [FIXED] - Fix border-radius width calculations Pull Request resolved: https://github.com/facebook/react-native/pull/37840 Test Plan: Test border colors along with border-radius through RNTester image Reviewed By: dmytrorykun Differential Revision: D46684071 Pulled By: cipolleschi fbshipit-source-id: cf7a80d0d63009b457f03d690b632e332a9b4a02 --- .../views/view/ReactViewBackgroundDrawable.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java index 31a4523569c5c5..110bf7527da06d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java @@ -891,7 +891,7 @@ private void updatePath() { /** Compute mInnerTopLeftCorner */ mInnerTopLeftCorner.x = mInnerClipTempRectForBorderRadius.left; - mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top * 2; + mInnerTopLeftCorner.y = mInnerClipTempRectForBorderRadius.top; getEllipseIntersectionWithLine( // Ellipse Bounds @@ -917,10 +917,7 @@ private void updatePath() { } mInnerBottomLeftCorner.x = mInnerClipTempRectForBorderRadius.left; - mInnerBottomLeftCorner.y = - borderWidth.bottom != 0 - ? mInnerClipTempRectForBorderRadius.bottom * -2 - : mInnerClipTempRectForBorderRadius.bottom; + mInnerBottomLeftCorner.y = mInnerClipTempRectForBorderRadius.bottom; getEllipseIntersectionWithLine( // Ellipse Bounds @@ -946,7 +943,7 @@ private void updatePath() { } mInnerTopRightCorner.x = mInnerClipTempRectForBorderRadius.right; - mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top * 2; + mInnerTopRightCorner.y = mInnerClipTempRectForBorderRadius.top; getEllipseIntersectionWithLine( // Ellipse Bounds @@ -972,10 +969,7 @@ private void updatePath() { } mInnerBottomRightCorner.x = mInnerClipTempRectForBorderRadius.right; - mInnerBottomRightCorner.y = - borderWidth.bottom != 0 - ? mInnerClipTempRectForBorderRadius.bottom * -2 - : mInnerClipTempRectForBorderRadius.bottom; + mInnerBottomRightCorner.y = mInnerClipTempRectForBorderRadius.bottom; getEllipseIntersectionWithLine( // Ellipse Bounds From e82bb7beb525d6de4e0210da352341ec91c94498 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Tue, 13 Jun 2023 07:32:13 -0700 Subject: [PATCH 131/468] rn-ci-e2e-test CircleCI using wrong parameters (#37852) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37852 Changelog: [Internal] - rn-ci-e2e-test is running on CircleCI but has been passing in the wrong parameter with `--version` -- which didn't evaluate the script, it would early exit as `--version` is a reserved parameter in yargs. You can see if you do `node scripts/set-rn-version.js --help` When I fixed this [here](https://www.internalfb.com/diff/D46511840?dst_version_fbid=827076485041949&transaction_fbid=625055476222975), forgot to pass `build-type` parameter This will fix the broken testjs e2e builds here: https://app.circleci.com/pipelines/github/facebook/react-native/25703/workflows/11a41ba1-c731-44e4-b515-a8b209ae0848/jobs/732035 Reviewed By: rshest Differential Revision: D46672741 fbshipit-source-id: 4a189127e4d0545192a03c1e7abc995dff6f83ae --- scripts/run-ci-e2e-tests.js | 6 +++++- scripts/set-rn-version.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/run-ci-e2e-tests.js b/scripts/run-ci-e2e-tests.js index 56550cc262b822..fbab0b3bc71160 100644 --- a/scripts/run-ci-e2e-tests.js +++ b/scripts/run-ci-e2e-tests.js @@ -64,7 +64,11 @@ try { } describe('Create react-native package'); - if (exec('node ./scripts/set-rn-version.js --to-version 1000.0.0').code) { + if ( + exec( + 'node ./scripts/set-rn-version.js --to-version 1000.0.0 --build-type dry-run', + ).code + ) { echo('Failed to set version and update package.json ready for release'); exitCode = 1; throw Error(exitCode); diff --git a/scripts/set-rn-version.js b/scripts/set-rn-version.js index ad8603471b4fe3..4081ee42afbb5c 100755 --- a/scripts/set-rn-version.js +++ b/scripts/set-rn-version.js @@ -49,6 +49,7 @@ if (require.main === module) { .option('b', { alias: 'build-type', type: 'string', + choices: ['dry-run', 'nightly', 'release'], required: true, }).argv; From b5f52216b07c0aec1d621392639620894c6dd50a Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Date: Tue, 13 Jun 2023 07:45:47 -0700 Subject: [PATCH 132/468] Add getObjectProperties function to Parser (#37789) Summary: [Codegen 128] This PR add a `getObjectProperties` function to the Parser interface, which returns the properties of an object represented by a type annotation as requested on https://github.com/facebook/react-native/issues/34872 ## Changelog: [INTERNAL] [ADDED] - Add getObjectProperties function to codegen Parser Pull Request resolved: https://github.com/facebook/react-native/pull/37789 Test Plan: Run `yarn jest react-native-codegen` and ensure CI is green Reviewed By: cipolleschi Differential Revision: D46584748 Pulled By: rshest fbshipit-source-id: 7f509b6f8754472a9b3048214345dc94265604ba --- .../src/parsers/__tests__/parsers-test.js | 94 +++++++++++++++++++ .../src/parsers/flow/components/events.js | 16 ++-- .../src/parsers/flow/parser.js | 4 + .../src/parsers/parser.js | 7 ++ .../src/parsers/parserMock.js | 4 + .../parsers/typescript/components/events.js | 18 ++-- .../src/parsers/typescript/parser.js | 4 + 7 files changed, 134 insertions(+), 13 deletions(-) diff --git a/packages/react-native-codegen/src/parsers/__tests__/parsers-test.js b/packages/react-native-codegen/src/parsers/__tests__/parsers-test.js index cec604b80ad1ab..4df7f89cc1df6b 100644 --- a/packages/react-native-codegen/src/parsers/__tests__/parsers-test.js +++ b/packages/react-native-codegen/src/parsers/__tests__/parsers-test.js @@ -383,6 +383,53 @@ describe('FlowParser', () => { ); }); }); + + describe('getObjectProperties', () => { + it('returns properties of an object represented by a type annotation', () => { + const properties = [ + { + type: 'ObjectTypeProperty', + key: { + type: 'Identifier', + name: 'a', + }, + value: { + type: 'StringTypeAnnotation', + range: [], + }, + }, + { + type: 'ObjectTypeProperty', + key: { + type: 'Identifier', + name: 'b', + }, + optional: true, + value: { + type: 'BooleanTypeAnnotation', + range: [], + }, + }, + ]; + + const typeAnnotation = { + type: 'TypeAlias', + properties: properties, + }; + + const expected = properties; + + expect(parser.getObjectProperties(typeAnnotation)).toEqual(expected); + }); + + it('returns undefined if typeAnnotation does not have properties', () => { + const declaration = { + type: 'TypeAlias', + }; + + expect(parser.getObjectProperties(declaration)).toEqual(undefined); + }); + }); }); describe('TypeScriptParser', () => { @@ -727,4 +774,51 @@ describe('TypeScriptParser', () => { ); }); }); + + describe('getObjectProperties', () => { + it('returns members of an object represented by a type annotation', () => { + const members = [ + { + type: 'ObjectTypeProperty', + key: { + type: 'Identifier', + name: 'a', + }, + value: { + type: 'StringTypeAnnotation', + range: [], + }, + }, + { + type: 'ObjectTypeProperty', + key: { + type: 'Identifier', + name: 'b', + }, + optional: true, + value: { + type: 'BooleanTypeAnnotation', + range: [], + }, + }, + ]; + + const typeAnnotation = { + type: 'TypeAlias', + members: members, + }; + + const expected = members; + + expect(parser.getObjectProperties(typeAnnotation)).toEqual(expected); + }); + + it('returns undefined if typeAnnotation does not have members', () => { + const declaration = { + type: 'TypeAlias', + }; + + expect(parser.getObjectProperties(declaration)).toEqual(undefined); + }); + }); }); diff --git a/packages/react-native-codegen/src/parsers/flow/components/events.js b/packages/react-native-codegen/src/parsers/flow/components/events.js index 2db5645426bcd6..b40b7166d3a24c 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/events.js +++ b/packages/react-native-codegen/src/parsers/flow/components/events.js @@ -69,9 +69,11 @@ function getPropertyType( optional, typeAnnotation: { type: 'ObjectTypeAnnotation', - properties: typeAnnotation.properties.map(member => - buildPropertiesForEvent(member, parser, getPropertyType), - ), + properties: parser + .getObjectProperties(typeAnnotation) + .map(member => + buildPropertiesForEvent(member, parser, getPropertyType), + ), }, }; case 'UnionTypeAnnotation': @@ -128,9 +130,11 @@ function extractArrayElementType( case 'ObjectTypeAnnotation': return { type: 'ObjectTypeAnnotation', - properties: typeAnnotation.properties.map(member => - buildPropertiesForEvent(member, parser, getPropertyType), - ), + properties: parser + .getObjectProperties(typeAnnotation) + .map(member => + buildPropertiesForEvent(member, parser, getPropertyType), + ), }; case 'ArrayTypeAnnotation': return { diff --git a/packages/react-native-codegen/src/parsers/flow/parser.js b/packages/react-native-codegen/src/parsers/flow/parser.js index d21f2bf3ece529..676a206588dad5 100644 --- a/packages/react-native-codegen/src/parsers/flow/parser.js +++ b/packages/react-native-codegen/src/parsers/flow/parser.js @@ -539,6 +539,10 @@ class FlowParser implements Parser { ? typeAnnotation.id.name : typeAnnotation.type; } + + getObjectProperties(typeAnnotation: $FlowFixMe): $FlowFixMe { + return typeAnnotation.properties; + } } module.exports = { diff --git a/packages/react-native-codegen/src/parsers/parser.js b/packages/react-native-codegen/src/parsers/parser.js index 205da97f1372e4..98901b41755c3b 100644 --- a/packages/react-native-codegen/src/parsers/parser.js +++ b/packages/react-native-codegen/src/parsers/parser.js @@ -407,4 +407,11 @@ export interface Parser { * @returns: the extracted type. */ extractTypeFromTypeAnnotation(typeAnnotation: $FlowFixMe): string; + + /** + * Given a typeAnnotation return the properties of an object. + * @parameter property + * @returns: the properties of an object represented by a type annotation. + */ + getObjectProperties(typeAnnotation: $FlowFixMe): $FlowFixMe; } diff --git a/packages/react-native-codegen/src/parsers/parserMock.js b/packages/react-native-codegen/src/parsers/parserMock.js index 4a3b83444efa69..6e5f78de77da53 100644 --- a/packages/react-native-codegen/src/parsers/parserMock.js +++ b/packages/react-native-codegen/src/parsers/parserMock.js @@ -478,4 +478,8 @@ export class MockedParser implements Parser { ? typeAnnotation.id.name : typeAnnotation.type; } + + getObjectProperties(typeAnnotation: $FlowFixMe): $FlowFixMe { + return typeAnnotation.properties; + } } diff --git a/packages/react-native-codegen/src/parsers/typescript/components/events.js b/packages/react-native-codegen/src/parsers/typescript/components/events.js index 17c3541ed6bdd1..f03b9209fea01e 100644 --- a/packages/react-native-codegen/src/parsers/typescript/components/events.js +++ b/packages/react-native-codegen/src/parsers/typescript/components/events.js @@ -71,9 +71,11 @@ function getPropertyType( optional, typeAnnotation: { type: 'ObjectTypeAnnotation', - properties: typeAnnotation.members.map(member => - buildPropertiesForEvent(member, parser, getPropertyType), - ), + properties: parser + .getObjectProperties(typeAnnotation) + .map(member => + buildPropertiesForEvent(member, parser, getPropertyType), + ), }, }; case 'TSUnionType': @@ -138,9 +140,11 @@ function extractArrayElementType( case 'TSTypeLiteral': return { type: 'ObjectTypeAnnotation', - properties: typeAnnotation.members.map(member => - buildPropertiesForEvent(member, parser, getPropertyType), - ), + properties: parser + .getObjectProperties(typeAnnotation) + .map(member => + buildPropertiesForEvent(member, parser, getPropertyType), + ), }; case 'TSArrayType': return { @@ -183,7 +187,7 @@ function findEventArgumentsAndType( if (typeAnnotation.type === 'TSTypeLiteral') { return { - argumentProps: typeAnnotation.members, + argumentProps: parser.getObjectProperties(typeAnnotation), paperTopLevelNameDeprecated: paperName, bubblingType, }; diff --git a/packages/react-native-codegen/src/parsers/typescript/parser.js b/packages/react-native-codegen/src/parsers/typescript/parser.js index 0d13c67c8c3bc8..4a18396b5c9625 100644 --- a/packages/react-native-codegen/src/parsers/typescript/parser.js +++ b/packages/react-native-codegen/src/parsers/typescript/parser.js @@ -553,6 +553,10 @@ class TypeScriptParser implements Parser { ? typeAnnotation.typeName.name : typeAnnotation.type; } + + getObjectProperties(typeAnnotation: $FlowFixMe): $FlowFixMe { + return typeAnnotation.members; + } } module.exports = { From 09d357c0df0c901304ca2d44de3c32f351c2005e Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Tue, 13 Jun 2023 08:06:24 -0700 Subject: [PATCH 133/468] Fix undefined symbols `_FBcoreLocalexxHash48` and `_RCTLocalizedStringFromKey` in OSS (#37838) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37838 We see a linker failure in the OSS build because our header exports C-style functions (not ObjC), that Objective C will assume are C ABI, but we build them as C++ functions. Internally these are all marked as `extern "C"`, so to not deviate I did the same here to expose these always as plain C functions. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D46671506 fbshipit-source-id: 5b3005074303763d55801c4d24ac9250b96d45ba --- packages/react-native/React/I18n/RCTLocalizedString.h | 8 ++++++++ packages/react-native/React/I18n/RCTLocalizedString.mm | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/packages/react-native/React/I18n/RCTLocalizedString.h b/packages/react-native/React/I18n/RCTLocalizedString.h index a190fccdab271d..68c48bd6775927 100644 --- a/packages/react-native/React/I18n/RCTLocalizedString.h +++ b/packages/react-native/React/I18n/RCTLocalizedString.h @@ -14,6 +14,10 @@ #import +#ifdef __cplusplus +extern "C" { +#endif + uint64_t FBcoreLocalexxHash48(const char *input, uint64_t length, uint64_t seed); NSString *RCTLocalizedStringFromKey(uint64_t key, NSString *defaultValue); @@ -23,4 +27,8 @@ NSString *RCTLocalizedStringFromKey(uint64_t key, NSString *defaultValue); #define RCTLocalizedString(string, description) \ RCTLocalizedStringFromKey(RCTLocalizedStringKey(string, description), @"" string) +#ifdef __cplusplus +} +#endif + #endif diff --git a/packages/react-native/React/I18n/RCTLocalizedString.mm b/packages/react-native/React/I18n/RCTLocalizedString.mm index ae2e05dd276c4d..6a09613b77a0ac 100644 --- a/packages/react-native/React/I18n/RCTLocalizedString.mm +++ b/packages/react-native/React/I18n/RCTLocalizedString.mm @@ -9,6 +9,8 @@ #if !defined(WITH_FBI18N) || !(WITH_FBI18N) +extern "C" { + static NSString *FBTStringByConvertingIntegerToBase64(uint64_t number) { const NSUInteger base = 64; @@ -39,4 +41,6 @@ return [bundle localizedStringForKey:FBTStringByConvertingIntegerToBase64(key) value:defaultValue table:nil]; } } +} + #endif From 922681f15bc373110a0154212f8b596d07656667 Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Tue, 13 Jun 2023 11:54:54 -0700 Subject: [PATCH 134/468] Add getTestId into views/common (#37851) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37851 ## Changelog [Internal] - The `testId` value in practice can be used for other things than e2e tests - e.g. there is already a use case for Accessibility, but also we may want to log it as an extra data point with e.g. performance metrics. This exposes a helper function to extract a `testId` from a view. Differential Revision: D46684365 fbshipit-source-id: 17602307c468a906ef4d0679e826dbcd1eb651b7 --- .../react/views/common/ViewUtils.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/common/ViewUtils.java diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/common/ViewUtils.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/common/ViewUtils.java new file mode 100644 index 00000000000000..65f1f3c4bb5f7f --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/common/ViewUtils.java @@ -0,0 +1,27 @@ +/* + * 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.react.views.common; + +import android.view.View; +import com.facebook.react.R; + +/** Class containing static methods involving manipulations of Views */ +public class ViewUtils { + + /** + * Returns value of testId for the given view, if present + * + * @param view View to get the testId value for + * @return the value of testId if defined for the view, otherwise null + */ + public static String getTestId(View view) { + return view.getTag(R.id.react_test_id) instanceof String + ? (String) view.getTag(R.id.react_test_id) + : null; + } +} From d631e0d9e950e74576f672f95b86cbfadfd98bf8 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Tue, 13 Jun 2023 13:28:12 -0700 Subject: [PATCH 135/468] test-e2e-local dont launch emulator if device connected (#37862) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37862 Changelog: [Internal] - Don't launch android emulator if you already have a device connected. Reviewed By: cortinico Differential Revision: D46688735 fbshipit-source-id: 1256792f96ef6989465e7cbe43385469502b46fe --- scripts/test-e2e-local.js | 4 ++-- scripts/testing-utils.js | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/scripts/test-e2e-local.js b/scripts/test-e2e-local.js index d88349290a0d50..6a8f679f29d249 100644 --- a/scripts/test-e2e-local.js +++ b/scripts/test-e2e-local.js @@ -22,7 +22,7 @@ const yargs = require('yargs'); const fs = require('fs'); const { - launchAndroidEmulator, + maybeLaunchAndroidEmulator, isPackagerRunning, launchPackagerInSeparateWindow, } = require('./testing-utils'); @@ -107,7 +107,7 @@ if (argv.target === 'RNTester') { } else { // we do the android path here - launchAndroidEmulator(); + maybeLaunchAndroidEmulator(); console.info( `We're going to test the ${ diff --git a/scripts/testing-utils.js b/scripts/testing-utils.js index a7d48b7d8b73a2..c3ce4f78dde413 100644 --- a/scripts/testing-utils.js +++ b/scripts/testing-utils.js @@ -60,7 +60,20 @@ function tryLaunchEmulator() { }; } -function launchAndroidEmulator() { +function hasConnectedDevice() { + const physicalDevices = exec('adb devices | grep -v emulator', {silent: true}) + .stdout.trim() + .split('\n') + .slice(1); + return physicalDevices.length > 0; +} + +function maybeLaunchAndroidEmulator() { + if (hasConnectedDevice) { + console.info('Already have a device connected. Skip launching emulator.'); + return; + } + const result = tryLaunchEmulator(); if (result.success) { console.info('Successfully launched emulator.'); @@ -103,7 +116,7 @@ function launchPackagerInSeparateWindow(folderPath) { } module.exports = { - launchAndroidEmulator, + maybeLaunchAndroidEmulator, isPackagerRunning, launchPackagerInSeparateWindow, }; From 03c978d2ccac719acdee0cd9c8275f0d476c8bf1 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Tue, 13 Jun 2023 14:24:12 -0700 Subject: [PATCH 136/468] add unit test for start method on RCTHost (#37858) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37858 Changelog: [Internal] in this diff, i add a test that runs `start` validates that the lifecycle `hostDidStart:` is called as a result. notably, i created a custom shim for `RCTInstance` to completely stub out its behavior. Reviewed By: cipolleschi Differential Revision: D46508066 fbshipit-source-id: e815aee64d06b160f2cbdc52720a8e698d11c680 --- .../react/bridgeless/iostests/RCTHostTests.mm | 63 ++++++++++++++++++- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm index 13fcf49f16add0..f76dfbb5f6807e 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm @@ -7,13 +7,72 @@ #import +#import +#import +#import +#import +#import + +#import + +@interface ShimRCTInstance : NSObject +@end + @interface RCTHostTests : XCTestCase @end -@implementation RCTHostTests +@implementation RCTHostTests { + RCTHost *_subject; + id _mockHostDelegate; +} + +static ShimRCTInstance *shimmedRCTInstance; + +- (void)setUp +{ + [super setUp]; + + shimmedRCTInstance = [ShimRCTInstance new]; + + _mockHostDelegate = OCMProtocolMock(@protocol(RCTHostDelegate)); + _subject = [[RCTHost alloc] initWithBundleURL:OCMClassMock([NSURL class]) + hostDelegate:_mockHostDelegate + turboModuleManagerDelegate:OCMProtocolMock(@protocol(RCTTurboModuleManagerDelegate)) + jsEngineProvider:^std::shared_ptr() { + return std::make_shared(); + }]; +} + +- (void)testStart +{ + [_subject start]; + OCMVerify(OCMTimes(1), [_mockHostDelegate hostDidStart:_subject]); +} + +@end + +@implementation ShimRCTInstance + +- (instancetype)init +{ + if (self = [super init]) { + RCTSwizzleInstanceSelector( + [RCTInstance class], + [ShimRCTInstance class], + @selector(initWithDelegate: + jsEngineInstance:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry:)); + } + return self; +} -- (void)testHost +- (instancetype)initWithDelegate:(id)delegate + jsEngineInstance:(std::shared_ptr)jsEngineInstance + bundleManager:(RCTBundleManager *)bundleManager + turboModuleManagerDelegate:(id)tmmDelegate + onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad + moduleRegistry:(RCTModuleRegistry *)moduleRegistry { + return self; } @end From be2b0e2d8a3cab9de93959d37d398b2144f301ab Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Tue, 13 Jun 2023 14:24:12 -0700 Subject: [PATCH 137/468] lift out ShimRCTInstance to RCTTestUtils (#37859) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37859 Changelog: [Internal] as title Reviewed By: cipolleschi Differential Revision: D46547014 fbshipit-source-id: ca89d659d24fa0fcef1c39fc47fc758cee34f7d8 --- .../react/bridgeless/iostests/RCTHostTests.mm | 31 +-------------- .../test_utils/ios/Shims/ShimRCTInstance.h | 11 ++++++ .../test_utils/ios/Shims/ShimRCTInstance.mm | 38 +++++++++++++++++++ 3 files changed, 50 insertions(+), 30 deletions(-) create mode 100644 packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h create mode 100644 packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm diff --git a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm index f76dfbb5f6807e..4e571b47ec0853 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm @@ -7,7 +7,7 @@ #import -#import +#import #import #import #import @@ -15,9 +15,6 @@ #import -@interface ShimRCTInstance : NSObject -@end - @interface RCTHostTests : XCTestCase @end @@ -50,29 +47,3 @@ - (void)testStart } @end - -@implementation ShimRCTInstance - -- (instancetype)init -{ - if (self = [super init]) { - RCTSwizzleInstanceSelector( - [RCTInstance class], - [ShimRCTInstance class], - @selector(initWithDelegate: - jsEngineInstance:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry:)); - } - return self; -} - -- (instancetype)initWithDelegate:(id)delegate - jsEngineInstance:(std::shared_ptr)jsEngineInstance - bundleManager:(RCTBundleManager *)bundleManager - turboModuleManagerDelegate:(id)tmmDelegate - onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad - moduleRegistry:(RCTModuleRegistry *)moduleRegistry -{ - return self; -} - -@end diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h new file mode 100644 index 00000000000000..50e1eb1f7fd25d --- /dev/null +++ b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface ShimRCTInstance : NSObject +@end diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm new file mode 100644 index 00000000000000..1e1b52c61546ad --- /dev/null +++ b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm @@ -0,0 +1,38 @@ +/* + * 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 "ShimRCTInstance.h" + +#import + +#import "RCTSwizzleHelpers.h" + +@implementation ShimRCTInstance + +- (instancetype)init +{ + if (self = [super init]) { + RCTSwizzleInstanceSelector( + [RCTInstance class], + [ShimRCTInstance class], + @selector(initWithDelegate: + jsEngineInstance:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry:)); + } + return self; +} + +- (instancetype)initWithDelegate:(id)delegate + jsEngineInstance:(std::shared_ptr)jsEngineInstance + bundleManager:(RCTBundleManager *)bundleManager + turboModuleManagerDelegate:(id)tmmDelegate + onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad + moduleRegistry:(RCTModuleRegistry *)moduleRegistry +{ + return self; +} + +@end From a4dae044df58f37ac0e760045bb8b3587ea3ae7e Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Tue, 13 Jun 2023 14:24:12 -0700 Subject: [PATCH 138/468] test RCTInstance initialization (#37860) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37860 Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D46547013 fbshipit-source-id: 2b1593799ce2b5d29e7ea6df4373ff6c92b51065 --- .../react/bridgeless/iostests/RCTHostTests.mm | 8 ++++++++ .../react/test_utils/ios/Shims/ShimRCTInstance.h | 5 +++++ .../react/test_utils/ios/Shims/ShimRCTInstance.mm | 15 +++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm index 4e571b47ec0853..58467be556b005 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm @@ -40,10 +40,18 @@ - (void)setUp }]; } +- (void)tearDown +{ + [shimmedRCTInstance reset]; + + [super tearDown]; +} + - (void)testStart { [_subject start]; OCMVerify(OCMTimes(1), [_mockHostDelegate hostDidStart:_subject]); + XCTAssertEqual(shimmedRCTInstance.initCount, 1); } @end diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h index 50e1eb1f7fd25d..a0aee07975b34f 100644 --- a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h +++ b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h @@ -8,4 +8,9 @@ #import @interface ShimRCTInstance : NSObject + +@property (assign) int initCount; + +- (void)reset; + @end diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm index 1e1b52c61546ad..017b45ac212b2c 100644 --- a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm +++ b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm @@ -11,20 +11,34 @@ #import "RCTSwizzleHelpers.h" +static __weak ShimRCTInstance *weakShim = nil; + @implementation ShimRCTInstance - (instancetype)init { if (self = [super init]) { + _initCount = 0; RCTSwizzleInstanceSelector( [RCTInstance class], [ShimRCTInstance class], @selector(initWithDelegate: jsEngineInstance:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry:)); + weakShim = self; } return self; } +- (void)reset +{ + RCTSwizzleInstanceSelector( + [RCTInstance class], + [ShimRCTInstance class], + @selector(initWithDelegate: + jsEngineInstance:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry:)); + _initCount = 0; +} + - (instancetype)initWithDelegate:(id)delegate jsEngineInstance:(std::shared_ptr)jsEngineInstance bundleManager:(RCTBundleManager *)bundleManager @@ -32,6 +46,7 @@ - (instancetype)initWithDelegate:(id)delegate onInitialBundleLoad:(RCTInstanceInitialBundleLoadCompletionBlock)onInitialBundleLoad moduleRegistry:(RCTModuleRegistry *)moduleRegistry { + weakShim.initCount++; return self; } From 75a5ec05bd3e269c9ad3b7c5d39ff8bb926993c9 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Tue, 13 Jun 2023 14:38:13 -0700 Subject: [PATCH 139/468] Descriptive CocoaPods error if CMake is not installed (#37839) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37839 The CocoaPods build assumes that a `cmake` command is present during `pod install`. It acts gracefully if it is not and propagates an empty string path, leading to a confusing error during the build, and requiring a `pod deintegrate` after CMake is installed because of when the binary is set. This replaces the usage with `Pod::Executable::which!`, the built-in CocoaPods method of finding an executable from `PATH` which errors out the build if not found. This will cause a failure during `pod install`, when we are looking for the command, and specify that `cmake` is the missing executable. This branch is only taken for source builds, so this will not show up in the cases where we do not need CocoaPods. Changelog: [iOS][Fixed] - Descriptive Cocoapods Error if CMake is not installed Reviewed By: cipolleschi Differential Revision: D46670007 fbshipit-source-id: d508743d51f9b99e1bce7d4d3cef6395d5abf46d --- packages/react-native/sdks/hermes-engine/hermes-engine.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec index 81112367d81f2f..5be0a8d49908f8 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec +++ b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec @@ -90,7 +90,7 @@ Pod::Spec.new do |spec| spec.prepare_command = ". #{react_native_path}/sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh" - CMAKE_BINARY = %x(command -v cmake | tr -d '\n') + CMAKE_BINARY = Pod::Executable::which!('cmake') # NOTE: Script phases are sorted alphabetically inside Xcode project spec.script_phases = [ { From a7e5c96a3d11671ed45b5d4f02334e8cc988ce9e Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Tue, 13 Jun 2023 15:50:01 -0700 Subject: [PATCH 140/468] Localize Talkback strings (#37856) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37856 These strings are spoken to the user when using an ascessibility role or state not natively supported by Talkback. We can enable these for translation by removing flags to disable localization, and adding descriptions to each string. These are derived from MDN for ARIA (used for iOS strings), along with Android and iOS documentation. Note that this was explicitly disabled as part of D15087192 because of creating spam which was hitting the GitHub repo, but when translation was enabled for the dev menu, this ended up being a non-issue after initial translation. And we really do want these to be localized. Changelog: [Android][Fixed] - Localize Talkback strings Reviewed By: cortinico Differential Revision: D46692127 fbshipit-source-id: 6da4a181e03f46bad850e4385b94155695a142a8 --- .../res/views/uimanager/values/strings.xml | 103 ++++++++++++++++++ .../uimanager/values/strings_unlocalized.xml | 103 ------------------ 2 files changed, 103 insertions(+), 103 deletions(-) create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings.xml delete mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings_unlocalized.xml diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings.xml new file mode 100644 index 00000000000000..a2f6ad5263150a --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings.xml @@ -0,0 +1,103 @@ + + + Link + Image + Button, Image + Heading + Alert + Combo Box + Menu + Menu Bar + Menu Item + Progress Bar + Radio Group + Scroll Bar + Spin Button + Tab + Tab List + Timer + Tool Bar + Summary + busy + expanded + collapsed + unselected + on + off + mixed + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings_unlocalized.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings_unlocalized.xml deleted file mode 100644 index d06603f611372a..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values/strings_unlocalized.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - Link - Image - Button, Image - Heading - Alert - Combo Box - Menu - Menu Bar - Menu Item - Progress Bar - Radio Group - Scroll Bar - Spin Button - Tab - Tab List - Timer - Tool Bar - Summary - busy - expanded - collapsed - unselected - on - off - mixed - From 1e332b8630d3017834a087d987f1a60e5e2659f4 Mon Sep 17 00:00:00 2001 From: Aymane Missouri Date: Tue, 13 Jun 2023 16:20:02 -0700 Subject: [PATCH 141/468] convert HeaderUtilTest to kotlin (#37829) Summary: This PR converts HeaderUtilTest.java to Kotlin as requested in https://github.com/facebook/react-native/issues/37708. ## Changelog: [INTERNAL] [CHANGED] - Convert HeaderUtilTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37829 Test Plan: Run ./gradlew :packages:react-native:ReactAndroid:test. All tests should pass. Reviewed By: mdvacca Differential Revision: D46647152 Pulled By: cortinico fbshipit-source-id: a05108c4cae28526ac55f4f273673221e3ff4cf1 --- .../react/modules/network/HeaderUtilTest.java | 73 ------------------ .../react/modules/network/HeaderUtilTest.kt | 74 +++++++++++++++++++ 2 files changed, 74 insertions(+), 73 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/HeaderUtilTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/HeaderUtilTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/HeaderUtilTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/HeaderUtilTest.java deleted file mode 100644 index 35c17cfbc21e98..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/HeaderUtilTest.java +++ /dev/null @@ -1,73 +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.react.modules.network; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class HeaderUtilTest { - public static final String TABULATION_TEST = "\teyJhbGciOiJS\t"; - public static final String TABULATION_STRIP_EXPECTED = "eyJhbGciOiJS"; - public static final String NUMBERS_TEST = "0123456789"; - public static final String SPECIALS_TEST = "!@#$%^&*()-=_+{}[]\\|;:'\",.<>/?"; - public static final String ALPHABET_TEST = "abcdefghijklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWHYZ"; - public static final String VALUE_BANNED_SYMBOLS_TEST = "���name�����������\u007f\u001f"; - public static final String NAME_BANNED_SYMBOLS_TEST = "���name�����������\u007f\u0020\u001f"; - public static final String BANNED_TEST_EXPECTED = "name"; - - @Test - public void nameStripKeepsLetters() { - assertEquals(ALPHABET_TEST, HeaderUtil.stripHeaderName(ALPHABET_TEST)); - } - - @Test - public void valueStripKeepsLetters() { - assertEquals(ALPHABET_TEST, HeaderUtil.stripHeaderValue(ALPHABET_TEST)); - } - - @Test - public void nameStripKeepsNumbers() { - assertEquals(NUMBERS_TEST, HeaderUtil.stripHeaderName(NUMBERS_TEST)); - } - - @Test - public void valueStripKeepsNumbers() { - assertEquals(NUMBERS_TEST, HeaderUtil.stripHeaderValue(NUMBERS_TEST)); - } - - @Test - public void valueStripKeepsSpecials() { - assertEquals(SPECIALS_TEST, HeaderUtil.stripHeaderValue(SPECIALS_TEST)); - } - - @Test - public void nameStripKeepsSpecials() { - assertEquals(SPECIALS_TEST, HeaderUtil.stripHeaderName(SPECIALS_TEST)); - } - - @Test - public void valueStripKeepsTabs() { - assertEquals(TABULATION_TEST, HeaderUtil.stripHeaderValue(TABULATION_TEST)); - } - - @Test - public void nameStripDeletesTabs() { - assertEquals(TABULATION_STRIP_EXPECTED, HeaderUtil.stripHeaderName(TABULATION_TEST)); - } - - @Test - public void valueStripRemovesExtraSymbols() { - assertEquals(BANNED_TEST_EXPECTED, HeaderUtil.stripHeaderValue(VALUE_BANNED_SYMBOLS_TEST)); - } - - @Test - public void nameStripRemovesExtraSymbols() { - assertEquals(BANNED_TEST_EXPECTED, HeaderUtil.stripHeaderName(NAME_BANNED_SYMBOLS_TEST)); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/HeaderUtilTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/HeaderUtilTest.kt new file mode 100644 index 00000000000000..7696779d7d66c9 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/HeaderUtilTest.kt @@ -0,0 +1,74 @@ +/* + * 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.react.modules.network + +import org.junit.Assert.assertEquals +import org.junit.Test + +class HeaderUtilTest { + companion object { + const val TABULATION_TEST = "\teyJhbGciOiJS\t" + const val TABULATION_STRIP_EXPECTED = "eyJhbGciOiJS" + const val NUMBERS_TEST = "0123456789" + const val SPECIALS_TEST = "!@#$%^&*()-=_+{}[]\\|;:'\",.<>/?" + const val ALPHABET_TEST = "abcdefghijklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWHYZ" + const val VALUE_BANNED_SYMBOLS_TEST = "���name�����������\u007f\u001f" + const val NAME_BANNED_SYMBOLS_TEST = "���name�����������\u007f\u0020\u001f" + const val BANNED_TEST_EXPECTED = "name" + } + + @Test + fun nameStripKeepsLetters() { + assertEquals(ALPHABET_TEST, HeaderUtil.stripHeaderName(ALPHABET_TEST)) + } + + @Test + fun valueStripKeepsLetters() { + assertEquals(ALPHABET_TEST, HeaderUtil.stripHeaderValue(ALPHABET_TEST)) + } + + @Test + fun nameStripKeepsNumbers() { + assertEquals(NUMBERS_TEST, HeaderUtil.stripHeaderName(NUMBERS_TEST)) + } + + @Test + fun valueStripKeepsNumbers() { + assertEquals(NUMBERS_TEST, HeaderUtil.stripHeaderValue(NUMBERS_TEST)) + } + + @Test + fun valueStripKeepsSpecials() { + assertEquals(SPECIALS_TEST, HeaderUtil.stripHeaderValue(SPECIALS_TEST)) + } + + @Test + fun nameStripKeepsSpecials() { + assertEquals(SPECIALS_TEST, HeaderUtil.stripHeaderName(SPECIALS_TEST)) + } + + @Test + fun valueStripKeepsTabs() { + assertEquals(TABULATION_TEST, HeaderUtil.stripHeaderValue(TABULATION_TEST)) + } + + @Test + fun nameStripDeletesTabs() { + assertEquals(TABULATION_STRIP_EXPECTED, HeaderUtil.stripHeaderName(TABULATION_TEST)) + } + + @Test + fun valueStripRemovesExtraSymbols() { + assertEquals(BANNED_TEST_EXPECTED, HeaderUtil.stripHeaderValue(VALUE_BANNED_SYMBOLS_TEST)) + } + + @Test + fun nameStripRemovesExtraSymbols() { + assertEquals(BANNED_TEST_EXPECTED, HeaderUtil.stripHeaderName(NAME_BANNED_SYMBOLS_TEST)) + } +} From b46992de8a45d8ba9d3ba7dc1c010524ce6a2cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Tue, 13 Jun 2023 16:36:04 -0700 Subject: [PATCH 142/468] Type mock.contexts correctly in Jest (#37847) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37847 Jest supports accessing the contexts used to call mock functions (the `this` value) but we're not typing that correctly in the definitions in React Native. This changes that. Changelog: [internal] Reviewed By: javache Differential Revision: D46684043 fbshipit-source-id: ff121e0726748788591e7d061a39fde238c1ddbe --- packages/react-native/flow/jest.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/flow/jest.js b/packages/react-native/flow/jest.js index 5f42ea1358f404..505dd3fc1638e2 100644 --- a/packages/react-native/flow/jest.js +++ b/packages/react-native/flow/jest.js @@ -38,6 +38,10 @@ type JestMockFn, TReturn> = { * instantiated from this mock function. */ instances: Array, + /** + * An array that contains the contexts for all calls of the mock function. + */ + contexts: Array, /** * An array that contains all the object results that have been * returned by this mock function call From a53e81ead9577ab8cc3cf39eea4a0ae153793e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Tue, 13 Jun 2023 16:36:04 -0700 Subject: [PATCH 143/468] Define FabricUIManager as an interface instead of as an object (#37849) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37849 The typing for `FabricUIManager` makes more sense as an interface (the same way we type native modules) than as an object, as the underlying implementation used to be a host object where properties were actually not enumerable, etc. This replaces that with a definition more aligned with how we actually use it. This also allows us to extend the mock with testing specific methods more easily (like in D45278720). Changelog: [internal] Reviewed By: javache Differential Revision: D46684044 fbshipit-source-id: 379cc3f95a7cbae733ed6a3a57e68b33efd21d34 --- .../Libraries/ReactNative/FabricUIManager.js | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/packages/react-native/Libraries/ReactNative/FabricUIManager.js b/packages/react-native/Libraries/ReactNative/FabricUIManager.js index dbdd96cae7fe9a..ad6c089b78fe02 100644 --- a/packages/react-native/Libraries/ReactNative/FabricUIManager.js +++ b/packages/react-native/Libraries/ReactNative/FabricUIManager.js @@ -24,55 +24,55 @@ import defineLazyObjectProperty from '../Utilities/defineLazyObjectProperty'; export type NodeSet = Array; export type NodeProps = {...}; -export type Spec = {| +export interface Spec { +createNode: ( reactTag: number, viewName: string, rootTag: RootTag, props: NodeProps, instanceHandle: InternalInstanceHandle, - ) => Node, - +cloneNode: (node: Node) => Node, - +cloneNodeWithNewChildren: (node: Node) => Node, - +cloneNodeWithNewProps: (node: Node, newProps: NodeProps) => Node, - +cloneNodeWithNewChildrenAndProps: (node: Node, newProps: NodeProps) => Node, - +createChildSet: (rootTag: RootTag) => NodeSet, - +appendChild: (parentNode: Node, child: Node) => Node, - +appendChildToSet: (childSet: NodeSet, child: Node) => void, - +completeRoot: (rootTag: RootTag, childSet: NodeSet) => void, - +measure: (node: Node, callback: MeasureOnSuccessCallback) => void, + ) => Node; + +cloneNode: (node: Node) => Node; + +cloneNodeWithNewChildren: (node: Node) => Node; + +cloneNodeWithNewProps: (node: Node, newProps: NodeProps) => Node; + +cloneNodeWithNewChildrenAndProps: (node: Node, newProps: NodeProps) => Node; + +createChildSet: (rootTag: RootTag) => NodeSet; + +appendChild: (parentNode: Node, child: Node) => Node; + +appendChildToSet: (childSet: NodeSet, child: Node) => void; + +completeRoot: (rootTag: RootTag, childSet: NodeSet) => void; + +measure: (node: Node, callback: MeasureOnSuccessCallback) => void; +measureInWindow: ( node: Node, callback: MeasureInWindowOnSuccessCallback, - ) => void, + ) => void; +measureLayout: ( node: Node, relativeNode: Node, onFail: () => void, onSuccess: MeasureLayoutOnSuccessCallback, - ) => void, + ) => void; +configureNextLayoutAnimation: ( config: LayoutAnimationConfig, callback: () => void, // check what is returned here errorCallback: () => void, - ) => void, - +sendAccessibilityEvent: (node: Node, eventType: string) => void, - +findShadowNodeByTag_DEPRECATED: (reactTag: number) => ?Node, - +setNativeProps: (node: Node, newProps: NodeProps) => void, + ) => void; + +sendAccessibilityEvent: (node: Node, eventType: string) => void; + +findShadowNodeByTag_DEPRECATED: (reactTag: number) => ?Node; + +setNativeProps: (node: Node, newProps: NodeProps) => void; +dispatchCommand: ( node: Node, commandName: string, args: Array, - ) => void, + ) => void; /** * Support methods for the DOM-compatible APIs. */ - +getParentNode: (node: Node) => ?InternalInstanceHandle, - +getChildNodes: (node: Node) => $ReadOnlyArray, - +isConnected: (node: Node) => boolean, - +compareDocumentPosition: (node: Node, otherNode: Node) => number, - +getTextContent: (node: Node) => string, + +getParentNode: (node: Node) => ?InternalInstanceHandle; + +getChildNodes: (node: Node) => $ReadOnlyArray; + +isConnected: (node: Node) => boolean; + +compareDocumentPosition: (node: Node, otherNode: Node) => number; + +getTextContent: (node: Node) => string; +getBoundingClientRect: ( node: Node, ) => ?[ @@ -80,18 +80,18 @@ export type Spec = {| /* y: */ number, /* width: */ number, /* height: */ number, - ], + ]; +getOffset: ( node: Node, ) => ?[ /* offsetParent: */ InternalInstanceHandle, /* offsetTop: */ number, /* offsetLeft: */ number, - ], + ]; +getScrollPosition: ( node: Node, - ) => ?[/* scrollLeft: */ number, /* scrollTop: */ number], -|}; + ) => ?[/* scrollLeft: */ number, /* scrollTop: */ number]; +} let nativeFabricUIManagerProxy: ?Spec; @@ -154,6 +154,7 @@ function createProxyWithCachedProperties( const proxy = Object.create(implementation); for (const propertyName of propertiesToCache) { defineLazyObjectProperty(proxy, propertyName, { + // $FlowExpectedError[prop-missing] get: () => implementation[propertyName], }); } From 9e50185d97a4fdd467654e9f99c022e7b46ac857 Mon Sep 17 00:00:00 2001 From: Vincent Riemer Date: Tue, 13 Jun 2023 16:39:08 -0700 Subject: [PATCH 144/468] Back out "Add plumbing/boilerplate for an iOS implementation of the `gotpointercapture` and `lostpointercapture` events" (#37861) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37861 Changelog: [Internal] - Back out of "Add plumbing/boilerplate for an iOS implementation of the `gotpointercapture` and `lostpointercapture` events" Original commit changeset: c9da5691d399 Original Phabricator Diff: D44977499 This diff appears to be causing issues as reported on T155721480 related to the file `RawPropsKeyMap.cpp` which, while I haven't figured out exactly why this is occurring, confirmed that this diff is causing the issue. In order to buy myself some more time as I diagnose this I'm backing the changes out in this diff. Reviewed By: adanoff Differential Revision: D46691035 fbshipit-source-id: 383b46732a3fad24a50e18ab948c96ce9bfe429e --- .../Components/View/ViewPropTypes.js | 2 - .../NativeComponent/BaseViewConfig.ios.js | 14 ------ packages/react-native/React/Views/RCTView.h | 2 - .../react-native/React/Views/RCTViewManager.m | 2 - .../components/view/TouchEventEmitter.cpp | 16 ------- .../components/view/TouchEventEmitter.h | 2 - .../renderer/components/view/primitives.h | 4 -- .../components/view/propsConversions.h | 24 ---------- .../PointerEventCaptureMouse.js | 44 +++++++++---------- 9 files changed, 22 insertions(+), 88 deletions(-) diff --git a/packages/react-native/Libraries/Components/View/ViewPropTypes.js b/packages/react-native/Libraries/Components/View/ViewPropTypes.js index 06672257cc73e6..1a37bd3206b286 100644 --- a/packages/react-native/Libraries/Components/View/ViewPropTypes.js +++ b/packages/react-native/Libraries/Components/View/ViewPropTypes.js @@ -105,8 +105,6 @@ type PointerEventProps = $ReadOnly<{| onPointerOverCapture?: ?(e: PointerEvent) => void, onPointerOut?: ?(e: PointerEvent) => void, onPointerOutCapture?: ?(e: PointerEvent) => void, - onGotPointerCapture?: ?(e: PointerEvent) => void, - onLostPointerCapture?: ?(e: PointerEvent) => void, |}>; type FocusEventProps = $ReadOnly<{| diff --git a/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js b/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js index 92b2959aad14d6..bb13443bf44a2d 100644 --- a/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js +++ b/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js @@ -144,18 +144,6 @@ const bubblingEventTypes = { bubbled: 'onPointerOut', }, }, - topGotPointerCapture: { - phasedRegistrationNames: { - captured: 'onGotPointerCaptureCapture', - bubbled: 'onGotPointerCapture', - }, - }, - topLostPointerCapture: { - phasedRegistrationNames: { - captured: 'onLostPointerCaptureCapture', - bubbled: 'onLostPointerCapture', - }, - }, }; const directEventTypes = { @@ -378,8 +366,6 @@ const validAttributesForEventProps = ConditionallyIgnoredEventHandlers({ onPointerLeave: true, onPointerOver: true, onPointerOut: true, - onGotPointerCapture: true, - onLostPointerCapture: true, }); /** diff --git a/packages/react-native/React/Views/RCTView.h b/packages/react-native/React/Views/RCTView.h index 200d8b451bf59e..fc5e2217cf5266 100644 --- a/packages/react-native/React/Views/RCTView.h +++ b/packages/react-native/React/Views/RCTView.h @@ -132,7 +132,5 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait; @property (nonatomic, assign) RCTCapturingEventBlock onPointerLeave; @property (nonatomic, assign) RCTBubblingEventBlock onPointerOver; @property (nonatomic, assign) RCTBubblingEventBlock onPointerOut; -@property (nonatomic, assign) RCTBubblingEventBlock onGotPointerCapture; -@property (nonatomic, assign) RCTBubblingEventBlock onLostPointerCapture; @end diff --git a/packages/react-native/React/Views/RCTViewManager.m b/packages/react-native/React/Views/RCTViewManager.m index eb3ff9c00d882e..9a0af4e74cecb9 100644 --- a/packages/react-native/React/Views/RCTViewManager.m +++ b/packages/react-native/React/Views/RCTViewManager.m @@ -549,7 +549,5 @@ - (void)updateAccessibilityTraitsForRole:(RCTView *)view withDefaultView:(RCTVie RCT_EXPORT_VIEW_PROPERTY(onPointerLeave, RCTCapturingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onPointerOver, RCTBubblingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onPointerOut, RCTBubblingEventBlock) -RCT_EXPORT_VIEW_PROPERTY(onGotPointerCapture, RCTBubblingEventBlock) -RCT_EXPORT_VIEW_PROPERTY(onLostPointerCapture, RCTBubblingEventBlock) @end diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp index d0c4fc399c2cd5..747dedcf7dd3ae 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp @@ -223,20 +223,4 @@ void TouchEventEmitter::onPointerOut(const PointerEvent &event) const { RawEvent::Category::ContinuousStart); } -void TouchEventEmitter::onGotPointerCapture(const PointerEvent &event) const { - dispatchPointerEvent( - "gotPointerCapture", - event, - EventPriority::AsynchronousBatched, - RawEvent::Category::ContinuousStart); -} - -void TouchEventEmitter::onLostPointerCapture(const PointerEvent &event) const { - dispatchPointerEvent( - "lostPointerCapture", - event, - EventPriority::AsynchronousBatched, - RawEvent::Category::ContinuousEnd); -} - } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h index ef2e11b95481a7..ad42dfa7674eac 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h @@ -38,8 +38,6 @@ class TouchEventEmitter : public EventEmitter { void onPointerLeave(PointerEvent const &event) const; void onPointerOver(PointerEvent const &event) const; void onPointerOut(PointerEvent const &event) const; - void onGotPointerCapture(PointerEvent const &event) const; - void onLostPointerCapture(PointerEvent const &event) const; private: void dispatchTouchEvent( diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h b/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h index 70ebe7f2d920e4..04daf6e3367070 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h @@ -60,10 +60,6 @@ struct ViewEvents { PointerOutCapture = 29, Click = 30, ClickCapture = 31, - GotPointerCapture = 32, - GotPointerCaptureCapture = 33, - LostPointerCapture = 34, - LostPointerCaptureCapture = 35, }; constexpr bool operator[](const Offset offset) const { diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h b/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h index 0139cd25202205..704a00f404c6c9 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h @@ -616,30 +616,6 @@ static inline ViewEvents convertRawProp( "onClickCapture", sourceValue[Offset::ClickCapture], defaultValue[Offset::ClickCapture]); - result[Offset::GotPointerCapture] = convertRawProp( - context, - rawProps, - "onGotPointerCapture", - sourceValue[Offset::GotPointerCapture], - defaultValue[Offset::GotPointerCapture]); - result[Offset::GotPointerCaptureCapture] = convertRawProp( - context, - rawProps, - "onGotPointerCaptureCapture", - sourceValue[Offset::GotPointerCaptureCapture], - defaultValue[Offset::GotPointerCaptureCapture]); - result[Offset::LostPointerCapture] = convertRawProp( - context, - rawProps, - "onLostPointerCapture", - sourceValue[Offset::LostPointerCapture], - defaultValue[Offset::LostPointerCapture]); - result[Offset::LostPointerCaptureCapture] = convertRawProp( - context, - rawProps, - "onLostPointerCaptureCapture", - sourceValue[Offset::LostPointerCaptureCapture], - defaultValue[Offset::LostPointerCaptureCapture]); // PanResponder callbacks result[Offset::MoveShouldSetResponder] = convertRawProp( diff --git a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js index 680cbb259e8202..7ce1b6bf894f66 100644 --- a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js +++ b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js @@ -32,12 +32,12 @@ function PointerEventCaptureMouseTestCase( const pointermoveNoCaptureGot1Ref = useRef(false); const ownEventForTheCapturedTargetGotRef = useRef(false); - const testGotPointerCapture = harness.useAsyncTest( - 'gotpointercapture event received"', - ); - const testLostPointerCapture = harness.useAsyncTest( - 'lostpointercapture event received"', - ); + // const testGotPointerCapture = harness.useAsyncTest( + // 'gotpointercapture event received"', + // ); + // const testLostPointerCapture = harness.useAsyncTest( + // 'lostpointercapture event received"', + // ); const handleCaptureButtonDown = useCallback((evt: PointerEvent) => { const target0 = target0Ref.current; @@ -50,20 +50,20 @@ function PointerEventCaptureMouseTestCase( } }, []); - const handleTarget0GotPointerCapture = useCallback( - (evt: PointerEvent) => { - testGotPointerCapture.done(); - }, - [testGotPointerCapture], - ); - - const handleTarget0LostPointerCapture = useCallback( - (evt: PointerEvent) => { - testLostPointerCapture.done(); - isPointerCaptureRef.current = false; - }, - [testLostPointerCapture], - ); + // const handleTarget0GotPointerCapture = useCallback( + // (evt: PointerEvent) => { + // testGotPointerCapture.done(); + // }, + // [testGotPointerCapture], + // ); + + // const handleTarget0LostPointerCapture = useCallback( + // (evt: PointerEvent) => { + // testLostPointerCapture.done(); + // isPointerCaptureRef.current = false; + // }, + // [testLostPointerCapture], + // ); const testPointerMove0 = harness.useAsyncTest( 'pointerover event for black rectangle received', @@ -150,8 +150,8 @@ function PointerEventCaptureMouseTestCase( From 0c520e0f4311714ec26ef85b64f8083b09f7be87 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 13 Jun 2023 17:00:20 -0700 Subject: [PATCH 145/468] Back out "Move BridgelessReactPackage to com.facebook.react package" Summary: Original commit changeset: ac172d22a6d7 Original Phabricator Diff: D46408934 bypass-github-export-checks changelog: [internal] internal Reviewed By: NickGerleman Differential Revision: D46699758 fbshipit-source-id: aa428924eff28e188f963c84c5b7d3a036b9ccf7 --- .../react/BridgelessReactPackage.java | 70 ------------------- 1 file changed, 70 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java deleted file mode 100644 index 97d24ec0ed8aa5..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java +++ /dev/null @@ -1,70 +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.react; - -import com.facebook.infer.annotation.Nullsafe; -import com.facebook.react.bridge.NativeModule; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.devsupport.LogBoxModule; -import com.facebook.react.devsupport.interfaces.DevSupportManager; -import com.facebook.react.module.annotations.ReactModuleList; -import com.facebook.react.module.model.ReactModuleInfoProvider; -import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; -import com.facebook.react.modules.core.DeviceEventManagerModule; -import com.facebook.react.modules.debug.DevSettingsModule; -import com.facebook.react.modules.debug.SourceCodeModule; -import com.facebook.react.modules.deviceinfo.DeviceInfoModule; -import com.facebook.react.modules.systeminfo.AndroidInfoModule; - -@Nullsafe(Nullsafe.Mode.LOCAL) -@ReactModuleList( - nativeModules = { - AndroidInfoModule.class, - DeviceInfoModule.class, - DevSettingsModule.class, - SourceCodeModule.class, - LogBoxModule.class, - DeviceEventManagerModule.class, - }) -public class BridgelessReactPackage extends TurboReactPackage { - - private DevSupportManager mDevSupportManager; - private DefaultHardwareBackBtnHandler mHardwareBackBtnHandler; - - public BridgelessReactPackage( - DevSupportManager devSupportManager, DefaultHardwareBackBtnHandler hardwareBackBtnHandler) { - mDevSupportManager = devSupportManager; - mHardwareBackBtnHandler = hardwareBackBtnHandler; - } - - @Override - public NativeModule getModule(String name, ReactApplicationContext reactContext) { - switch (name) { - case AndroidInfoModule.NAME: - return new AndroidInfoModule(reactContext); - case DeviceInfoModule.NAME: - return new DeviceInfoModule(reactContext); - case SourceCodeModule.NAME: - return new SourceCodeModule(reactContext); - case DevSettingsModule.NAME: - return new DevSettingsModule(reactContext, mDevSupportManager); - case DeviceEventManagerModule.NAME: - return new DeviceEventManagerModule(reactContext, mHardwareBackBtnHandler); - case LogBoxModule.NAME: - return new LogBoxModule(reactContext, mDevSupportManager); - default: - throw new IllegalArgumentException( - "In BridgelessReactPackage, could not find Native module for " + name); - } - } - - @Override - public ReactModuleInfoProvider getReactModuleInfoProvider() { - return new BridgelessReactPackage$$ReactModuleInfoProvider(); - } -} From c870a529fe78ea1cc780f6b7c6f1b0940f4eb8df Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Tue, 13 Jun 2023 18:33:55 -0700 Subject: [PATCH 146/468] Trigger rerender on animation complete (#37836) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37836 When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect. Prior diffs ensure that upon completion of natively driven animations, the final values are synced to the JS side AnimatedValue nodes. In this diff, on completion of a natively driven animation, AnimatedProps.update() is called, which in turn calls the value update callback on AnimatedProps, which [triggers a rerender (via setState)](https://www.internalfb.com/code/fbsource/[566daad5db45807260a8af1f85385ca86aebf894]/xplat/js/react-native-github/packages/react-native/Libraries/Animated/useAnimatedProps.js?lines=80) which has the effect of pushing the latest animated values to Fabric. Alternative considered was using setNativeProps, but that approach was dropped as setNativeProps was only introduced to make migration easier and should not be used for new code, as per sammy-SC. Changelog: [General][Fixed] - When animating using native driver, trigger rerender on animation completion in order to update Pressability responder regions Reviewed By: javache Differential Revision: D46655246 fbshipit-source-id: b008c24f9d016be4b145ba799fffae5f55fab787 --- .../Animated/__tests__/AnimatedNative-test.js | 26 ++++++++----------- .../Animated/animations/Animation.js | 23 ++++++++++++++++ .../Animated/animations/DecayAnimation.js | 9 +++++++ .../Animated/animations/SpringAnimation.js | 8 ++++++ .../Animated/animations/TimingAnimation.js | 8 ++++++ .../Libraries/Animated/useAnimatedProps.js | 10 +++---- 6 files changed, 62 insertions(+), 22 deletions(-) diff --git a/packages/react-native/Libraries/Animated/__tests__/AnimatedNative-test.js b/packages/react-native/Libraries/Animated/__tests__/AnimatedNative-test.js index 23e6a2123ddf8d..d331d283029c51 100644 --- a/packages/react-native/Libraries/Animated/__tests__/AnimatedNative-test.js +++ b/packages/react-native/Libraries/Animated/__tests__/AnimatedNative-test.js @@ -1027,21 +1027,17 @@ describe('Native Animated', () => { }).start(); jest.runAllTimers(); - Animated.timing(opacity, { - toValue: 4, - duration: 500, - useNativeDriver: false, - }).start(); - try { - process.env.NODE_ENV = 'development'; - expect(jest.runAllTimers).toThrow( - 'Attempting to run JS driven animation on animated node that has ' + - 'been moved to "native" earlier by starting an animation with ' + - '`useNativeDriver: true`', - ); - } finally { - process.env.NODE_ENV = 'test'; - } + expect( + Animated.timing(opacity, { + toValue: 4, + duration: 500, + useNativeDriver: false, + }).start, + ).toThrow( + 'Attempting to run JS driven animation on animated node that has ' + + 'been moved to "native" earlier by starting an animation with ' + + '`useNativeDriver: true`', + ); }); it('fails for unsupported styles', () => { diff --git a/packages/react-native/Libraries/Animated/animations/Animation.js b/packages/react-native/Libraries/Animated/animations/Animation.js index 6a14a87fabde3e..ad956cd79d9d6d 100644 --- a/packages/react-native/Libraries/Animated/animations/Animation.js +++ b/packages/react-native/Libraries/Animated/animations/Animation.js @@ -11,9 +11,11 @@ 'use strict'; import type {PlatformConfig} from '../AnimatedPlatformConfig'; +import type AnimatedNode from '../nodes/AnimatedNode'; import type AnimatedValue from '../nodes/AnimatedValue'; import NativeAnimatedHelper from '../NativeAnimatedHelper'; +import AnimatedProps from '../nodes/AnimatedProps'; export type EndResult = {finished: boolean, value?: number, ...}; export type EndCallback = (result: EndResult) => void; @@ -65,6 +67,21 @@ export default class Animation { onEnd && onEnd(result); } + __findAnimatedPropsNodes(node: AnimatedNode): Array { + const result = []; + + if (node instanceof AnimatedProps) { + result.push(node); + return result; + } + + for (const child of node.__getChildren()) { + result.push(...this.__findAnimatedPropsNodes(child)); + } + + return result; + } + __startNativeAnimation(animatedValue: AnimatedValue): void { const startNativeAnimationWaitId = `${startNativeAnimationNextId}:startAnimation`; startNativeAnimationNextId += 1; @@ -88,6 +105,12 @@ export default class Animation { const {value} = result; if (value != null) { animatedValue.__onAnimatedValueUpdateReceived(value); + + // Once the JS side node is synced with the updated values, trigger an + // update on the AnimatedProps nodes to call any registered callbacks. + this.__findAnimatedPropsNodes(animatedValue).forEach(node => + node.update(), + ); } }, ); diff --git a/packages/react-native/Libraries/Animated/animations/DecayAnimation.js b/packages/react-native/Libraries/Animated/animations/DecayAnimation.js index f0042c5881dead..cc6a37bfaa3418 100644 --- a/packages/react-native/Libraries/Animated/animations/DecayAnimation.js +++ b/packages/react-native/Libraries/Animated/animations/DecayAnimation.js @@ -85,6 +85,15 @@ export default class DecayAnimation extends Animation { this._onUpdate = onUpdate; this.__onEnd = onEnd; this._startTime = Date.now(); + + if (!this._useNativeDriver && animatedValue.__isNative === true) { + throw new Error( + 'Attempting to run JS driven animation on animated node ' + + 'that has been moved to "native" earlier by starting an ' + + 'animation with `useNativeDriver: true`', + ); + } + if (this._useNativeDriver) { this.__startNativeAnimation(animatedValue); } else { diff --git a/packages/react-native/Libraries/Animated/animations/SpringAnimation.js b/packages/react-native/Libraries/Animated/animations/SpringAnimation.js index 69101dab030e8f..49855295b473ed 100644 --- a/packages/react-native/Libraries/Animated/animations/SpringAnimation.js +++ b/packages/react-native/Libraries/Animated/animations/SpringAnimation.js @@ -221,6 +221,14 @@ export default class SpringAnimation extends Animation { } const start = () => { + if (!this._useNativeDriver && animatedValue.__isNative === true) { + throw new Error( + 'Attempting to run JS driven animation on animated node ' + + 'that has been moved to "native" earlier by starting an ' + + 'animation with `useNativeDriver: true`', + ); + } + if (this._useNativeDriver) { this.__startNativeAnimation(animatedValue); } else { diff --git a/packages/react-native/Libraries/Animated/animations/TimingAnimation.js b/packages/react-native/Libraries/Animated/animations/TimingAnimation.js index 5c0c3ce38144de..a32c7543c68ba4 100644 --- a/packages/react-native/Libraries/Animated/animations/TimingAnimation.js +++ b/packages/react-native/Libraries/Animated/animations/TimingAnimation.js @@ -112,6 +112,14 @@ export default class TimingAnimation extends Animation { this.__onEnd = onEnd; const start = () => { + if (!this._useNativeDriver && animatedValue.__isNative === true) { + throw new Error( + 'Attempting to run JS driven animation on animated node ' + + 'that has been moved to "native" earlier by starting an ' + + 'animation with `useNativeDriver: true`', + ); + } + // Animations that sometimes have 0 duration and sometimes do not // still need to use the native driver when duration is 0 so as to // not cause intermixed JS and native animations. diff --git a/packages/react-native/Libraries/Animated/useAnimatedProps.js b/packages/react-native/Libraries/Animated/useAnimatedProps.js index 865bddd8ca3cbe..bf3a6d140c97f9 100644 --- a/packages/react-native/Libraries/Animated/useAnimatedProps.js +++ b/packages/react-native/Libraries/Animated/useAnimatedProps.js @@ -66,7 +66,9 @@ export default function useAnimatedProps( // changes), but `setNativeView` already optimizes for that. node.setNativeView(instance); - // NOTE: This callback is only used by the JavaScript animation driver. + // NOTE: When using the JS animation driver, this callback is called on + // every animation frame. When using the native driver, this callback is + // called when the animation completes. onUpdateRef.current = () => { if ( process.env.NODE_ENV === 'test' || @@ -82,12 +84,6 @@ export default function useAnimatedProps( // $FlowIgnore[not-a-function] - Assume it's still a function. // $FlowFixMe[incompatible-use] instance.setNativeProps(node.__getAnimatedValue()); - } else { - throw new Error( - 'Attempting to run JS driven animation on animated node ' + - 'that has been moved to "native" earlier by starting an ' + - 'animation with `useNativeDriver: true`', - ); } }; From b03c5affdb570abca7620c33b4b31ad7512b1139 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 13 Jun 2023 20:27:17 -0700 Subject: [PATCH 147/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907899298431 Sandcastle Job Instance ID: 974117684 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46712473 fbshipit-source-id: 59819cf17e00294b9ca34f71a5a8675458f7795c --- .../I18n/strings/ar.lproj/Localizable.strings | 2 ++ .../I18n/strings/cs.lproj/Localizable.strings | 2 ++ .../I18n/strings/da.lproj/Localizable.strings | 2 ++ .../I18n/strings/de.lproj/Localizable.strings | 2 ++ .../I18n/strings/el.lproj/Localizable.strings | 2 ++ .../I18n/strings/en-GB.lproj/Localizable.strings | 2 ++ .../I18n/strings/en.lproj/Localizable.strings | 2 ++ .../I18n/strings/es-ES.lproj/Localizable.strings | 2 ++ .../I18n/strings/es.lproj/Localizable.strings | 2 ++ .../I18n/strings/fi.lproj/Localizable.strings | 2 ++ .../I18n/strings/fr.lproj/Localizable.strings | 2 ++ .../I18n/strings/he.lproj/Localizable.strings | 2 ++ .../I18n/strings/hi.lproj/Localizable.strings | 2 ++ .../I18n/strings/hr.lproj/Localizable.strings | 2 ++ .../I18n/strings/hu.lproj/Localizable.strings | 2 ++ .../I18n/strings/id.lproj/Localizable.strings | 2 ++ .../I18n/strings/it.lproj/Localizable.strings | 2 ++ .../I18n/strings/ja.lproj/Localizable.strings | 2 ++ .../I18n/strings/ko.lproj/Localizable.strings | 2 ++ .../I18n/strings/ms.lproj/Localizable.strings | 2 ++ .../I18n/strings/nb.lproj/Localizable.strings | 2 ++ .../I18n/strings/nl.lproj/Localizable.strings | 2 ++ .../I18n/strings/pl.lproj/Localizable.strings | 2 ++ .../I18n/strings/pt-PT.lproj/Localizable.strings | 2 ++ .../I18n/strings/pt.lproj/Localizable.strings | 2 ++ .../I18n/strings/ro.lproj/Localizable.strings | 2 ++ .../I18n/strings/ru.lproj/Localizable.strings | 2 ++ .../I18n/strings/sk.lproj/Localizable.strings | 2 ++ .../I18n/strings/sv.lproj/Localizable.strings | 2 ++ .../I18n/strings/th.lproj/Localizable.strings | 2 ++ .../I18n/strings/tr.lproj/Localizable.strings | 2 ++ .../I18n/strings/uk.lproj/Localizable.strings | 2 ++ .../I18n/strings/vi.lproj/Localizable.strings | 2 ++ .../strings/zh-Hans.lproj/Localizable.strings | 2 ++ .../strings/zh-Hant-HK.lproj/Localizable.strings | 2 ++ .../strings/zh-Hant.lproj/Localizable.strings | 2 ++ .../I18n/strings/zu.lproj/Localizable.strings | 2 ++ .../I18n/strings/zu.lproj/fbt_language_pack.bin | Bin 0 -> 2076 bytes 38 files changed, 74 insertions(+) create mode 100644 packages/react-native/React/I18n/strings/ar.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/cs.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/da.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/de.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/el.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/en-GB.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/en.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/es-ES.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/es.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/fi.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/fr.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/he.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/hi.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/hr.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/hu.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/id.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/it.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/ja.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/ko.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/ms.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/nb.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/nl.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/pl.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/pt-PT.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/pt.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/ro.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/ru.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/sk.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/sv.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/th.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/tr.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/uk.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/vi.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/zh-Hans.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/zh-Hant-HK.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/zh-Hant.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/zu.lproj/Localizable.strings create mode 100644 packages/react-native/React/I18n/strings/zu.lproj/fbt_language_pack.bin diff --git a/packages/react-native/React/I18n/strings/ar.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/ar.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/ar.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/cs.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/cs.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/cs.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/da.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/da.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/da.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/de.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/de.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/de.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/el.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/el.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/el.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/en-GB.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/en-GB.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/en-GB.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/en.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/en.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/en.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/es-ES.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/es-ES.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/es-ES.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/es.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/es.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/es.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/fi.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/fi.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/fi.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/fr.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/fr.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/fr.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/he.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/he.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/he.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/hi.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/hi.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/hi.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/hr.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/hr.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/hr.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/hu.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/hu.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/hu.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/id.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/id.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/id.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/it.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/it.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/it.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/ja.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/ja.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/ja.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/ko.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/ko.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/ko.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/ms.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/ms.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/ms.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/nb.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/nb.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/nb.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/nl.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/nl.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/nl.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/pl.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/pl.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/pl.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/pt-PT.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/pt-PT.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/pt-PT.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/pt.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/pt.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/pt.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/ro.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/ro.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/ro.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/ru.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/ru.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/ru.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/sk.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/sk.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/sk.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/sv.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/sv.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/sv.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/th.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/th.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/th.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/tr.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/tr.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/tr.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/uk.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/uk.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/uk.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/vi.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/vi.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/vi.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/zh-Hans.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/zh-Hans.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/zh-Hans.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/zh-Hant-HK.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/zh-Hant-HK.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/zh-Hant-HK.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/zh-Hant.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/zh-Hant.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/zh-Hant.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/zu.lproj/Localizable.strings b/packages/react-native/React/I18n/strings/zu.lproj/Localizable.strings new file mode 100644 index 00000000000000..f5e9186bea23f2 --- /dev/null +++ b/packages/react-native/React/I18n/strings/zu.lproj/Localizable.strings @@ -0,0 +1,2 @@ +// @generated SignedSource<<6c4053ad9f2da7cd9f9d1bc0789bd1e5>> + diff --git a/packages/react-native/React/I18n/strings/zu.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/zu.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..1bafad6fb4657eac1b8e54466927feac62371b1b GIT binary patch literal 2076 zcmaJ?J8x7+6rLmwi4cX0D59WPX(`BqWZsW-28S488^>VB0V0?=Gh^1?m-k@|qDa9{ zprD{gNs%%|iWDfy51^n-L6IU=loBZqa_;QC$S6`)`tIy^XTEdJoO5RGNkYiEGs|ly z$VvQ1NQ<1n=W+55KIh3X@-~?(Z$3nRugnl~_bpQ9AK^HU?|#Pd@b6tDKfFoE8e$&t zWR8&gh|7rMh+p0ym~9}$lb_YvP9x`-{rBBJ%@ix(Ik`3P|p2Hmb7 zj#F$~MU8MFip(G|?}FtZyw2JR=eQ7`u&>c?tvy|7Cxbz^75u2}nNyj$05l6=2_=ky z62eKesEsUA@}SnfU$mWG8nr{P!8@B%ipGItCIK^m?s*bkQC);jUh(NetJ@h*+BPtj zAtfWJHBnI?bP@(6&q;95apv>bU$ecQDn5N^Yp=M?PPvTx%@9QJ%s3%^woJt6XEL%_ z>prM-<6E5x+-!56a25KrlvAYwF4v&61}>?lMpe?gwT>3uu+wja>0~nKx4H6MYNKpc zF=iELj3NmEPG@GgoMjj5R_i}5dKh7KN`?i~+A$hsb}|}ecnA=TJzh}8(mG9wbusurSaq+IQrC_BD zE+-W=!HQm3=Z0gQjV#1*dq}QVYn1xWYMAHoLng4SZhl!`)(Rd+Mu}% zV61UoN$x2)2Anc!ld{%JS9A|+U5PbJ$G6)ca8l*~G6alQd6%rzKvmK--~pP&`n1-S z{G@}S??*hcQl-QNwJcM~qyQC?qu34J1e%b}wDT`!`z*2cItM5eG%}YM2%r{EpuyEt z35zy@kHXIqyHx8+J*R!RnP3;SJR5JBN|`6_y{9ZQE3mnY$$_)Fp7&~Pb)Q~sloEUl zl8G#FgOTNoI|mgV!%jBQ)MX)$Yi;SnSs&MjC`xZ2OXqCT76c0pa*`(VsFZZN-tS4g z&Hw*5SH1$(9a!>N;;Tw;l1W$w2;Q1tox%1qGUAN}!BI%{A+4@x#a*9HHx6F<`wG~l4GP=M{9yA- zb?)r$PQyowx7n`0Q>CZ)U%Iolb6KD1HJo?%{aRQP4UgT`?DpeE!-p4pt9$eyH9UXO z(+ju5=M6u-+g(_Y8&?|MUmq`REuTmGN6_CKJ_$Yv!OvnDf2w<;dbhf{WlMmN< Yu6(1b`QQJu_GqzLX^tYQHHYo|3x!J46951J literal 0 HcmV?d00001 From af4a0336e95ee3f9a43b96acfb09595c46e22fa4 Mon Sep 17 00:00:00 2001 From: jaroslawmichalik Date: Wed, 14 Jun 2023 02:07:53 -0700 Subject: [PATCH 148/468] Convert JavaOnlyArrayTest to Kotlin (#37855) Summary: Part of https://github.com/facebook/react-native/issues/37708 ## Changelog: [Internal] [Changed] - Convert JavaOnlyArrayTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37855 Reviewed By: cortinico Differential Revision: D46697501 Pulled By: rshest fbshipit-source-id: edc3906c41af4936eacdeb95502cc62f80ae89c8 --- .../react/bridge/JavaOnlyArrayTest.java | 37 ------------------- .../react/bridge/JavaOnlyArrayTest.kt | 29 +++++++++++++++ 2 files changed, 29 insertions(+), 37 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyArrayTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyArrayTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyArrayTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyArrayTest.java deleted file mode 100644 index 6421ae2a5985da..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyArrayTest.java +++ /dev/null @@ -1,37 +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.react.bridge; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.Test; - -/** Tests for {@link JavaOnlyArray} */ -public class JavaOnlyArrayTest { - - @Test - public void testGetType() throws Exception { - JavaOnlyArray values = - JavaOnlyArray.of(1, 2f, 3., "4", false, JavaOnlyArray.of(), JavaOnlyMap.of(), null); - ReadableType[] expectedTypes = - new ReadableType[] { - ReadableType.Number, - ReadableType.Number, - ReadableType.Number, - ReadableType.String, - ReadableType.Boolean, - ReadableType.Array, - ReadableType.Map, - ReadableType.Null - }; - - for (int i = 0; i < values.size(); i++) { - assertThat(values.getType(i)).isEqualTo(expectedTypes[i]); - } - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyArrayTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyArrayTest.kt new file mode 100644 index 00000000000000..46fbb1f67668d5 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/JavaOnlyArrayTest.kt @@ -0,0 +1,29 @@ +/* + * 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.react.bridge + +import org.assertj.core.api.Assertions.assertThat +import org.junit.Test + +/** Tests for [JavaOnlyArray] */ +class JavaOnlyArrayTest { + @Test + fun testGetType() { + val values = + JavaOnlyArray.of(1, 2f, 3.0, "4", false, JavaOnlyArray.of(), JavaOnlyMap.of(), null) + + assertThat(values.getType(0)).isEqualTo(ReadableType.Number) + assertThat(values.getType(1)).isEqualTo(ReadableType.Number) + assertThat(values.getType(2)).isEqualTo(ReadableType.Number) + assertThat(values.getType(3)).isEqualTo(ReadableType.String) + assertThat(values.getType(4)).isEqualTo(ReadableType.Boolean) + assertThat(values.getType(5)).isEqualTo(ReadableType.Array) + assertThat(values.getType(6)).isEqualTo(ReadableType.Map) + assertThat(values.getType(7)).isEqualTo(ReadableType.Null) + } +} From 06b2c7eb55fdea7eb4a78a7dd468a6f3d4250eb6 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 14 Jun 2023 04:52:51 -0700 Subject: [PATCH 149/468] translation auto-update for i18n/oculus-mirage.config.json on master Summary: Chronos Job Instance ID: 1125907899375459 Sandcastle Job Instance ID: 36028797991662582 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46722114 fbshipit-source-id: 9259e4403318f1cecd3fc1cf4ac145e7eaec3b63 --- .../src/main/res/views/uimanager/values-cs/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-da/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-de/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-el/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-en-rGB/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-es-rES/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-es/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-fi/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-fr/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-hu/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-it/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-iw/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ja/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ko/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-nb/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-nl/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-pl/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-pt-rPT/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-pt/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ro/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ru/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-sv/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-tr/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-vi/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-zh-rCN/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-zh-rHK/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-zh-rTW/strings.xml | 6 ++++++ 27 files changed, 162 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-en-rGB/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml new file mode 100644 index 00000000000000..b556b85f3bc390 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml new file mode 100644 index 00000000000000..1fd6723b3bae1f --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml new file mode 100644 index 00000000000000..b4629c93404814 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml new file mode 100644 index 00000000000000..0604fa12ac1e99 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-en-rGB/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-en-rGB/strings.xml new file mode 100644 index 00000000000000..49147780ee63b5 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-en-rGB/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml new file mode 100644 index 00000000000000..025a080a25a9f8 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml new file mode 100644 index 00000000000000..bfb1514177a8c5 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml new file mode 100644 index 00000000000000..7c49d51816ed44 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml new file mode 100644 index 00000000000000..64b98fc6a925f6 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml new file mode 100644 index 00000000000000..7c28e052110cd6 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml new file mode 100644 index 00000000000000..89dcf449cfb41d --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml new file mode 100644 index 00000000000000..dcca08e175b5d0 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml new file mode 100644 index 00000000000000..437a25fe2bea8f --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml new file mode 100644 index 00000000000000..ba310011f0d554 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml new file mode 100644 index 00000000000000..873742c208ac05 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml new file mode 100644 index 00000000000000..75355cf16bd979 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml new file mode 100644 index 00000000000000..4f53d3ec705bb8 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml new file mode 100644 index 00000000000000..a0d4564f7f0932 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml new file mode 100644 index 00000000000000..3a24466f7006cd --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml new file mode 100644 index 00000000000000..445f1af124553e --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml new file mode 100644 index 00000000000000..1105ec010ea037 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml new file mode 100644 index 00000000000000..2eed9288127946 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml new file mode 100644 index 00000000000000..755cf862c5eb9e --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml new file mode 100644 index 00000000000000..706622a3be9832 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml new file mode 100644 index 00000000000000..c50c06c1a71bf2 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml new file mode 100644 index 00000000000000..067865f00e1e61 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml new file mode 100644 index 00000000000000..c56baa9ccc27f0 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml @@ -0,0 +1,6 @@ + + + + + + From 7caa327643719f1aac02da9de9e406c085f40c9d Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 14 Jun 2023 04:52:51 -0700 Subject: [PATCH 150/468] translation auto-update for i18n/portal_workplacelive_on_portal.config.json on master Summary: Chronos Job Instance ID: 1125907899375459 Sandcastle Job Instance ID: 36028797991662582 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46722126 fbshipit-source-id: cbdaa8940a1743482f38e05d24b93371551cebd1 --- .../res/views/uimanager/values-fb/strings.xml | 31 +++++++++++++++++++ .../views/uimanager/values-fr-rCA/strings.xml | 6 ++++ 2 files changed, 37 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fb/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fb/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fb/strings.xml new file mode 100644 index 00000000000000..42769e25d7f3f7 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fb/strings.xml @@ -0,0 +1,31 @@ + + + + + + [Link#a31d26668a679e44a0843994a6744274:1] + [Image#d8aa55c15c7118a635092b092bcf1d33:1] + [Button, Image#2b5b423bf3daff8f8b188f5d5733ec14:1] + [Heading#03d19d231fd31bc5dae409f337e4fea3:1] + [Alert#f230077c00a8397fcc7138dfd8b37405:1] + [Combo Box#c399e5a30d2d764efcced424465cacc4:1] + [Menu#a2c49a9b7c94c31d6f53f5f59329a558:1] + [Menu Bar#9ede63b4972815fe4810781f1f15770c:1] + [Menu Item#ba3a1d642e7bfae7a60f57181ff5a91f:1] + [Progress Bar#fc1ee5dacc16eb35a88ca3aff9355683:1] + [Radio Group#382586bc34074311334bc929c63f69e4:1] + [Scroll Bar#8c5cb8c1bbbac0ed64bb63c240b9a415:1] + [Spin Button#8af18737c08f4adab8e7103876d29955:1] + [Tab#60c56bd22945b4d1532f474bfc568a66:1] + [Tab List#8daaf7f9316191f0e35f3ba31ed11aec:1] + [Timer#2f3aa4d3a05064a96945540d06072632:1] + [Tool Bar#13851684ac57a6612b478471e4894082:1] + [Summary#12f17d5316cde76d270ad4534e1d9f35:1] + [busy#c38a44fbc4bbf985a9e846c05e60b947:1] + [expanded#45ee23081f04143c5be90131a7b0e3c5:1] + [collapsed#850739bd3f1cb1a9b82c3a6f68399233:1] + [unselected#815cb61a1bc6c57ed0a65707d8c0c2d2:1] + [on#86ddae449e2a1cb3b1fc5fed82bfc660:1] + [off#f1ca5b210c9adef0fe7f14fe85ba521d:1] + [mixed#30d19e1c3c088ba70e30538143bad3a8:1] + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml new file mode 100644 index 00000000000000..d5fe3fb4a959d0 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml @@ -0,0 +1,6 @@ + + + + + + From d1f158b103fcaefc110afda9952f55cb36dc5d0b Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 14 Jun 2023 04:52:51 -0700 Subject: [PATCH 151/468] translation auto-update for i18n/pages-manager.config.json on master Summary: Chronos Job Instance ID: 1125907899375459 Sandcastle Job Instance ID: 36028797991662582 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46722113 fbshipit-source-id: 2c9ccb5614b51bc33f9915b441a4731b0cec4979 --- .../src/main/res/views/uimanager/values-af/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ar/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-bn/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-gu/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-hi/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-in/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-kn/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ml/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-mr/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ms/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-pa/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ta/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-te/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-th/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-tl/strings.xml | 6 ++++++ 15 files changed, 90 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bn/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ml/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml new file mode 100644 index 00000000000000..24e1b69fe6b4ef --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml new file mode 100644 index 00000000000000..9ee5b1218296dd --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bn/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bn/strings.xml new file mode 100644 index 00000000000000..b5d516623ef92f --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bn/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml new file mode 100644 index 00000000000000..2a2946b617eb63 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml new file mode 100644 index 00000000000000..3bca368f01586b --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml new file mode 100644 index 00000000000000..6d32bd7238156f --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml new file mode 100644 index 00000000000000..b4a93b39ff0be2 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ml/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ml/strings.xml new file mode 100644 index 00000000000000..5d568f33232987 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ml/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml new file mode 100644 index 00000000000000..ad239221c0e924 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml new file mode 100644 index 00000000000000..443eca7a57e1f8 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml new file mode 100644 index 00000000000000..ea45e686429267 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml new file mode 100644 index 00000000000000..f8bfd1c350e5e0 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml new file mode 100644 index 00000000000000..241b213130fe0a --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml new file mode 100644 index 00000000000000..a4206503879525 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml new file mode 100644 index 00000000000000..dadacb703c930c --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml @@ -0,0 +1,6 @@ + + + + + + From 994547a9f47a08f35c1e6ccf692fc4c5cd22c8b3 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 14 Jun 2023 04:52:51 -0700 Subject: [PATCH 152/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907899375459 Sandcastle Job Instance ID: 36028797991662582 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46722128 fbshipit-source-id: 18b2bfef14410db7655c9af8dfd102feafc395eb --- .../src/main/res/views/uimanager/values-bg/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-fa/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-hr/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-sk/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-sr/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-uk/strings.xml | 6 ++++++ 6 files changed, 36 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml new file mode 100644 index 00000000000000..09b7b31c671dab --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml new file mode 100644 index 00000000000000..72270d97102a7c --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml new file mode 100644 index 00000000000000..97250a3e1f6a4c --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml new file mode 100644 index 00000000000000..2d1768d211d54d --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml new file mode 100644 index 00000000000000..47782d7cf1000e --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml new file mode 100644 index 00000000000000..bf3cc46d1cb490 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml @@ -0,0 +1,6 @@ + + + + + + From 2eb6e975e1d80bcccead1a0d6259a83643573bf8 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 14 Jun 2023 04:52:51 -0700 Subject: [PATCH 153/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907899375459 Sandcastle Job Instance ID: 36028797991662582 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46722111 fbshipit-source-id: 867dec5275f09c568c8de2ea54ce7ceb5441c73e --- .../src/main/res/views/uimanager/values-as/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-az/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-be/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-bs/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ca/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-cb/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-et/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-hy/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-is/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-jv/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ka/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-kk/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-km/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ku/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ky/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-lo/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-lt/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-lv/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-mk/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-mn/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-my/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ne/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ps/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-qz/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-si/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-sl/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-sn/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-so/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-sq/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-sw/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-tg/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-tk/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-ur/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-uz/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-wo/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-zu/strings.xml | 6 ++++++ 36 files changed, 216 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-as/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-az/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-be/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bs/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ca/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cb/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hy/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-is/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-jv/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ka/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kk/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ku/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ky/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lo/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mn/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ne/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ps/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-qz/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sl/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sn/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-so/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tg/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tk/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uz/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-wo/strings.xml create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-as/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-as/strings.xml new file mode 100644 index 00000000000000..7224dbc28d87b8 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-as/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-az/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-az/strings.xml new file mode 100644 index 00000000000000..8d1df4784531c0 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-az/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-be/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-be/strings.xml new file mode 100644 index 00000000000000..ce84b2af7e3b2d --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-be/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bs/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bs/strings.xml new file mode 100644 index 00000000000000..6360c5c0799ee6 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bs/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ca/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ca/strings.xml new file mode 100644 index 00000000000000..d839c0b739be71 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ca/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cb/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cb/strings.xml new file mode 100644 index 00000000000000..89de99e2b6bf58 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cb/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml new file mode 100644 index 00000000000000..e17476d14d8823 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hy/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hy/strings.xml new file mode 100644 index 00000000000000..9fc19db9a6a210 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hy/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-is/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-is/strings.xml new file mode 100644 index 00000000000000..e4a30caa711f08 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-is/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-jv/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-jv/strings.xml new file mode 100644 index 00000000000000..5bc93b9a564110 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-jv/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ka/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ka/strings.xml new file mode 100644 index 00000000000000..1c2a251fabd607 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ka/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kk/strings.xml new file mode 100644 index 00000000000000..f2afa0349f18f9 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kk/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml new file mode 100644 index 00000000000000..d6ed5fadf8cf0f --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ku/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ku/strings.xml new file mode 100644 index 00000000000000..60ec646388c582 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ku/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ky/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ky/strings.xml new file mode 100644 index 00000000000000..8bdeee47c0d67f --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ky/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lo/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lo/strings.xml new file mode 100644 index 00000000000000..d35f4bd7efb9eb --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lo/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml new file mode 100644 index 00000000000000..c3177bbf23299d --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml new file mode 100644 index 00000000000000..a66be9d1d970c9 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml new file mode 100644 index 00000000000000..1c76e1bb07c64e --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mn/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mn/strings.xml new file mode 100644 index 00000000000000..2f27b04d30db45 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mn/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml new file mode 100644 index 00000000000000..65abfdbf7bd192 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ne/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ne/strings.xml new file mode 100644 index 00000000000000..47a8e78d014c40 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ne/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ps/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ps/strings.xml new file mode 100644 index 00000000000000..d86dbade5fa188 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ps/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-qz/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-qz/strings.xml new file mode 100644 index 00000000000000..57089df8cbebff --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-qz/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml new file mode 100644 index 00000000000000..2153d88a0669fb --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sl/strings.xml new file mode 100644 index 00000000000000..a8d2a680928b58 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sl/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sn/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sn/strings.xml new file mode 100644 index 00000000000000..ed69640542f946 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sn/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-so/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-so/strings.xml new file mode 100644 index 00000000000000..bf64cbaf06b979 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-so/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml new file mode 100644 index 00000000000000..a225539656b409 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml new file mode 100644 index 00000000000000..6dea5b85bb9a65 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tg/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tg/strings.xml new file mode 100644 index 00000000000000..330b5d77cf1e83 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tg/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tk/strings.xml new file mode 100644 index 00000000000000..abee0e9ebcd3f8 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tk/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml new file mode 100644 index 00000000000000..6d76f390ea068a --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uz/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uz/strings.xml new file mode 100644 index 00000000000000..9d4667fa9877e6 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uz/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-wo/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-wo/strings.xml new file mode 100644 index 00000000000000..b7de40359f547d --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-wo/strings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml new file mode 100644 index 00000000000000..44cf81d27ef227 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml @@ -0,0 +1,6 @@ + + + + + + From 406fb0edcf7d15ceb62329117a75efc796e2fa26 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 14 Jun 2023 04:52:51 -0700 Subject: [PATCH 154/468] translation auto-update for i18n/adsmanager.config.json on master Summary: Chronos Job Instance ID: 1125907899375459 Sandcastle Job Instance ID: 36028797991662582 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46722119 fbshipit-source-id: 4377e640f5e8337ac67734b4d6bf244a22c9c24e --- .../views/uimanager/values-fb-rLS/strings.xml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fb-rLS/strings.xml diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fb-rLS/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fb-rLS/strings.xml new file mode 100644 index 00000000000000..b36e207a5eff90 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fb-rLS/strings.xml @@ -0,0 +1,26 @@ + + + + + + Image \@\@\@ + Button, Image\@\@\@\@\@\@ + Heading \@\@\@ \@\@\@ + Combo Box \@\@\@ + Menu \@\@\@ + Menu Bar \@\@\@ + Menu Item\@\@\@\@\@\@ + Progress Bar\@\@\@\@\@\@ + Radio Group\@\@\@\@\@\@\@\@\@ + Scroll Bar\@\@\@\@\@\@\@\@\@ + Spin Button \@\@\@ \@\@\@ + Tab List\@\@\@ + Timer \@\@\@ + Tool Bar\@\@\@\@\@\@ + Summary\@\@\@\@\@\@ + expanded \@\@\@ \@\@\@ + collapsed \@\@\@ \@\@\@ \@\@\@ + unselected\@\@\@ + off \@\@\@ + mixed\@\@\@ + From 168f8a526ab85dacad9156f084fd5b7ce427a503 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 14 Jun 2023 04:52:51 -0700 Subject: [PATCH 155/468] translation auto-update for i18n/anna.config.json on master Summary: Chronos Job Instance ID: 1125907899375459 Sandcastle Job Instance ID: 36028797991662582 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46722124 fbshipit-source-id: 7f205866265c1a0fdf738a6ea64dc909293b6f85 --- .../src/main/res/views/uimanager/values-ha/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ha/strings.xml diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ha/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ha/strings.xml new file mode 100644 index 00000000000000..084b1b6aac0de0 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ha/strings.xml @@ -0,0 +1,6 @@ + + + + + + From af99a6890b84713d002fbbd872f10fe2e6304861 Mon Sep 17 00:00:00 2001 From: Ethan Gill Date: Wed, 14 Jun 2023 05:21:49 -0700 Subject: [PATCH 156/468] Update TODO task numbers for Binding.cpp (#37844) Summary: Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/37844 T132338609 (open) is the Android equivalent of T130208323 (closed) Reviewed By: javache, luluwu2032 Differential Revision: D46682202 fbshipit-source-id: 8fb5061367af8b62d2889ccbd5f3e90824d9302d --- .../ReactAndroid/src/main/jni/react/fabric/Binding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp index 713f8c8c18381f..3d880580d5cc46 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp @@ -440,7 +440,7 @@ void Binding::installFabricUIManager( toolbox.contextContainer = contextContainer; toolbox.componentRegistryFactory = componentsRegistry->buildRegistryFunction; - // TODO: (T130208323) runtimeExecutor should execute lambdas after + // TODO: (T132338609) runtimeExecutor should execute lambdas after // main bundle eval, and bindingsInstallExecutor should execute before. toolbox.bridgelessBindingsExecutor = std::nullopt; toolbox.runtimeExecutor = runtimeExecutor; From 31eb235a6add02836753a9f598900a7e1c412452 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Wed, 14 Jun 2023 07:44:51 -0700 Subject: [PATCH 157/468] Fix set-rn-version (#37854) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37854 Changelog: [Internal] - Fix `saveFiles` in set-rn-version, incorrect function invoke Reviewed By: NickGerleman Differential Revision: D46582168 fbshipit-source-id: 944e182a88a1aa79bbf47d36ef8395c21dfefb24 --- scripts/__tests__/set-rn-version-test.js | 1 - scripts/set-rn-version.js | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/__tests__/set-rn-version-test.js b/scripts/__tests__/set-rn-version-test.js index 5c83cb002ee945..019aef2a62da7f 100644 --- a/scripts/__tests__/set-rn-version-test.js +++ b/scripts/__tests__/set-rn-version-test.js @@ -156,7 +156,6 @@ describe('set-rn-version', () => { sedMock.mockReturnValueOnce({code: 0}); const filesToValidate = [ 'packages/react-native/package.json', - 'packages/react-native/ReactAndroid/gradle.properties', 'packages/react-native/template/package.json', ]; diff --git a/scripts/set-rn-version.js b/scripts/set-rn-version.js index 4081ee42afbb5c..189e882fb13ec3 100755 --- a/scripts/set-rn-version.js +++ b/scripts/set-rn-version.js @@ -155,14 +155,19 @@ function setReactNativeVersion(argVersion, dependencyVersions, buildType) { // Create tmp folder for copies of files to verify files have changed const filesToValidate = [ 'packages/react-native/package.json', - 'packages/react-native/ReactAndroid/gradle.properties', 'packages/react-native/template/package.json', ]; const tmpVersioningFolder = fs.mkdtempSync( path.join(os.tmpdir(), 'rn-set-version'), ); echo(`The tmp versioning folder is ${tmpVersioningFolder}`); - saveFiles(tmpVersioningFolder); + saveFiles( + [ + 'packages/react-native/package.json', + 'packages/react-native/template/package.json', + ], + tmpVersioningFolder, + ); setSource(version); setPackage(version, dependencyVersions); From be348528e6824d6a0d56fa32047a3fb95d68e97f Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Wed, 14 Jun 2023 07:44:51 -0700 Subject: [PATCH 158/468] Delete validation in set-rn-version (#37814) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37814 Changelog: [Internal] - deleting file validation, do we need this? Reviewed By: NickGerleman Differential Revision: D46584771 fbshipit-source-id: 69a8853872b2b1582318a2e65d9919e2b50b2475 --- scripts/__tests__/set-rn-version-test.js | 46 +----------------------- scripts/set-rn-version.js | 44 +---------------------- 2 files changed, 2 insertions(+), 88 deletions(-) diff --git a/scripts/__tests__/set-rn-version-test.js b/scripts/__tests__/set-rn-version-test.js index 019aef2a62da7f..d01ee595905939 100644 --- a/scripts/__tests__/set-rn-version-test.js +++ b/scripts/__tests__/set-rn-version-test.js @@ -7,7 +7,6 @@ * @format */ -const execMock = jest.fn(); const echoMock = jest.fn(); const catMock = jest.fn(); const sedMock = jest.fn(); @@ -16,23 +15,15 @@ const updateTemplatePackageMock = jest.fn(); jest .mock('shelljs', () => ({ - exec: execMock, echo: echoMock, cat: catMock, sed: sedMock, })) .mock('./../update-template-package', () => updateTemplatePackageMock) - .mock('./../scm-utils', () => ({ - saveFiles: jest.fn(), - })) - .mock('path', () => ({ - join: () => '../packages/react-native', - })) .mock('fs', () => ({ writeFileSync: writeFileSyncMock, mkdtempSync: () => './rn-set-version/', - })) - .mock('os'); + })); const setReactNativeVersion = require('../set-rn-version'); @@ -58,7 +49,6 @@ describe('set-rn-version', () => { } }); - execMock.mockReturnValueOnce({stdout: 'line1\nline2\nline3\n'}); sedMock.mockReturnValueOnce({code: 0}); const version = '0.81.0-nightly-29282302-abcd1234'; @@ -115,7 +105,6 @@ describe('set-rn-version', () => { return 'exports.version = {major: ${major}, minor: ${minor}, patch: ${patch}, prerelease: ${prerelease}}'; }); - execMock.mockReturnValueOnce({stdout: 'line1\nline2\nline3\n'}); sedMock.mockReturnValueOnce({code: 0}); const version = '0.81.0'; @@ -144,38 +133,5 @@ describe('set-rn-version', () => { expect(updateTemplatePackageMock).toHaveBeenCalledWith({ 'react-native': version, }); - expect(execMock.mock.calls[0][0]).toBe( - `diff -r ./rn-set-version/ . | grep '^[>]' | grep -c ${version} `, - ); - }); - - it('should fail validation', () => { - catMock.mockReturnValue('{}'); - - execMock.mockReturnValueOnce({stdout: 'line1\nline2\n'}); - sedMock.mockReturnValueOnce({code: 0}); - const filesToValidate = [ - 'packages/react-native/package.json', - 'packages/react-native/template/package.json', - ]; - - const version = '0.81.0'; - setReactNativeVersion(version, null, 'release'); - - expect(echoMock).toHaveBeenNthCalledWith( - 1, - 'The tmp versioning folder is ./rn-set-version/', - ); - - expect(echoMock).toHaveBeenNthCalledWith(2, 'WARNING:'); - - expect(echoMock.mock.calls[2][0]).toBe( - `Failed to update all the files: [${filesToValidate.join( - ', ', - )}] must have versions in them`, - ); - expect(echoMock.mock.calls[3][0]).toBe( - `These files already had version ${version} set.`, - ); }); }); diff --git a/scripts/set-rn-version.js b/scripts/set-rn-version.js index 189e882fb13ec3..836fa7d96f319d 100755 --- a/scripts/set-rn-version.js +++ b/scripts/set-rn-version.js @@ -10,12 +10,9 @@ 'use strict'; const fs = require('fs'); -const os = require('os'); -const path = require('path'); -const {cat, echo, exec, exit, sed} = require('shelljs'); +const {cat, echo, exit, sed} = require('shelljs'); const yargs = require('yargs'); const {parseVersion, validateBuildType} = require('./version-utils'); -const {saveFiles} = require('./scm-utils'); const updateTemplatePackage = require('./update-template-package'); const {applyPackageVersions} = require('./npm-utils'); @@ -152,23 +149,6 @@ function setReactNativeVersion(argVersion, dependencyVersions, buildType) { const version = parseVersion(argVersion, buildType); - // Create tmp folder for copies of files to verify files have changed - const filesToValidate = [ - 'packages/react-native/package.json', - 'packages/react-native/template/package.json', - ]; - const tmpVersioningFolder = fs.mkdtempSync( - path.join(os.tmpdir(), 'rn-set-version'), - ); - echo(`The tmp versioning folder is ${tmpVersioningFolder}`); - saveFiles( - [ - 'packages/react-native/package.json', - 'packages/react-native/template/package.json', - ], - tmpVersioningFolder, - ); - setSource(version); setPackage(version, dependencyVersions); @@ -179,28 +159,6 @@ function setReactNativeVersion(argVersion, dependencyVersions, buildType) { updateTemplatePackage(templateDependencyVersions); setGradle(version); - - // Validate changes - // We just do a git diff and check how many times version is added across files - const numberOfChangedLinesWithNewVersion = exec( - `diff -r ${tmpVersioningFolder} . | grep '^[>]' | grep -c ${version.version} `, - {silent: true}, - ).stdout.trim(); - - if (+numberOfChangedLinesWithNewVersion !== filesToValidate.length) { - // TODO: the logic that checks whether all the changes have been applied - // is missing several files. For example, it is not checking Ruby version nor that - // the Objecive-C files, the codegen and other files are properly updated. - // We are going to work on this in another PR. - echo('WARNING:'); - echo( - `Failed to update all the files: [${filesToValidate.join( - ', ', - )}] must have versions in them`, - ); - echo(`These files already had version ${version.version} set.`); - } - return; } From de6bfec82a1cb4b387bfe8a87b1f597f39572764 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 14 Jun 2023 07:46:07 -0700 Subject: [PATCH 159/468] Disable bitcode from Hermes (#37868) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37868 Thanks to the help of the community, we discovered that we can safely disable the bitcode setting in Hermes. Community testing reported that the tarball size get reduced from ~500 Mb to ~25 Mb, a x20 reduction ## Changelog: [iOS][Changed] - Disabled bitcode for Hermes prebuilts Reviewed By: dmytrorykun Differential Revision: D46704633 fbshipit-source-id: a6624110f27eb9f18e6b57ed28aa2f86804d45e7 --- .circleci/config.yml | 4 ++-- .../sdks/hermes-engine/utils/build-apple-framework.sh | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96523f6d3a1f91..933e062f9dbcae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,8 +60,8 @@ references: gems_cache_key: &gems_cache_key v1-gems-{{ checksum "Gemfile.lock" }} gradle_cache_key: &gradle_cache_key v1-gradle-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "packages/react-native/ReactAndroid/gradle.properties" }} hermes_workspace_cache_key: &hermes_workspace_cache_key v5-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }} - hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} - hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} + hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} + hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}-{{ checksum "packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh" }} hermes_linux_cache_key: &hermes_linux_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-linux-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} hermes_windows_cache_key: &hermes_windows_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-windows-{{ checksum "/Users/circleci/project/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v4-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }} diff --git a/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh b/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh index aab75e92ebfb22..429707c356c9f0 100755 --- a/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh +++ b/packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh @@ -52,13 +52,8 @@ function build_host_hermesc { # Utility function to configure an Apple framework function configure_apple_framework { - local enable_bitcode enable_debugger cmake_build_type + local enable_debugger cmake_build_type - if [[ $1 == iphoneos || $1 == catalyst ]]; then - enable_bitcode="true" - else - enable_bitcode="false" - fi if [[ $BUILD_TYPE == "Debug" ]]; then enable_debugger="true" else @@ -82,7 +77,7 @@ function configure_apple_framework { -DHERMES_ENABLE_LIBFUZZER:BOOLEAN=false \ -DHERMES_ENABLE_FUZZILLI:BOOLEAN=false \ -DHERMES_ENABLE_TEST_SUITE:BOOLEAN=false \ - -DHERMES_ENABLE_BITCODE:BOOLEAN="$enable_bitcode" \ + -DHERMES_ENABLE_BITCODE:BOOLEAN=false \ -DHERMES_BUILD_APPLE_FRAMEWORK:BOOLEAN=true \ -DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \ -DIMPORT_HERMESC:PATH="$IMPORT_HERMESC_PATH" \ From b3cc19ce64272749680915c31d3147ae15b27bf9 Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Wed, 14 Jun 2023 09:47:52 -0700 Subject: [PATCH 160/468] Add @Nullable annotations to ViewUtils (#37877) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37877 # Changelog: [Internal] - A quick follow-up to https://github.com/facebook/react-native/pull/37851 There was a suggestion to add `Nullable` annotations, but the change had already landed at that point, so putting up another one. Reviewed By: cortinico Differential Revision: D46721095 fbshipit-source-id: 7361dec852160126c861ee2b22db240e586cc452 --- .../facebook/react/views/common/ViewUtils.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/common/ViewUtils.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/common/ViewUtils.java index 65f1f3c4bb5f7f..a75abc5865e8e3 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/common/ViewUtils.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/common/ViewUtils.java @@ -8,6 +8,7 @@ package com.facebook.react.views.common; import android.view.View; +import androidx.annotation.Nullable; import com.facebook.react.R; /** Class containing static methods involving manipulations of Views */ @@ -19,9 +20,15 @@ public class ViewUtils { * @param view View to get the testId value for * @return the value of testId if defined for the view, otherwise null */ - public static String getTestId(View view) { - return view.getTag(R.id.react_test_id) instanceof String - ? (String) view.getTag(R.id.react_test_id) - : null; + public static @Nullable String getTestId(@Nullable View view) { + if (view == null) { + return null; + } + Object tag = view.getTag(R.id.react_test_id); + if (tag instanceof String) { + return (String) tag; + } else { + return null; + } } } From 332be0f0c84c48e0b0edd373636b0b5538fa3b2b Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 14 Jun 2023 10:10:16 -0700 Subject: [PATCH 161/468] download hermes-engine when the configuration change (#37850) Summary: Currently, we ask users to reinstall the pods using the `PRODUCTION` flag when they want to either profile their app or prepare a release. This way of working with the Release mode is not standard. One of the reason why we introduced it was to provide a different binary for Hermes and reinstalling the pods was the quickest way. With this change, we are deferring the decision on when Hermes should be installed for apps to the moment where the app is actually build by the system. These changes are not applied to Nightlies, when a specific tarball is passed to the cocoapods using the `HERMES_ENGINE_TARBALL_PATH` env var, and when hermes is built from source as in these scenarios we are usually not interested in building for Release. The system is also smart enough not to redownload the tarball if the configuration does not change. It assumes that the default configuration when the pods are installed for the first time is Debug. ## Changelog: [IOS] [CHANGED] - Download the right `hermes-engine` configuration at build time. Pull Request resolved: https://github.com/facebook/react-native/pull/37850 Test Plan: - CircleCI green for the Release template jobs - Tested locally modifying the `hermes-utils` to force specific versions. - Tested locally with RNTestProject Reviewed By: dmytrorykun Differential Revision: D46687390 Pulled By: cipolleschi fbshipit-source-id: 375406e0ab351a5d1f5d5146e724f5ed0cd77949 --- .gitignore | 1 + .../scripts/cocoapods/__tests__/utils-test.rb | 23 ++-- .../react-native/scripts/cocoapods/utils.rb | 4 +- .../sdks/hermes-engine/hermes-engine.podspec | 31 ++++-- .../sdks/hermes-engine/hermes-utils.rb | 38 ++++--- .../utils/replace_hermes_version.js | 104 ++++++++++++++++++ packages/rn-tester/Podfile.lock | 82 +++++++------- 7 files changed, 212 insertions(+), 71 deletions(-) create mode 100644 packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js diff --git a/.gitignore b/.gitignore index 491d740ad1a070..5f30b988d17c85 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ DerivedData *.xcuserstate project.xcworkspace **/.xcode.env.local +/poackages/react-native/sdks/downloads/ # Gradle /build/ diff --git a/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb index 44fb7c6c557b38..82209f2dc1d49e 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/utils-test.rb @@ -178,21 +178,26 @@ def test_hasPod_whenInstallerHasPod_returnTrue # Test - Set GCC Preprocessor Definition for React-hermes # # ======================================================== # - def test_SetGCCPreprocessorDefinitionForReactHermes_itSetsThePreprocessorForDebug + def test_SetGCCPreprocessorDefinitionForHermes_itSetsThePreprocessorForDebug # Arrange react_hermes_name = "React-hermes" react_core_name = "React-Core" - react_hermes_debug_config = BuildConfigurationMock.new("Debug") - react_hermes_release_config = BuildConfigurationMock.new("Release") - react_core_debug_config = BuildConfigurationMock.new("Debug") - react_core_release_config = BuildConfigurationMock.new("Release") - react_hermes_target = TargetMock.new(react_hermes_name, [react_hermes_debug_config, react_hermes_release_config]) - react_core_target = TargetMock.new(react_core_name, [react_core_debug_config, react_core_release_config]) + hermes_engine_name = "hermes-engine" + react_hermes_debug_config = BuildConfigurationMock.new("Debug") + react_hermes_release_config = BuildConfigurationMock.new("Release") + react_core_debug_config = BuildConfigurationMock.new("Debug") + react_core_release_config = BuildConfigurationMock.new("Release") + hermes_engine_debug_config = BuildConfigurationMock.new("Debug") + hermes_engine_release_config = BuildConfigurationMock.new("Release") + react_hermes_target = TargetMock.new(react_hermes_name, [react_hermes_debug_config, react_hermes_release_config]) + react_core_target = TargetMock.new(react_core_name, [react_core_debug_config, react_core_release_config]) + hermes_engine_target = TargetMock.new(hermes_engine_name, [hermes_engine_debug_config, hermes_engine_release_config]) installer = InstallerMock.new( :pod_target_installation_results => { react_hermes_name => TargetInstallationResultMock.new(react_hermes_target, react_hermes_target), react_core_name => TargetInstallationResultMock.new(react_core_target, react_core_target), + hermes_engine_name => TargetInstallationResultMock.new(hermes_engine_target, hermes_engine_target), } ) @@ -201,11 +206,13 @@ def test_SetGCCPreprocessorDefinitionForReactHermes_itSetsThePreprocessorForDebu # Assert build_setting = "GCC_PREPROCESSOR_DEFINITIONS" - expected_value = "HERMES_ENABLE_DEBUGGER=1" + expected_value = "$(inherited) HERMES_ENABLE_DEBUGGER=1" assert_equal(expected_value, react_hermes_debug_config.build_settings[build_setting]) assert_nil(react_hermes_release_config.build_settings[build_setting]) assert_nil(react_core_debug_config.build_settings[build_setting]) assert_nil(react_core_release_config.build_settings[build_setting]) + assert_equal(expected_value, hermes_engine_debug_config.build_settings[build_setting]) + assert_nil(hermes_engine_release_config.build_settings[build_setting]) end # ============================ # diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index 91c638f50afb4e..fc823b54e41393 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -41,6 +41,7 @@ def self.has_pod(installer, name) def self.set_gcc_preprocessor_definition_for_React_hermes(installer) self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-hermes", "Debug") + self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "hermes-engine", "Debug") end def self.turn_off_resource_bundle_react_core(installer) @@ -153,7 +154,8 @@ def self.add_build_settings_to_pod(installer, settings_name, settings_value, tar if pod_name.to_s == target_pod_name target_installation_result.native_target.build_configurations.each do |config| if configuration == nil || (configuration != nil && configuration == config.name) - config.build_settings[settings_name] = settings_value + config.build_settings[settings_name] ||= '$(inherited) ' + config.build_settings[settings_name] << settings_value end end end diff --git a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec index 5be0a8d49908f8..681cb2c4d234a6 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-engine.podspec +++ b/packages/react-native/sdks/hermes-engine/hermes-engine.podspec @@ -8,9 +8,6 @@ require_relative "./hermes-utils.rb" react_native_path = File.join(__dir__, "..", "..") -# Whether Hermes is built for Release or Debug is determined by the PRODUCTION envvar. -build_type = ENV['PRODUCTION'] == "1" ? :release : :debug - # package.json package = JSON.parse(File.read(File.join(react_native_path, "package.json"))) version = package['version'] @@ -23,7 +20,7 @@ git = "https://github.com/facebook/hermes.git" abort_if_invalid_tarball_provided! -source = compute_hermes_source(build_from_source, hermestag_file, git, version, build_type, react_native_path) +source = compute_hermes_source(build_from_source, hermestag_file, git, version, react_native_path) Pod::Spec.new do |spec| spec.name = "hermes-engine" @@ -42,7 +39,7 @@ Pod::Spec.new do |spec| spec.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", "CLANG_CXX_LIBRARY" => "compiler-default" - }.merge!(build_type == :debug ? { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } : {}) + } spec.ios.vendored_frameworks = "destroot/Library/Frameworks/ios/hermes.framework" spec.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework" @@ -50,7 +47,7 @@ Pod::Spec.new do |spec| if source[:http] then spec.subspec 'Pre-built' do |ss| - ss.preserve_paths = ["destroot/bin/*"].concat(build_type == :debug ? ["**/*.{h,c,cpp}"] : []) + ss.preserve_paths = ["destroot/bin/*"].concat(["**/*.{h,c,cpp}"]) ss.source_files = "destroot/include/**/*.h" ss.exclude_files = ["destroot/include/jsi/jsi/JSIDynamic.{h,cpp}", "destroot/include/jsi/jsi/jsilib-*.{h,cpp}"] ss.header_mappings_dir = "destroot/include" @@ -58,6 +55,24 @@ Pod::Spec.new do |spec| ss.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework" end + + # Right now, even reinstalling pods with the PRODUCTION flag turned on, does not change the version of hermes that is downloaded + # To remove the PRODUCTION flag, we want to download the right version of hermes on the flight + # we do so in a pre-build script we invoke from the Xcode build pipeline + # We use this only for Apps created using the template. RNTester and Nightlies should not be used to build for Release. + # We ignore this if we provide a specific tarball: the assumption here is that if you are providing a tarball, is because you want to + # test something specific for that tarball. + if source[:http].include?('https://repo1.maven.org/') + spec.script_phase = { + :name => "[Hermes] Replace Hermes for the right configuration, if needed", + :execution_position => :before_compile, + :script => <<-EOS + . "$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh" + "$NODE_BINARY" "$REACT_NATIVE_PATH/sdks/hermes-engine/utils/replace_hermes_version.js" -c "$CONFIGURATION" -r "#{version}" -p "$REACT_NATIVE_PATH" + EOS + } + end + elsif source[:git] then spec.subspec 'Hermes' do |ss| @@ -96,7 +111,7 @@ Pod::Spec.new do |spec| { :name => '[RN] [1] Build Hermesc', :script => <<-EOS - . ${PODS_ROOT}/../.xcode.env + . "${REACT_NATIVE_PATH}/scripts/xcode/with-environment.sh" export CMAKE_BINARY=${CMAKE_BINARY:-#{CMAKE_BINARY}} . ${REACT_NATIVE_PATH}/sdks/hermes-engine/utils/build-hermesc-xcode.sh #{hermesc_path} EOS @@ -104,7 +119,7 @@ Pod::Spec.new do |spec| { :name => '[RN] [2] Build Hermes', :script => <<-EOS - . ${PODS_ROOT}/../.xcode.env + . "${REACT_NATIVE_PATH}/scripts/xcode/with-environment.sh" export CMAKE_BINARY=${CMAKE_BINARY:-#{CMAKE_BINARY}} . ${REACT_NATIVE_PATH}/sdks/hermes-engine/utils/build-hermes-xcode.sh #{version} #{hermesc_path}/ImportHermesc.cmake EOS diff --git a/packages/react-native/sdks/hermes-engine/hermes-utils.rb b/packages/react-native/sdks/hermes-engine/hermes-utils.rb index 26abc7b70761fb..1d3f501d9d3910 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-utils.rb +++ b/packages/react-native/sdks/hermes-engine/hermes-utils.rb @@ -30,7 +30,7 @@ def abort_if_invalid_tarball_provided!() # - react_native_path: path to react native # # Returns: a properly configured source object -def compute_hermes_source(build_from_source, hermestag_file, git, version, build_type, react_native_path) +def compute_hermes_source(build_from_source, hermestag_file, git, version, react_native_path) source = {} if ENV.has_key?('HERMES_ENGINE_TARBALL_PATH') @@ -43,8 +43,10 @@ def compute_hermes_source(build_from_source, hermestag_file, git, version, build else build_hermes_from_source(source, git) end - elsif hermes_artifact_exists(release_tarball_url(version, build_type)) - use_release_tarball(source, version, build_type) + elsif hermes_artifact_exists(release_tarball_url(version, :debug)) + use_release_tarball(source, version, :debug) + download_stable_hermes(react_native_path, version, :debug) + download_stable_hermes(react_native_path, version, :release) elsif hermes_artifact_exists(nightly_tarball_url(version).gsub("\\", "")) use_nightly_tarball(source, react_native_path, version) else @@ -100,6 +102,25 @@ def putsIfPodPresent(message, level = 'warning') end end +def download_stable_hermes(react_native_path, version, configuration) + tarball_url = release_tarball_url(version, configuration) + download_hermes_tarball(react_native_path, tarball_url, version, configuration) +end + +def download_hermes_tarball(react_native_path, tarball_url, version, configuration) + destination_folder = "#{react_native_path}/sdks/downloads" + destination_path = configuration == nil ? + "#{destination_folder}/hermes-ios-#{version}.tar.gz" : + "#{destination_folder}/hermes-ios-#{version}-#{configuration}.tar.gz" + + unless File.exist?(destination_path) + # Download to a temporary file first so we don't cache incomplete downloads. + tmp_file = "#{destination_folder}/hermes-ios.download" + `mkdir -p "#{destination_folder}" && curl "#{tarball_url}" -Lo "#{tmp_file}" && mv "#{tmp_file}" "#{destination_path}"` + end + return destination_path +end + # This function downloads the nightly prebuilt version of Hermes based on the passed version # and save it in the node_module/react_native/sdks/downloads folder # It then returns the path to the hermes tarball @@ -110,16 +131,7 @@ def putsIfPodPresent(message, level = 'warning') # Returns: the path to the downloaded Hermes tarball def download_nightly_hermes(react_native_path, version) tarball_url = nightly_tarball_url(version) - - destination_folder = "#{react_native_path}/sdks/downloads" - destination_path = "#{destination_folder}/hermes-ios-#{version}.tar.gz" - - unless File.exist?(destination_path) - # Download to a temporary file first so we don't cache incomplete downloads. - tmp_file = "#{destination_folder}/hermes-ios.download" - `mkdir -p "#{destination_folder}" && curl "#{tarball_url}" -Lo "#{tmp_file}" && mv "#{tmp_file}" "#{destination_path}"` - end - return destination_path + return download_stable_hermes(react_native_path, tarball_url, version, nil) end def nightly_tarball_url(version) diff --git a/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js b/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js new file mode 100644 index 00000000000000..1ccc91b85f9e79 --- /dev/null +++ b/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js @@ -0,0 +1,104 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +'use strict'; + +const yargs = require('yargs'); +const fs = require('fs'); +const {execSync} = require('child_process'); + +const LAST_BUILD_FILENAME = '.last_build_configuration'; + +function validateBuildConfiguration(configuration) { + if (!['Debug', 'Release'].includes(configuration)) { + throw new Error(`Invalid configuration ${configuration}`); + } +} + +function validateVersion(version) { + if (version == null || version === '') { + throw new Error('Version cannot be empty'); + } +} + +function shouldReplaceHermesConfiguration(configuration) { + const fileExists = fs.existsSync(LAST_BUILD_FILENAME); + + if (fileExists) { + console.log(`Found ${LAST_BUILD_FILENAME} file`); + const oldConfiguration = fs.readFileSync(LAST_BUILD_FILENAME).toString(); + if (oldConfiguration === configuration) { + console.log('No need to download a new build of Hermes!'); + return false; + } + } + + // Assumption: if there is no stored last build, we assume that it was build for debug. + if (!fs.existsSync && configuration === 'Debug') { + console.log( + 'File does not exists, but Debug configuration. No need to download a new build of Hermes!', + ); + return false; + } + + return true; +} + +function replaceHermesConfiguration(configuration, version, reactNativePath) { + const tarballURLPath = `${reactNativePath}/sdks/downloads/hermes-ios-${version}-${configuration}.tar.gz`; + + const finalLocation = 'hermes-engine'; + console.log('Preparing the final location'); + fs.rmSync(finalLocation, {force: true, recursive: true}); + fs.mkdirSync(finalLocation, {recursive: true}); + + console.log('Extracting the tarball'); + execSync(`tar -xf ${tarballURLPath} -C ${finalLocation}`); +} + +function updateLastBuildConfiguration(configuration) { + fs.writeFileSync(LAST_BUILD_FILENAME, configuration); +} + +function main(configuration, version, reactNativePath) { + validateBuildConfiguration(configuration); + validateVersion(version); + + if (!shouldReplaceHermesConfiguration(configuration)) { + return; + } + + replaceHermesConfiguration(configuration, version, reactNativePath); + updateLastBuildConfiguration(configuration); + console.log('Done replacing hermes-engine'); +} + +// This script is executed in the Pods folder, which is usually not synched to Github, so it should be ok +const argv = yargs + .option('c', { + alias: 'configuration', + description: + 'Configuration to use to download the right Hermes version. Allowed values are "Debug" and "Release".', + }) + .option('r', { + alias: 'reactNativeVersion', + description: + 'The Version of React Native associated with the Hermes tarball.', + }) + .option('p', { + alias: 'reactNativePath', + description: 'The path to the React Native root folder', + }) + .usage('Usage: $0 -c Debug -r -p ').argv; + +const configuration = argv.configuration; +const version = argv.reactNativeVersion; +const reactNativePath = argv.reactNativePath; + +main(configuration, version, reactNativePath); diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index a9132e6b3dd66c..75cf0dff61df6d 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -1242,8 +1242,8 @@ SPEC CHECKSUMS: boost: 57d2868c099736d80fcd648bf211b4431e51a558 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 - FBLazyVector: 9c79ec2238e065a949c9bb7aebdf7cebd6203015 - FBReactNativeSpec: 66b1b6348a3f6c3133e6e437ad50b46f4fef812f + FBLazyVector: ca580232ba491b6601ee57bcdc874fda97a459a5 + FBReactNativeSpec: 4db5acd51db3de49e59e3740f03c94ce1282a31e Flipper: 6edb735e6c3e332975d1b17956bcc584eccf5818 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 @@ -1254,53 +1254,53 @@ SPEC CHECKSUMS: FlipperKit: 2efad7007d6745a3f95e4034d547be637f89d3f6 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 99bd064df01718db56b8f75e6b5ea3051c7dad0a - hermes-engine: 6085d07261e8a8bfe708e4b0dcd0f3eae72a8e4d + hermes-engine: 4ea4b12e82d2ccfd03b29e3d9191b716b4c8f476 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c RCT-Folly: b0d1393cb3763d71efca99db314c65f0072eb0fe - RCTRequired: 40ffd795b32a630f147fcc15247920e5161b6a4e - RCTTypeSafety: fd9d941c329580ea280cad3565bb2e1656969f41 - React: 47363de0e2c161a347eef1cb57cba33f1a4b7377 - React-callinvoker: 28e99e6254975d5be67eafeedbcc3a45bb1ace94 + RCTRequired: 5394bb1f71591633e1158bdf0534206cb5ccbeb5 + RCTTypeSafety: ba46a7f654566047a9358f2e74b2eafd97ccba9b + React: 8a004085056a81c7820f65a8bc0a92e1f7ef6878 + React-callinvoker: c2b59f2cbf0d8bcdc18b33f53e097907c12a149c React-Codegen: 9ecf53f804f4d1d2a5d29bb2154e22a30c381f81 - React-Core: f2a04589df942502db2f3ef84ddc83a35a7086d3 - React-CoreModules: 4fe81e5b80d5daa3e81151dfc9e516ae1a0e575f - React-cxxreact: 1235a3b3d8ea0639f95741cc907ddbb41da4bea3 - React-debug: 9c6d0fd7867cc4a8f435d528e2c5fa8465e9c054 - React-Fabric: b429ac248d619825f97ceb607d1a2d556a49c47c - React-FabricImage: 8136841d81a7005ac3c294623f87497f6bbf8f09 - React-graphics: ed6de536e153c7bc852f9c773a3c9b21c2ee22da - React-hermes: b494c9c833faa6217b2f666d13aa52623c34c2e9 - React-ImageManager: 3e990b6ffbc7634556ddf5b90e5bb1025c397a4c - React-jsi: 00d3c30ce021ff1a074315b824b22108db01131f - React-jsiexecutor: 473c386e219c256066689a334663e8813cdc65ef - React-jsinspector: 25164fdf93d5be275ba455d916e96adb49fa407c - React-logger: a2165169d9c1897c1a139c6b158f6f79090ee174 - React-NativeModulesApple: 5ca2a6989b4549ecf557958c72d514bda071922d - React-perflogger: b5ecf879c705577c80e5299ae678b9375fe2f998 - React-RCTActionSheet: 4a241f444d11926261dd904449a31f35157d4eee - React-RCTAnimation: cf7c9f502e597ee97ce18d1bc4eb8a5836ecf21d - React-RCTAppDelegate: da46fbaa608f201a832d1310bd2e8ce4234642b1 - React-RCTBlob: 48eae02e3f75777da97e9282a5861d04471624a9 - React-RCTFabric: 4b122d0e96f6a581046b8cb950e3277036a5d45a - React-RCTImage: 3efab57255aeb986f89ddc8719fbffd4559954ad - React-RCTLinking: 708dbd9b0aa0845c735e5d6b0e9f7f268008a830 - React-RCTNetwork: d88896f8b7adf85ba366168c5bf1e03d7c235493 - React-RCTPushNotification: dbacfd181137a62deebc62fd386419e707cdcf95 - React-RCTSettings: 17cb468bba42b17b7b0e40ea971d6bd8a78baa3f - React-RCTTest: d7142acb2544c01f53deb2b0543d63df6e214ac2 - React-RCTText: 8cb3ebda2675a02de0cb363a765fafb7d6c31cc1 - React-RCTVibration: c40f0f3e0114354bbf4b418e381c2c96d1d22d48 - React-rncore: 11d8412fb1e339cd1be30aa33cb3b265b46a542b - React-runtimeexecutor: c810e5b7d7500a9ad3ed66b834503e412684936d - ReactCommon: a7972e80473d6ba9bcf3ee53bcc310ac6b944a49 - ReactCommon-Samples: 93c677b30087b6aa82bbccb4458a2028cd6ebd10 + React-Core: d730664c1ee918190a0c26bbf5c993f57e46ff5d + React-CoreModules: 390071843c203f516ec8dbc1c9ce1a815d35e908 + React-cxxreact: 39409697255baeb1ac42e436daee59913036109d + React-debug: d69fb5b4e3a47e8d5f8fdb01c1ec8983b7c1afec + React-Fabric: b19750f6cd0fae4e87173b1c2b6f9c94621b6679 + React-FabricImage: dc031099e2ae4734b70f1f66b7edf4f1cc40335a + React-graphics: e2c5d8a680cd5db24ab87756f688ecd24fd4628e + React-hermes: 4e22050b18127c27759488b703c0a9d5e6a341ba + React-ImageManager: f6792f5987f85271cbbc31e99dc16e63fd82fccb + React-jsi: 57f6f99db8d596dd599450f921b77229616e983b + React-jsiexecutor: 05d7b49ae31548ed320bb17d97bf5d648406278b + React-jsinspector: 03d477e4dd236c5411ef9a2f8c52cc2951ab6149 + React-logger: adce225eaf6d94e0e2568ba586c3f6e857fc8862 + React-NativeModulesApple: 67bb14d796e45adad89238b96a26b0f0daa5fa72 + React-perflogger: 8889aa68bda6d4cb649f890677d36c7b1eadfcd9 + React-RCTActionSheet: f5f5aa4079e8316562171fdf6346883d79fc51b1 + React-RCTAnimation: 0a3247bc23fd71f8eff8ccdb1bdeebbcb1de8af3 + React-RCTAppDelegate: 4d24c5365e3581fe22a05f0fadf5595b18d8c456 + React-RCTBlob: 484c22d88cbfc3d3441c1e54686f7793eaf30fa3 + React-RCTFabric: cd58dfa8a168d41363f84e78abe2d71d081581fb + React-RCTImage: 65ef7ecc938dea1decadd876448c47bc71e9d60b + React-RCTLinking: 100b9d0a895d95ea1e59e62375fe9b95d83fe031 + React-RCTNetwork: 710d044df7ddbe7be1ecae2608fc2ae2c5096c9a + React-RCTPushNotification: 502720de4bfd05358169c10e1ab791a794f550b0 + React-RCTSettings: f0f73ba95d32777386c294572c0e7f757bd33e08 + React-RCTTest: 6978788114214cf1f3004c04c5c2b882d9c0c0ea + React-RCTText: a64c63e34beec7c9893042a200d48accde4a406e + React-RCTVibration: e16f969546e42256468f7681d6d6ec3d2cab4524 + React-rncore: 4b86b32071e99b892eefaeee55dcec300e3e9194 + React-runtimeexecutor: 5499cb980788a75a5a474ab07b480e73f87e76b0 + ReactCommon: ed5e5ad966bbc436641a15fedb1b20dd68a2d147 + ReactCommon-Samples: cc63a8216d5e2090cc82c9427cd8d6675bef4d0f ScreenshotManager: d39b964a374e5012e2b8c143e29ead86b1da6a3c SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: b82f2e3cbeb3d926329278b24d54d798215d4fa3 + Yoga: 456e136b8de9c5360b609bd3238656cea243958f YogaKit: f782866e155069a2cca2517aafea43200b01fd5a PODFILE CHECKSUM: bdab6add69d555774de227d7119a8f5ae02a670e -COCOAPODS: 1.12.0 +COCOAPODS: 1.12.1 From daa99fe5e7d3b4fc634513ae8b3d954c7b40eaa4 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 14 Jun 2023 10:10:16 -0700 Subject: [PATCH 162/468] Cleanup, remove the PRODUCTION flag (#37882) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37882 After some progressive changes, we can finally remove the PRODUCTION flag from the codebase. ## Changelog: [iOS][Removed] - Remove PRODUCTION flag from iOS build logic Reviewed By: cortinico, dmytrorykun Differential Revision: D46726208 fbshipit-source-id: 407268779be8de32c5a6c15ba220a60b7cb9ced7 --- .circleci/config.yml | 4 ---- .../ReactCommon/hermes/React-hermes.podspec | 2 -- .../scripts/cocoapods/__tests__/flipper-test.rb | 1 + packages/react-native/scripts/cocoapods/flipper.rb | 5 ++--- packages/react-native/scripts/react_native_pods.rb | 13 +++++-------- packages/rn-tester/Podfile | 2 +- 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 933e062f9dbcae..879715c2e92bc0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -886,10 +886,6 @@ jobs: command: | cd /tmp/$PROJECT_NAME/ios - if [[ << parameters.flavor >> == "Release" ]]; then - export PRODUCTION=1 - fi - if [[ << parameters.architecture >> == "NewArch" ]]; then export RCT_NEW_ARCH_ENABLED=1 fi diff --git a/packages/react-native/ReactCommon/hermes/React-hermes.podspec b/packages/react-native/ReactCommon/hermes/React-hermes.podspec index 72f16d96d388d7..300d1571ad931a 100644 --- a/packages/react-native/ReactCommon/hermes/React-hermes.podspec +++ b/packages/react-native/ReactCommon/hermes/React-hermes.podspec @@ -5,8 +5,6 @@ require "json" -# Whether Hermes is built for Release or Debug is determined by the PRODUCTION envvar. - # package.json package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json"))) version = package['version'] diff --git a/packages/react-native/scripts/cocoapods/__tests__/flipper-test.rb b/packages/react-native/scripts/cocoapods/__tests__/flipper-test.rb index 2c0659ecc4cd13..905c0af2ec938f 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/flipper-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/flipper-test.rb @@ -23,6 +23,7 @@ def test_installFlipperDependencies_installDependencies # Assert assert_equal($podInvocationCount, 1) assert_equal($podInvocation['React-Core/DevSupport'][:path], "../../" ) + assert_equal($podInvocation['React-Core/DevSupport'][:configurations], ["Debug"] ) end # ======================= # diff --git a/packages/react-native/scripts/cocoapods/flipper.rb b/packages/react-native/scripts/cocoapods/flipper.rb index 73371c1df603b1..f41ed7d7893eb9 100644 --- a/packages/react-native/scripts/cocoapods/flipper.rb +++ b/packages/react-native/scripts/cocoapods/flipper.rb @@ -19,10 +19,9 @@ # This function installs the `React-Core/DevSupport` subpods # when the dependencies are installed for a non production app. # -# @parameter production: a boolean that indicates whether we are in production or not. # @parameter pathToReactNative: the path to the React Native installation -def install_flipper_dependencies(pathToReactNative) - pod 'React-Core/DevSupport', :path => "#{pathToReactNative}/" +def install_flipper_dependencies(pathToReactNative, configurations: ["Debug"]) + pod 'React-Core/DevSupport', :path => "#{pathToReactNative}/", :configurations => configurations end diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index cee3065b2ef64e..440a9e0577f950 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -57,7 +57,7 @@ def prepare_react_native_project! # - path: path to react_native installation. # - fabric_enabled: whether fabric should be enabled or not. # - new_arch_enabled: whether the new architecture should be enabled or not. -# - production: whether the dependencies must be installed to target a Debug or a Release build. +# - :production [DEPRECATED] whether the dependencies must be installed to target a Debug or a Release build. # - hermes_enabled: whether Hermes should be enabled or not. # - flipper_configuration: The configuration to use for flipper. # - app_path: path to the React Native app. Required by the New Architecture. @@ -67,7 +67,7 @@ def use_react_native! ( path: "../node_modules/react-native", fabric_enabled: false, new_arch_enabled: ENV['RCT_NEW_ARCH_ENABLED'] == '1', - production: ENV['PRODUCTION'] == '1', + production: false, # deprecated hermes_enabled: ENV['USE_HERMES'] && ENV['USE_HERMES'] == '0' ? false : true, flipper_configuration: FlipperConfiguration.disabled, app_path: '..', @@ -164,12 +164,9 @@ def use_react_native! ( build_codegen!(prefix, relative_installation_root) end - # CocoaPods `configurations` option ensures that the target is copied only for the specified configurations, - # but those dependencies are still built. - # Flipper doesn't currently compile for release https://github.com/facebook/react-native/issues/33764 - # Setting the production flag to true when build for production make sure that we don't install Flipper in the app in the first place. - if flipper_configuration.flipper_enabled && !production - install_flipper_dependencies(prefix) + # Flipper now build in Release mode but it is not linked to the Release binary (as specified by the Configuration option) + if flipper_configuration.flipper_enabled + install_flipper_dependencies(prefix, :configurations => flipper_configuration.configurations) use_flipper_pods(flipper_configuration.versions, :configurations => flipper_configuration.configurations) end diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index e4e35975def76c..cf6b7f05d24d6d 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -38,7 +38,7 @@ def pods(target_name, options = {}, use_flipper: !IN_CI && !USE_FRAMEWORKS) flipper_configuration: use_flipper ? FlipperConfiguration.enabled : FlipperConfiguration.disabled, app_path: "#{Dir.pwd}", config_file_dir: "#{Dir.pwd}/node_modules", - production: !ENV['PRODUCTION'].nil?, + production: false, #deprecated ios_folder: '.', ) pod 'ReactCommon-Samples', :path => "#{@prefix_path}/ReactCommon/react/nativemodule/samples" From 8d694c8e093f03a5bbc65ac8d94052b0fc93a93f Mon Sep 17 00:00:00 2001 From: Lorenzo Sciandra Date: Wed, 14 Jun 2023 10:31:13 -0700 Subject: [PATCH 163/468] add 0.71.11 changelog (#37887) Summary: Adds changelog for new patch. ## Changelog: [Internal] [Changed] - add changelog entry for 0.71.11 Pull Request resolved: https://github.com/facebook/react-native/pull/37887 Test Plan: N/A Reviewed By: dmytrorykun Differential Revision: D46727332 Pulled By: cipolleschi fbshipit-source-id: 169f37efa629771cd7fd1796e575f92abac26d9e --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e57237ddd9f03..cbd665ac8382e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## v0.71.11 + +### Changed + +- Bump CLI to 10.2.4 and Metro to 0.73.10 ([69804c70cb](https://github.com/facebook/react-native/commit/69804c70cb5c1afba934e55d7c4d694450c918f0) by [@kelset](https://github.com/kelset)) + +#### iOS specific + +- Prefer `Content-Location` header in bundle response as JS source URL ([671ea383fe](https://github.com/facebook/react-native/commit/671ea383fe45dd9834a0c0481360de050df7f0c9) by [@robhogan](https://github.com/robhogan)) + +### Fixed + +#### Android specific + +- Fixed crash occurring in certain native views when handling keyboard events. ([f7e35d4ef7](https://github.com/facebook/react-native/commit/f7e35d4ef7d68d06fba1439c0aa6d9ed05b58a7f) by [@aleqsio](https://github.com/aleqsio)) +- Prevent crash on OnePlus/Oppo devices in runAnimationStep ([f2c05142](https://github.com/facebook/react-native/commit/f2c05142259563b892e593b5a018bdbb6a0cf177) by [@hsource](https://github.com/hsource)) +- Revert "fix: border width top/bottom not matching the border radius" to fix border styling issues ([fd8a19d](https://github.com/facebook/react-native/commit/fd8a19d5e2bc00f29b3cd992d24790084cc34cbd) by [@kelset](https://github.com/kelset)) + +#### iOS specific + +- Make 0.71 compatible with Xcode 15 (thanks to @AlexanderEggers for the commit in main) ([5bd1a4256e](https://github.com/facebook/react-native/commit/5bd1a4256e0f55bada2b3c277e1dc8aba67a57ce) by [@kelset](https://github.com/kelset)) + ## v0.71.10 ### Fixed From 377a8b70eee4b1d9f6e641ceda523ebe02c2e92c Mon Sep 17 00:00:00 2001 From: Pranav Yadav Date: Wed, 14 Jun 2023 10:33:23 -0700 Subject: [PATCH 164/468] Add README to RN Template App, added when `npx react-native@latest init ` (#37521) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: [skip-ci] I noticed that; when a _new_ RN App is created using RN CLI there is ***NO*** *README* file added to the project. Having a simple README file explaining what type of project it is, for example how other web projects do it, such as long lived `create-react-app`, now widely used `create-next-app`, etc. Why not for React Native App then? This PR; Adds README file to RN Template App :zap:, which should be added to the project when a new project is created using RN CLI. ### Website PR: https://github.com/facebook/react-native-website/pull/3732 🚀😇 bypass-github-export-checks ## Changelog: [INTERNAL] [ADDED] - Add README to RN Template App :zap: Pull Request resolved: https://github.com/facebook/react-native/pull/37521 Test Plan: - The README file should be included in the newly created RN App using RN CLI Reviewed By: NickGerleman Differential Revision: D46075719 Pulled By: cipolleschi fbshipit-source-id: efcccc09d72c57a065b36de6e787594082000e15 --- packages/react-native/template/README.md | 79 ++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 packages/react-native/template/README.md diff --git a/packages/react-native/template/README.md b/packages/react-native/template/README.md new file mode 100644 index 00000000000000..12470c30ecb5a2 --- /dev/null +++ b/packages/react-native/template/README.md @@ -0,0 +1,79 @@ +This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli). + +# Getting Started + +>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding. + +## Step 1: Start the Metro Server + +First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native. + +To start Metro, run the following command from the _root_ of your React Native project: + +```bash +# using npm +npm start + +# OR using Yarn +yarn start +``` + +## Step 2: Start your Application + +Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app: + +### For Android + +```bash +# using npm +npm run android + +# OR using Yarn +yarn android +``` + +### For iOS + +```bash +# using npm +npm run ios + +# OR using Yarn +yarn ios +``` + +If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly. + +This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively. + +## Step 3: Modifying your App + +Now that you have successfully run the app, let's modify it. + +1. Open `App.tsx` in your text editor of choice and edit some lines. +2. For **Android**: Press the R key twice or select **"Reload"** from the **Developer Menu** (Ctrl + M (on Window and Linux) or Cmd ⌘ + M (on macOS)) to see your changes! + + For **iOS**: Hit Cmd ⌘ + R in your iOS Simulator to reload the app and see your changes! + +## Congratulations! :tada: + +You've successfully run and modified your React Native App. :partying_face: + +### Now what? + +- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps). +- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started). + +# Troubleshooting + +If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page. + +# Learn More + +To learn more about React Native, take a look at the following resources: + +- [React Native Website](https://reactnative.dev) - learn more about React Native. +- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment. +- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**. +- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts. +- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native. From 44755726ed3dd59a21cfe10fb996fe720357eee8 Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Wed, 14 Jun 2023 11:20:10 -0700 Subject: [PATCH 165/468] Performance.measure: handle the case with a single startMark argument correctly (#37888) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37888 # Changelog: [Internal] - There was one particular permutation of input arguments to `Performance.measure` that wasn't handled correctly on the native side, namely when there is only the start mark argument present, but not the end time/mark, e.g.: ``` Performance.measure('myMeasure', 'someStartMark'); ``` In this case, [according to the standard](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure), the end time should be taken as the current one: > The end timestamp is one of: > ... > -the value returned by Performance.now(), if no end mark is specified or can be determined from other values. It was taken as 0 instead, making the total duration negative and consequently getting it filtered out by the default `durationThreshold` of 0. I've added a corresponding missing clause in the native unit tests. This also required a slight extension to the `PerformanceObserver` API to allow for mocking the current timestamp provider. Reviewed By: rubennorte Differential Revision: D46728261 fbshipit-source-id: bd904d9c93707fa04c1a0ddb30802691e253c106 --- .../PerformanceEntryReporter.cpp | 18 ++++++++++++++---- .../WebPerformance/PerformanceEntryReporter.h | 8 ++++++++ .../__tests__/PerformanceEntryReporterTest.cpp | 14 ++++++++++++-- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/packages/react-native/Libraries/WebPerformance/PerformanceEntryReporter.cpp b/packages/react-native/Libraries/WebPerformance/PerformanceEntryReporter.cpp index e223156ac94aa8..3d8d3aba94dc2f 100644 --- a/packages/react-native/Libraries/WebPerformance/PerformanceEntryReporter.cpp +++ b/packages/react-native/Libraries/WebPerformance/PerformanceEntryReporter.cpp @@ -15,10 +15,6 @@ namespace facebook::react { EventTag PerformanceEntryReporter::sCurrentEventTag_{0}; -static inline double getCurrentTimeStamp() { - return JSExecutor::performanceNow(); -} - PerformanceEntryReporter &PerformanceEntryReporter::getInstance() { static PerformanceEntryReporter instance; return instance; @@ -29,11 +25,17 @@ PerformanceEntryReporter::PerformanceEntryReporter() { // sure that marks can be referenced by measures getBuffer(PerformanceEntryType::MARK).hasNameLookup = true; } + void PerformanceEntryReporter::setReportingCallback( std::optional> callback) { callback_ = callback; } +double PerformanceEntryReporter::getCurrentTimeStamp() const { + return timeStampProvider_ != nullptr ? timeStampProvider_() + : JSExecutor::performanceNow(); +} + void PerformanceEntryReporter::startReporting(PerformanceEntryType entryType) { auto &buffer = getBuffer(entryType); buffer.isReporting = true; @@ -219,7 +221,15 @@ void PerformanceEntryReporter::measure( const std::optional &endMark) { double startTimeVal = startMark ? getMarkTime(*startMark) : startTime; double endTimeVal = endMark ? getMarkTime(*endMark) : endTime; + + if (!endMark && endTime < startTimeVal) { + // The end time is not specified, take the current time, according to the + // standard + endTimeVal = getCurrentTimeStamp(); + } + double durationVal = duration ? *duration : endTimeVal - startTimeVal; + logEntry( {name, static_cast(PerformanceEntryType::MEASURE), diff --git a/packages/react-native/Libraries/WebPerformance/PerformanceEntryReporter.h b/packages/react-native/Libraries/WebPerformance/PerformanceEntryReporter.h index 8ea7c820e01893..a68df9247a4c34 100644 --- a/packages/react-native/Libraries/WebPerformance/PerformanceEntryReporter.h +++ b/packages/react-native/Libraries/WebPerformance/PerformanceEntryReporter.h @@ -147,6 +147,10 @@ class PerformanceEntryReporter : public EventLogger { return eventCounts_; } + void setTimeStampProvider(std::function provider) { + timeStampProvider_ = provider; + } + private: std::optional> callback_; @@ -171,6 +175,8 @@ class PerformanceEntryReporter : public EventLogger { std::unordered_map eventsInFlight_; std::mutex eventsInFlightMutex_; + std::function timeStampProvider_ = nullptr; + static EventTag sCurrentEventTag_; PerformanceEntryReporter(); @@ -182,6 +188,8 @@ class PerformanceEntryReporter : public EventLogger { PerformanceEntryType entryType, const char *entryName, std::vector &res) const; + + double getCurrentTimeStamp() const; }; } // namespace facebook::react diff --git a/packages/react-native/Libraries/WebPerformance/__tests__/PerformanceEntryReporterTest.cpp b/packages/react-native/Libraries/WebPerformance/__tests__/PerformanceEntryReporterTest.cpp index c5895021ee6c88..e7e8952a89d6ac 100644 --- a/packages/react-native/Libraries/WebPerformance/__tests__/PerformanceEntryReporterTest.cpp +++ b/packages/react-native/Libraries/WebPerformance/__tests__/PerformanceEntryReporterTest.cpp @@ -146,8 +146,11 @@ TEST(PerformanceEntryReporter, PerformanceEntryReporterTestReportMeasures) { reporter.measure("measure3", 0.0, 0.0, 5.0, "mark1"); reporter.measure("measure4", 1.5, 0.0, std::nullopt, std::nullopt, "mark2"); + reporter.setTimeStampProvider([]() { return 3.5; }); + reporter.measure("measure5", 0.0, 0.0, std::nullopt, "mark2"); + reporter.mark("mark3", 2.0); - reporter.measure("measure5", 2.0, 2.0); + reporter.measure("measure6", 2.0, 2.0); reporter.mark("mark4", 2.0); auto res = reporter.popPendingEntries(); @@ -226,13 +229,20 @@ TEST(PerformanceEntryReporter, PerformanceEntryReporterTestReportMeasures) { std::nullopt, std::nullopt, std::nullopt}, - {"measure5", + {"measure6", static_cast(PerformanceEntryType::MEASURE), 2.0, 0.0, std::nullopt, std::nullopt, std::nullopt}, + {"measure5", + static_cast(PerformanceEntryType::MEASURE), + 2.0, + 1.5, + std::nullopt, + std::nullopt, + std::nullopt}, }; ASSERT_EQ(expected, entries); From 202b965fedac2c754e11a100c85d4779ab284a57 Mon Sep 17 00:00:00 2001 From: tarunrajput Date: Wed, 14 Jun 2023 11:53:02 -0700 Subject: [PATCH 166/468] add emitObjectProp in parser primitives (#37872) Summary: Part of https://github.com/facebook/react-native/issues/34872 > Create a function emitObjectProp(name: string, optional: boolean) in parser-primitives.js. Factor out the code from [Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/events.js#L84-L93) and [TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/events.js#L87-L96) into that function. Use that function in the original call site. ## Changelog: [Internal][Changed]: Add emitObjectProp in parser primitives Pull Request resolved: https://github.com/facebook/react-native/pull/37872 Test Plan: ```shell yarn test react-native-codegen ``` Reviewed By: cipolleschi Differential Revision: D46715634 Pulled By: rshest fbshipit-source-id: 6c58002df132bc5b05a10a19f8611819d7179cb1 --- .../__tests__/parsers-primitives-test.js | 97 +++++++++++++++++++ .../src/parsers/flow/components/events.js | 19 ++-- .../src/parsers/parsers-primitives.js | 28 ++++++ .../parsers/typescript/components/events.js | 16 ++- 4 files changed, 139 insertions(+), 21 deletions(-) diff --git a/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js b/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js index a09730d1ce36bb..8e108d250b8c0e 100644 --- a/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js +++ b/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js @@ -42,12 +42,14 @@ const { typeEnumResolution, Visitor, emitStringProp, + emitObjectProp, } = require('../parsers-primitives.js'); const {MockedParser} = require('../parserMock'); const {emitUnion} = require('../parsers-primitives'); const {UnsupportedUnionTypeAnnotationParserError} = require('../errors'); const {FlowParser} = require('../flow/parser'); const {TypeScriptParser} = require('../typescript/parser'); +const {getPropertyType} = require('../flow/components/events'); const parser = new MockedParser(); const flowParser = new FlowParser(); @@ -1671,3 +1673,98 @@ describe('emitBoolProp', () => { }); }); }); + +describe('emitObjectProp', () => { + const name = 'someProp'; + describe('when property is optional', () => { + it('returns optional Object Prop', () => { + const typeAnnotation = { + properties: [ + { + key: { + name: 'someKey', + }, + optional: true, + value: { + type: 'StringTypeAnnotation', + typeAnnotation: { + type: 'StringTypeAnnotation', + }, + }, + }, + ], + }; + const result = emitObjectProp( + name, + true, + flowParser, + typeAnnotation, + getPropertyType, + ); + const expected = { + name: 'someProp', + optional: true, + typeAnnotation: { + properties: [ + { + name: 'someKey', + optional: true, + typeAnnotation: { + type: 'StringTypeAnnotation', + }, + }, + ], + type: 'ObjectTypeAnnotation', + }, + }; + + expect(result).toEqual(expected); + }); + }); + + describe('when property is required', () => { + it('returns required Object Prop', () => { + const typeAnnotation = { + properties: [ + { + key: { + name: 'someKey', + }, + optional: false, + value: { + type: 'StringTypeAnnotation', + typeAnnotation: { + type: 'StringTypeAnnotation', + }, + }, + }, + ], + }; + const result = emitObjectProp( + name, + false, + flowParser, + typeAnnotation, + getPropertyType, + ); + const expected = { + name: 'someProp', + optional: false, + typeAnnotation: { + properties: [ + { + name: 'someKey', + optional: false, + typeAnnotation: { + type: 'StringTypeAnnotation', + }, + }, + ], + type: 'ObjectTypeAnnotation', + }, + }; + + expect(result).toEqual(expected); + }); + }); +}); diff --git a/packages/react-native-codegen/src/parsers/flow/components/events.js b/packages/react-native-codegen/src/parsers/flow/components/events.js index b40b7166d3a24c..9901c5edd24259 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/events.js +++ b/packages/react-native-codegen/src/parsers/flow/components/events.js @@ -33,12 +33,13 @@ const { emitMixedProp, emitStringProp, emitInt32Prop, + emitObjectProp, } = require('../../parsers-primitives'); function getPropertyType( /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's * LTI update could not be added via codemod */ - name, + name: string, optional: boolean, typeAnnotation: $FlowFixMe, parser: Parser, @@ -64,18 +65,13 @@ function getPropertyType( parser, ); case 'ObjectTypeAnnotation': - return { + return emitObjectProp( name, optional, - typeAnnotation: { - type: 'ObjectTypeAnnotation', - properties: parser - .getObjectProperties(typeAnnotation) - .map(member => - buildPropertiesForEvent(member, parser, getPropertyType), - ), - }, - }; + parser, + typeAnnotation, + getPropertyType, + ); case 'UnionTypeAnnotation': return { name, @@ -315,4 +311,5 @@ function getEvents( module.exports = { getEvents, + getPropertyType, }; diff --git a/packages/react-native-codegen/src/parsers/parsers-primitives.js b/packages/react-native-codegen/src/parsers/parsers-primitives.js index db5668cc5706a4..ea0bec6ea0a4cb 100644 --- a/packages/react-native-codegen/src/parsers/parsers-primitives.js +++ b/packages/react-native-codegen/src/parsers/parsers-primitives.js @@ -60,6 +60,7 @@ const { wrapNullable, unwrapNullable, translateFunctionTypeAnnotation, + buildPropertiesForEvent, } = require('./parsers-commons'); const {isModuleRegistryCall} = require('./utils'); @@ -657,6 +658,32 @@ function emitMixedProp( }; } +function emitObjectProp( + name: string, + optional: boolean, + parser: Parser, + typeAnnotation: $FlowFixMe, + getPropertyType: ( + name: $FlowFixMe, + optional: boolean, + typeAnnotation: $FlowFixMe, + parser: Parser, + ) => NamedShape, +): NamedShape { + return { + name, + optional, + typeAnnotation: { + type: 'ObjectTypeAnnotation', + properties: parser + .getObjectProperties(typeAnnotation) + .map(member => + buildPropertiesForEvent(member, parser, getPropertyType), + ), + }, + }; +} + module.exports = { emitArrayType, emitBoolean, @@ -687,4 +714,5 @@ module.exports = { typeEnumResolution, translateArrayTypeAnnotation, Visitor, + emitObjectProp, }; diff --git a/packages/react-native-codegen/src/parsers/typescript/components/events.js b/packages/react-native-codegen/src/parsers/typescript/components/events.js index f03b9209fea01e..eafc857184fa83 100644 --- a/packages/react-native-codegen/src/parsers/typescript/components/events.js +++ b/packages/react-native-codegen/src/parsers/typescript/components/events.js @@ -35,6 +35,7 @@ const { emitMixedProp, emitStringProp, emitInt32Prop, + emitObjectProp, } = require('../../parsers-primitives'); function getPropertyType( /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's @@ -66,18 +67,13 @@ function getPropertyType( case 'Float': return emitFloatProp(name, optional); case 'TSTypeLiteral': - return { + return emitObjectProp( name, optional, - typeAnnotation: { - type: 'ObjectTypeAnnotation', - properties: parser - .getObjectProperties(typeAnnotation) - .map(member => - buildPropertiesForEvent(member, parser, getPropertyType), - ), - }, - }; + parser, + typeAnnotation, + getPropertyType, + ); case 'TSUnionType': return { name, From 875f6a70861a4e48c9bc001d30a55f24d87443ed Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 14 Jun 2023 12:03:26 -0700 Subject: [PATCH 167/468] Restore installing DevSupport to all the config Summary: CircleCI was broken because we changed how the `React-Core/DevSupport` pod is installed. ## Changelog: [Internal] - Restore the installation of React-Core/DevSupport Reviewed By: cortinico Differential Revision: D46734714 fbshipit-source-id: 9b8c28837f0485ed0df2f94e417f89b5f0077c7d --- .../react-native/scripts/cocoapods/__tests__/flipper-test.rb | 3 +-- packages/react-native/scripts/cocoapods/flipper.rb | 4 ++-- packages/react-native/scripts/react_native_pods.rb | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/react-native/scripts/cocoapods/__tests__/flipper-test.rb b/packages/react-native/scripts/cocoapods/__tests__/flipper-test.rb index 905c0af2ec938f..12de576beb3681 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/flipper-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/flipper-test.rb @@ -22,8 +22,7 @@ def test_installFlipperDependencies_installDependencies # Assert assert_equal($podInvocationCount, 1) - assert_equal($podInvocation['React-Core/DevSupport'][:path], "../../" ) - assert_equal($podInvocation['React-Core/DevSupport'][:configurations], ["Debug"] ) + assert_equal($podInvocation['React-Core/DevSupport'][:path], "../../") end # ======================= # diff --git a/packages/react-native/scripts/cocoapods/flipper.rb b/packages/react-native/scripts/cocoapods/flipper.rb index f41ed7d7893eb9..7206161e568560 100644 --- a/packages/react-native/scripts/cocoapods/flipper.rb +++ b/packages/react-native/scripts/cocoapods/flipper.rb @@ -20,8 +20,8 @@ # when the dependencies are installed for a non production app. # # @parameter pathToReactNative: the path to the React Native installation -def install_flipper_dependencies(pathToReactNative, configurations: ["Debug"]) - pod 'React-Core/DevSupport', :path => "#{pathToReactNative}/", :configurations => configurations +def install_flipper_dependencies(pathToReactNative) + pod 'React-Core/DevSupport', :path => "#{pathToReactNative}/" end diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index 440a9e0577f950..eb55940a379eb4 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -166,7 +166,7 @@ def use_react_native! ( # Flipper now build in Release mode but it is not linked to the Release binary (as specified by the Configuration option) if flipper_configuration.flipper_enabled - install_flipper_dependencies(prefix, :configurations => flipper_configuration.configurations) + install_flipper_dependencies(prefix) use_flipper_pods(flipper_configuration.versions, :configurations => flipper_configuration.configurations) end From b0485bed0945061becace5af924fa60b17ab295f Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Wed, 14 Jun 2023 13:32:50 -0700 Subject: [PATCH 168/468] Return final animation values to JS when animation completes (#37886) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37886 When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect **This diff:** - Returning the final values from the native side, at the same place it sets the "finished" flag. This gets sent to JS in `animated/animations/Animation.js`. Changelog: [iOS][Changed] - return animated values to JS for natively driven animations Reviewed By: rshest Differential Revision: D46709214 fbshipit-source-id: f16f36a05cd052d1120ba6e04ec6dd72eb4a98e5 --- .../Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m | 4 ++-- .../Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m | 4 ++-- .../Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m | 4 ++-- .../RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m | 6 ++++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m index 5c19386cd93650..b4aec0c33288fe 100644 --- a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m +++ b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTDecayAnimation.m @@ -70,10 +70,10 @@ - (void)startAnimation - (void)stopAnimation { - _valueNode = nil; if (_callback) { - _callback(@[ @{@"finished" : @(_animationHasFinished)} ]); + _callback(@[ @{@"finished" : @(_animationHasFinished), @"value" : @(_valueNode.value)} ]); } + _valueNode = nil; } - (void)stepAnimationWithTime:(NSTimeInterval)currentTime diff --git a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m index d2bf4cd618b24c..1de5cb13eb8ffa 100644 --- a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m +++ b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTFrameAnimation.m @@ -76,10 +76,10 @@ - (void)startAnimation - (void)stopAnimation { - _valueNode = nil; if (_callback) { - _callback(@[ @{@"finished" : @(_animationHasFinished)} ]); + _callback(@[ @{@"finished" : @(_animationHasFinished), @"value" : @(_valueNode.value)} ]); } + _valueNode = nil; } - (void)stepAnimationWithTime:(NSTimeInterval)currentTime diff --git a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m index 232916017607de..640107df09c287 100644 --- a/packages/react-native/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m +++ b/packages/react-native/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m @@ -96,10 +96,10 @@ - (void)startAnimation - (void)stopAnimation { - _valueNode = nil; if (_callback) { - _callback(@[ @{@"finished" : @(_animationHasFinished)} ]); + _callback(@[ @{@"finished" : @(_animationHasFinished), @"value" : @(_valueNode.value)} ]); } + _valueNode = nil; } - (void)stepAnimationWithTime:(NSTimeInterval)currentTime diff --git a/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m b/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m index 09682c19e9b433..7e0c3fcefdddf6 100644 --- a/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m +++ b/packages/rn-tester/RNTesterUnitTests/RCTNativeAnimatedNodesManagerTests.m @@ -486,7 +486,8 @@ - (void)testAnimationCallbackFinish RCTResponseSenderBlock endCallback = ^(NSArray *response) { endCallbackCalls++; - XCTAssertEqualObjects(response, @[ @{@"finished" : @YES} ]); + NSArray *expected = @[ @{@"finished" : @YES, @"value" : @1} ]; + XCTAssertEqualObjects(response, expected); }; [_nodesManager startAnimatingNode:@1 @@ -714,7 +715,8 @@ - (void)testHandleStoppingAnimation RCTResponseSenderBlock endCallback = ^(NSArray *response) { endCallbackCalled = YES; - XCTAssertEqualObjects(response, @[ @{@"finished" : @NO} ]); + XCTAssertEqual(response.count, 1); + XCTAssertEqualObjects(response[0][@"finished"], @NO); }; [_nodesManager startAnimatingNode:@404 From 1807ba6f31cd8344ff0917927bc13f9f74fe503a Mon Sep 17 00:00:00 2001 From: Sam Goldman Date: Wed, 14 Jun 2023 17:00:12 -0700 Subject: [PATCH 169/468] Deploy Flow v0.208.1 to fbsource (#37892) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37892 Changelog: [Internal] Reviewed By: SamChou19815 Differential Revision: D46734451 fbshipit-source-id: 7c50c95782bc34e7f43f916fbba75fb0e5f2d09d --- .flowconfig | 2 +- .flowconfig.android | 2 +- package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.flowconfig b/.flowconfig index d313861fc746d3..b3d0e7d79cf27f 100644 --- a/.flowconfig +++ b/.flowconfig @@ -75,4 +75,4 @@ untyped-import untyped-type-import [version] -^0.207.0 +^0.208.1 diff --git a/.flowconfig.android b/.flowconfig.android index 543e30dc6034b2..69e0eb50b66e48 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -75,4 +75,4 @@ untyped-import untyped-type-import [version] -^0.207.0 +^0.208.1 diff --git a/package.json b/package.json index 40ccb1a12cabb2..5f6c53b84442e5 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "eslint-plugin-react-native": "^4.0.0", "eslint-plugin-redundant-undefined": "^0.4.0", "eslint-plugin-relay": "^1.8.3", - "flow-bin": "^0.207.0", + "flow-bin": "^0.208.1", "hermes-eslint": "0.12.0", "inquirer": "^7.1.0", "jest": "^29.2.1", diff --git a/yarn.lock b/yarn.lock index a969b06ec24bcd..91d2aeb3bf9964 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4925,10 +4925,10 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== -flow-bin@^0.207.0: - version "0.207.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.207.0.tgz#71c6a21214c57f3e36e03b32033dd0358452499b" - integrity sha512-jAet+lhdrvpk4kjonZ6r/v09rkyaPQX+E5gio+HesEBvsOsCWfnuadBRQZihTM4+szjJPWEkITfrCurI/aCqEQ== +flow-bin@^0.208.1: + version "0.208.1" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.208.1.tgz#98390cc968980988d9c7ddbcf7233b53baa0b616" + integrity sha512-sr+gCnYg5UC/lbrCj/qO2GDSGzV75HDl8drEHX/Dpjr5gS+NYoFQ1r9C9ESAeYpakmiot/HPdKYOjCFtqUcsQA== flow-enums-runtime@^0.0.6: version "0.0.6" From 75d34407c11f884a71c44bfaded664b80caf3aed Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 14 Jun 2023 17:14:02 -0700 Subject: [PATCH 170/468] test RCTInstance invalidation on RCTHost restart (#37899) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37899 Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D46547012 fbshipit-source-id: 9b157678c474120aeca3896942e368678cb5b8eb --- .../react/bridgeless/iostests/RCTHostTests.mm | 37 +++++++++++++++++++ .../bridgeless/platform/ios/Core/RCTHost.mm | 4 ++ .../test_utils/ios/Shims/ShimRCTInstance.h | 1 + .../test_utils/ios/Shims/ShimRCTInstance.mm | 8 ++++ 4 files changed, 50 insertions(+) diff --git a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm index 58467be556b005..be05d7a97abc7c 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm @@ -8,6 +8,8 @@ #import #import +#import +#import #import #import #import @@ -15,6 +17,22 @@ #import +RCT_MOCK_REF(RCTHost, _RCTLogNativeInternal); + +RCTLogLevel gLogLevel; +int gLogCalledTimes = 0; +NSString *gLogMessage = nil; +static void RCTLogNativeInternalMock(RCTLogLevel level, const char *fileName, int lineNumber, NSString *format, ...) +{ + gLogLevel = level; + gLogCalledTimes++; + + va_list args; + va_start(args, format); + gLogMessage = [[NSString alloc] initWithFormat:format arguments:args]; + va_end(args); +} + @interface RCTHostTests : XCTestCase @end @@ -43,15 +61,34 @@ - (void)setUp - (void)tearDown { [shimmedRCTInstance reset]; + gLogCalledTimes = 0; + gLogMessage = nil; [super tearDown]; } - (void)testStart { + RCT_MOCK_SET(RCTHost, _RCTLogNativeInternal, RCTLogNativeInternalMock); + + XCTAssertEqual(shimmedRCTInstance.initCount, 0); [_subject start]; OCMVerify(OCMTimes(1), [_mockHostDelegate hostDidStart:_subject]); XCTAssertEqual(shimmedRCTInstance.initCount, 1); + XCTAssertEqual(gLogCalledTimes, 0); + + XCTAssertEqual(shimmedRCTInstance.invalidateCount, 0); + [_subject start]; + XCTAssertEqual(shimmedRCTInstance.initCount, 2); + XCTAssertEqual(shimmedRCTInstance.invalidateCount, 1); + OCMVerify(OCMTimes(2), [_mockHostDelegate hostDidStart:_subject]); + XCTAssertEqual(gLogLevel, RCTLogLevelWarning); + XCTAssertEqual(gLogCalledTimes, 1); + XCTAssertEqualObjects( + gLogMessage, + @"RCTHost should not be creating a new instance if one already exists. This implies there is a bug with how/when this method is being called."); + + RCT_MOCK_RESET(RCTHost, _RCTLogNativeInternal); } @end diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm index d7d8c274af17a5..2706a9e40ad6bd 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm @@ -15,9 +15,13 @@ #import #import #import +#import #import #import +RCT_MOCK_DEF(RCTHost, _RCTLogNativeInternal); +#define _RCTLogNativeInternal RCT_MOCK_USE(RCTHost, _RCTLogNativeInternal) + using namespace facebook::react; @interface RCTHost () diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h index a0aee07975b34f..42686392f2aeb5 100644 --- a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h +++ b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h @@ -10,6 +10,7 @@ @interface ShimRCTInstance : NSObject @property (assign) int initCount; +@property (assign) int invalidateCount; - (void)reset; diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm index 017b45ac212b2c..0cfaff555d9ce7 100644 --- a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm +++ b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm @@ -24,6 +24,7 @@ - (instancetype)init [ShimRCTInstance class], @selector(initWithDelegate: jsEngineInstance:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry:)); + RCTSwizzleInstanceSelector([RCTInstance class], [ShimRCTInstance class], @selector(invalidate)); weakShim = self; } return self; @@ -36,7 +37,9 @@ - (void)reset [ShimRCTInstance class], @selector(initWithDelegate: jsEngineInstance:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry:)); + RCTSwizzleInstanceSelector([RCTInstance class], [ShimRCTInstance class], @selector(invalidate)); _initCount = 0; + _invalidateCount = 0; } - (instancetype)initWithDelegate:(id)delegate @@ -50,4 +53,9 @@ - (instancetype)initWithDelegate:(id)delegate return self; } +- (void)invalidate +{ + weakShim.invalidateCount++; +} + @end From e822056618a6fbe86f9a692a6f0a87ad79e6873e Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 14 Jun 2023 17:14:02 -0700 Subject: [PATCH 171/468] add test helpers for memory (#37895) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37895 Changelog: [Internal] i'm adding these helpers so we can test that our objects aren't leaking memory Reviewed By: cipolleschi Differential Revision: D46625916 fbshipit-source-id: d811336ae3b0ac420b81832c258d5573c20a5bc7 --- .../test_utils/ios/Memory/RCTMemoryUtils.h | 19 ++++++++ .../test_utils/ios/Memory/RCTMemoryUtils.m | 45 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/test_utils/ios/Memory/RCTMemoryUtils.h create mode 100644 packages/react-native/ReactCommon/react/test_utils/ios/Memory/RCTMemoryUtils.m diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/Memory/RCTMemoryUtils.h b/packages/react-native/ReactCommon/react/test_utils/ios/Memory/RCTMemoryUtils.h new file mode 100644 index 00000000000000..e9110fa59e5456 --- /dev/null +++ b/packages/react-native/ReactCommon/react/test_utils/ios/Memory/RCTMemoryUtils.h @@ -0,0 +1,19 @@ +/* + * 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 + +#import + +RCT_EXTERN_C_BEGIN + +int RCTGetRetainCount(id _Nullable object); + +void RCTAutoReleasePoolPush(void); +void RCTAutoReleasePoolPop(void); + +RCT_EXTERN_C_END diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/Memory/RCTMemoryUtils.m b/packages/react-native/ReactCommon/react/test_utils/ios/Memory/RCTMemoryUtils.m new file mode 100644 index 00000000000000..22f41fec29fea8 --- /dev/null +++ b/packages/react-native/ReactCommon/react/test_utils/ios/Memory/RCTMemoryUtils.m @@ -0,0 +1,45 @@ +/* + * 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 "RCTMemoryUtils.h" + +int RCTGetRetainCount(id _Nullable object) +{ + return object != nil ? CFGetRetainCount((__bridge CFTypeRef)object) - 1 : 0; +} + +OBJC_EXPORT +void *objc_autoreleasePoolPush(void) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); + +OBJC_EXPORT +void objc_autoreleasePoolPop(void *context) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); + +static NSString *const kAutoreleasePoolContextStackKey = @"autorelease_pool_context_stack"; + +void RCTAutoReleasePoolPush(void) +{ + assert([NSThread isMainThread]); + NSMutableDictionary *dictionary = [[NSThread currentThread] threadDictionary]; + void *context = objc_autoreleasePoolPush(); + NSMutableArray *contextStack = dictionary[kAutoreleasePoolContextStackKey]; + if (!contextStack) { + contextStack = [NSMutableArray array]; + dictionary[kAutoreleasePoolContextStackKey] = contextStack; + } + [contextStack addObject:[NSValue valueWithPointer:context]]; +} + +void RCTAutoReleasePoolPop(void) +{ + assert([NSThread isMainThread]); + NSMutableDictionary *dictionary = [[NSThread currentThread] threadDictionary]; + NSMutableArray *contextStack = dictionary[kAutoreleasePoolContextStackKey]; + assert(contextStack.count > 0); + NSValue *lastContext = contextStack.lastObject; + [contextStack removeLastObject]; + objc_autoreleasePoolPop(lastContext.pointerValue); +} From cc7da26f44c8359c186a7ce23298ee72d2a74896 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 14 Jun 2023 17:14:02 -0700 Subject: [PATCH 172/468] test RCTHost doesn't leak memory (#37896) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37896 Changelog: [Internal] example usage of the memory test utilities Reviewed By: cipolleschi Differential Revision: D46625917 fbshipit-source-id: 379a76e59fb58cc4e5972195df167c52170f5e4c --- .../react/bridgeless/iostests/RCTHostTests.mm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm index be05d7a97abc7c..bffd646b0bac3d 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm @@ -7,6 +7,7 @@ #import +#import #import #import #import @@ -47,6 +48,8 @@ - (void)setUp { [super setUp]; + RCTAutoReleasePoolPush(); + shimmedRCTInstance = [ShimRCTInstance new]; _mockHostDelegate = OCMProtocolMock(@protocol(RCTHostDelegate)); @@ -60,6 +63,14 @@ - (void)setUp - (void)tearDown { + RCTAutoReleasePoolPop(); + + _subject = nil; + XCTAssertEqual(RCTGetRetainCount(_subject), 0); + + _mockHostDelegate = nil; + XCTAssertEqual(RCTGetRetainCount(_mockHostDelegate), 0); + [shimmedRCTInstance reset]; gLogCalledTimes = 0; gLogMessage = nil; From 7d69cd5640df74d3b396084a1350c4d990818ad8 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 14 Jun 2023 17:14:02 -0700 Subject: [PATCH 173/468] test callFunctionOnJSModule (#37898) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37898 Changelog: [Internal] as title Reviewed By: cipolleschi Differential Revision: D46672230 fbshipit-source-id: 8180f9dc26b44d50530fc440602acbafcf24df2f --- .../react/bridgeless/iostests/RCTHostTests.mm | 12 ++++++++++++ .../react/test_utils/ios/Shims/ShimRCTInstance.h | 8 ++++++-- .../react/test_utils/ios/Shims/ShimRCTInstance.mm | 11 +++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm index bffd646b0bac3d..adef9709c43407 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm @@ -102,4 +102,16 @@ - (void)testStart RCT_MOCK_RESET(RCTHost, _RCTLogNativeInternal); } +- (void)testCallFunctionOnJSModule +{ + [_subject start]; + + NSArray *args = @[ @"hi", @(5), @(NO) ]; + [_subject callFunctionOnJSModule:@"jsModule" method:@"method" args:args]; + + XCTAssertEqualObjects(shimmedRCTInstance.jsModuleName, @"jsModule"); + XCTAssertEqualObjects(shimmedRCTInstance.method, @"method"); + XCTAssertEqualObjects(shimmedRCTInstance.args, args); +} + @end diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h index 42686392f2aeb5..e11e88c560a72a 100644 --- a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h +++ b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.h @@ -9,8 +9,12 @@ @interface ShimRCTInstance : NSObject -@property (assign) int initCount; -@property (assign) int invalidateCount; +@property int initCount; +@property int invalidateCount; + +@property NSString *jsModuleName; +@property NSString *method; +@property NSArray *args; - (void)reset; diff --git a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm index 0cfaff555d9ce7..77476f9dfd3d52 100644 --- a/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm +++ b/packages/react-native/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm @@ -25,6 +25,8 @@ - (instancetype)init @selector(initWithDelegate: jsEngineInstance:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry:)); RCTSwizzleInstanceSelector([RCTInstance class], [ShimRCTInstance class], @selector(invalidate)); + RCTSwizzleInstanceSelector( + [RCTInstance class], [ShimRCTInstance class], @selector(callFunctionOnJSModule:method:args:)); weakShim = self; } return self; @@ -38,6 +40,8 @@ - (void)reset @selector(initWithDelegate: jsEngineInstance:bundleManager:turboModuleManagerDelegate:onInitialBundleLoad:moduleRegistry:)); RCTSwizzleInstanceSelector([RCTInstance class], [ShimRCTInstance class], @selector(invalidate)); + RCTSwizzleInstanceSelector( + [RCTInstance class], [ShimRCTInstance class], @selector(callFunctionOnJSModule:method:args:)); _initCount = 0; _invalidateCount = 0; } @@ -58,4 +62,11 @@ - (void)invalidate weakShim.invalidateCount++; } +- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args +{ + weakShim.jsModuleName = moduleName; + weakShim.method = method; + weakShim.args = [args copy]; +} + @end From 1cac95d076858121b504bbf857c2190c59908044 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 14 Jun 2023 17:14:02 -0700 Subject: [PATCH 174/468] push error handling c++ parsing down (#37893) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37893 Changelog: [Internal] i just noticed we can push more C++ code down into RCTInstance, so let's do that! will make everything easier to test as well Reviewed By: cipolleschi, RSNara Differential Revision: D46672345 fbshipit-source-id: fcb878698ebc9a19714ba6ff94a5760efc830958 --- .../bridgeless/platform/ios/Core/RCTHost.mm | 27 +++++-------------- .../platform/ios/Core/RCTInstance.h | 7 ++++- .../platform/ios/Core/RCTInstance.mm | 21 ++++++++++++++- 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm index 2706a9e40ad6bd..fc91d96e5420cb 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTHost.mm @@ -234,28 +234,13 @@ - (void)dealloc #pragma mark - RCTInstanceDelegate -- (void)instance:(RCTInstance *)instance didReceiveErrorMap:(facebook::react::MapBuffer)errorMap +- (void)instance:(RCTInstance *)instance + didReceiveJSErrorStack:(NSArray *> *)stack + message:(NSString *)message + exceptionId:(NSUInteger)exceptionId + isFatal:(BOOL)isFatal { - NSString *message = [NSString stringWithCString:errorMap.getString(JSErrorHandlerKey::kErrorMessage).c_str() - encoding:[NSString defaultCStringEncoding]]; - std::vector frames = errorMap.getMapBufferList(JSErrorHandlerKey::kAllStackFrames); - NSMutableArray *> *stack = [NSMutableArray new]; - for (facebook::react::MapBuffer const &mapBuffer : frames) { - NSDictionary *frame = @{ - @"file" : [NSString stringWithCString:mapBuffer.getString(JSErrorHandlerKey::kFrameFileName).c_str() - encoding:[NSString defaultCStringEncoding]], - @"methodName" : [NSString stringWithCString:mapBuffer.getString(JSErrorHandlerKey::kFrameMethodName).c_str() - encoding:[NSString defaultCStringEncoding]], - @"lineNumber" : [NSNumber numberWithInt:mapBuffer.getInt(JSErrorHandlerKey::kFrameLineNumber)], - @"column" : [NSNumber numberWithInt:mapBuffer.getInt(JSErrorHandlerKey::kFrameColumnNumber)], - }; - [stack addObject:frame]; - } - [_hostDelegate host:self - didReceiveJSErrorStack:stack - message:message - exceptionId:errorMap.getInt(JSErrorHandlerKey::kExceptionId) - isFatal:errorMap.getBool(JSErrorHandlerKey::kIsFatal)]; + [_hostDelegate host:self didReceiveJSErrorStack:stack message:message exceptionId:exceptionId isFatal:isFatal]; } - (void)instance:(RCTInstance *)instance didInitializeRuntime:(facebook::jsi::Runtime &)runtime diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.h b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.h index 80c10803316f76..5445ca8b7c247d 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.h +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.h @@ -38,7 +38,12 @@ FB_RUNTIME_PROTOCOL @protocol RCTInstanceDelegate -- (void)instance:(RCTInstance *)instance didReceiveErrorMap:(facebook::react::MapBuffer)errorMap; +- (void)instance:(RCTInstance *)instance + didReceiveJSErrorStack:(NSArray *> *)stack + message:(NSString *)message + exceptionId:(NSUInteger)exceptionId + isFatal:(BOOL)isFatal; + - (void)instance:(RCTInstance *)instance didInitializeRuntime:(facebook::jsi::Runtime &)runtime; @end diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm index 5e23e46836c287..6c76569703cc65 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm @@ -413,7 +413,26 @@ - (void)_notifyEventDispatcherObserversOfEvent_DEPRECATED:(NSNotification *)noti - (void)_handleJSErrorMap:(facebook::react::MapBuffer)errorMap { - [_delegate instance:self didReceiveErrorMap:std::move(errorMap)]; + NSString *message = [NSString stringWithCString:errorMap.getString(JSErrorHandlerKey::kErrorMessage).c_str() + encoding:[NSString defaultCStringEncoding]]; + std::vector frames = errorMap.getMapBufferList(JSErrorHandlerKey::kAllStackFrames); + NSMutableArray *> *stack = [NSMutableArray new]; + for (facebook::react::MapBuffer const &mapBuffer : frames) { + NSDictionary *frame = @{ + @"file" : [NSString stringWithCString:mapBuffer.getString(JSErrorHandlerKey::kFrameFileName).c_str() + encoding:[NSString defaultCStringEncoding]], + @"methodName" : [NSString stringWithCString:mapBuffer.getString(JSErrorHandlerKey::kFrameMethodName).c_str() + encoding:[NSString defaultCStringEncoding]], + @"lineNumber" : [NSNumber numberWithInt:mapBuffer.getInt(JSErrorHandlerKey::kFrameLineNumber)], + @"column" : [NSNumber numberWithInt:mapBuffer.getInt(JSErrorHandlerKey::kFrameColumnNumber)], + }; + [stack addObject:frame]; + } + [_delegate instance:self + didReceiveJSErrorStack:stack + message:message + exceptionId:errorMap.getInt(JSErrorHandlerKey::kExceptionId) + isFatal:errorMap.getBool(JSErrorHandlerKey::kIsFatal)]; } @end From 066d52b7a9bc777eb96eeb22396646841af780bc Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 14 Jun 2023 17:14:02 -0700 Subject: [PATCH 175/468] test host error callback (#37894) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37894 Changelog: [Internal] as title Reviewed By: cipolleschi Differential Revision: D46672582 fbshipit-source-id: b37f6840c2fa505a33988cbb4b89f66698b0c66c --- .../react/bridgeless/iostests/RCTHostTests.mm | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm index adef9709c43407..b3a7a1fb04e89e 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm @@ -114,4 +114,35 @@ - (void)testCallFunctionOnJSModule XCTAssertEqualObjects(shimmedRCTInstance.args, args); } +- (void)testDidReceiveErrorStack +{ + id instanceDelegate = (id)_subject; + + NSMutableArray *> *stack = [NSMutableArray array]; + + NSMutableDictionary *stackFrame0 = [NSMutableDictionary dictionary]; + stackFrame0[@"linenumber"] = @(3); + stackFrame0[@"column"] = @(4); + stackFrame0[@"methodname"] = @"method1"; + stackFrame0[@"file"] = @"file1.js"; + [stack addObject:stackFrame0]; + + NSMutableDictionary *stackFrame1 = [NSMutableDictionary dictionary]; + stackFrame0[@"linenumber"] = @(63); + stackFrame0[@"column"] = @(44); + stackFrame0[@"methodname"] = @"method2"; + stackFrame0[@"file"] = @"file2.js"; + [stack addObject:stackFrame1]; + + [instanceDelegate instance:OCMClassMock([RCTInstance class]) + didReceiveJSErrorStack:stack + message:@"message" + exceptionId:5 + isFatal:YES]; + + OCMVerify( + OCMTimes(1), + [_mockHostDelegate host:_subject didReceiveJSErrorStack:stack message:@"message" exceptionId:5 isFatal:YES]); +} + @end From 0f688dc677e1609acd617138a3bc5e4dd526ef63 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 14 Jun 2023 17:14:02 -0700 Subject: [PATCH 176/468] test runtime lifecycle callback (#37897) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37897 Changelog: [Internal] adding unit test for `instance:didInitializeRuntime` Reviewed By: cipolleschi Differential Revision: D46704036 fbshipit-source-id: 6418bae56ae465f6ed9addde75d4de5719f402bb --- .../react/bridgeless/iostests/RCTHostTests.mm | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm index b3a7a1fb04e89e..606d2d9dabd1f1 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm @@ -134,15 +134,25 @@ - (void)testDidReceiveErrorStack stackFrame0[@"file"] = @"file2.js"; [stack addObject:stackFrame1]; - [instanceDelegate instance:OCMClassMock([RCTInstance class]) - didReceiveJSErrorStack:stack - message:@"message" - exceptionId:5 - isFatal:YES]; + [instanceDelegate instance:[OCMArg any] didReceiveJSErrorStack:stack message:@"message" exceptionId:5 isFatal:YES]; OCMVerify( OCMTimes(1), [_mockHostDelegate host:_subject didReceiveJSErrorStack:stack message:@"message" exceptionId:5 isFatal:YES]); } +- (void)testDidInitializeRuntime +{ + id mockRuntimeDelegate = OCMProtocolMock(@protocol(RCTHostRuntimeDelegate)); + _subject.runtimeDelegate = mockRuntimeDelegate; + + auto hermesRuntime = facebook::hermes::makeHermesRuntime(); + facebook::jsi::Runtime *rt = hermesRuntime.get(); + + id instanceDelegate = (id)_subject; + [instanceDelegate instance:[OCMArg any] didInitializeRuntime:*rt]; + + OCMVerify(OCMTimes(1), [mockRuntimeDelegate host:_subject didInitializeRuntime:*rt]); +} + @end From 8c9e37561f56d50a9f7bbd6d67eeab3f85c3a66e Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Wed, 14 Jun 2023 19:22:05 -0700 Subject: [PATCH 177/468] Remove usage of passthroughAnimatedPropExplicitValues in ScrollViewStickyHeader (#37867) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37867 No longer needed with D46574511. Changelog: [Internal] - Remove usage of passthroughAnimatedPropExplicitValues in ScrollViewStickyHeader Reviewed By: rshest Differential Revision: D46703731 fbshipit-source-id: 8c0f767083aa5f3791541f5ec05b5b1b625ab61f --- .../ScrollView/ScrollViewStickyHeader.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js b/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js index 866c4e97aaba7f..abcf74e4ce7544 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js @@ -262,17 +262,7 @@ const ScrollViewStickyHeaderWithForwardedRef: React.AbstractComponent< const child = React.Children.only<$FlowFixMe>(props.children); - // TODO T68319535: remove this if NativeAnimated is rewritten for Fabric - const passthroughAnimatedPropExplicitValues = - isFabric && translateY != null - ? { - style: {transform: [{translateY: translateY}]}, - } - : null; - return ( - /* $FlowFixMe[prop-missing] passthroughAnimatedPropExplicitValues isn't properly - included in the Animated.View flow type. */ + ]}> {React.cloneElement(child, { style: styles.fill, // We transfer the child style to the wrapper. onLayout: undefined, // we call this manually through our this._onLayout From 894b62ce90e3659e3aae866fd8a24b893569b3db Mon Sep 17 00:00:00 2001 From: Pieter Vanderwerff Date: Wed, 14 Jun 2023 21:18:55 -0700 Subject: [PATCH 178/468] Fix component type references in xplat (#37903) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37903 The name "component" in a function type contexts will be banned in future versions of Flow (the same other keywords like typeof are today). This diff renames the offending usages in xplat files. Changelog: [Internal] Reviewed By: gkz Differential Revision: D46748791 fbshipit-source-id: b8a51f63faad3b85232bd17a4bbe6ee7b0e4120f --- packages/react-native/Libraries/ReactNative/AppRegistry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/ReactNative/AppRegistry.js b/packages/react-native/Libraries/ReactNative/AppRegistry.js index 011bb45d45c84c..afd4f08cff0774 100644 --- a/packages/react-native/Libraries/ReactNative/AppRegistry.js +++ b/packages/react-native/Libraries/ReactNative/AppRegistry.js @@ -31,7 +31,7 @@ type TaskCancelProvider = () => TaskCanceller; export type ComponentProvider = () => React$ComponentType; export type ComponentProviderInstrumentationHook = ( - component: ComponentProvider, + component_: ComponentProvider, scopedPerformanceLogger: IPerformanceLogger, ) => React$ComponentType; export type AppConfig = { From 5cf8f43ab182781ea82e88077df425c3efbfc21f Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 15 Jun 2023 02:32:51 -0700 Subject: [PATCH 179/468] Re-enable direct debugging with JSC on iOS 16.4+ (#37874) Summary: See: https://webkit.org/blog/13936/enabling-the-inspection-of-web-content-in-apps As of iOS 16.4 and above, JSContexts are no longer inspectable by default. Without this, we cannot attach Safari Web Inspector to the JSContext, AKA, we can no longer direct debug. This is a simple change to re-enable that. I decided to extend the `availability` check to macOS and tvOS as I'm certain both out of tree platform forks will want this fix as well. ## Changelog: [IOS] [FIXED] - Re-enable direct debugging with JSC on iOS 16.4+ Pull Request resolved: https://github.com/facebook/react-native/pull/37874 Test Plan: I launched RNTester in an iOS 15, and iOS 16.4 simulator. I then verified that we can attach Safari Web inspector to both simulators' JSContexts. Reviewed By: cortinico Differential Revision: D46719890 Pulled By: huntie fbshipit-source-id: 7fa5ae244577b7dbf3c9c16e65ad530cfc3e9cbd --- packages/react-native/ReactCommon/jsc/JSCRuntime.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp index fea1d0bc2d33c7..93f20b828f0a93 100644 --- a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp +++ b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp @@ -398,6 +398,11 @@ JSCRuntime::JSCRuntime(JSGlobalContextRef ctx) stringCounter_(0) #endif { +#ifndef NDEBUG + if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) { + JSGlobalContextSetInspectable(ctx_, true); + } +#endif } JSCRuntime::~JSCRuntime() { From e6a2b2093c35aabf4a4a38b3a8e58fa91a7c5b42 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 15 Jun 2023 05:58:21 -0700 Subject: [PATCH 180/468] Revert D46719890: Re-enable direct debugging with JSC on iOS 16.4+ Differential Revision: D46719890 Original commit changeset: 7fa5ae244577 Original Phabricator Diff: D46719890 fbshipit-source-id: 1e5478d0fd0d09a678111b133cc46c4bdc8fc282 --- packages/react-native/ReactCommon/jsc/JSCRuntime.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp index 93f20b828f0a93..fea1d0bc2d33c7 100644 --- a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp +++ b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp @@ -398,11 +398,6 @@ JSCRuntime::JSCRuntime(JSGlobalContextRef ctx) stringCounter_(0) #endif { -#ifndef NDEBUG - if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) { - JSGlobalContextSetInspectable(ctx_, true); - } -#endif } JSCRuntime::~JSCRuntime() { From 7d4f233db32af0f8fbbe59de549532678ebf4b8e Mon Sep 17 00:00:00 2001 From: Ahmad Syarifuddin Randiko Date: Thu, 15 Jun 2023 06:03:04 -0700 Subject: [PATCH 181/468] (docs): fix license url (#37909) Summary: Update the license url on the documentation because it throws 404 page not found ## Changelog: [General] [Fixed] - License on the documentation throws 404 page not found Pull Request resolved: https://github.com/facebook/react-native/pull/37909 Test Plan: Click the LICENSE and should open the license page Reviewed By: GijsWeterings Differential Revision: D46760941 Pulled By: hoxyq fbshipit-source-id: f2522c51606ed5776aa6ae325143887749cc4d3a --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b42c65535c204..94f74a32d6b8e3 100644 --- a/README.md +++ b/README.md @@ -143,5 +143,5 @@ React Native is MIT licensed, as found in the [LICENSE][l] file. React Native documentation is Creative Commons licensed, as found in the [LICENSE-docs][ld] file. -[l]: https://github.com/facebook/react-native/blob/HEAD/LICENSE +[l]: https://github.com/facebook/react-native/blob/main/packages/react-native/LICENSE [ld]: https://github.com/facebook/react-native/blob/HEAD/LICENSE-docs From 09c95413ddf87cb844f4f17b5b7100ebcdcd51a1 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 15 Jun 2023 07:27:57 -0700 Subject: [PATCH 182/468] Use `fileExists` in replace_hermes script (#37911) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37911 Thanks to [adrianha](https://github.com/adrianha) for spotting a bug in the script that replace the Hermes engine. I miscopied the variable to check when there is no previous build file. This change uses the right variable and improves also the messages printed to the user. ## Changelog: [Internal] - Fix replace_hermes_version script using the right `fileExists` variable Reviewed By: dmytrorykun Differential Revision: D46762041 fbshipit-source-id: fdf3da6a598ecc657ee9313a2fa41e71c01d14ce --- .../sdks/hermes-engine/utils/replace_hermes_version.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js b/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js index 1ccc91b85f9e79..ce1bb48f542bd8 100644 --- a/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js +++ b/packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js @@ -34,15 +34,17 @@ function shouldReplaceHermesConfiguration(configuration) { console.log(`Found ${LAST_BUILD_FILENAME} file`); const oldConfiguration = fs.readFileSync(LAST_BUILD_FILENAME).toString(); if (oldConfiguration === configuration) { - console.log('No need to download a new build of Hermes!'); + console.log( + 'Same config of the previous build. No need to replace Hermes engine', + ); return false; } } // Assumption: if there is no stored last build, we assume that it was build for debug. - if (!fs.existsSync && configuration === 'Debug') { + if (!fileExists && configuration === 'Debug') { console.log( - 'File does not exists, but Debug configuration. No need to download a new build of Hermes!', + 'No previous build detected, but Debug Configuration. No need to replace Hermes engine', ); return false; } From 54a5ff9745ca8713b8d3a83dc37792ea71597b53 Mon Sep 17 00:00:00 2001 From: louiszawadzki Date: Thu, 15 Jun 2023 07:45:30 -0700 Subject: [PATCH 183/468] Set iOS AppState to inactive when app is launching (#37690) Summary: When an iOS app launches, the current `AppStateStatus` that is returned is `"unknown"`. However, `RCTSharedApplication().applicationState` returns `UIApplicationStateInactive` - which makes sense since the app is still showing its launch screen. I suggest to return `"inactive"` instead of `"unknown"`, since it makes more sense and `"unknown"` is not mentioned in the [official documentation](https://reactnative.dev/docs/appstate). I also edited the annotation for the `"inactive"` status type to make it more accurate. bypass-github-export-checks ## Changelog: [IOS] [CHANGED] - Set initial AppState status to "inactive" instead of "unknown" Pull Request resolved: https://github.com/facebook/react-native/pull/37690 Test Plan: I played a bit with the `rn-tester` app to display the `AppStateExample` [component](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/AppState/AppStateExample.js). I did not manage to display its content, but I managed to render it and log from [its render function](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/AppState/AppStateExample.js#L84). This is what I log in the `render` function: ![image](https://github.com/facebook/react-native/assets/8973379/76212f48-6d2e-4b14-b2a4-72c58e39bf3d) Here is the log I saw before the change: ![image](https://github.com/facebook/react-native/assets/8973379/f3c56047-dfca-4bad-b676-0fc79b990dd9) and after the change: ![image](https://github.com/facebook/react-native/assets/8973379/8de84b31-69a7-4547-b251-483ddde68e25) Reviewed By: cortinico Differential Revision: D46729548 Pulled By: cipolleschi fbshipit-source-id: 18d2d606e0b77306811bd898b28858746c713e12 --- packages/react-native/Libraries/AppState/AppState.d.ts | 2 +- packages/react-native/React/CoreModules/RCTAppState.mm | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/AppState/AppState.d.ts b/packages/react-native/Libraries/AppState/AppState.d.ts index 45beaca9bde90b..6333c8190565ce 100644 --- a/packages/react-native/Libraries/AppState/AppState.d.ts +++ b/packages/react-native/Libraries/AppState/AppState.d.ts @@ -24,7 +24,7 @@ import {NativeEventSubscription} from '../EventEmitter/RCTNativeAppEventEmitter' * App States * active - The app is running in the foreground * background - The app is running in the background. The user is either in another app or on the home screen - * inactive [iOS] - This is a transition state that currently never happens for typical React Native apps. + * inactive [iOS] - This is a transition state that happens when the app launches, is asking for permissions or when a call or SMS message is received. * unknown [iOS] - Initial value until the current app state is determined * extension [iOS] - The app is running as an app extension * diff --git a/packages/react-native/React/CoreModules/RCTAppState.mm b/packages/react-native/React/CoreModules/RCTAppState.mm index 389aa6d642dfd0..0aa63fc6b53390 100644 --- a/packages/react-native/React/CoreModules/RCTAppState.mm +++ b/packages/react-native/React/CoreModules/RCTAppState.mm @@ -20,7 +20,11 @@ static NSDictionary *states; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - states = @{@(UIApplicationStateActive) : @"active", @(UIApplicationStateBackground) : @"background"}; + states = @{ + @(UIApplicationStateActive) : @"active", + @(UIApplicationStateBackground) : @"background", + @(UIApplicationStateInactive) : @"inactive" + }; }); if (RCTRunningInAppExtension()) { From dc2037c0f1c06fe2a176ea48c6f255d10fa9e4b7 Mon Sep 17 00:00:00 2001 From: Pieter Vanderwerff Date: Thu, 15 Jun 2023 08:23:06 -0700 Subject: [PATCH 184/468] Switch xplat prettier config to hermes plugin (#37915) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37915 Enable the `prettier-plugin-hermes-parser` in xplat. This plugin enables the use of `hermes-parser` which is significantly faster than the current flow parser prettier bundles (improves formatting time by ~50%) and also brings support for the latest Prettier 3.0.0 printing logic for JS. This upgrade is required in order to enable upcoming Flow features that add new syntax. Changelog: [Internal] Reviewed By: SamChou19815 Differential Revision: D46748891 fbshipit-source-id: 3775ef9afa7c04e565fa4fcf8ca5b410f49d35a1 --- .prettierrc | 12 +++++- jest/preprocessor.js | 5 ++- package.json | 1 + .../Animated/nodes/AnimatedValueXY.js | 20 ++-------- .../ScrollView/ScrollViewStickyHeader.js | 13 ++++++- .../Libraries/Core/setUpRegeneratorRuntime.js | 6 ++- .../Interaction/JSEventLoopWatchdog.js | 6 +-- .../LogBox/UI/LogBoxInspectorHeader.js | 2 +- packages/react-native/cli.js | 8 ++-- ...PointerEventAttributesHoverablePointers.js | 17 ++++---- .../PointerEventAttributesNoHoverPointers.js | 17 ++++---- .../PointerEventPrimaryTouchPointer.js | 39 +++++++++++-------- .../Lists/VirtualizedListContext.js | 4 +- yarn.lock | 20 ++++++++++ 14 files changed, 103 insertions(+), 67 deletions(-) diff --git a/.prettierrc b/.prettierrc index fd47e617ecc8ea..8a48dc429e1577 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,5 +5,15 @@ "requirePragma": true, "singleQuote": true, "trailingComma": "all", - "endOfLine": "lf" + "endOfLine": "lf", + "overrides": [ + { + "files": [ + "*.js" + ], + "options": { + "parser": "hermes" + } + } + ] } diff --git a/jest/preprocessor.js b/jest/preprocessor.js index cc0a5af4618e59..b971b4260c769f 100644 --- a/jest/preprocessor.js +++ b/jest/preprocessor.js @@ -89,9 +89,10 @@ module.exports = { ); }, - getCacheKey: (createCacheKeyFunction([ + // $FlowFixMe[signature-verification-failure] + getCacheKey: createCacheKeyFunction([ __filename, require.resolve('metro-react-native-babel-transformer'), require.resolve('@babel/core/package.json'), - ]) /*: any */), + ]), }; diff --git a/package.json b/package.json index 5f6c53b84442e5..53497018976d39 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,7 @@ "mkdirp": "^0.5.1", "mock-fs": "^5.1.4", "prettier": "2.8.8", + "prettier-plugin-hermes-parser": "0.12.1", "react": "18.2.0", "react-test-renderer": "18.2.0", "shelljs": "^0.8.5", diff --git a/packages/react-native/Libraries/Animated/nodes/AnimatedValueXY.js b/packages/react-native/Libraries/Animated/nodes/AnimatedValueXY.js index dc24a674bba4a7..fa4a82320e3069 100644 --- a/packages/react-native/Libraries/Animated/nodes/AnimatedValueXY.js +++ b/packages/react-native/Libraries/Animated/nodes/AnimatedValueXY.js @@ -19,11 +19,7 @@ import invariant from 'invariant'; export type AnimatedValueXYConfig = $ReadOnly<{ useNativeDriver: boolean, }>; -type ValueXYListenerCallback = (value: { - x: number, - y: number, - ... -}) => mixed; +type ValueXYListenerCallback = (value: {x: number, y: number, ...}) => mixed; let _uniqueId = 1; @@ -135,11 +131,7 @@ export default class AnimatedValueXY extends AnimatedWithChildren { * See https://reactnative.dev/docs/animatedvaluexy#resetanimation */ resetAnimation( - callback?: (value: { - x: number, - y: number, - ... - }) => void, + callback?: (value: {x: number, y: number, ...}) => void, ): void { this.x.resetAnimation(); this.y.resetAnimation(); @@ -153,13 +145,7 @@ export default class AnimatedValueXY extends AnimatedWithChildren { * * See https://reactnative.dev/docs/animatedvaluexy#stopanimation */ - stopAnimation( - callback?: (value: { - x: number, - y: number, - ... - }) => void, - ): void { + stopAnimation(callback?: (value: {x: number, y: number, ...}) => void): void { this.x.stopAnimation(); this.y.stopAnimation(); callback && callback(this.__getValue()); diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js b/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js index abcf74e4ce7544..acb737fdfa593d 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js @@ -246,7 +246,18 @@ const ScrollViewStickyHeaderWithForwardedRef: React.AbstractComponent< clearTimeout(_timer.current); } }; - }, [nextHeaderLayoutY, measured, layoutHeight, layoutY, scrollViewHeight, scrollAnimatedValue, inverted, offset, animatedValueListener, isFabric]); + }, [ + nextHeaderLayoutY, + measured, + layoutHeight, + layoutY, + scrollViewHeight, + scrollAnimatedValue, + inverted, + offset, + animatedValueListener, + isFabric, + ]); const _onLayout = (event: LayoutEvent) => { setLayoutY(event.nativeEvent.layout.y); diff --git a/packages/react-native/Libraries/Core/setUpRegeneratorRuntime.js b/packages/react-native/Libraries/Core/setUpRegeneratorRuntime.js index 425e715a1e3f5e..c334acca7cdd3f 100644 --- a/packages/react-native/Libraries/Core/setUpRegeneratorRuntime.js +++ b/packages/react-native/Libraries/Core/setUpRegeneratorRuntime.js @@ -22,8 +22,10 @@ let hasNativeGenerator; try { // If this function was lowered by regenerator-transform, it will try to // access `global.regeneratorRuntime` which doesn't exist yet and will throw. - hasNativeGenerator = hasNativeConstructor(function* () {}, - 'GeneratorFunction'); + hasNativeGenerator = hasNativeConstructor( + function* () {}, + 'GeneratorFunction', + ); } catch { // In this case, we know generators are not provided natively. hasNativeGenerator = false; diff --git a/packages/react-native/Libraries/Interaction/JSEventLoopWatchdog.js b/packages/react-native/Libraries/Interaction/JSEventLoopWatchdog.js index 113d073ee7000c..1db16e53ed7abe 100644 --- a/packages/react-native/Libraries/Interaction/JSEventLoopWatchdog.js +++ b/packages/react-native/Libraries/Interaction/JSEventLoopWatchdog.js @@ -14,11 +14,7 @@ const infoLog = require('../Utilities/infoLog'); type Handler = { onIterate?: () => void, - onStall: (params: { - lastInterval: number, - busyTime: number, - ... - }) => ?string, + onStall: (params: {lastInterval: number, busyTime: number, ...}) => ?string, ... }; diff --git a/packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js b/packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js index 097f152ed9f2d7..1f578db82f0f26 100644 --- a/packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js +++ b/packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js @@ -88,7 +88,7 @@ const backgroundForLevel = (level: LogLevel) => default: 'transparent', pressed: LogBoxStyle.getFatalDarkColor(), }, - }[level]); + })[level]; function LogBoxInspectorHeaderButton( props: $ReadOnly<{| diff --git a/packages/react-native/cli.js b/packages/react-native/cli.js index 301a51241fbeae..451c0860fc0bf0 100755 --- a/packages/react-native/cli.js +++ b/packages/react-native/cli.js @@ -56,10 +56,10 @@ async function main() { if (latest !== currentVersion) { const msg = ` ${chalk.bold.yellow('WARNING:')} You should run ${chalk.white.bold( - 'npx react-native@latest', - )} to ensure you're always using the most current version of the CLI. NPX has cached version (${chalk.bold.yellow( - currentVersion, - )}) != current release (${chalk.bold.green(latest)}) + 'npx react-native@latest', + )} to ensure you're always using the most current version of the CLI. NPX has cached version (${chalk.bold.yellow( + currentVersion, + )}) != current release (${chalk.bold.green(latest)}) `; console.warn(msg); } diff --git a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAttributesHoverablePointers.js b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAttributesHoverablePointers.js index 384430805e12b9..79a5556b87821e 100644 --- a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAttributesHoverablePointers.js +++ b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAttributesHoverablePointers.js @@ -67,13 +67,16 @@ function PointerEventAttributesHoverablePointersTestCase( testNamePrefix + ' ' + expectedPointerType + ' ' + expectedEventType; detected_pointertypes[event.nativeEvent.pointerType] = true; - harness.test(({assert_equals}) => { - assert_equals( - eventType, - expectedEventType, - 'Event.type should be ' + expectedEventType, - ); - }, pointerTestName + "'s type should be " + expectedEventType); + harness.test( + ({assert_equals}) => { + assert_equals( + eventType, + expectedEventType, + 'Event.type should be ' + expectedEventType, + ); + }, + pointerTestName + "'s type should be " + expectedEventType, + ); // Test button and buttons if (eventType === 'pointerdown') { diff --git a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAttributesNoHoverPointers.js b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAttributesNoHoverPointers.js index bedfc48181a8a9..c9894ae6cf3763 100644 --- a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAttributesNoHoverPointers.js +++ b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventAttributesNoHoverPointers.js @@ -66,13 +66,16 @@ function PointerEventAttributesNoHoverPointersTestCase( testNamePrefix + ' ' + expectedPointerType + ' ' + expectedEventType; detected_pointertypes[event.nativeEvent.pointerType] = true; - harness.test(({assert_equals}) => { - assert_equals( - eventType, - expectedEventType, - 'Event.type should be ' + expectedEventType, - ); - }, pointerTestName + "'s type should be " + expectedEventType); + harness.test( + ({assert_equals}) => { + assert_equals( + eventType, + expectedEventType, + 'Event.type should be ' + expectedEventType, + ); + }, + pointerTestName + "'s type should be " + expectedEventType, + ); // Test button and buttons harness.test(({assert_equals}) => { diff --git a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js index 140f1da72861fb..cd643c420353e7 100644 --- a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js +++ b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventPrimaryTouchPointer.js @@ -62,23 +62,28 @@ function PointerEventPrimaryTouchPointerTestCase( expectedOrder[Object.keys(detected_events).length]; detected_events[pointerEventIdentifier] = true; - harness.test(({assert_equals}) => { - assert_equals( - boxLabel, - expectedBoxLabel, - 'event should be coming from the correct box', - ); - assert_equals( - eventType, - expectedEventType.toLowerCase(), - 'event should have the right type', - ); - assert_equals( - isPrimary, - expectedIsPrimary, - 'event should be correctly primary', - ); - }, `${expectedBoxLabel} box's ${expectedEventType} should${!expectedIsPrimary ? ' not' : ''} be marked as the primary pointer`); + harness.test( + ({assert_equals}) => { + assert_equals( + boxLabel, + expectedBoxLabel, + 'event should be coming from the correct box', + ); + assert_equals( + eventType, + expectedEventType.toLowerCase(), + 'event should have the right type', + ); + assert_equals( + isPrimary, + expectedIsPrimary, + 'event should be correctly primary', + ); + }, + `${expectedBoxLabel} box's ${expectedEventType} should${ + !expectedIsPrimary ? ' not' : '' + } be marked as the primary pointer`, + ); }, [harness], ); diff --git a/packages/virtualized-lists/Lists/VirtualizedListContext.js b/packages/virtualized-lists/Lists/VirtualizedListContext.js index bca5724498a356..b40128f2dd2b26 100644 --- a/packages/virtualized-lists/Lists/VirtualizedListContext.js +++ b/packages/virtualized-lists/Lists/VirtualizedListContext.js @@ -31,9 +31,7 @@ type Context = $ReadOnly<{ cellKey: string, ref: React.ElementRef, }) => void, - unregisterAsNestedChild: ({ - ref: React.ElementRef, - }) => void, + unregisterAsNestedChild: ({ref: React.ElementRef}) => void, }>; export const VirtualizedListContext: React.Context = diff --git a/yarn.lock b/yarn.lock index 91d2aeb3bf9964..91bec52806c02b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5311,6 +5311,11 @@ hermes-estree@0.12.0: resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.12.0.tgz#8a289f9aee854854422345e6995a48613bac2ca8" integrity sha512-+e8xR6SCen0wyAKrMT3UD0ZCCLymKhRgjEB5sS28rKiFir/fXgLoeRilRUssFCILmGHb+OvHDUlhxs0+IEyvQw== +hermes-estree@0.12.1: + version "0.12.1" + resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.12.1.tgz#74901ee351387fecbf3c683c90b1fa7d22f1c6f0" + integrity sha512-IWnP3rEZnuEq64IGM/sNsp+QCQcCAAu5TMallJ7bpUw0YUfk5q6cA7tvBGo/D0kGyo5jASc4Yp/CQCsLSSMfGQ== + hermes-estree@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/hermes-estree/-/hermes-estree-0.8.0.tgz#530be27243ca49f008381c1f3e8b18fb26bf9ec0" @@ -5323,6 +5328,13 @@ hermes-parser@0.12.0: dependencies: hermes-estree "0.12.0" +hermes-parser@0.12.1: + version "0.12.1" + resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.12.1.tgz#e60595f05ecd13026c614ca5d9db2eaefe971301" + integrity sha512-53aep6osCq1GiSIlbe7ltPD9v0GeAUtGlaMhgKexGjePoI66GnalLR5aPeuIZbExBQAb+af/kiXT3yxBweuXUA== + dependencies: + hermes-estree "0.12.1" + hermes-parser@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/hermes-parser/-/hermes-parser-0.8.0.tgz#116dceaba32e45b16d6aefb5c4c830eaeba2d257" @@ -7589,6 +7601,14 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" +prettier-plugin-hermes-parser@0.12.1: + version "0.12.1" + resolved "https://registry.yarnpkg.com/prettier-plugin-hermes-parser/-/prettier-plugin-hermes-parser-0.12.1.tgz#5c1ec4c18cea9c4b88478fa27f172e3f849b40b6" + integrity sha512-Letp5jjP/lpw/zpqKmtuDytQ2fP5M5dExcdUqIZknOwf+cXLirHaDddxz3gqzUJrpU4WzuaC0x3nfcH1Hi0Tng== + dependencies: + hermes-estree "0.12.1" + hermes-parser "0.12.1" + prettier@2.8.8: version "2.8.8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" From abc6e1cbf4cf9775205b0246404b0059a5838fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Van=20der=20Auwermeulen?= Date: Thu, 15 Jun 2023 08:58:24 -0700 Subject: [PATCH 185/468] feat: allow custom assignment of rootView to rootViewController (#37873) Summary: To use a native Drawer on iPad, I can override `createRootViewController` to create a `UISplitViewController` instead of a `UIViewController`, but I then need to assign the rootView with ```objective-c [splitViewController setViewController:mainVC forColumn:UISplitViewControllerColumnSecondary]; ``` which I can currently only do by copy pasting the entire `didFinishLaunchingWithOptions` and only replacing the assignment ```objective-c rootViewController.view = rootView; ``` In an attempt of making it easier for developers to use a native drawer in iOS, being able to override the assignment would make it easier. bypass-github-export-checks ## Changelog: [iOS] [ADDED] - added override method with default implementation Pull Request resolved: https://github.com/facebook/react-native/pull/37873 Test Plan: Tested on iPad iOS 16 simulator Reviewed By: cortinico Differential Revision: D46761919 Pulled By: cipolleschi fbshipit-source-id: c3ece0170d732133edc08f220a2f9a67da93815a --- .../Libraries/AppDelegate/RCTAppDelegate.h | 11 +++++++++++ .../Libraries/AppDelegate/RCTAppDelegate.mm | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h index f2df4437c3da92..52763c21c4b7e9 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h @@ -36,6 +36,7 @@ * - (UIView *)createRootViewWithBridge:(RCTBridge *)bridge moduleName:(NSString*)moduleName initProps:(NSDictionary *)initProps; * - (UIViewController *)createRootViewController; + * - (void)setRootView:(UIView *)rootView toRootViewController:(UIViewController *)rootViewController; * New Architecture: * - (BOOL)concurrentRootEnabled * - (BOOL)turboModuleEnabled; @@ -94,6 +95,16 @@ */ - (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:)` + * + * @return: void + */ +- (void)setRootView:(UIView *)rootView toRootViewController:(UIViewController *)rootViewController; + /// This method controls whether the App will use RuntimeScheduler. Only applicable in the legacy architecture. /// /// @return: `YES` to use RuntimeScheduler, `NO` to use JavaScript scheduler. The default value is `YES`. diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 808c315c2f1bf4..ecc438ca4a4f7a 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -77,7 +77,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [self createRootViewController]; - rootViewController.view = rootView; + [self setRootView:rootView toRootViewController:rootViewController]; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; @@ -129,6 +129,11 @@ - (UIViewController *)createRootViewController return [UIViewController new]; } +- (void)setRootView:(UIView *)rootView toRootViewController:(UIViewController *)rootViewController +{ + rootViewController.view = rootView; +} + - (BOOL)runtimeSchedulerEnabled { return YES; From 1561d2906e712bc5f0f6fd12fe60ae495d48a8c8 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Thu, 15 Jun 2023 11:44:26 -0700 Subject: [PATCH 186/468] Make React-utils its own pod (#37659) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37659 changelog: [internal] To better align with how BUCK is setup internally, let's make React utils its own pod. Reviewed By: dmytrorykun Differential Revision: D46358021 fbshipit-source-id: c2a48a18e9839a508a87d54685115883975f3979 --- .../AppDelegate/React-RCTAppDelegate.podspec | 2 + packages/react-native/React-Core.podspec | 1 + .../React/React-RCTFabric.podspec | 2 + .../ReactCommon/React-Fabric.podspec | 8 +- .../platform/ios/React-ImageManager.podspec | 4 +- .../react/utils/React-utils.podspec | 57 +++++++ .../cocoapods/__tests__/codegen_utils-test.rb | 5 +- .../__tests__/new_architecture-test.rb | 5 +- .../scripts/cocoapods/codegen_utils.rb | 2 + .../scripts/cocoapods/new_architecture.rb | 2 + .../react-native/scripts/react_native_pods.rb | 1 + packages/rn-tester/Podfile.lock | 157 +++++++++++------- 12 files changed, 176 insertions(+), 70 deletions(-) create mode 100644 packages/react-native/ReactCommon/react/utils/React-utils.podspec diff --git a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec index 9888ded6fb3b8e..c22ba9279aeb76 100644 --- a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec +++ b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec @@ -49,6 +49,7 @@ header_search_paths = [ "$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", "$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers/", "$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers/", + "${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers/" ] : []).map{|p| "\"#{p}\""}.join(" ") Pod::Spec.new do |s| @@ -93,6 +94,7 @@ Pod::Spec.new do |s| s.dependency "React-RCTFabric" s.dependency "React-graphics" s.dependency "React-debug" + s.dependency "React-utils" s.script_phases = { :name => "Generate Legacy Components Interop", diff --git a/packages/react-native/React-Core.podspec b/packages/react-native/React-Core.podspec index fe840820e65520..2fad76d2d9726a 100644 --- a/packages/react-native/React-Core.podspec +++ b/packages/react-native/React-Core.podspec @@ -130,6 +130,7 @@ Pod::Spec.new do |s| s.dependency "React-perflogger", version s.dependency "React-jsi", version s.dependency "React-jsiexecutor", version + s.dependency "React-utils" s.dependency "SocketRocket", socket_rocket_version s.dependency "Yoga" s.dependency "glog" diff --git a/packages/react-native/React/React-RCTFabric.podspec b/packages/react-native/React/React-RCTFabric.podspec index 543f01691cb084..1c1ac9f67937b7 100644 --- a/packages/react-native/React/React-RCTFabric.podspec +++ b/packages/react-native/React/React-RCTFabric.podspec @@ -44,6 +44,7 @@ if ENV['USE_FRAMEWORKS'] header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-ImageManager/React_ImageManager.framework/Headers\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\"" header_search_paths << "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"" + header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" end Pod::Spec.new do |s| @@ -81,6 +82,7 @@ Pod::Spec.new do |s| s.dependency "React-RCTText" s.dependency "React-FabricImage" s.dependency "React-debug" + s.dependency "React-utils" if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" s.dependency "hermes-engine" diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index 96cef2b9e79049..1f5a9b955fd5ea 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -52,7 +52,7 @@ Pod::Spec.new do |s| s.dependency "DoubleConversion" s.dependency "React-Core" s.dependency "React-debug" - # s.dependency "React-utils" + s.dependency "React-utils" # s.dependency "React-runtimescheduler" s.dependency "React-cxxreact" @@ -324,10 +324,4 @@ Pod::Spec.new do |s| ss.header_dir = "react/renderer/runtimescheduler" ss.pod_target_xcconfig = { "GCC_WARN_PEDANTIC" => "YES" } end - - s.subspec "utils" do |ss| - ss.source_files = "react/utils/*.{m,mm,cpp,h}" - ss.header_dir = "react/utils" - end - end diff --git a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec index a5f2bd21334955..5dd7f9ef452028 100644 --- a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +++ b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec @@ -48,7 +48,8 @@ Pod::Spec.new do |s| "\"$(PODS_ROOT)/DoubleConversion\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\"", - "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"" + "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" ] end @@ -63,5 +64,6 @@ Pod::Spec.new do |s| s.dependency "React-Core/Default" s.dependency "React-RCTImage" s.dependency "React-debug" + s.dependency "React-utils" s.dependency "glog" end diff --git a/packages/react-native/ReactCommon/react/utils/React-utils.podspec b/packages/react-native/ReactCommon/react/utils/React-utils.podspec new file mode 100644 index 00000000000000..d262c559241052 --- /dev/null +++ b/packages/react-native/ReactCommon/react/utils/React-utils.podspec @@ -0,0 +1,57 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json"))) +version = package['version'] + +source = { :git => 'https://github.com/facebook/react-native.git' } +if version == '1000.0.0' + # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. + source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1") +else + source[:tag] = "v#{version}" +end + +folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' +folly_version = '2021.07.22.00' + +header_search_paths = [ + "\"$(PODS_ROOT)/RCT-Folly\"", + "\"$(PODS_TARGET_SRCROOT)\"", + "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"", +] + +if ENV["USE_FRAMEWORKS"] + header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"" +end + +Pod::Spec.new do |s| + s.name = "React-utils" + s.version = version + s.summary = "-" # TODO + s.homepage = "https://reactnative.dev/" + s.license = package["license"] + s.author = "Meta Platforms, Inc. and its affiliates" + s.platforms = { :ios => min_ios_version_supported } + s.source = source + s.source_files = "**/*.{cpp,h,mm}" + s.compiler_flags = folly_compiler_flags + s.header_dir = "react/utils" + s.exclude_files = "tests" + s.pod_target_xcconfig = { + "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", + "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')} + + if ENV['USE_FRAMEWORKS'] + s.module_name = "React_utils" + s.header_mappings_dir = "../.." + end + + s.dependency "RCT-Folly", folly_version + s.dependency "React-debug" + s.dependency "glog" +end diff --git a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb index b738548d5cf945..297ed18bca59bb 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb @@ -578,7 +578,7 @@ def get_podspec_fabric_and_script_phases(script_phases) 'React-rncore': [], 'React-Fabric': [], 'React-debug': [], - + 'React-utils': [], }) specs[:'script_phases'] = script_phases @@ -590,12 +590,13 @@ def get_podspec_when_use_frameworks specs = get_podspec_no_fabric_no_script() specs["pod_target_xcconfig"]["FRAMEWORK_SEARCH_PATHS"].concat([]) - specs["pod_target_xcconfig"]["HEADER_SEARCH_PATHS"].concat(" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-FabricImage/React_FabricImage.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"") + specs["pod_target_xcconfig"]["HEADER_SEARCH_PATHS"].concat(" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-FabricImage/React_FabricImage.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"") specs[:dependencies].merge!({ 'React-graphics': [], 'React-Fabric': [], 'React-debug': [], + 'React-utils': [], }) return specs diff --git a/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb b/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb index 702d02982c2c4b..1f0c04c216a168 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb @@ -129,7 +129,7 @@ def test_installModulesDependencies_whenNewArchEnabledAndNewArchAndNoSearchPaths # Assert assert_equal(spec.compiler_flags, NewArchitectureHelper.folly_compiler_flags) - assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"") + assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"") assert_equal(spec.pod_target_xcconfig["CLANG_CXX_LANGUAGE_STANDARD"], "c++17") assert_equal(spec.pod_target_xcconfig["OTHER_CPLUSPLUSFLAGS"], "$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1") assert_equal( @@ -149,6 +149,7 @@ def test_installModulesDependencies_whenNewArchEnabledAndNewArchAndNoSearchPaths { :dependency_name => "React-Fabric" }, { :dependency_name => "React-graphics" }, { :dependency_name => "React-debug" }, + { :dependency_name => "React-utils" }, { :dependency_name => "hermes-engine" } ]) end @@ -167,7 +168,7 @@ def test_installModulesDependencies_whenNewArchDisabledAndSearchPathsAndCompiler # Assert assert_equal(spec.compiler_flags, "-Wno-nullability-completeness #{NewArchitectureHelper.folly_compiler_flags}") - assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "#{other_flags} \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"") + assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "#{other_flags} \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"") assert_equal(spec.pod_target_xcconfig["CLANG_CXX_LANGUAGE_STANDARD"], "c++17") assert_equal( spec.dependencies, diff --git a/packages/react-native/scripts/cocoapods/codegen_utils.rb b/packages/react-native/scripts/cocoapods/codegen_utils.rb index 97715206cf5e17..1ea549fa094961 100644 --- a/packages/react-native/scripts/cocoapods/codegen_utils.rb +++ b/packages/react-native/scripts/cocoapods/codegen_utils.rb @@ -101,6 +101,7 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"", "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers\"", "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" ]) end @@ -142,6 +143,7 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa 'React-graphics': [], 'React-Fabric': [], 'React-debug': [], + 'React-utils': [], }); end diff --git a/packages/react-native/scripts/cocoapods/new_architecture.rb b/packages/react-native/scripts/cocoapods/new_architecture.rb index 3b128b01d29d3d..b9a51834c91269 100644 --- a/packages/react-native/scripts/cocoapods/new_architecture.rb +++ b/packages/react-native/scripts/cocoapods/new_architecture.rb @@ -110,6 +110,7 @@ def self.install_modules_dependencies(spec, new_arch_enabled, folly_version) header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"" + header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" end header_search_paths_string = header_search_paths.join(" ") spec.compiler_flags = compiler_flags.empty? ? @@folly_compiler_flags : "#{compiler_flags} #{@@folly_compiler_flags}" @@ -137,6 +138,7 @@ def self.install_modules_dependencies(spec, new_arch_enabled, folly_version) spec.dependency "React-Fabric" spec.dependency "React-graphics" spec.dependency "React-debug" + spec.dependency "React-utils" if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" spec.dependency "hermes-engine" diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index eb55940a379eb4..40d5ee3b2b2579 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -118,6 +118,7 @@ def use_react_native! ( pod 'React-rncore', :path => "#{prefix}/ReactCommon" pod 'React-cxxreact', :path => "#{prefix}/ReactCommon/cxxreact" pod 'React-debug', :path => "#{prefix}/ReactCommon/react/debug" + pod 'React-utils', :path => "#{prefix}/ReactCommon/react/utils" if hermes_enabled setup_hermes!(:react_native_path => prefix, :fabric_enabled => fabric_enabled) diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 75cf0dff61df6d..b595f3ccdc18c0 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -137,6 +137,7 @@ PODS: - React-jsiexecutor - React-NativeModulesApple - React-rncore + - React-utils - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - React-Core (1000.0.0): @@ -149,6 +150,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/CoreModulesHeaders (1000.0.0): @@ -161,6 +163,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/Default (1000.0.0): @@ -172,6 +175,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/DevSupport (1000.0.0): @@ -186,6 +190,7 @@ PODS: - React-jsiexecutor (= 1000.0.0) - React-jsinspector (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTActionSheetHeaders (1000.0.0): @@ -198,6 +203,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTAnimationHeaders (1000.0.0): @@ -210,6 +216,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTBlobHeaders (1000.0.0): @@ -222,6 +229,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTImageHeaders (1000.0.0): @@ -234,6 +242,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTLinkingHeaders (1000.0.0): @@ -246,6 +255,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTNetworkHeaders (1000.0.0): @@ -258,6 +268,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTPushNotificationHeaders (1000.0.0): @@ -270,6 +281,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTSettingsHeaders (1000.0.0): @@ -282,6 +294,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTTextHeaders (1000.0.0): @@ -294,6 +307,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTVibrationHeaders (1000.0.0): @@ -306,6 +320,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-Core/RCTWebSocket (1000.0.0): @@ -318,6 +333,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-perflogger (= 1000.0.0) + - React-utils - SocketRocket (= 0.6.0) - Yoga - React-CoreModules (1000.0.0): @@ -372,11 +388,11 @@ PODS: - React-Fabric/templateprocessor (= 1000.0.0) - React-Fabric/textlayoutmanager (= 1000.0.0) - React-Fabric/uimanager (= 1000.0.0) - - React-Fabric/utils (= 1000.0.0) - React-graphics (= 1000.0.0) - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/animations (1000.0.0): - DoubleConversion @@ -392,6 +408,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/attributedstring (1000.0.0): - DoubleConversion @@ -407,6 +424,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/butter (1000.0.0): - DoubleConversion @@ -422,6 +440,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/componentregistry (1000.0.0): - DoubleConversion @@ -437,6 +456,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/componentregistrynative (1000.0.0): - DoubleConversion @@ -452,6 +472,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components (1000.0.0): - DoubleConversion @@ -478,6 +499,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/inputaccessory (1000.0.0): - DoubleConversion @@ -493,6 +515,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/legacyviewmanagerinterop (1000.0.0): - DoubleConversion @@ -508,6 +531,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/modal (1000.0.0): - DoubleConversion @@ -523,6 +547,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/rncore (1000.0.0): - DoubleConversion @@ -538,6 +563,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/root (1000.0.0): - DoubleConversion @@ -553,6 +579,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/safeareaview (1000.0.0): - DoubleConversion @@ -568,6 +595,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/scrollview (1000.0.0): - DoubleConversion @@ -583,6 +611,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/text (1000.0.0): - DoubleConversion @@ -598,6 +627,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/textinput (1000.0.0): - DoubleConversion @@ -613,6 +643,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/unimplementedview (1000.0.0): - DoubleConversion @@ -628,6 +659,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/view (1000.0.0): - DoubleConversion @@ -643,6 +675,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - Yoga - React-Fabric/config (1000.0.0): @@ -659,6 +692,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/core (1000.0.0): - DoubleConversion @@ -674,6 +708,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/debug_renderer (1000.0.0): - DoubleConversion @@ -689,6 +724,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/imagemanager (1000.0.0): - DoubleConversion @@ -704,6 +740,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/leakchecker (1000.0.0): - DoubleConversion @@ -719,6 +756,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/mapbuffer (1000.0.0): - DoubleConversion @@ -734,6 +772,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/mounting (1000.0.0): - DoubleConversion @@ -749,6 +788,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/runtimescheduler (1000.0.0): - DoubleConversion @@ -764,6 +804,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/scheduler (1000.0.0): - DoubleConversion @@ -779,6 +820,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/telemetry (1000.0.0): - DoubleConversion @@ -794,6 +836,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/templateprocessor (1000.0.0): - DoubleConversion @@ -809,6 +852,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/textlayoutmanager (1000.0.0): - DoubleConversion @@ -825,6 +869,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/uimanager (1000.0.0): - DoubleConversion @@ -840,21 +885,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger - - ReactCommon/turbomodule/core (= 1000.0.0) - - React-Fabric/utils (1000.0.0): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 1000.0.0) - - RCTTypeSafety (= 1000.0.0) - - React-Core - - React-cxxreact - - React-debug - - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) - - React-jsiexecutor (= 1000.0.0) - - React-logger + - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-FabricImage (1000.0.0): - DoubleConversion @@ -893,6 +924,7 @@ PODS: - React-debug - React-Fabric - React-RCTImage + - React-utils - React-jsi (1000.0.0): - boost (= 1.76.0) - DoubleConversion @@ -962,6 +994,7 @@ PODS: - React-ImageManager - React-RCTImage (= 1000.0.0) - React-RCTText + - React-utils - Yoga - React-RCTImage (1000.0.0): - RCT-Folly (= 2021.07.22.00) @@ -1013,6 +1046,10 @@ PODS: - React-rncore (1000.0.0) - React-runtimeexecutor (1000.0.0): - React-jsi (= 1000.0.0) + - React-utils (1000.0.0): + - glog + - RCT-Folly (= 2021.07.22.00) + - React-debug - ReactCommon-Samples (1000.0.0): - DoubleConversion - hermes-engine @@ -1120,6 +1157,7 @@ DEPENDENCIES: - React-RCTVibration (from `../react-native/Libraries/Vibration`) - React-rncore (from `../react-native/ReactCommon`) - React-runtimeexecutor (from `../react-native/ReactCommon/runtimeexecutor`) + - React-utils (from `../react-native/ReactCommon/react/utils`) - ReactCommon-Samples (from `../react-native/ReactCommon/react/nativemodule/samples`) - ReactCommon/turbomodule/core (from `../react-native/ReactCommon`) - ScreenshotManager (from `NativeModuleExample`) @@ -1229,6 +1267,8 @@ EXTERNAL SOURCES: :path: "../react-native/ReactCommon" React-runtimeexecutor: :path: "../react-native/ReactCommon/runtimeexecutor" + React-utils: + :path: "../react-native/ReactCommon/react/utils" ReactCommon: :path: "../react-native/ReactCommon" ReactCommon-Samples: @@ -1242,8 +1282,8 @@ SPEC CHECKSUMS: boost: 57d2868c099736d80fcd648bf211b4431e51a558 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 - FBLazyVector: ca580232ba491b6601ee57bcdc874fda97a459a5 - FBReactNativeSpec: 4db5acd51db3de49e59e3740f03c94ce1282a31e + FBLazyVector: f4492a543c5a8fa1502d3a5867e3f7252497cfe8 + FBReactNativeSpec: 7a256eec25705f77ac6d6c6187ec2d89a180fa6c Flipper: 6edb735e6c3e332975d1b17956bcc584eccf5818 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 @@ -1254,53 +1294,54 @@ SPEC CHECKSUMS: FlipperKit: 2efad7007d6745a3f95e4034d547be637f89d3f6 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 99bd064df01718db56b8f75e6b5ea3051c7dad0a - hermes-engine: 4ea4b12e82d2ccfd03b29e3d9191b716b4c8f476 + hermes-engine: 3d4707423e276e19d41573fc74ac39cf57c56b17 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c RCT-Folly: b0d1393cb3763d71efca99db314c65f0072eb0fe - RCTRequired: 5394bb1f71591633e1158bdf0534206cb5ccbeb5 - RCTTypeSafety: ba46a7f654566047a9358f2e74b2eafd97ccba9b - React: 8a004085056a81c7820f65a8bc0a92e1f7ef6878 - React-callinvoker: c2b59f2cbf0d8bcdc18b33f53e097907c12a149c - React-Codegen: 9ecf53f804f4d1d2a5d29bb2154e22a30c381f81 - React-Core: d730664c1ee918190a0c26bbf5c993f57e46ff5d - React-CoreModules: 390071843c203f516ec8dbc1c9ce1a815d35e908 - React-cxxreact: 39409697255baeb1ac42e436daee59913036109d - React-debug: d69fb5b4e3a47e8d5f8fdb01c1ec8983b7c1afec - React-Fabric: b19750f6cd0fae4e87173b1c2b6f9c94621b6679 - React-FabricImage: dc031099e2ae4734b70f1f66b7edf4f1cc40335a - React-graphics: e2c5d8a680cd5db24ab87756f688ecd24fd4628e - React-hermes: 4e22050b18127c27759488b703c0a9d5e6a341ba - React-ImageManager: f6792f5987f85271cbbc31e99dc16e63fd82fccb - React-jsi: 57f6f99db8d596dd599450f921b77229616e983b - React-jsiexecutor: 05d7b49ae31548ed320bb17d97bf5d648406278b - React-jsinspector: 03d477e4dd236c5411ef9a2f8c52cc2951ab6149 - React-logger: adce225eaf6d94e0e2568ba586c3f6e857fc8862 - React-NativeModulesApple: 67bb14d796e45adad89238b96a26b0f0daa5fa72 - React-perflogger: 8889aa68bda6d4cb649f890677d36c7b1eadfcd9 - React-RCTActionSheet: f5f5aa4079e8316562171fdf6346883d79fc51b1 - React-RCTAnimation: 0a3247bc23fd71f8eff8ccdb1bdeebbcb1de8af3 - React-RCTAppDelegate: 4d24c5365e3581fe22a05f0fadf5595b18d8c456 - React-RCTBlob: 484c22d88cbfc3d3441c1e54686f7793eaf30fa3 - React-RCTFabric: cd58dfa8a168d41363f84e78abe2d71d081581fb - React-RCTImage: 65ef7ecc938dea1decadd876448c47bc71e9d60b - React-RCTLinking: 100b9d0a895d95ea1e59e62375fe9b95d83fe031 - React-RCTNetwork: 710d044df7ddbe7be1ecae2608fc2ae2c5096c9a - React-RCTPushNotification: 502720de4bfd05358169c10e1ab791a794f550b0 - React-RCTSettings: f0f73ba95d32777386c294572c0e7f757bd33e08 - React-RCTTest: 6978788114214cf1f3004c04c5c2b882d9c0c0ea - React-RCTText: a64c63e34beec7c9893042a200d48accde4a406e - React-RCTVibration: e16f969546e42256468f7681d6d6ec3d2cab4524 - React-rncore: 4b86b32071e99b892eefaeee55dcec300e3e9194 - React-runtimeexecutor: 5499cb980788a75a5a474ab07b480e73f87e76b0 - ReactCommon: ed5e5ad966bbc436641a15fedb1b20dd68a2d147 - ReactCommon-Samples: cc63a8216d5e2090cc82c9427cd8d6675bef4d0f + RCTRequired: 82c56a03b3efd524bfdb581a906add903f78f978 + RCTTypeSafety: 034ade4e3b36be976b8378f825ccadbe104fa852 + React: cb6dc75e09f32aeddb4d8fb58a394a67219a92fe + React-callinvoker: bae59cbd6affd712bbfc703839dad868ff35069d + React-Codegen: 42dae0c7801d765934f76cfbaefcb5742524cc98 + React-Core: b04375fb8581bb80b6c87c25061a1998c61b0006 + React-CoreModules: fa9b32bbc7818672a7ca91eeef4867e133b566ec + React-cxxreact: 21b73aa1e245d6c701e62150312c3748756bbf42 + React-debug: d1cd203242675d48eecec6c2553933c0e0a3874f + React-Fabric: e85af38574589ce0d1a353623ecda0f94435da16 + React-FabricImage: 8552a7e0919bc2ab09c6869a7507ad7a46e552d9 + React-graphics: a85048af7e210ec4fed185ef201726f7b4825cc0 + React-hermes: fa4837e1d1e55f462ad3e485794056189b495d7e + React-ImageManager: 528eb68fe16f08d4c76cd32949e6bcd9e4aeae4b + React-jsi: ae20bc6ced4999f64acc5163cbfa67f878f346f4 + React-jsiexecutor: 754993beb8627912e5b25344cad02ed11a616d9f + React-jsinspector: bede0a6ac88f2463eafc1301239fe943adf06fa7 + React-logger: c20eb15d006d5c303cf6bfbb11243c8d579d9f56 + React-NativeModulesApple: 518f3f3d2d9e4944f99df30e601f8774d1fa1663 + React-perflogger: c294d51cfc18b90caa1604ef3a0fe2dd76b9e15e + React-RCTActionSheet: 943bd5f540f3af1e5a149c13c4de81858edf718a + React-RCTAnimation: a430a8c32e7947b7b014f7bd1ef6825168ad4841 + React-RCTAppDelegate: c847ea72bc6fd48b7b6693755c232a3cecbbc970 + React-RCTBlob: 9de0f88a876429c31b96b63975173c60978b5586 + React-RCTFabric: 911e88ea1b9f0b083b1502fb8dabda0a68142d42 + React-RCTImage: 8addd5fae983149d4506fbf8b36be30585adadf4 + React-RCTLinking: aec004e7f55b71be0f68913b1d993964fc8013e1 + React-RCTNetwork: 67229afd0642c55d4493cad5129238a7a1599441 + React-RCTPushNotification: 9e4bba7bb3a4682281216a81f3342caecf84cef7 + React-RCTSettings: 9b6f5a70aa3b859b2686794c3441e278b4f6e0a6 + React-RCTTest: d4004e03f9e5ca2607eb05bee5a0618b189a127a + React-RCTText: 6d0a9927391dc26325c2edf60ef7d36f637e709c + React-RCTVibration: ae65884c71d67f356396d6fcc44eec48b5afef70 + React-rncore: fe8c75a4beb121d0f923f0a45a17910083ccb681 + React-runtimeexecutor: e1c32bc249dd3cf3919cb4664fd8dc84ef70cff7 + React-utils: 2c3b06a36a63d6fce240ac5cb1de003b95222810 + ReactCommon: de6e7a92ad50207b08bcf696a61d9b509876e131 + ReactCommon-Samples: 13b7118480fb9abeee8a98bc1cceff06984cfde4 ScreenshotManager: d39b964a374e5012e2b8c143e29ead86b1da6a3c SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: 456e136b8de9c5360b609bd3238656cea243958f + Yoga: 239f77be94241af2a02e7018fe6165a715bc25f1 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: bdab6add69d555774de227d7119a8f5ae02a670e +PODFILE CHECKSUM: e220946495183a79874329aff76ec197027be224 COCOAPODS: 1.12.1 From 24f77074184390ce5d5ca50ab6af3d8bb2d59e77 Mon Sep 17 00:00:00 2001 From: tarunrajput Date: Thu, 15 Jun 2023 11:47:37 -0700 Subject: [PATCH 187/468] add emitObjectProp in parser primitives (#37904) Summary: This is a follow up PR to https://github.com/facebook/react-native/issues/37872 as it was not merged correctly. ## Changelog: [Internal][Changed]: Add emitObjectProp in parser primitives Pull Request resolved: https://github.com/facebook/react-native/pull/37904 Test Plan: `yarn test react-native-codegen` Reviewed By: cipolleschi Differential Revision: D46753690 Pulled By: rshest fbshipit-source-id: a1d0a727222066f3721f62427a51ee0317e06f13 --- .../__tests__/parsers-primitives-test.js | 14 +++++++++++--- .../src/parsers/flow/components/events.js | 4 ++-- .../src/parsers/parsers-primitives.js | 17 ++++------------- .../src/parsers/typescript/components/events.js | 9 +++------ 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js b/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js index 8e108d250b8c0e..722d44299eba8b 100644 --- a/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js +++ b/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js @@ -49,7 +49,7 @@ const {emitUnion} = require('../parsers-primitives'); const {UnsupportedUnionTypeAnnotationParserError} = require('../errors'); const {FlowParser} = require('../flow/parser'); const {TypeScriptParser} = require('../typescript/parser'); -const {getPropertyType} = require('../flow/components/events'); +const {extractArrayElementType} = require('../flow/components/events'); const parser = new MockedParser(); const flowParser = new FlowParser(); @@ -1679,6 +1679,10 @@ describe('emitObjectProp', () => { describe('when property is optional', () => { it('returns optional Object Prop', () => { const typeAnnotation = { + type: 'GenericTypeAnnotation', + id: { + name: 'ObjectTypeAnnotation', + }, properties: [ { key: { @@ -1699,7 +1703,7 @@ describe('emitObjectProp', () => { true, flowParser, typeAnnotation, - getPropertyType, + extractArrayElementType, ); const expected = { name: 'someProp', @@ -1725,6 +1729,10 @@ describe('emitObjectProp', () => { describe('when property is required', () => { it('returns required Object Prop', () => { const typeAnnotation = { + type: 'GenericTypeAnnotation', + id: { + name: 'ObjectTypeAnnotation', + }, properties: [ { key: { @@ -1745,7 +1753,7 @@ describe('emitObjectProp', () => { false, flowParser, typeAnnotation, - getPropertyType, + extractArrayElementType, ); const expected = { name: 'someProp', diff --git a/packages/react-native-codegen/src/parsers/flow/components/events.js b/packages/react-native-codegen/src/parsers/flow/components/events.js index 9901c5edd24259..f0fd64e4eb187f 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/events.js +++ b/packages/react-native-codegen/src/parsers/flow/components/events.js @@ -70,7 +70,7 @@ function getPropertyType( optional, parser, typeAnnotation, - getPropertyType, + extractArrayElementType, ); case 'UnionTypeAnnotation': return { @@ -311,5 +311,5 @@ function getEvents( module.exports = { getEvents, - getPropertyType, + extractArrayElementType, }; diff --git a/packages/react-native-codegen/src/parsers/parsers-primitives.js b/packages/react-native-codegen/src/parsers/parsers-primitives.js index ea0bec6ea0a4cb..845a42e073ffca 100644 --- a/packages/react-native-codegen/src/parsers/parsers-primitives.js +++ b/packages/react-native-codegen/src/parsers/parsers-primitives.js @@ -60,7 +60,6 @@ const { wrapNullable, unwrapNullable, translateFunctionTypeAnnotation, - buildPropertiesForEvent, } = require('./parsers-commons'); const {isModuleRegistryCall} = require('./utils'); @@ -663,24 +662,16 @@ function emitObjectProp( optional: boolean, parser: Parser, typeAnnotation: $FlowFixMe, - getPropertyType: ( - name: $FlowFixMe, - optional: boolean, + extractArrayElementType: ( typeAnnotation: $FlowFixMe, + name: string, parser: Parser, - ) => NamedShape, + ) => EventTypeAnnotation, ): NamedShape { return { name, optional, - typeAnnotation: { - type: 'ObjectTypeAnnotation', - properties: parser - .getObjectProperties(typeAnnotation) - .map(member => - buildPropertiesForEvent(member, parser, getPropertyType), - ), - }, + typeAnnotation: extractArrayElementType(typeAnnotation, name, parser), }; } diff --git a/packages/react-native-codegen/src/parsers/typescript/components/events.js b/packages/react-native-codegen/src/parsers/typescript/components/events.js index eafc857184fa83..230b9b512a6b7f 100644 --- a/packages/react-native-codegen/src/parsers/typescript/components/events.js +++ b/packages/react-native-codegen/src/parsers/typescript/components/events.js @@ -50,10 +50,7 @@ function getPropertyType( const topLevelType = parseTopLevelType(annotation); const typeAnnotation = topLevelType.type; const optional = optionalProperty || topLevelType.optional; - const type = - typeAnnotation.type === 'TSTypeReference' - ? typeAnnotation.typeName.name - : typeAnnotation.type; + const type = parser.extractTypeFromTypeAnnotation(typeAnnotation); switch (type) { case 'TSBooleanKeyword': @@ -72,7 +69,7 @@ function getPropertyType( optional, parser, typeAnnotation, - getPropertyType, + extractArrayElementType, ); case 'TSUnionType': return { @@ -92,7 +89,6 @@ function getPropertyType( typeAnnotation: extractArrayElementType(typeAnnotation, name, parser), }; default: - (type: empty); throw new Error(`Unable to determine event type for "${name}": ${type}`); } } @@ -314,4 +310,5 @@ function getEvents( module.exports = { getEvents, + extractArrayElementType, }; From 8b1bf058c4bcbf4e5ca45b0056217266a1ed870c Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Thu, 15 Jun 2023 12:27:32 -0700 Subject: [PATCH 188/468] Re-enable direct debugging with JSC on iOS 16.4+ (#37914) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37914 Restores https://github.com/facebook/react-native/pull/37874 (reverted earlier today), with fix for `JSCRuntime.cpp` build on Android. Changelog: None Reviewed By: cortinico Differential Revision: D46762984 fbshipit-source-id: 6d56f81b9d0c928887860993b2b729ed96c0734c --- packages/react-native/ReactCommon/jsc/JSCRuntime.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp index fea1d0bc2d33c7..90a11df160a106 100644 --- a/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp +++ b/packages/react-native/ReactCommon/jsc/JSCRuntime.cpp @@ -398,6 +398,13 @@ JSCRuntime::JSCRuntime(JSGlobalContextRef ctx) stringCounter_(0) #endif { +#ifndef NDEBUG +#ifdef TARGET_OS_MAC + if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) { + JSGlobalContextSetInspectable(ctx_, true); + } +#endif +#endif } JSCRuntime::~JSCRuntime() { From aaa15ed09bb82ae6c5ad553743148db4e949b0cf Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Thu, 15 Jun 2023 13:08:46 -0700 Subject: [PATCH 189/468] Deploy 0.209.0 to xplat (#37921) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37921 Changelog: [Internal] Reviewed By: pieterv Differential Revision: D46773358 fbshipit-source-id: a7ef8a44c4a55a8ad5be2bc637267c518895c1c3 --- .flowconfig | 3 ++- .flowconfig.android | 3 ++- package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.flowconfig b/.flowconfig index b3d0e7d79cf27f..f9ab44caa8f632 100644 --- a/.flowconfig +++ b/.flowconfig @@ -31,6 +31,7 @@ packages/react-native/flow/ [options] enums=true +conditional_type=true emoji=true @@ -75,4 +76,4 @@ untyped-import untyped-type-import [version] -^0.208.1 +^0.209.0 diff --git a/.flowconfig.android b/.flowconfig.android index 69e0eb50b66e48..155704621ef37f 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -31,6 +31,7 @@ packages/react-native/flow/ [options] enums=true +conditional_type=true emoji=true @@ -75,4 +76,4 @@ untyped-import untyped-type-import [version] -^0.208.1 +^0.209.0 diff --git a/package.json b/package.json index 53497018976d39..2f86089c27f280 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "eslint-plugin-react-native": "^4.0.0", "eslint-plugin-redundant-undefined": "^0.4.0", "eslint-plugin-relay": "^1.8.3", - "flow-bin": "^0.208.1", + "flow-bin": "^0.209.0", "hermes-eslint": "0.12.0", "inquirer": "^7.1.0", "jest": "^29.2.1", diff --git a/yarn.lock b/yarn.lock index 91bec52806c02b..42a07e676c5766 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4925,10 +4925,10 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== -flow-bin@^0.208.1: - version "0.208.1" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.208.1.tgz#98390cc968980988d9c7ddbcf7233b53baa0b616" - integrity sha512-sr+gCnYg5UC/lbrCj/qO2GDSGzV75HDl8drEHX/Dpjr5gS+NYoFQ1r9C9ESAeYpakmiot/HPdKYOjCFtqUcsQA== +flow-bin@^0.209.0: + version "0.209.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.209.0.tgz#616a002b94ef35e1b083add9a6d27dbe387bf4f0" + integrity sha512-HRc6+bKE8AN23SnuKaxdUjcQcjaIp6pksrGJ6pltFO5tIEvZmPrbT99P7Yb3ybqwcKU/Ry8yfJbuW92Ed2V3nw== flow-enums-runtime@^0.0.6: version "0.0.6" From 2ae163a7e8f56861ba081ed3909d4a1d890930f1 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 15 Jun 2023 13:14:17 -0700 Subject: [PATCH 190/468] Re-add the top level LICENSE file (#37916) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37916 Repos on GitHub should have a top level LICENSE file to make sure GitHub can autodiscover the correct license for the project. Once we moved the file inside packages/react-native/ the autodiscovery is not working anymore (it returns a 404). Changelog: [Internal] - Re-add the top level LICENSE file Reviewed By: hoxyq Differential Revision: D46764347 fbshipit-source-id: cd760c004cf97248490b43f7ba08a47ef2d23c89 --- LICENSE | 21 +++++++++++++++++++++ README.md | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000000000..b93be90515ccd0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 94f74a32d6b8e3..28ae98f546a027 100644 --- a/README.md +++ b/README.md @@ -143,5 +143,5 @@ React Native is MIT licensed, as found in the [LICENSE][l] file. React Native documentation is Creative Commons licensed, as found in the [LICENSE-docs][ld] file. -[l]: https://github.com/facebook/react-native/blob/main/packages/react-native/LICENSE -[ld]: https://github.com/facebook/react-native/blob/HEAD/LICENSE-docs +[l]: https://github.com/facebook/react-native/blob/main/LICENSE +[ld]: https://github.com/facebook/react-native/blob/main/LICENSE-docs From ca65d97d603f0308c18bbee835b7cf6d5f76e232 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Thu, 15 Jun 2023 15:23:40 -0700 Subject: [PATCH 191/468] fix: foreground ripple crash on api < 23 (#37901) Summary: The Pressable component supports the `foreground` option for ripple. However, using it on old android api levels (e.g. android 5) crashes with ``` Error while updating property nativeForegroundAndroid' of a view managed by: RCTView null No virtual method setForeground(Landroid/ graphics/drawable/Drawable;)V in class Lcom/ facebook/react/views/view/ReactViewGroup; or its super classes ``` TouchableNativeFeedback.js has a check to make sure this does not happen [as seen here](https://github.com/facebook/react-native/blob/b0485bed0945061becace5af924fa60b17ab295f/packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.js#L158) I also want to point out that this PR can be closed https://github.com/facebook/react-native/pull/30466 as it's already implemented ## Changelog: [ANDROID] [CHANGED] - Remove okhttp3 internal util usage Pull Request resolved: https://github.com/facebook/react-native/pull/37843 Test Plan: None, the implementation is based on okhttp internal util Reviewed By: NickGerleman Differential Revision: D46764363 Pulled By: cortinico fbshipit-source-id: e46770625f19057fa7374be15e92903d7966f880 --- .../react/modules/network/RequestBodyUtil.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.java index 4a56e92a88796a..7c0d07dde5b06e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.java @@ -30,7 +30,6 @@ import java.util.zip.GZIPOutputStream; import okhttp3.MediaType; import okhttp3.RequestBody; -import okhttp3.internal.Util; import okio.BufferedSink; import okio.ByteString; import okio.Okio; @@ -128,6 +127,21 @@ private static InputStream getDownloadFileInputStream(Context context, Uri uri) return RequestBody.create(mediaType, gzipByteArrayOutputStream.toByteArray()); } + /** + * Reference: + * https://github.com/square/okhttp/blob/8c8c3dbcfa91e28de2e13975ec414e07f153fde4/okhttp/src/commonMain/kotlin/okhttp3/internal/-UtilCommon.kt#L281-L288 + * Checked exceptions will be ignored + */ + private static void closeQuietly(Source source) { + try { + source.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + // noop. + } + } + /** Creates a RequestBody from a mediaType and inputStream given. */ public static RequestBody create(final MediaType mediaType, final InputStream inputStream) { return new RequestBody() { @@ -152,7 +166,7 @@ public void writeTo(BufferedSink sink) throws IOException { source = Okio.source(inputStream); sink.writeAll(source); } finally { - Util.closeQuietly(source); + closeQuietly(source); } } }; From 7bc2b730a8b5994ade1dfa66769e5ec60cfc05fb Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Thu, 15 Jun 2023 18:05:55 -0700 Subject: [PATCH 194/468] Interop: Introduce Bridge proxy Summary: The TurboModule interop layer on iOS will ship with a Bridge proxy. The Bridge proxy is an object that will try to simulate the Bridge's APIs, whenever possible, by delegating to Bridgeless abstractions. ## Changes This diff introduces the Bridge proxy. This diff starts attaching the Bridge proxy on legacy native module objects. ## How did we polyfill the APIs The polyfills can be classified into these categories: - implemented - custom warning - custom error - default error - deleted When there was a sane implementation (e.g: the API belonged to [RCTCallableJSModules](https://www.internalfb.com/code/fbsource/[534223aa13d33b595edcb777189618efe20dd167]/xplat/js/react-native-github/React/Base/RCTCallableJSModules.m?lines=11), [RCTModuleRegistry](https://www.internalfb.com/code/fbsource/[9a3ba2b3176b6d1a1f161e33cec51bf892815311]/xplat/js/react-native-github/React/Base/RCTModuleRegistry.m?lines=13), [RCTBundleManager](https://www.internalfb.com/code/fbsource/[91fa1f7f49731a16aedbcd5a6740647dc21ff727]/xplat/js/react-native-github/React/Base/RCTBundleManager.m?lines=13), or [RCTBundleManager](https://www.internalfb.com/code/fbsource/[91fa1f7f49731a16aedbcd5a6740647dc21ff727]/xplat/js/react-native-github/React/Base/RCTBundleManager.m?lines=13)), it was implemented. When it was safe to no-op the API (e.g: loading), it emit a custom warning. When it was unsafe to call (i.e: we didn't want people calling the API) (e.g: RCTCxxBridge start), it emit a custom error. All other APIs emit default errors. Some APIs cannot emit errors because doing so makes the app not render: I put warnings and nooped those APIs. I think we will have to tune these polyfills based off production crashes/results. Reviewed By: mdvacca Differential Revision: D46084318 fbshipit-source-id: c02535073956597a4bf91c14b1980f653cb6d3df --- .../Libraries/Image/RCTImageLoader.h | 7 + .../Libraries/Image/RCTImageLoader.mm | 9 + .../Libraries/Image/RCTImageStoreManager.h | 7 + .../Libraries/Image/RCTImageStoreManager.mm | 9 + .../Libraries/Network/RCTNetworking.h | 7 + .../Libraries/Network/RCTNetworking.mm | 9 + .../react-native/React/Base/RCTBridgeProxy.h | 35 ++ .../react-native/React/Base/RCTBridgeProxy.mm | 447 ++++++++++++++++++ .../React/Base/RCTEventDispatcher.m | 9 + .../React/Base/RCTEventDispatcherProtocol.h | 7 + .../CoreModules/RCTAccessibilityManager.h | 7 + .../CoreModules/RCTAccessibilityManager.mm | 9 + .../React/CoreModules/RCTDevMenu.h | 7 + .../React/CoreModules/RCTDevMenu.mm | 13 + .../React/CoreModules/RCTDevSettings.h | 7 + .../React/CoreModules/RCTDevSettings.mm | 15 + .../React/CoreModules/RCTRedBox.h | 7 + .../React/CoreModules/RCTRedBox.mm | 18 + .../React/CoreModules/RCTWebSocketModule.h | 7 + .../React/CoreModules/RCTWebSocketModule.mm | 9 + .../React/Modules/RCTSurfacePresenterStub.h | 8 + .../React/Modules/RCTSurfacePresenterStub.m | 14 + .../platform/ios/Core/RCTInstance.mm | 17 + .../ios/ReactCommon/RCTTurboModuleManager.h | 4 + .../ios/ReactCommon/RCTTurboModuleManager.mm | 25 +- 25 files changed, 711 insertions(+), 2 deletions(-) create mode 100644 packages/react-native/React/Base/RCTBridgeProxy.h create mode 100644 packages/react-native/React/Base/RCTBridgeProxy.mm diff --git a/packages/react-native/Libraries/Image/RCTImageLoader.h b/packages/react-native/Libraries/Image/RCTImageLoader.h index 592785573066db..ae9dc8069743e3 100644 --- a/packages/react-native/Libraries/Image/RCTImageLoader.h +++ b/packages/react-native/Libraries/Image/RCTImageLoader.h @@ -8,6 +8,7 @@ #import #import +#import #import #import #import @@ -34,3 +35,9 @@ @property (nonatomic, readonly) RCTImageLoader *imageLoader; @end + +@interface RCTBridgeProxy (RCTImageLoader) + +@property (nonatomic, readonly) RCTImageLoader *imageLoader; + +@end diff --git a/packages/react-native/Libraries/Image/RCTImageLoader.mm b/packages/react-native/Libraries/Image/RCTImageLoader.mm index bfcdf26a5d3cee..09317d99c2d653 100644 --- a/packages/react-native/Libraries/Image/RCTImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTImageLoader.mm @@ -1293,6 +1293,15 @@ - (RCTImageLoader *)imageLoader @end +@implementation RCTBridgeProxy (RCTImageLoader) + +- (RCTImageLoader *)imageLoader +{ + return [self moduleForClass:[RCTImageLoader class]]; +} + +@end + Class RCTImageLoaderCls(void) { return RCTImageLoader.class; diff --git a/packages/react-native/Libraries/Image/RCTImageStoreManager.h b/packages/react-native/Libraries/Image/RCTImageStoreManager.h index 389f613ea8afe1..61f324d51cd4e8 100644 --- a/packages/react-native/Libraries/Image/RCTImageStoreManager.h +++ b/packages/react-native/Libraries/Image/RCTImageStoreManager.h @@ -8,6 +8,7 @@ #import #import +#import #import @interface RCTImageStoreManager : NSObject @@ -44,3 +45,9 @@ @property (nonatomic, readonly) RCTImageStoreManager *imageStoreManager; @end + +@interface RCTBridgeProxy (RCTImageStoreManager) + +@property (nonatomic, readonly) RCTImageStoreManager *imageStoreManager; + +@end diff --git a/packages/react-native/Libraries/Image/RCTImageStoreManager.mm b/packages/react-native/Libraries/Image/RCTImageStoreManager.mm index acfa4d3434c4eb..242c42cce8a0e5 100644 --- a/packages/react-native/Libraries/Image/RCTImageStoreManager.mm +++ b/packages/react-native/Libraries/Image/RCTImageStoreManager.mm @@ -254,6 +254,15 @@ - (RCTImageStoreManager *)imageStoreManager @end +@implementation RCTBridgeProxy (RCTImageStoreManager) + +- (RCTImageStoreManager *)imageStoreManager +{ + return [self moduleForClass:[RCTImageStoreManager class]]; +} + +@end + Class RCTImageStoreManagerCls(void) { return RCTImageStoreManager.class; diff --git a/packages/react-native/Libraries/Network/RCTNetworking.h b/packages/react-native/Libraries/Network/RCTNetworking.h index 3ad70f0ce80fd5..fcc9fe81714a29 100644 --- a/packages/react-native/Libraries/Network/RCTNetworking.h +++ b/packages/react-native/Libraries/Network/RCTNetworking.h @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. */ +#import #import #import #import @@ -61,6 +62,12 @@ @end +@interface RCTBridgeProxy (RCTNetworking) + +@property (nonatomic, readonly) RCTNetworking *networking; + +@end + // HACK: When uploading images/video from PHAssetLibrary, we change the URL scheme to be // ph-upload://. This is to ensure that we upload a full video when given a ph-upload:// URL, // instead of just the thumbnail. Consider the following problem: diff --git a/packages/react-native/Libraries/Network/RCTNetworking.mm b/packages/react-native/Libraries/Network/RCTNetworking.mm index 9b9c12711dea7c..4e78d8e798e8ae 100644 --- a/packages/react-native/Libraries/Network/RCTNetworking.mm +++ b/packages/react-native/Libraries/Network/RCTNetworking.mm @@ -762,6 +762,15 @@ - (RCTNetworking *)networking @end +@implementation RCTBridgeProxy (RCTNetworking) + +- (RCTNetworking *)networking +{ + return [self moduleForClass:[RCTNetworking class]]; +} + +@end + Class RCTNetworkingCls(void) { return RCTNetworking.class; diff --git a/packages/react-native/React/Base/RCTBridgeProxy.h b/packages/react-native/React/Base/RCTBridgeProxy.h new file mode 100644 index 00000000000000..b1c70287b1cc35 --- /dev/null +++ b/packages/react-native/React/Base/RCTBridgeProxy.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBridgeModule.h" + +@class RCTBundleManager; +@class RCTCallableJSModules; +@class RCTModuleRegistry; +@class RCTViewRegistry; + +@interface RCTBridgeProxy : NSProxy +- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry + moduleRegistry:(RCTModuleRegistry *)moduleRegistry + bundleManager:(RCTBundleManager *)bundleManager + callableJSModules:(RCTCallableJSModules *)callableJSModules + dispatchToJSThread:(void (^)(dispatch_block_t))dispatchToJSThread NS_DESIGNATED_INITIALIZER; + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel; +- (void)forwardInvocation:(NSInvocation *)invocation; + +- (void)logWarning:(NSString *)message cmd:(SEL)cmd; +- (void)logError:(NSString *)message cmd:(SEL)cmd; + +/** + * Methods required for RCTBridge class extensions + */ +- (id)moduleForClass:(Class)moduleClass; +- (id)moduleForName:(NSString *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoad; +@end diff --git a/packages/react-native/React/Base/RCTBridgeProxy.mm b/packages/react-native/React/Base/RCTBridgeProxy.mm new file mode 100644 index 00000000000000..c91a0fe9667400 --- /dev/null +++ b/packages/react-native/React/Base/RCTBridgeProxy.mm @@ -0,0 +1,447 @@ +/* + * 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 "RCTBridgeProxy.h" +#import +#import +#import +#import +#import + +using namespace facebook; + +@interface RCTUIManagerProxy : NSProxy +- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry NS_DESIGNATED_INITIALIZER; + +- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel; +- (void)forwardInvocation:(NSInvocation *)invocation; +@end + +@implementation RCTBridgeProxy { + RCTUIManagerProxy *_uiManagerProxy; + RCTModuleRegistry *_moduleRegistry; + RCTBundleManager *_bundleManager; + RCTCallableJSModules *_callableJSModules; + void (^_dispatchToJSThread)(dispatch_block_t); +} + +- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry + moduleRegistry:(RCTModuleRegistry *)moduleRegistry + bundleManager:(RCTBundleManager *)bundleManager + callableJSModules:(RCTCallableJSModules *)callableJSModules + dispatchToJSThread:(void (^)(dispatch_block_t))dispatchToJSThread +{ + self = [super self]; + if (self) { + self->_uiManagerProxy = [[RCTUIManagerProxy alloc] initWithViewRegistry:viewRegistry]; + self->_moduleRegistry = moduleRegistry; + self->_bundleManager = bundleManager; + self->_callableJSModules = callableJSModules; + self->_dispatchToJSThread = dispatchToJSThread; + } + return self; +} + +- (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue +{ + [self logWarning:@"Please migrate to dispatchToJSThread: @synthesize dispatchToJSThread = _dispatchToJSThread" + cmd:_cmd]; + + if (queue == RCTJSThread) { + _dispatchToJSThread(block); + } else if (queue) { + dispatch_async(queue, block); + } +} + +/** + * Used By: + * - RCTDevSettings + */ +- (Class)executorClass +{ + [self logWarning:@"This method is unsupported. Returning nil." cmd:_cmd]; + return nil; +} + +/** + * Used By: + * - RCTBlobCollector + */ +- (jsi::Runtime *)runtime +{ + [self logWarning:@"This method is unsupported. Returning nullptr." cmd:_cmd]; + return nullptr; +} + +/** + * RCTModuleRegistry + */ +- (id)moduleForName:(NSString *)moduleName +{ + [self logWarning:@"Please migrate to RCTModuleRegistry: @synthesize moduleRegistry = _moduleRegistry." cmd:_cmd]; + return [_moduleRegistry moduleForName:[moduleName UTF8String]]; +} + +- (id)moduleForName:(NSString *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoad +{ + [self logWarning:@"Please migrate to RCTModuleRegistry: @synthesize moduleRegistry = _moduleRegistry." cmd:_cmd]; + return [_moduleRegistry moduleForName:[moduleName UTF8String] lazilyLoadIfNecessary:lazilyLoad]; +} + +- (id)moduleForClass:(Class)moduleClass +{ + [self logWarning:@"Please migrate to RCTModuleRegistry: @synthesize moduleRegistry = _moduleRegistry." cmd:_cmd]; + NSString *moduleName = RCTBridgeModuleNameForClass(moduleClass); + return [_moduleRegistry moduleForName:[moduleName UTF8String] lazilyLoadIfNecessary:YES]; +} + +- (NSArray *)modulesConformingToProtocol:(Protocol *)protocol +{ + [self logError:@"The TurboModule system cannot load modules by protocol. Returning an empty NSArray*." cmd:_cmd]; + return @[]; +} + +- (BOOL)moduleIsInitialized:(Class)moduleClass +{ + [self logWarning:@"Please migrate to RCTModuleRegistry: @synthesize moduleRegistry = _moduleRegistry." cmd:_cmd]; + return [_moduleRegistry moduleIsInitialized:moduleClass]; +} + +- (NSArray *)moduleClasses +{ + [self logError:@"The TurboModuleManager does not implement this method. Returning an empty NSArray*." cmd:_cmd]; + return @[]; +} + +/** + * RCTBundleManager + */ +- (void)setBundleURL:(NSURL *)bundleURL +{ + [self logWarning:@"Please migrate to RCTBundleManager: @synthesize bundleManager = _bundleManager." cmd:_cmd]; + [_bundleManager setBundleURL:bundleURL]; +} + +- (NSURL *)bundleURL +{ + [self logWarning:@"Please migrate to RCTBundleManager: @synthesize bundleManager = _bundleManager." cmd:_cmd]; + return [_bundleManager bundleURL]; +} + +/** + * RCTCallableJSModules + */ +- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args +{ + [self logWarning:@"Please migrate to RCTCallableJSModules: @synthesize callableJSModules = _callableJSModules." + cmd:_cmd]; + + NSArray *ids = [moduleDotMethod componentsSeparatedByString:@"."]; + NSString *module = ids[0]; + NSString *method = ids[1]; + [_callableJSModules invokeModule:module method:method withArgs:args]; +} + +- (void)enqueueJSCall:(NSString *)module + method:(NSString *)method + args:(NSArray *)args + completion:(dispatch_block_t)completion +{ + [self logWarning:@"Please migrate to RCTCallableJSModules: @synthesize callableJSModules = _callableJSModules." + cmd:_cmd]; + [_callableJSModules invokeModule:module method:method withArgs:args onComplete:completion]; +} + +- (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path +{ + [self logError:@"Please migrate to RCTHost registerSegmentWithId. Nooping" cmd:_cmd]; +} + +- (id)delegate +{ + [self logError:@"This method is unsupported. Returning nil." cmd:_cmd]; + return nil; +} + +- (NSDictionary *)launchOptions +{ + [self logError:@"Bridgeless mode doesn't support launchOptions. Returning nil." cmd:_cmd]; + return nil; +} + +- (BOOL)loading +{ + [self logWarning:@"This method is not implemented. Returning NO." cmd:_cmd]; + return NO; +} + +- (BOOL)valid +{ + [self logWarning:@"This method is not implemented. Returning NO." cmd:_cmd]; + return NO; +} + +- (RCTPerformanceLogger *)performanceLogger +{ + [self logWarning:@"Bridgeless mode does not support RCTPerformanceLogger. Returning nil." cmd:_cmd]; + return nil; +} + +- (void)reload +{ + [self logError:@"Please use RCTReloadCommand instead. Nooping." cmd:_cmd]; +} + +- (void)reloadWithReason:(NSString *)reason +{ + [self logError:@"Please use RCTReloadCommand instead. Nooping." cmd:_cmd]; +} + +- (void)onFastRefresh +{ + [[NSNotificationCenter defaultCenter] postNotificationName:RCTBridgeFastRefreshNotification object:self]; +} + +- (void)requestReload __deprecated_msg("Use RCTReloadCommand instead") +{ + [self logError:@"Please use RCTReloadCommand instead. Nooping." cmd:_cmd]; +} + +- (BOOL)isBatchActive +{ + [self logWarning:@"Bridgeless mode does not support batching. Returning NO." cmd:_cmd]; + return NO; +} + +/** + * RCTBridge () + */ + +- (NSString *)bridgeDescription +{ + [self logWarning:@"Bridgeless mode does not support bridgeDescription. Returning \"BridgeProxy\"." cmd:_cmd]; + return @"BridgeProxy"; +} + +- (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args +{ + [self logError:@"Bridgeless mode does not queuing callbacks by ids. No-oping." cmd:_cmd]; +} + +- (RCTBridge *)batchedBridge +{ + [self logWarning:@"Bridgeless mode does not support batchedBridge. Returning bridge proxy." cmd:_cmd]; + return (RCTBridge *)self; +} + +- (void)setBatchedBridge +{ + [self logError:@"Bridgeless mode does not support setBatchedBridge. No-oping." cmd:_cmd]; +} + +- (RCTBridgeModuleListProvider)moduleProvider +{ + [self logWarning:@"Bridgeless mode does not support RCTBridgeModuleListProvider. Returning empty block" cmd:_cmd]; + return ^{ + return @[]; + }; +} + +- (RCTModuleRegistry *)moduleRegistry +{ + return _moduleRegistry; +} + +/** + * RCTBridge (RCTCxxBridge) + */ + +- (RCTBridge *)parentBridge +{ + [self logWarning:@"Bridgeless mode does not support parentBridge. Returning bridge proxy." cmd:_cmd]; + return (RCTBridge *)self; +} + +- (BOOL)moduleSetupComplete +{ + [self logWarning:@"Bridgeless mode does not implement moduleSetupComplete. Returning YES." cmd:_cmd]; + return YES; +} + +- (void)start +{ + [self + logError: + @"Starting the bridge proxy does nothing. If you want to start React Native, please use RCTHost start. Nooping" + cmd:_cmd]; +} + +- (void)registerModuleForFrameUpdates:(id)module withModuleData:(RCTModuleData *)moduleData +{ + [self logError:@"Bridgeless mode does not allow custom modules to register themselves for frame updates. Nooping" + cmd:_cmd]; +} + +- (RCTModuleData *)moduleDataForName:(NSString *)moduleName +{ + [self logError:@"Bridgeless mode does not use RCTModuleData. Returning nil." cmd:_cmd]; + return nil; +} + +- (void)registerAdditionalModuleClasses:(NSArray *)newModules +{ + [self + logError: + @"This API is unsupported. Please return all module classes from your app's RCTTurboModuleManagerDelegate getModuleClassFromName:. Nooping." + cmd:_cmd]; +} + +- (void)updateModuleWithInstance:(id)instance +{ + [self logError:@"Bridgeless mode does not support module replacement. Nooping." cmd:_cmd]; +} + +- (void)startProfiling +{ + [self logWarning:@"Bridgeless mode does not support this method. Nooping." cmd:_cmd]; +} + +- (void)stopProfiling:(void (^)(NSData *))callback +{ + [self logWarning:@"Bridgeless mode does not support this method. Nooping." cmd:_cmd]; +} + +- (id)callNativeModule:(NSUInteger)moduleID method:(NSUInteger)methodID params:(NSArray *)params +{ + [self logError:@"Bridgeless mode does not support this method. Nooping and returning nil." cmd:_cmd]; + return nil; +} + +- (void)logMessage:(NSString *)message level:(NSString *)level +{ + [self logWarning:@"Bridgeless mode does not support this method. Nooping." cmd:_cmd]; +} + +- (void)_immediatelyCallTimer:(NSNumber *)timer +{ + [self logWarning:@"Bridgeless mode does not support this method. Nooping." cmd:_cmd]; +} + +/** + * RCTBridge (Inspector) + */ +- (BOOL)inspectable +{ + [self logWarning:@"Bridgeless mode does not support this method. Returning NO." cmd:_cmd]; + return NO; +} + +/** + * RCTBridge (RCTUIManager) + */ +- (RCTUIManager *)uiManager +{ + return (RCTUIManager *)_uiManagerProxy; +} + +/** + * NSProxy setup + */ +- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel; +{ + return [RCTCxxBridge instanceMethodSignatureForSelector:sel]; +} + +- (void)forwardInvocation:(NSInvocation *)invocation +{ + [self logError:@"This method is unsupported." cmd:invocation.selector]; +} + +/** + * Logging + * TODO(155977839): Add a means to configure/disable these logs, so people do not ignore all LogBoxes + */ +- (void)logWarning:(NSString *)message cmd:(SEL)cmd +{ + RCTLogWarn(@"RCTBridgeProxy: Calling [bridge %@]. %@", NSStringFromSelector(cmd), message); +} + +- (void)logError:(NSString *)message cmd:(SEL)cmd +{ + RCTLogError(@"RCTBridgeProxy: Calling [bridge %@]. %@", NSStringFromSelector(cmd), message); +} + +@end + +@implementation RCTUIManagerProxy { + RCTViewRegistry *_viewRegistry; +} +- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry +{ + self = [super self]; + if (self) { + _viewRegistry = viewRegistry; + } + return self; +} + +/** + * RCTViewRegistry + */ +- (UIView *)viewForReactTag:(NSNumber *)reactTag +{ + [self logWarning:@"Please migrate to RCTViewRegistry: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED." + cmd:_cmd]; + return [_viewRegistry viewForReactTag:reactTag]; +} + +- (void)addUIBlock:(RCTViewManagerUIBlock)block +{ + [self + logWarning: + @"This method isn't implemented faithfully: the viewRegistry passed to RCTViewManagerUIBlock is nil. Please migrate to RCTViewRegistry: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED." + cmd:_cmd]; + __weak __typeof(self) weakSelf = self; + RCTExecuteOnMainQueue(^{ + __typeof(self) strongSelf = weakSelf; + if (strongSelf) { + block((RCTUIManager *)strongSelf, nil); + } + }); +} + +/** + * NSProxy setup + */ +- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel +{ + return [RCTUIManager instanceMethodSignatureForSelector:sel]; +} + +- (void)forwardInvocation:(NSInvocation *)invocation +{ + [self logError:@"This methid is unsupported." cmd:invocation.selector]; +} + +/** + * Logging + * TODO(155977839): Add a means to configure/disable these logs, so people do not ignore all LogBoxes + */ +- (void)logWarning:(NSString *)message cmd:(SEL)cmd +{ + RCTLogWarn( + @"RCTBridgeProxy (RCTUIManagerProxy): Calling [bridge.uiManager %@]. %@", NSStringFromSelector(cmd), message); +} + +- (void)logError:(NSString *)message cmd:(SEL)cmd +{ + RCTLogError( + @"RCTBridgeProxy (RCTUIManagerProxy): Calling [bridge.uiManager %@]. %@", NSStringFromSelector(cmd), message); +} + +@end diff --git a/packages/react-native/React/Base/RCTEventDispatcher.m b/packages/react-native/React/Base/RCTEventDispatcher.m index 00f6046b4eb535..d779006e7e90b0 100644 --- a/packages/react-native/React/Base/RCTEventDispatcher.m +++ b/packages/react-native/React/Base/RCTEventDispatcher.m @@ -28,3 +28,12 @@ @implementation RCTBridge (RCTEventDispatcher) } @end + +@implementation RCTBridgeProxy (RCTEventDispatcher) + +- (id)eventDispatcher +{ + return [self moduleForName:@"EventDispatcher" lazilyLoadIfNecessary:YES]; +} + +@end diff --git a/packages/react-native/React/Base/RCTEventDispatcherProtocol.h b/packages/react-native/React/Base/RCTEventDispatcherProtocol.h index 4125e9829443a0..170135bb64b7b9 100644 --- a/packages/react-native/React/Base/RCTEventDispatcherProtocol.h +++ b/packages/react-native/React/Base/RCTEventDispatcherProtocol.h @@ -8,6 +8,7 @@ #import #import +#import /** * The threshold at which text inputs will start warning that the JS thread @@ -132,3 +133,9 @@ typedef NS_ENUM(NSInteger, RCTTextEventType) { - (id)eventDispatcher; @end + +@interface RCTBridgeProxy (RCTEventDispatcher) + +- (id)eventDispatcher; + +@end diff --git a/packages/react-native/React/CoreModules/RCTAccessibilityManager.h b/packages/react-native/React/CoreModules/RCTAccessibilityManager.h index 707d5766dd4c53..01af72e81420ff 100644 --- a/packages/react-native/React/CoreModules/RCTAccessibilityManager.h +++ b/packages/react-native/React/CoreModules/RCTAccessibilityManager.h @@ -9,6 +9,7 @@ #import #import +#import extern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; // posted when multiplier is changed @@ -34,3 +35,9 @@ extern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; / @property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager; @end + +@interface RCTBridgeProxy (RCTAccessibilityManager) + +@property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager; + +@end diff --git a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm index d91b2a1980e80c..4aaabcaba30be7 100644 --- a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm +++ b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm @@ -405,6 +405,15 @@ - (RCTAccessibilityManager *)accessibilityManager @end +@implementation RCTBridgeProxy (RCTAccessibilityManager) + +- (RCTAccessibilityManager *)accessibilityManager +{ + return [self moduleForClass:[RCTAccessibilityManager class]]; +} + +@end + Class RCTAccessibilityManagerCls(void) { return RCTAccessibilityManager.class; diff --git a/packages/react-native/React/CoreModules/RCTDevMenu.h b/packages/react-native/React/CoreModules/RCTDevMenu.h index eedfff15688171..b9b76f63e6e385 100644 --- a/packages/react-native/React/CoreModules/RCTDevMenu.h +++ b/packages/react-native/React/CoreModules/RCTDevMenu.h @@ -9,6 +9,7 @@ #import #import +#import #import #if RCT_DEV_MENU @@ -108,3 +109,9 @@ typedef NSString * (^RCTDevMenuItemTitleBlock)(void); @property (nonatomic, readonly) RCTDevMenu *devMenu; @end + +@interface RCTBridgeProxy (RCTDevMenu) + +@property (nonatomic, readonly) RCTDevMenu *devMenu; + +@end diff --git a/packages/react-native/React/CoreModules/RCTDevMenu.mm b/packages/react-native/React/CoreModules/RCTDevMenu.mm index f40cf4febf25af..1a8b81ead4d23b 100644 --- a/packages/react-native/React/CoreModules/RCTDevMenu.mm +++ b/packages/react-native/React/CoreModules/RCTDevMenu.mm @@ -563,6 +563,19 @@ - (RCTDevMenu *)devMenu @end +@implementation RCTBridgeProxy (RCTDevMenu) + +- (RCTDevMenu *)devMenu +{ +#if RCT_DEV_MENU + return [self moduleForClass:[RCTDevMenu class]]; +#else + return nil; +#endif +} + +@end + Class RCTDevMenuCls(void) { return RCTDevMenu.class; diff --git a/packages/react-native/React/CoreModules/RCTDevSettings.h b/packages/react-native/React/CoreModules/RCTDevSettings.h index c576e372f4b037..35a24b5d9191b2 100644 --- a/packages/react-native/React/CoreModules/RCTDevSettings.h +++ b/packages/react-native/React/CoreModules/RCTDevSettings.h @@ -6,6 +6,7 @@ */ #import +#import #import #import #import @@ -114,6 +115,12 @@ @end +@interface RCTBridgeProxy (RCTDevSettings) + +@property (nonatomic, readonly) RCTDevSettings *devSettings; + +@end + // In debug builds, the dev menu is enabled by default but it is further customizable using this method. // However, this method only has an effect in builds where the dev menu is actually compiled in. // (i.e. RCT_DEV or RCT_DEV_MENU is set) diff --git a/packages/react-native/React/CoreModules/RCTDevSettings.mm b/packages/react-native/React/CoreModules/RCTDevSettings.mm index d9b03ed38744b2..f95e963fb29d5b 100644 --- a/packages/react-native/React/CoreModules/RCTDevSettings.mm +++ b/packages/react-native/React/CoreModules/RCTDevSettings.mm @@ -633,6 +633,21 @@ - (RCTDevSettings *)devSettings @end +@implementation RCTBridgeProxy (RCTDevSettings) + +- (RCTDevSettings *)devSettings +{ +#if RCT_REMOTE_PROFILE + return [self moduleForClass:[RCTDevSettings class]]; +#elif RCT_DEV_MENU + return devSettingsMenuEnabled ? [self moduleForClass:[RCTDevSettings class]] : nil; +#else + return nil; +#endif +} + +@end + Class RCTDevSettingsCls(void) { return RCTDevSettings.class; diff --git a/packages/react-native/React/CoreModules/RCTRedBox.h b/packages/react-native/React/CoreModules/RCTRedBox.h index 5d67a2a57a914c..e4eed8732c40e9 100644 --- a/packages/react-native/React/CoreModules/RCTRedBox.h +++ b/packages/react-native/React/CoreModules/RCTRedBox.h @@ -9,6 +9,7 @@ #import #import +#import #import @class RCTJSStackFrame; @@ -57,3 +58,9 @@ typedef void (^RCTRedBoxButtonPressHandler)(void); @property (nonatomic, readonly) RCTRedBox *redBox; @end + +@interface RCTBridgeProxy (RCTRedBox) + +@property (nonatomic, readonly) RCTRedBox *redBox; + +@end diff --git a/packages/react-native/React/CoreModules/RCTRedBox.mm b/packages/react-native/React/CoreModules/RCTRedBox.mm index c80731cea7d636..dc58594a80702c 100644 --- a/packages/react-native/React/CoreModules/RCTRedBox.mm +++ b/packages/react-native/React/CoreModules/RCTRedBox.mm @@ -702,6 +702,15 @@ - (RCTRedBox *)redBox @end +@implementation RCTBridgeProxy (RCTRedBox) + +- (RCTRedBox *)redBox +{ + return RCTRedBoxGetEnabled() ? [self moduleForClass:[RCTRedBox class]] : nil; +} + +@end + #else // Disabled @interface RCTRedBox () @@ -787,6 +796,15 @@ - (RCTRedBox *)redBox @end +@implementation RCTBridgeProxy (RCTRedBox) + +- (RCTRedBox *)redBox +{ + return nil; +} + +@end + #endif Class RCTRedBoxCls(void) diff --git a/packages/react-native/React/CoreModules/RCTWebSocketModule.h b/packages/react-native/React/CoreModules/RCTWebSocketModule.h index 0e39e18f990c50..f92bfc42e3aea3 100644 --- a/packages/react-native/React/CoreModules/RCTWebSocketModule.h +++ b/packages/react-native/React/CoreModules/RCTWebSocketModule.h @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. */ +#import #import NS_ASSUME_NONNULL_BEGIN @@ -32,4 +33,10 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface RCTBridgeProxy (RCTWebSocketModule) + +- (RCTWebSocketModule *)webSocketModule; + +@end + NS_ASSUME_NONNULL_END diff --git a/packages/react-native/React/CoreModules/RCTWebSocketModule.mm b/packages/react-native/React/CoreModules/RCTWebSocketModule.mm index 4451b9460e5bac..3fd7238911f559 100644 --- a/packages/react-native/React/CoreModules/RCTWebSocketModule.mm +++ b/packages/react-native/React/CoreModules/RCTWebSocketModule.mm @@ -207,6 +207,15 @@ - (RCTWebSocketModule *)webSocketModule @end +@implementation RCTBridgeProxy (RCTWebSocketModule) + +- (RCTWebSocketModule *)webSocketModule +{ + return [self moduleForClass:[RCTWebSocketModule class]]; +} + +@end + Class RCTWebSocketModuleCls(void) { return RCTWebSocketModule.class; diff --git a/packages/react-native/React/Modules/RCTSurfacePresenterStub.h b/packages/react-native/React/Modules/RCTSurfacePresenterStub.h index 70510c181279cc..9cf334854744ca 100644 --- a/packages/react-native/React/Modules/RCTSurfacePresenterStub.h +++ b/packages/react-native/React/Modules/RCTSurfacePresenterStub.h @@ -8,6 +8,7 @@ #import #import +#import @protocol RCTSurfaceProtocol; @@ -44,4 +45,11 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface RCTBridgeProxy (RCTSurfacePresenterStub) + +- (id)surfacePresenter; +- (void)setSurfacePresenter:(id)presenter; + +@end + NS_ASSUME_NONNULL_END diff --git a/packages/react-native/React/Modules/RCTSurfacePresenterStub.m b/packages/react-native/React/Modules/RCTSurfacePresenterStub.m index e4e0ec7404be59..07524d583ea422 100644 --- a/packages/react-native/React/Modules/RCTSurfacePresenterStub.m +++ b/packages/react-native/React/Modules/RCTSurfacePresenterStub.m @@ -20,3 +20,17 @@ - (void)setSurfacePresenter:(id)surfacePresenter } @end + +@implementation RCTBridgeProxy (RCTSurfacePresenterStub) + +- (id)surfacePresenter +{ + return objc_getAssociatedObject(self, @selector(surfacePresenter)); +} + +- (void)setSurfacePresenter:(id)surfacePresenter +{ + objc_setAssociatedObject(self, @selector(surfacePresenter), surfacePresenter, OBJC_ASSOCIATION_RETAIN); +} + +@end diff --git a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm index 6c76569703cc65..2258edae930bdb 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/bridgeless/platform/ios/Core/RCTInstance.mm @@ -6,11 +6,13 @@ */ #import "RCTInstance.h" +#import #import #import #import +#import #import #import #import @@ -229,6 +231,21 @@ - (void)_start delegate:self jsInvoker:std::make_shared(bufferedRuntimeExecutor)]; + if (RCTTurboModuleInteropEnabled() && RCTTurboModuleInteropBridgeProxyEnabled()) { + RCTBridgeProxy *bridgeProxy = [[RCTBridgeProxy alloc] + initWithViewRegistry:_bridgeModuleDecorator.viewRegistry_DEPRECATED + moduleRegistry:_bridgeModuleDecorator.moduleRegistry + bundleManager:_bridgeModuleDecorator.bundleManager + callableJSModules:_bridgeModuleDecorator.callableJSModules + dispatchToJSThread:^(dispatch_block_t block) { + __strong __typeof(self) strongSelf = weakSelf; + if (strongSelf && strongSelf->_valid) { + strongSelf->_reactInstance->getBufferedRuntimeExecutor()([=](jsi::Runtime &runtime) { block(); }); + } + }]; + [_turboModuleManager setBridgeProxy:bridgeProxy]; + } + // Initialize RCTModuleRegistry so that TurboModules can require other TurboModules. [_bridgeModuleDecorator.moduleRegistry setTurboModuleRegistry:_turboModuleManager]; diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h index 34535f8c381073..4d0872fbab4a69 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h @@ -9,6 +9,7 @@ #import +#import #import #import #import @@ -65,6 +66,9 @@ RCT_EXTERN void RCTTurboModuleSetBindingMode(facebook::react::TurboModuleBinding */ - (void)installJSBindingWithRuntimeExecutor:(facebook::react::RuntimeExecutor &)runtimeExecutor; +// TODO: Should we move this into the initializer? +- (void)setBridgeProxy:(RCTBridgeProxy *)bridgeProxy; + - (void)invalidate; @end diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm index 9b629d8d72fc44..efb232fa13420e 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm @@ -17,6 +17,7 @@ #import #import +#import #import #import #import @@ -198,6 +199,8 @@ @implementation RCTTurboModuleManager { NSDictionary> *_legacyEagerlyInitializedModules; NSDictionary *_legacyEagerlyRegisteredModuleClasses; + + RCTBridgeProxy *_bridgeProxy; } - (instancetype)initWithBridge:(RCTBridge *)bridge @@ -243,6 +246,11 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge return self; } +- (void)setBridgeProxy:(RCTBridgeProxy *)bridgeProxy +{ + _bridgeProxy = bridgeProxy; +} + - (void)notifyAboutTurboModuleSetup:(const char *)name { NSString *moduleName = [[NSString alloc] initWithUTF8String:name]; @@ -441,6 +449,15 @@ - (BOOL)_isLegacyModule:(const char *)moduleName } Class moduleClass = [self _getModuleClassFromName:moduleName]; + return [self _isLegacyModuleClass:moduleClass]; +} + +- (BOOL)_isLegacyModuleClass:(Class)moduleClass +{ + if (RCTTurboModuleInteropForAllTurboModulesEnabled()) { + return YES; + } + return moduleClass != nil && (!RCT_IS_TURBO_MODULE_CLASS(moduleClass) || [moduleClass isSubclassOfClass:RCTCxxModule.class]); } @@ -617,7 +634,7 @@ - (BOOL)_shouldCreateObjCModule:(Class)moduleClass * this method exists to know if we can safely set the bridge to the * NativeModule. */ - if ([module respondsToSelector:@selector(bridge)] && _bridge) { + if ([module respondsToSelector:@selector(bridge)] && (_bridge || _bridgeProxy)) { /** * Just because a NativeModule has the `bridge` method, it doesn't mean * that it has synthesized the bridge in its implementation. Therefore, @@ -634,7 +651,11 @@ - (BOOL)_shouldCreateObjCModule:(Class)moduleClass * generated, so we have have to rely on the KVC API of ObjC to set * the bridge property of these NativeModules. */ - [(id)module setValue:_bridge forKey:@"bridge"]; + if (_bridge) { + [(id)module setValue:_bridge forKey:@"bridge"]; + } else if (_bridgeProxy && [self _isLegacyModuleClass:[module class]]) { + [(id)module setValue:_bridgeProxy forKey:@"bridge"]; + } } @catch (NSException *exception) { RCTLogError( @"%@ has no setter or ivar for its bridge, which is not " From e66c906454e40308f68a110f8a9d6258edda2352 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 15 Jun 2023 20:50:08 -0700 Subject: [PATCH 195/468] translation auto-update for i18n/twilight.config.json on master Summary: Chronos Job Instance ID: 1125907900414465 Sandcastle Job Instance ID: 13510799855734354 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46788752 fbshipit-source-id: ca4f179c658c3d1239ab5d48d09e44c266c2103d --- .../src/main/res/views/uimanager/values-fr/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml index 64b98fc6a925f6..14e76329cc9db8 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml @@ -3,4 +3,8 @@ + opération en cours + agrandi + réduit + mixte From 582951eca67625e2e9a7345e88d134091001a81b Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 15 Jun 2023 22:34:36 -0700 Subject: [PATCH 196/468] Create ReactHostInterface Summary: Introduce ReactHostInterface interface bypass-github-export-checks changelog: [internal] internal Reviewed By: fkgozali Differential Revision: D46746516 fbshipit-source-id: 6c0c84761fbfd2009d72b1bf138648e1b31b4730 --- .../react/interfaces/ReactHostInterface.kt | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactHostInterface.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactHostInterface.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactHostInterface.kt new file mode 100644 index 00000000000000..cdaadcc706087f --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactHostInterface.kt @@ -0,0 +1,66 @@ +/* + * 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.react.interfaces + +import android.app.Activity +import com.facebook.react.bridge.ReactContext +import com.facebook.react.bridge.queue.ReactQueueConfiguration +import com.facebook.react.common.LifecycleState +import com.facebook.react.common.annotations.UnstableReactNativeAPI +import com.facebook.react.devsupport.interfaces.DevSupportManager +import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler + +/** + * A ReactHost is an object that manages a single {@link ReactInstance}. A ReactHost can be + * constructed without initializing the ReactInstance, and it will continue to exist after the + * instance is destroyed. + * + * The implementation of this interface should be Thread Safe + */ +@UnstableReactNativeAPI +interface ReactHostInterface { + + /** The current [LifecycleState] for React Host */ + val lifecycleState: LifecycleState + + /** + * The current [ReactContext] associated with ReactInstance. It could be nullable if ReactInstance + * hasn't been created. + */ + val currentReactContext: ReactContext? + + // TODO: review if DevSupportManager should be nullable + /** [DevSupportManager] used by this ReactHost */ + val devSupportManager: DevSupportManager? + + // TODO: review if possible to remove ReactQueueConfiguration + /** [ReactQueueConfiguration] for caller to post jobs in React Native threads */ + val reactQueueConfiguration: ReactQueueConfiguration? + + /** To be called when back button is pressed */ + fun onBackPressed(): Boolean + + // TODO: review why activity is nullable in all of the lifecycle methods + /** To be called when the host activity is resumed. */ + fun onHostResume(activity: Activity?, defaultBackButtonImpl: DefaultHardwareBackBtnHandler?) + + /** To be called when the host activity is resumed. */ + fun onHostResume(activity: Activity?) + + /** To be called when the host activity is paused. */ + fun onHostPause(activity: Activity?) + + /** To be called when the host activity is paused. */ + fun onHostPause() + + /** To be called when the host activity is destroyed. */ + fun onHostDestroy() + + /** To be called when the host activity is destroyed. */ + fun onHostDestroy(activity: Activity?) +} From e51ff0b6e693010c4a078e133f3ff31336d116ec Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 15 Jun 2023 22:34:36 -0700 Subject: [PATCH 197/468] Refactor ReactHost to implement ReactHostInterface Summary: Refactor ReactHost to implement ReactHostInterface bypass-github-export-checks changelog: [internal] internal Reviewed By: cortinico Differential Revision: D46770421 fbshipit-source-id: d7d6dc361ef89b3478e882a3334059c6440f1edf --- .../com/facebook/react/bridgeless/ReactHost.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java index 88dd19ed42968f..608b58e9f84089 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java @@ -48,6 +48,7 @@ import com.facebook.react.devsupport.interfaces.DevSupportManager; import com.facebook.react.fabric.ComponentFactory; import com.facebook.react.fabric.FabricUIManager; +import com.facebook.react.interfaces.ReactHostInterface; import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; import com.facebook.react.modules.core.DeviceEventManagerModule; import com.facebook.react.uimanager.UIManagerModule; @@ -77,7 +78,7 @@ */ @ThreadSafe @Nullsafe(Nullsafe.Mode.LOCAL) -public class ReactHost { +public class ReactHost implements ReactHostInterface { // TODO T61403233 Make this configurable by product code private static final boolean DEV = ReactBuildConfig.DEBUG; @@ -183,6 +184,7 @@ private MemoryPressureListener createMemoryPressureListener(ReactInstance reactI }; } + @Override public LifecycleState getLifecycleState() { return mReactLifecycleStateManager.getLifecycleState(); } @@ -322,6 +324,7 @@ public Task stopSurface(final ReactSurface surface) { * @param activity The host activity */ @ThreadConfined(UI) + @Override public void onHostResume( final @Nullable Activity activity, DefaultHardwareBackBtnHandler defaultBackButtonImpl) { mDefaultHardwareBackBtnHandler = defaultBackButtonImpl; @@ -329,6 +332,7 @@ public void onHostResume( } @ThreadConfined(UI) + @Override public void onHostResume(final @Nullable Activity activity) { final String method = "onHostResume(activity)"; log(method); @@ -341,6 +345,7 @@ public void onHostResume(final @Nullable Activity activity) { } @ThreadConfined(UI) + @Override public void onHostPause(final @Nullable Activity activity) { final String method = "onHostPause(activity)"; log(method); @@ -368,6 +373,7 @@ public void onHostPause(final @Nullable Activity activity) { /** To be called when the host activity is paused. */ @ThreadConfined(UI) + @Override public void onHostPause() { final String method = "onHostPause()"; log(method); @@ -381,6 +387,7 @@ public void onHostPause() { /** To be called when the host activity is destroyed. */ @ThreadConfined(UI) + @Override public void onHostDestroy() { final String method = "onHostDestroy()"; log(method); @@ -390,6 +397,7 @@ public void onHostDestroy() { } @ThreadConfined(UI) + @Override public void onHostDestroy(@Nullable Activity activity) { final String method = "onHostDestroy(activity)"; log(method); @@ -413,10 +421,12 @@ private void moveToHostDestroy(@Nullable ReactContext currentContext) { * * @return The {@link BridgelessReactContext} associated with ReactInstance. */ + @Override public @Nullable ReactContext getCurrentReactContext() { return mBridgelessReactContextRef.getNullable(); } + @Override public DevSupportManager getDevSupportManager() { return assertNotNull(mDevSupportManager); } @@ -503,6 +513,7 @@ public MemoryPressureRouter getMemoryPressureRouter() { } @ThreadConfined(UI) + @Override public boolean onBackPressed() { UiThreadUtil.assertOnUiThread(); final ReactInstance reactInstance = mReactInstanceTaskRef.get().getResult(); From 5f088a4ddf7afde190bd440a57c94c265d753322 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 15 Jun 2023 22:34:36 -0700 Subject: [PATCH 198/468] Reduce visibility of ReactHost.getDefaultBackButtonHandler() method Summary: Reduce visibility of ReactHost.getDefaultBackButtonHandler() method bypass-github-export-checks changelog: [internal] internal Reviewed By: cortinico Differential Revision: D46773273 fbshipit-source-id: 5608a03882ca33028f10c9e47f7ad77930eb6db9 --- .../src/main/java/com/facebook/react/bridgeless/ReactHost.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java index 608b58e9f84089..3660c61d780d75 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java @@ -494,7 +494,7 @@ T getNativeModule(Class nativeModuleInterface) { return null; } - public DefaultHardwareBackBtnHandler getDefaultBackButtonHandler() { + /* package */ DefaultHardwareBackBtnHandler getDefaultBackButtonHandler() { return () -> { UiThreadUtil.assertOnUiThread(); if (mDefaultHardwareBackBtnHandler != null) { From 0edc2f08e157ac7becc17249633141881f12e585 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 15 Jun 2023 22:34:36 -0700 Subject: [PATCH 199/468] Refactor ReactApplication to support ReactHostInterface Summary: This diff refactors ReactApplication to support ReactHostInterface, the goal is to be able to use this interface to integrate bridgeless in RN Tester app bypass-github-export-checks changelog: [internal] internal Reviewed By: cortinico Differential Revision: D46770419 fbshipit-source-id: b3e88b12aab6287396b16b277f906026a07acad6 --- .../java/com/facebook/react/ReactApplication.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.java index 3d7ce471d1198b..b8abe0cf16980f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.java @@ -7,8 +7,20 @@ package com.facebook.react; +import androidx.annotation.Nullable; +import com.facebook.react.interfaces.ReactHostInterface; + +/** Interface that represents an instance of a React Native application */ public interface ReactApplication { /** Get the default {@link ReactNativeHost} for this app. */ ReactNativeHost getReactNativeHost(); + + /** + * Get the default {@link ReactHostInterface} for this app. This method will be used by the new + * architecture of react native + */ + default @Nullable ReactHostInterface getReactHostInterface() { + return null; + } } From c5496fd93f3c09d72b249b8154f17af8a6df38fb Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 15 Jun 2023 22:34:36 -0700 Subject: [PATCH 200/468] Introduce ReactSurfaceInterface Summary: This diff introduces ReactSurfaceInterface (as an empty interface). The goal is to demonstrate that we will be extending interfaces iteratively, meaning we will complete this API as we advance on the Stable API of surface in H2 bypass-github-export-checks changelog: [internal] internal Reviewed By: cortinico Differential Revision: D46770420 fbshipit-source-id: 48b1ee302c157ae3431d61c84322d788d149f881 --- .../facebook/react/bridgeless/ReactSurface.java | 3 ++- .../react/interfaces/ReactSurfaceInterface.kt | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactSurfaceInterface.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactSurface.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactSurface.java index c7898a1c5767ba..8568296d4d27ad 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactSurface.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactSurface.java @@ -23,6 +23,7 @@ import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.fabric.SurfaceHandler; import com.facebook.react.fabric.SurfaceHandlerBinding; +import com.facebook.react.interfaces.ReactSurfaceInterface; import com.facebook.react.modules.i18nmanager.I18nUtil; import com.facebook.react.uimanager.events.EventDispatcher; import java.util.concurrent.atomic.AtomicReference; @@ -31,7 +32,7 @@ /** A class responsible for creating and rendering a full-screen React surface. */ @Nullsafe(Nullsafe.Mode.LOCAL) @ThreadSafe -public class ReactSurface { +public class ReactSurface implements ReactSurfaceInterface { private final AtomicReference mSurfaceView = new AtomicReference<>(null); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactSurfaceInterface.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactSurfaceInterface.kt new file mode 100644 index 00000000000000..5dd268bdf098de --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/interfaces/ReactSurfaceInterface.kt @@ -0,0 +1,14 @@ +/* + * 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.react.interfaces + +/** Represents a Surface in React Native. */ +interface ReactSurfaceInterface { + // the API of this interface will be completed as we analyze and refactor API of ReactSurface, + // ReactRootView, etc. +} From 92525ef3aebb5b31a4af1f987ef0282d12ecb7a1 Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Fri, 16 Jun 2023 00:44:20 -0700 Subject: [PATCH 201/468] Untangle dependency loop in virtualized-lists (#37912) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37912 # Changelog: [Internal] - I've noticed bundler spamming with cyclical dependency warnings when working on FB4A. This gets rid of the unneeded two-way dependency between `ListMetricsAggregator <-> VirtualizeUtils`. Reviewed By: NickGerleman Differential Revision: D46761080 fbshipit-source-id: a25f7eebbd177e24c39dad9af7ac574f3aa30f35 --- packages/virtualized-lists/Lists/VirtualizeUtils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/virtualized-lists/Lists/VirtualizeUtils.js b/packages/virtualized-lists/Lists/VirtualizeUtils.js index 3dd88d607590bf..012ef5ba97f07f 100644 --- a/packages/virtualized-lists/Lists/VirtualizeUtils.js +++ b/packages/virtualized-lists/Lists/VirtualizeUtils.js @@ -10,8 +10,9 @@ 'use strict'; -import type {CellMetricProps} from './ListMetricsAggregator'; -import ListMetricsAggregator from './ListMetricsAggregator'; +import type ListMetricsAggregator, { + CellMetricProps, +} from './ListMetricsAggregator'; /** * Used to find the indices of the frames that overlap the given offsets. Useful for finding the From 621a7a86343b919b9acf2a81058e22501ddbd796 Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Fri, 16 Jun 2023 02:12:23 -0700 Subject: [PATCH 202/468] Extend expected Flow type of the global.performance object to match Performance API (#37917) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37917 # Changelog: [Internal] - The `global.performance` object now has all of the API defined according to the `Performance` API, so we can modify the local RN's flow definition override correspondingly. Reviewed By: NickGerleman Differential Revision: D46762326 fbshipit-source-id: 0d0b9ea271a91008e775d8cf59693c35758f71e5 --- .../Libraries/Core/setUpPerformance.js | 19 ++++++------------- .../Utilities/createPerformanceLogger.js | 2 +- packages/react-native/flow/global.js | 4 +--- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/packages/react-native/Libraries/Core/setUpPerformance.js b/packages/react-native/Libraries/Core/setUpPerformance.js index c5f25890cdcf72..6ed3fce86e501c 100644 --- a/packages/react-native/Libraries/Core/setUpPerformance.js +++ b/packages/react-native/Libraries/Core/setUpPerformance.js @@ -19,18 +19,11 @@ if (NativePerformance) { } else { if (!global.performance) { // $FlowExpectedError[cannot-write] - global.performance = ({}: {now?: () => number}); - } - - /** - * Returns a double, measured in milliseconds. - * https://developer.mozilla.org/en-US/docs/Web/API/Performance/now - */ - if (typeof global.performance.now !== 'function') { - // $FlowExpectedError[cannot-write] - global.performance.now = function () { - const performanceNow = global.nativePerformanceNow || Date.now; - return performanceNow(); - }; + global.performance = ({ + now: function () { + const performanceNow = global.nativePerformanceNow || Date.now; + return performanceNow(); + }, + }: {now?: () => number}); } } diff --git a/packages/react-native/Libraries/Utilities/createPerformanceLogger.js b/packages/react-native/Libraries/Utilities/createPerformanceLogger.js index 0c09c750c7f094..40b565eabe33f0 100644 --- a/packages/react-native/Libraries/Utilities/createPerformanceLogger.js +++ b/packages/react-native/Libraries/Utilities/createPerformanceLogger.js @@ -27,7 +27,7 @@ const PRINT_TO_CONSOLE: false = false; // Type as false to prevent accidentally const WEB_PERFORMANCE_PREFIX = 'global_perf_'; export const getCurrentTimestamp: () => number = - global.nativeQPLTimestamp ?? global.performance.now.bind(global.performance); + global.nativeQPLTimestamp ?? (() => global.performance.now()); class PerformanceLogger implements IPerformanceLogger { _timespans: {[key: string]: ?Timespan} = {}; diff --git a/packages/react-native/flow/global.js b/packages/react-native/flow/global.js index e7f9814671a5a6..676f09957d259d 100644 --- a/packages/react-native/flow/global.js +++ b/packages/react-native/flow/global.js @@ -27,9 +27,7 @@ declare var global: { }, // setUpPerformance - +performance: { - +now: () => number, - }, + +performance: Performance, // setUpXHR +XMLHttpRequest: typeof XMLHttpRequest, From d097408c1ca15d3aa9dd69dc12f1043f54890213 Mon Sep 17 00:00:00 2001 From: Ilya Zorin Date: Fri, 16 Jun 2023 02:41:48 -0700 Subject: [PATCH 203/468] Correctly annotate ReactHost.onHostResume Reviewed By: ezgicicek, ngorogiannis Differential Revision: D46795053 fbshipit-source-id: 266c9f27e3db5cdf1e1bb0f9ce30e71b31f54e2d --- .../src/main/java/com/facebook/react/bridgeless/ReactHost.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java index 3660c61d780d75..354e0cf62ee8ad 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHost.java @@ -326,7 +326,8 @@ public Task stopSurface(final ReactSurface surface) { @ThreadConfined(UI) @Override public void onHostResume( - final @Nullable Activity activity, DefaultHardwareBackBtnHandler defaultBackButtonImpl) { + final @Nullable Activity activity, + @Nullable DefaultHardwareBackBtnHandler defaultBackButtonImpl) { mDefaultHardwareBackBtnHandler = defaultBackButtonImpl; onHostResume(activity); } From f1901d43d5bc5d579745e91f3bed09d7314ae6e1 Mon Sep 17 00:00:00 2001 From: Pankaj Khushalani <2182001pk@gmail.com> Date: Fri, 16 Jun 2023 04:05:49 -0700 Subject: [PATCH 204/468] migrate ReactCookieJarContainerTest to Kotlin (#37809) Summary: This PR migrates ReactCookieJarContainerTest.java to Kotlin as a part of the issue https://github.com/facebook/react-native/issues/37708 ## Changelog: [INTERNAL] [CHANGED] - Migrate ReactCookieJarContainerTest.java to Kotlin + ocupado + ampliado + contraído + mezclado diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml index bfb1514177a8c5..b88dde0a04992a 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml @@ -3,4 +3,8 @@ + ocupado + expandido + contraído + mixto diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml index 3bca368f01586b..7fa9a41c23edb5 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml @@ -3,4 +3,8 @@ + व्यस्त + बड़ा किया गया + छोटा किया गया + मिक्स diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml index 873742c208ac05..900e9a239fb400 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml @@ -3,4 +3,8 @@ + opptatt + utvidet + skjult + blandet diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml index a4206503879525..7fedc8676bbfb5 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml @@ -3,4 +3,8 @@ + ไม่ว่าง + ขยายแล้ว + ยุบแล้ว + ผสมกัน From ba726f69755bc67c017c2a2257cf10cb78fb013a Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 06:33:44 -0700 Subject: [PATCH 209/468] translation auto-update for i18n/portal_smart_camera.config.json on master Summary: Chronos Job Instance ID: 1125907900691355 Sandcastle Job Instance ID: 4503600601881693 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46798916 fbshipit-source-id: 49b815201a355eb8ba1a9d964ccba88a68e66d6a --- .../src/main/res/views/uimanager/values-zh-rTW/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml index c56baa9ccc27f0..2f98cd91d203de 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml @@ -3,4 +3,7 @@ + 已展開 + 已收合 + 混合 From 6350f77b0ac20f62d85386872c44148a02663570 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 06:33:44 -0700 Subject: [PATCH 210/468] translation auto-update for i18n/analyticsapp.config.json on master Summary: Chronos Job Instance ID: 1125907900691355 Sandcastle Job Instance ID: 4503600601881693 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46798911 fbshipit-source-id: 3ad5f39013157f0b4b27df470a5e3f50ca569dbb --- .../src/main/res/views/uimanager/values-zh-rTW/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml index 2f98cd91d203de..f9f52e8dcb39dc 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml @@ -3,6 +3,7 @@ + 忙線中 已展開 已收合 混合 From fa17aad24e988216280e9b066d04a993619e02de Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 06:37:11 -0700 Subject: [PATCH 211/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907900746121 Sandcastle Job Instance ID: 13510799856289353 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46799013 fbshipit-source-id: fb554c0a053e01f0f7627cee2b896ee7372f6773 --- .../strings/es-ES.lproj/fbt_language_pack.bin | Bin 0 -> 428 bytes .../I18n/strings/es.lproj/fbt_language_pack.bin | Bin 0 -> 424 bytes .../I18n/strings/fr.lproj/fbt_language_pack.bin | Bin 0 -> 428 bytes .../I18n/strings/hi.lproj/fbt_language_pack.bin | Bin 0 -> 1640 bytes .../I18n/strings/nb.lproj/fbt_language_pack.bin | Bin 0 -> 416 bytes .../I18n/strings/th.lproj/fbt_language_pack.bin | Bin 0 -> 1776 bytes .../strings/zh-Hant.lproj/fbt_language_pack.bin | Bin 0 -> 1300 bytes 7 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/react-native/React/I18n/strings/es-ES.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/es.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/fr.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/hi.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/nb.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/th.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/zh-Hant.lproj/fbt_language_pack.bin diff --git a/packages/react-native/React/I18n/strings/es-ES.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/es-ES.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..0b9570e4652a01dbc75e7f22ed134f6ee8fb1f08 GIT binary patch literal 428 zcmY#kU|?`_@(GY(PywCB5Ssw81Q3J74gm2QAf5rlEkL~I|Ns9WaV{WE&d)0;N<6$aC7*%e z3RIjOD4w5OT9617d;t~X0E#8%7UX1t1c5*W=tBH}1?)4BJs_32sa452P`x02R!~S` zZe~F+$P5tQqbeXP#LOud#y83-OAJT~Foy9{a{SUP%Thua7}&sJ!v>T9nGFg85Pb;h lP7vEK)CUvCB5Ssw81Q3J7_5kq;Af5um4M4o-|Ns9WaV{WE&d)0;N<6$aC7*%e z3RIjOD4w5OT9617d;t~X1d63r6eQ-QWP+3eUCjX`@c|aF&p`ID0 MF~hBNLN-+ zNMUYfK`@XB=6h5HWQCYH<-+(zIc13fNdd+%eoBsCnq^r^C<6lTOcz`g_7#R|l^nH43e zKpLbgD=4HeH?trZ$OQ8}ssge?%$#yze50JQ#DJs#V;Dar$1lyYEG3kIfejosY(NQ+ txu75b(TAY!1F`)=eSClvFpQAh#{v#Bko-FgwOn8`L3+4=7^DW-9010ZJ2C(O literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/hi.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/hi.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..c84ee86adac985f97b0e7418f8227f8eb3a5fbaa GIT binary patch literal 1640 zcmah}O-R#W7=NlICPGpX3xq~lCxxxek;mz>Y1>?Lv(;toqlx?QYq?Z9l=O)O9TdX? z3I2m2Vj>7TNJ(_)(4j+zj_;vEhlmayI#l+1zs4-F!SDb7|K8{KKF{+$&$G9Qh&tQ7 zfktY=7mp%BoKo)QVW`OM>S^{nY0l)&7fKTvM24;Y(0Qc=cTnkVS{6L(~zz1L*C;>CT zEg%a-05@O-8i871lji}v2g-l}@H{tuZf(I#Cjn+WW5sD^EHLAhg&DKVc+HHLlFZ33 z`mXecg?@n*reS@AJq!xmDy z1JycwXVp6I7Bi%NP3)bQ>8`LMVokwJPq)RA+C`x)$!u}R5_B6%cf88ytjGk;9&SI| zSEW56v@+NWRixrH+|KEZx0$hs+W(fdI3@Ip+K38Qgh;n6^AXj<9H>3AM$6(rB~%%r zd!mxadl~-5m5$E_FE2m1(&<*vbET>OO9M(}Ws_&YiE&nVK?jyF10p59Bujx|{G#-- zuXjb$Pyx{~)0RBvArWUytYU0r(G8*|WtTIC^iZ_*U1lt#^fDGk2VF4rkEcskyz-cO%|q4{F}+v9Q3;J-%P>-^g0y}&gq-fvW| h`I{R5PJZz0T4?7F-U9+5HA4Y9w4p&;v@h6{|AY)0daA5R%uQN1H%od7&}lb zzo4Kbv806I4U$-CNm*t}Y6;M_96%NL01MbhAoD?HCFLaMf%JiNWd(&4=4KWIgLH%V z9#sKZA!bgwFuqYvSzn+4T;3CXreKYw6-)faY3PC!M4;w5seA-VUa#~6>1?YKuN%a zg$oplZg>TwvJe-}Oy1KfZGr~@j2 zU&zmaeSiU5z;j>*cm(tSEkFZMEBN8j5pHw=;B134#@QOz<~ZBt+B42}u%0t~t_UAt zdMSNoIh*Hfle14;TjXq)vjxu91!cSR-q>?l#(lxr2gKqGet19vYzE!tY>()m%ohRo zWF<(1hfSGrg=+}DMr8V}*ITV>DOk|EQX6|K!;5Tir5lE=R@U=M=oCex+;{Q{*?Hj? zGyE3ZT+B#q}aP; z#L?$}qFquj%GRKZ_Kp4e98YjykkgDe)Bk@a`9>4}X9pl>^?->$eV+xs}uVGAnW>9IPyG81Q*|ucd zKHX$d+@0)dyyXs$Dc{(>?6H*o7&rw3B||VQ`Tg7x>0e@bRf~=XiY1AJ(UdyA^|a8U4P0ScV=TD#Yel+ z{xM7Lq2lp7X@_ena$E7nWXk2Thwdvr9L#w7yd8*NA-^x;^C9Mh*S)-dHO_-r^M|}% c-0+<#owrGTcZB`NG2bc~Q|ze%gimRlzurTnHvj+t literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/zh-Hant.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/zh-Hant.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..0a4ebe25c885510d2d81c583f3589ac1226b6f0b GIT binary patch literal 1300 zcmaKs%}*0S7{*845F{jWFvbH14jeo{(%RBU;(-EU!M3cWMKmVZ4~z5z3WW-U11Q8o zF<=5k#Ke*yX-pu}psfm+c=Eu(g9i^DJTTifA%?#|d}i6HYfRka*O}*e=Y3~qW;>OH zkfwUGSWYU@Bcy_q2$?1^0j*)PX8+ z9thwNbAAV(!4^mW_HIMK14O{yulU!|5nIY>K+`E{{w<|(C6%8` zMx~_(bSVj6RQyu(^NI27=BkvLr11?%5>R4Ag%}}YDvw4VNwdp@%&RsQ72#)9Dwvhda5IB+Fdh zAf-pgd%)@yV#jIZf)bPWhv#8jo#L~4`iBYBXFo`dh27Hah#bZZUKX zm|eyI*H>!vrUq@Vp6gDFq1h7FM7Xxpb`B0Yh6?lDbZgrj8h00u_qN}tX=?EMxbANp z*7}_z)m)oKM4#PIALROCAmS8VqK<1%!0N4ycpO}ZT7%X;&Cp%0z1M>V-+{HXh6XL literal 0 HcmV?d00001 From a855013fc6c963aca2282b6b43aeeb621eeb88d7 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 16 Jun 2023 08:00:57 -0700 Subject: [PATCH 212/468] Use static_cast instead of static_pointer_cast where possible (#37932) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37932 `static_cast(*sharedBase)` is preferred over `*std::static_pointer_cast(sharedBase)`, since we don't need to copy the underlying shared_ptr to do so. The same applies for `std::const_pointer_cast`. Changelog: [Internal] Reviewed By: rshest Differential Revision: D46766558 fbshipit-source-id: 5d0b660107b2a60340952e2b5ec2792e3ed1832a --- .../RCTActivityIndicatorViewComponentView.mm | 4 +- .../Image/RCTImageComponentView.mm | 18 +++--- .../RCTInputAccessoryComponentView.mm | 4 +- ...CTLegacyViewManagerInteropComponentView.mm | 8 +-- .../Modal/RCTModalHostViewComponentView.mm | 8 +-- .../RCTPullToRefreshViewComponentView.mm | 8 +-- .../ScrollView/RCTScrollViewComponentView.mm | 29 +++++---- .../Switch/RCTSwitchComponentView.mm | 10 +-- .../Text/RCTParagraphComponentView.mm | 10 +-- .../TextInput/RCTTextInputComponentView.mm | 37 ++++++----- .../RCTUnimplementedNativeComponentView.mm | 4 +- .../RCTUnimplementedViewComponentView.mm | 4 +- .../View/RCTViewComponentView.mm | 8 +-- .../Fabric/Mounting/RCTMountingManager.mm | 2 +- .../react/fabric/CoreComponentsRegistry.cpp | 6 +- .../react/fabric/FabricMountingManager.cpp | 15 ++--- .../DefaultComponentsRegistry.cpp | 7 +-- .../LayoutAnimationKeyFrameManager.cpp | 14 ++--- .../image/ImageComponentDescriptor.h | 5 +- .../InputAccessoryComponentDescriptor.h | 19 +++--- ...cyViewManagerInteropComponentDescriptor.mm | 8 +-- .../modal/ModalHostViewComponentDescriptor.h | 22 +++---- .../AndroidProgressBarComponentDescriptor.h | 8 +-- .../SafeAreaViewComponentDescriptor.h | 22 +++---- .../AndroidSwitchComponentDescriptor.h | 8 +-- .../text/ParagraphComponentDescriptor.h | 5 +- .../AndroidTextInputComponentDescriptor.h | 62 +++++++++---------- .../TextInputComponentDescriptor.h | 6 +- .../UnimplementedViewComponentDescriptor.cpp | 4 +- .../components/view/AccessibilityProps.cpp | 2 +- .../core/ConcreteComponentDescriptor.h | 9 ++- .../react/renderer/core/ConcreteState.h | 4 +- .../react/renderer/core/ShadowNode.cpp | 9 +-- .../react/renderer/mounting/ShadowTree.cpp | 2 +- .../renderer/uimanager/UIManagerBinding.cpp | 4 +- .../react/utils/ContextContainer.h | 4 +- 36 files changed, 180 insertions(+), 219 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm index 3f233578412588..eb0d5682f5ddff 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm @@ -64,8 +64,8 @@ - (instancetype)initWithFrame:(CGRect)frame - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - const auto &oldViewProps = *std::static_pointer_cast(_props); - const auto &newViewProps = *std::static_pointer_cast(props); + const auto &oldViewProps = static_cast(*_props); + const auto &newViewProps = static_cast(*props); if (oldViewProps.animating != newViewProps.animating) { if (newViewProps.animating) { diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm index 8b5b3d1b22ad28..043d31f604c648 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm @@ -54,8 +54,8 @@ + (ComponentDescriptorProvider)componentDescriptorProvider - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - auto const &oldImageProps = *std::static_pointer_cast(_props); - auto const &newImageProps = *std::static_pointer_cast(props); + const auto &oldImageProps = static_cast(*_props); + const auto &newImageProps = static_cast(*props); // `resizeMode` if (oldImageProps.resizeMode != newImageProps.resizeMode) { @@ -88,7 +88,7 @@ - (void)updateState:(State::Shared const &)state oldState:(State::Shared const & (newImageState && newImageState->getData().getImageSource() != oldImageState->getData().getImageSource())) { // Loading actually starts a little before this, but this is the first time we know // the image is loading and can fire an event from this component - std::static_pointer_cast(_eventEmitter)->onLoadStart(); + static_cast(*_eventEmitter).onLoadStart(); // TODO (T58941612): Tracking for visibility should be done directly on this class. // For now, we consolidate instrumentation logic in the image loader, so that pre-Fabric gets the same treatment. @@ -138,10 +138,10 @@ - (void)didReceiveImage:(UIImage *)image metadata:(id)metadata fromObserver:(voi return; } - std::static_pointer_cast(_eventEmitter)->onLoad(); - std::static_pointer_cast(_eventEmitter)->onLoadEnd(); + static_cast(*_eventEmitter).onLoad(); + static_cast(*_eventEmitter).onLoadEnd(); - const auto &imageProps = *std::static_pointer_cast(_props); + const auto &imageProps = static_cast(*_props); if (imageProps.tintColor) { image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; @@ -176,7 +176,7 @@ - (void)didReceiveProgress:(float)progress fromObserver:(void const *)observer return; } - std::static_pointer_cast(_eventEmitter)->onProgress(progress); + static_cast(*_eventEmitter).onProgress(progress); } - (void)didReceiveFailureFromObserver:(void const *)observer @@ -187,8 +187,8 @@ - (void)didReceiveFailureFromObserver:(void const *)observer return; } - std::static_pointer_cast(_eventEmitter)->onError(); - std::static_pointer_cast(_eventEmitter)->onLoadEnd(); + static_cast(*_eventEmitter).onError(); + static_cast(*_eventEmitter).onLoadEnd(); } @end diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm index f78c2797f0ef7c..f00cc30d211a16 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm @@ -107,8 +107,8 @@ - (void)unmountChildComponentView:(UIView *)childCompo - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - auto const &oldInputAccessoryProps = *std::static_pointer_cast(_props); - auto const &newInputAccessoryProps = *std::static_pointer_cast(props); + const auto &oldInputAccessoryProps = static_cast(*_props); + const auto &newInputAccessoryProps = static_cast(*props); if (newInputAccessoryProps.backgroundColor != oldInputAccessoryProps.backgroundColor) { _contentView.backgroundColor = RCTUIColorFromSharedColor(newInputAccessoryProps.backgroundColor); diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm index 5324963ea01a42..81181588130732 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm @@ -187,9 +187,9 @@ - (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask _adapter.eventInterceptor = ^(std::string eventName, folly::dynamic event) { if (weakSelf) { __typeof(self) strongSelf = weakSelf; - auto eventEmitter = - std::static_pointer_cast(strongSelf->_eventEmitter); - eventEmitter->dispatchEvent(eventName, event); + const auto &eventEmitter = + static_cast(*strongSelf->_eventEmitter); + eventEmitter.dispatchEvent(eventName, event); } }; self.contentView = _adapter.paperView; @@ -217,7 +217,7 @@ - (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask [_adapter.paperView didUpdateReactSubviews]; if (updateMask & RNComponentViewUpdateMaskProps) { - const auto &newProps = *std::static_pointer_cast(_props); + const auto &newProps = static_cast(*_props); [_adapter setProps:newProps.otherProps]; } } diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm index 28c4bd227b7cc9..b91e44bb15ba23 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm @@ -182,12 +182,12 @@ - (void)ensurePresentedOnlyIfNeeded - (std::shared_ptr)modalEventEmitter { - if (!self->_eventEmitter) { + if (!_eventEmitter) { return nullptr; } - assert(std::dynamic_pointer_cast(self->_eventEmitter)); - return std::static_pointer_cast(self->_eventEmitter); + assert(std::dynamic_pointer_cast(_eventEmitter)); + return std::static_pointer_cast(_eventEmitter); } #pragma mark - RCTMountingTransactionObserving @@ -245,7 +245,7 @@ - (void)prepareForRecycle - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - const auto &newProps = *std::static_pointer_cast(props); + const auto &newProps = static_cast(*props); #if !TARGET_OS_TV self.viewController.supportedInterfaceOrientations = supportedOrientationsMask(newProps.supportedOrientations); diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm index 9480239051e8be..23de45a94715eb 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm @@ -57,8 +57,8 @@ + (ComponentDescriptorProvider)componentDescriptorProvider - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - auto const &oldConcreteProps = *std::static_pointer_cast(_props); - auto const &newConcreteProps = *std::static_pointer_cast(props); + const auto &oldConcreteProps = static_cast(*_props); + const auto &newConcreteProps = static_cast(*props); if (newConcreteProps.refreshing != oldConcreteProps.refreshing) { if (newConcreteProps.refreshing) { @@ -89,12 +89,12 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & - (void)handleUIControlEventValueChanged { - std::static_pointer_cast(_eventEmitter)->onRefresh({}); + static_cast(*_eventEmitter).onRefresh({}); } - (void)_updateTitle { - auto const &concreteProps = *std::static_pointer_cast(_props); + const auto &concreteProps = static_cast(*_props); if (concreteProps.title.empty()) { _refreshControl.attributedTitle = nil; diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm index fde373ba822035..94c82ad08ada0b 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm @@ -190,8 +190,8 @@ - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - const auto &oldScrollViewProps = *std::static_pointer_cast(_props); - const auto &newScrollViewProps = *std::static_pointer_cast(props); + const auto &oldScrollViewProps = static_cast(*_props); + const auto &newScrollViewProps = static_cast(*props); #define REMAP_PROP(reactName, localName, target) \ if (oldScrollViewProps.reactName != newScrollViewProps.reactName) { \ @@ -408,7 +408,7 @@ - (void)_updateStateWithContentOffset - (void)prepareForRecycle { - const auto &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); _scrollView.contentOffset = RCTCGPointFromPoint(props.contentOffset); // We set the default behavior to "never" so that iOS // doesn't do weird things to UIScrollView insets automatically @@ -445,7 +445,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView if ((_lastScrollEventDispatchTime == 0) || (now - _lastScrollEventDispatchTime > _scrollEventThrottle)) { _lastScrollEventDispatchTime = now; if (_eventEmitter) { - std::static_pointer_cast(_eventEmitter)->onScroll([self _scrollViewMetrics]); + static_cast(*_eventEmitter).onScroll([self _scrollViewMetrics]); } RCTSendScrollEventForNativeAnimations_DEPRECATED(scrollView, self.tag); @@ -479,7 +479,7 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView return; } - std::static_pointer_cast(_eventEmitter)->onScrollBeginDrag([self _scrollViewMetrics]); + static_cast(*_eventEmitter).onScrollBeginDrag([self _scrollViewMetrics]); _isUserTriggeredScrolling = YES; } @@ -491,7 +491,7 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL return; } - std::static_pointer_cast(_eventEmitter)->onScrollEndDrag([self _scrollViewMetrics]); + static_cast(*_eventEmitter).onScrollEndDrag([self _scrollViewMetrics]); [self _updateStateWithContentOffset]; @@ -510,8 +510,7 @@ - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView return; } - std::static_pointer_cast(_eventEmitter) - ->onMomentumScrollBegin([self _scrollViewMetrics]); + static_cast(*_eventEmitter).onMomentumScrollBegin([self _scrollViewMetrics]); } - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView @@ -522,7 +521,7 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView return; } - std::static_pointer_cast(_eventEmitter)->onMomentumScrollEnd([self _scrollViewMetrics]); + static_cast(*_eventEmitter).onMomentumScrollEnd([self _scrollViewMetrics]); [self _updateStateWithContentOffset]; _isUserTriggeredScrolling = NO; } @@ -541,7 +540,7 @@ - (void)_handleFinishedScrolling:(UIScrollView *)scrollView return; } - std::static_pointer_cast(_eventEmitter)->onMomentumScrollEnd([self _scrollViewMetrics]); + static_cast(*_eventEmitter).onMomentumScrollEnd([self _scrollViewMetrics]); [self _updateStateWithContentOffset]; } @@ -553,7 +552,7 @@ - (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(nullable return; } - std::static_pointer_cast(_eventEmitter)->onScrollBeginDrag([self _scrollViewMetrics]); + static_cast(*_eventEmitter).onScrollBeginDrag([self _scrollViewMetrics]); } - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale @@ -564,7 +563,7 @@ - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UI return; } - std::static_pointer_cast(_eventEmitter)->onScrollEndDrag([self _scrollViewMetrics]); + static_cast(*_eventEmitter).onScrollEndDrag([self _scrollViewMetrics]); [self _updateStateWithContentOffset]; } @@ -607,7 +606,7 @@ - (void)scrollTo:(double)x y:(double)y animated:(BOOL)animated fmax(_scrollView.contentInset.top, 0), 0.01)); // Make width and height greater than 0 - const auto &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); if (!CGRectContainsPoint(maxRect, offset) && !props.scrollToOverflowEnabled) { CGFloat localX = fmax(offset.x, CGRectGetMinX(maxRect)); localX = fmin(localX, CGRectGetMaxX(maxRect)); @@ -714,7 +713,7 @@ - (void)removeScrollListener:(NSObject *)scrollListener - (void)_prepareForMaintainVisibleScrollPosition { - const auto &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); if (!props.maintainVisibleContentPosition) { return; } @@ -740,7 +739,7 @@ - (void)_prepareForMaintainVisibleScrollPosition - (void)_adjustForMaintainVisibleContentPosition { - const auto &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); if (!props.maintainVisibleContentPosition) { return; } diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm index 844b60c120efb8..bf95785588cbeb 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm @@ -57,8 +57,8 @@ + (ComponentDescriptorProvider)componentDescriptorProvider - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - const auto &oldSwitchProps = *std::static_pointer_cast(_props); - const auto &newSwitchProps = *std::static_pointer_cast(props); + const auto &oldSwitchProps = static_cast(*_props); + const auto &newSwitchProps = static_cast(*props); // `value` if (oldSwitchProps.value != newSwitchProps.value) { @@ -92,13 +92,13 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & - (void)onChange:(UISwitch *)sender { - const auto &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); if (props.value == sender.on) { return; } - std::dynamic_pointer_cast(_eventEmitter) - ->onChange(SwitchEventEmitter::OnChange{.value = static_cast(sender.on)}); + static_cast(*_eventEmitter) + .onChange(SwitchEventEmitter::OnChange{.value = static_cast(sender.on)}); } #pragma mark - Native Commands diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm index ac45711c97bea3..95f3ab569346a1 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm @@ -81,8 +81,8 @@ + (ComponentDescriptorProvider)componentDescriptorProvider - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - auto const &oldParagraphProps = *std::static_pointer_cast(_props); - auto const &newParagraphProps = *std::static_pointer_cast(props); + const auto &oldParagraphProps = static_cast(*_props); + const auto &newParagraphProps = static_cast(*props); _paragraphAttributes = newParagraphProps.paragraphAttributes; @@ -147,7 +147,7 @@ - (BOOL)isAccessibilityElement - (NSArray *)accessibilityElements { - auto const ¶graphProps = *std::static_pointer_cast(_props); + const auto ¶graphProps = static_cast(*_props); // If the component is not `accessible`, we return an empty array. // We do this because logically all nested components represent the content of the component; @@ -241,13 +241,13 @@ - (void)handleLongPress:(UILongPressGestureRecognizer *)gesture - (BOOL)canBecomeFirstResponder { - auto const ¶graphProps = *std::static_pointer_cast(_props); + const auto ¶graphProps = static_cast(*_props); return paragraphProps.isSelectable; } - (BOOL)canPerformAction:(SEL)action withSender:(id)sender { - auto const ¶graphProps = *std::static_pointer_cast(_props); + const auto ¶graphProps = static_cast(*_props); if (paragraphProps.isSelectable && action == @selector(copy:)) { return YES; diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm index 17a38ca7858d07..54f9bbf0e2c700 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm @@ -82,7 +82,7 @@ - (void)didMoveToWindow [super didMoveToWindow]; if (self.window && !_didMoveToWindow) { - auto const &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); if (props.autoFocus) { [_backedTextInputView becomeFirstResponder]; } @@ -107,8 +107,8 @@ + (ComponentDescriptorProvider)componentDescriptorProvider - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - auto const &oldTextInputProps = *std::static_pointer_cast(_props); - auto const &newTextInputProps = *std::static_pointer_cast(props); + const auto &oldTextInputProps = static_cast(*_props); + const auto &newTextInputProps = static_cast(*props); // Traits: if (newTextInputProps.traits.multiline != oldTextInputProps.traits.multiline) { @@ -251,8 +251,7 @@ - (void)updateLayoutMetrics:(LayoutMetrics const &)layoutMetrics RCTUIEdgeInsetsFromEdgeInsets(layoutMetrics.contentInsets - layoutMetrics.borderWidth); if (_eventEmitter) { - auto const &textInputEventEmitter = *std::static_pointer_cast(_eventEmitter); - textInputEventEmitter.onContentSizeChange([self _textInputMetrics]); + static_cast(*_eventEmitter).onContentSizeChange([self _textInputMetrics]); } } @@ -278,7 +277,7 @@ - (BOOL)textInputShouldBeginEditing - (void)textInputDidBeginEditing { - auto const &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); if (props.traits.clearTextOnFocus) { _backedTextInputView.attributedText = nil; @@ -291,7 +290,7 @@ - (void)textInputDidBeginEditing } if (_eventEmitter) { - std::static_pointer_cast(_eventEmitter)->onFocus([self _textInputMetrics]); + static_cast(*_eventEmitter).onFocus([self _textInputMetrics]); } } @@ -303,8 +302,8 @@ - (BOOL)textInputShouldEndEditing - (void)textInputDidEndEditing { if (_eventEmitter) { - std::static_pointer_cast(_eventEmitter)->onEndEditing([self _textInputMetrics]); - std::static_pointer_cast(_eventEmitter)->onBlur([self _textInputMetrics]); + static_cast(*_eventEmitter).onEndEditing([self _textInputMetrics]); + static_cast(*_eventEmitter).onBlur([self _textInputMetrics]); } } @@ -319,7 +318,7 @@ - (BOOL)textInputShouldSubmitOnReturn // (no connection to any specific "submitting" process). if (_eventEmitter && shouldSubmit) { - std::static_pointer_cast(_eventEmitter)->onSubmitEditing([self _textInputMetrics]); + static_cast(*_eventEmitter).onSubmitEditing([self _textInputMetrics]); } return shouldSubmit; } @@ -336,7 +335,7 @@ - (void)textInputDidReturn - (NSString *)textInputShouldChangeText:(NSString *)text inRange:(NSRange)range { - auto const &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); if (!_backedTextInputView.textWasPasted) { if (_eventEmitter) { @@ -344,7 +343,7 @@ - (NSString *)textInputShouldChangeText:(NSString *)text inRange:(NSRange)range keyPressMetrics.text = RCTStringFromNSString(text); keyPressMetrics.eventCount = _mostRecentEventCount; - auto const &textInputEventEmitter = *std::static_pointer_cast(_eventEmitter); + auto const &textInputEventEmitter = static_cast(*_eventEmitter); if (props.onKeyPressSync) { textInputEventEmitter.onKeyPressSync(keyPressMetrics); } else { @@ -394,8 +393,8 @@ - (void)textInputDidChange [self _updateState]; if (_eventEmitter) { - auto const &textInputEventEmitter = *std::static_pointer_cast(_eventEmitter); - auto const &props = *std::static_pointer_cast(_props); + auto const &textInputEventEmitter = static_cast(*_eventEmitter); + const auto &props = static_cast(*_props); if (props.onChangeSync) { textInputEventEmitter.onChangeSync([self _textInputMetrics]); } else { @@ -409,14 +408,14 @@ - (void)textInputDidChangeSelection if (_comingFromJS) { return; } - auto const &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); if (props.traits.multiline && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) { [self textInputDidChange]; _ignoreNextTextInputCall = YES; } if (_eventEmitter) { - std::static_pointer_cast(_eventEmitter)->onSelectionChange([self _textInputMetrics]); + static_cast(*_eventEmitter).onSelectionChange([self _textInputMetrics]); } } @@ -425,7 +424,7 @@ - (void)textInputDidChangeSelection - (void)scrollViewDidScroll:(UIScrollView *)scrollView { if (_eventEmitter) { - std::static_pointer_cast(_eventEmitter)->onScroll([self _textInputMetrics]); + static_cast(*_eventEmitter).onScroll([self _textInputMetrics]); } } @@ -579,7 +578,7 @@ - (void)_updateState - (void)_restoreTextSelection { - auto const selection = std::dynamic_pointer_cast(_props)->selection; + const auto &selection = static_cast(*_props).selection; if (!selection.has_value()) { return; } @@ -659,7 +658,7 @@ - (BOOL)_textOf:(NSAttributedString *)newText equals:(NSAttributedString *)oldTe - (SubmitBehavior)getSubmitBehavior { - auto const &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); const SubmitBehavior submitBehaviorDefaultable = props.traits.submitBehavior; // We should always have a non-default `submitBehavior`, but in case we don't, set it based on multiline. diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm index 6c38b8bda685ce..0a55451e61a929 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm @@ -47,8 +47,8 @@ + (ComponentDescriptorProvider)componentDescriptorProvider - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - const auto &oldViewProps = *std::static_pointer_cast(_props); - const auto &newViewProps = *std::static_pointer_cast(props); + const auto &oldViewProps = static_cast(*_props); + const auto &newViewProps = static_cast(*props); if (oldViewProps.name != newViewProps.name) { _label.text = [NSString stringWithFormat:@"'%s' is not Fabric compatible yet.", newViewProps.name.c_str()]; diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm index 1112c5a9895437..e448178777285d 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm @@ -54,8 +54,8 @@ + (ComponentDescriptorProvider)componentDescriptorProvider - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps { - auto const &oldUnimplementedViewProps = *std::static_pointer_cast(_props); - auto const &newUnimplementedViewProps = *std::static_pointer_cast(props); + const auto &oldUnimplementedViewProps = static_cast(*_props); + const auto &newUnimplementedViewProps = static_cast(*props); if (oldUnimplementedViewProps.getComponentName() != newUnimplementedViewProps.getComponentName()) { _label.text = diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm index 33da37d1f0a65a..b15f9dfb1be0a8 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm @@ -193,8 +193,8 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & NSStringFromClass([self class])); #endif - auto const &oldViewProps = *std::static_pointer_cast(_props); - auto const &newViewProps = *std::static_pointer_cast(props); + const auto &oldViewProps = static_cast(*_props); + const auto &newViewProps = static_cast(*props); BOOL needsInvalidateLayer = NO; @@ -425,7 +425,7 @@ - (void)prepareForRecycle [super prepareForRecycle]; // If view was managed by animated, its props need to align with UIView's properties. - auto const &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); if ([_propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN containsObject:@"transform"]) { self.layer.transform = RCTCATransform3DFromTransformMatrix(props.transform); } @@ -712,7 +712,7 @@ - (NSString *)accessibilityLabel - (NSString *)accessibilityValue { - auto const &props = *std::static_pointer_cast(_props); + const auto &props = static_cast(*_props); // Handle Switch. if ((self.accessibilityTraits & AccessibilityTraitSwitch) == AccessibilityTraitSwitch) { diff --git a/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm b/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm index 0e7cc3f383cf69..2cb3779169f2a2 100644 --- a/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm +++ b/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm @@ -316,7 +316,7 @@ - (void)synchronouslyUpdateViewOnUIThread:(ReactTag)reactTag [componentView updateProps:newProps oldProps:oldProps]; componentView.propKeysManagedByAnimated_DO_NOT_USE_THIS_IS_BROKEN = propKeys; - const auto &newViewProps = *std::static_pointer_cast(newProps); + const auto &newViewProps = static_cast(*newProps); if (props[@"transform"] && !CATransform3DEqualToTransform( diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp index b82a561a074c05..49cca5270a59fa 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp @@ -88,9 +88,9 @@ CoreComponentsRegistry::initHybrid( auto registry = CoreComponentsRegistry::sharedProviderRegistry() ->createComponentDescriptorRegistry( {eventDispatcher, contextContainer}); - auto mutableRegistry = - std::const_pointer_cast(registry); - mutableRegistry->setFallbackComponentDescriptor( + auto &mutableRegistry = + const_cast(*registry); + mutableRegistry.setFallbackComponentDescriptor( std::make_shared( ComponentDescriptorParameters{ eventDispatcher, contextContainer, nullptr})); diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp index e39091a6a57635..8e8c94747f0cfd 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp @@ -201,19 +201,14 @@ static inline void writeIntBufferTypePreamble( // TODO: this method will be removed when binding for components are code-gen jni::local_ref getPlatformComponentName(ShadowView const &shadowView) { static std::string scrollViewComponentName = std::string("ScrollView"); - - jni::local_ref componentName; if (scrollViewComponentName == shadowView.componentName) { - auto newViewProps = - std::static_pointer_cast(shadowView.props); - if (newViewProps->getProbablyMoreHorizontalThanVertical_DEPRECATED()) { - componentName = jni::make_jstring("AndroidHorizontalScrollView"); - return componentName; + const auto &newViewProps = + static_cast(*shadowView.props); + if (newViewProps.getProbablyMoreHorizontalThanVertical_DEPRECATED()) { + return jni::make_jstring("AndroidHorizontalScrollView"); } } - - componentName = jni::make_jstring(shadowView.componentName); - return componentName; + return jni::make_jstring(shadowView.componentName); } static inline float scale(Float value, Float pointScaleFactor) { diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp index 8273e31777adc7..a291c22f915282 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp @@ -44,10 +44,9 @@ DefaultComponentsRegistry::initHybrid( ->createComponentDescriptorRegistry( {eventDispatcher, contextContainer}); - auto mutableRegistry = - std::const_pointer_cast(registry); - - mutableRegistry->setFallbackComponentDescriptor( + auto &mutableRegistry = + const_cast(*registry); + mutableRegistry.setFallbackComponentDescriptor( std::make_shared( ComponentDescriptorParameters{ eventDispatcher, contextContainer, nullptr})); diff --git a/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp b/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp index 34aed3a676046f..71df612c864c89 100644 --- a/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp @@ -467,8 +467,7 @@ LayoutAnimationKeyFrameManager::pullTransaction( if (baselineShadowView.traits.check( ShadowNodeTraits::Trait::ViewKind)) { - auto const &viewProps = - *std::static_pointer_cast(props); + const auto &viewProps = static_cast(*props); const_cast(viewProps).opacity = 0; } @@ -489,8 +488,7 @@ LayoutAnimationKeyFrameManager::pullTransaction( .cloneProps(propsParserContext, viewStart.props, {}); if (baselineShadowView.traits.check( ShadowNodeTraits::Trait::ViewKind)) { - auto const &viewProps = - *std::static_pointer_cast(props); + const auto &viewProps = static_cast(*props); const_cast(viewProps).transform = Transform::Scale(isScaleX ? 0 : 1, isScaleY ? 0 : 1, 1); } @@ -590,8 +588,8 @@ LayoutAnimationKeyFrameManager::pullTransaction( if (baselineShadowView.traits.check( ShadowNodeTraits::Trait::ViewKind)) { - auto const &viewProps = - *std::static_pointer_cast(props); + const auto &viewProps = + static_cast(*props); const_cast(viewProps).opacity = 0; } @@ -615,8 +613,8 @@ LayoutAnimationKeyFrameManager::pullTransaction( if (baselineShadowView.traits.check( ShadowNodeTraits::Trait::ViewKind)) { - auto const &viewProps = - *std::static_pointer_cast(props); + const auto &viewProps = + static_cast(*props); const_cast(viewProps).transform = Transform::Scale(isScaleX ? 0 : 1, isScaleY ? 0 : 1, 1); } diff --git a/packages/react-native/ReactCommon/react/renderer/components/image/ImageComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/image/ImageComponentDescriptor.h index ae8040185efa46..2feb6c9719b7ef 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/image/ImageComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/components/image/ImageComponentDescriptor.h @@ -27,12 +27,11 @@ class ImageComponentDescriptor final void adopt(ShadowNode::Unshared const &shadowNode) const override { ConcreteComponentDescriptor::adopt(shadowNode); - auto imageShadowNode = - std::static_pointer_cast(shadowNode); + auto &imageShadowNode = static_cast(*shadowNode); // `ImageShadowNode` uses `ImageManager` to initiate image loading and // communicate the loading state and results to mounting layer. - imageShadowNode->setImageManager(imageManager_); + imageShadowNode.setImageManager(imageManager_); } private: diff --git a/packages/react-native/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryComponentDescriptor.h index 5f2117fbc90dfd..695fe7bcbd5eb9 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/components/inputaccessory/InputAccessoryComponentDescriptor.h @@ -22,20 +22,17 @@ class InputAccessoryComponentDescriptor final using ConcreteComponentDescriptor::ConcreteComponentDescriptor; void adopt(ShadowNode::Unshared const &shadowNode) const override { - auto concreteShadowNode = - std::static_pointer_cast(shadowNode); + auto &layoutableShadowNode = + static_cast(*shadowNode); - auto layoutableShadowNode = - std::static_pointer_cast(concreteShadowNode); + auto &stateData = + static_cast( + *shadowNode->getState()) + .getData(); - auto state = - std::static_pointer_cast( - shadowNode->getState()); - auto stateData = state->getData(); - - layoutableShadowNode->setSize( + layoutableShadowNode.setSize( Size{stateData.viewportSize.width, stateData.viewportSize.height}); - layoutableShadowNode->setPositionType(YGPositionTypeAbsolute); + layoutableShadowNode.setPositionType(YGPositionTypeAbsolute); ConcreteComponentDescriptor::adopt(shadowNode); } diff --git a/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm b/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm index 67846a6634291a..4df8893ba2ff62 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +++ b/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm @@ -57,7 +57,7 @@ ContextContainer::Shared const &contextContainer, ComponentDescriptor::Flavor const &flavor) { - auto componentName = *std::static_pointer_cast(flavor); + auto &componentName = *static_cast(flavor.get()); auto moduleName = moduleNameFromComponentName(componentName); Class module = NSClassFromString(RCTNSStringFromString(moduleName)); assert(module); @@ -101,7 +101,7 @@ ComponentName LegacyViewManagerInteropComponentDescriptor::getComponentName() const { - return std::static_pointer_cast(this->flavor_)->c_str(); + return static_cast(flavor_.get())->c_str(); } void LegacyViewManagerInteropComponentDescriptor::adopt(ShadowNode::Unshared const &shadowNode) const @@ -109,11 +109,11 @@ ConcreteComponentDescriptor::adopt(shadowNode); assert(std::dynamic_pointer_cast(shadowNode)); - auto legacyViewManagerInteropShadowNode = std::static_pointer_cast(shadowNode); + auto &legacyViewManagerInteropShadowNode = static_cast(*shadowNode); auto state = LegacyViewManagerInteropState{}; state.coordinator = _coordinator; - legacyViewManagerInteropShadowNode->setStateData(std::move(state)); + legacyViewManagerInteropShadowNode.setStateData(std::move(state)); } } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/components/modal/ModalHostViewComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/modal/ModalHostViewComponentDescriptor.h index dbb7c40a9648ea..49300366e520c3 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/modal/ModalHostViewComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/components/modal/ModalHostViewComponentDescriptor.h @@ -23,20 +23,16 @@ class ModalHostViewComponentDescriptor final using ConcreteComponentDescriptor::ConcreteComponentDescriptor; void adopt(ShadowNode::Unshared const &shadowNode) const override { - auto modalShadowNode = - std::static_pointer_cast(shadowNode); - - auto layoutableShadowNode = - std::static_pointer_cast(modalShadowNode); - - auto state = - std::static_pointer_cast( - shadowNode->getState()); - auto stateData = state->getData(); - - layoutableShadowNode->setSize( + auto &layoutableShadowNode = + static_cast(*shadowNode); + auto &stateData = + static_cast( + *shadowNode->getState()) + .getData(); + + layoutableShadowNode.setSize( Size{stateData.screenSize.width, stateData.screenSize.height}); - layoutableShadowNode->setPositionType(YGPositionTypeAbsolute); + layoutableShadowNode.setPositionType(YGPositionTypeAbsolute); ConcreteComponentDescriptor::adopt(shadowNode); } diff --git a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarComponentDescriptor.h index 6dc1ce41a1a59e..1f3fc051432dd9 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarComponentDescriptor.h @@ -29,17 +29,17 @@ class AndroidProgressBarComponentDescriptor final void adopt(ShadowNode::Unshared const &shadowNode) const override { ConcreteComponentDescriptor::adopt(shadowNode); - auto androidProgressBarShadowNode = - std::static_pointer_cast(shadowNode); + auto &androidProgressBarShadowNode = + static_cast(*shadowNode); // `AndroidProgressBarShadowNode` uses // `AndroidProgressBarMeasurementsManager` to provide measurements to Yoga. - androidProgressBarShadowNode->setAndroidProgressBarMeasurementsManager( + androidProgressBarShadowNode.setAndroidProgressBarMeasurementsManager( measurementsManager_); // All `AndroidProgressBarShadowNode`s must have leaf Yoga nodes with // properly setup measure function. - androidProgressBarShadowNode->enableMeasurement(); + androidProgressBarShadowNode.enableMeasurement(); } private: diff --git a/packages/react-native/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewComponentDescriptor.h index 09134eb9abde1f..b0b916b853bea7 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/components/safeareaview/SafeAreaViewComponentDescriptor.h @@ -22,21 +22,13 @@ class SafeAreaViewComponentDescriptor final void adopt(ShadowNode::Unshared const &shadowNode) const override { react_native_assert( std::dynamic_pointer_cast(shadowNode)); - auto safeAreaViewShadowNode = - std::static_pointer_cast(shadowNode); - - react_native_assert(std::dynamic_pointer_cast( - safeAreaViewShadowNode)); - auto layoutableShadowNode = - std::static_pointer_cast( - safeAreaViewShadowNode); - - auto state = - std::static_pointer_cast( - shadowNode->getState()); - auto stateData = state->getData(); - - layoutableShadowNode->setPadding(stateData.padding); + auto &layoutableShadowNode = + static_cast(*shadowNode); + auto &stateData = + static_cast( + *shadowNode->getState()) + .getData(); + layoutableShadowNode.setPadding(stateData.padding); ConcreteComponentDescriptor::adopt(shadowNode); } diff --git a/packages/react-native/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchComponentDescriptor.h index 5ce046bebe53ea..a2694a68dc9ad8 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/components/switch/androidswitch/react/renderer/components/androidswitch/AndroidSwitchComponentDescriptor.h @@ -29,17 +29,17 @@ class AndroidSwitchComponentDescriptor final void adopt(ShadowNode::Unshared const &shadowNode) const override { ConcreteComponentDescriptor::adopt(shadowNode); - auto androidSwitchShadowNode = - std::static_pointer_cast(shadowNode); + auto &androidSwitchShadowNode = + static_cast(*shadowNode); // `AndroidSwitchShadowNode` uses `AndroidSwitchMeasurementsManager` to // provide measurements to Yoga. - androidSwitchShadowNode->setAndroidSwitchMeasurementsManager( + androidSwitchShadowNode.setAndroidSwitchMeasurementsManager( measurementsManager_); // All `AndroidSwitchShadowNode`s must have leaf Yoga nodes with properly // setup measure function. - androidSwitchShadowNode->enableMeasurement(); + androidSwitchShadowNode.enableMeasurement(); } private: diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h index 3d76dc9306cc1f..85576b0f56c9d1 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphComponentDescriptor.h @@ -31,12 +31,11 @@ class ParagraphComponentDescriptor final void adopt(ShadowNode::Unshared const &shadowNode) const override { ConcreteComponentDescriptor::adopt(shadowNode); - auto paragraphShadowNode = - std::static_pointer_cast(shadowNode); + auto ¶graphShadowNode = static_cast(*shadowNode); // `ParagraphShadowNode` uses `TextLayoutManager` to measure text content // and communicate text rendering metrics to mounting layer. - paragraphShadowNode->setTextLayoutManager(textLayoutManager_); + paragraphShadowNode.setTextLayoutManager(textLayoutManager_); } private: diff --git a/packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputComponentDescriptor.h index 33f183d58e3738..7ea08be94c9589 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputComponentDescriptor.h @@ -84,52 +84,49 @@ class AndroidTextInputComponentDescriptor final protected: void adopt(ShadowNode::Unshared const &shadowNode) const override { - auto textInputShadowNode = - std::static_pointer_cast(shadowNode); + auto &textInputShadowNode = + static_cast(*shadowNode); // `ParagraphShadowNode` uses `TextLayoutManager` to measure text content // and communicate text rendering metrics to mounting layer. - textInputShadowNode->setTextLayoutManager(textLayoutManager_); + textInputShadowNode.setTextLayoutManager(textLayoutManager_); - textInputShadowNode->setContextContainer( + textInputShadowNode.setContextContainer( const_cast(getContextContainer().get())); - int surfaceId = textInputShadowNode->getSurfaceId(); + int surfaceId = textInputShadowNode.getSurfaceId(); if (surfaceIdToThemePaddingMap_.find(surfaceId) != surfaceIdToThemePaddingMap_.end()) { YGStyle::Edges theme = surfaceIdToThemePaddingMap_[surfaceId]; + auto &textInputProps = textInputShadowNode.getConcreteProps(); + // Override padding // Node is still unsealed during adoption, before layout is complete // TODO: T62959168 account for RTL and paddingLeft when setting default // paddingStart, and vice-versa with paddingRight/paddingEnd. // For now this assumes no RTL. - YGStyle::Edges result = - textInputShadowNode->getConcreteProps().yogaStyle.padding(); + YGStyle::Edges result = textInputProps.yogaStyle.padding(); bool changedPadding = false; - if (!textInputShadowNode->getConcreteProps().hasPadding && - !textInputShadowNode->getConcreteProps().hasPaddingStart && - !textInputShadowNode->getConcreteProps().hasPaddingLeft && - !textInputShadowNode->getConcreteProps().hasPaddingHorizontal) { + if (!textInputProps.hasPadding && !textInputProps.hasPaddingStart && + !textInputProps.hasPaddingLeft && + !textInputProps.hasPaddingHorizontal) { changedPadding = true; result[YGEdgeStart] = theme[YGEdgeStart]; } - if (!textInputShadowNode->getConcreteProps().hasPadding && - !textInputShadowNode->getConcreteProps().hasPaddingEnd && - !textInputShadowNode->getConcreteProps().hasPaddingRight && - !textInputShadowNode->getConcreteProps().hasPaddingHorizontal) { + if (!textInputProps.hasPadding && !textInputProps.hasPaddingEnd && + !textInputProps.hasPaddingRight && + !textInputProps.hasPaddingHorizontal) { changedPadding = true; result[YGEdgeEnd] = theme[YGEdgeEnd]; } - if (!textInputShadowNode->getConcreteProps().hasPadding && - !textInputShadowNode->getConcreteProps().hasPaddingTop && - !textInputShadowNode->getConcreteProps().hasPaddingVertical) { + if (!textInputProps.hasPadding && !textInputProps.hasPaddingTop && + !textInputProps.hasPaddingVertical) { changedPadding = true; result[YGEdgeTop] = theme[YGEdgeTop]; } - if (!textInputShadowNode->getConcreteProps().hasPadding && - !textInputShadowNode->getConcreteProps().hasPaddingBottom && - !textInputShadowNode->getConcreteProps().hasPaddingVertical) { + if (!textInputProps.hasPadding && !textInputProps.hasPaddingBottom && + !textInputProps.hasPaddingVertical) { changedPadding = true; result[YGEdgeBottom] = theme[YGEdgeBottom]; } @@ -139,16 +136,14 @@ class AndroidTextInputComponentDescriptor final // paddingLeft update, we must explicitly unset paddingStart... (same with // paddingEnd) // TODO: support RTL - if ((textInputShadowNode->getConcreteProps().hasPadding || - textInputShadowNode->getConcreteProps().hasPaddingLeft || - textInputShadowNode->getConcreteProps().hasPaddingHorizontal) && - !textInputShadowNode->getConcreteProps().hasPaddingStart) { + if ((textInputProps.hasPadding || textInputProps.hasPaddingLeft || + textInputProps.hasPaddingHorizontal) && + !textInputProps.hasPaddingStart) { result[YGEdgeStart] = YGValueUndefined; } - if ((textInputShadowNode->getConcreteProps().hasPadding || - textInputShadowNode->getConcreteProps().hasPaddingRight || - textInputShadowNode->getConcreteProps().hasPaddingHorizontal) && - !textInputShadowNode->getConcreteProps().hasPaddingEnd) { + if ((textInputProps.hasPadding || textInputProps.hasPaddingRight || + textInputProps.hasPaddingHorizontal) && + !textInputProps.hasPaddingEnd) { result[YGEdgeEnd] = YGValueUndefined; } @@ -157,16 +152,15 @@ class AndroidTextInputComponentDescriptor final // commit, state update, etc, will incur this cost. if (changedPadding) { // Set new props on node - const_cast( - textInputShadowNode->getConcreteProps()) + const_cast(textInputProps) .yogaStyle.padding() = result; // Communicate new props to Yoga part of the node - textInputShadowNode->updateYogaProps(); + textInputShadowNode.updateYogaProps(); } } - textInputShadowNode->dirtyLayout(); - textInputShadowNode->enableMeasurement(); + textInputShadowNode.dirtyLayout(); + textInputShadowNode.enableMeasurement(); ConcreteComponentDescriptor::adopt(shadowNode); } diff --git a/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputComponentDescriptor.h index c1a900be843e5f..224c7703fe7ebf 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputComponentDescriptor.h @@ -28,10 +28,8 @@ class TextInputComponentDescriptor final void adopt(ShadowNode::Unshared const &shadowNode) const override { ConcreteComponentDescriptor::adopt(shadowNode); - auto concreteShadowNode = - std::static_pointer_cast(shadowNode); - - concreteShadowNode->setTextLayoutManager(textLayoutManager_); + auto &concreteShadowNode = static_cast(*shadowNode); + concreteShadowNode.setTextLayoutManager(textLayoutManager_); } private: diff --git a/packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp b/packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp index 5fd1a4ba9cb4bf..b0420504ef4262 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp @@ -15,7 +15,7 @@ ComponentHandle UnimplementedViewComponentDescriptor::getComponentHandle() } ComponentName UnimplementedViewComponentDescriptor::getComponentName() const { - return std::static_pointer_cast(this->flavor_)->c_str(); + return static_cast(flavor_.get())->c_str(); } Props::Shared UnimplementedViewComponentDescriptor::cloneProps( @@ -32,7 +32,7 @@ Props::Shared UnimplementedViewComponentDescriptor::cloneProps( emptyRawProps.parse(rawPropsParser_, context); auto unimplementedViewProps = std::make_shared( context, - *std::static_pointer_cast(clonedProps), + static_cast(*clonedProps), emptyRawProps); unimplementedViewProps->setComponentName(getComponentName()); diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp index d9ebf62e9b5330..5d42331e70d4cb 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp @@ -260,7 +260,7 @@ void AccessibilityProps::setProp( #if RN_DEBUG_STRING_CONVERTIBLE SharedDebugStringConvertibleList AccessibilityProps::getDebugProps() const { - auto const &defaultProps = AccessibilityProps(); + const auto &defaultProps = AccessibilityProps(); return SharedDebugStringConvertibleList{ debugStringConvertibleItem("testId", testId, defaultProps.testId), }; diff --git a/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h index 3315e745ab82d1..93fe429330c1e6 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h @@ -87,11 +87,10 @@ class ConcreteComponentDescriptor : public ComponentDescriptor { void appendChild( const ShadowNode::Shared &parentShadowNode, const ShadowNode::Shared &childShadowNode) const override { - auto concreteParentShadowNode = - std::static_pointer_cast(parentShadowNode); - auto concreteNonConstParentShadowNode = - std::const_pointer_cast(concreteParentShadowNode); - concreteNonConstParentShadowNode->appendChild(childShadowNode); + auto &concreteParentShadowNode = + static_cast(*parentShadowNode); + const_cast(concreteParentShadowNode) + .appendChild(childShadowNode); } virtual Props::Shared cloneProps( diff --git a/packages/react-native/ReactCommon/react/renderer/core/ConcreteState.h b/packages/react-native/ReactCommon/react/renderer/core/ConcreteState.h index 640342d1965ff5..61fb3299cf78e8 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ConcreteState.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ConcreteState.h @@ -49,7 +49,7 @@ class ConcreteState : public State { * Returns stored data. */ Data const &getData() const { - return *std::static_pointer_cast(data_); + return *static_cast(data_.get()); } /* @@ -90,7 +90,7 @@ class ConcreteState : public State { auto stateUpdate = StateUpdate{ family, [=](StateData::Shared const &oldData) -> StateData::Shared { react_native_assert(oldData); - return callback(*std::static_pointer_cast(oldData)); + return callback(*static_cast(oldData.get())); }}; family->dispatchRawState(std::move(stateUpdate), priority); diff --git a/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp index ba8da5d6f1eda8..f8782c879f0c0a 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp @@ -227,9 +227,8 @@ void ShadowNode::appendChild(const ShadowNode::Shared &child) { ensureUnsealed(); cloneChildrenIfShared(); - auto nonConstChildren = - std::const_pointer_cast(children_); - nonConstChildren->push_back(child); + auto &children = const_cast(*children_); + children.push_back(child); child->family_->setParent(family_); } @@ -241,11 +240,9 @@ void ShadowNode::replaceChild( ensureUnsealed(); cloneChildrenIfShared(); - newChild->family_->setParent(family_); - auto &children = - *std::const_pointer_cast(children_); + auto &children = const_cast(*children_); auto size = children.size(); if (suggestedIndex != -1 && suggestedIndex < size) { diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp index f504c986b5c418..1ded30dcfdacb4 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp @@ -446,7 +446,7 @@ void ShadowTree::emitLayoutEvents( // Checking if the `onLayout` event was requested for the particular Shadow // Node. - auto const &viewProps = + const auto &viewProps = static_cast(*viewShadowNode.getProps()); if (!viewProps.onLayout) { continue; diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp index 2e4db8f6e19b27..9d8daa8fd4df87 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp @@ -332,7 +332,7 @@ jsi::Value UIManagerBinding::get( size_t count) -> jsi::Value { validateArgumentCount(runtime, methodName, paramCount, count); - auto const &rawProps = RawProps(runtime, arguments[1]); + const auto &rawProps = RawProps(runtime, arguments[1]); return valueFromShadowNode( runtime, uiManager->cloneNode( @@ -356,7 +356,7 @@ jsi::Value UIManagerBinding::get( size_t count) -> jsi::Value { validateArgumentCount(runtime, methodName, paramCount, count); - auto const &rawProps = RawProps(runtime, arguments[1]); + const auto &rawProps = RawProps(runtime, arguments[1]); return valueFromShadowNode( runtime, uiManager->cloneNode( diff --git a/packages/react-native/ReactCommon/react/utils/ContextContainer.h b/packages/react-native/ReactCommon/react/utils/ContextContainer.h index f71fb759493683..d9b602240deab4 100644 --- a/packages/react-native/ReactCommon/react/utils/ContextContainer.h +++ b/packages/react-native/ReactCommon/react/utils/ContextContainer.h @@ -82,7 +82,7 @@ class ContextContainer final { react_native_assert( instances_.find(key) != instances_.end() && "ContextContainer doesn't have an instance for given key."); - return *std::static_pointer_cast(instances_.at(key)); + return *static_cast(instances_.at(key).get()); } /* @@ -99,7 +99,7 @@ class ContextContainer final { return {}; } - return *std::static_pointer_cast(iterator->second); + return *static_cast(iterator->second.get()); } private: From f38fc9ba8681622f7cfdb586753e50c596946929 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Fri, 16 Jun 2023 08:06:08 -0700 Subject: [PATCH 213/468] Unblock test_android by using a non-internal method of OkHTTP Summary: test_android is currently broken due to us using `toHttpUrl` which is `Deprecated` with .ERROR severity level in OkHTTP 4. This fixes it by using the HttpUrl.Builder class which is always accessible in OkHTTP. Changelog: [Internal] [Changed] - Unblock test_android by using a non-internal method of OkHTTP Reviewed By: sammy-SC Differential Revision: D46799515 fbshipit-source-id: 874194f0d9be6ba48b49a86b1a17836a8310cc8d --- .../react/modules/network/ReactCookieJarContainerTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/ReactCookieJarContainerTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/ReactCookieJarContainerTest.kt index 5999e4c68d94d7..15e9537ea59200 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/ReactCookieJarContainerTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/ReactCookieJarContainerTest.kt @@ -25,7 +25,7 @@ import org.robolectric.RobolectricTestRunner @PrepareForTest(ReactCookieJarContainer::class) @PowerMockIgnore("org.mockito.*", "org.robolectric.*", "androidx.*", "android.*") class ReactCookieJarContainerTest { - private val httpUrl: HttpUrl = HttpUrl.parse("http://example.com") + private val httpUrl: HttpUrl = HttpUrl.Builder().host("example.com").scheme("http").build() @Test fun testMissingJar() { From 84fc79f453f01ce1d1294914ab810492344aa524 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Fri, 16 Jun 2023 08:40:11 -0700 Subject: [PATCH 214/468] Bump Gradle to 8.1.1 Summary: Just keeping our Gradle version up to date. Changelog: [Internal] [Changed] - Bump Gradle to 8.1.1 Reviewed By: yungsters Differential Revision: D46769069 fbshipit-source-id: b79ae35473f40e821cf6a1b8e094e33d1b1a44d7 --- gradle/wrapper/gradle-wrapper.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../template/android/gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a21c6ebe28b660..8707e8b5067f9d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/react-native-gradle-plugin/gradle/wrapper/gradle-wrapper.properties b/packages/react-native-gradle-plugin/gradle/wrapper/gradle-wrapper.properties index a21c6ebe28b660..8707e8b5067f9d 100644 --- a/packages/react-native-gradle-plugin/gradle/wrapper/gradle-wrapper.properties +++ b/packages/react-native-gradle-plugin/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/react-native/template/android/gradle/wrapper/gradle-wrapper.properties b/packages/react-native/template/android/gradle/wrapper/gradle-wrapper.properties index a21c6ebe28b660..8707e8b5067f9d 100644 --- a/packages/react-native/template/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/react-native/template/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 71936fcf43a97556e60d62187aaeb20c65b463e1 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 16 Jun 2023 10:25:49 -0700 Subject: [PATCH 215/468] Fix hermes-engine in Nightlies Summary: With commit [332be0f](https://github.com/facebook/react-native/commit/332be0f0c84c48e0b0edd373636b0b5538fa3b2b) nightlies were broken due to a wrong update with the method we need to use to download hermes. This change fixes that issue ## Changelog: [Internal] - Fix hermes-engine download in Nightlies Reviewed By: cortinico Differential Revision: D46800717 fbshipit-source-id: 62ce94b980110f46337ce2520fa3c9fbcfe856cc --- packages/react-native/sdks/hermes-engine/hermes-utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/sdks/hermes-engine/hermes-utils.rb b/packages/react-native/sdks/hermes-engine/hermes-utils.rb index 1d3f501d9d3910..bec2c4b9897d8a 100644 --- a/packages/react-native/sdks/hermes-engine/hermes-utils.rb +++ b/packages/react-native/sdks/hermes-engine/hermes-utils.rb @@ -131,7 +131,7 @@ def download_hermes_tarball(react_native_path, tarball_url, version, configurati # Returns: the path to the downloaded Hermes tarball def download_nightly_hermes(react_native_path, version) tarball_url = nightly_tarball_url(version) - return download_stable_hermes(react_native_path, tarball_url, version, nil) + return download_hermes_tarball(react_native_path, tarball_url, version, nil) end def nightly_tarball_url(version) From 5f8bbf2bd27ccff2c83be8d9dedc7005854fecaa Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Fri, 16 Jun 2023 10:40:39 -0700 Subject: [PATCH 216/468] Mitigate flickering on color animations (#37925) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37925 Vectorized animations (XY, Color) are split into multiple animations for each component that execute in parallel. Upon each of these animations completing, a rerender is triggered to sync the state back to the JS AnimatedValue nodes. The problem with this is that calling update() on AnimatedProps when each animation completes results in potential flickering as all animations that are part of the vectorized animation may not have completed yet. For example, only the animation for the red channel of an animating color may have been completed, resulting in a temporary red color being rendered. So, for now, ignore AnimatedProps that use a vectorized animation. Follow up will properly address vectorized animations - only call the update() when all animations complete. Changelog: [General][Fixed] - Mitigate flickering on color animations Reviewed By: rshest Differential Revision: D46778405 fbshipit-source-id: 5ecb0be95a131b22e5081024d4e094b22b57aac4 --- .../Libraries/Animated/animations/Animation.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/react-native/Libraries/Animated/animations/Animation.js b/packages/react-native/Libraries/Animated/animations/Animation.js index ad956cd79d9d6d..29dda1c4e8eb04 100644 --- a/packages/react-native/Libraries/Animated/animations/Animation.js +++ b/packages/react-native/Libraries/Animated/animations/Animation.js @@ -15,7 +15,9 @@ import type AnimatedNode from '../nodes/AnimatedNode'; import type AnimatedValue from '../nodes/AnimatedValue'; import NativeAnimatedHelper from '../NativeAnimatedHelper'; +import AnimatedColor from '../nodes/AnimatedColor'; import AnimatedProps from '../nodes/AnimatedProps'; +import AnimatedValueXY from '../nodes/AnimatedValueXY'; export type EndResult = {finished: boolean, value?: number, ...}; export type EndCallback = (result: EndResult) => void; @@ -75,6 +77,17 @@ export default class Animation { return result; } + // Vectorized animations (animations on AnimatedValueXY, AnimatedColor nodes) + // are split into multiple animations for each component that execute in parallel. + // Calling update() on AnimatedProps when each animation completes results in + // potential flickering as all animations that are part of the vectorized animation + // may not have completed yet. For example, only the animation for the red channel of + // an animating color may have been completed, resulting in a temporary red color + // being rendered. So, for now, ignore AnimatedProps that use a vectorized animation. + if (node instanceof AnimatedValueXY || node instanceof AnimatedColor) { + return result; + } + for (const child of node.__getChildren()) { result.push(...this.__findAnimatedPropsNodes(child)); } From 19699ab3b529af747223b7e470ad1e84be264b86 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 16 Jun 2023 13:21:49 -0700 Subject: [PATCH 217/468] Native ARIA Roles: Remove JS Shim (#37304) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37304 ### Stack ARIA roles in React Native are implemented on top of accessibilityRole. This is lossy because there are many more ARIA roles than accessibilityRole. This is especially true for RN on desktop where accessibilityRole was designed around accessibility APIs only available on mobile. This series of changes aims to change this implementation to instead pass the ARIA role to native, alongside any existing accessibilityRole. This gives the platform more control in exactly how to map an ARIA role to native behavior. As an example, this would allow mapping any ARIA role to AutomationControlType on Windows without needing to fork to add new options to accessibilityRole. It also allows greater implementation flexibility for other platforms down the line, but for now, iOS and Android behave the same as before (though with their implementation living in native). ### Diff This removes the JS shimming of `role` to `accessibilityRole`. It can be landed when the native `role` implementation for both iOS and Android are live for versions we service out of band. This will require any out of tree platforms to add their own native implementation for `role` to continue to work. Changelog: [Internal] Reviewed By: philIip Differential Revision: D45432518 fbshipit-source-id: 02ac28049a029381af019c042fc7f37833f4157c --- .../Libraries/Components/View/View.js | 6 - .../Components/View/__tests__/View-test.js | 1 + packages/react-native/Libraries/Text/Text.js | 9 - .../Libraries/Text/__tests__/Text-test.js | 1 + .../Utilities/AcessibilityMapping.js | 154 ------------------ 5 files changed, 2 insertions(+), 169 deletions(-) delete mode 100644 packages/react-native/Libraries/Utilities/AcessibilityMapping.js diff --git a/packages/react-native/Libraries/Components/View/View.js b/packages/react-native/Libraries/Components/View/View.js index a10c06231fbfa7..d9814254743da9 100644 --- a/packages/react-native/Libraries/Components/View/View.js +++ b/packages/react-native/Libraries/Components/View/View.js @@ -12,7 +12,6 @@ import type {ViewProps} from './ViewPropTypes'; import flattenStyle from '../../StyleSheet/flattenStyle'; import TextAncestor from '../../Text/TextAncestor'; -import {getAccessibilityRoleFromRole} from '../../Utilities/AcessibilityMapping'; import ViewNativeComponent from './ViewNativeComponent'; import * as React from 'react'; @@ -35,7 +34,6 @@ const View: React.AbstractComponent< accessibilityLabel, accessibilityLabelledBy, accessibilityLiveRegion, - accessibilityRole, accessibilityState, accessibilityValue, 'aria-busy': ariaBusy, @@ -56,7 +54,6 @@ const View: React.AbstractComponent< importantForAccessibility, nativeID, pointerEvents, - role, tabIndex, ...otherProps }: ViewProps, @@ -113,9 +110,6 @@ const View: React.AbstractComponent< accessibilityLabel={ariaLabel ?? accessibilityLabel} focusable={tabIndex !== undefined ? !tabIndex : focusable} accessibilityState={_accessibilityState} - accessibilityRole={ - role ? getAccessibilityRoleFromRole(role) : accessibilityRole - } accessibilityElementsHidden={ariaHidden ?? accessibilityElementsHidden} accessibilityLabelledBy={_accessibilityLabelledBy} accessibilityValue={_accessibilityValue} diff --git a/packages/react-native/Libraries/Components/View/__tests__/View-test.js b/packages/react-native/Libraries/Components/View/__tests__/View-test.js index 66fac79f4ab4e2..18649af87ee377 100644 --- a/packages/react-native/Libraries/Components/View/__tests__/View-test.js +++ b/packages/react-native/Libraries/Components/View/__tests__/View-test.js @@ -160,6 +160,7 @@ describe('View compat with web', () => { aria-setsize={5} aria-sort="ascending" importantForAccessibility="no-hide-descendants" + role="main" /> `); }); diff --git a/packages/react-native/Libraries/Text/Text.js b/packages/react-native/Libraries/Text/Text.js index df548af47dab81..d473178deb5490 100644 --- a/packages/react-native/Libraries/Text/Text.js +++ b/packages/react-native/Libraries/Text/Text.js @@ -15,7 +15,6 @@ import * as PressabilityDebug from '../Pressability/PressabilityDebug'; import usePressability from '../Pressability/usePressability'; import flattenStyle from '../StyleSheet/flattenStyle'; import processColor from '../StyleSheet/processColor'; -import {getAccessibilityRoleFromRole} from '../Utilities/AcessibilityMapping'; import Platform from '../Utilities/Platform'; import TextAncestor from './TextAncestor'; import {NativeText, NativeVirtualText} from './TextNativeComponent'; @@ -34,7 +33,6 @@ const Text: React.AbstractComponent< const { accessible, accessibilityLabel, - accessibilityRole, accessibilityState, allowFontScaling, 'aria-busy': ariaBusy, @@ -57,7 +55,6 @@ const Text: React.AbstractComponent< onResponderTerminationRequest, onStartShouldSetResponder, pressRetentionOffset, - role, suppressHighlighting, ...restProps } = props; @@ -234,9 +231,6 @@ const Text: React.AbstractComponent< {...restProps} {...eventHandlersForText} accessibilityLabel={ariaLabel ?? accessibilityLabel} - accessibilityRole={ - role ? getAccessibilityRoleFromRole(role) : accessibilityRole - } accessibilityState={_accessibilityState} isHighlighted={isHighlighted} isPressable={isPressable} @@ -253,9 +247,6 @@ const Text: React.AbstractComponent< {...restProps} {...eventHandlersForText} accessibilityLabel={ariaLabel ?? accessibilityLabel} - accessibilityRole={ - role ? getAccessibilityRoleFromRole(role) : accessibilityRole - } accessibilityState={nativeTextAccessibilityState} accessible={ accessible == null && Platform.OS === 'android' diff --git a/packages/react-native/Libraries/Text/__tests__/Text-test.js b/packages/react-native/Libraries/Text/__tests__/Text-test.js index af02de98211cbe..ffd7e8d688789f 100644 --- a/packages/react-native/Libraries/Text/__tests__/Text-test.js +++ b/packages/react-native/Libraries/Text/__tests__/Text-test.js @@ -169,6 +169,7 @@ describe('Text compat with web', () => { disabled={true} ellipsizeMode="tail" isHighlighted={false} + role="main" selectionColor={null} /> `); diff --git a/packages/react-native/Libraries/Utilities/AcessibilityMapping.js b/packages/react-native/Libraries/Utilities/AcessibilityMapping.js deleted file mode 100644 index 911f3381089fe9..00000000000000 --- a/packages/react-native/Libraries/Utilities/AcessibilityMapping.js +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict-local - * @format - */ - -'use strict'; - -import type { - AccessibilityRole, - Role, -} from '../Components/View/ViewAccessibility'; - -// Map role values to AccessibilityRole values -export function getAccessibilityRoleFromRole(role: Role): ?AccessibilityRole { - switch (role) { - case 'alert': - return 'alert'; - case 'alertdialog': - return undefined; - case 'application': - return undefined; - case 'article': - return undefined; - case 'banner': - return undefined; - case 'button': - return 'button'; - case 'cell': - return undefined; - case 'checkbox': - return 'checkbox'; - case 'columnheader': - return undefined; - case 'combobox': - return 'combobox'; - case 'complementary': - return undefined; - case 'contentinfo': - return undefined; - case 'definition': - return undefined; - case 'dialog': - return undefined; - case 'directory': - return undefined; - case 'document': - return undefined; - case 'feed': - return undefined; - case 'figure': - return undefined; - case 'form': - return undefined; - case 'grid': - return 'grid'; - case 'group': - return undefined; - case 'heading': - return 'header'; - case 'img': - return 'image'; - case 'link': - return 'link'; - case 'list': - return 'list'; - case 'listitem': - return undefined; - case 'log': - return undefined; - case 'main': - return undefined; - case 'marquee': - return undefined; - case 'math': - return undefined; - case 'menu': - return 'menu'; - case 'menubar': - return 'menubar'; - case 'menuitem': - return 'menuitem'; - case 'meter': - return undefined; - case 'navigation': - return undefined; - case 'none': - return 'none'; - case 'note': - return undefined; - case 'option': - return undefined; - case 'presentation': - return 'none'; - case 'progressbar': - return 'progressbar'; - case 'radio': - return 'radio'; - case 'radiogroup': - return 'radiogroup'; - case 'region': - return undefined; - case 'row': - return undefined; - case 'rowgroup': - return undefined; - case 'rowheader': - return undefined; - case 'scrollbar': - return 'scrollbar'; - case 'searchbox': - return 'search'; - case 'separator': - return undefined; - case 'slider': - return 'adjustable'; - case 'spinbutton': - return 'spinbutton'; - case 'status': - return undefined; - case 'summary': - return 'summary'; - case 'switch': - return 'switch'; - case 'tab': - return 'tab'; - case 'table': - return undefined; - case 'tablist': - return 'tablist'; - case 'tabpanel': - return undefined; - case 'term': - return undefined; - case 'timer': - return 'timer'; - case 'toolbar': - return 'toolbar'; - case 'tooltip': - return undefined; - case 'tree': - return undefined; - case 'treegrid': - return undefined; - case 'treeitem': - return undefined; - } - - return undefined; -} From 62ec7a3211d7e12b9307c6ef6d9aaa6850c546b6 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 14:55:08 -0700 Subject: [PATCH 218/468] translation auto-update for i18n/portal_workplacelive_on_portal.config.json on master Summary: Chronos Job Instance ID: 1125907901104572 Sandcastle Job Instance ID: 22517999110029078 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46813059 fbshipit-source-id: 53157d153de606108ed936e3d5f7ffca474be1b8 --- .../src/main/res/views/uimanager/values-de/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml index b4629c93404814..ffeb4ff1f96bee 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml @@ -3,4 +3,8 @@ + in Gebrauch + eingeblendet + ausgeblendet + gemischt From 56e402c22cd3524c93eef1622e33df96c32811b0 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 14:55:08 -0700 Subject: [PATCH 219/468] translation auto-update for i18n/analyticsapp.config.json on master Summary: Chronos Job Instance ID: 1125907901104572 Sandcastle Job Instance ID: 22517999110029078 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46813056 fbshipit-source-id: becc2692aab72b681eae33f4ffedfbe74b6a39fe --- .../src/main/res/views/uimanager/values-fi/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml index 7c49d51816ed44..0865df4c3407af 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml @@ -3,4 +3,8 @@ + varattu + laajennettu + pienennetty + yhdistetty From 25c9d0fdee051bf3e702653636aa4349569daa5f Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 14:55:08 -0700 Subject: [PATCH 220/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907901104572 Sandcastle Job Instance ID: 22517999110029078 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46813062 fbshipit-source-id: fed7836f590cc9b2b3028ad268b0783da0498c5b --- .../src/main/res/views/uimanager/values-tl/strings.xml | 2 ++ .../src/main/res/views/uimanager/values-uk/strings.xml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml index dadacb703c930c..6dc341aa4d7188 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml @@ -3,4 +3,6 @@ + naka-expand + naka-collapse diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml index bf3cc46d1cb490..2777a19c5cdb6b 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml @@ -3,4 +3,8 @@ + зайнято + розгорнуто + згорнуто + змішано From 47d1e3b966ba8e41642fbb57c3680e0ff5fa7e57 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 14:55:08 -0700 Subject: [PATCH 221/468] translation auto-update for i18n/talk.config.json on master Summary: Chronos Job Instance ID: 1125907901104572 Sandcastle Job Instance ID: 22517999110029078 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46813053 fbshipit-source-id: 08bd5a03dab002835af32575414cb48d880a2609 --- .../src/main/res/views/uimanager/values-pt/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml index 3a24466f7006cd..02fcc2c8e37523 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml @@ -3,4 +3,8 @@ + ocupado + expandido + recolhido + mesclado From 8bb7f527df04aa83eb5b055e7d2e1c3f7d21d9ac Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 14:55:08 -0700 Subject: [PATCH 222/468] translation auto-update for i18n/messenger.config.json on master Summary: Chronos Job Instance ID: 1125907901104572 Sandcastle Job Instance ID: 22517999110029078 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46813060 fbshipit-source-id: 366a682d7f3a7f155eb173e257bea7d4e21c9bdc --- .../src/main/res/views/uimanager/values-it/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml index 89dcf449cfb41d..a9816192981feb 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml @@ -3,4 +3,6 @@ + aperto + chiuso From b68749980116acae9403984aefdf1825aa4ad579 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 14:55:08 -0700 Subject: [PATCH 223/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907901104572 Sandcastle Job Instance ID: 22517999110029078 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46813063 fbshipit-source-id: 971a766c6328770cb7e620bbf1d2a0592b825c1b --- .../src/main/res/views/uimanager/values-it/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml index a9816192981feb..9866314133d259 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml @@ -3,6 +3,8 @@ + occupato aperto chiuso + misto From 9a8071e401daf1dd7c121c8d92f0736ad48d28ba Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 14:55:08 -0700 Subject: [PATCH 224/468] translation auto-update for i18n/oculus-mirage.config.json on master Summary: Chronos Job Instance ID: 1125907901104572 Sandcastle Job Instance ID: 22517999110029078 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46813068 fbshipit-source-id: 33a0e3f4d5884076c8f671ded84ba198113967f2 --- .../src/main/res/views/uimanager/values-ko/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml index ba310011f0d554..9332377e9ad30d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml @@ -3,4 +3,8 @@ + 처리 중 + 확대됨 + 숨겨짐 + 혼합 From 3aa42a2d3d197146a78ccf8945233608b0a28b70 Mon Sep 17 00:00:00 2001 From: Vincent Riemer Date: Fri, 16 Jun 2023 15:09:13 -0700 Subject: [PATCH 225/468] Add plumbing/boilerplate for an iOS implementation of the `gotpointercapture` and `lostpointercapture` events (second try) (#37889) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37889 Changelog: [Internal] - Add plumbing/boilerplate for an iOS implementation of the gotpointercapture and lostpointercapture events Lets try this again: The key difference between this and D44977499 (which I previously reverted) is that in propsConversions & primitives I've ommited the "capture" versions of those methods as it was causing issues. Since we're not doing any runtime checks of those raw props it isn't particularlly necessary (at least not yet) and if we ever want to we can address that when it comes up. The original diff description follows: This diff simply adds the boilerplate necessary to hook up the gotpointercapture and lostpointercapture events to the fabric iOS touch handler. This diff does not contain any actual implementation of their behavior as that will occur in future diffs. Reviewed By: adanoff Differential Revision: D46709127 fbshipit-source-id: 339dc99e14f2e72d9116bbe84edc67cb5bfaa73b --- .../Components/View/ViewPropTypes.js | 4 ++ .../NativeComponent/BaseViewConfig.ios.js | 14 ++++++ packages/react-native/React/Views/RCTView.h | 2 + .../react-native/React/Views/RCTViewManager.m | 2 + .../components/view/TouchEventEmitter.cpp | 16 +++++++ .../components/view/TouchEventEmitter.h | 2 + .../renderer/components/view/primitives.h | 6 ++- .../components/view/propsConversions.h | 12 +++++ .../PointerEventCaptureMouse.js | 44 +++++++++---------- 9 files changed, 78 insertions(+), 24 deletions(-) diff --git a/packages/react-native/Libraries/Components/View/ViewPropTypes.js b/packages/react-native/Libraries/Components/View/ViewPropTypes.js index 1a37bd3206b286..f69c97dcc9ebfa 100644 --- a/packages/react-native/Libraries/Components/View/ViewPropTypes.js +++ b/packages/react-native/Libraries/Components/View/ViewPropTypes.js @@ -105,6 +105,10 @@ type PointerEventProps = $ReadOnly<{| onPointerOverCapture?: ?(e: PointerEvent) => void, onPointerOut?: ?(e: PointerEvent) => void, onPointerOutCapture?: ?(e: PointerEvent) => void, + onGotPointerCapture?: ?(e: PointerEvent) => void, + onGotPointerCaptureCapture?: ?(e: PointerEvent) => void, + onLostPointerCapture?: ?(e: PointerEvent) => void, + onLostPointerCaptureCapture?: ?(e: PointerEvent) => void, |}>; type FocusEventProps = $ReadOnly<{| diff --git a/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js b/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js index bb13443bf44a2d..92b2959aad14d6 100644 --- a/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js +++ b/packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js @@ -144,6 +144,18 @@ const bubblingEventTypes = { bubbled: 'onPointerOut', }, }, + topGotPointerCapture: { + phasedRegistrationNames: { + captured: 'onGotPointerCaptureCapture', + bubbled: 'onGotPointerCapture', + }, + }, + topLostPointerCapture: { + phasedRegistrationNames: { + captured: 'onLostPointerCaptureCapture', + bubbled: 'onLostPointerCapture', + }, + }, }; const directEventTypes = { @@ -366,6 +378,8 @@ const validAttributesForEventProps = ConditionallyIgnoredEventHandlers({ onPointerLeave: true, onPointerOver: true, onPointerOut: true, + onGotPointerCapture: true, + onLostPointerCapture: true, }); /** diff --git a/packages/react-native/React/Views/RCTView.h b/packages/react-native/React/Views/RCTView.h index fc5e2217cf5266..200d8b451bf59e 100644 --- a/packages/react-native/React/Views/RCTView.h +++ b/packages/react-native/React/Views/RCTView.h @@ -132,5 +132,7 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait; @property (nonatomic, assign) RCTCapturingEventBlock onPointerLeave; @property (nonatomic, assign) RCTBubblingEventBlock onPointerOver; @property (nonatomic, assign) RCTBubblingEventBlock onPointerOut; +@property (nonatomic, assign) RCTBubblingEventBlock onGotPointerCapture; +@property (nonatomic, assign) RCTBubblingEventBlock onLostPointerCapture; @end diff --git a/packages/react-native/React/Views/RCTViewManager.m b/packages/react-native/React/Views/RCTViewManager.m index 9a0af4e74cecb9..eb3ff9c00d882e 100644 --- a/packages/react-native/React/Views/RCTViewManager.m +++ b/packages/react-native/React/Views/RCTViewManager.m @@ -549,5 +549,7 @@ - (void)updateAccessibilityTraitsForRole:(RCTView *)view withDefaultView:(RCTVie RCT_EXPORT_VIEW_PROPERTY(onPointerLeave, RCTCapturingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onPointerOver, RCTBubblingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onPointerOut, RCTBubblingEventBlock) +RCT_EXPORT_VIEW_PROPERTY(onGotPointerCapture, RCTBubblingEventBlock) +RCT_EXPORT_VIEW_PROPERTY(onLostPointerCapture, RCTBubblingEventBlock) @end diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp index 747dedcf7dd3ae..d0c4fc399c2cd5 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp @@ -223,4 +223,20 @@ void TouchEventEmitter::onPointerOut(const PointerEvent &event) const { RawEvent::Category::ContinuousStart); } +void TouchEventEmitter::onGotPointerCapture(const PointerEvent &event) const { + dispatchPointerEvent( + "gotPointerCapture", + event, + EventPriority::AsynchronousBatched, + RawEvent::Category::ContinuousStart); +} + +void TouchEventEmitter::onLostPointerCapture(const PointerEvent &event) const { + dispatchPointerEvent( + "lostPointerCapture", + event, + EventPriority::AsynchronousBatched, + RawEvent::Category::ContinuousEnd); +} + } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h index ad42dfa7674eac..ef2e11b95481a7 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/TouchEventEmitter.h @@ -38,6 +38,8 @@ class TouchEventEmitter : public EventEmitter { void onPointerLeave(PointerEvent const &event) const; void onPointerOver(PointerEvent const &event) const; void onPointerOut(PointerEvent const &event) const; + void onGotPointerCapture(PointerEvent const &event) const; + void onLostPointerCapture(PointerEvent const &event) const; private: void dispatchTouchEvent( diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h b/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h index 04daf6e3367070..ac418daa87fef8 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/primitives.h @@ -21,7 +21,7 @@ namespace facebook::react { enum class PointerEventsMode : uint8_t { Auto, None, BoxNone, BoxOnly }; struct ViewEvents { - std::bitset<32> bits{}; + std::bitset<64> bits{}; enum class Offset : std::size_t { // Pointer events @@ -60,13 +60,15 @@ struct ViewEvents { PointerOutCapture = 29, Click = 30, ClickCapture = 31, + GotPointerCapture = 32, + LostPointerCapture = 33, }; constexpr bool operator[](const Offset offset) const { return bits[static_cast(offset)]; } - std::bitset<32>::reference operator[](const Offset offset) { + std::bitset<64>::reference operator[](const Offset offset) { return bits[static_cast(offset)]; } }; diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h b/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h index 704a00f404c6c9..6aabbf23835d97 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/propsConversions.h @@ -616,6 +616,18 @@ static inline ViewEvents convertRawProp( "onClickCapture", sourceValue[Offset::ClickCapture], defaultValue[Offset::ClickCapture]); + result[Offset::GotPointerCapture] = convertRawProp( + context, + rawProps, + "onGotPointerCapture", + sourceValue[Offset::GotPointerCapture], + defaultValue[Offset::GotPointerCapture]); + result[Offset::LostPointerCapture] = convertRawProp( + context, + rawProps, + "onLostPointerCapture", + sourceValue[Offset::LostPointerCapture], + defaultValue[Offset::LostPointerCapture]); // PanResponder callbacks result[Offset::MoveShouldSetResponder] = convertRawProp( diff --git a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js index 7ce1b6bf894f66..680cbb259e8202 100644 --- a/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js +++ b/packages/rn-tester/js/examples/Experimental/W3CPointerEventPlatformTests/PointerEventCaptureMouse.js @@ -32,12 +32,12 @@ function PointerEventCaptureMouseTestCase( const pointermoveNoCaptureGot1Ref = useRef(false); const ownEventForTheCapturedTargetGotRef = useRef(false); - // const testGotPointerCapture = harness.useAsyncTest( - // 'gotpointercapture event received"', - // ); - // const testLostPointerCapture = harness.useAsyncTest( - // 'lostpointercapture event received"', - // ); + const testGotPointerCapture = harness.useAsyncTest( + 'gotpointercapture event received"', + ); + const testLostPointerCapture = harness.useAsyncTest( + 'lostpointercapture event received"', + ); const handleCaptureButtonDown = useCallback((evt: PointerEvent) => { const target0 = target0Ref.current; @@ -50,20 +50,20 @@ function PointerEventCaptureMouseTestCase( } }, []); - // const handleTarget0GotPointerCapture = useCallback( - // (evt: PointerEvent) => { - // testGotPointerCapture.done(); - // }, - // [testGotPointerCapture], - // ); - - // const handleTarget0LostPointerCapture = useCallback( - // (evt: PointerEvent) => { - // testLostPointerCapture.done(); - // isPointerCaptureRef.current = false; - // }, - // [testLostPointerCapture], - // ); + const handleTarget0GotPointerCapture = useCallback( + (evt: PointerEvent) => { + testGotPointerCapture.done(); + }, + [testGotPointerCapture], + ); + + const handleTarget0LostPointerCapture = useCallback( + (evt: PointerEvent) => { + testLostPointerCapture.done(); + isPointerCaptureRef.current = false; + }, + [testLostPointerCapture], + ); const testPointerMove0 = harness.useAsyncTest( 'pointerover event for black rectangle received', @@ -150,8 +150,8 @@ function PointerEventCaptureMouseTestCase( From 71e7bbbc2cf21abacf7009e300f5bba737e20d17 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 20:39:36 -0700 Subject: [PATCH 226/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907901243147 Sandcastle Job Instance ID: 36028797994468775 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46819262 fbshipit-source-id: 85876f5642d606661725f2f9cf81b114d6b0bc06 --- .../strings/da.lproj/fbt_language_pack.bin | Bin 0 -> 1300 bytes .../strings/de.lproj/fbt_language_pack.bin | Bin 0 -> 1308 bytes .../strings/en-GB.lproj/fbt_language_pack.bin | Bin 0 -> 424 bytes .../strings/es.lproj/fbt_language_pack.bin | Bin 424 -> 1364 bytes .../strings/fi.lproj/fbt_language_pack.bin | Bin 0 -> 1340 bytes .../strings/fr.lproj/fbt_language_pack.bin | Bin 428 -> 1360 bytes .../strings/hu.lproj/fbt_language_pack.bin | Bin 0 -> 1348 bytes .../strings/it.lproj/fbt_language_pack.bin | Bin 0 -> 420 bytes .../strings/ja.lproj/fbt_language_pack.bin | Bin 0 -> 1436 bytes .../strings/ko.lproj/fbt_language_pack.bin | Bin 0 -> 1332 bytes .../strings/pl.lproj/fbt_language_pack.bin | Bin 0 -> 1340 bytes .../strings/pt.lproj/fbt_language_pack.bin | Bin 0 -> 1360 bytes .../strings/sk.lproj/fbt_language_pack.bin | Bin 0 -> 1332 bytes .../strings/uk.lproj/fbt_language_pack.bin | Bin 0 -> 460 bytes .../zh-Hans.lproj/fbt_language_pack.bin | Bin 0 -> 288 bytes 15 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/react-native/React/I18n/strings/da.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/de.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/en-GB.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/fi.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/hu.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/it.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/ja.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/ko.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/pl.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/pt.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/sk.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/uk.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/zh-Hans.lproj/fbt_language_pack.bin diff --git a/packages/react-native/React/I18n/strings/da.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/da.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..69a7e2469c1461110e87273dad3314dd91289aec GIT binary patch literal 1300 zcmaKsy-yTD7{*6E5fKwK#!ygPK?%v7cU&Z);NZjq?~e065RD1$-tL}zvtR7Tc@PQ< zO9~4M3kwQEZE*#Kl{6F<`~en}RK~wReBO12Y+~Xjzn%Aa-ua%{oo0-!ELG}LY#I?` zX*PxTB)fC3uFEOCtwH; z0L^UxG(huP0OP+eE@&wuAmF{o3Naty-GSFXKJFT^_)HDg1H7k)!FpuZNE5bg9iii_HAF-d)xZ(eQQt_8T>!rJ{7~J2{0$N63 z=yXGHr$MjL+O|!vDYaG)ay_R&+Ysl?&PKk_sI5qy>uG@1WVy0CD|LCd-fI<>Y^fhueWk9}b5d(o&6w|N zZK=I=ySAMf#CM+hH=f#s;*R=6=4ZK8EauxUq;?uXd9$*L{zu|}5Pg$$2K0NN@|!qM hifipk1qIG0d6ud8yeR+kpSojlpVVdyP@QBye*h*V2#5dx literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/de.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/de.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..b41367fa6093b853980b49fd67ead6aa7cd5f4c4 GIT binary patch literal 1308 zcmaKsJyR1w9L86TiWnUV$DyD|L1AHL5)(4g8HjMeCB%e4bew^E*<3F7lH*H28Lj zkP~nO_Q5XL0FOWhq`)b1d;~|}0PKPdz;d5nK@7YFZ@_D?2R!f`NT3KZAPv6bn_s{Q zI0lE{6<}ktK^s)SkDq5}Y$|D>M1et7o4Ps;A<6i!^Vn_F*Qjp|X=K>c3_^-;@z_d_+T9@o` zpX~!R-M{wXfXCQ+8PqWYtsC#pQ6iU46)Q9cCiO#d!hN<6e_WiQMEk^A;V)pB|M#Tg zKZTtWwl3u;*iyPSTj#iEud%Y}m|l}*V43uKQ0Td(Kxk82EtVR!IiU-K)h%_Q&=7i2 z%1<{t)%6Rlwl&@H6`=>SR;M_e$_ZVumb3E}WmD+Ik`c;k*%tcoR8gAE_lrWWS4#`k zAU6=YI=vo6t?i5NJ=OBfR!%cSyuZ3OH8*SZg!U^tc}p2)g_ef(-b!i45&D5WQ0i*E zAhd4RI@1HaCA7Ef)HZY5?AXQY(|O{Q$~)?k&{@kamy4}uLc5JXYRe1Ae+}(Zc;kKm pxFX{69p6Xh)mpNQ0(Vk!4^#0S#o}N8X*(L{WPRA#XKj*segn&73orlx literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/en-GB.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/en-GB.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..bd9be08307975f450779f91bec3122cedb325af9 GIT binary patch literal 424 zcmY#kU|?`_@(GY(PywCB5Ssw81Q3J7_5kq;Af5um4M4o-|Ns9WaZVsk&d3mZ@ZWG=}2Ao>uJyZu6a hK;8$253>7Mz~Kc_`wl}b7uZaY9xfmTsR3b_IRH`cH9P6fv?E(5$u93um*VU2JG|?2;a!ENH63QDdXV6i@PnFq)8|R| zg~#{Y)2)cfT!mrRj=J&&9x|K=@9(vjt3~*N_zwQ>3I$&oKVy8p3iEWsV8N(rVQItE zokc#HXHoOsSk+4KqZMdfS&k2W)ofxe>qQ$VU~r#!GXcSfq~g{a9~mVKF9kajft0h?!E8#dEe)K-{-x%Q6ie1 z&g6$_6i-AWG>rQY4dQ->!qiWpz!`^r9Ylz>Llndh(cXb~g7)%t7vl6P(H__auYeBH zAOZ$K_X^QBun#_f4#0dGME@cNE_ot^PkZh)pRY{Rw<$MNY@`eFEvfAGoFEVm^*0ZD_u z&&OQHvsTmEj<9J=dbiV7M4INAL>jL?M z1YH^9ee-zJY?zIz9?Tm)JKy)szcD$AXiUbqCUP9zmmcrKuku8Og(b9H*KuLds*Lmg ztEiceZL;t5u~Rn%-bZ^o>|Hzy-Xr_6G{OElPM)Fr5{el z(=*XVT1Q&VPJ4{ zU~n;UU|_JDg9Ec&7#REm7>IEs#(}{_@p*60X>MX-lixk(dEWQD=d1UQGREd-@}&_r ziXLMU8^Lp!-Nkc=#n}Lhh0Zwin=r!Irx*+4CuoP@{X!f4-Ghib~r zVGsj9G4BbWwS5Nr;4Nr_82i&3 zGk~sT*nzJHF4@D}zm2|Wcs?Iz*G%1~fe(268v0J?GM10jQe;mJOg*fnasMWA6-@2e zlJ5jfLxoi@b=IWkj zI5y>+@f_Myw_|oYG=Ze)650S>{GxXj;W~R~)sKzw7@aRqXAij-Iiqd|>oaBBr@g)8 zaXKRzXF+C@dw1YDO{B{{RwwDUq&k7?u{|EAJCtj#Y-@bGn-9UUI=ZMz1&)U0rjsTKZYmXeSptO*nZ*nNnWv%&!fS2EP9Wz V@ViFwAOGYIhBax-AfTLRoxhpLAD#dJ delta 145 zcmcb>wT5|uPO1$91A_z*^Dr_nhyZB|AT0o-Lx40gU;%O_0C5Nq8vrp#4@m3)5U&B^ z89>|u#5?}~{|^#p2jZf`D^p4{OBl{f-pC}+_-67&CgI5r%sO1GK)Kw^ijq`@$#u+P NlS^2%Cf{Qz0swy=8sh)} diff --git a/packages/react-native/React/I18n/strings/hu.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/hu.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..af4c2491c7c0b27e935cc781bfc6054b549daad0 GIT binary patch literal 1348 zcmaKsKTH!*9LFD86%n;D#xO8+U~qthN@>E#AF;(2Do{j20(b58Z0}vK+#M&qiGk6D zgn@yD!~qfp6Ox93!FcJ$z~IQpz+jvl7*PEF9`6ui;w7KH`+dLf{eJJ?wTm$}I+V$E zvM#(a7Gs_G?O>1b8)faRl|_Wojd)c!jD3tS;UA%mLi>jH`ttL%c0L+AqqbIGFDq4eKd5R?V_q?7!^uK;-3h z#Z=si#(kRqsr2r`Gqq}PpmEK_JG;1CFU?Wtj%AbFA@y6Kj<#EBbVm$SE>~$$ViUxk zW~BcReyOb2HEwFYtGU6B!`?}c>TA4Y>0IHMGFy>4)i=tjRdp}VXG7|@p?ex~Vdr+G zM)j-ZYQc%A8rByyxTis4htj9ByY8Gwo%ZGLy<_-FsPg}wi1?D|9#P%Pdd;r!b~DLIX)WtecsG_HQhHE#$&1Yz*H$ae-*2< zg`#PTeWmf#fYB+8s!gxNLOlO^5x=Lcc z*@5|`rTp?$y*GvURKB;MhrTuQx_@-osD!aSQjZ&o-xJ0uKUbMf4v8y7^LxfUC8y^4 zLchqzO9NgpAI7x_b9}LPS)3E~FTFC8gLU;~==T_Wa4?a78^+a1CpDW%BmZsjpGEh8 p&Y(rMU*wsRHlEL9(BOP1bNEEWd6ED9pT2D(C-tPeLVd31`3-Q-ExP~! literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/it.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/it.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..14d040462596087991a81e03d54fe8c38a6551eb GIT binary patch literal 420 zcmY#kU|?`_@(GY(PywEJ!T^iK+lyhaa$jeFd_E6^L^)i@}D0bY%sF6y|0Y1cUU0 z_#RaOSs`XlxiG#_PFZ3=Qh+gxpOWL3W?7aJ3UVzdOh9f1nG5ndh&}{$ABgQ2>I3pR dFl>6Hl?udz-64iR z6FDHpgb>gY6a%6dDG3H*JoqPg;9xSP(8L&z9#nj0ccxiF;wHb{edd{YXWw^br-Tqv zU+ZuckrKQSQcQ|)HpCN@LpBU7ZGU!p&A>_A#sD9~5-iHtyp8D$ogyRGu29Q2Z z$ToNh5}*&bKq<%v>0^YXz!dO}YZ_wgxsPQPH zaUQQscv?Kfm|}E|(HTB3T|>=Myzvy$3_o1(tl48nIE(TLp)zpyS zQ`B8IU-sd<{rSY+_=n6|T%=Amg>O`2%`-Z|=mMWld9HrX&FB|?R5#5{_wAGH z^n}(vDcbp(WY*VrClMtn+IZcw@l>c6rHPd|QU=QoY9<4XQ zUzd+j|GNz8pUL;7R_8cV7De`l%b-RIx?B4r-F+=QB9H8MMJs|m)~M9oooyDY+gUGl zMXc?mx$Z21Dr#~{_l{!`z3Rp%eO;X!J&E;2Z-hQbYtzGvVzM8Pq zS1K*`I&-f@>W(IBLsQfgle(#@V{p(jl$-Bnr@6&r>gH*uZIpiHF zm)bt!3btBnBT`=q$Gk3|t3qmj*cqsb`8`tiHAkHNrlC7h2d+n~HN(DZQkRFqH8mE` zEvb9lQG2_i0rB(Hvykr#z7{y5)aNI$zP!!paX9e6nW$e=gL+1C|HqNO1!_z_rU39h H`Z)gp%ubpK literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/ko.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/ko.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..c131bf58d47f98bcec903eb4c4b6693ebb74f8ed GIT binary patch literal 1332 zcmaKsO-vI(7=}k}2og+4G=>9*J@hC^YfA%1e#C;M)It#r2~a9XfA}j@ARZvy17H&& zX-!F5g0Vs&B_UWNCYTW8frCd69z1y9K$uxi9#MQ}yHhqXag%3f-g)Qy_M4gAH4;La z8yv1GVnmM+iB#cUNp9d?LCQ%fF{mTApk>t|ByJ$8e~7jMW8cy0ubU9RE)$Xi%OD6k zK`p2P25@|dkS`zyV&DmA0!Cl}3^~4meUJjrKp)__Q4(QS;DgU#7o@-fm;`;m0cwE} zRDd%)^8|bahk)0X1Tq){J>dBF`8i+8RlpXqr+Znpxs3jqHhv9#`a(W^my_srmZf9R zm47Z`l;|8w=V_MLY|_Sgj1t|E=thn$Wt1iEIW!MtagX$9x&)f7%gSmJHR-qZ?S5Pa7-awe2ObWfIG*;Ow<=elE&tg2v|Pau)r#E{BplP!cFI ztBvvXGkIN!rcr;Mt)~hhqev?bE@)Z1cl3*Blr*L4iG^%k|ad%zc( z=odQD7#Ot9)|iBD3ba?>ZR#Hvy45x`>G0MEg}zf`wKtkatwQ&<*;?AdrijpOb-hzl zp6TNA9uAm0Jf?vm;g5DbsA+Bt_=TQmnlT6ZXRC#_&$|4bwuX?m)B(x+81;V z)C7{TUk6e;4V@PDUfq?;%)|MtD4ipdzwxyO9(U{cN>lLo|uiW(yy)YP~ zn*)P`O&Ay)9ZYm!G+Gk|M+XN621jEY7*+hf*Y}`_iI;rt-S_)__j~u=ySrgR$m~=y zGem}QMTkO%a2_OAaSoCJ(nkW^8HIkz6GFBEgy*|xgYdqg?LDqR{5na$gNI-e zjDR3GI6=rBcn`M0V~_(OFaW-z#uu;yw!j8>1X%4pjCXK~kbUqO?0{Eb6KsH0kOPxo z6bym@_=$1%z%F3Vwhf*G_IxF<_xtdWP30W$o4T!c+BFT=2g1LE>nim$L$RsrciJUi zC&546d-{>7KJ^?+*IXa-?D0+At5Lq9Evt4ybG+p>uaB$be^fcts6{> z>`FIlsk&zL+$Oe#UreeIvo)cn#+He!3hykgeOlo=u_3(k@LcD3hh7N34?dRP^Qq0Yjl32-^42Hn(Q!)kRi; zRVrn?NX3qMQtRqcG?q=zN*!q|HH&kRtkm;~@Wf&{RXEbcWwm6v>^0)`8q-EO>W_z{ zo-r22ZqLv)spn%WwPZ1FN_}fQnwSndQK<{5*j&mBHKa~W6zcW-`q6mz)$n3Iq^`)^ zS-LkqJ8e{?c4t~)gZg7qC;Ut$7n`!AzF{_KrkIIHT{6?HV%7{(6>B~(Q!h>s2(JY-;KrG%srl^949N?MXMq)92LQaFDkbz;Y^orE;% zz|et#fj@u&sg+=0U?>tJq8%7I@CS70(18IV28IqmdG2x-MMA>T&%Wn<&adx%&vu9q zGCPyWkCPBageYVj=P_~_=TS03f+WBr6VRL7A>>_vaQ^_;QN)gM9Xzf=1kVui@iZZC zz;ob&BDe)Y;MXZaj=&z+22a5Xh=EaXj2uT`4{U=C@EEY%<9J>W{KPX3!9Mr^w!sUq z0aif~+y)b13)$;hAHy(1Vm4cm1*vrBcyW8QV)UBK8f{U*Pks{F>3@US$35Ge|M7TRv< zlqFadv5Oe1PIGt5QCx~uR85cj&xC)C`Fwrc_8g0P3RRkhMakQN996I7I;;lA-F?0L z-e3jn3;$9-2YlCas-EHdXu>z)v-(UFsOXM@>RXT`c+#t#)hGJXH$%c>eUnbC1+L+|a`OA!wu zZX3R4vB@}gM0^-y-SBPdY24W#$Ss41A~w)>*)+b!5WbH89|8VVvD#T*HCd}~ScWK+ zWvCU3YqsewvRq8-c|Tff#QA&0w5ct{;)UF-^rP*iC+b|ZAoYAYGQC*Imit;=)^yuL z$9nnN$$BN$oeE2xsxM65P0=-}=i}98Mom~!-m{k( z1v|GE?if;6?%VOix_VFQ$-0$D#7d8(ZWR3Va%K+shxq@Cy+dpd@LS>6PhwwLELX~8 eaKV3Ua4!S=zsCIU|I8icIoUnz9b$6^^ZW(1+#W&z literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/sk.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/sk.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..1fbb2a586f4a48cc268bcede8f114107258a6c04 GIT binary patch literal 1332 zcmaKszfTlF6vszB2_i;ROeiR>ps;|1^NveMX!s!>cz2u!hi5`UW^eakZ-30PKh9$- zN()IWEGQ_v#KwYz!h%>B;~j~A0tF?dF%*<4erK7%GbV2G*?I4MXWs10yqzIJ$m~?M zFi3`A5fUeZcn^?%y!%Km=_au#G7Nt!QV4kyBa!|YZ69LCXgi<#aL%q0vJYMZAC$oa zh=U(j2sr_5@D6N&GDv}5aEkFq-~jA`23P?+ZwzytUc;Q=EBFB3f>)pcR8RmD-~s3d z1boB1N1zS(ckP0gfPdTZ&+~J>gl-Tj)YR7DEYo>Tq6^FDV;(YJ0FPEpc z-w_WjT{~>@Sx_?~&evjVA>UN$8g}4AJP}%SZht8Re+RFQ|2?tj58`z+0Ayy0^UyWE zy4GHM+h9Bc&r~ZeZCJXqD1EiyC2MxtlfGVAPNj?aS?MS1%P*9FHMe@{ zE9Hu6xxAdB{Pk(0nhM88r9WdVj69y98`7UoulZSJGO7{&J&(pxndt;eNqse!p38Zo zQGIYdH@+GKrN-ra&nt<=(r9H(_Gin_#%8CDn)Kb7&4fY25$R{bLTxEM71b=y_t31< zf>KCIT{ZL7@w!@)zO!KEH%1%0B%<|HpIYh3P34L7?V^_{XXlWw3wjK1+zkNNN7Q~1 kXUSvvQZ|bQcNL#mKC$TT;`;Z0`u0RQc~4$fyiaGI--?whP5=M^ literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/uk.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/uk.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..e5f02560c504115df522140db0a922e99355d620 GIT binary patch literal 460 zcmY#kU|?`_@(GY(PywjgTz5*T-bhL^M!pE8!qg<*nF|+ z!akr7!vUx~A4Gn`g`Ggzeu(THs2s?hKwbN==~n@|9zS3K`x@j1s2zJQPP^D~VZ(*J zAQymiX9a~6=4KWIgUkW(J*on-Ld=|UVSJ;Uvc!O-0Am0?~({?gp{_LVbLI6wv?3?qmUn2T1-MhFUJLnIJt}KnzlYYz_dhq*{Fd literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/zh-Hans.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/zh-Hans.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..a270ec17dbb1ca74ac3969901a4e3f1b5defb40c GIT binary patch literal 288 zcmY#kU|?`_@(GY(Pywww(p2h!cok^v`+PJN4zloj^87XS}bOr*E-A83O|w z*gb4OF_2o2`5^kx|Ns9%Gzj~J`uG4Tpu3RmWC6PqB>xUWEf?5KkRC1|MmGllo0b}G literal 0 HcmV?d00001 From 17b714fd8ab49c56648a82fe9a2c8af0f352a928 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 21:41:32 -0700 Subject: [PATCH 227/468] translation auto-update for i18n/portal_async.config.json on master Summary: Chronos Job Instance ID: 1125907901184259 Sandcastle Job Instance ID: 27021598737781976 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46819589 fbshipit-source-id: 7ab988d4a3bd446c65dad778e1da14f7dca27d97 --- .../src/main/res/views/uimanager/values-ja/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml index 437a25fe2bea8f..72304da6c40ea5 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml @@ -3,4 +3,8 @@ + 作業中 + 展開中 + 縮小中 + 混合 From 2f4182da06c96ac7d1f5e4970c1a5d4ccdb166d5 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 21:41:32 -0700 Subject: [PATCH 228/468] translation auto-update for i18n/talk.config.json on master Summary: Chronos Job Instance ID: 1125907901184259 Sandcastle Job Instance ID: 27021598737781976 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46819606 fbshipit-source-id: 8cd775f6124e3ce996dc521efa2b9477eb0b6938 --- .../src/main/res/views/uimanager/values-da/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-hu/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-pl/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-sk/strings.xml | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml index 1fd6723b3bae1f..d6ac1ca4d59549 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml @@ -3,4 +3,8 @@ + optaget + udvidet + skjult + blandet diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml index 7c28e052110cd6..809c0582ec8fde 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml @@ -3,4 +3,8 @@ + elfoglalt + kibontva + összecsukva + vegyes diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml index 4f53d3ec705bb8..8e14e16ca00381 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml @@ -3,4 +3,8 @@ + zajęte + rozwinięte + zwinięte + mieszane diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml index 2d1768d211d54d..81249ed17a4ae4 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml @@ -3,4 +3,8 @@ + obsadené + rozbalené + zbalené + zmiešané From c7d0a8823c75deff3dcc1965b2d276f0fc77e770 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Fri, 16 Jun 2023 21:41:32 -0700 Subject: [PATCH 229/468] translation auto-update for i18n/anna.config.json on master Summary: Chronos Job Instance ID: 1125907901184259 Sandcastle Job Instance ID: 27021598737781976 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46819604 fbshipit-source-id: 7ea92faedbf50ec760a975c46a7ae7773f91d7e7 --- .../src/main/res/views/uimanager/values-ms/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml index 443eca7a57e1f8..c23bb0fa836417 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml @@ -3,4 +3,8 @@ + sibuk + dikembangkan + diruntuhkan + campuran From 53526e756fa981e9e6f49ecd7abaebbdc360f07b Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sat, 17 Jun 2023 04:19:19 -0700 Subject: [PATCH 230/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907901446115 Sandcastle Job Instance ID: 18014399485170687 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46821576 fbshipit-source-id: b758826346428ca2b40d079b10de336c433e6755 --- .../strings/ms.lproj/fbt_language_pack.bin | Bin 0 -> 1292 bytes .../strings/nb.lproj/fbt_language_pack.bin | Bin 416 -> 1296 bytes .../strings/ru.lproj/fbt_language_pack.bin | Bin 0 -> 1580 bytes .../strings/uk.lproj/fbt_language_pack.bin | Bin 460 -> 1564 bytes .../zh-Hant-HK.lproj/fbt_language_pack.bin | Bin 0 -> 1288 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/react-native/React/I18n/strings/ms.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/ru.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/zh-Hant-HK.lproj/fbt_language_pack.bin diff --git a/packages/react-native/React/I18n/strings/ms.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/ms.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..db8d65ae2fe72d883e9b1659483df2b3ffb1d086 GIT binary patch literal 1292 zcmaKsKTi}v7{*6E6%ox9#86OdL16*Oop)TM;{fr%z2iJML}LQ8w|6kNe{R{GJ%LbI zSXfe0@DV5|`~b#KSXfwCSW;M6SyLGCd6yZoiHV#1cIJ8Bop;`uo!v3U*!+xHA7x|c zF=nt)+(+0j?pZd(23RI>#-ZOO5yspMOX7!Uv+zEkO14XH5>YV5|84f~SHCuG|*ytW_1AHKNU1HD#dvvK89z1o{r-XOf7 zErsFqJPY%#DgQQn5$$3DlDW#e2`>^>?4W(CJgUzYsLsNYX~S_HsTkGK;#gO*3pi`a zzXx9mn>&UrBCLz@eN{1)tvL+iy#ermZ>UBA-STFdrAoTSTq z{aL3|+?&j4J?AVJvC?xYgnJiXj^Sz?h>($aiHOlq1u1>ATadYQt zzL%~1ax>T3)bZZxi^=&}r>k{1x0`qP-h|eby?S@0G~;Rg$nEpGRWE35yS2_#-)?Fh zEP1u<+)i8T&U3F+-nE`-J>j_Ja literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/nb.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/nb.lproj/fbt_language_pack.bin index f3cfc776851c6a866538bcb1679a65f461275e3e..153401ec038cd1c7c2cccfe3c74ddfb83958d166 100644 GIT binary patch literal 1296 zcmaKsKT{Jy7{*u4AR;=<$T$=fDJU#tCNUucGc&f$jz9qFU=gIjIQV@H zaWDYK;5FC<%ODLHxIpt248Sqyfqg)^zu#c&91OrII08MOgF09S55P2F;3ww%20nui z-~_w_0_=kdp!H4uxxA!O#z16ST}NO&(z^pMHbPr`I_o>8XBp7TGB%FBFm=IgBSe>N zOaB)7ZSEP483`KiNT22)9}RmWJ(^Ps`+_pOm)>1?p)Yu3`CepuJP5FU8Jj??(RCao zPZo17{oC{o*G<0@c7woRKcs&TemgW=Jv7@QGCke2x$rUB<*;U|!8N>o%$*LpY)1N2 z1No}vjP$7n@@Z^IdUO|T-_=ZSxMa<@BZ})XPBq3nj0^|oCB2*Q{2&lq2zE5$bwzCI zhG3^7p5}0myn*y+e@xpp(k>3h5NRIc&dAts-B&idkUs5OvOjV^=WxUS|D=+C2GvXR z@t7tvy-qZ&j^4H!+Xt>0Y*8N4dOgZnULmQSwAtFp7aFxS70<;xue9}CL+Oojc4@0! z-MiA-ZcBGVu5`R=xATV!8Kq11=KPZqKTvw3&=D1_h+Q4d|9Bx^Ud{S>rT40Z^=g#C z?hNDArM+&q*}IzWMJv12%(Rkor}g?f&llEKZA*<0OZ}|P59gIGAJ(ny!iuZ(BPZr{ zt)5d_cWUjWSZ^vFY`V3BOfR|bl)wGVEfo9OQx%`LonkTHe5th8h|0T_b>tsQzCUzt sX#eTcK}Fv#ee-Xb|T41Bk3;Cn9)3c0m9b>G5`Po delta 175 zcmbQhwSakoPQ48S1A_z*GcYnRhyW=aAT0o-J%BVaU;%PkfY<|w4S*P=2PC!yh!+5H z4-i)X@sa=k|AWNYfVen2t2C#Cf#C*Jj2$SJUrJxo(k6h0~vLWm*$N1NEh8XY7lwlrZAs93O+3N4~BfwowrKm1As;!u7PF(NuR zIyg8uH~>;9rBGuW9qvmU85|rKjB#*aQ1Lsr_hK83FZtfP-#Ono_uO;uyA~p9tap1& zWWk8YOeVaK(_y?Tse;O=L|V>+&qxo^+4=Y0HlEzz!QM$yAAk&Z$EZ+AeCz}CdHCS8A-8jOdC^T17@oHnfIT;SmeZl zSQja=X3UvI8nQ`a%19d1A`9a>hlnNUoGPXQV;C32DhrGxD0M5}N%l=5V;b)bkuhWH zj97zsnJLXG-2vzdTp6)|btvBn_T^;7DGoN~jr(E&Gs+6FZlycLx(q7cfEpRhB8Np{ z7Ooxgj7ZaVp*9ESn%F>P|I}K3<$H3P^S+i1$Z>DX$jbGnIk%dQ*Wy!p*+aBVN>B$k z%t-2LkO)hed5{*m#6$Qo6}zHJGPYN^^wkDB7F+e$2C7Y07x~$4pzwewOVS z6r2@{yrtL=Zq1V1Y3^7G_2Gj8$h4DRH~%Lvv6;`y1KxbZreLOvO2d0ERyd3CnAgd^ zn+5T*RVy;S=)5JB<{8Rj93$zx72oxj{3)T=er)NZueV5z1ly}ajmAYAsW$q z*g0Mu4NO#N?wasMe2)6K<`-g#fH&y1Y2Fj_gliK$e$5A4>GI=lad=KXCWu1$xl;393Hh2LWm)5F_A-!HFA)owWX1pg^C5+QVYduOt6auy08^05DsODU_#(x z8V(*kaPUwIgi_jK41d5(!jS_951c%C@S^z5bOs;6_>%9v_x-l{Ei+>vgtWCdJ@v$Z zKSK1R9`76ED&BRZmQ)j+klX{G7aBsQFA||&!?zByJ$$v#b&&lFge(DZzyUM>1UNiT zNFJC6`hkZ)J#ci6kPToOZ~zTJHE;m8BEZ*v1@PEMI>ZOQ0H1(WU>+C-UIGrl0_cHS z;3wAo22h{~tO4(VG{E!o19m|7>-ZSvq9(dU*J+uhX^G9TSz3me7^MCV{^>5w(h}XI zJ8VhMGBBHAvnH~-yUqPd2=|#~ctx<;)+6x@Tfi?05TXLn z{jSu1m)mRWqq}fJCZZV&s4*vsFR>N!K>FO`KI@_Z@YKT{MWPcY3CVu+OM9LZZyQRi zWQ-oOH2lO$2n7EbHb+*a{S}cDmM+l(o7KxMFO$5~Uptd?We&@bA4r>OZu3`6en>gb zT`aqW*lFaGlReT71vZA`N`Ls-5UMiGp^5MKz|oo&h>1hmh*@okc|%j#L1C>wZ|Fbv z*y3sbBH}NKW@86_lseH1>^;6u@)&Ab8tiF(PpinG)Lll7XNQB@aMJ((=)?`d&qpPO zSaw&OkxllNE#bUE7xi|JBnF1Ncr4Dto}@WCXiX|U5bCj5z3w)}&8eO@!FID(@eYTn zxhvx8J>fxrD4ZA#D4uGKMJ!WIM#b&1&c?^~z=+}<*1j=k&=yzxQIo~dY8tXA-s`fq zyOPF~;;!c2@p0e8$$HO2rY@f`)Ti`AJPLK@)1A_z*>o77fhydvbAT0o-OMo;oU;%Pg0C5Zu!}Nf}9suzfAl?DQ zOMrO6|H*uea*PKi2Qo`D-kF@stjw&!z%f~nMRKwN3)^HZ7A^%opt1|wFYLKE?PAA; f4Hx!a*vG)Y0Tjy$3MtIZEC`-#!D=*l6>AXyeIFrm diff --git a/packages/react-native/React/I18n/strings/zh-Hant-HK.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/zh-Hant-HK.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..3c20478c76a417543143e672076dd41b487da1eb GIT binary patch literal 1288 zcmaKs%}*0S7{*6!2$CjpAjU%v95_PK+R{Mc!9uMC+foa~YDlmj7U>5R3KfV4Fn|li zph@`(9>6FeMhrG+t0EfX!2<^m`~e<1OPd(aoWy6AowCHlO@2H3JTvdR@67B@6(PjZ zU~_6n6`lyGBpTc=kP6((iJFuWmE=@Ik4rs-+*J{&KZUj&-X>b*bsl2(G$8_r04Jye z8bCn)6d~WiCP;w+-~n|&161G_hVFqaun6vh+koZXJ4479@Cqz~aS#I?zzPhY5~#re z-j@SEz&2P1DKH9HZ606-TA==Oc*v%57SK#uOueIz1w2=s@L$l03>6mOUsCw_bwONu zK$q6xx5>Vmnx-Gtj%q(R8H4Ir*s@e(#o_TfARqdU zVyb1I)qdm?a#{Ay!OLZnVseUZ&x-T!>FPA;P>j!StkEaan7<-7{k*jQY$li8K&+tj zGimx}t}vg3zoN(?W-`)-Y$?WyPhZmH4ywV}U4@VREBZOvKVBbkW~v~}Ap~E2DQo_7 zsiZ%HeHZe)#nnk7MTJ~#ebMe%D+^{>0?xQT)MJcu-R*BT7+nqv*ZM^JJztaF#dWh) zSKk`6cNVqJ;}1mpy<8_6!$HGHt(I$ZxTWT*+1tl;v$1Qy<}*dOzEW$jHtKo}TzA@y zP4>7p!L_}^|9-u4@{md0?1>wfdFF6qFi5$ zB)m?aQ_poE;t19!0&cEjEm23GcIXb*!Rt|@Y1ns->zZ)HWHPvKaoyvJTRpZW Date: Sat, 17 Jun 2023 06:05:33 -0700 Subject: [PATCH 231/468] Hide unnecessarily exposed private methods in GlobalPerformanceLogger (#37947) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37947 # Changelog: [Internal] - This is a follow-up to an earlier change, that inadvertently added internal methods as public into the GlobalPerformance API. Reviewed By: rubennorte Differential Revision: D46820273 fbshipit-source-id: b960b436e3e5e8f81a76bd3ced7282f76906dfca --- .../Libraries/Utilities/createPerformanceLogger.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/react-native/Libraries/Utilities/createPerformanceLogger.js b/packages/react-native/Libraries/Utilities/createPerformanceLogger.js index 950156c67f81b5..ef701198b8d3d4 100644 --- a/packages/react-native/Libraries/Utilities/createPerformanceLogger.js +++ b/packages/react-native/Libraries/Utilities/createPerformanceLogger.js @@ -48,7 +48,7 @@ class PerformanceLogger implements IPerformanceLogger { // // In most of the other cases this kind of check for `performance` being defined // wouldn't be necessary. - performanceMark(key: string, startTime: number) { + _performanceMark(key: string, startTime: number) { if (this._isLoggingForWebPerformance) { global.performance?.mark?.(key, { startTime, @@ -56,7 +56,7 @@ class PerformanceLogger implements IPerformanceLogger { } } - performanceMeasure( + _performanceMeasure( key: string, start: number | string, end: number | string, @@ -100,7 +100,7 @@ class PerformanceLogger implements IPerformanceLogger { endExtras, }; - this.performanceMeasure( + this._performanceMeasure( `${WEB_PERFORMANCE_PREFIX}_${key}`, startTime, endTime, @@ -220,7 +220,7 @@ class PerformanceLogger implements IPerformanceLogger { this._pointExtras[key] = extras; } - this.performanceMark(`${WEB_PERFORMANCE_PREFIX}_${key}`, timestamp); + this._performanceMark(`${WEB_PERFORMANCE_PREFIX}_${key}`, timestamp); } removeExtra(key: string): ?ExtraValue { @@ -283,7 +283,7 @@ class PerformanceLogger implements IPerformanceLogger { infoLog('PerformanceLogger.js', 'start: ' + key); } - this.performanceMark( + this._performanceMark( `${WEB_PERFORMANCE_PREFIX}_timespan_start_${key}`, timestamp, ); @@ -333,7 +333,7 @@ class PerformanceLogger implements IPerformanceLogger { delete _cookies[key]; } - this.performanceMeasure( + this._performanceMeasure( `${WEB_PERFORMANCE_PREFIX}_${key}`, `${WEB_PERFORMANCE_PREFIX}_timespan_start_${key}`, timestamp, From bb879d3ecb2445b10e151407669964a6fea463e2 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Sat, 17 Jun 2023 07:49:56 -0700 Subject: [PATCH 232/468] Move CoreFeatures to React-utils (#37599) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37599 changelog: [internal] Moving CoreFeatures class to `utils` module from `core` module. There are other modules besides `core` that need to use CoreFeatures and moving it to `utils` will prevent circular dependency. Reviewed By: javache, rshest Differential Revision: D46218604 fbshipit-source-id: 6030f00ad37f55f0c95f4eafa61fb22808b880a4 --- .../Mounting/ComponentViews/Image/RCTImageComponentView.mm | 2 +- .../react-native/React/Fabric/Mounting/RCTMountingManager.mm | 2 +- packages/react-native/React/Fabric/RCTSurfacePresenter.mm | 2 +- .../ReactAndroid/src/main/jni/react/fabric/Binding.cpp | 2 +- .../src/main/jni/react/fabric/FabricMountingManager.cpp | 2 +- packages/react-native/ReactCommon/React-FabricImage.podspec | 1 + .../ReactCommon/react/renderer/components/image/CMakeLists.txt | 1 + .../ReactCommon/react/renderer/components/image/ImageProps.cpp | 2 +- .../react/renderer/components/scrollview/ScrollViewProps.cpp | 2 +- .../react/renderer/components/text/BaseTextProps.cpp | 2 +- .../react/renderer/components/text/ParagraphLayoutManager.cpp | 2 +- .../react/renderer/components/text/ParagraphProps.cpp | 2 +- .../components/androidtextinput/AndroidTextInputProps.cpp | 2 +- .../react/renderer/components/view/AccessibilityProps.cpp | 2 +- .../ReactCommon/react/renderer/components/view/ViewProps.cpp | 2 +- .../react/renderer/components/view/ViewShadowNode.cpp | 2 +- .../react/renderer/components/view/YogaStylableProps.cpp | 2 +- .../react/renderer/core/ConcreteComponentDescriptor.h | 2 +- packages/react-native/ReactCommon/react/renderer/core/Props.cpp | 2 +- .../ReactCommon/react/renderer/runtimescheduler/primitives.h | 2 +- .../react/renderer/textlayoutmanager/TextLayoutManager.cpp | 2 +- .../ReactCommon/react/renderer/uimanager/primitives.h | 2 +- .../ReactCommon/react/{renderer/core => utils}/CoreFeatures.cpp | 0 .../ReactCommon/react/{renderer/core => utils}/CoreFeatures.h | 0 24 files changed, 22 insertions(+), 20 deletions(-) rename packages/react-native/ReactCommon/react/{renderer/core => utils}/CoreFeatures.cpp (100%) rename packages/react-native/ReactCommon/react/{renderer/core => utils}/CoreFeatures.h (100%) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm index 043d31f604c648..472d83e45b12e0 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm @@ -14,9 +14,9 @@ #import #import #import -#import #import #import +#import using namespace facebook::react; diff --git a/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm b/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm index 2cb3779169f2a2..d624bb99bcfcb0 100644 --- a/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm +++ b/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm @@ -17,11 +17,11 @@ #import #import #import -#import #import #import #import #import +#import #import #import diff --git a/packages/react-native/React/Fabric/RCTSurfacePresenter.mm b/packages/react-native/React/Fabric/RCTSurfacePresenter.mm index 3e11f245198c48..e974b3562b557c 100644 --- a/packages/react-native/React/Fabric/RCTSurfacePresenter.mm +++ b/packages/react-native/React/Fabric/RCTSurfacePresenter.mm @@ -29,12 +29,12 @@ #import #import #import -#import #import #import #import #import #import +#import #import #import "PlatformRunLoopObserver.h" diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp index 3d880580d5cc46..3e9ca977833abe 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -36,6 +35,7 @@ #include #include #include +#include namespace facebook::react { diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp index 8e8c94747f0cfd..993ddca71ac2e1 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricMountingManager.cpp @@ -13,12 +13,12 @@ #include #include -#include #include #include #include #include #include +#include #include #include diff --git a/packages/react-native/ReactCommon/React-FabricImage.podspec b/packages/react-native/ReactCommon/React-FabricImage.podspec index e5a4be90b50d90..9250bad91b31b3 100644 --- a/packages/react-native/ReactCommon/React-FabricImage.podspec +++ b/packages/react-native/ReactCommon/React-FabricImage.podspec @@ -77,6 +77,7 @@ Pod::Spec.new do |s| s.dependency "DoubleConversion" s.dependency "React-ImageManager" s.dependency "React-Fabric" + s.dependency "React-utils" s.dependency "Yoga" if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" diff --git a/packages/react-native/ReactCommon/react/renderer/components/image/CMakeLists.txt b/packages/react-native/ReactCommon/react/renderer/components/image/CMakeLists.txt index 9e5e0989e3298f..cb7dcae7d6d3cf 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/image/CMakeLists.txt +++ b/packages/react-native/ReactCommon/react/renderer/components/image/CMakeLists.txt @@ -26,6 +26,7 @@ target_link_libraries(rrc_image glog_init jsi react_debug + react_utils react_render_core react_render_debug react_render_graphics diff --git a/packages/react-native/ReactCommon/react/renderer/components/image/ImageProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/image/ImageProps.cpp index 5598746faa9f85..40de1421dd056e 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/image/ImageProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/image/ImageProps.cpp @@ -7,8 +7,8 @@ #include #include -#include #include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp index e60623e4900e02..fb70d8a6176cab 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp @@ -8,9 +8,9 @@ #include "ScrollViewProps.h" #include -#include #include #include +#include #include diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp index 1d54aaf6829de7..248054b629e90b 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp @@ -8,10 +8,10 @@ #include "BaseTextProps.h" #include -#include #include #include #include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphLayoutManager.cpp b/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphLayoutManager.cpp index 41720767d228f4..623b17ab8131f8 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphLayoutManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphLayoutManager.cpp @@ -7,7 +7,7 @@ #include "ParagraphLayoutManager.h" #include -#include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphProps.cpp index 242567dc4b6e63..be978655612902 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/text/ParagraphProps.cpp @@ -9,9 +9,9 @@ #include #include -#include #include #include +#include #include diff --git a/packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp index 9953e2228ed24f..07ed9defdb3c08 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp @@ -7,9 +7,9 @@ #include "AndroidTextInputProps.h" #include -#include #include #include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp index 5d42331e70d4cb..45d5460d9d0923 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp @@ -9,9 +9,9 @@ #include #include -#include #include #include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/ViewProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/ViewProps.cpp index a269bc0e749160..900080e6646f89 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/ViewProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/ViewProps.cpp @@ -11,10 +11,10 @@ #include #include -#include #include #include #include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp index 2318f08e968269..98b87012855e0d 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp @@ -8,7 +8,7 @@ #include "ViewShadowNode.h" #include #include -#include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp index 724a33ab4a3b80..79f294bef7647a 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp @@ -9,9 +9,9 @@ #include #include -#include #include #include +#include #include #include diff --git a/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h b/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h index 93fe429330c1e6..01ea9b1603ba87 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +++ b/packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -21,6 +20,7 @@ #include #include #include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/core/Props.cpp b/packages/react-native/ReactCommon/react/renderer/core/Props.cpp index 6f62ff59b8fcce..a2f3ba5f9a0a2f 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/Props.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/Props.cpp @@ -8,8 +8,8 @@ #include "Props.h" #include -#include #include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/primitives.h b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/primitives.h index 3ba035b6872a21..d27044300ce2eb 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/primitives.h +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/primitives.h @@ -9,8 +9,8 @@ #include #include -#include #include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp index e39f6712784f26..916e5ccd8992c9 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp @@ -12,11 +12,11 @@ #include #include #include -#include #include #include #include #include +#include using namespace facebook::jni; diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/primitives.h b/packages/react-native/ReactCommon/react/renderer/uimanager/primitives.h index 629a37b658934a..2d1426cb65957a 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/primitives.h +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/primitives.h @@ -12,10 +12,10 @@ #include #include #include -#include #include #include #include +#include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/renderer/core/CoreFeatures.cpp b/packages/react-native/ReactCommon/react/utils/CoreFeatures.cpp similarity index 100% rename from packages/react-native/ReactCommon/react/renderer/core/CoreFeatures.cpp rename to packages/react-native/ReactCommon/react/utils/CoreFeatures.cpp diff --git a/packages/react-native/ReactCommon/react/renderer/core/CoreFeatures.h b/packages/react-native/ReactCommon/react/utils/CoreFeatures.h similarity index 100% rename from packages/react-native/ReactCommon/react/renderer/core/CoreFeatures.h rename to packages/react-native/ReactCommon/react/utils/CoreFeatures.h From b5b2d8d0763c01ff59eab67d933b81ee14c32b2d Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sat, 17 Jun 2023 09:29:58 -0700 Subject: [PATCH 233/468] translation auto-update for i18n/oculus-mirage.config.json on master Summary: Chronos Job Instance ID: 1125907901618950 Sandcastle Job Instance ID: 13510799857052383 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46823020 fbshipit-source-id: d4aa979a0e8c7090192f90ece1c6cbe738cdbbbc --- .../src/main/res/views/uimanager/values-ru/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-zh-rHK/strings.xml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml index 1105ec010ea037..c8b37daf6d5555 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml @@ -3,4 +3,8 @@ + занято + развернуто + свернуто + смешанный diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml index 067865f00e1e61..7fe732d4ab28ae 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml @@ -3,4 +3,8 @@ + 忙碌中 + 已展開 + 已收合 + 混合 From 36b5fe0b1eb4eeb266f7c740a02e95c8cf91777d Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sat, 17 Jun 2023 09:29:58 -0700 Subject: [PATCH 234/468] translation auto-update for i18n/talk.config.json on master Summary: Chronos Job Instance ID: 1125907901618950 Sandcastle Job Instance ID: 13510799857052383 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46823029 fbshipit-source-id: f5e5c1480fd6b85b2b08c227b1d9913c010f1531 --- .../src/main/res/views/uimanager/values-ar/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml index 9ee5b1218296dd..9e9fb55c5013eb 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml @@ -3,4 +3,8 @@ + مشغول + موسع + مطوي + مختلط From 061e3245b57de8e00ac6757b7a4c7c2e1bc4077a Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sat, 17 Jun 2023 12:14:40 -0700 Subject: [PATCH 235/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907901759875 Sandcastle Job Instance ID: 27021598738215434 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46823756 fbshipit-source-id: 0065c2c182c5cabf504097cc4d05fd56064663fc --- .../strings/ar.lproj/fbt_language_pack.bin | Bin 0 -> 1488 bytes .../strings/sk.lproj/fbt_language_pack.bin | Bin 1332 -> 1356 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/react-native/React/I18n/strings/ar.lproj/fbt_language_pack.bin diff --git a/packages/react-native/React/I18n/strings/ar.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/ar.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..0348a1d6c6c735a1760f263aac96b7fb4d2130f4 GIT binary patch literal 1488 zcmZ`(OHUI~6h3Mtgpi2wg$av^=~9x`mIe|x1;m1Fsf8jM66nJseefz&AS{e&ku?4Q z7A{O6wl*lKVn~e(<1b*r;!fhir3+(RxNw2ucc%A3>tm9ybH8)G`R1H+Z^ukTJ)Le} z3z@MZ(x?T$&2$#OP1H#BWHKU`!81mN$a0d5{0Qz%h%Mk=eVqr%oFKXiGy`9b6YT=q zz#6a&xB&}L4}3g^9Iy-w1MNTy@C`oifTzGRFb1&q6BE%YFb9kQZlE1715Lm_-uW5W z1KtChz#70cO#>r<3$Ozk&lu;963=R)C<^=@Q9!*?f05s#M9}A< zuaeQe)HSdU2^5mkGuV?~mHJO{{FNxNIckJ?i7YZ#+d~mma62XP$-J3s&5BJui{{E) z?K)ebR@mjmOHqUz1TxCVXU_5a4(DQ2i*~p4EaC;Jkv*-5H*8eko{mNW-LBMK_|vOO z^<8SX@2W609#s0~lgkakzRbP9sPv|xlh=rDAx-U4TbZ4{g6Ze&860d`-=GoXOa`s1MI{+;!D|Lla7?)6X7Ad!|&};+?F1? zAL_OF74LIdI|ibj(L){@4o8x+LB-Qu@u+>N&7ydByubB&cW_4WKF9c+JLF6#eyz>! z>atGR6(99DdOayiT5(Uu==^+O;qZO8!`6X-B|NV3Q$x4fdb;8<#b>)0t?}SetKzOD zUu@9PnN<8rA|3RFd^W`+32(F`9SJBt-JkT%SQhRo9=(}#I2S`V6mN|uoKAb-j^dO4 zlxx`C3;#Of`&ows?*l$*#{GlbTaI}HZZ~fDj`HNyWir02od5clw!!dZC7)r|RQvn} D;NHf; literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/sk.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/sk.lproj/fbt_language_pack.bin index 1fbb2a586f4a48cc268bcede8f114107258a6c04..142a2bfdb28964a70973540b0d16a690b10831e7 100644 GIT binary patch delta 357 zcmdnOb%tw#PJIgl1A_z*uVG+Vfn!YISoF!>;(JmZ4N4;hsik4$D|l9zq*@Be?0d-#F4AU`Mn=)UYkg@XLN((FnG zhRKdh(xNi|Au8CwDu5D+3=9U73z_5@113*o5|_+?%5wtc^OK4bQ&RH|uLQDzb^&E) zKxMgrB2~GWsYe$kf~7Z1{>UWFcxEy$v$XUJBsB#^sRf7E<|Q8KWnfTY;FxU4EIHYM YnQgNda~>myZg!5Nqe*Dg0AOQRr~m)} delta 322 zcmX@ZwS{YfPJIId1A_z*PhnwT5CPH$fV2RRz5}F@fhdskg^7V-0}xLD;u0W^0Ad>; zRsiBZj0_A Date: Sun, 18 Jun 2023 05:00:07 -0700 Subject: [PATCH 236/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907902062758 Sandcastle Job Instance ID: 18014399485519691 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46827865 fbshipit-source-id: 03cf98f93fc2fb1329079a76da30248ac8d131fd --- .../I18n/strings/cs.lproj/fbt_language_pack.bin | Bin 0 -> 1368 bytes .../I18n/strings/he.lproj/fbt_language_pack.bin | Bin 0 -> 1444 bytes .../I18n/strings/id.lproj/fbt_language_pack.bin | Bin 0 -> 1300 bytes .../I18n/strings/nl.lproj/fbt_language_pack.bin | Bin 0 -> 1324 bytes .../strings/pt-PT.lproj/fbt_language_pack.bin | Bin 0 -> 1372 bytes .../I18n/strings/vi.lproj/fbt_language_pack.bin | Bin 0 -> 1352 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/react-native/React/I18n/strings/cs.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/he.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/id.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/nl.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/pt-PT.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/vi.lproj/fbt_language_pack.bin diff --git a/packages/react-native/React/I18n/strings/cs.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/cs.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..b8b20f9bf1fb84b7821744455aaf97d8b9c43617 GIT binary patch literal 1368 zcmaKsF-#Lt7{{Ml6|qJ%Y8X1)z$gio(!f|iELflxifBymU3sdNEFfhpG zppn6Dn$Wm7FrYDBn>aE!I65#e8Ak>c|L=GYo0xdX@4fH;ec$_D-}idgM+li1O{F8G z4;CRBiD2v{S1|UFFzF(pz;hjXEr<}Z9U?(|4|5NE3Q{aL{ zFbpE#-~=Jxzz*01HIN1|5C%U`<15$(o1g|B0#Un9>l&hsvf*1@?S~+RoISMwTp~uL2bXuP$@V-OXgfcj#X?o zT&g*m&CLoojWT?DGJXNJ%`M*kU{bAYuqre;JUaVjn8#}w)%|AP z&*Wvj$j~w7zrmiC0pGlgi++0kdvuyU68*8H|03)B!dcsor=1?p-7UeOem!{*B z)6RgW^z_J5wVJIR?{_a3oy!j7mQ|cD+#Q-2GfPTW##f^zt@kUPtfx!!@lo+N3x3}X z%cE&MJ*afvnkkHU`K;3RYR}#}ljiZKeB7E0Kt0?<>tRPI56diTY=d uAHsJxo(k6h3Mtgpi2wKVf(SgM-A@mL_ZzDi(Y#wNON3g8i{TfB36ZAPfu)4i2Dg zq_F}u1RjlpqXUC+a$s<~j0}#(I5@BnT^ z-iS16#{DW?#J!0csh(`oaszxxdWdXiN&4-0Ho>OjX}vCkJUW9I;P5ojKClaH0879q z&;hgn1ni$8`T)EDMu85X5%>=GCtwp;1RevdJ!ykJ-~(KM1~dYPsP_%{3hV*~kOvll zG%y5s0XxtP)C0dz{{Ywn7JeTcK?YM3i8Zk$3iAFIlvYjOdG?isAzq4-CfimT;Q16JQxZ>P^9Np|F+cL z66o6yuefJ2O#hV=`FT{>M#LKGRA|rI$0kyXVpW4w1$|3`+@IDuwLXp`nvSZo%XK|A z({XROHS^E@N3YKdz=Tes$NYlc|HXcRZ?_1rsa7DO4Zv|x?r5e%#y7At?!Zk8Z= zZ`#kXPDw0R*O(8@I(<2rQ-&Iw>Ag?E=G8TcG zUY82V(7;q?Y_gxVSTP>VI+Nq>tm0#_L6Rx+T_2I{XhPRZIGIr!{?l1tU7-IaapS_ literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/id.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/id.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..251ed4d6188bf4be18daa8fca3c7e2ee33b86a04 GIT binary patch literal 1300 zcmaKsKTs1v6vm$#8AMbH$DyFOg2Do35)(2qLty|hU=m_T5N%-ZPvYh7lH+n00z+Y8 zX<=bONnvS0VL@T#SWr+{SXx+ESUHwf;`c7QOdMytncwYx-|oHlc5m+{iD+rQP@bSk z^oTT?z1j}V0kipLMpj=_76cJR6d@#!MbOW=bt$bfM`;M)bF z6L17xgC5ubb3g+GzN7gJj==%g2U~z+f4xL>3XZ`W@CxjMXP^r1fhjN!65uCtegP-o z9XJGBTMw9k>zf0^zt7HiDOZ4L8+H^rqJ_RT;OipL>UJ0f@b60hI{LoVY6#fcj&Q;V zb;z+1jwR|L9t(v|9R{VSGoapt5yu%~i|2q&L2{O?M{Uk9)I8j$Oh8F6mlH7nI^&-T|i z3Tw06NjF6L6FEa*9$o_@ajGnxECs-01KvzT2jc9LDCi?f?iRO_ARdt#*4YDuG^ z#@p+UXOJOEkcHCSpQ+uj(tJ2AD6qXTx2>X}79p5tG-vhTF>3VQdV2k5XNthK??o6#ixI zYbJBh&Is=|`i9nVy`;&!q(>#mpbA!NiTG7MXXp|`czkc$XO1hcQ=J*X-n$}p4Kc-` zRMRcHi~j3~@5+vCh=)29{w<7A9h-HNI_nLXV_QmxxyY-C-$dNEZO2oorMkn(r;#<0 zfnG}Un2B-mv-9(Fe{_D~^Sp5%4Ve)hKZ|Uel4em)V?N~xYlv7J{XV7qoV~tgsgR^A zVmy};8))3z5#Dw5dzv?@$iDD-4pqi$rI5G6ki7kxb!> z;MM-$6$`$a(K~~B$-|R&7^d;roqA)#)VeEt6|R+R~JH^^;i4S zVzwUYrBY^grCnJYX{jYErb9#R&+F~nU^*S@qQ0DZSfm@FUdpRpSt=NzelVRY&1dXf zsMjj_#fqEuLtU9&>-CzOqy3)BnU!W*4(h|7-(Gz(y)dtL!tqXVE2GmvD%7Pxt<%WQ z@mD4|?|s9kHK~>jwPIA;v%b;{b$8jUZlpJPx`OfT$7a5;B|QptN;e9HT=Q9|t-4!k zl^3!86^xJJPH-m#zl@;$AZp3IYO`EMgMU=Cj)p%J|?=(Uy*|l Af&c&j literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/pt-PT.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/pt-PT.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..5c514d2e0738019defe238688c29b344e4da80c1 GIT binary patch literal 1372 zcmaKszf%)I6vtPMhz!o)&#_36f`US35)(2qV?h8hU=m^=h&EyGN5Un!+;Mk_A!A8F zL1|%O;f#fiMGEaK7_p$Rps=v8u%vJt{s0xfZ`lo*amJhZ-0klql-Z$AbyhqqD8)PA2xdpu?JdAw^G2uVNcLcW3dA$0b8)%Q5V{HE{V_onZ zJOgVW4WeKW9Gzk80Cd3)SO-%e3_{=#adyEg&<1OOVvo`M0I9JbnCC0_1iIiQ*aiVu z0~v4!i~`E(7v?<#U%)PS3toUNu>bq`n8IEFWm8}0hQq!|8`VSOp2s7G87Z4+*k&W( zKFo~$IT<&MW?LJ{n)Q{6LKNO_zJr!xZDEWS@)Z({rJ{D(zHWyJ>I= zSeLe|XlqWe_u8R^JSX6LZy?x?^j{~x%GWUcx}%GX9oW0F&t8JHtSa8H}BB(|ak_{i9)Z)_V*q(Dt`l!aL|6OULe06TMMSXO~ z)~tqH5%y8`p*rxEMJcdA+GwvFz3I|kZA%-~(QLcCVOX%@{Pc~tu?J*(Cv8J$qdYeE zbPB;f_r+Dl@6tx~I<2`V7%Gmlg}>zgPe}Y-v~D`Ty>+%s&njEGS|~-S7M3?`%Uz;) zq>a2EuQrn6oRGHkl|-_Tn^XRHYvrjnA1^4qkd93*m9wRu)>d`H_PElmnOZr~nTRSq zTU#8zKg&0iUPxAgjFze^eQzR>o{2dLrAyi5eAbV)l+I3;n$2RnH{WADwp5Jj73FtU z9!<>6)T&B*vzxIR?~E&*?&Pb>$!S~Z+w~UDYx%g+Mm<-aY#BwR-9G4`Ul}Z$!DBURd>DA0U;tzc591|QsM{red@x#M8} S`A^>=5tGKyIieW-asC4LH6rr> literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/vi.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/vi.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..860517fe17a3fbc04f7f5a8fa3b5e5fb612f2d51 GIT binary patch literal 1352 zcmaKsKTH!*9LJwp4I*k|&@eE(p@Rb?t&~PK3y1~VQVT^iCUAG9z5coDziXw$fdmEz z9Y`EB!6-oz22C_FXlo+z7#tlK92~rjffxq|2Nl2X`d-t-#3rA6@B90`-|xNO@Ab|_ z2pJg+M!Ja$GeRio#VUiOAqw2?IC2-L2UmnMkj3FF}D8BLHs&Q$UE>9 zEP^<=1kQsFuz!ecEL7y4jzJKkOyCW9~`jMr@+pNxlRqWOp{jqzD~$b?ql^Ds-&w_ zF}L(2Rjm33Or+~iBlZO5s#SZd(`3r3KPGN&XF206tYoe!Dm5e-=i@#cjWEM4uG^p$ zwOqC8OV}AcZaZq^K1C`(n$?{RwvThlmG*{VOXV>Y>uomW@Q*BZ4Wi&8w5gNc0P z{xi*3BW2az>vU%YDbS~ucnviw)F|dquQsQbS$x|;qu%yre8WSzo%KW*3*vu`O zwd$`Vs;G8jBizUOrdYLgbVxSWazy3!qp-_X?FB394!5zI?EAsNp3ovIISCV4ZON5E zF$TpR>v^)p?I*D&qc*Osu{$B3T4L;+{9Jq7&gyIJoC|Nn|9=kqO=9(*1*n&GbO}#$ z4aLQ++6HSN%aV>x7PM4;0#jSZBc;By?kfqMQl`AVXm~{EzRJ{Xd9*Jo^jN?%Fp&t& zG_^df#I>R%bY&=$@GkVbg&xj~_g)#63PO+hl15PWXNA7p?+pxja$cclLcY;Z$z2gT zG%!;x$L5>+-B3IeF}Gs(p4F3^y52uBlu3*A#o?+aBQ5j_9axB@Cw+sO&=;~5DI!Pu zgpOy!iGfNyCUkyW3m4q;b3!MsX+D2dzAAKYChPZmV>gA?qou%fa1{BE+25^WaIky8 p=foaA@H=I;a4Zu literal 0 HcmV?d00001 From 692458c72ce4ae78997e4bf40b5a6976a3ca292b Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sun, 18 Jun 2023 06:43:34 -0700 Subject: [PATCH 237/468] translation auto-update for i18n/pages-manager.config.json on master Summary: Chronos Job Instance ID: 1125907902027871 Sandcastle Job Instance ID: 27021598738469361 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46828649 fbshipit-source-id: 612bf012bea257dec10d7cca83069d7c267b420b --- .../src/main/res/views/uimanager/values-cs/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-in/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-pt-rPT/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-te/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-vi/strings.xml | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml index b556b85f3bc390..7498fae942c3aa 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml @@ -3,4 +3,8 @@ + zaneprázdněno + rozbaleno + sbaleno + oboje diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml index 6d32bd7238156f..7e3350ce987f11 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml @@ -3,4 +3,8 @@ + sibuk + diperluas + diciutkan + campuran diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml index a0d4564f7f0932..5a1f664c4c3173 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml @@ -3,4 +3,8 @@ + ocupado + expandido + fechado + misto diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml index 241b213130fe0a..442c4b4544b6b4 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml @@ -3,4 +3,8 @@ + బిజీగా ఉన్నారు + విస్తరింపబడింది + కుదించబడింది + మిక్స్డ్ diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml index 706622a3be9832..6f6cfc761c25fe 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml @@ -3,4 +3,8 @@ + bận + đã mở rộng + đã thu gọn + kết hợp From 1231ab6472e90bf70cbb8d979fbe7d0a954bddcd Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sun, 18 Jun 2023 06:43:34 -0700 Subject: [PATCH 238/468] translation auto-update for i18n/adsmanager.config.json on master Summary: Chronos Job Instance ID: 1125907902027871 Sandcastle Job Instance ID: 27021598738469361 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46828645 fbshipit-source-id: 1b21b2d39dd81e00b1f572732d4849e3333910fc --- .../src/main/res/views/uimanager/values-iw/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml index dcca08e175b5d0..c87b7ee2815a27 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml @@ -3,4 +3,8 @@ + תפוס + מורחב + מצומצם + משולב From 27fb8b2bcacf6c51d5ba937ca25d3ca5e8688d4a Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sun, 18 Jun 2023 06:43:34 -0700 Subject: [PATCH 239/468] translation auto-update for i18n/barcelona.config.json on master Summary: Chronos Job Instance ID: 1125907902027871 Sandcastle Job Instance ID: 27021598738469361 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46828650 fbshipit-source-id: 70fd9f800fca23d727f6246d6ff659d2e8e0da51 --- .../src/main/res/views/uimanager/values-sr/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml index 47782d7cf1000e..ff74fb4c84c2a9 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml @@ -3,4 +3,7 @@ + проширено + скупљено + мешано From d052d5f7808a07b74634e89611a46f5d33f8cf30 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sun, 18 Jun 2023 06:43:34 -0700 Subject: [PATCH 240/468] translation auto-update for i18n/talk.config.json on master Summary: Chronos Job Instance ID: 1125907902027871 Sandcastle Job Instance ID: 27021598738469361 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46828652 fbshipit-source-id: ec58fe8ebdad312609743f1674f308f18ce33891 --- .../src/main/res/views/uimanager/values-nl/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml index 75355cf16bd979..931367c9ed5542 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml @@ -3,4 +3,8 @@ + bezig + uitgevouwen + samengevouwen + gemengd From 564a83681c5c81aa348ee43d06c15790d5df1dca Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sun, 18 Jun 2023 11:55:33 -0700 Subject: [PATCH 241/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907902391870 Sandcastle Job Instance ID: 4503600603166431 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46830005 fbshipit-source-id: acd3c21501ec9a763c0ba0e3c0a185a25d9f3afd --- .../I18n/strings/el.lproj/fbt_language_pack.bin | Bin 0 -> 1592 bytes .../I18n/strings/tr.lproj/fbt_language_pack.bin | Bin 0 -> 1360 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/react-native/React/I18n/strings/el.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/tr.lproj/fbt_language_pack.bin diff --git a/packages/react-native/React/I18n/strings/el.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/el.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..c573452c46c18886b3bb1d1b5093f8feaced3c1e GIT binary patch literal 1592 zcmaJ>OHWf#5FWJ>LWp5Od_;^*WZ?oLNNGaChKE?NKrIx}m;j}g&YNP=7cN-1B*ujc7b<>pdJkM;Vw11;erLWjGiPS*DJ7z&dbg*9 zO7TWyrxN_%q+cOB%%6{1xj4!D6bzy=&$ zCRzjHz)QdZi<~IA=$HsY?5J|h( z6G=IX*L5r=%^MVg){ES732fG*oCh6Pp%d!cLV2I6FZ!H3Vzej87R;@)S=d@v-(4MIqEXD zAt?%2bgB*pLM?JRg<*Smi)PEz6tL!eD;=8aTnnVhRYJ{?u3=X# z&x#$CCyAwuiuKdfa}SX~TBSOJqiv!DC*;#z+Xx(pwXB$Jz+!TSD`(q1uXf5hrnF^^qZ@KjLPw@X z<-Nx(;EBgvSUadDf^a+JbNK)KZ0ZK#@5h``_~WcGt!aEWSPywSN27xy9qfd8z%yPI z8ghyW9qZFP)({RlrmHJ7Zw$AW zKW^+B)x5~TYj#tDqZ>{N>ob<)d;yv%L?C@3e4`};v z*R$%ThHyypvBs&&aNl&f=B{Z^sMA>=)%;;3*5~nisx%Ko+JZH)fKT(0_GsH^Mf{cK z!KYDY-IV`{=H=l?U7f@CLh~W-xU1XU4F7rRp3Z}T>yK+wJwKWK<+V1S+l>eAYil2E W>i%Z?w|}$+$|vvPZ-_NkKYszNOdY=f literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/tr.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/tr.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..c5d872a32f7777fc7c1adcfbaf0e9b2c6718f644 GIT binary patch literal 1360 zcmaKs%}*0S7{*7fO7N>1H5_{Afg>cXlm>1V5DRWgEfmq1z_h!q?apptw_9oB!2<^m z9{3N+fdmg8Y+{H94#qA?5B>=pIB?)(Jb2)u_{=f`t0r#p+nMKmX5QKP*y$&POpYm; z5a~yakT411-A8WY9VAyt4+(gY0q8Z)A>>1Vc>W&BAYw--{m)&9-~~dyo+sozcmo(v zKn#Qc0f*-Z>4JA)4Lk=UAPA1oWFLG68{joq0z7vJ@wi(4S@&?s!b}kFiZ(Y!}5tl@auZf}Uwn`2oH4(dkSV=R>yDg^G%FIB8tpAytZ=l=Oan3}XpINk{mR4h$ zX=q+2#Ja-g`|tC4N^;;E@2~a4pVNaL|9b-7-^I_?6;L&4!<(+{cs(oGxfP?lJj*li zOlrm+s+e(G>T+Q|7SE<9r5>u!zsye!Wu=}@Mn`9hsl`*BUnr=CMWwEf>%~}eI3o3g zJ~Q}mg04tC9WT|Ce1b{+U^tc>k5*$+FQ(#CDLYb^IyJiJIJwo+@tzin3A zli|s6y&|epWL1;8_}GXi z8u>?359%zDh~=J1ZD#G{f-;5tm%RInpC!KbxK_OKi`YvZOXm~?1@1Bb9tOO7jr-sJ RY1`}N Date: Sun, 18 Jun 2023 16:56:26 -0700 Subject: [PATCH 242/468] translation auto-update for i18n/anna.config.json on master Summary: Chronos Job Instance ID: 1125907902394694 Sandcastle Job Instance ID: 27021598738649603 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46831139 fbshipit-source-id: 81a7d7b6ad5decfb951fb486b8af68c5d011bb86 --- .../src/main/res/views/uimanager/values-gu/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-tr/strings.xml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml index 2a2946b617eb63..a20ac06e9e7291 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml @@ -3,4 +3,8 @@ + વ્યસ્ત + વિસ્તૃત + નાનું + મિક્સ કરેલ diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml index 755cf862c5eb9e..8668849f5e6c8a 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml @@ -3,4 +3,8 @@ + meşgul + genişletilmiş + daraltılmış + karışık From 53b721e578ae75e344798dfee26141dbba90de84 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sun, 18 Jun 2023 16:56:26 -0700 Subject: [PATCH 243/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907902394694 Sandcastle Job Instance ID: 27021598738649603 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46831143 fbshipit-source-id: f9c0bf1b4d30a4165a72d877fdd4eb6ebe88a094 --- .../src/main/res/views/uimanager/values-el/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-ur/strings.xml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml index 0604fa12ac1e99..80c7d1d78ffbc7 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml @@ -3,4 +3,8 @@ + απασχολημένος/η + διευρυμένο + συμπτυγμένο + μεικτά diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml index 6d76f390ea068a..dde996b6b1a016 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml @@ -3,4 +3,8 @@ + مصروف + توسیع کیا گیا + سکیڑا گیا + امتزاج From 7725ea60e38d2409892b321474cf1869c6c439ee Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sun, 18 Jun 2023 16:56:26 -0700 Subject: [PATCH 244/468] translation auto-update for i18n/creatorstudio.config.json on master Summary: Chronos Job Instance ID: 1125907902394694 Sandcastle Job Instance ID: 27021598738649603 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46831130 fbshipit-source-id: 69d04cbb97d4df569b385ea988a6d11e4a59e8ae --- .../src/main/res/views/uimanager/values-ro/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml index 445f1af124553e..8339b5612596e9 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml @@ -3,4 +3,8 @@ + ocupat + extins + restrâns + mixt From b2264b98d9cd7b7aaa378654ddb4f106c09c5c45 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sun, 18 Jun 2023 16:56:26 -0700 Subject: [PATCH 245/468] translation auto-update for i18n/pages-manager.config.json on master Summary: Chronos Job Instance ID: 1125907902394694 Sandcastle Job Instance ID: 27021598738649603 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46831131 fbshipit-source-id: 64464af3f09569f990b30ed20248bcf08f27ac76 --- .../src/main/res/views/uimanager/values-zh-rCN/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml index c50c06c1a71bf2..23776fa20f774e 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml @@ -3,4 +3,8 @@ + 忙碌中 + 已展开 + 已收起 + 混合 From a2f69158b5af25d98c2b064de2d36595c941010b Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sun, 18 Jun 2023 16:56:26 -0700 Subject: [PATCH 246/468] translation auto-update for i18n/barcelona.config.json on master Summary: Chronos Job Instance ID: 1125907902394694 Sandcastle Job Instance ID: 27021598738649603 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46831128 fbshipit-source-id: 3c9139c13c1ace5a5a353caf1d15cdc2c7d10fe8 --- .../src/main/res/views/uimanager/values-fr-rCA/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml index d5fe3fb4a959d0..3c614c4ff83792 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml @@ -3,4 +3,8 @@ + en cours de traitement + agrandi + réduit + à double état From 92199a727c3cb9bf1e5ea5751e5222ac03afebcc Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Sun, 18 Jun 2023 21:27:06 -0700 Subject: [PATCH 247/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907902463243 Sandcastle Job Instance ID: 36028797995197700 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46832154 fbshipit-source-id: 82223c908ab80deb521ee3d29c4081d56591c072 --- .../strings/es-ES.lproj/fbt_language_pack.bin | Bin 428 -> 1368 bytes .../strings/it.lproj/fbt_language_pack.bin | Bin 420 -> 1388 bytes .../strings/ro.lproj/fbt_language_pack.bin | Bin 0 -> 1340 bytes .../strings/sv.lproj/fbt_language_pack.bin | Bin 0 -> 1012 bytes .../zh-Hans.lproj/fbt_language_pack.bin | Bin 288 -> 1296 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/react-native/React/I18n/strings/ro.lproj/fbt_language_pack.bin create mode 100644 packages/react-native/React/I18n/strings/sv.lproj/fbt_language_pack.bin diff --git a/packages/react-native/React/I18n/strings/es-ES.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/es-ES.lproj/fbt_language_pack.bin index 0b9570e4652a01dbc75e7f22ed134f6ee8fb1f08..49767974f575a8472434948a7f64e1c52cf66e73 100644 GIT binary patch literal 1368 zcmaKsy-yQi9LFEEA|XW4;9Jt6Lq|zkdo+@;6c7uxr51{4NZ`4b)@$#L=dKkR1_uU4 z2M0$61_vFC4#YSR>)^=X;2*%iXky|epS$1p_jb?yp1VsDLZ&AQhnu+B{pyUAm6ox0(B7VSh!b;*v%xs9AUYk4j&M$L@TfyjlLcISZdggGQaxEg56fyqV$ozZ4$JeE`sLsM} zfw7LZnu}+5Fipf(MP46lY8fn`n78opIk{TPG5v}MKImcL%1Hnl}1TPaOTooO#VS7$O6sb}-)vH4nYe`Z}7kXUYN cRdNnQi~+>Y3JNLA%`6C>T*6{B`58+Q00Xol0{{R3 diff --git a/packages/react-native/React/I18n/strings/it.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/it.lproj/fbt_language_pack.bin index 14d040462596087991a81e03d54fe8c38a6551eb..616f8c3cfe57da594a84433bbb8dc3e138d1f858 100644 GIT binary patch literal 1388 zcmaKszfV(96vwYxl@MYuqSl1rC3b|^+R{kkQa~)&mRcyHF@gJjwBGjp;{CF8W^iz1 zaByIB@DE^MFvh{b!NI}7fq}t+I5{w&_`R?9Hcd3X()_$r#?FWP}WnL~NOW-i|$ld`ghme~fVywz2bg4LsK{PoE>?=qw>0!7g|K zT(AP}f+Qf|;0z)AUD6cne;EZQz2Z zpa^n60VCiTbq~R3un*pV9X|d#Jw-}#0cg)y=sWNW+f~?9>UmVrji$*IKk!1!umcAB zfr#P95HQQ|F#Z&_5zI~I2Uy3HfU1yW^mnfgS|Qw|2z>+E4NafgfuYbKU=h8gGru>3 zuPEYf4#puZvo+7)%{YpK_M{*k5zp^Z^p3_g$Meu6qG2YlMGWt=>4mQAC?3^W?A!a- zdKyu?OZ)4;iI~e+ZnNj%r}FQS}>))H*f4H*-uAOm#5dmu-@s{d#q)a>uIei{m$y6 zsrlJr%T*R%J8YF{ExhwDN^5 z^?}rrZL?6w)t^Xh*ZksIX#x2!VE>8uTj%GFUk(%@@5Mdxd8J+|VZc9b@ct6uCg1=7 delta 186 zcmaFEwS;+sPQ48S1A_z*voJC+hyZB=AT0o-eSkDFU;%PEfY=9!4S*P|2T1P#;w3;l z0f=jW_`v`F|3PZmfH*lLv$Qy$f#C{Ni~}f^pPXD;kXQl~Wng&o|34pGabiJgQOV>) hW_<}(pj2*VF<1>qOIA=wVQywY@Z=5_qshNmiU3zGB<}zK diff --git a/packages/react-native/React/I18n/strings/ro.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/ro.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..41afd9c105a3d8a76b280b8a59bd75eae2392d1e GIT binary patch literal 1340 zcmaKsJxo(k6vwanRK$Rq=n`ySHg#;!A$--Sa=^o_p@Ow@os}=4XnPQI^Dr zF`13xJ;LtbonSZE5R)Qh4EA2+VeE~>BL5M-31}zy4nFr_{JO~4d+-|UfOSv-lRyRx zoL*q;2poVNunMvu0nQL|3_gJaunnFA$~}bj&Mqs!ainEi=$>WQj&hr6 zyOYGP;Qx;l{d#Ckx+7vgXtQrvh8D!f5M^mqYa6!NS*CoHRj>G&mXnKmOtz`5WOLQ> zyzpnbD=*ZAOjX#6h4j>NqqNqy)m2TmJw@2v*>)qlHIWkbTzhH!;heG|?8RI&D5`n7 zHqrVICbEUuw3`+7S}C_s@>5-5m!{Uju-@yh_f$(S*Hc#qrl@lkoP@Eu52hdlFF+mK0~wG6zme|@@R}dN5qSG&K2IReHDDW#VGn(k z^B)QS7W$SEglc+r91Z=nZW*TP6MYeJp35E@`YyaB^rP9~uB8(F6y8mEz8k8c;W~lo zsGf&C&Cl1q!Lea5wh-25hgJx^CSoh-+e2sKYNMfvz z)3r6jIbYr%hu9g>8xdbdf9!dox-)dxe<%E_?1!^s6BYTe;AxiX4B&lTm~X4TDN09Y z!sorCnuaUBH-nS%|0fZjF!?`Be-Z>@vpjRu>b$fKugy7F=cBDxS}os_`k|65xAjKv zLTlUof$hiN%HyM|sTcN&Ss8y&EGX5STadcfDAgK4Hj=tg?v2OY-HUur`?+>E+uxCK zck4-UqiT+%R`!~sPHEki`mPnJO|6-idSGqp literal 0 HcmV?d00001 diff --git a/packages/react-native/React/I18n/strings/zh-Hans.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/zh-Hans.lproj/fbt_language_pack.bin index a270ec17dbb1ca74ac3969901a4e3f1b5defb40c..2682682103b19f536e61ca2fc55fac56fde7c745 100644 GIT binary patch literal 1296 zcmaKs%}*0S7{*6!NF^k4AjSg+4jed0(%RBM!lh8LU|ZHg5seA-!xH)dg+c}5fdgQX zHV`5~v?i3OAx4Q3q(xK`Md&GIgpi1aDB~%#Gx zMo_K^COIB=7+Xr~z8=3pKuhE$|TB1-*dP{&9woFJKF-f&>@?J|KZcPy;Fe z0Y{kgJNOJfGz0IIs^^gCIPG{uRdHD5$pW8^w z%iDBi9loUc=g`kj&gRoQG?|vO(=@q6LPAb)3~^JcUxGf3-;d3o~=>2v1NgDpX>a)2qAEqee9PUn$oRE{-draRwFXWKpzw6G;r&wBg z2l*FH_=R=rRGa%Yteiulbd@XDK^JtWRNAYYt zO|tK*tdC^|oSj4A{zwNaz_d?_8Uh2RDA)boE~ClmXyMur>$>AaouL>8?kxJA+9gi8LiFwK_k~ac2lc8s*7=L zZ|E5vb&VD0yW!P$xOCn=K0erWy{@G>7~p!?GOiE0Cu+I2PDp`HQ&X7hOQD!s@<;}* zeIbXxA?9;&9cd3chIC`Mx%OWRo6O^$t6bLxLuRwlb(8A>XVltlYeoGM<^EykjD34t n3rhP*-Am> Date: Sun, 18 Jun 2023 23:22:12 -0700 Subject: [PATCH 248/468] Update ktfmt component on FBS:master (#37950) Differential Revision: D46802820 fbshipit-source-id: a2737658576bf86f431a7b355d853a529f6a2c34 --- .../facebook/react/common/mapbuffer/ReadableMapBuffer.kt | 1 + .../facebook/react/common/mapbuffer/WritableMapBuffer.kt | 6 ++++++ .../com/facebook/react/defaults/DefaultJSIModulePackage.kt | 1 + .../java/com/facebook/react/ReactActivityDelegateTest.kt | 4 ++++ .../app/src/main/java/com/helloworld/MainApplication.kt | 3 +++ 5 files changed, 15 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt index ccfc730773427b..329f8701f5f8b2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt @@ -262,6 +262,7 @@ class ReadableMapBuffer : MapBuffer { override val key: Int get() = readUnsignedShort(bucketOffset).toInt() + override val type: MapBuffer.DataType get() = MapBuffer.DataType.values()[readUnsignedShort(bucketOffset + TYPE_OFFSET).toInt()] diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt index 8a6a7a9b9bb6a7..c3f161b518e53b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt @@ -136,7 +136,9 @@ class WritableMapBuffer : MapBuffer { override fun iterator(): Iterator = object : Iterator { var count = 0 + override fun hasNext(): Boolean = count < values.size() + override fun next(): MapBuffer.Entry = MapBufferEntry(count++) } @@ -145,12 +147,16 @@ class WritableMapBuffer : MapBuffer { override val type: DataType = values.valueAt(index).dataType(key) override val booleanValue: Boolean get() = verifyValue(key, values.valueAt(index)) + override val intValue: Int get() = verifyValue(key, values.valueAt(index)) + override val doubleValue: Double get() = verifyValue(key, values.valueAt(index)) + override val stringValue: String get() = verifyValue(key, values.valueAt(index)) + override val mapBufferValue: MapBuffer get() = verifyValue(key, values.valueAt(index)) } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultJSIModulePackage.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultJSIModulePackage.kt index de55e4bd0507f4..f1328997c849ea 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultJSIModulePackage.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultJSIModulePackage.kt @@ -40,6 +40,7 @@ class DefaultJSIModulePackage(private val reactNativeHost: ReactNativeHost) : JS private val reactNativeHost: ReactNativeHost ) : JSIModuleSpec { override fun getJSIModuleType(): JSIModuleType = JSIModuleType.UIManager + override fun getJSIModuleProvider(): JSIModuleProvider { val componentFactory = ComponentFactory() diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/ReactActivityDelegateTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/ReactActivityDelegateTest.kt index 2912a9c193645b..c2f8efbc2f4584 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/ReactActivityDelegateTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/ReactActivityDelegateTest.kt @@ -24,6 +24,7 @@ class ReactActivityDelegateTest { val delegate = object : ReactActivityDelegate(nullDelegate, "test-delegate") { override fun isFabricEnabled() = true + public val inspectLaunchOptions: Bundle? get() = composeLaunchOptions() } @@ -38,6 +39,7 @@ class ReactActivityDelegateTest { val delegate = object : ReactActivityDelegate(nullDelegate, "test-delegate") { override fun isFabricEnabled() = false + public val inspectLaunchOptions: Bundle? get() = composeLaunchOptions() } @@ -50,8 +52,10 @@ class ReactActivityDelegateTest { val delegate = object : ReactActivityDelegate(nullDelegate, "test-delegate") { override fun isFabricEnabled() = true + override fun getLaunchOptions(): Bundle = Bundle().apply { putString("test-property", "test-value") } + public val inspectLaunchOptions: Bundle? get() = composeLaunchOptions() } diff --git a/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt b/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt index 6ca847e0e0bd5a..f1c5e490fca860 100644 --- a/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt +++ b/packages/react-native/template/android/app/src/main/java/com/helloworld/MainApplication.kt @@ -18,8 +18,11 @@ class MainApplication : Application(), ReactApplication { // packages.add(new MyReactNativePackage()); return PackageList(this).packages } + override fun getJSMainModuleName(): String = "index" + override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG + override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED } From 0f39f3dd0137e58ddbce00fc04df945209602b05 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 02:56:48 -0700 Subject: [PATCH 249/468] translation auto-update for i18n/oculus-mirage.config.json on master Summary: Chronos Job Instance ID: 1125907902554121 Sandcastle Job Instance ID: 36028797995243282 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46836680 fbshipit-source-id: a611209750ab3e4fe80981647e35c5e6eff1ce19 --- .../res/views/uimanager/values-sv/strings.xml | 4 ++++ .../views/uimanager/values-zh-rCN/strings.xml | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml index 2eed9288127946..dcd33103a931e3 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml @@ -3,4 +3,8 @@ + upptagen + utökad + minimerad + blandad diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml index 23776fa20f774e..9326438143a1e9 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rCN/strings.xml @@ -3,8 +3,29 @@ + 链接 + 图片 + 按钮,图片 + 标题 + 提醒 + 组合框 + 菜单 + 菜单栏 + 菜单项目 + 进度条 + 单选组 + 滚动条 + 旋转按钮 + 选项卡 + 选项卡列表 + 倒计时 + 工具栏 + 摘要 忙碌中 已展开 已收起 + 未选中 + + 混合 From 4ad086a01de76c834069217284c40025dba45e3d Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 02:56:48 -0700 Subject: [PATCH 250/468] translation auto-update for i18n/talk.config.json on master Summary: Chronos Job Instance ID: 1125907902554121 Sandcastle Job Instance ID: 36028797995243282 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46836666 fbshipit-source-id: ea301c6a87bb99ed86aa14990a8a8e213f7484c3 --- .../res/views/uimanager/values-bn/strings.xml | 4 ++++ .../res/views/uimanager/values-ms/strings.xml | 19 +++++++++++++++++ .../res/views/uimanager/values-te/strings.xml | 21 +++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bn/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bn/strings.xml index b5d516623ef92f..a2cde5a8c2f6d5 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bn/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bn/strings.xml @@ -3,4 +3,8 @@ + ব্যস্ত + বাড়ানো হয়েছে + সংকোচন করা হয়েছে + মিশ্র diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml index c23bb0fa836417..c1091f8d92ff8d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ms/strings.xml @@ -3,8 +3,27 @@ + Pautan + Imej + Butang, Imej + Tajuk + Isyarat + Kotak Kombo + Bar Menu + Item Menu + Bar Kemajuan + Kumpulan Radio + Bar Tatal + Butang Putaran + Senarai Tab + Pemasa + Bar Alat + Ringkasan sibuk dikembangkan diruntuhkan + dinyahpilih + dihidupkan + dimatikan campuran diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml index 442c4b4544b6b4..f08a251c185554 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-te/strings.xml @@ -3,8 +3,29 @@ + లింక్ + చిత్రం + బటన్, చిత్రం + శీర్షిక + హెచ్చరిక + కాంబో బాక్స్ + మెను + మెను బార్ + మెను ఐటమ్ + ప్రోగ్రెస్ బార్ + రేడియో గ్రూప్ + స్క్రోల్ బార్ + స్పిన్ బటన్ + ట్యాబ్ + ట్యాబ్ జాబితా + టైమర్ + టూల్ బార్ + సమ్మరీ బిజీగా ఉన్నారు విస్తరింపబడింది కుదించబడింది + ఎంపిక తీసివేసారు + ఆన్ చేయి + ఆఫ్ చేయి మిక్స్డ్ From 6edceb9155babfe8e122906f7229406f5c1ca428 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 02:56:48 -0700 Subject: [PATCH 251/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907902554121 Sandcastle Job Instance ID: 36028797995243282 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46836672 fbshipit-source-id: 4032fe32e9da5c2a1c57e6308a695db01c7c346c --- .../res/views/uimanager/values-km/strings.xml | 1 + .../res/views/uimanager/values-mr/strings.xml | 21 +++++++++++++++++++ .../res/views/uimanager/values-my/strings.xml | 9 ++++++++ .../res/views/uimanager/values-si/strings.xml | 9 ++++++++ .../res/views/uimanager/values-sq/strings.xml | 1 + 5 files changed, 41 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml index d6ed5fadf8cf0f..7d8b08c43aa174 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml @@ -3,4 +3,5 @@ + បិទ diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml index ad239221c0e924..fe3b5c4a6e926c 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml @@ -3,4 +3,25 @@ + लिंक + प्रतिमा + बटण, प्रतिमा + मथळा + अलर्ट + कॉम्बो बॉक्स + मेनू + मेनू बार + मेनू आयटम + प्रगती बार + रेडिओ ग्रुप + बार स्क्रोल करा + बटण स्पिन करा + टॅब + टॅब लिस्ट + टायमर + टूल बार + सारांश + निवड रद्द केलेले + चालू + बंद diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml index 65abfdbf7bd192..6add1f51dddc29 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml @@ -3,4 +3,13 @@ + ခလုတ်၊ ဓာတ်ပုံ + သတိပေးချက် + မီနူးတွဲအကွက် + ပြီးစီးမှုပြ ဘားတန်း + ရေဒီယိုအုပ်စု + လှည့်ရန် ခလုတ် + အချိန်တိုင်းစက် + ခေါက်သိမ်းထားပါတယ် + ပိတ် diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml index 2153d88a0669fb..08fdba8c54dc85 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml @@ -3,4 +3,13 @@ + ‍බොත්තම, රූපය + ඇඟවීම + සංයුක්ත පෙට්ටිය + ප්‍රගති තීරුව + ගුවන්විදුලි සමූහය + වේගයෙන් කරකවන බොත්තම + කාල ගණකය + හකුළන ලදී + අක්‍රියයි diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml index a225539656b409..327e8a80b2f802 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml @@ -3,4 +3,5 @@ + Buton, imazh From 11010b5c74f91c828305e073cccb5729e47fc921 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 02:56:48 -0700 Subject: [PATCH 252/468] translation auto-update for i18n/creatorstudio.config.json on master Summary: Chronos Job Instance ID: 1125907902554121 Sandcastle Job Instance ID: 36028797995243282 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46836669 fbshipit-source-id: bd670de9fe71b4eaa354fd6d3d32aa7b84513014 --- .../res/views/uimanager/values-ko/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml index 9332377e9ad30d..7370e6d18ac660 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ko/strings.xml @@ -3,8 +3,29 @@ + 링크 + 이미지 + 버튼, 이미지 + 제목 + 알림 + 콤보 상자 + 메뉴 + 메뉴 표시줄 + 메뉴 항목 + 진행률 표시줄 + 라디오 그룹 + 스크롤 바 + 회전 버튼 + + 탭 리스트 + 타이머 + 도구 표시줄 + 요약 처리 중 확대됨 숨겨짐 + 선택되지 않음 + 설정 + 해제 혼합 From c8c9f04e11e9df2216182d8f5f0e292986d58fe8 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 02:56:48 -0700 Subject: [PATCH 253/468] translation auto-update for i18n/messenger.config.json on master Summary: Chronos Job Instance ID: 1125907902554121 Sandcastle Job Instance ID: 36028797995243282 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46836676 fbshipit-source-id: 4d737023ab0d699ac119d7228469c2ca8d496c7c --- .../src/main/res/views/uimanager/values-kn/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml index b4a93b39ff0be2..eb9df77099b6ee 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml @@ -3,4 +3,7 @@ + ಕಾರ್ಯನಿರತ + ವಿಸ್ತರಿಸಲಾಗಿದೆ + ಮುಚ್ಚಿದೆ From a528902663135b335e69cd1a1d296e820404ce94 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 02:56:48 -0700 Subject: [PATCH 254/468] translation auto-update for i18n/barcelona.config.json on master Summary: Chronos Job Instance ID: 1125907902554121 Sandcastle Job Instance ID: 36028797995243282 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46836681 fbshipit-source-id: 8a75c554969e294b391b65a11ca7e4ee3b02e6ce --- .../res/views/uimanager/values-ja/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml index 72304da6c40ea5..871ca3b04aa55f 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ja/strings.xml @@ -3,8 +3,29 @@ + リンク + 画像 + ボタン、画像 + 見出し + アラート + コンボボックス + メニュー + メニューバー + メニューアイテム + 進行状況バー + ラジオグループ + スクロールバー + スピンボタン + タブ + タブリスト + タイマー + ツールバー + 概要 作業中 展開中 縮小中 + 未選択 + オン + オフ 混合 From 109a8a02297b3bd057cffadb4ac1ffcfca9b5004 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 05:16:00 -0700 Subject: [PATCH 255/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907902661436 Sandcastle Job Instance ID: 9007200228784914 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46838811 fbshipit-source-id: 0f93a1cd777250ced2009781f4e055c13e4045a4 --- .../strings/sv.lproj/fbt_language_pack.bin | Bin 1012 -> 1300 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/react-native/React/I18n/strings/sv.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/sv.lproj/fbt_language_pack.bin index 1487621925d27e70c93d6cdf05f780d2803b3311..eb84af0fb6b22c1e0726c203f55d88ef19697793 100644 GIT binary patch delta 632 zcmYk&PfHs?7zXfnlURcw3f5-*1A45OfWZ;+-z=H<`Z@Ki~!Gnh$DtPDzP_WRG@fjS!g&*(i`!F-_?nC=gM?JfoBNOJG12y5YZu94?>%`@mru-a{JhaK>*qg=5$zGHDqL zdH8LT=n~E#hB|D+8Z5vk$bt?jxWlD?;1`@i1Ac-WjzbY9A$53@$qzoZTJnQBp<)GY zRI|g?X6!|HpHNvF){#@P0@T^Ve?udl3gpIB&v8*`SM}atU1`QukKvbykJ>=tL?vBF zOs^Sp9yq=odQKS8rOG;x1&lizcCb}06a9S@-?jceYCTUUu)xQCR8_q+dblHEw&lwmb#brtjK;5am>%;v<8-Ea@^)4! zvB0%3BZ*96Pv^yOeBCdE@&tLJv$FW1@OAEss3)d%!=2Af8Eo?90=<2&BF`!dKca{cmyBBE_LH;8QHBho^~$n{Up zY)SMfh$b+E2o%(y0yg~OUIG&sLIfVvKzAhQc!w8=B^^?PLjad>0#!Hw3;s|z2mRAG z7{h=!g(JpX7lqQtf0~*o)vi>_N6>dR+ras5HVTzXwBRSPC#{r!#O_WxT|LU=i6IoszjzYS)uzU$F+ZPrk3*K Date: Mon, 19 Jun 2023 07:58:45 -0700 Subject: [PATCH 256/468] Re-add gating to RuntimeScheduler::Task around setNativeState (#37597) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37597 changelog: [internal] In https://github.com/facebook/react-native/commit/7211ef19624304b6a4d5219a8e0a2c67651b8b33 I removed use of CoreFeatures class from RuntimeScheduler to work around a circular dependency in cocoapods. In D46218604 I resolved the circular dependency issue and this diff adds the feature flag back. Reviewed By: javache Differential Revision: D46218660 fbshipit-source-id: abcdd522195cd5fa979ed3a559c00e1f2d2ae23a --- .../React-runtimescheduler.podspec | 67 +++++++++++++++++++ .../renderer/runtimescheduler/primitives.h | 16 ++++- 2 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec new file mode 100644 index 00000000000000..2756131fa11588 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec @@ -0,0 +1,67 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json"))) +version = package['version'] + +source = { :git => 'https://github.com/facebook/react-native.git' } +if version == '1000.0.0' + # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. + source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1") +else + source[:tag] = "v#{version}" +end + +folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' +folly_version = '2021.07.22.00' + +header_search_paths = [ + "\"$(PODS_ROOT)/RCT-Folly\"", +] + +if ENV['USE_FRAMEWORKS'] + header_search_paths << "\"$(PODS_TARGET_SRCROOT)/../../..\"" #this is needed to allow the RuntimeScheduler access its own files + header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"" +end + +Pod::Spec.new do |s| + s.name = "React-runtimescheduler" + s.version = version + s.summary = "-" # TODO + s.homepage = "https://reactnative.dev/" + s.license = package["license"] + s.author = "Meta Platforms, Inc. and its affiliates" + s.platforms = { :ios => min_ios_version_supported } + s.source = source + s.source_files = "**/*.{cpp,h}" + s.compiler_flags = folly_compiler_flags + s.header_dir = "react/renderer/runtimescheduler" + s.exclude_files = "tests" + s.pod_target_xcconfig = { + "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", + "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')} + + if ENV['USE_FRAMEWORKS'] + s.module_name = "React_runtimescheduler" + s.header_mappings_dir = "../../.." + end + + s.dependency "React-jsi" + s.dependency "React-runtimeexecutor" + s.dependency "React-callinvoker" + s.dependency "React-debug" + s.dependency "React-utils" + s.dependency "glog" + s.dependency "RCT-Folly", folly_version + + if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" + s.dependency "hermes-engine" + else + s.dependency "React-jsi" + end + +end diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/primitives.h b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/primitives.h index d27044300ce2eb..a21e2cc51f45c5 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/primitives.h +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/primitives.h @@ -23,8 +23,14 @@ struct TaskWrapper : public jsi::HostObject { inline static jsi::Value valueFromTask( jsi::Runtime &runtime, std::shared_ptr task) { - return jsi::Object::createFromHostObject( - runtime, std::make_shared(task)); + if (CoreFeatures::useNativeState) { + jsi::Object obj(runtime); + obj.setNativeState(runtime, std::move(task)); + return obj; + } else { + return jsi::Object::createFromHostObject( + runtime, std::make_shared(task)); + } } inline static std::shared_ptr taskFromValue( @@ -34,7 +40,11 @@ inline static std::shared_ptr taskFromValue( return nullptr; } - return value.getObject(runtime).getHostObject(runtime)->task; + if (CoreFeatures::useNativeState) { + return value.getObject(runtime).getNativeState(runtime); + } else { + return value.getObject(runtime).getHostObject(runtime)->task; + } } } // namespace facebook::react From 3d6a2a9cbd0d8d180d82c5ccfce6b5a9b5201dc0 Mon Sep 17 00:00:00 2001 From: ankit-tailor Date: Mon, 19 Jun 2023 10:34:32 -0700 Subject: [PATCH 257/468] refactor: converted NativeAnimatedInterpolationTest to kotlin (#37960) Summary: This PR converts [NativeAnimatedNodeTraversalTest](https://github.com/facebook/react-native/tree/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.java) into Kotlin as requested in https://github.com/facebook/react-native/issues/37708 ## Changelog: [INTERNAL] [CHANGED] - Convert `NativeAnimatedNodeTraversalTest` to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37960 Test Plan: 1. Run `./gradlew :packages:react-native:ReactAndroid:test`. 2. All tests should pass. Reviewed By: javache Differential Revision: D46838215 Pulled By: rshest fbshipit-source-id: 6681d74896a0c94fa7f3ad2ce79eeab4974c55f4 --- .../NativeAnimatedNodeTraversalTest.java | 1294 ----------------- .../NativeAnimatedNodeTraversalTest.kt | 1238 ++++++++++++++++ 2 files changed, 1238 insertions(+), 1294 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.java deleted file mode 100644 index a587bcb2c4c693..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.java +++ /dev/null @@ -1,1294 +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.react.animated; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.atMost; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.reset; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; - -import com.facebook.react.bridge.Arguments; -import com.facebook.react.bridge.Callback; -import com.facebook.react.bridge.CatalystInstance; -import com.facebook.react.bridge.JSIModuleType; -import com.facebook.react.bridge.JavaOnlyArray; -import com.facebook.react.bridge.JavaOnlyMap; -import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReadableMap; -import com.facebook.react.common.MapBuilder; -import com.facebook.react.uimanager.UIManagerModule; -import com.facebook.react.uimanager.events.Event; -import com.facebook.react.uimanager.events.EventDispatcher; -import com.facebook.react.uimanager.events.RCTEventEmitter; -import java.util.Map; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.rule.PowerMockRule; -import org.robolectric.RobolectricTestRunner; - -/** Tests the animated nodes graph traversal algorithm from {@link NativeAnimatedNodesManager}. */ -@PrepareForTest({Arguments.class}) -@RunWith(RobolectricTestRunner.class) -@PowerMockIgnore({"org.mockito.*", "org.robolectric.*", "androidx.*", "android.*"}) -public class NativeAnimatedNodeTraversalTest { - - private static long FRAME_LEN_NANOS = 1000000000L / 60L; - private static long INITIAL_FRAME_TIME_NANOS = 14599233201256L; /* random */ - - @Rule public PowerMockRule rule = new PowerMockRule(); - - private long mFrameTimeNanos; - private ReactApplicationContext mReactApplicationContextMock; - private CatalystInstance mCatalystInstanceMock; - private UIManagerModule mUIManagerMock; - private EventDispatcher mEventDispatcherMock; - private NativeAnimatedNodesManager mNativeAnimatedNodesManager; - - private long nextFrameTime() { - return mFrameTimeNanos += FRAME_LEN_NANOS; - } - - @Before - public void setUp() { - PowerMockito.mockStatic(Arguments.class); - PowerMockito.when(Arguments.createArray()) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - return new JavaOnlyArray(); - } - }); - PowerMockito.when(Arguments.createMap()) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - return new JavaOnlyMap(); - } - }); - - mFrameTimeNanos = INITIAL_FRAME_TIME_NANOS; - - mReactApplicationContextMock = mock(ReactApplicationContext.class); - PowerMockito.when(mReactApplicationContextMock.hasActiveReactInstance()) - .thenAnswer( - new Answer() { - @Override - public Boolean answer(InvocationOnMock invocationOnMock) throws Throwable { - return true; - } - }); - PowerMockito.when(mReactApplicationContextMock.hasCatalystInstance()) - .thenAnswer( - new Answer() { - @Override - public Boolean answer(InvocationOnMock invocationOnMock) throws Throwable { - return true; - } - }); - PowerMockito.when(mReactApplicationContextMock.getCatalystInstance()) - .thenAnswer( - new Answer() { - @Override - public CatalystInstance answer(InvocationOnMock invocationOnMock) throws Throwable { - return mCatalystInstanceMock; - } - }); - PowerMockito.when(mReactApplicationContextMock.getNativeModule(any(Class.class))) - .thenAnswer( - new Answer() { - @Override - public UIManagerModule answer(InvocationOnMock invocationOnMock) throws Throwable { - return mUIManagerMock; - } - }); - - mCatalystInstanceMock = mock(CatalystInstance.class); - PowerMockito.when(mCatalystInstanceMock.getJSIModule(any(JSIModuleType.class))) - .thenAnswer( - new Answer() { - @Override - public UIManagerModule answer(InvocationOnMock invocationOnMock) throws Throwable { - return mUIManagerMock; - } - }); - PowerMockito.when(mCatalystInstanceMock.getNativeModule(any(Class.class))) - .thenAnswer( - new Answer() { - @Override - public UIManagerModule answer(InvocationOnMock invocationOnMock) throws Throwable { - return mUIManagerMock; - } - }); - - mUIManagerMock = mock(UIManagerModule.class); - mEventDispatcherMock = mock(EventDispatcher.class); - PowerMockito.when(mUIManagerMock.getEventDispatcher()) - .thenAnswer( - new Answer() { - @Override - public EventDispatcher answer(InvocationOnMock invocation) throws Throwable { - return mEventDispatcherMock; - } - }); - PowerMockito.when(mUIManagerMock.getConstants()) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - return MapBuilder.of("customDirectEventTypes", MapBuilder.newHashMap()); - } - }); - PowerMockito.when(mUIManagerMock.getDirectEventNamesResolver()) - .thenAnswer( - new Answer() { - @Override - public UIManagerModule.CustomEventNamesResolver answer(InvocationOnMock invocation) - throws Throwable { - return new UIManagerModule.CustomEventNamesResolver() { - @Override - public String resolveCustomEventName(String eventName) { - Map directEventTypes = - (Map) - mUIManagerMock.getConstants().get("customDirectEventTypes"); - if (directEventTypes != null) { - Map customEventType = - (Map) directEventTypes.get(eventName); - if (customEventType != null) { - return customEventType.get("registrationName"); - } - } - return eventName; - } - }; - } - }); - PowerMockito.when(mUIManagerMock.resolveCustomDirectEventName(any(String.class))) - .thenAnswer( - new Answer() { - @Override - public String answer(InvocationOnMock invocation) throws Throwable { - String arg = invocation.getArguments()[0].toString(); - return "on" + arg.substring(3); - } - }); - mNativeAnimatedNodesManager = new NativeAnimatedNodesManager(mReactApplicationContextMock); - } - - /** - * Generates a simple animated nodes graph and attaches the props node to a given {@param viewTag} - * Parameter {@param opacity} is used as a initial value for the "opacity" attribute. - * - *

Nodes are connected as follows (nodes IDs in parens): ValueNode(1) -> StyleNode(2) -> - * PropNode(3) - */ - private void createSimpleAnimatedViewWithOpacity(int viewTag, double opacity) { - mNativeAnimatedNodesManager.createAnimatedNode( - 1, JavaOnlyMap.of("type", "value", "value", opacity, "offset", 0d)); - mNativeAnimatedNodesManager.createAnimatedNode( - 2, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("opacity", 1))); - mNativeAnimatedNodesManager.createAnimatedNode( - 3, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 2))); - mNativeAnimatedNodesManager.connectAnimatedNodes(1, 2); - mNativeAnimatedNodesManager.connectAnimatedNodes(2, 3); - mNativeAnimatedNodesManager.connectAnimatedNodeToView(3, viewTag); - } - - @Test - public void testFramesAnimation() { - createSimpleAnimatedViewWithOpacity(1000, 0d); - - JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d); - Callback animationCallback = mock(Callback.class); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, 1, JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1d), animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - for (int i = 0; i < frames.size(); i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(frames.getDouble(i)); - } - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - @Test - public void testFramesAnimationLoopsFiveTimes() { - createSimpleAnimatedViewWithOpacity(1000, 0d); - - JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d); - Callback animationCallback = mock(Callback.class); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, - 1, - JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1d, "iterations", 5), - animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - for (int iteration = 0; iteration < 5; iteration++) { - for (int i = 0; i < frames.size(); i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(frames.getDouble(i)); - } - } - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - @Test - public void testNodeValueListenerIfNotListening() { - int nodeId = 1; - - createSimpleAnimatedViewWithOpacity(1000, 0d); - JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d); - - Callback animationCallback = mock(Callback.class); - AnimatedNodeValueListener valueListener = mock(AnimatedNodeValueListener.class); - - mNativeAnimatedNodesManager.startListeningToAnimatedNodeValue(nodeId, valueListener); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, - nodeId, - JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1d), - animationCallback); - - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(valueListener).onValueUpdate(eq(0d)); - - mNativeAnimatedNodesManager.stopListeningToAnimatedNodeValue(nodeId); - - reset(valueListener); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(valueListener); - } - - @Test - public void testNodeValueListenerIfListening() { - int nodeId = 1; - - createSimpleAnimatedViewWithOpacity(1000, 0d); - JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d); - - Callback animationCallback = mock(Callback.class); - AnimatedNodeValueListener valueListener = mock(AnimatedNodeValueListener.class); - - mNativeAnimatedNodesManager.startListeningToAnimatedNodeValue(nodeId, valueListener); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, - nodeId, - JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1d), - animationCallback); - - for (int i = 0; i < frames.size(); i++) { - reset(valueListener); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(valueListener).onValueUpdate(eq(frames.getDouble(i))); - } - - reset(valueListener); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(valueListener); - } - - public void performSpringAnimationTestWithConfig( - JavaOnlyMap config, boolean testForCriticallyDamped) { - createSimpleAnimatedViewWithOpacity(1000, 0d); - - Callback animationCallback = mock(Callback.class); - mNativeAnimatedNodesManager.startAnimatingNode(1, 1, config, animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0); - - double previousValue = 0d; - boolean wasGreaterThanOne = false; - /* run 3 secs of animation */ - for (int i = 0; i < 3 * 60; i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock, atMost(1)) - .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - double currentValue = stylesCaptor.getValue().getDouble("opacity"); - if (currentValue > 1d) { - wasGreaterThanOne = true; - } - // verify that animation step is relatively small - assertThat(Math.abs(currentValue - previousValue)).isLessThan(0.12d); - previousValue = currentValue; - } - // verify that we've reach the final value at the end of animation - assertThat(previousValue).isEqualTo(1d); - // verify that value has reached some maximum value that is greater than the final value - // (bounce) - if (testForCriticallyDamped) { - assertThat(!wasGreaterThanOne); - } else { - assertThat(wasGreaterThanOne); - } - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - @Test - public void testUnderdampedSpringAnimation() { - performSpringAnimationTestWithConfig( - JavaOnlyMap.of( - "type", - "spring", - "stiffness", - 230.2d, - "damping", - 22d, - "mass", - 1d, - "initialVelocity", - 0d, - "toValue", - 1d, - "restSpeedThreshold", - 0.001d, - "restDisplacementThreshold", - 0.001d, - "overshootClamping", - false), - false); - } - - @Test - public void testCriticallyDampedSpringAnimation() { - performSpringAnimationTestWithConfig( - JavaOnlyMap.of( - "type", - "spring", - "stiffness", - 1000d, - "damping", - 500d, - "mass", - 3.0d, - "initialVelocity", - 0d, - "toValue", - 1d, - "restSpeedThreshold", - 0.001d, - "restDisplacementThreshold", - 0.001d, - "overshootClamping", - false), - true); - } - - @Test - public void testSpringAnimationLoopsFiveTimes() { - createSimpleAnimatedViewWithOpacity(1000, 0d); - - Callback animationCallback = mock(Callback.class); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, - 1, - JavaOnlyMap.of( - "type", - "spring", - "stiffness", - 230.2d, - "damping", - 22d, - "mass", - 1d, - "initialVelocity", - 0d, - "toValue", - 1d, - "restSpeedThreshold", - 0.001d, - "restDisplacementThreshold", - 0.001d, - "overshootClamping", - false, - "iterations", - 5), - animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0); - - double previousValue = 0d; - boolean wasGreaterThanOne = false; - boolean didComeToRest = false; - int numberOfResets = 0; - /* run 3 secs of animation, five times */ - for (int i = 0; i < 3 * 60 * 5; i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock, atMost(1)) - .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - double currentValue = stylesCaptor.getValue().getDouble("opacity"); - if (currentValue > 1d) { - wasGreaterThanOne = true; - } - // Test to see if it reset after coming to rest - if (didComeToRest - && currentValue == 0d - && Math.abs(Math.abs(currentValue - previousValue) - 1d) < 0.001d) { - numberOfResets++; - } - - // verify that an animation step is relatively small, unless it has come to rest and reset - if (!didComeToRest) assertThat(Math.abs(currentValue - previousValue)).isLessThan(0.12d); - - // record that the animation did come to rest when it rests on toValue - didComeToRest = - Math.abs(currentValue - 1d) < 0.001d && Math.abs(currentValue - previousValue) < 0.001d; - previousValue = currentValue; - } - // verify that we've reach the final value at the end of animation - assertThat(previousValue).isEqualTo(1d); - // verify that value has reached some maximum value that is greater than the final value - // (bounce) - assertThat(wasGreaterThanOne); - // verify that value reset 4 times after finishing a full animation - assertThat(numberOfResets).isEqualTo(4); - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - @Test - public void testDecayAnimation() { - createSimpleAnimatedViewWithOpacity(1000, 0d); - - Callback animationCallback = mock(Callback.class); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, - 1, - JavaOnlyMap.of("type", "decay", "velocity", 0.5d, "deceleration", 0.998d), - animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock, atMost(1)) - .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - double previousValue = stylesCaptor.getValue().getDouble("opacity"); - double previousDiff = Double.POSITIVE_INFINITY; - /* run 3 secs of animation */ - for (int i = 0; i < 3 * 60; i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock, atMost(1)) - .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - double currentValue = stylesCaptor.getValue().getDouble("opacity"); - double currentDiff = currentValue - previousValue; - // verify monotonicity - // greater *or equal* because the animation stops during these 3 seconds - assertThat(currentValue).as("on frame " + i).isGreaterThanOrEqualTo(previousValue); - // verify decay - if (i > 3) { - // i > 3 because that's how long it takes to settle previousDiff - if (i % 3 != 0) { - // i % 3 != 0 because every 3 frames we go a tiny - // bit faster, because frame length is 16.(6)ms - assertThat(currentDiff).as("on frame " + i).isLessThanOrEqualTo(previousDiff); - } else { - assertThat(currentDiff).as("on frame " + i).isGreaterThanOrEqualTo(previousDiff); - } - } - previousValue = currentValue; - previousDiff = currentDiff; - } - // should be done in 3s - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - @Test - public void testDecayAnimationLoopsFiveTimes() { - createSimpleAnimatedViewWithOpacity(1000, 0d); - - Callback animationCallback = mock(Callback.class); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, - 1, - JavaOnlyMap.of("type", "decay", "velocity", 0.5d, "deceleration", 0.998d, "iterations", 5), - animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock, atMost(1)) - .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - double previousValue = stylesCaptor.getValue().getDouble("opacity"); - double previousDiff = Double.POSITIVE_INFINITY; - double initialValue = stylesCaptor.getValue().getDouble("opacity"); - boolean didComeToRest = false; - int numberOfResets = 0; - /* run 3 secs of animation, five times */ - for (int i = 0; i < 3 * 60 * 5; i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock, atMost(1)) - .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - double currentValue = stylesCaptor.getValue().getDouble("opacity"); - double currentDiff = currentValue - previousValue; - // Test to see if it reset after coming to rest (i.e. dropped back to ) - if (didComeToRest && currentValue == initialValue) { - numberOfResets++; - } - - // verify monotonicity, unless it has come to rest and reset - // greater *or equal* because the animation stops during these 3 seconds - if (!didComeToRest) - assertThat(currentValue).as("on frame " + i).isGreaterThanOrEqualTo(previousValue); - - // Test if animation has come to rest using the 0.1 threshold from DecayAnimation.java - didComeToRest = Math.abs(currentDiff) < 0.1d; - previousValue = currentValue; - previousDiff = currentDiff; - } - - // verify that value reset (looped) 4 times after finishing a full animation - assertThat(numberOfResets).isEqualTo(4); - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - @Test - public void testAnimationCallbackFinish() { - createSimpleAnimatedViewWithOpacity(1000, 0d); - - JavaOnlyArray frames = JavaOnlyArray.of(0d, 1d); - Callback animationCallback = mock(Callback.class); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, 1, JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1d), animationCallback); - - ArgumentCaptor callbackResponseCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(animationCallback); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(animationCallback); - - reset(animationCallback); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(animationCallback).invoke(callbackResponseCaptor.capture()); - - assertThat(callbackResponseCaptor.getValue().hasKey("finished")).isTrue(); - assertThat(callbackResponseCaptor.getValue().getBoolean("finished")).isTrue(); - - reset(animationCallback); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(animationCallback); - } - - /** - * Creates a following graph of nodes: Value(1, firstValue) ----> Add(3) ---> Style(4) ---> - * Props(5) ---> View(viewTag) | Value(2, secondValue) --+ - * - *

Add(3) node maps to a "translateX" attribute of the Style(4) node. - */ - private void createAnimatedGraphWithAdditionNode( - int viewTag, double firstValue, double secondValue) { - mNativeAnimatedNodesManager.createAnimatedNode( - 1, JavaOnlyMap.of("type", "value", "value", firstValue, "offset", 0d)); - mNativeAnimatedNodesManager.createAnimatedNode( - 2, JavaOnlyMap.of("type", "value", "value", secondValue, "offset", 0d)); - - mNativeAnimatedNodesManager.createAnimatedNode( - 3, JavaOnlyMap.of("type", "addition", "input", JavaOnlyArray.of(1, 2))); - - mNativeAnimatedNodesManager.createAnimatedNode( - 4, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("translateX", 3))); - mNativeAnimatedNodesManager.createAnimatedNode( - 5, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 4))); - mNativeAnimatedNodesManager.connectAnimatedNodes(1, 3); - mNativeAnimatedNodesManager.connectAnimatedNodes(2, 3); - mNativeAnimatedNodesManager.connectAnimatedNodes(3, 4); - mNativeAnimatedNodesManager.connectAnimatedNodes(4, 5); - mNativeAnimatedNodesManager.connectAnimatedNodeToView(5, viewTag); - } - - @Test - public void testAdditionNode() { - createAnimatedGraphWithAdditionNode(50, 100d, 1000d); - - Callback animationCallback = mock(Callback.class); - JavaOnlyArray frames = JavaOnlyArray.of(0d, 1d); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, - 1, - JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 101d), - animationCallback); - - mNativeAnimatedNodesManager.startAnimatingNode( - 2, - 2, - JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1010d), - animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1100d); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1111d); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - /** - * Verifies that {@link NativeAnimatedNodesManager#runUpdates} updates the view correctly in case - * when one of the addition input nodes has started animating while the other one has not. - * - *

We expect that the output of the addition node will take the starting value of the second - * input node even though the node hasn't been connected to an active animation driver. - */ - @Test - public void testViewReceiveUpdatesIfOneOfAnimationHasntStarted() { - createAnimatedGraphWithAdditionNode(50, 100d, 1000d); - - // Start animating only the first addition input node - Callback animationCallback = mock(Callback.class); - JavaOnlyArray frames = JavaOnlyArray.of(0d, 1d); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, - 1, - JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 101d), - animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1100d); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1101d); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - /** - * Verifies that {@link NativeAnimatedNodesManager#runUpdates} updates the view correctly in case - * when one of the addition input nodes animation finishes before the other. - * - *

We expect that the output of the addition node after one of the animation has finished will - * take the last value of the animated node and the view will receive updates up until the second - * animation is over. - */ - @Test - public void testViewReceiveUpdatesWhenOneOfAnimationHasFinished() { - createAnimatedGraphWithAdditionNode(50, 100d, 1000d); - - Callback animationCallback = mock(Callback.class); - - // Start animating for the first addition input node, will have 2 frames only - JavaOnlyArray firstFrames = JavaOnlyArray.of(0d, 1d); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, - 1, - JavaOnlyMap.of("type", "frames", "frames", firstFrames, "toValue", 200d), - animationCallback); - - // Start animating for the first addition input node, will have 6 frames - JavaOnlyArray secondFrames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d); - mNativeAnimatedNodesManager.startAnimatingNode( - 2, - 2, - JavaOnlyMap.of("type", "frames", "frames", secondFrames, "toValue", 1010d), - animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1100d); - - for (int i = 1; i < secondFrames.size(); i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")) - .isEqualTo(1200d + secondFrames.getDouble(i) * 10d); - } - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - @Test - public void testMultiplicationNode() { - mNativeAnimatedNodesManager.createAnimatedNode( - 1, JavaOnlyMap.of("type", "value", "value", 1d, "offset", 0d)); - mNativeAnimatedNodesManager.createAnimatedNode( - 2, JavaOnlyMap.of("type", "value", "value", 5d, "offset", 0d)); - - mNativeAnimatedNodesManager.createAnimatedNode( - 3, JavaOnlyMap.of("type", "multiplication", "input", JavaOnlyArray.of(1, 2))); - - mNativeAnimatedNodesManager.createAnimatedNode( - 4, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("translateX", 3))); - mNativeAnimatedNodesManager.createAnimatedNode( - 5, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 4))); - mNativeAnimatedNodesManager.connectAnimatedNodes(1, 3); - mNativeAnimatedNodesManager.connectAnimatedNodes(2, 3); - mNativeAnimatedNodesManager.connectAnimatedNodes(3, 4); - mNativeAnimatedNodesManager.connectAnimatedNodes(4, 5); - mNativeAnimatedNodesManager.connectAnimatedNodeToView(5, 50); - - Callback animationCallback = mock(Callback.class); - JavaOnlyArray frames = JavaOnlyArray.of(0d, 1d); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, 1, JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 2d), animationCallback); - - mNativeAnimatedNodesManager.startAnimatingNode( - 2, - 2, - JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 10d), - animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(5d); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(20d); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - /** - * This test verifies that when {@link NativeAnimatedModule#stopAnimation} is called the animation - * will no longer be updating the nodes it has been previously attached to and that the animation - * callback will be triggered with {@code {finished: false}} - */ - @Test - public void testHandleStoppingAnimation() { - createSimpleAnimatedViewWithOpacity(1000, 0d); - - JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1.0d); - Callback animationCallback = mock(Callback.class); - mNativeAnimatedNodesManager.startAnimatingNode( - 404, - 1, - JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1d), - animationCallback); - - ArgumentCaptor callbackResponseCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(animationCallback); - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock, times(2)) - .synchronouslyUpdateViewOnUIThread(anyInt(), any(ReadableMap.class)); - verifyNoMoreInteractions(animationCallback); - - reset(animationCallback); - reset(mUIManagerMock); - mNativeAnimatedNodesManager.stopAnimation(404); - verify(animationCallback).invoke(callbackResponseCaptor.capture()); - verifyNoMoreInteractions(animationCallback); - verifyNoMoreInteractions(mUIManagerMock); - - assertThat(callbackResponseCaptor.getValue().hasKey("finished")).isTrue(); - assertThat(callbackResponseCaptor.getValue().getBoolean("finished")).isFalse(); - - reset(animationCallback); - reset(mUIManagerMock); - // Run "update" loop a few more times -> we expect no further updates nor callback calls to be - // triggered - for (int i = 0; i < 5; i++) { - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - } - - verifyNoMoreInteractions(mUIManagerMock); - verifyNoMoreInteractions(animationCallback); - } - - @Test - public void testGetValue() { - int tag = 1; - mNativeAnimatedNodesManager.createAnimatedNode( - tag, JavaOnlyMap.of("type", "value", "value", 1d, "offset", 0d)); - - Callback saveValueCallbackMock = mock(Callback.class); - - mNativeAnimatedNodesManager.getValue(tag, saveValueCallbackMock); - - verify(saveValueCallbackMock, times(1)).invoke(1d); - } - - @Test - public void testInterpolationNode() { - mNativeAnimatedNodesManager.createAnimatedNode( - 1, JavaOnlyMap.of("type", "value", "value", 10d, "offset", 0d)); - - mNativeAnimatedNodesManager.createAnimatedNode( - 2, - JavaOnlyMap.of( - "type", - "interpolation", - "inputRange", - JavaOnlyArray.of(10d, 20d), - "outputRange", - JavaOnlyArray.of(0d, 1d), - "extrapolateLeft", - "extend", - "extrapolateRight", - "extend")); - - mNativeAnimatedNodesManager.createAnimatedNode( - 3, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("opacity", 2))); - mNativeAnimatedNodesManager.createAnimatedNode( - 4, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 3))); - mNativeAnimatedNodesManager.connectAnimatedNodes(1, 2); - mNativeAnimatedNodesManager.connectAnimatedNodes(2, 3); - mNativeAnimatedNodesManager.connectAnimatedNodes(3, 4); - mNativeAnimatedNodesManager.connectAnimatedNodeToView(4, 50); - - Callback animationCallback = mock(Callback.class); - JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.2d, 0.4d, 0.6d, 0.8d, 1d); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, - 1, - JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 20d), - animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - for (int i = 0; i < frames.size(); i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(frames.getDouble(i)); - } - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - private Event createScrollEvent(final int tag, final double value) { - return new Event(tag) { - @Override - public String getEventName() { - return "topScroll"; - } - - @Override - public void dispatch(RCTEventEmitter rctEventEmitter) { - rctEventEmitter.receiveEvent( - tag, "topScroll", JavaOnlyMap.of("contentOffset", JavaOnlyMap.of("y", value))); - } - }; - } - - @Test - public void testNativeAnimatedEventDoUpdate() { - int viewTag = 1000; - - createSimpleAnimatedViewWithOpacity(viewTag, 0d); - - mNativeAnimatedNodesManager.addAnimatedEventToView( - viewTag, - "onScroll", - JavaOnlyMap.of( - "animatedValueTag", 1, "nativeEventPath", JavaOnlyArray.of("contentOffset", "y"))); - - mNativeAnimatedNodesManager.onEventDispatch(createScrollEvent(viewTag, 10)); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(10); - } - - @Test - public void testNativeAnimatedEventDoNotUpdate() { - int viewTag = 1000; - - createSimpleAnimatedViewWithOpacity(viewTag, 0d); - - mNativeAnimatedNodesManager.addAnimatedEventToView( - viewTag, - "otherEvent", - JavaOnlyMap.of( - "animatedValueTag", 1, "nativeEventPath", JavaOnlyArray.of("contentOffset", "y"))); - - mNativeAnimatedNodesManager.addAnimatedEventToView( - 999, - "topScroll", - JavaOnlyMap.of( - "animatedValueTag", 1, "nativeEventPath", JavaOnlyArray.of("contentOffset", "y"))); - - mNativeAnimatedNodesManager.onEventDispatch(createScrollEvent(viewTag, 10)); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0); - } - - @Test - public void testNativeAnimatedEventCustomMapping() { - int viewTag = 1000; - - PowerMockito.when(mUIManagerMock.getConstants()) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - return MapBuilder.of( - "customDirectEventTypes", - MapBuilder.of("onScroll", MapBuilder.of("registrationName", "onScroll"))); - } - }); - mNativeAnimatedNodesManager = new NativeAnimatedNodesManager(mReactApplicationContextMock); - - createSimpleAnimatedViewWithOpacity(viewTag, 0d); - - mNativeAnimatedNodesManager.addAnimatedEventToView( - viewTag, - "onScroll", - JavaOnlyMap.of( - "animatedValueTag", 1, "nativeEventPath", JavaOnlyArray.of("contentOffset", "y"))); - - mNativeAnimatedNodesManager.onEventDispatch(createScrollEvent(viewTag, 10)); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(10); - } - - @Test - public void testRestoreDefaultProps() { - int viewTag = 1001; // restoreDefaultProps not called in Fabric, make sure it's a non-Fabric tag - int propsNodeTag = 3; - mNativeAnimatedNodesManager.createAnimatedNode( - 1, JavaOnlyMap.of("type", "value", "value", 1d, "offset", 0d)); - mNativeAnimatedNodesManager.createAnimatedNode( - 2, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("opacity", 1))); - mNativeAnimatedNodesManager.createAnimatedNode( - propsNodeTag, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 2))); - mNativeAnimatedNodesManager.connectAnimatedNodes(1, 2); - mNativeAnimatedNodesManager.connectAnimatedNodes(2, propsNodeTag); - mNativeAnimatedNodesManager.connectAnimatedNodeToView(propsNodeTag, viewTag); - - JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.5d, 1d); - Callback animationCallback = mock(Callback.class); - mNativeAnimatedNodesManager.startAnimatingNode( - 1, 1, JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 0d), animationCallback); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - for (int i = 0; i < frames.size(); i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - } - - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.restoreDefaultValues(propsNodeTag); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().isNull("opacity")); - } - - /** - * Creates a following graph of nodes: Value(3, initialValue) ----> Style(4) ---> Props(5) ---> - * View(viewTag) - * - *

Value(3) is set to track Value(1) via Tracking(2) node with the provided animation config - */ - private void createAnimatedGraphWithTrackingNode( - int viewTag, double initialValue, JavaOnlyMap animationConfig) { - mNativeAnimatedNodesManager.createAnimatedNode( - 1, JavaOnlyMap.of("type", "value", "value", initialValue, "offset", 0d)); - mNativeAnimatedNodesManager.createAnimatedNode( - 3, JavaOnlyMap.of("type", "value", "value", initialValue, "offset", 0d)); - - mNativeAnimatedNodesManager.createAnimatedNode( - 2, - JavaOnlyMap.of( - "type", - "tracking", - "animationId", - 70, - "value", - 3, - "toValue", - 1, - "animationConfig", - animationConfig)); - - mNativeAnimatedNodesManager.createAnimatedNode( - 4, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("translateX", 3))); - mNativeAnimatedNodesManager.createAnimatedNode( - 5, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 4))); - mNativeAnimatedNodesManager.connectAnimatedNodes(1, 2); - mNativeAnimatedNodesManager.connectAnimatedNodes(3, 4); - mNativeAnimatedNodesManager.connectAnimatedNodes(4, 5); - mNativeAnimatedNodesManager.connectAnimatedNodeToView(5, viewTag); - } - - /** - * In this test we verify that when value is being tracked we can update destination value in the - * middle of ongoing animation and the animation will update and animate to the new spot. This is - * tested using simple 5 frame backed timing animation. - */ - @Test - public void testTracking() { - JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.25d, 0.5d, 0.75d, 1d); - JavaOnlyMap animationConfig = JavaOnlyMap.of("type", "frames", "frames", frames); - - createAnimatedGraphWithTrackingNode(1000, 0d, animationConfig); - - ArgumentCaptor stylesCaptor = ArgumentCaptor.forClass(ReadableMap.class); - - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(0d); - - // update "toValue" to 100, we expect tracking animation to animate now from 0 to 100 in 5 steps - mNativeAnimatedNodesManager.setAnimatedNodeValue(1, 100d); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); // kick off the animation - - for (int i = 0; i < frames.size(); i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")) - .isEqualTo(frames.getDouble(i) * 100d); - } - - // update "toValue" to 0 but run only two frames from the animation, - // we expect tracking animation to animate now from 100 to 75 - mNativeAnimatedNodesManager.setAnimatedNodeValue(1, 0d); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); // kick off the animation - - for (int i = 0; i < 2; i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")) - .isEqualTo(100d * (1d - frames.getDouble(i))); - } - - // at this point we expect tracking value to be at 75 - assertThat(((ValueAnimatedNode) mNativeAnimatedNodesManager.getNodeById(3)).getValue()) - .isEqualTo(75d); - - // we update "toValue" again to 100 and expect the animation to restart from the current place - mNativeAnimatedNodesManager.setAnimatedNodeValue(1, 100d); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); // kick off the animation - - for (int i = 0; i < frames.size(); i++) { - reset(mUIManagerMock); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verify(mUIManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()); - assertThat(stylesCaptor.getValue().getDouble("translateX")) - .isEqualTo(50d + 50d * frames.getDouble(i)); - } - } - - /** - * In this test we verify that when tracking is set up for a given animated node and when the - * animation settles it will not be registered as an active animation and therefore will not - * consume resources on running the animation that has already completed. Then we verify that when - * the value updates the animation will resume as expected and the complete again when reaches the - * end. - */ - @Test - public void testTrackingPausesWhenEndValueIsReached() { - JavaOnlyArray frames = JavaOnlyArray.of(0d, 0.5d, 1d); - JavaOnlyMap animationConfig = JavaOnlyMap.of("type", "frames", "frames", frames); - - createAnimatedGraphWithTrackingNode(1000, 0d, animationConfig); - mNativeAnimatedNodesManager.setAnimatedNodeValue(1, 100d); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); // make sure animation starts - - reset(mUIManagerMock); - for (int i = 0; i < frames.size(); i++) { - assertThat(mNativeAnimatedNodesManager.hasActiveAnimations()).isTrue(); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - } - verify(mUIManagerMock, times(frames.size())) - .synchronouslyUpdateViewOnUIThread(eq(1000), any(ReadableMap.class)); - - // the animation has completed, we expect no updates to be done - reset(mUIManagerMock); - assertThat(mNativeAnimatedNodesManager.hasActiveAnimations()).isFalse(); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - - // we update end value and expect the animation to restart - mNativeAnimatedNodesManager.setAnimatedNodeValue(1, 200d); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); // make sure animation starts - - reset(mUIManagerMock); - for (int i = 0; i < frames.size(); i++) { - assertThat(mNativeAnimatedNodesManager.hasActiveAnimations()).isTrue(); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - } - verify(mUIManagerMock, times(frames.size())) - .synchronouslyUpdateViewOnUIThread(eq(1000), any(ReadableMap.class)); - - // the animation has completed, we expect no updates to be done - reset(mUIManagerMock); - assertThat(mNativeAnimatedNodesManager.hasActiveAnimations()).isFalse(); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - verifyNoMoreInteractions(mUIManagerMock); - } - - /** - * In this test we verify that when tracking is configured to use spring animation and when the - * destination value updates the current speed of the animated value will be taken into account - * while updating the spring animation and it will smoothly transition to the new end value. - */ - @Test - public void testSpringTrackingRetainsSpeed() { - // this spring config corresponds to tension 20 and friction 0.5 which makes the spring settle - // very slowly - JavaOnlyMap springConfig = - JavaOnlyMap.of( - "type", - "spring", - "restSpeedThreshold", - 0.001, - "mass", - 1d, - "restDisplacementThreshold", - 0.001, - "initialVelocity", - 0.5d, - "damping", - 2.5, - "stiffness", - 157.8, - "overshootClamping", - false); - - createAnimatedGraphWithTrackingNode(1000, 0d, springConfig); - - // update "toValue" to 1, we expect tracking animation to animate now from 0 to 1 - mNativeAnimatedNodesManager.setAnimatedNodeValue(1, 1d); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - - // we run several steps of animation until the value starts bouncing, has negative speed and - // passes the final point (that is 1) while going backwards - boolean isBoucingBack = false; - double previousValue = - ((ValueAnimatedNode) mNativeAnimatedNodesManager.getNodeById(3)).getValue(); - for (int maxFrames = 500; maxFrames > 0; maxFrames--) { - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - double currentValue = - ((ValueAnimatedNode) mNativeAnimatedNodesManager.getNodeById(3)).getValue(); - if (previousValue >= 1d && currentValue < 1d) { - isBoucingBack = true; - break; - } - previousValue = currentValue; - } - assertThat(isBoucingBack).isTrue(); - - // we now update "toValue" to 1.5 but since the value have negative speed and has also pretty - // low friction we expect it to keep going in the opposite direction for a few more frames - mNativeAnimatedNodesManager.setAnimatedNodeValue(1, 1.5d); - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - int bounceBackInitialFrames = 0; - boolean hasTurnedForward = false; - - // we run 8 seconds of animation - for (int i = 0; i < 8 * 60; i++) { - mNativeAnimatedNodesManager.runUpdates(nextFrameTime()); - double currentValue = - ((ValueAnimatedNode) mNativeAnimatedNodesManager.getNodeById(3)).getValue(); - if (!hasTurnedForward) { - if (currentValue <= previousValue) { - bounceBackInitialFrames++; - } else { - hasTurnedForward = true; - } - } - previousValue = currentValue; - } - assertThat(hasTurnedForward).isEqualTo(true); - assertThat(bounceBackInitialFrames).isGreaterThan(3); - - // we verify that the value settled at 2 - assertThat(previousValue).isEqualTo(1.5d); - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.kt new file mode 100644 index 00000000000000..c8ecdb3bb8d751 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.kt @@ -0,0 +1,1238 @@ +/* + * 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.react.animated + +import com.facebook.react.bridge.Arguments +import com.facebook.react.bridge.Callback +import com.facebook.react.bridge.CatalystInstance +import com.facebook.react.bridge.JSIModuleType +import com.facebook.react.bridge.JavaOnlyArray +import com.facebook.react.bridge.JavaOnlyMap +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.bridge.ReadableMap +import com.facebook.react.common.MapBuilder +import com.facebook.react.uimanager.UIManagerModule +import com.facebook.react.uimanager.events.Event +import com.facebook.react.uimanager.events.EventDispatcher +import com.facebook.react.uimanager.events.RCTEventEmitter +import kotlin.collections.Map +import org.assertj.core.api.Assertions.assertThat +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.ArgumentCaptor +import org.mockito.ArgumentMatchers.any +import org.mockito.ArgumentMatchers.anyInt +import org.mockito.ArgumentMatchers.eq +import org.mockito.Mockito.atMost +import org.mockito.Mockito.mock +import org.mockito.Mockito.reset +import org.mockito.Mockito.times +import org.mockito.Mockito.verify +import org.mockito.Mockito.verifyNoMoreInteractions +import org.powermock.api.mockito.PowerMockito.mockStatic +import org.powermock.api.mockito.PowerMockito.`when` as whenever +import org.powermock.core.classloader.annotations.PowerMockIgnore +import org.powermock.core.classloader.annotations.PrepareForTest +import org.powermock.modules.junit4.rule.PowerMockRule +import org.robolectric.RobolectricTestRunner + +/** Tests the animated nodes graph traversal algorithm from {@link NativeAnimatedNodesManager}. */ +@PrepareForTest(Arguments::class) +@RunWith(RobolectricTestRunner::class) +@PowerMockIgnore("org.mockito.*", "org.robolectric.*", "androidx.*", "android.*") +class NativeAnimatedNodeTraversalTest { + @get:Rule var rule = PowerMockRule() + + companion object { + private val FRAME_LEN_NANOS: Long = 1000000000L / 60L + private val INITIAL_FRAME_TIME_NANOS: Long = 14599233201256L /* random */ + } + + private var frameTimeNanos: Long = 0L + private lateinit var reactApplicationContextMock: ReactApplicationContext + private lateinit var catalystInstanceMock: CatalystInstance + private lateinit var uiManagerMock: UIManagerModule + private lateinit var eventDispatcherMock: EventDispatcher + private lateinit var nativeAnimatedNodesManager: NativeAnimatedNodesManager + + private fun nextFrameTime(): Long { + frameTimeNanos += FRAME_LEN_NANOS + return frameTimeNanos + } + + @Before + fun setUp() { + mockStatic(Arguments::class.java) + whenever(Arguments.createArray()).thenAnswer { JavaOnlyArray() } + whenever(Arguments.createMap()).thenAnswer { JavaOnlyMap() } + + frameTimeNanos = INITIAL_FRAME_TIME_NANOS + + reactApplicationContextMock = mock(ReactApplicationContext::class.java) + whenever(reactApplicationContextMock.hasActiveReactInstance()).thenAnswer { true } + whenever(reactApplicationContextMock.hasCatalystInstance()).thenAnswer { true } + whenever(reactApplicationContextMock.getCatalystInstance()).thenAnswer { catalystInstanceMock } + whenever(reactApplicationContextMock.getNativeModule(UIManagerModule::class.java)).thenAnswer { + uiManagerMock + } + + catalystInstanceMock = mock(CatalystInstance::class.java) + whenever(catalystInstanceMock.getJSIModule(any(JSIModuleType::class.java))).thenAnswer { + uiManagerMock + } + whenever(catalystInstanceMock.getNativeModule(UIManagerModule::class.java)).thenAnswer { + uiManagerMock + } + + uiManagerMock = mock(UIManagerModule::class.java) + eventDispatcherMock = mock(EventDispatcher::class.java) + whenever(uiManagerMock.getEventDispatcher()).thenAnswer { eventDispatcherMock } + whenever(uiManagerMock.getConstants()).thenAnswer { + MapBuilder.of("customDirectEventTypes", MapBuilder.newHashMap()) + } + whenever(uiManagerMock.getDirectEventNamesResolver()).thenAnswer { + object : UIManagerModule.CustomEventNamesResolver { + override fun resolveCustomEventName(eventName: String): String { + val directEventTypes: Map>? = + uiManagerMock?.constants?.get("customDirectEventTypes") + as? Map>? + if (directEventTypes != null) { + val customEventType: Map? = + directEventTypes[eventName] as? Map? + if (customEventType != null) { + return customEventType["registrationName"] ?: eventName + } + } + return eventName + } + } + } + whenever(uiManagerMock.resolveCustomDirectEventName(any(String::class.java))).thenAnswer { + invocation -> + val arg = invocation.arguments[0].toString() + "on${arg.substring(3)}" + } + nativeAnimatedNodesManager = NativeAnimatedNodesManager(reactApplicationContextMock) + } + + /** + * Generates a simple animated nodes graph and attaches the props node to a given {@param viewTag} + * Parameter {@param opacity} is used as a initial value for the "opacity" attribute. + * + *

Nodes are connected as follows (nodes IDs in parens): ValueNode(1) -> StyleNode(2) -> + * PropNode(3) + */ + private fun createSimpleAnimatedViewWithOpacity(viewTag: Int, opacity: Double) { + nativeAnimatedNodesManager.createAnimatedNode( + 1, JavaOnlyMap.of("type", "value", "value", opacity, "offset", 0.0)) + nativeAnimatedNodesManager.createAnimatedNode( + 2, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("opacity", 1))) + nativeAnimatedNodesManager.createAnimatedNode( + 3, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 2))) + nativeAnimatedNodesManager.connectAnimatedNodes(1, 2) + nativeAnimatedNodesManager.connectAnimatedNodes(2, 3) + nativeAnimatedNodesManager.connectAnimatedNodeToView(3, viewTag) + } + + @Test + fun testFramesAnimation() { + createSimpleAnimatedViewWithOpacity(1000, 0.0) + + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) + + val animationCallback: Callback = mock(Callback::class.java) + nativeAnimatedNodesManager.startAnimatingNode( + 1, 1, JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1.0), animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + for (i in 0 until frames.size()) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(frames.getDouble(i)) + } + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + @Test + fun testFramesAnimationLoopsFiveTimes() { + createSimpleAnimatedViewWithOpacity(1000, 0.0) + + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) + val animationCallback: Callback = mock(Callback::class.java) + nativeAnimatedNodesManager.startAnimatingNode( + 1, + 1, + JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1.0, "iterations", 5), + animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + for (iteration in 1..5) { + for (i in 0 until frames.size()) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(frames.getDouble(i)) + } + } + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + @Test + fun testNodeValueListenerIfNotListening() { + val nodeId: Int = 1 + + createSimpleAnimatedViewWithOpacity(1000, 0.0) + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) + + val animationCallback: Callback = mock(Callback::class.java) + val valueListener: AnimatedNodeValueListener = mock(AnimatedNodeValueListener::class.java) + + nativeAnimatedNodesManager.startListeningToAnimatedNodeValue(nodeId, valueListener) + nativeAnimatedNodesManager.startAnimatingNode( + 1, + nodeId, + JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1.0), + animationCallback) + + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(valueListener).onValueUpdate(eq(0.0)) + + nativeAnimatedNodesManager.stopListeningToAnimatedNodeValue(nodeId) + + reset(valueListener) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(valueListener) + } + + @Test + fun testNodeValueListenerIfListening() { + val nodeId: Int = 1 + + createSimpleAnimatedViewWithOpacity(1000, 0.0) + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) + + val animationCallback: Callback = mock(Callback::class.java) + val valueListener: AnimatedNodeValueListener = mock(AnimatedNodeValueListener::class.java) + + nativeAnimatedNodesManager.startListeningToAnimatedNodeValue(nodeId, valueListener) + nativeAnimatedNodesManager.startAnimatingNode( + 1, + nodeId, + JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1.0), + animationCallback) + + for (i in 0 until frames.size()) { + reset(valueListener) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(valueListener).onValueUpdate(eq(frames.getDouble(i))) + } + + reset(valueListener) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(valueListener) + } + + fun performSpringAnimationTestWithConfig(config: JavaOnlyMap?, testForCriticallyDamped: Boolean) { + createSimpleAnimatedViewWithOpacity(1000, 0.0) + + val animationCallback: Callback = mock(Callback::class.java) + + nativeAnimatedNodesManager.startAnimatingNode(1, 1, config, animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0.0) + + var previousValue: Double = 0.0 + var wasGreaterThanOne: Boolean = false + + /* run 3 secs of animation */ + for (i in 0 until 3 * 60) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock, atMost(1)) + .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + val currentValue: Double = stylesCaptor.getValue().getDouble("opacity") + if (currentValue > 1.0) { + wasGreaterThanOne = true + } + // verify that animation step is relatively small + assertThat(java.lang.Math.abs(currentValue - previousValue)).isLessThan(0.12) + previousValue = currentValue + } + // verify that we've reach the final value at the end of animation + assertThat(previousValue).isEqualTo(1.0) + // verify that value has reached some maximum value that is greater than the final value + // (bounce) + if (testForCriticallyDamped) { + assertThat(!wasGreaterThanOne) + } else { + assertThat(wasGreaterThanOne) + } + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + @Test + fun testUnderdampedSpringAnimation() { + performSpringAnimationTestWithConfig( + JavaOnlyMap.of( + "type", + "spring", + "stiffness", + 230.2, + "damping", + 22.0, + "mass", + 1.0, + "initialVelocity", + 0.0, + "toValue", + 1.0, + "restSpeedThreshold", + 0.001, + "restDisplacementThreshold", + 0.001, + "overshootClamping", + false), + false) + } + + @Test + fun testCriticallyDampedSpringAnimation() { + performSpringAnimationTestWithConfig( + JavaOnlyMap.of( + "type", + "spring", + "stiffness", + 1000.0, + "damping", + 500.0, + "mass", + 3.0, + "initialVelocity", + 0.0, + "toValue", + 1.0, + "restSpeedThreshold", + 0.001, + "restDisplacementThreshold", + 0.001, + "overshootClamping", + false), + true) + } + + @Test + fun testSpringAnimationLoopsFiveTimes() { + createSimpleAnimatedViewWithOpacity(1000, 0.0) + + val animationCallback: Callback = mock(Callback::class.java) + nativeAnimatedNodesManager.startAnimatingNode( + 1, + 1, + JavaOnlyMap.of( + "type", + "spring", + "stiffness", + 230.2, + "damping", + 22.0, + "mass", + 1.0, + "initialVelocity", + 0.0, + "toValue", + 1.0, + "restSpeedThreshold", + 0.001, + "restDisplacementThreshold", + 0.001, + "overshootClamping", + false, + "iterations", + 5), + animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0.0) + + var previousValue: Double = 0.0 + var wasGreaterThanOne: Boolean = false + var didComeToRest: Boolean = false + var numberOfResets: Int = 0 + /* run 3 secs of animation, five times */ + for (i in 0 until 3 * 60 * 5) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock, atMost(1)) + .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + val currentValue: Double = stylesCaptor.getValue().getDouble("opacity") + if (currentValue > 1.0) { + wasGreaterThanOne = true + } + // Test to see if it reset after coming to rest + if (didComeToRest && + currentValue == 0.0 && + Math.abs(Math.abs(currentValue - previousValue) - 1.0) < 0.001) { + numberOfResets++ + } + + // verify that an animation step is relatively small, unless it has come to rest and + // reset + if (!didComeToRest) assertThat(Math.abs(currentValue - previousValue)).isLessThan(0.12) + + // record that the animation did come to rest when it rests on toValue + didComeToRest = + Math.abs(currentValue - 1.0) < 0.001 && Math.abs(currentValue - previousValue) < 0.001 + previousValue = currentValue + } + // verify that we've reach the final value at the end of animation + assertThat(previousValue).isEqualTo(1.0) + // verify that value has reached some maximum value that is greater than the final value + // (bounce) + assertThat(wasGreaterThanOne) + // verify that value reset 4 times after finishing a full animation + assertThat(numberOfResets).isEqualTo(4) + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + @Test + fun testDecayAnimation() { + createSimpleAnimatedViewWithOpacity(1000, 0.0) + + val animationCallback: Callback = mock(Callback::class.java) + nativeAnimatedNodesManager.startAnimatingNode( + 1, + 1, + JavaOnlyMap.of("type", "decay", "velocity", 0.5, "deceleration", 0.998), + animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock, atMost(1)) + .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + var previousValue: Double = stylesCaptor.getValue().getDouble("opacity") + var previousDiff: Double = Double.POSITIVE_INFINITY + /* run 3 secs of animation */ + for (i in 0 until 3 * 60) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock, atMost(1)) + .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + val currentValue: Double = stylesCaptor.getValue().getDouble("opacity") + val currentDiff: Double = currentValue - previousValue + // verify monotonicity + // greater *or equal* because the animation stops during these 3 seconds + assertThat(currentValue).`as`("on frame " + i).isGreaterThanOrEqualTo(previousValue) + // verify decay + if (i > 3) { + // i > 3 because that's how long it takes to settle previousDiff + if (i % 3 != 0) { + // i % 3 != 0 because every 3 frames we go a tiny + // bit faster, because frame length is 16.(6)ms + assertThat(currentDiff).`as`("on frame " + i).isLessThanOrEqualTo(previousDiff) + } else { + assertThat(currentDiff).`as`("on frame " + i).isGreaterThanOrEqualTo(previousDiff) + } + } + previousValue = currentValue + previousDiff = currentDiff + } + // should be done in 3s + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + @Test + fun testDecayAnimationLoopsFiveTimes() { + createSimpleAnimatedViewWithOpacity(1000, 0.0) + + val animationCallback: Callback = mock(Callback::class.java) + nativeAnimatedNodesManager.startAnimatingNode( + 1, + 1, + JavaOnlyMap.of("type", "decay", "velocity", 0.5, "deceleration", 0.998, "iterations", 5), + animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock, atMost(1)) + .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + var previousValue: Double = stylesCaptor.getValue().getDouble("opacity") + val initialValue: Double = stylesCaptor.getValue().getDouble("opacity") + var didComeToRest: Boolean = false + var numberOfResets: Int = 0 + /* run 3 secs of animation, five times */ + for (i in 0 until 3 * 60 * 5) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock, atMost(1)) + .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + val currentValue: Double = stylesCaptor.getValue().getDouble("opacity") + val currentDiff: Double = currentValue - previousValue + // Test to see if it reset after coming to rest (i.e. dropped back to ) + if (didComeToRest && currentValue == initialValue) { + numberOfResets++ + } + + // verify monotonicity, unless it has come to rest and reset + // greater *or equal* because the animation stops during these 3 seconds + if (!didComeToRest) { + assertThat(currentValue).`as`("on frame " + i).isGreaterThanOrEqualTo(previousValue) + } + + // Test if animation has come to rest using the 0.1 threshold from DecayAnimation.java + didComeToRest = Math.abs(currentDiff) < 0.1 + previousValue = currentValue + } + + // verify that value reset (looped) 4 times after finishing a full animation + assertThat(numberOfResets).isEqualTo(4) + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + @Test + fun testAnimationCallbackFinish() { + createSimpleAnimatedViewWithOpacity(1000, 0.0) + + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 1.0) + val animationCallback: Callback = mock(Callback::class.java) + nativeAnimatedNodesManager.startAnimatingNode( + 1, 1, JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1.0), animationCallback) + + val callbackResponseCaptor: ArgumentCaptor = + ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(animationCallback) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(animationCallback) + + reset(animationCallback) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(animationCallback).invoke(callbackResponseCaptor.capture()) + + assertThat(callbackResponseCaptor.getValue().hasKey("finished")).isTrue() + assertThat(callbackResponseCaptor.getValue().getBoolean("finished")).isTrue() + + reset(animationCallback) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(animationCallback) + } + + /** + * Creates a following graph of nodes: Value(1, firstValue) ----> Add(3) ---> Style(4) ---> + * Props(5) ---> View(viewTag) | Value(2, secondValue) --+ + * + *

Add(3) node maps to a "translateX" attribute of the Style(4) node. + */ + private fun createAnimatedGraphWithAdditionNode( + viewTag: Int, + firstValue: Double, + secondValue: Double + ) { + nativeAnimatedNodesManager.createAnimatedNode( + 1, JavaOnlyMap.of("type", "value", "value", firstValue, "offset", 0.0)) + nativeAnimatedNodesManager.createAnimatedNode( + 2, JavaOnlyMap.of("type", "value", "value", secondValue, "offset", 0.0)) + + nativeAnimatedNodesManager.createAnimatedNode( + 3, JavaOnlyMap.of("type", "addition", "input", JavaOnlyArray.of(1, 2))) + + nativeAnimatedNodesManager.createAnimatedNode( + 4, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("translateX", 3))) + nativeAnimatedNodesManager.createAnimatedNode( + 5, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 4))) + nativeAnimatedNodesManager.connectAnimatedNodes(1, 3) + nativeAnimatedNodesManager.connectAnimatedNodes(2, 3) + nativeAnimatedNodesManager.connectAnimatedNodes(3, 4) + nativeAnimatedNodesManager.connectAnimatedNodes(4, 5) + nativeAnimatedNodesManager.connectAnimatedNodeToView(5, viewTag) + } + + @Test + fun testAdditionNode() { + createAnimatedGraphWithAdditionNode(50, 100.0, 1000.0) + + val animationCallback: Callback = mock(Callback::class.java) + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 1.0) + nativeAnimatedNodesManager.startAnimatingNode( + 1, + 1, + JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 101.0), + animationCallback) + + nativeAnimatedNodesManager.startAnimatingNode( + 2, + 2, + JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1010.0), + animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1100.0) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1111.0) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + /** + * Verifies that {@link NativeAnimatedNodesManager#runUpdates} updates the view correctly in case + * when one of the addition input nodes has started animating while the other one has not. + * + *

We expect that the output of the addition node will take the starting value of the second + * input node even though the node hasn't been connected to an active animation driver. + */ + @Test + fun testViewReceiveUpdatesIfOneOfAnimationHasntStarted() { + createAnimatedGraphWithAdditionNode(50, 100.0, 1000.0) + + // Start animating only the first addition input node + val animationCallback: Callback = mock(Callback::class.java) + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 1.0) + nativeAnimatedNodesManager.startAnimatingNode( + 1, + 1, + JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 101.0), + animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1100.0) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1101.0) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + /** + * Verifies that {@link NativeAnimatedNodesManager#runUpdates} updates the view correctly in case + * when one of the addition input nodes animation finishes before the other. + * + *

We expect that the output of the addition node after one of the animation has finished will + * take the last value of the animated node and the view will receive updates up until the second + * animation is over. + */ + @Test + fun testViewReceiveUpdatesWhenOneOfAnimationHasFinished() { + createAnimatedGraphWithAdditionNode(50, 100.0, 1000.0) + + val animationCallback: Callback = mock(Callback::class.java) + + // Start animating for the first addition input node, will have 2 frames only + val firstFrames: JavaOnlyArray = JavaOnlyArray.of(0.0, 1.0) + nativeAnimatedNodesManager.startAnimatingNode( + 1, + 1, + JavaOnlyMap.of("type", "frames", "frames", firstFrames, "toValue", 200.0), + animationCallback) + + // Start animating for the first addition input node, will have 6 frames + val secondFrames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) + nativeAnimatedNodesManager.startAnimatingNode( + 2, + 2, + JavaOnlyMap.of("type", "frames", "frames", secondFrames, "toValue", 1010.0), + animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1100.0) + + for (i in 1 until secondFrames.size()) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")) + .isEqualTo(1200.0 + secondFrames.getDouble(i) * 10.0) + } + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + @Test + fun testMultiplicationNode() { + nativeAnimatedNodesManager.createAnimatedNode( + 1, JavaOnlyMap.of("type", "value", "value", 1.0, "offset", 0.0)) + nativeAnimatedNodesManager.createAnimatedNode( + 2, JavaOnlyMap.of("type", "value", "value", 5.0, "offset", 0.0)) + + nativeAnimatedNodesManager.createAnimatedNode( + 3, JavaOnlyMap.of("type", "multiplication", "input", JavaOnlyArray.of(1, 2))) + + nativeAnimatedNodesManager.createAnimatedNode( + 4, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("translateX", 3))) + nativeAnimatedNodesManager.createAnimatedNode( + 5, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 4))) + nativeAnimatedNodesManager.connectAnimatedNodes(1, 3) + nativeAnimatedNodesManager.connectAnimatedNodes(2, 3) + nativeAnimatedNodesManager.connectAnimatedNodes(3, 4) + nativeAnimatedNodesManager.connectAnimatedNodes(4, 5) + nativeAnimatedNodesManager.connectAnimatedNodeToView(5, 50) + + val animationCallback: Callback = mock(Callback::class.java) + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 1.0) + nativeAnimatedNodesManager.startAnimatingNode( + 1, 1, JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 2.0), animationCallback) + + nativeAnimatedNodesManager.startAnimatingNode( + 2, + 2, + JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 10.0), + animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(5.0) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(20.0) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + /** + * This test verifies that when {@link NativeAnimatedModule#stopAnimation} is called the animation + * will no longer be updating the nodes it has been previously attached to and that the animation + * callback will be triggered with {@code {finished: false}} + */ + @Test + fun testHandleStoppingAnimation() { + createSimpleAnimatedViewWithOpacity(1000, 0.0) + + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) + val animationCallback: Callback = mock(Callback::class.java) + nativeAnimatedNodesManager.startAnimatingNode( + 404, + 1, + JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1.0), + animationCallback) + + val callbackResponseCaptor: ArgumentCaptor = + ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(animationCallback) + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock, times(2)) + .synchronouslyUpdateViewOnUIThread(anyInt(), any(ReadableMap::class.java)) + verifyNoMoreInteractions(animationCallback) + + reset(animationCallback) + reset(uiManagerMock) + nativeAnimatedNodesManager.stopAnimation(404) + verify(animationCallback).invoke(callbackResponseCaptor.capture()) + verifyNoMoreInteractions(animationCallback) + verifyNoMoreInteractions(uiManagerMock) + + assertThat(callbackResponseCaptor.getValue().hasKey("finished")).isTrue() + assertThat(callbackResponseCaptor.getValue().getBoolean("finished")).isFalse() + + reset(animationCallback) + reset(uiManagerMock) + // Run "update" loop a few more times -> we expect no further updates nor callback calls to + // be + // triggered + for (i in 0 until 5) { + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + } + + verifyNoMoreInteractions(uiManagerMock) + verifyNoMoreInteractions(animationCallback) + } + + @Test + fun testGetValue() { + val tag: Int = 1 + nativeAnimatedNodesManager.createAnimatedNode( + tag, JavaOnlyMap.of("type", "value", "value", 1.0, "offset", 0.0)) + + val saveValueCallbackMock: Callback = mock(Callback::class.java) + + nativeAnimatedNodesManager.getValue(tag, saveValueCallbackMock) + + verify(saveValueCallbackMock, times(1)).invoke(1.0) + } + + @Test + fun testInterpolationNode() { + nativeAnimatedNodesManager.createAnimatedNode( + 1, JavaOnlyMap.of("type", "value", "value", 10.0, "offset", 0.0)) + + nativeAnimatedNodesManager.createAnimatedNode( + 2, + JavaOnlyMap.of( + "type", + "interpolation", + "inputRange", + JavaOnlyArray.of(10.0, 20.0), + "outputRange", + JavaOnlyArray.of(0.0, 1.0), + "extrapolateLeft", + "extend", + "extrapolateRight", + "extend")) + + nativeAnimatedNodesManager.createAnimatedNode( + 3, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("opacity", 2))) + nativeAnimatedNodesManager.createAnimatedNode( + 4, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 3))) + nativeAnimatedNodesManager.connectAnimatedNodes(1, 2) + nativeAnimatedNodesManager.connectAnimatedNodes(2, 3) + nativeAnimatedNodesManager.connectAnimatedNodes(3, 4) + nativeAnimatedNodesManager.connectAnimatedNodeToView(4, 50) + + val animationCallback: Callback = mock(Callback::class.java) + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) + nativeAnimatedNodesManager.startAnimatingNode( + 1, + 1, + JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 20.0), + animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + for (i in 0 until frames.size()) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(frames.getDouble(i)) + } + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + private fun createScrollEvent(tag: Int, value: Double): Event> { + return object : Event>(tag) { + + override fun getEventName(): String { + return "topScroll" + } + + @Override + override fun dispatch(rctEventEmitter: RCTEventEmitter) { + rctEventEmitter.receiveEvent( + tag, "topScroll", JavaOnlyMap.of("contentOffset", JavaOnlyMap.of("y", value))) + } + } + } + + @Test + fun testNativeAnimatedEventDoUpdate() { + val viewTag: Int = 1000 + + createSimpleAnimatedViewWithOpacity(viewTag, 0.0) + + nativeAnimatedNodesManager.addAnimatedEventToView( + viewTag, + "onScroll", + JavaOnlyMap.of( + "animatedValueTag", 1, "nativeEventPath", JavaOnlyArray.of("contentOffset", "y"))) + + nativeAnimatedNodesManager.onEventDispatch(createScrollEvent(viewTag, 10.0)) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(10.0) + } + + @Test + fun testNativeAnimatedEventDoNotUpdate() { + val viewTag: Int = 1000 + + createSimpleAnimatedViewWithOpacity(viewTag, 0.0) + + nativeAnimatedNodesManager.addAnimatedEventToView( + viewTag, + "otherEvent", + JavaOnlyMap.of( + "animatedValueTag", 1, "nativeEventPath", JavaOnlyArray.of("contentOffset", "y"))) + + nativeAnimatedNodesManager.addAnimatedEventToView( + 999, + "topScroll", + JavaOnlyMap.of( + "animatedValueTag", 1, "nativeEventPath", JavaOnlyArray.of("contentOffset", "y"))) + + nativeAnimatedNodesManager.onEventDispatch(createScrollEvent(viewTag, 10.0)) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0.0) + } + + @Test + fun testNativeAnimatedEventCustomMapping() { + val viewTag: Int = 1000 + + whenever(uiManagerMock.getConstants()).thenAnswer { + MapBuilder.of( + "customDirectEventTypes", + MapBuilder.of("onScroll", MapBuilder.of("registrationName", "onScroll"))) + } + + nativeAnimatedNodesManager = NativeAnimatedNodesManager(reactApplicationContextMock) + + createSimpleAnimatedViewWithOpacity(viewTag, 0.0) + + nativeAnimatedNodesManager.addAnimatedEventToView( + viewTag, + "onScroll", + JavaOnlyMap.of( + "animatedValueTag", 1, "nativeEventPath", JavaOnlyArray.of("contentOffset", "y"))) + + nativeAnimatedNodesManager.onEventDispatch(createScrollEvent(viewTag, 10.0)) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(10.0) + } + + @Test + fun testRestoreDefaultProps() { + val viewTag: Int = 1001 + // restoreDefaultProps not called in Fabric, make sure it's a non-Fabric tag + val propsNodeTag: Int = 3 + nativeAnimatedNodesManager.createAnimatedNode( + 1, JavaOnlyMap.of("type", "value", "value", 1.0, "offset", 0.0)) + nativeAnimatedNodesManager.createAnimatedNode( + 2, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("opacity", 1))) + nativeAnimatedNodesManager.createAnimatedNode( + propsNodeTag, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 2))) + nativeAnimatedNodesManager.connectAnimatedNodes(1, 2) + nativeAnimatedNodesManager.connectAnimatedNodes(2, propsNodeTag) + nativeAnimatedNodesManager.connectAnimatedNodeToView(propsNodeTag, viewTag) + + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.5, 1.0) + val animationCallback: Callback = mock(Callback::class.java) + nativeAnimatedNodesManager.startAnimatingNode( + 1, 1, JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 0.0), animationCallback) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + for (i in 0 until frames.size()) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + } + + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0.0) + + reset(uiManagerMock) + nativeAnimatedNodesManager.restoreDefaultValues(propsNodeTag) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().isNull("opacity")) + } + + /** + * Creates a following graph of nodes: Value(3, initialValue) ----> Style(4) ---> Props(5) ---> + * View(viewTag) + * + *

Value(3) is set to track Value(1) via Tracking(2) node with the provided animation config + */ + private fun createAnimatedGraphWithTrackingNode( + viewTag: Int, + initialValue: Double, + animationConfig: JavaOnlyMap + ) { + nativeAnimatedNodesManager.createAnimatedNode( + 1, JavaOnlyMap.of("type", "value", "value", initialValue, "offset", 0.0)) + nativeAnimatedNodesManager.createAnimatedNode( + 3, JavaOnlyMap.of("type", "value", "value", initialValue, "offset", 0.0)) + + nativeAnimatedNodesManager.createAnimatedNode( + 2, + JavaOnlyMap.of( + "type", + "tracking", + "animationId", + 70, + "value", + 3, + "toValue", + 1, + "animationConfig", + animationConfig)) + + nativeAnimatedNodesManager.createAnimatedNode( + 4, JavaOnlyMap.of("type", "style", "style", JavaOnlyMap.of("translateX", 3))) + nativeAnimatedNodesManager.createAnimatedNode( + 5, JavaOnlyMap.of("type", "props", "props", JavaOnlyMap.of("style", 4))) + nativeAnimatedNodesManager.connectAnimatedNodes(1, 2) + nativeAnimatedNodesManager.connectAnimatedNodes(3, 4) + nativeAnimatedNodesManager.connectAnimatedNodes(4, 5) + nativeAnimatedNodesManager.connectAnimatedNodeToView(5, viewTag) + } + + /** + * In this test we verify that when value is being tracked we can update destination value in the + * middle of ongoing animation and the animation will update and animate to the new spot. This is + * tested using simple 5 frame backed timing animation. + */ + @Test + fun testTracking() { + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.25, 0.5, 0.75, 1) + val animationConfig: JavaOnlyMap = JavaOnlyMap.of("type", "frames", "frames", frames) + + createAnimatedGraphWithTrackingNode(1000, 0.0, animationConfig) + + val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) + + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(0.0) + + // update "toValue" to 100, we expect tracking animation to animate now from 0 to 100 in 5 + // steps + nativeAnimatedNodesManager.setAnimatedNodeValue(1, 100.0) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + // kick off the animation + + for (i in 0 until frames.size()) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")) + .isEqualTo(frames.getDouble(i) * 100.0) + } + + // update "toValue" to 0 but run only two frames from the animation, + // we expect tracking animation to animate now from 100 to 75 + nativeAnimatedNodesManager.setAnimatedNodeValue(1, 0.0) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + // kick off the animation + + for (i in 0 until 2) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")) + .isEqualTo(100 * (1 - frames.getDouble(i))) + } + + // at this point we expect tracking value to be at 75 + assertThat((nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).getValue()) + .isEqualTo(75.0) + + // we update "toValue" again to 100 and expect the animation to restart from the current + // place + nativeAnimatedNodesManager.setAnimatedNodeValue(1, 100.0) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + // kick off the animation + + for (i in 0 until frames.size()) { + reset(uiManagerMock) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) + assertThat(stylesCaptor.getValue().getDouble("translateX")) + .isEqualTo(50.0 + 50.0 * frames.getDouble(i)) + } + } + + /** + * In this test we verify that when tracking is set up for a given animated node and when the + * animation settles it will not be registered as an active animation and therefore will not + * consume resources on running the animation that has already completed. Then we verify that when + * the value updates the animation will resume as expected and the complete again when reaches the + * end. + */ + @Test + fun testTrackingPausesWhenEndValueIsReached() { + val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.5, 1.0) + val animationConfig: JavaOnlyMap = JavaOnlyMap.of("type", "frames", "frames", frames) + + createAnimatedGraphWithTrackingNode(1000, 0.0, animationConfig) + nativeAnimatedNodesManager.setAnimatedNodeValue(1, 100.0) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + // make sure animation starts + + reset(uiManagerMock) + for (i in 0 until frames.size()) { + assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isTrue() + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + } + verify(uiManagerMock, times(frames.size())) + .synchronouslyUpdateViewOnUIThread(eq(1000), any(ReadableMap::class.java)) + + // the animation has completed, we expect no updates to be done + reset(uiManagerMock) + assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isFalse() + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + + // we update end value and expect the animation to restart + nativeAnimatedNodesManager.setAnimatedNodeValue(1, 200.0) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + // make sure animation starts + + reset(uiManagerMock) + for (i in 0 until frames.size()) { + assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isTrue() + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + } + verify(uiManagerMock, times(frames.size())) + .synchronouslyUpdateViewOnUIThread(eq(1000), any(ReadableMap::class.java)) + + // the animation has completed, we expect no updates to be done + reset(uiManagerMock) + assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isFalse() + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + verifyNoMoreInteractions(uiManagerMock) + } + + /** + * In this test we verify that when tracking is configured to use spring animation and when the + * destination value updates the current speed of the animated value will be taken into account + * while updating the spring animation and it will smoothly transition to the new end value. + */ + @Test + fun testSpringTrackingRetainsSpeed() { + // this spring config corresponds to tension 20 and friction 0.5 which makes the spring + // settle + // very slowly + val springConfig: JavaOnlyMap = + JavaOnlyMap.of( + "type", + "spring", + "restSpeedThreshold", + 0.001, + "mass", + 1.0, + "restDisplacementThreshold", + 0.001, + "initialVelocity", + 0.5, + "damping", + 2.5, + "stiffness", + 157.8, + "overshootClamping", + false) + + createAnimatedGraphWithTrackingNode(1000, 0.0, springConfig) + + // update "toValue" to 1, we expect tracking animation to animate now from 0 to 1 + nativeAnimatedNodesManager.setAnimatedNodeValue(1, 1.0) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + + // we run several steps of animation until the value starts bouncing, has negative speed and + // passes the final point (that is 1) while going backwards + var isBoucingBack: Boolean = false + var previousValue: Double = + (nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).getValue() + for (i in 500 downTo 0) { + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + val currentValue: Double = + (nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).getValue() + if (previousValue >= 1.0 && currentValue < 1.0) { + isBoucingBack = true + break + } + previousValue = currentValue + } + assertThat(isBoucingBack).isTrue() + + // we now update "toValue" to 1.5 but since the value have negative speed and has also + // pretty + // low friction we expect it to keep going in the opposite direction for a few more frames + nativeAnimatedNodesManager.setAnimatedNodeValue(1, 1.5) + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + var bounceBackInitialFrames: Int = 0 + var hasTurnedForward: Boolean = false + + // we run 8 seconds of animation + for (i in 0 until 8 * 60) { + nativeAnimatedNodesManager.runUpdates(nextFrameTime()) + val currentValue: Double = + (nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).getValue() + if (!hasTurnedForward) { + if (currentValue <= previousValue) { + bounceBackInitialFrames++ + } else { + hasTurnedForward = true + } + } + previousValue = currentValue + } + assertThat(hasTurnedForward).isEqualTo(true) + assertThat(bounceBackInitialFrames).isGreaterThan(3) + + // we verify that the value settled at 2 + assertThat(previousValue).isEqualTo(1.5) + } +} From 9101e446150e8599d151991e598a8b82341d338b Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Mon, 19 Jun 2023 10:46:51 -0700 Subject: [PATCH 258/468] Expose react_utils via prefab to fix broken test_android (#37965) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37965 test_android is currently failing as we're not shipping the implementation of one of the symbol inside `react_utils` which is now accessed by the `ConcreteComponentDescriptor.h` file (used by the app project). Either we expose `react_utils` as a static library (.a) or as a dynamic library (.so). I've decided to go for the latter for the sake of saving space on user devices. Changelog: [Internal] [Changed] - Expose react_utils via prefab to fix broken test_android Reviewed By: sammy-SC Differential Revision: D46841689 fbshipit-source-id: a5467ca3a7ac2f26f7a5a2c4d6e161a391766b0d --- packages/react-native/ReactAndroid/build.gradle | 8 ++++++++ .../cmake-utils/ReactNative-application.cmake | 2 ++ 2 files changed, 10 insertions(+) diff --git a/packages/react-native/ReactAndroid/build.gradle b/packages/react-native/ReactAndroid/build.gradle index 25ba3cbcda958c..e88a41047cce6d 100644 --- a/packages/react-native/ReactAndroid/build.gradle +++ b/packages/react-native/ReactAndroid/build.gradle @@ -185,6 +185,10 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa new Pair("src/main/jni/react/jni", "react/jni/"), ] ), + new PrefabPreprocessingEntry( + "react_utils", + new Pair("../ReactCommon/react/utils/", "react/utils/"), + ), new PrefabPreprocessingEntry( "react_render_imagemanager", [ @@ -488,6 +492,7 @@ android { "runtimeexecutor", "react_codegen_rncore", "react_debug", + "react_utils", "react_render_componentregistry", "react_newarchdefaults", "react_render_animations", @@ -585,6 +590,9 @@ android { react_debug { headers(new File(prefabHeadersDir, "react_debug").absolutePath) } + react_utils { + headers(new File(prefabHeadersDir, "react_utils").absolutePath) + } react_render_componentregistry { headers(new File(prefabHeadersDir, "react_render_componentregistry").absolutePath) } diff --git a/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake b/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake index 2cb77c4f77d49f..a24bd464d51a40 100644 --- a/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake +++ b/packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake @@ -68,6 +68,7 @@ add_library(turbomodulejsijni ALIAS ReactAndroid::turbomodulejsijni) add_library(runtimeexecutor ALIAS ReactAndroid::runtimeexecutor) add_library(react_codegen_rncore ALIAS ReactAndroid::react_codegen_rncore) add_library(react_debug ALIAS ReactAndroid::react_debug) +add_library(react_utils ALIAS ReactAndroid::react_utils) add_library(react_render_componentregistry ALIAS ReactAndroid::react_render_componentregistry) add_library(react_newarchdefaults ALIAS ReactAndroid::react_newarchdefaults) add_library(react_render_core ALIAS ReactAndroid::react_render_core) @@ -95,6 +96,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME} jsi # prefab ready react_codegen_rncore # prefab ready react_debug # prefab ready + react_utils # prefab ready react_nativemodule_core # prefab ready react_newarchdefaults # prefab ready react_render_componentregistry # prefab ready From 187f16ddc66493c3046ceffed69e21c646dfa7b1 Mon Sep 17 00:00:00 2001 From: Graham Mendick Date: Mon, 19 Jun 2023 11:13:48 -0700 Subject: [PATCH 259/468] Support Android Transitions during Fragment navigation (#37857) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Adds support for Android Transitions during Fragment navigation. React Native navigation libraries (like [the Navigation router](https://github.com/grahammendick/navigation/blob/e9deae985a1962db17d6b1fbf90628d20c29810c/NavigationReactNative/src/android/src/main/java/com/navigation/reactnative/NavigationStackView.java#L139) and [React Native Screens](https://github.com/software-mansion/react-native-screens/blob/ea240b46866d66398904d0c2d0fe5fabdc2f269b/android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt#L98)) use Fragments to manage the stack of screens. But they can’t use Transitions to animate these Fragments because React Native images disappear during the Transition (see the videos in the Test Plan section below). Navigation libraries are forced to [setCustomAnimations](https://developer.android.com/reference/androidx/fragment/app/FragmentTransaction.html#setCustomAnimations(int,int)) instead of [enter and exit Transitions](https://developer.android.com/reference/android/app/Fragment#setEnterTransition(android.transition.Transition)). But animations have limitations compared to Transitions - Animations have to be resx files so can’t be defined declaratively in React - Android’s Material Transforms are built around Transitions - Native shared elements only support Transitions Images disappearing during Transitions is [a known Fresco bug](https://github.com/facebook/fresco/issues/2512). This PR applies [the fix suggested by the Fresco repo](https://github.com/facebook/fresco/issues/1445#issuecomment-315763953). ## Changelog: [ANDROID] [FIXED] - Support Android Transitions during Fragment navigation Pull Request resolved: https://github.com/facebook/react-native/pull/37857 Test Plan: I’ve created a [minimal reproduction that demonstrates the bug](https://github.com/grahammendick/image-disappears-during-transition-bug). The first video below shows the example from that repo. You can see that the image disappears when changing the painting. It should fade out and in like the text does. The second video shows the same example after the fix is applied. You can see that the painting fades out and in just like the text. https://github.com/facebook/react-native/assets/1761227/6739f029-eda0-44d2-b328-a73b075bd82a https://github.com/facebook/react-native/assets/1761227/9c73cdf0-303b-4a82-8df5-5f6a5846a58e Reviewed By: javache Differential Revision: D46769995 Pulled By: dmytrorykun fbshipit-source-id: 0ced8af7b246d8c59cbfb5cabf422114c6154c65 --- .../java/com/facebook/react/views/image/ReactImageView.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java index 30a6ed20bdf546..da4fad4b4c7c97 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java @@ -152,6 +152,9 @@ public ReactImageView( mDraweeControllerBuilder = draweeControllerBuilder; mGlobalImageLoadListener = globalImageLoadListener; mCallerContext = callerContext; + // Workaround Android bug where ImageView visibility is not propagated to the Drawable, so you + // have to manually update visibility. Will be resolved once we move to VitoView. + setLegacyVisibilityHandlingEnabled(true); } public void setShouldNotifyLoadEvents(boolean shouldNotify) { From c2ca91db9f0fb4bcbc07ec0aba7cb27f15b3648a Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 12:34:01 -0700 Subject: [PATCH 260/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907902962069 Sandcastle Job Instance ID: 22517999111494527 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46845052 fbshipit-source-id: d83c36e5ed7186b2b95883c9bb8755c11e02e7b5 --- .../strings/de.lproj/fbt_language_pack.bin | Bin 1308 -> 1308 bytes .../strings/hr.lproj/fbt_language_pack.bin | Bin 0 -> 1352 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/react-native/React/I18n/strings/hr.lproj/fbt_language_pack.bin diff --git a/packages/react-native/React/I18n/strings/de.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/de.lproj/fbt_language_pack.bin index b41367fa6093b853980b49fd67ead6aa7cd5f4c4..ce2967d2c9223dee617487d6ee3783d3d29e26df 100644 GIT binary patch delta 26 hcmbQkHHT}%0!CgA1_lO~qSTDE)SMKC&1)I+nE_?L2c!T1 delta 26 hcmbQkHHT}%0!Cg=1_lO~qSTD+y!?W+&1)I+nE`1e2q*vm diff --git a/packages/react-native/React/I18n/strings/hr.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/hr.lproj/fbt_language_pack.bin new file mode 100644 index 0000000000000000000000000000000000000000..de41c0ea6d31335982a36f25b02637c1c1ec065c GIT binary patch literal 1352 zcmaKsKTH!*9LFEpAQDteh+$y3p(7-%Ee#|t1;m2aQVT_Nfp_f{Ua$9uyXy%zIWV}e zIWRa#;^5%G$YhKunppA3)DCR$KU|$fDOQFkMQxpcZ_icI^YPr0k41$Hh>DIKoSgt zUl{isoC5xCAHV_N@8^Ki-T+zuQ~k@%8eIw!>huP_tc&ZAAs}A{~))8#&RW6pLbPpU>{A@c90E zJ`Ids_wL-u<<;D~eMNQHW5OFiUl~P{WJUZg+Jhnc- zeC=al@=e6~+KYMg);@_Zw4MCG_9N` zHLI;=bCuG()R|!Qg|?8XNWEA{PcJu$>piWl)#|1jolRaZm^B*Na55$RIb&(!(Hz~D zdNH@@t6IJ#^~1?*VK!}NrCu-Q7K&afkh(a%-fmZSdgDE-rI)Lz+NSjF)u)s5vqn>D zcWyUr&~QTPLRfCDF>#b5_I;dBrc9zW2c4`MFpu0YeCuT0ct38%_ z!f565+3Ittt%_GzQx{ObKl*R=!{F=RC!U|he)3qUs;YS4{}tcIMD#!7{*Qlh2cw$2 L4?mwgCtl|-9+w_z literal 0 HcmV?d00001 From 8eab55bf1580dd54052903e4ac88982f9b26e050 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 12:49:35 -0700 Subject: [PATCH 261/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368381932 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46845217 fbshipit-source-id: 5a1c23d043eead133667867c4d9b34efc578eb63 --- .../src/main/res/views/uimanager/values-bg/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-bs/strings.xml | 1 + .../src/main/res/views/uimanager/values-et/strings.xml | 9 +++++++++ .../src/main/res/views/uimanager/values-iw/strings.xml | 9 +++++++++ .../src/main/res/views/uimanager/values-kn/strings.xml | 1 + .../src/main/res/views/uimanager/values-mk/strings.xml | 2 ++ .../src/main/res/views/uimanager/values-pa/strings.xml | 4 ++++ 7 files changed, 30 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml index 09b7b31c671dab..cb87543f716460 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml @@ -3,4 +3,8 @@ + заето + разширено + свито + смесено diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bs/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bs/strings.xml index 6360c5c0799ee6..0cf19ab9da7128 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bs/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bs/strings.xml @@ -3,4 +3,5 @@ + skupljeno diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml index e17476d14d8823..3ed2f53c3bfc8c 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml @@ -3,4 +3,13 @@ + Nupp, pilt + Hoiatus + Liitboks + Edenemisriba + Raadionuppude grupp + Pööramisnupp + Taimer + ahendatud + väljas diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml index c87b7ee2815a27..d1c1a72d24ffc2 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml @@ -3,8 +3,17 @@ + לחצן, תמונה + כותרת + התראה + תיבה משולבת + סרגל התקדמות + קבוצת רדיו + לחצן מסתובב + טיימר תפוס מורחב מצומצם + כבוי משולב diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml index eb9df77099b6ee..016a8df171aeaf 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml @@ -6,4 +6,5 @@ ಕಾರ್ಯನಿರತ ವಿಸ್ತರಿಸಲಾಗಿದೆ ಮುಚ್ಚಿದೆ + ಬಗೆಬಗೆಯ diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml index 1c76e1bb07c64e..5a62600cc41f21 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml @@ -3,4 +3,6 @@ + Копче, слика + исклучено diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml index ea45e686429267..06ddf2bd560542 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml @@ -3,4 +3,8 @@ + ਵਿਅਸਤ + ਵਿਸਤਾਰ ਕੀਤਾ ਗਿਆ + ਸਮੇਟਿਆ ਗਿਆ + ਮਿਕਸਡ From 14ef6328ca7f1231ab48be00869d6aa954dfc558 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 12:49:35 -0700 Subject: [PATCH 262/468] translation auto-update for i18n/twilight.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368381932 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46845220 fbshipit-source-id: 1364a2fe866162b10466ec62dab0d5446f067def --- .../res/views/uimanager/values-nl/strings.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml index 931367c9ed5542..feeed53f1ae50d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nl/strings.xml @@ -3,8 +3,26 @@ + Afbeelding + Knop, afbeelding + Kop + Waarschuwing + Combivak + Menubalk + Menu-item + Voortgangsbalk + Keuzegroep + Scrollbalk + Draaiknop + Tabblad + Lijst met tabbladen + Werkbalk + Samenvatting bezig uitgevouwen samengevouwen + gedeselecteerd + aan + uit gemengd From 91fc35997488c4ad8ed753b09fb3d565a2eacbe1 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 12:49:35 -0700 Subject: [PATCH 263/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368381932 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46845211 fbshipit-source-id: 175119b90703ae249a422a2c277b614cac896bf6 --- .../views/uimanager/values-fr-rCA/strings.xml | 1 + .../res/views/uimanager/values-hr/strings.xml | 4 ++++ .../res/views/uimanager/values-uk/strings.xml | 21 +++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml index 3c614c4ff83792..4b1ddb0255be18 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml @@ -3,6 +3,7 @@ + Zone combinée en cours de traitement agrandi réduit diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml index 97250a3e1f6a4c..3630a6b4a56717 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml @@ -3,4 +3,8 @@ + zauzeto + prošireno + sažeto + mješovito diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml index 2777a19c5cdb6b..02c3e74feae637 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uk/strings.xml @@ -3,8 +3,29 @@ + Посилання + Зображення + Кнопка, зображення + Заголовок + Сповіщення + Комбінований список + Меню + Рядок меню + Об\'єкт меню + Індикатор прогресу + Група перемикачів + Прокручування + Кнопка обертання + Вкладка + Список вкладок + Таймер + Панель інструментів + Зведення зайнято розгорнуто згорнуто + не вибрано + Увімк. + Вимк. змішано From 356db63c9eb64112466cc76b6b410abfbd5d5820 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 12:49:35 -0700 Subject: [PATCH 264/468] translation auto-update for i18n/oculus-mirage.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368381932 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46845205 fbshipit-source-id: 596000b53f9661cb100bfda2f01b5b38dc002325 --- .../res/views/uimanager/values-de/strings.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml index ffeb4ff1f96bee..d27292ddce5b9d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml @@ -3,8 +3,26 @@ + Bild + Button, Bild + Überschrift + Warnhinweis + Kombinationsfeld + Menü + Menüleiste + Menüpunkt + Statusanzeige + Gruppe von Buttons + Scroll-Leiste + Drehfeld + Tab-Liste + Symbolleiste + Übersicht in Gebrauch eingeblendet ausgeblendet + nicht ausgewählt + ein + aus gemischt From c7ffb5ee3117ec118b98afb21b2a62494f006fe7 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 12:49:35 -0700 Subject: [PATCH 265/468] translation auto-update for i18n/messenger.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368381932 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46845215 fbshipit-source-id: 2470fffb563b349c2e8cc75043ce5aa539899ea7 --- .../res/views/uimanager/values-ml/strings.xml | 25 +++++++++++++++++++ .../res/views/uimanager/values-mr/strings.xml | 4 +++ 2 files changed, 29 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ml/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ml/strings.xml index 5d568f33232987..a9aa446a89b7a8 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ml/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ml/strings.xml @@ -3,4 +3,29 @@ + ലിങ്ക് + ചിത്രം + ബട്ടൺ, ചിത്രം + തലക്കെട്ട് + അലേർട്ട് + കോംബോ ബോക്‌സ് + മെനു + മെനു ബാർ + മെനു ഇനം + പുരോഗതി ബാർ + റേഡിയോ ഗ്രൂപ്പ് + സ്‌ക്രോൾ ബാർ + കറക്കുക ബട്ടൺ + ടാബ് + ടാബ് ലിസ്‌റ്റ് + ടൈമർ + ടൂൾ ബാർ + സംഗ്രഹം + തിരക്കിലാണ് + വിപുലീകരിച്ചു + ചുരുക്കി + തിരഞ്ഞെടുത്തത് മാറ്റി + ഓണാണ് + ഓഫാണ് + മിശ്രിതം diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml index fe3b5c4a6e926c..bf953bf7a29598 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mr/strings.xml @@ -21,7 +21,11 @@ टायमर टूल बार सारांश + व्यग्र + विस्तारित केले + संकुचित केले निवड रद्द केलेले चालू बंद + मिश्र From 33deed518901623ce1facde6836fa6851ff72252 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 12:49:35 -0700 Subject: [PATCH 266/468] translation auto-update for i18n/anna.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368381932 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46845202 fbshipit-source-id: 94829405e039039335d93e16b8b5d0c947b7ae62 --- .../res/views/uimanager/values-sw/strings.xml | 9 ++++++++ .../res/views/uimanager/values-ta/strings.xml | 21 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml index 6dea5b85bb9a65..d7c4b54c2d5e34 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml @@ -3,4 +3,13 @@ + Kitufe, Picha + Arifa + Kisanduku cha Combo + Upau wa Hatua + Kundi la Redio + Kitufe cha Kuzungusha + Kipima muda + imekunjwa + imezimwa diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml index f8bfd1c350e5e0..1e7ca80a14e9e9 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml @@ -3,4 +3,25 @@ + இணைப்பு + படம் + பொத்தான், படம் + தலைப்பு + நினைவூட்டல் + காம்போ பெட்டி + மெனு + மெனு பட்டி + மெனு பொருள் + போக்கு பட்டி + ரேடியோ குழு + உருட்டுப்பட்டி + ஸ்பின் பட்டன் + பிரிவு + பிரிவுப் பட்டியல் + டைமர் + கருவிப்பட்டி + சுருக்கம் + தேர்வுநீக்கப்பட்டது + ஆன் + ஆஃப் From 5364d998c42ed91a1f4d0cfc608a98b298ac95ae Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 18:32:32 -0700 Subject: [PATCH 267/468] translation auto-update for i18n/creatorstudio.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368528448 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46848290 fbshipit-source-id: d30538d8600e6254807cd9a1e87a1a25fe7560ce --- .../res/views/uimanager/values-da/strings.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml index d6ac1ca4d59549..6c51adb91eca54 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-da/strings.xml @@ -3,8 +3,26 @@ + Billede + Knap, billede + Overskrift + Underretning + Kombinationsboks + Menulinje + Menupunkt + Statuslinje + Radiogruppe + Rullelinje + Snurreknap + Fane + Liste over faner + Værktøjslinje + Oversigt optaget udvidet skjult + fravalgt + til + fra blandet From 89fe0949eb2de76edb7cdf82a9e026e285b377be Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 18:32:32 -0700 Subject: [PATCH 268/468] translation auto-update for i18n/anna.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368528448 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46848278 fbshipit-source-id: 769c652370d32816181f968a56984aa08f90edb8 --- .../src/main/res/views/uimanager/values-af/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml index 24e1b69fe6b4ef..d3c5b193cf5cb8 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml @@ -3,4 +3,8 @@ + besig + is uitgevou + is ingevou + is gemeng From fb74710f98512f97e144998899d8d0691aa39f84 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 18:32:32 -0700 Subject: [PATCH 269/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368528448 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46848275 fbshipit-source-id: e26c951abe26d38f9d94306496830dcc294dad74 --- .../res/views/uimanager/values-hi/strings.xml | 21 +++++++++++++++++++ .../res/views/uimanager/values-sv/strings.xml | 20 ++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml index 7fa9a41c23edb5..17e5277843ad9d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hi/strings.xml @@ -3,8 +3,29 @@ + लिंक + फ़ोटो + बटन, फ़ोटो + शीर्षक + अलर्ट + कॉम्बो बॉक्स + मेनू + मेनू बार + मेनू आइटम + प्रोग्रेस बार + रेडियो ग्रुप + स्क्रॉल बार + स्पिन बटन + टैब + टैब लिस्ट + टाइमर + टूल बार + सारांश व्यस्त बड़ा किया गया छोटा किया गया + नहीं चुने गए + चालू है + बंद है मिक्स diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml index dcd33103a931e3..436c66aaa4f86f 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml @@ -3,8 +3,28 @@ + Länk + Bild + Knapp, bild + Rubrik + Avisering + Kombinationsruta + Meny + Menyfält + Menyobjekt + Förloppsfält + Alternativgrupp + Bläddringslist + Rotationsknapp + Flik + Fliklista + Verktygsfält + Sammanfattning upptagen utökad minimerad + avmarkerad + + av blandad From 3b86071691b633864d638ae99b3c67436542675c Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 18:32:32 -0700 Subject: [PATCH 270/468] translation auto-update for i18n/barcelona.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368528448 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46848279 fbshipit-source-id: 1ad04f3fb45a6c9cdb41bd403189bb5be6666d2a --- .../res/views/uimanager/values-ru/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml index c8b37daf6d5555..8d1e8856c1ef46 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml @@ -3,8 +3,29 @@ + Ссылка + Изображение + Кнопка, изображение + Заголовок + Оповещение + Комбинированное поле + Меню + Панель меню + Элемент меню + Индикатор прогресса + Группа кнопок-переключателей + Полоса прокрутки + Кнопка кольцевого списка + Вкладка + Список вкладок + Таймер + Панель инструментов + Сводка занято развернуто свернуто + не выбрано + вкл + выкл смешанный From 4cb93999b4a4e05536e4a2f4da1dd9c64293148c Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 18:32:32 -0700 Subject: [PATCH 271/468] translation auto-update for i18n/portal_ar.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368528448 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46848291 fbshipit-source-id: 3f21c94d4c988d225efe8da02a67a75de08ece4a --- .../views/uimanager/values-zh-rTW/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml index f9f52e8dcb39dc..95b51c40a54195 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rTW/strings.xml @@ -3,8 +3,29 @@ + 連結 + 圖像 + 圖像,按鈕 + 標題 + 提醒 + 下拉式方塊 + 功能表 + 功能表列 + 功能表項目 + 進度列 + 選項按鈕群組 + 捲軸 + 微調按鈕 + 頁籤 + 頁籤清單 + 計時器 + 工具列 + 摘要 忙線中 已展開 已收合 + 已取消選取 + 開啟 + 關閉 混合 From 5c1eaa3d023b4bb340e9685a0364facf8c6c2992 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 18:32:32 -0700 Subject: [PATCH 272/468] translation auto-update for i18n/portal_async.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368528448 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46848286 fbshipit-source-id: ee5504773a7fde305442ccbb68ef3a2bd510b00f --- .../views/uimanager/values-fr-rCA/strings.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml index 4b1ddb0255be18..116e8fc71442b2 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr-rCA/strings.xml @@ -3,9 +3,27 @@ + Lien + Bouton, image + Titre + Alerte Zone combinée + Barre de menu + Option de menu + Barre de progression + Groupe de boutons radio + Barre de déroulement + Bouton compteur circulaire + Onglet + Liste des onglets + Minuterie + Barre d’outils + Résumé en cours de traitement agrandi réduit + désélectionné + activé + désactivé à double état From 7ec1d6699b5e491b2a7ae1a42bea07f9bea8e4c8 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 18:32:32 -0700 Subject: [PATCH 273/468] translation auto-update for i18n/analyticsapp.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368528448 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46848273 fbshipit-source-id: a895d120d90260cf4f1e88f1afc96fa3241b7eb4 --- .../res/views/uimanager/values-cs/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml index 7498fae942c3aa..53b972bbfd8f41 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-cs/strings.xml @@ -3,8 +3,29 @@ + Odkaz + Obrázek + Tlačítko, obrázek + Nadpis + Výstraha + Kombinované pole + Nabídka + Panel nabídky + Položka nabídky + Ukazatel postupu + Skupina přepínačů + Posuvník + Číselník + Karta + Seznam karet + Časovač + Panel nástrojů + Přehled zaneprázdněno rozbaleno sbaleno + nevybráno + zap + vyp oboje From 4db3ed9ff195d7d3d1ee2b1d2edfbee521c46517 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 18:32:32 -0700 Subject: [PATCH 274/468] translation auto-update for i18n/pages-manager.config.json on master Summary: Chronos Job Instance ID: 1125907902915429 Sandcastle Job Instance ID: 31525198368528448 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46848285 fbshipit-source-id: 8062843cd18a89a1c10b0a83d403fae81ff28135 --- .../main/res/views/uimanager/values-gu/strings.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml index a20ac06e9e7291..737791466d55af 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml @@ -3,8 +3,21 @@ + શીર્ષક + એલર્ટ + મેનૂ બાર + મેનૂ આઇટમ + પ્રગતિ બાર + રેડિયો ગ્રૂપ + સ્ક્રોલ બાર + ટેબ લિસ્ટ + ટૂલ બાર + સારાંશ વ્યસ્ત વિસ્તૃત નાનું + પસંદગીમાંથી કાઢી નાખ્યું + ચાલુ + બંધ મિક્સ કરેલ From 0e1a82f4b74af9d04993747807a5bfce273b3f4b Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Mon, 19 Jun 2023 18:42:19 -0700 Subject: [PATCH 275/468] Change to to make it work in OSS (#37661) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37661 ~~As title, Hermes will be supported. JSC not yet.~~ **Update 8th June:** Split the original diff to 3 diffs, this one will simply change the head file path. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D46324942 fbshipit-source-id: ab2e54d0d8104d635b2405a818d5413adba304a6 --- .../main/jni/react/bridgeless/hermes/jni/JHermesInstance.cpp | 2 +- .../main/jni/react/bridgeless/hermes/jni/JHermesInstance.h | 2 +- .../src/main/jni/react/bridgeless/hermes/jni/OnLoad.cpp | 5 ++--- .../src/main/jni/react/bridgeless/jni/JBindingsInstaller.h | 2 +- .../src/main/jni/react/bridgeless/jni/JJSEngineInstance.h | 2 +- .../src/main/jni/react/bridgeless/jni/JJSTimerExecutor.cpp | 2 +- .../src/main/jni/react/bridgeless/jni/JJSTimerExecutor.h | 2 +- .../src/main/jni/react/bridgeless/jni/JJavaTimerManager.cpp | 2 +- .../src/main/jni/react/bridgeless/jni/JJavaTimerManager.h | 2 +- .../main/jni/react/bridgeless/jni/JReactExceptionManager.cpp | 2 +- .../main/jni/react/bridgeless/jni/JReactExceptionManager.h | 2 +- .../src/main/jni/react/bridgeless/jni/JReactInstance.cpp | 2 +- .../src/main/jni/react/bridgeless/jni/JReactInstance.h | 2 +- .../src/main/jni/react/bridgeless/jni/JavaTimerRegistry.h | 2 +- .../src/main/jni/react/bridgeless/jni/OnLoad.cpp | 5 ++--- 15 files changed, 17 insertions(+), 19 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/JHermesInstance.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/JHermesInstance.cpp index 4c04821a75e5c6..4095d9cd605113 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/JHermesInstance.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/JHermesInstance.cpp @@ -7,7 +7,7 @@ #include "JHermesInstance.h" -#include +#include namespace facebook::react { diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/JHermesInstance.h b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/JHermesInstance.h index 117556998971d0..2fbc73a45cd011 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/JHermesInstance.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/JHermesInstance.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/OnLoad.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/OnLoad.cpp index 136b1a09d123e6..f6aa11c21da613 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/OnLoad.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/OnLoad.cpp @@ -5,12 +5,11 @@ * LICENSE file in the root directory of this source tree. */ -#include -#include +#include #include "JHermesInstance.h" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { - return facebook::xplat::initialize( + return facebook::jni::initialize( vm, [] { facebook::react::JHermesInstance::registerNatives(); }); } diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JBindingsInstaller.h b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JBindingsInstaller.h index cc632469ba7f1e..1048f67b93f3e3 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JBindingsInstaller.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JBindingsInstaller.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include #include diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSEngineInstance.h b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSEngineInstance.h index ba4d66cfea0c99..8d1463cb5cd83c 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSEngineInstance.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSEngineInstance.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.cpp index ebd93d2d49b9fe..b628d738aaa576 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.cpp @@ -7,7 +7,7 @@ #include "JJSTimerExecutor.h" -#include +#include #include namespace facebook::react { diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.h b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.h index 3da6a77b1f8217..9436e71daad4f4 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.h @@ -8,7 +8,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJavaTimerManager.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJavaTimerManager.cpp index 638f664cc782ce..b54da9b159130a 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJavaTimerManager.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJavaTimerManager.cpp @@ -7,7 +7,7 @@ #include "JJavaTimerManager.h" -#include +#include #include namespace facebook::react { diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJavaTimerManager.h b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJavaTimerManager.h index d44cec367fc795..e576a1f892a553 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJavaTimerManager.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJavaTimerManager.h @@ -9,7 +9,7 @@ #include -#include +#include #include namespace facebook::react { diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactExceptionManager.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactExceptionManager.cpp index a8968d77bcc1aa..21cc5d52d3bfe8 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactExceptionManager.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactExceptionManager.cpp @@ -6,7 +6,7 @@ */ #include "JReactExceptionManager.h" -#include +#include #include #include #include diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactExceptionManager.h b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactExceptionManager.h index 23b4ea46b900a4..f84b068e70554f 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactExceptionManager.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactExceptionManager.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactInstance.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactInstance.cpp index 4df09482a59492..e5d2f4c6d07934 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactInstance.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactInstance.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactInstance.h b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactInstance.h index 99e7d80ebb8778..652dc7234f4933 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactInstance.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JReactInstance.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JavaTimerRegistry.h b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JavaTimerRegistry.h index ae89a5296f8b5f..943b9bc4835dcb 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JavaTimerRegistry.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JavaTimerRegistry.h @@ -9,7 +9,7 @@ #include -#include +#include #include #include "JJavaTimerManager.h" diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/OnLoad.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/OnLoad.cpp index 171de6b35e31f1..e8dfb19f5b233f 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/OnLoad.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/OnLoad.cpp @@ -5,15 +5,14 @@ * LICENSE file in the root directory of this source tree. */ -#include -#include +#include #include #include "JJSTimerExecutor.h" #include "JReactInstance.h" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void * /*unused*/) { - return facebook::xplat::initialize(vm, [] { + return facebook::jni::initialize(vm, [] { facebook::react::JReactMarker::setLogPerfMarkerIfNeeded(); facebook::react::JReactInstance::registerNatives(); facebook::react::JJSTimerExecutor::registerNatives(); From a3c7102d5c03e623b0967e62dc0be30cd706928f Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Mon, 19 Jun 2023 20:00:03 -0700 Subject: [PATCH 276/468] Add a separate HermesInstance for internal (#37968) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37968 Currently we have 2 versions of JSITracing: - [Internal](https://www.internalfb.com/code/fbsource/[06c0641fed51160887cdaec18d22dd39d11ee1c0]/xplat/ReactNative/react/jsi/JSITracing.h) - [OSS](https://www.internalfb.com/code/fbsource/[06c0641fed51160887cdaec18d22dd39d11ee1c0]/xplat/js/react-native-github/packages/react-native/ReactCommon/hermes/executor/JSITracing.h) After talking with rubennorte it's expected that the OSS version has empty implementation and we want to keep it this way for Bridgeless as well. To include both OSS and internal JSITracing for Bridgeless, in this diff a duplicate internal HermesInstance is created, after this change: - Internal HermesInstance will use existed internal JSITracing - OSS HermesInstance will use existed OSS JSITracing The newly created internal HermesInstance will be located in existed internal Hermes folder which was created for the Bridge. **Is there a better way to solve this issue?** - I thought about including both versions of JSITracing in ReactInstance.cpp but couldn't find a way to unify the including paths for JSITracing.h inside ReactInstance.cpp Changelog: [Internal] Reviewed By: cortinico Differential Revision: D46527522 fbshipit-source-id: 7d2c14a6313e89bf5daaf668867cae31442e81b1 --- .../ReactCommon/react/bridgeless/ReactInstance.cpp | 4 ---- .../ReactCommon/react/bridgeless/hermes/HermesInstance.cpp | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactCommon/react/bridgeless/ReactInstance.cpp b/packages/react-native/ReactCommon/react/bridgeless/ReactInstance.cpp index 07edae1f8dcc00..4f0b96e4106741 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/ReactInstance.cpp +++ b/packages/react-native/ReactCommon/react/bridgeless/ReactInstance.cpp @@ -13,8 +13,6 @@ #include #include #include -#include -#include #include #include @@ -321,8 +319,6 @@ void defineReactInstanceFlags( ReactInstance::JSRuntimeFlags options) noexcept { defineReadOnlyGlobal(runtime, "RN$Bridgeless", jsi::Value(true)); - jsi::addNativeTracingHooks(runtime); - if (options.isProfiling) { defineReadOnlyGlobal(runtime, "__RCTProfileIsProfiling", jsi::Value(true)); } diff --git a/packages/react-native/ReactCommon/react/bridgeless/hermes/HermesInstance.cpp b/packages/react-native/ReactCommon/react/bridgeless/hermes/HermesInstance.cpp index 6b73c1a91c420d..5a2fd57c06082e 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/hermes/HermesInstance.cpp +++ b/packages/react-native/ReactCommon/react/bridgeless/hermes/HermesInstance.cpp @@ -7,6 +7,7 @@ #include "HermesInstance.h" +#include #include #ifdef HERMES_ENABLE_DEBUGGER @@ -115,6 +116,8 @@ std::unique_ptr HermesInstance::createJSRuntime( return decoratedRuntime; #endif + jsi::addNativeTracingHooks(*hermesRuntime); + return hermesRuntime; } From 739c084e3bec796e1a3ff442a7466046925f175c Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Mon, 19 Jun 2023 20:41:01 -0700 Subject: [PATCH 277/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907903072414 Sandcastle Job Instance ID: 27021598739221974 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46849012 fbshipit-source-id: 6ba7a9c055b751328431f005ef7429c9ab4bb2f1 --- .../strings/es-ES.lproj/fbt_language_pack.bin | Bin 1368 -> 1368 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/react-native/React/I18n/strings/es-ES.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/es-ES.lproj/fbt_language_pack.bin index 49767974f575a8472434948a7f64e1c52cf66e73..c934ef2c41e7a9196b1865daacbd0477dcdcdb34 100644 GIT binary patch delta 14 Vcmcb?b%Sez5i?`{W@BbmCIBYs1S$Xk delta 14 Vcmcb?b%Sez5i?`rW@BbmCIBXt1RMYW From 28c26dc30533180c6c0ac10836ea60d889a6114d Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Mon, 19 Jun 2023 21:31:07 -0700 Subject: [PATCH 278/468] Add CMakeLists to build C++ files in OSS (#37969) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37969 Add CMakeLists to build Bridgeless C++ files in OSS Changelog: [Internal] Reviewed By: cortinico Differential Revision: D46527523 fbshipit-source-id: 93427732461f8efdeff671bff86557ecde5eea47 --- .../react-native/ReactAndroid/build.gradle | 24 +++++++++++- .../ReactAndroid/gradle.properties | 1 + .../ReactAndroid/src/main/jni/CMakeLists.txt | 22 +++++------ .../bridgeless/hermes/jni/CMakeLists.txt | 29 +++++++++++++++ .../jni/react/bridgeless/jni/CMakeLists.txt | 31 ++++++++++++++++ .../react/bridgeless/jni/JJSTimerExecutor.cpp | 1 - .../ReactCommon/jserrorhandler/CMakeLists.txt | 22 +++++++++++ .../react/bridgeless/CMakeLists.txt | 37 +++++++++++++++++++ .../react/bridgeless/hermes/CMakeLists.txt | 25 +++++++++++++ .../react/bridgeless/hermes/HermesInstance.h | 2 +- .../tests/cxx/ReactInstanceTest.cpp | 2 +- .../ReactCommon/react/bridging/CMakeLists.txt | 2 +- .../componentregistry/native/CMakeLists.txt | 1 + 13 files changed, 183 insertions(+), 16 deletions(-) create mode 100644 packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/CMakeLists.txt create mode 100644 packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/CMakeLists.txt create mode 100644 packages/react-native/ReactCommon/jserrorhandler/CMakeLists.txt create mode 100644 packages/react-native/ReactCommon/react/bridgeless/CMakeLists.txt create mode 100644 packages/react-native/ReactCommon/react/bridgeless/hermes/CMakeLists.txt diff --git a/packages/react-native/ReactAndroid/build.gradle b/packages/react-native/ReactAndroid/build.gradle index e88a41047cce6d..5a189eac11e29c 100644 --- a/packages/react-native/ReactAndroid/build.gradle +++ b/packages/react-native/ReactAndroid/build.gradle @@ -336,6 +336,23 @@ task downloadGlog(dependsOn: createNativeDepsDirectories, type: Download) { dest(new File(downloadsDir, "glog-${GLOG_VERSION}.tar.gz")) } +task downloadGtest(dependsOn: createNativeDepsDirectories, type: Download) { + src("https://github.com/google/googletest/archive/refs/tags/release-${GTEST_VERSION}.tar.gz") + onlyIfModified(true) + overwrite(false) + retries(5) + dest(new File(downloadsDir, "gtest.tar.gz")) +} + +task prepareGtest(dependsOn: dependenciesPath ? [] : [downloadGtest], type: Copy) { + from(dependenciesPath ?: tarTree(downloadGtest.dest)) + eachFile { fname -> { + fname.path = (fname.path - "googletest-release-${GTEST_VERSION}/") + } + } + into(new File(thirdPartyNdkDir,"googletest")) +} + // Prepare glog sources to be compiled, this task will perform steps that normally should've been // executed by automake. This way we can avoid dependencies on make/automake final def prepareGlog = tasks.register("prepareGlog", PrepareGlogTask) { @@ -360,6 +377,7 @@ task downloadNdkBuildDependencies { dependsOn(downloadGlog) dependsOn(downloadFmt) dependsOn(downloadLibevent) + dependsOn(downloadGtest) } /** @@ -485,6 +503,10 @@ android { targets "jsijniprofiler", "reactnativeblob", "reactperfloggerjni", + "bridgeless", + "rninstance", + "hermesinstancejni", + "uimanagerjni", // prefab targets "reactnativejni", "react_render_debug", @@ -541,7 +563,7 @@ android { } } - preBuild.dependsOn(prepareJSC, prepareBoost, prepareDoubleConversion, prepareFmt, prepareFolly, prepareGlog, prepareLibevent) + preBuild.dependsOn(prepareJSC, prepareBoost, prepareDoubleConversion, prepareFmt, prepareFolly, prepareGlog, prepareLibevent, prepareGtest) preBuild.dependsOn("generateCodegenArtifactsFromSchema") preBuild.dependsOn(preparePrefab) diff --git a/packages/react-native/ReactAndroid/gradle.properties b/packages/react-native/ReactAndroid/gradle.properties index 5843fa9dfbb21a..3cdc947328b8ca 100644 --- a/packages/react-native/ReactAndroid/gradle.properties +++ b/packages/react-native/ReactAndroid/gradle.properties @@ -29,6 +29,7 @@ FMT_VERSION=6.2.1 FOLLY_VERSION=2021.07.22.00 GLOG_VERSION=0.3.5 LIBEVENT_VERSION=2.1.12 +GTEST_VERSION=1.12.1 android.useAndroidX=true android.enableJetifier=true diff --git a/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt b/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt index f97a1a2ee278db..ea61441a641ba1 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt +++ b/packages/react-native/ReactAndroid/src/main/jni/CMakeLists.txt @@ -48,6 +48,7 @@ add_react_third_party_ndk_subdir(fmt) add_react_third_party_ndk_subdir(libevent) add_react_third_party_ndk_subdir(folly) add_react_third_party_ndk_subdir(jsc) +add_react_third_party_ndk_subdir(googletest) # Common targets add_react_common_subdir(yoga) @@ -97,6 +98,9 @@ add_react_common_subdir(react/utils) add_react_common_subdir(react/bridging) add_react_common_subdir(react/renderer/mapbuffer) add_react_common_subdir(react/nativemodule/core) +add_react_common_subdir(jserrorhandler) +add_react_common_subdir(react/bridgeless) +add_react_common_subdir(react/bridgeless/hermes) # ReactAndroid JNI targets add_react_build_subdir(generated/source/codegen/jni) @@ -114,12 +118,8 @@ add_react_android_subdir(src/main/jni/react/fabric) add_react_android_subdir(src/main/jni/react/newarchdefaults) add_react_android_subdir(src/main/jni/react/hermes/reactexecutor) add_react_android_subdir(src/main/jni/react/hermes/instrumentation/) - -# GTest setup -set(GOOGLETEST_ROOT ${ANDROID_NDK}/sources/third_party/googletest) -add_library(gtest STATIC ${GOOGLETEST_ROOT}/src/gtest_main.cc ${GOOGLETEST_ROOT}/src/gtest-all.cc) -target_include_directories(gtest PRIVATE ${GOOGLETEST_ROOT}) -target_include_directories(gtest PUBLIC ${GOOGLETEST_ROOT}/include) +add_react_android_subdir(src/main/jni/react/bridgeless/jni) +add_react_android_subdir(src/main/jni/react/bridgeless/hermes/jni) # GTest dependencies add_executable(reactnative_unittest @@ -163,17 +163,17 @@ add_executable(reactnative_unittest ${REACT_COMMON_DIR}/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp ${REACT_COMMON_DIR}/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp ${REACT_COMMON_DIR}/react/renderer/uimanager/tests/FabricUIManagerTest.cpp - + ########## (COMPILE BUT FAIL ON ASSERTS) ########### # ${REACT_COMMON_DIR}/react/renderer/animations/tests/LayoutAnimationTest.cpp # ${REACT_COMMON_DIR}/react/renderer/mounting/tests/MountingTest.cpp # ${REACT_COMMON_DIR}/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp - + ########## (COMPILE BUT FAIL WITH RUNTIME EXCEPTIONS) ########### # ${REACT_COMMON_DIR}/hermes/inspector/chrome/tests/ConnectionDemuxTests.cpp # ${REACT_COMMON_DIR}/hermes/inspector/detail/tests/SerialExecutorTests.cpp # ${REACT_COMMON_DIR}/hermes/inspector/tests/InspectorTests.cpp - + ########## (DO NOT COMPILE) ########### # ${REACT_COMMON_DIR}/react/renderer/core/tests/ShadowNodeTest.cpp # ${REACT_COMMON_DIR}/react/renderer/core/tests/ConcreteShadowNodeTest.cpp @@ -192,9 +192,9 @@ add_executable(reactnative_unittest target_link_libraries(reactnative_unittest folly_runtime folly_futures - glog + glog glog_init - gtest + gtest_main hermes-engine::libhermes hermes_inspector jsi diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/CMakeLists.txt b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/CMakeLists.txt new file mode 100644 index 00000000000000..a779d4f72a712d --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/hermes/jni/CMakeLists.txt @@ -0,0 +1,29 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB_RECURSE hermes_instance_jni_SRC CONFIGURE_DEPENDS *.cpp) + +add_library(hermesinstancejni + SHARED + ${hermes_instance_jni_SRC} +) +target_compile_options( + hermesinstancejni + PRIVATE + $<$:-DHERMES_ENABLE_DEBUGGER=1> + -std=c++17 + -fexceptions +) +target_include_directories(hermesinstancejni PRIVATE .) +target_link_libraries( + hermesinstancejni + hermes-engine::libhermes + rninstance + fbjni + bridgelesshermes +) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/CMakeLists.txt b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/CMakeLists.txt new file mode 100644 index 00000000000000..7b5fa858832498 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/CMakeLists.txt @@ -0,0 +1,31 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB_RECURSE bridgeless_jni_SRC CONFIGURE_DEPENDS *.cpp) + +add_library(rninstance + SHARED + ${bridgeless_jni_SRC} +) +target_compile_options( + rninstance + PRIVATE + $<$:-DHERMES_ENABLE_DEBUGGER=1> + -std=c++17 + -fexceptions +) +target_include_directories(rninstance PUBLIC .) +target_link_libraries( + rninstance + fabricjni + turbomodulejsijni + fb + jsi + fbjni + bridgeless +) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.cpp index b628d738aaa576..26a896816cad4e 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless/jni/JJSTimerExecutor.cpp @@ -14,7 +14,6 @@ namespace facebook::react { void JJSTimerExecutor::setTimerManager( std::weak_ptr timerManager) { - assert(timerManager && "`timerManager` must not be `nullptr`."); timerManager_ = timerManager; } diff --git a/packages/react-native/ReactCommon/jserrorhandler/CMakeLists.txt b/packages/react-native/ReactCommon/jserrorhandler/CMakeLists.txt new file mode 100644 index 00000000000000..a007f929c0ed9e --- /dev/null +++ b/packages/react-native/ReactCommon/jserrorhandler/CMakeLists.txt @@ -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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-std=c++17) + +file(GLOB_RECURSE js_error_handler_SRC CONFIGURE_DEPENDS *.cpp) +add_library( + jserrorhandler + SHARED + ${js_error_handler_SRC} +) +target_include_directories(jserrorhandler PUBLIC .) +target_link_libraries(jserrorhandler + jsi + folly_runtime + mapbufferjni +) diff --git a/packages/react-native/ReactCommon/react/bridgeless/CMakeLists.txt b/packages/react-native/ReactCommon/react/bridgeless/CMakeLists.txt new file mode 100644 index 00000000000000..2ad8ccb366b2d5 --- /dev/null +++ b/packages/react-native/ReactCommon/react/bridgeless/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB bridgeless_SRC "*.cpp") + +add_library(bridgeless + STATIC + ${bridgeless_SRC} +) +target_compile_options( + bridgeless + PRIVATE + $<$:-DHERMES_ENABLE_DEBUGGER=1> + -std=c++17 + -fexceptions +) +target_include_directories(bridgeless PUBLIC .) + +find_library(LIBHERMES NAMES hermes-engine::libhermes) +if (LIBHERMES) + target_link_libraries(bridgeless hermes-engine::libhermes) +endif () + +target_link_libraries( + bridgeless + jserrorhandler + fabricjni + turbomodulejsijni + fb + jsi + jsireact +) diff --git a/packages/react-native/ReactCommon/react/bridgeless/hermes/CMakeLists.txt b/packages/react-native/ReactCommon/react/bridgeless/hermes/CMakeLists.txt new file mode 100644 index 00000000000000..0870d732737453 --- /dev/null +++ b/packages/react-native/ReactCommon/react/bridgeless/hermes/CMakeLists.txt @@ -0,0 +1,25 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-std=c++17) + +file(GLOB_RECURSE bridgeless_hermes_SRC CONFIGURE_DEPENDS *.cpp) +add_library( + bridgelesshermes + STATIC + ${bridgeless_hermes_SRC} +) +target_include_directories(bridgelesshermes PUBLIC .) + +target_link_libraries(bridgelesshermes + jsireact + hermes-engine::libhermes + hermes_inspector + jsi + hermes_executor_common +) diff --git a/packages/react-native/ReactCommon/react/bridgeless/hermes/HermesInstance.h b/packages/react-native/ReactCommon/react/bridgeless/hermes/HermesInstance.h index 933018ccd348f3..b176edc6820bcc 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/hermes/HermesInstance.h +++ b/packages/react-native/ReactCommon/react/bridgeless/hermes/HermesInstance.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include diff --git a/packages/react-native/ReactCommon/react/bridgeless/tests/cxx/ReactInstanceTest.cpp b/packages/react-native/ReactCommon/react/bridgeless/tests/cxx/ReactInstanceTest.cpp index ca3f34f14d35d9..2ef608629916e0 100644 --- a/packages/react-native/ReactCommon/react/bridgeless/tests/cxx/ReactInstanceTest.cpp +++ b/packages/react-native/ReactCommon/react/bridgeless/tests/cxx/ReactInstanceTest.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include diff --git a/packages/react-native/ReactCommon/react/bridging/CMakeLists.txt b/packages/react-native/ReactCommon/react/bridging/CMakeLists.txt index 18eb946077fe68..8d8f81a768b49d 100644 --- a/packages/react-native/ReactCommon/react/bridging/CMakeLists.txt +++ b/packages/react-native/ReactCommon/react/bridging/CMakeLists.txt @@ -21,4 +21,4 @@ add_library(react_bridging STATIC ${react_bridging_SRC}) target_include_directories(react_bridging PUBLIC ${REACT_COMMON_DIR}) -target_link_libraries(react_bridging jsi) +target_link_libraries(react_bridging jsi callinvoker) diff --git a/packages/react-native/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt b/packages/react-native/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt index fabef78d62f02d..ea49c8984747e1 100644 --- a/packages/react-native/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt +++ b/packages/react-native/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt @@ -28,4 +28,5 @@ target_link_libraries(rrc_native react_render_core react_render_debug react_utils + callinvoker ) From 6e1210e72e3f75cc56a87f7342d16a108c03facd Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 04:49:13 -0700 Subject: [PATCH 279/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907903287368 Sandcastle Job Instance ID: 31525198368818645 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46856457 fbshipit-source-id: 23d16aef61a7d4cc19951f3008a6de3323c54fd1 --- .../strings/th.lproj/fbt_language_pack.bin | Bin 1776 -> 1784 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/react-native/React/I18n/strings/th.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/th.lproj/fbt_language_pack.bin index 0d1b7870d2ddbdb42fa3fa2de2623aef64c72a86..9986617c8df7a6000b682c93568463b481e5e77a 100644 GIT binary patch delta 280 zcmYk#p-TgC7{>AUJTNo%~18oZf z4Zjt+;2&U+f$fb8hQ)=G`2~wFe0X?xUwD_%D!Nb3TLqCV5$Tdeazy^066G!wImGt{ zd)(j@dsqe{8AiCqF+yZ2(ofU4{k|zO#UpyS!UdXWU>8N?JXqip873H@iw@3kf&^7G zU8J#gTwRa!$z5tqKU}J{AkW>KRcX z?IJB{*PZC8KD(w?^uxtk3Bt8oXjTjEQ*(#a^=8AaWZ>=5oB8?B+mpB1?l*4_A}__@ GJ=_9P>^jx} From 4067b38165c2f4837b5547ce5875a8f8e3ca5751 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 05:38:51 -0700 Subject: [PATCH 280/468] translation auto-update for i18n/oculus-mirage.config.json on master Summary: Chronos Job Instance ID: 1125907903026576 Sandcastle Job Instance ID: 13510799858272981 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46857058 fbshipit-source-id: b14940e6b931a5add22d0a11e023ed6895617b0b --- .../res/views/uimanager/values-it/strings.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml index 9866314133d259..0a87368ca7c5c3 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-it/strings.xml @@ -3,8 +3,25 @@ + Immagine + Pulsante, Immagine + Titolo + Avviso + Casella combinata + Barra dei menu + Elemento del menu + Barra di avanzamento + Gruppo radio + Barra di scorrimento + Pulsante girevole + Lista delle tab + Barra degli strumenti + Riepilogo occupato aperto chiuso + non selezionato + + no misto From d741f56353f27541ee4c75635d446bfbc1389b89 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 05:38:51 -0700 Subject: [PATCH 281/468] translation auto-update for i18n/messenger.config.json on master Summary: Chronos Job Instance ID: 1125907903026576 Sandcastle Job Instance ID: 13510799858272981 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46857053 fbshipit-source-id: de055b9bb67eb6519de875a85e4d612ca20b39cf --- .../src/main/res/views/uimanager/values-ta/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml index 1e7ca80a14e9e9..9823eab70ede1b 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ta/strings.xml @@ -21,7 +21,11 @@ டைமர் கருவிப்பட்டி சுருக்கம் + பணிமிகுதி + விரிவாக்கப்பட்டது + சுருக்கப்பட்டது தேர்வுநீக்கப்பட்டது ஆன் ஆஃப் + கலந்துள்ளது From 2b6699e1a839c8c7f823853687aa865eb760ecc4 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 05:38:51 -0700 Subject: [PATCH 282/468] translation auto-update for i18n/twilight.config.json on master Summary: Chronos Job Instance ID: 1125907903026576 Sandcastle Job Instance ID: 13510799858272981 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46857050 fbshipit-source-id: 1ea396127cbfe52c7279158ce28666e44f8c9216 --- .../views/uimanager/values-zh-rHK/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml index 7fe732d4ab28ae..c2f4bc5e83e40b 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-zh-rHK/strings.xml @@ -3,8 +3,29 @@ + 連結 + 圖像 + 圖像,按鈕 + 標題 + 提醒 + 下拉式方塊 + 選單 + 選單列 + 選單項目 + 進度列 + 選項按鈕群組 + 捲軸 + 微調按鈕 + 分頁 + 分頁清單 + 計時器 + 工具列 + 摘要 忙碌中 已展開 已收合 + 已取消選取 + 開啟 + 關閉 混合 From 595e56d401dc226856bb657c78970f7fd2d2f10d Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 05:38:51 -0700 Subject: [PATCH 283/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907903026576 Sandcastle Job Instance ID: 13510799858272981 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46857054 fbshipit-source-id: 526ccd7455711e1baebbf059882a30bcdca48c94 --- .../src/main/res/views/uimanager/values-iw/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml index d1c1a72d24ffc2..42af3e683b3035 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml @@ -3,14 +3,20 @@ + קישור + תמונה לחצן, תמונה כותרת התראה תיבה משולבת + פריט בתפריט סרגל התקדמות קבוצת רדיו לחצן מסתובב + לשונית + רשימת לשוניות טיימר + סיכום תפוס מורחב מצומצם From c1379d143f20345456298a70510984e70b6a769b Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 05:38:51 -0700 Subject: [PATCH 284/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907903026576 Sandcastle Job Instance ID: 13510799858272981 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46857046 fbshipit-source-id: 4826c75d8a553361c501e9d05b53fc54b3da06b6 --- .../main/res/views/uimanager/values-et/strings.xml | 10 ++++++++++ .../main/res/views/uimanager/values-kn/strings.xml | 10 ++++++++++ .../main/res/views/uimanager/values-my/strings.xml | 11 +++++++++++ .../main/res/views/uimanager/values-sl/strings.xml | 6 ++++++ 4 files changed, 37 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml index 3ed2f53c3bfc8c..09a037999775d2 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml @@ -3,13 +3,23 @@ + Pilt Nupp, pilt Hoiatus Liitboks + Menüü-üksus Edenemisriba Raadionuppude grupp + Kerimisriba Pööramisnupp + Vahekaart + Vahekaartide loend Taimer + Tööriistariba + hõivatud + laiendatud ahendatud + valimata väljas + miksitud diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml index 016a8df171aeaf..0b7d5364f61119 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml @@ -3,6 +3,16 @@ + ಲಿಂಕ್ + ಚಿತ್ರ + ಬಟನ್, ಚಿತ್ರ + ಕೊಂಬೊ ಬಾಕ್ಸ್ + ಮೆನು + ಮೆನು ಐಟಂ + ಪ್ರೋಗ್ರೆಸ್ ಬಾರ್ + ಸ್ಪಿನ್ ಬಟನ್ + ಟ್ಯಾಬ್ + ಟೈಮರ್ ಕಾರ್ಯನಿರತ ವಿಸ್ತರಿಸಲಾಗಿದೆ ಮುಚ್ಚಿದೆ diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml index 6add1f51dddc29..de6a7ba3757fcb 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml @@ -3,13 +3,24 @@ + လင့်ခ် + ဓာတ်ပုံ ခလုတ်၊ ဓာတ်ပုံ သတိပေးချက် မီနူးတွဲအကွက် + မီနူး အကြောင်းအရာ ပြီးစီးမှုပြ ဘားတန်း ရေဒီယိုအုပ်စု + ရွှေ့ဆွဲကြည့်ရန် ဘားတန်း လှည့်ရန် ခလုတ် + တက်ဘ် + တက်ဘ်စာရင်း အချိန်တိုင်းစက် + ကိရိယာ ဘားတန်း + အလုပ်များနေပါတယ် + ချဲ့ထားပြီး ခေါက်သိမ်းထားပါတယ် + မရွေးချယ်ထား ပိတ် + ရောစပ်ထားပြီး diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sl/strings.xml index a8d2a680928b58..a768b2feb83894 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sl/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sl/strings.xml @@ -3,4 +3,10 @@ + Gumb, slika + Kombinirano polje + Radio skupina + Časovnik + strnjeno + izključeno From 58f0d46837cda5ef4468bfa725d25d42583086d4 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 05:38:51 -0700 Subject: [PATCH 285/468] translation auto-update for i18n/pages-manager.config.json on master Summary: Chronos Job Instance ID: 1125907903026576 Sandcastle Job Instance ID: 13510799858272981 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46857049 fbshipit-source-id: 4491d9557d44809ebca6183292dbbbb1d44cffe7 --- .../main/res/views/uimanager/values-kn/strings.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml index 0b7d5364f61119..15c52aff789e9d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-kn/strings.xml @@ -6,15 +6,26 @@ ಲಿಂಕ್ ಚಿತ್ರ ಬಟನ್, ಚಿತ್ರ + ಶಿರೋಲೇಖ + ಎಚ್ಚರಿಕೆ ಕೊಂಬೊ ಬಾಕ್ಸ್ ಮೆನು + ಮೆನು ಬಾರ್ ಮೆನು ಐಟಂ ಪ್ರೋಗ್ರೆಸ್ ಬಾರ್ + ರೇಡಿಯೋ ಗುಂಪು + ಸ್ಕ್ರಾಲ್ ಬಾರ್ ಸ್ಪಿನ್ ಬಟನ್ ಟ್ಯಾಬ್ + ಟ್ಯಾಬ್ ಪಟ್ಟಿ ಟೈಮರ್ + ಟೂಲ್ ಬಾರ್ + ಸಾರಾಂಶ ಕಾರ್ಯನಿರತ ವಿಸ್ತರಿಸಲಾಗಿದೆ ಮುಚ್ಚಿದೆ + ಆಯ್ಕೆ ರದ್ದುಮಾಡಲಾಗಿದೆ + ಆನ್ + ಆಫ್ ಬಗೆಬಗೆಯ From 9db70763ef808a16d86cb11fb1a8d4b44c0a70e8 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 05:38:51 -0700 Subject: [PATCH 286/468] translation auto-update for i18n/talk.config.json on master Summary: Chronos Job Instance ID: 1125907903026576 Sandcastle Job Instance ID: 13510799858272981 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46857056 fbshipit-source-id: 4d5744bd6f90b2036248b3f19e5fb138e44a9537 --- .../res/views/uimanager/values-fi/strings.xml | 21 +++++++++++++++++++ .../res/views/uimanager/values-sk/strings.xml | 11 ++++++++++ 2 files changed, 32 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml index 0865df4c3407af..ce80c989f9e75d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fi/strings.xml @@ -3,8 +3,29 @@ + Linkki + Kuva + Painike, kuva + Otsikko + Hälytys + Yhdistelmäruutu + Valikko + Valikkopalkki + Valikkokohde + Edistymispalkki + Valintanappiryhmä + Vierityspalkki + Pyörityspainike + Välilehti + Välilehtilista + Ajastin + Työkalupalkki + Yhteenveto varattu laajennettu pienennetty + ei valittu + käytössä + ei käytössä yhdistetty diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml index 81249ed17a4ae4..7fd1ecdfa9dbb1 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml @@ -3,8 +3,19 @@ + Odkaz + Obrázok + Upozornenie + Kombinované pole + Položka ponuky + Indikátor postupu + Lišta na posúvanie + Tabulátor + Zoznam kariet + Súhrn obsadené rozbalené zbalené + vypnuté zmiešané From cba13bb7bf4609904641d0f314455bcec5c46ffc Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 05:38:51 -0700 Subject: [PATCH 287/468] translation auto-update for i18n/creatorstudio.config.json on master Summary: Chronos Job Instance ID: 1125907903026576 Sandcastle Job Instance ID: 13510799858272981 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46857047 fbshipit-source-id: 0de1a28af7783388bcf5a9f632d21b4afcc07948 --- .../res/views/uimanager/values-th/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml index 7fedc8676bbfb5..f78b401f7b0aaf 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-th/strings.xml @@ -3,8 +3,29 @@ + ลิงก์ + รูปภาพ + ปุ่ม, รูปภาพ + ส่วนหัว + การแจ้งเตือน + กล่องคอมโบ + เมนู + แถบเมนู + รายการในเมนู + แถบความคืบหน้า + กลุ่มปุ่มตัวเลือก + แถบเลื่อน + ปุ่มเพิ่ม/ลด + แท็บ + รายการแท็บ + ตัวจับเวลา + แถบเครื่องมือ + สรุป ไม่ว่าง ขยายแล้ว ยุบแล้ว + ไม่ได้เลือก + เปิดอยู่ + ปิดอยู่ ผสมกัน From 9f7dddf1ac34a54f27c97d2e451e7cb724cd0094 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 20 Jun 2023 08:00:05 -0700 Subject: [PATCH 288/468] AGP to 8.0.2 (#37019) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37019 This bumps the version of AGP to the latest stable. There was a breaking change in how buildConfig are built which I had to handle. This also requires a bump of RNGP to work correctly. Moreover, we now required Java 17 to build Android apps (as that's a AGP requirement). Changelog: [Android] [Changed] - Java to 17 and AGP to 8.0.2 Reviewed By: cipolleschi Differential Revision: D45178748 fbshipit-source-id: 0f302e1f2f2ee56bd3566202fbb5ef67c9b220db --- .circleci/Dockerfiles/Dockerfile.android | 2 +- .circleci/config.yml | 2 +- build.gradle.kts | 6 +++--- package.json | 2 +- .../react-native-gradle-plugin/build.gradle.kts | 7 +++++-- .../main/kotlin/com/facebook/react/ReactPlugin.kt | 4 ++-- .../facebook/react/utils/AgpConfiguratorUtils.kt | 1 + .../facebook/react/utils/JdkConfiguratorUtils.kt | 15 ++++++++++----- packages/react-native/ReactAndroid/build.gradle | 3 +++ .../react-native/ReactAndroid/gradle.properties | 4 ++++ .../ReactAndroid/hermes-engine/build.gradle | 2 ++ packages/react-native/build.gradle.kts | 4 ++-- 12 files changed, 35 insertions(+), 17 deletions(-) diff --git a/.circleci/Dockerfiles/Dockerfile.android b/.circleci/Dockerfiles/Dockerfile.android index c6f706fc6758af..000822cd337393 100644 --- a/.circleci/Dockerfiles/Dockerfile.android +++ b/.circleci/Dockerfiles/Dockerfile.android @@ -14,7 +14,7 @@ # and build a Android application that can be used to run the # tests specified in the scripts/ directory. # -FROM reactnativecommunity/react-native-android:8.0 +FROM reactnativecommunity/react-native-android:9.0 LABEL Description="React Native Android Test Image" LABEL maintainer="Meta Open Source " diff --git a/.circleci/config.yml b/.circleci/config.yml index 13b480ad30ab85..1ec33d4df0e914 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,7 +113,7 @@ executors: reactnativeandroid: <<: *defaults docker: - - image: reactnativecommunity/react-native-android:8.0 + - image: reactnativecommunity/react-native-android:9.0 resource_class: "xlarge" environment: - TERM: "dumb" diff --git a/build.gradle.kts b/build.gradle.kts index 1c3ebaccc359de..db10f36431a398 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,8 +7,8 @@ plugins { id("io.github.gradle-nexus.publish-plugin") version "1.1.0" - id("com.android.library") version "7.4.2" apply false - id("com.android.application") version "7.4.2" apply false + id("com.android.library") version "8.0.2" apply false + id("com.android.application") version "8.0.2" apply false id("de.undercouch.download") version "5.0.1" apply false kotlin("android") version "1.8.0" apply false } @@ -30,7 +30,7 @@ version = group = "com.facebook.react" val ndkPath by extra(System.getenv("ANDROID_NDK")) -val ndkVersion by extra(System.getenv("ANDROID_NDK_VERSION")) +val ndkVersion by extra(System.getenv("ANDROID_NDK_VERSION") ?: "23.1.7779620") val sonatypeUsername = findProperty("SONATYPE_USERNAME")?.toString() val sonatypePassword = findProperty("SONATYPE_PASSWORD")?.toString() diff --git a/package.json b/package.json index 2f86089c27f280..53f2467430c6d1 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"", "format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"", "update-lock": "npx yarn-deduplicate", - "docker-setup-android": "docker pull reactnativecommunity/react-native-android:8.0", + "docker-setup-android": "docker pull reactnativecommunity/react-native-android:9.0", "docker-build-android": "docker build -t reactnativeci/android -f .circleci/Dockerfiles/Dockerfile.android .", "test-android-run-instrumentation": "docker run --cap-add=SYS_ADMIN -it reactnativeci/android bash .circleci/Dockerfiles/scripts/run-android-docker-instrumentation-tests.sh", "test-android-run-unit": "docker run --cap-add=SYS_ADMIN -it reactnativeci/android bash .circleci/Dockerfiles/scripts/run-android-docker-unit-tests.sh", diff --git a/packages/react-native-gradle-plugin/build.gradle.kts b/packages/react-native-gradle-plugin/build.gradle.kts index 33f4dc589d42f9..b8813324b1ad77 100644 --- a/packages/react-native-gradle-plugin/build.gradle.kts +++ b/packages/react-native-gradle-plugin/build.gradle.kts @@ -37,7 +37,7 @@ dependencies { // The KGP/AGP version is defined by React Native Gradle plugin. // Therefore we specify an implementation dep rather than a compileOnly. implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0") - implementation("com.android.tools.build:gradle:7.4.2") + implementation("com.android.tools.build:gradle:8.0.2") implementation("com.google.code.gson:gson:2.8.9") implementation("com.google.guava:guava:31.0.1-jre") @@ -55,11 +55,14 @@ dependencies { } java { + // We intentionally don't build for Java 17 as users will see a cryptic bytecode version + // error first. Instead we produce a Java 11-compatible Gradle Plugin, so that AGP can print their + // nice message showing that JDK 11 (or 17) is required first sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } -kotlin { jvmToolchain(11) } +kotlin { jvmToolchain(17) } tasks.withType { kotlinOptions { diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt index 709f1097142425..ff0de04b4c7cd7 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt @@ -86,13 +86,13 @@ class ReactPlugin : Plugin { private fun checkJvmVersion(project: Project) { val jvmVersion = Jvm.current()?.javaVersion?.majorVersion - if ((jvmVersion?.toIntOrNull() ?: 0) <= 8) { + if ((jvmVersion?.toIntOrNull() ?: 0) <= 16) { project.logger.error( """ ******************************************************************************** - ERROR: requires JDK11 or higher. + ERROR: requires JDK17 or higher. Incompatible major version detected: '$jvmVersion' ******************************************************************************** diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt index 3bf008535f7e02..3e9f8fc5e7a2ff 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/AgpConfiguratorUtils.kt @@ -21,6 +21,7 @@ internal object AgpConfiguratorUtils { val action = Action { project.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext -> + ext.buildFeatures.buildConfig = true ext.defaultConfig.buildConfigField( "boolean", "IS_NEW_ARCHITECTURE_ENABLED", project.isNewArchEnabled.toString()) ext.defaultConfig.buildConfigField( diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/JdkConfiguratorUtils.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/JdkConfiguratorUtils.kt index b54ea52404f226..0d557148eb885e 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/JdkConfiguratorUtils.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/JdkConfiguratorUtils.kt @@ -19,28 +19,33 @@ internal object JdkConfiguratorUtils { /** * Function that takes care of configuring the JDK toolchain for all the projects projects. As we * do decide the JDK version based on the AGP version that RNGP brings over, here we can safely - * configure the toolchain to 11. + * configure the toolchain to 17. */ fun configureJavaToolChains(input: Project) { + // Check at the app level if react.internal.disableJavaVersionAlignment is set. if (input.hasProperty(INTERNAL_DISABLE_JAVA_VERSION_ALIGNMENT)) { return } input.rootProject.allprojects { project -> + // Allows every single module to set react.internal.disableJavaVersionAlignment also. + if (project.hasProperty(INTERNAL_DISABLE_JAVA_VERSION_ALIGNMENT)) { + return@allprojects + } val action = Action { project.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext -> - ext.compileOptions.sourceCompatibility = JavaVersion.VERSION_11 - ext.compileOptions.targetCompatibility = JavaVersion.VERSION_11 + ext.compileOptions.sourceCompatibility = JavaVersion.VERSION_17 + ext.compileOptions.targetCompatibility = JavaVersion.VERSION_17 } } project.pluginManager.withPlugin("com.android.application", action) project.pluginManager.withPlugin("com.android.library", action) project.pluginManager.withPlugin("org.jetbrains.kotlin.android") { - project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(11) + project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(17) } project.pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { - project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(11) + project.extensions.getByType(KotlinTopLevelExtension::class.java).jvmToolchain(17) } } } diff --git a/packages/react-native/ReactAndroid/build.gradle b/packages/react-native/ReactAndroid/build.gradle index 5a189eac11e29c..665c0f02901741 100644 --- a/packages/react-native/ReactAndroid/build.gradle +++ b/packages/react-native/ReactAndroid/build.gradle @@ -594,6 +594,7 @@ android { buildFeatures { prefab true prefabPublishing !skipPrefabPublishing + buildConfig true } prefab { @@ -751,6 +752,8 @@ react { } kotlin { + // We intentionally don't build on JDK 17 as our tests are broken due to Mockito/PowerMock + // not running well on JDK 17. jvmToolchain(11) } diff --git a/packages/react-native/ReactAndroid/gradle.properties b/packages/react-native/ReactAndroid/gradle.properties index 3cdc947328b8ca..48f489a1d0e984 100644 --- a/packages/react-native/ReactAndroid/gradle.properties +++ b/packages/react-native/ReactAndroid/gradle.properties @@ -33,3 +33,7 @@ GTEST_VERSION=1.12.1 android.useAndroidX=true android.enableJetifier=true + +# We want to have more fine grained control on the Java version for +# ReactAndroid, therefore we disable RGNP Java version alignment mechanism +react.internal.disableJavaVersionAlignment=true diff --git a/packages/react-native/ReactAndroid/hermes-engine/build.gradle b/packages/react-native/ReactAndroid/hermes-engine/build.gradle index c1fceaaeec7747..15a2f49b0969a3 100644 --- a/packages/react-native/ReactAndroid/hermes-engine/build.gradle +++ b/packages/react-native/ReactAndroid/hermes-engine/build.gradle @@ -202,6 +202,8 @@ android { } kotlin { + // We intentionally don't build on JDK 17 to keep this version aligned with + // the JVM toolchain of :ReactAndroid jvmToolchain(11) } diff --git a/packages/react-native/build.gradle.kts b/packages/react-native/build.gradle.kts index 6ac661e1d42c6f..47a482604cda2b 100644 --- a/packages/react-native/build.gradle.kts +++ b/packages/react-native/build.gradle.kts @@ -11,8 +11,8 @@ // their settings.gradle.kts file. // More on this here: https://reactnative.dev/contributing/how-to-build-from-source plugins { - id("com.android.library") version "7.4.2" apply false - id("com.android.application") version "7.4.2" apply false + id("com.android.library") version "8.0.2" apply false + id("com.android.application") version "8.0.2" apply false id("de.undercouch.download") version "5.0.1" apply false kotlin("android") version "1.8.0" apply false } From 9d4cacee53256c846aabe70d9b4430169821919b Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 20 Jun 2023 08:53:03 -0700 Subject: [PATCH 289/468] Remove FakeAsyncLocalStorage from GitHub (#37975) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37975 AsyncLocalStorage is no longer distributed with react-native, so neither should this test mock be. Changelog: [Internal] Reviewed By: rshest Differential Revision: D46857153 fbshipit-source-id: 3fdb2d95f3185b85a0777fde6ce59165c8ace8e9 --- .../react/testing/FakeAsyncLocalStorage.java | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/androidTest/java/com/facebook/react/testing/FakeAsyncLocalStorage.java diff --git a/packages/react-native/ReactAndroid/src/androidTest/java/com/facebook/react/testing/FakeAsyncLocalStorage.java b/packages/react-native/ReactAndroid/src/androidTest/java/com/facebook/react/testing/FakeAsyncLocalStorage.java deleted file mode 100644 index d544be393a9acc..00000000000000 --- a/packages/react-native/ReactAndroid/src/androidTest/java/com/facebook/react/testing/FakeAsyncLocalStorage.java +++ /dev/null @@ -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. - */ - -package com.facebook.react.testing; - -import com.facebook.react.bridge.Arguments; -import com.facebook.react.bridge.BaseJavaModule; -import com.facebook.react.bridge.Callback; -import com.facebook.react.bridge.ReactMethod; -import com.facebook.react.bridge.ReadableArray; -import com.facebook.react.bridge.WritableMap; - -/** Dummy implementation of storage module, used for testing */ -public final class FakeAsyncLocalStorage extends BaseJavaModule { - - private static WritableMap errorMessage; - - static { - errorMessage = Arguments.createMap(); - errorMessage.putString("message", "Fake Async Local Storage"); - } - - @Override - public String getName() { - return "AsyncSQLiteDBStorage"; - } - - @ReactMethod - public void multiGet(final ReadableArray keys, final Callback callback) { - callback.invoke(errorMessage, null); - } - - @ReactMethod - public void multiSet(final ReadableArray keyValueArray, final Callback callback) { - callback.invoke(errorMessage); - } - - @ReactMethod - public void multiRemove(final ReadableArray keys, final Callback callback) { - callback.invoke(errorMessage); - } - - @ReactMethod - public void clear(Callback callback) { - callback.invoke(errorMessage); - } - - @ReactMethod - public void getAllKeys(final Callback callback) { - callback.invoke(errorMessage, null); - } -} From a4a8b4d8eb7ce9c50afc6061362d67777f60b2df Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 20 Jun 2023 09:37:38 -0700 Subject: [PATCH 290/468] Remove some magic constants (#37875) Summary: RCTUITextView has two instances where it references some magic constants for font size and color. We inherited these in React Native macOS, and now I want to remove that diff & implement these properly :D. Looking at commit history, these constants were found by UI inspecting a UITextView several years ago. We don't need to do this.. Apple provides API's for accessing these constants through the system. This gives us slightly better support for things like Large Text support (where 17 needs to be scaled) and Dark Mode (where the old placeholderFontColor is just wrong). Granted, these constants are overwritten almost immediately, I still thought it worth using the proper OS APIs. The other nice thing about this API is they have very nice macOS equivalents, making the diffs nicer :). ## Changelog: Pick one each for the category and type tags: [IOS] [FIXED] - Remove some magic constants from RCTUITextView Pull Request resolved: https://github.com/facebook/react-native/pull/37875 Test Plan: Verified that the default UIFont is still 17 after this change. Reviewed By: philIip Differential Revision: D46770167 Pulled By: dmytrorykun fbshipit-source-id: f577b5242a0c896d232f090ef2ffa5f452f8a191 --- .../Libraries/Text/TextInput/Multiline/RCTUITextView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.m b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.m index c6a98e65205b66..ce8a77ec6c1275 100644 --- a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.m +++ b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.m @@ -22,13 +22,13 @@ @implementation RCTUITextView { static UIFont *defaultPlaceholderFont(void) { - return [UIFont systemFontOfSize:17]; + return [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; } static UIColor *defaultPlaceholderColor(void) { // Default placeholder color from UITextField. - return [UIColor colorWithRed:0 green:0 blue:0.0980392 alpha:0.22]; + return [UIColor placeholderTextColor]; } - (instancetype)initWithFrame:(CGRect)frame From 049f6465191ddb626b865f37a2cd55226d52a0f8 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 09:44:23 -0700 Subject: [PATCH 291/468] translation auto-update for i18n/portal_alohausers.config.json on master Summary: Chronos Job Instance ID: 1125907903421526 Sandcastle Job Instance ID: 13510799858446338 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46862878 fbshipit-source-id: bb06270bd105db1804057a98fe6b61d2f966d118 --- .../main/res/views/uimanager/values-en-rGB/strings.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-en-rGB/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-en-rGB/strings.xml index 49147780ee63b5..43f9f73c92027d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-en-rGB/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-en-rGB/strings.xml @@ -3,4 +3,14 @@ + Button, image + Combo box + Menu bar + Menu item + Progress bar + Radio group + Scroll bar + Spin button + Tab list + Tool bar From 17ae70a5269b2fcfcc2cb8a17f1361864e60971f Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 09:44:23 -0700 Subject: [PATCH 292/468] translation auto-update for i18n/talk.config.json on master Summary: Chronos Job Instance ID: 1125907903421526 Sandcastle Job Instance ID: 13510799858446338 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46862872 fbshipit-source-id: 94504834f9703f8e5e716c998dc3a0e49d2546a2 --- .../src/main/res/views/uimanager/values-sk/strings.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml index 7fd1ecdfa9dbb1..7d7f4b6c603fb5 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sk/strings.xml @@ -5,17 +5,27 @@ Odkaz Obrázok + Tlačidlo, obrázok + Nadpis Upozornenie Kombinované pole + Ponuka + Lišta s ponukou Položka ponuky Indikátor postupu + Skupina tlačidiel na výber Lišta na posúvanie + Otočné tlačidlo Tabulátor Zoznam kariet + Časovač + Panel s nástrojmi Súhrn obsadené rozbalené zbalené + nevybrané + zapnuté vypnuté zmiešané From cdfc001797a8f15dd18eedef95efd1b2d4456600 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 09:44:23 -0700 Subject: [PATCH 293/468] translation auto-update for i18n/portal_calling.config.json on master Summary: Chronos Job Instance ID: 1125907903421526 Sandcastle Job Instance ID: 13510799858446338 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46862874 fbshipit-source-id: 18aecb3eda334f7e27f41b299343d32c243e4a14 --- .../src/main/res/views/uimanager/values-de/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml index d27292ddce5b9d..d0aaf6106fe419 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-de/strings.xml @@ -14,7 +14,7 @@ Statusanzeige Gruppe von Buttons Scroll-Leiste - Drehfeld + Auswahl-Button Tab-Liste Symbolleiste Übersicht From dfa6d60909b765384749e8722e040addce9f6582 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 09:44:23 -0700 Subject: [PATCH 294/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907903421526 Sandcastle Job Instance ID: 13510799858446338 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46862867 fbshipit-source-id: 6ab6a444d4cd6a5327d84af9882a81fd2aff1ab6 --- .../src/main/res/views/uimanager/values-bg/strings.xml | 9 +++++++++ .../src/main/res/views/uimanager/values-sr/strings.xml | 1 + 2 files changed, 10 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml index cb87543f716460..8bbecbb0b4aeb9 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml @@ -3,8 +3,17 @@ + Бутон, изображение + Заглавие + Сигнал + Комбинирана кутия + Лента за напредък + Радио група + Бутон за завъртане + Таймер заето разширено свито + изключено смесено diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml index ff74fb4c84c2a9..c068ba1b686f04 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml @@ -3,6 +3,7 @@ + заузето проширено скупљено мешано From 1024d4f3d57e7aef4f4c1f117f9f066113af976c Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 09:44:23 -0700 Subject: [PATCH 295/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907903421526 Sandcastle Job Instance ID: 13510799858446338 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46862860 fbshipit-source-id: 3169de1f0ff8835cd289e8ca93cdcc836bcd7c5e --- .../main/res/views/uimanager/values-ur/strings.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml index dde996b6b1a016..259966f368d0f1 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml @@ -3,8 +3,22 @@ + لنک + تصویر + بٹن، تصویر + الرٹ + کومبو باکس + مینیو آئٹم + پیش رفت بار + ریڈیو گروپ + سکرول بار + سپن بٹن + ٹیب لسٹ + ٹائمر + ٹول بار مصروف توسیع کیا گیا سکیڑا گیا + آف ہے امتزاج From 10f4d9ec8e87b929be3bc7427f0585970e0c59e7 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 09:44:23 -0700 Subject: [PATCH 296/468] translation auto-update for i18n/adsmanager.config.json on master Summary: Chronos Job Instance ID: 1125907903421526 Sandcastle Job Instance ID: 13510799858446338 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46862871 fbshipit-source-id: 2a87e1812d0c4a0cd69b2a40dded144284768be4 --- .../src/main/res/views/uimanager/values-iw/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml index 42af3e683b3035..9342d9abb8edab 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml @@ -9,6 +9,7 @@ כותרת התראה תיבה משולבת + תפריט פריט בתפריט סרגל התקדמות קבוצת רדיו @@ -20,6 +21,7 @@ תפוס מורחב מצומצם + מופעל כבוי משולב From 02771ecbfc1d42c6ee7a404ae4929178e18332d9 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 09:44:23 -0700 Subject: [PATCH 297/468] translation auto-update for i18n/portal_core_ui.config.json on master Summary: Chronos Job Instance ID: 1125907903421526 Sandcastle Job Instance ID: 13510799858446338 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46862865 fbshipit-source-id: 852509a6a55e1b95758e841f95c96610c1af545e --- .../views/uimanager/values-es-rES/strings.xml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml index 3f23af2985d179..650b200951503d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml @@ -3,8 +3,28 @@ + Enlace + Imagen + Botón, imagen + Encabezado + Alerta + Cuadro combinado + Menú + Barra de menú + Elemento del menú + Barra de progreso + Grupo de botones de radio + Barra de desplazamiento + Botón de selección + Pestaña + Temporizador + Barra de herramientas + Resumen ocupado ampliado contraído + sin seleccionar + activado + desactivado mezclado From a108dcb2ce9bf4d2ac936054535daf7065b7391d Mon Sep 17 00:00:00 2001 From: Brandon Austin Date: Tue, 20 Jun 2023 09:53:47 -0700 Subject: [PATCH 298/468] Move verifyProprsNotAlreadyDefined Function To parsers-commons.js (#37963) Summary: Move the `verifyProprsNotAlreadyDefined` functions [from Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/componentsUtils.js#L220-L229) and [from TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/componentsUtils.js#LL486-L495) to the parsers-commons.js file. Use the new function in place of the others. ## Changelog: [Internal] [Changed] - Moved `verifyProprsNotAlreadyDefined` to `parsers-commons.js` Pull Request resolved: https://github.com/facebook/react-native/pull/37963 Reviewed By: cipolleschi Differential Revision: D46841711 Pulled By: rshest fbshipit-source-id: 4c7e85d8e184126d16c520b0e56b4c291babff06 --- .../src/parsers/flow/components/componentsUtils.js | 12 +----------- .../src/parsers/parsers-commons.js | 12 ++++++++++++ .../parsers/typescript/components/componentsUtils.js | 12 +----------- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/packages/react-native-codegen/src/parsers/flow/components/componentsUtils.js b/packages/react-native-codegen/src/parsers/flow/components/componentsUtils.js index 0f840ae969a99f..222175272b7b79 100644 --- a/packages/react-native-codegen/src/parsers/flow/components/componentsUtils.js +++ b/packages/react-native-codegen/src/parsers/flow/components/componentsUtils.js @@ -11,6 +11,7 @@ 'use strict'; const {getValueFromTypes} = require('../utils.js'); +const {verifyPropNotAlreadyDefined} = require('../../parsers-commons'); import type {TypeDeclarationMap, PropAST, ASTNode} from '../../utils'; import type {BuildSchemaFN, Parser} from '../../parser'; @@ -206,17 +207,6 @@ function flattenProperties( .filter(Boolean); } -function verifyPropNotAlreadyDefined( - props: $ReadOnlyArray, - needleProp: PropAST, -) { - const propName = needleProp.key.name; - const foundProp = props.some(prop => prop.key.name === propName); - if (foundProp) { - throw new Error(`A prop was already defined with the name ${propName}`); - } -} - function getTypeAnnotation<+T>( name: string, annotation: $FlowFixMe | ASTNode, diff --git a/packages/react-native-codegen/src/parsers/parsers-commons.js b/packages/react-native-codegen/src/parsers/parsers-commons.js index 9629c5121d371b..b837ef50ff68f8 100644 --- a/packages/react-native-codegen/src/parsers/parsers-commons.js +++ b/packages/react-native-codegen/src/parsers/parsers-commons.js @@ -1072,6 +1072,17 @@ function buildPropertiesForEvent( return getPropertyType(name, optional, typeAnnotation, parser); } +function verifyPropNotAlreadyDefined( + props: $ReadOnlyArray, + needleProp: PropAST, +) { + const propName = needleProp.key.name; + const foundProp = props.some(prop => prop.key.name === propName); + if (foundProp) { + throw new Error(`A prop was already defined with the name ${propName}`); + } +} + module.exports = { wrapModuleSchema, unwrapNullable, @@ -1099,4 +1110,5 @@ module.exports = { handleGenericTypeAnnotation, getTypeResolutionStatus, buildPropertiesForEvent, + verifyPropNotAlreadyDefined, }; diff --git a/packages/react-native-codegen/src/parsers/typescript/components/componentsUtils.js b/packages/react-native-codegen/src/parsers/typescript/components/componentsUtils.js index bbcbd279e893ad..ecbc70299dcc39 100644 --- a/packages/react-native-codegen/src/parsers/typescript/components/componentsUtils.js +++ b/packages/react-native-codegen/src/parsers/typescript/components/componentsUtils.js @@ -13,6 +13,7 @@ const { parseTopLevelType, flattenIntersectionType, } = require('../parseTopLevelType'); +const {verifyPropNotAlreadyDefined} = require('../../parsers-commons'); import type {TypeDeclarationMap, PropAST, ASTNode} from '../../utils'; import type {BuildSchemaFN, Parser} from '../../parser'; @@ -453,17 +454,6 @@ function getSchemaInfo( }; } -function verifyPropNotAlreadyDefined( - props: $ReadOnlyArray, - needleProp: PropAST, -) { - const propName = needleProp.key.name; - const foundProp = props.some(prop => prop.key.name === propName); - if (foundProp) { - throw new Error(`A prop was already defined with the name ${propName}`); - } -} - function flattenProperties( typeDefinition: $ReadOnlyArray, types: TypeDeclarationMap, From b85adbf7973f740ab393a64a608e125e6d860bbe Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 20 Jun 2023 10:26:47 -0700 Subject: [PATCH 299/468] Use the correct path to upload apk from android template jobs (#37977) Summary: Upload of apk artifacts from template jobs is currently failing (see https://app.circleci.com/pipelines/github/facebook/react-native/25867/workflows/daec954a-2de9-4573-877a-c9d4cfade6b0/jobs/739866/steps) due to wrong path. This fixes it. ## Changelog: [INTERNAL] - Use the correct path to upload apk from android template jobs Pull Request resolved: https://github.com/facebook/react-native/pull/37977 Test Plan: will wait for CI results Reviewed By: cipolleschi Differential Revision: D46858996 Pulled By: cortinico fbshipit-source-id: 6fd81c77e94f5b18dbbbed005e47271ecd06718c --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ec33d4df0e914..06473be195e75d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -814,7 +814,7 @@ jobs: ./gradlew assemble<< parameters.flavor >> -PREACT_NATIVE_MAVEN_LOCAL_REPO=/root/react-native/maven-local - store_artifacts: - path: /tmp/$PROJECT_NAME/android/app/build/outputs/apk/ + path: /tmp/AndroidTemplateProject/android/app/build/outputs/apk/ destination: template-apk # ------------------------- From 936936ca544940c25c2bfd541ab175b3773862a9 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 11:23:02 -0700 Subject: [PATCH 300/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907903608343 Sandcastle Job Instance ID: 36028797996121595 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46866714 fbshipit-source-id: 776df408f08bce6b2efe29f892b3cc3be14cdfb9 --- .../strings/de.lproj/fbt_language_pack.bin | Bin 1308 -> 1312 bytes .../zh-Hans.lproj/fbt_language_pack.bin | Bin 1296 -> 1296 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/react-native/React/I18n/strings/de.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/de.lproj/fbt_language_pack.bin index ce2967d2c9223dee617487d6ee3783d3d29e26df..7a8e7fdae5d3d2aecbe97a9b7fe5ec861512c351 100644 GIT binary patch delta 301 zcmbQkwSa4aNo)fP1A_UM| zf#C`e?*ZZkK->bvDM0K3#3~afDo4IyW?;Ah#7BU50}#&v;tn7#0pbK8_5orGAXWil z0U-VZH1q`!UjgC+K)eQsX8Unt--(l|3U6%1>%s* z+|(iH1_Am!tyOF;H=!RUmPOoXL%h;!-V8Q9hukV`*`DVn&XxQ)x*_ Le%|JFjCsrep|?5k delta 297 zcmZ3$HHT}0No)-Z1A_mCbtO3M4K>US~ zf#CuW?*QUCK->Vt2|(-s#0nE9Do4IxW?;Ai#0P+Q4G_-&;uat-0OA-R_5flNAXWfk z9w7b!H1r7&UjX7gK)eEorvNd?@*E(J0Ad#){xg}EQJPU=vL>Unt;xUt|3U6%1>%s* z+|(iH1_Am!tyO2~csMRUmPOg2|1H;$j_8Q4XM}OHpb@T53)T1H Date: Tue, 20 Jun 2023 14:20:29 -0700 Subject: [PATCH 301/468] Fix SurfaceMountingManager leaking views from stopped surfaces (#37964) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37964 When a Surface is stopped, we don't immediately destroy the SurfaceMountingManager but instead just tear down its internal state. This allows for better error handling (eg did this react tag ever exist, or is this non-existing tag). The way we construct the set of tags post-deletion is flawed though: `mTagToViewState.keySet()` does not create a new Set with all the tags used, but instead uses the underlying HashMap to iterate over the keys as needed. This effectively keeps all the Views inside that deleted surface alive. Changelog: [Android][Fixed] Surfaces in the new architecture no longer leak views once stopped Reviewed By: sammy-SC, rshest Differential Revision: D46840717 fbshipit-source-id: fad145e4dd21b216d1e64f5dc79900434cff1785 --- .../react/config/ReactFeatureFlags.java | 3 ++ .../mounting/SurfaceMountingManager.java | 53 ++++++++++++------- 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index 6eb5b53b12f552..fce0e58f9c69a5 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -159,4 +159,7 @@ public class ReactFeatureFlags { /** Report mount operations from the host platform to notify mount hooks. */ public static boolean enableMountHooks = false; + + /** Fixes a leak in SurfaceMountingManager.mTagSetForStoppedSurface */ + public static boolean fixStoppedSurfaceTagSetLeak = true; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java index f3fb5e0a0024bf..be7bf13bbf6723 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java @@ -16,6 +16,7 @@ import androidx.annotation.AnyThread; import androidx.annotation.NonNull; import androidx.annotation.UiThread; +import androidx.collection.SparseArrayCompat; import com.facebook.common.logging.FLog; import com.facebook.infer.annotation.Assertions; import com.facebook.infer.annotation.ThreadConfined; @@ -52,6 +53,7 @@ import com.facebook.react.views.view.ReactViewManagerWrapper; import java.util.HashSet; import java.util.LinkedList; +import java.util.Map; import java.util.Queue; import java.util.Set; import java.util.Stack; @@ -91,7 +93,8 @@ public class SurfaceMountingManager { private RemoveDeleteTreeUIFrameCallback mRemoveDeleteTreeUIFrameCallback; // This is null *until* StopSurface is called. - private Set mTagSetForStoppedSurface; + private Set mTagSetForStoppedSurfaceLegacy; + private SparseArrayCompat mTagSetForStoppedSurface; private final int mSurfaceId; @@ -166,7 +169,10 @@ public boolean getViewExists(int tag) { // If Surface stopped, check if tag *was* associated with this Surface, even though it's been // deleted. This helps distinguish between scenarios where an invalid tag is referenced, vs // race conditions where an imperative method is called on a tag during/just after StopSurface. - if (mTagSetForStoppedSurface != null && mTagSetForStoppedSurface.contains(tag)) { + if (mTagSetForStoppedSurface != null && mTagSetForStoppedSurface.containsKey(tag)) { + return true; + } + if (mTagSetForStoppedSurfaceLegacy != null && mTagSetForStoppedSurfaceLegacy.contains(tag)) { return true; } if (mTagToViewState == null) { @@ -287,27 +293,38 @@ public void stopSurface() { } Runnable runnable = - new Runnable() { - @Override - public void run() { - // We must call `onDropViewInstance` on all remaining Views + () -> { + if (ReactFeatureFlags.fixStoppedSurfaceTagSetLeak) { + mTagSetForStoppedSurface = new SparseArrayCompat<>(); + for (Map.Entry entry : mTagToViewState.entrySet()) { + // Using this as a placeholder value in the map. We're using SparseArrayCompat + // since it can efficiently represent the list of pending tags + mTagSetForStoppedSurface.put(entry.getKey(), this); + + // We must call `onDropViewInstance` on all remaining Views + onViewStateDeleted(entry.getValue()); + } + } else { for (ViewState viewState : mTagToViewState.values()) { + // We must call `onDropViewInstance` on all remaining Views onViewStateDeleted(viewState); } + mTagSetForStoppedSurfaceLegacy = mTagToViewState.keySet(); + } - // Evict all views from cache and memory - mTagSetForStoppedSurface = mTagToViewState.keySet(); - mTagToViewState = null; - mJSResponderHandler = null; - mRootViewManager = null; - mMountItemExecutor = null; - mOnViewAttachItems.clear(); - - if (ReactFeatureFlags.enableViewRecycling) { - mViewManagerRegistry.onSurfaceStopped(mSurfaceId); - } - FLog.e(TAG, "Surface [" + mSurfaceId + "] was stopped on SurfaceMountingManager."); + // Evict all views from cache and memory + // TODO: clear instead of nulling out to simplify null-safety in this class + mTagToViewState = null; + mJSResponderHandler = null; + mRootViewManager = null; + mMountItemExecutor = null; + mThemedReactContext = null; + mOnViewAttachItems.clear(); + + if (ReactFeatureFlags.enableViewRecycling) { + mViewManagerRegistry.onSurfaceStopped(mSurfaceId); } + FLog.e(TAG, "Surface [" + mSurfaceId + "] was stopped on SurfaceMountingManager."); }; if (UiThreadUtil.isOnUiThread()) { From 8f072b438a81293da026f0284dac8ddc7be35382 Mon Sep 17 00:00:00 2001 From: Liam Jones Date: Tue, 20 Jun 2023 17:14:31 -0700 Subject: [PATCH 302/468] Fix for UIApplicationDidReceiveMemoryWarningNotification not being obeyed on iOS (#37973) Summary: Prior to 0.69, an RN app receiving the `UIApplicationDidReceiveMemoryWarningNotification` notification resulted in RN performing a GC on the JSC. Since 0.69 this has not worked, this PR fixes the issue. Before 0.69 this was handled via a hardcoded memory pressure level: https://github.com/facebook/react-native/blob/c5c17985dae402725abb8a3a94ccedc515428711/React/CxxBridge/RCTCxxBridge.mm#L362 (It seems like the levels are an Android concept - see https://developer.android.com/reference/android/content/ComponentCallbacks2#constants_1) In commit https://github.com/facebook/react-native/commit/0916df99511d6918ea905c2a9df45bccc1fd332a it was changed to run from a constant which could be reconfigured but a mistake (return type of `BOOL` rather than `int`) was resulting in the intended default memory pressure level of 15 (same as the old hardcoded value) being changed to 1 when it was passed on to `handleMemoryPressure`. ## Changelog: [IOS] [FIXED] - UIApplicationDidReceiveMemoryWarningNotification has not been obeyed on iOS since RN 0.69 Pull Request resolved: https://github.com/facebook/react-native/pull/37973 Test Plan: Tested manually via the Simulator using Debug -> Simulate Memory Warning and monitoring the console output of the app. Before fix: ``` WARNING: Logging before InitGoogleLogging() is written to STDERR W0620 11:21:42.824463 257294336 JSIExecutor.cpp:377] Memory warning (pressure level: 1) received by JS VM, unrecognized pressure level ``` With fix (and also the same output for the latest 0.68 tag in the repo): ``` WARNING: Logging before InitGoogleLogging() is written to STDERR I0620 11:25:47.479444 79212544 JSIExecutor.cpp:370] Memory warning (pressure level: TRIM_MEMORY_RUNNING_CRITICAL) received by JS VM, running a GC ``` Reviewed By: javache Differential Revision: D46857205 Pulled By: sammy-SC fbshipit-source-id: 35121e6c4186fded6ef3ba728d9aafbc936627bb --- packages/react-native/React/Base/RCTConstants.h | 2 +- packages/react-native/React/Base/RCTConstants.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/React/Base/RCTConstants.h b/packages/react-native/React/Base/RCTConstants.h index b1c244ac93c228..e81a7d6bf72eee 100644 --- a/packages/react-native/React/Base/RCTConstants.h +++ b/packages/react-native/React/Base/RCTConstants.h @@ -73,7 +73,7 @@ RCT_EXTERN void RCTSetValidateCanSendEventInRCTEventEmitter(BOOL value); /* * Memory Pressure Unloading Level */ -RCT_EXTERN BOOL RCTGetMemoryPressureUnloadLevel(void); +RCT_EXTERN int RCTGetMemoryPressureUnloadLevel(void); RCT_EXTERN void RCTSetMemoryPressureUnloadLevel(int value); /* diff --git a/packages/react-native/React/Base/RCTConstants.m b/packages/react-native/React/Base/RCTConstants.m index 81b8741d583fe8..51fb43ac2758c7 100644 --- a/packages/react-native/React/Base/RCTConstants.m +++ b/packages/react-native/React/Base/RCTConstants.m @@ -56,7 +56,7 @@ void RCTSetValidateCanSendEventInRCTEventEmitter(BOOL value) */ static int RCTMemoryPressureUnloadLevel = 15; -BOOL RCTGetMemoryPressureUnloadLevel(void) +int RCTGetMemoryPressureUnloadLevel(void) { return RCTMemoryPressureUnloadLevel; } From 4defe4f3e42e970d56e320d186d6a80199df6a86 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 17:58:21 -0700 Subject: [PATCH 303/468] translation auto-update for i18n/oculus-mirage.config.json on master Summary: Chronos Job Instance ID: 1125907903618839 Sandcastle Job Instance ID: 27021598739804874 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46883105 fbshipit-source-id: 3084fea1e602f38259ad261f45326b7750b8a618 --- .../res/views/uimanager/values-el/strings.xml | 21 +++++++++++++++++++ .../views/uimanager/values-es-rES/strings.xml | 1 + .../res/views/uimanager/values-sv/strings.xml | 2 +- .../res/views/uimanager/values-vi/strings.xml | 19 +++++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml index 80c7d1d78ffbc7..277ce44184acde 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-el/strings.xml @@ -3,8 +3,29 @@ + Σύνδεσμος + Εικόνα + Κουμπί, εικόνα + Επικεφαλίδα + Ειδοποίηση + Σύνθετο πλαίσιο + Μενού + Γραμμή μενού + Στοιχείο μενού + Γραμμή προόδου + Ομάδα κουμπιών επιλογής + Γραμμή κύλισης + Κουμπί περιστροφής + Καρτέλα + Λίστα καρτελών + Χρονόμετρο + Γραμμή εργαλείων + Σύνοψη απασχολημένος/η διευρυμένο συμπτυγμένο + μη επιλεγμένα + ναι + όχι μεικτά diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml index 650b200951503d..d3200129fe5e0b 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es-rES/strings.xml @@ -17,6 +17,7 @@ Barra de desplazamiento Botón de selección Pestaña + Lista de pestañas Temporizador Barra de herramientas Resumen diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml index 436c66aaa4f86f..c40edbe7723586 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sv/strings.xml @@ -13,7 +13,7 @@ Menyfält Menyobjekt Förloppsfält - Alternativgrupp + Radiogrupp Bläddringslist Rotationsknapp Flik diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml index 6f6cfc761c25fe..5a185889b86d8d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-vi/strings.xml @@ -3,8 +3,27 @@ + Liên kết + Hình ảnh + Nút, Hình ảnh + Tiêu đề + Thông báo + Ô lựa chọn + Thanh menu + Mục trong menu + Thanh tiến độ + Nhóm nút radio + Thanh cuộn + Nút quay + Danh sách tab + Bộ hẹn giờ + Thanh công cụ + Tóm tắt bận đã mở rộng đã thu gọn + không được chọn + đang bật + đang tắt kết hợp From 194de0f848a2fd61d269ab348215306243d8994a Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 17:58:21 -0700 Subject: [PATCH 304/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907903618839 Sandcastle Job Instance ID: 27021598739804874 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46883090 fbshipit-source-id: 549808831b33a4d290a584b50bca57cb3a484564 --- .../src/main/res/views/uimanager/values-iw/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-km/strings.xml | 3 +++ .../src/main/res/views/uimanager/values-ur/strings.xml | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml index 9342d9abb8edab..d032407ea5be96 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-iw/strings.xml @@ -10,17 +10,21 @@ התראה תיבה משולבת תפריט + סרגל תפריטים פריט בתפריט סרגל התקדמות קבוצת רדיו + סרגל גלילה לחצן מסתובב לשונית רשימת לשוניות טיימר + סרגל כלים סיכום תפוס מורחב מצומצם + הבחירה בוטלה מופעל כבוי משולב diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml index 7d8b08c43aa174..97888b8ff6af0b 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml @@ -3,5 +3,8 @@ + តំណ + របាររំកិល + បានពង្រីក បិទ diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml index 259966f368d0f1..4bb15414f464ef 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml @@ -9,11 +9,11 @@ الرٹ کومبو باکس مینیو آئٹم - پیش رفت بار + پیشرفت کی بار ریڈیو گروپ سکرول بار - سپن بٹن - ٹیب لسٹ + گھمانے کا بٹن + ٹیب کی لسٹ ٹائمر ٹول بار مصروف From 2261e34afbfda2cad7f4896ca9b1d4d7b70bc4ef Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 17:58:21 -0700 Subject: [PATCH 305/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907903618839 Sandcastle Job Instance ID: 27021598739804874 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46883096 fbshipit-source-id: 59bcd9ec926450fe5d913cb9728485cadf7f90af --- .../res/views/uimanager/values-fr/strings.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml index 14e76329cc9db8..aad6fa4a4e9542 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fr/strings.xml @@ -3,8 +3,27 @@ + Lien + Bouton, image + Titre + Alerte + Liste déroulante + Barre de menu + Élément du menu + Barre de progression + Groupe de boutons radio + Barre de défilement + Toupie + Onglet + Liste d’onglets + Minuteur + Barre d’outils + Récapitulatif opération en cours agrandi réduit + désélectionné(s) + activé + désactivé mixte From 784e522c0f6a39ebc14d5cf2545cb6e0b9f68515 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 17:58:21 -0700 Subject: [PATCH 306/468] translation auto-update for i18n/anna.config.json on master Summary: Chronos Job Instance ID: 1125907903618839 Sandcastle Job Instance ID: 27021598739804874 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46883088 fbshipit-source-id: 788b9733459c2c7c1bc72874d4066eac13926f8b --- .../src/main/res/views/uimanager/values-gu/strings.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml index 737791466d55af..6dac5291f7830c 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-gu/strings.xml @@ -3,14 +3,22 @@ + લિંક + ફોટો + બટન, ફોટો શીર્ષક એલર્ટ + કોમ્બો બોક્સ + મેનૂ મેનૂ બાર મેનૂ આઇટમ પ્રગતિ બાર રેડિયો ગ્રૂપ સ્ક્રોલ બાર + સ્પિન બટન + ટેબ ટેબ લિસ્ટ + ટાઇમર ટૂલ બાર સારાંશ વ્યસ્ત From 15606efa180dfed98416e3608f5eadb7fd1ffdb0 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Tue, 20 Jun 2023 20:37:24 -0700 Subject: [PATCH 307/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907903682636 Sandcastle Job Instance ID: 13510799859062636 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46885889 fbshipit-source-id: f1688e39299d5fea527ab22f680da14ffa023ba7 --- .../strings/en-GB.lproj/fbt_language_pack.bin | Bin 424 -> 1268 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/react-native/React/I18n/strings/en-GB.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/en-GB.lproj/fbt_language_pack.bin index bd9be08307975f450779f91bec3122cedb325af9..6e6f1851dcc6414019afbbce233221a886466787 100644 GIT binary patch literal 1268 zcmaKsJx~)t7=}MJG7%{#7{`L*ij*>wn2?bfnn1*Wmk>jO=s1J-mvFgX?k5Dsf`Y=r z!oq^WlET8m!oq^Wv9_SFu(Y6b97`(k-ODcCj5FNKv%BxR-+s5>-cOE*mKNmZH03ZN zl4u(3ZJI(mNfVT%Oyb;uK1gPW+8Ijb_t8(ndy77O-GcadmB@W^7W}?K^c@_7 zBk&T~Kn8g*1;oIHy;VUTOoQB?^K(|p4WN0pt@xp#V?59OEXI-N*^;UR7*d=2*O_lR1~a$Pv5G3$ zW*D*9eePph6e%jb=6Vb|+%Y3<3+KVTo6Pe~S5o6B@?1LR{y6is06QD);9Dv_P;}Fi zdVv@F^ppD&i1!1p7Z_nE_MAQcSEFONv1CSugE)!%tj5IWHQwVsI~V4oBRQ2r^BmQa zRBs4h=RP|R#Wn&~_%O9zjl*47^oo1zUdGT@Ts=8vI!di~%wb}FO2x)*WNOwZ_JsTF z{DgbTJy!SVJoo`Z=kO+9er1v`fYr$&wJk%lMr9?s-)e6=roYB=uz9^17W-~F6x!6* zOXXH$N$BEWeMem`wuD}(73S8u_00>dZfLp_C_)bwt!`;=HZOG5TAg`NRknp*Dfc2- zt=K}}pDooE3tma+&3bvc9_9x^*XK6lxHG)C-xIB{*2!xwr_1?7yN>gnXh1TsxcW$6}g!WgR#&&*a2;F_;lq delta 160 zcmeyuxq^9uPLK@)1A_z*b1*V6hyZC5AT0o-1AsI#U;%P^fY=9!O@J7r2PC!!h*tpd z6d-N@;ywQ-^D&AsUYVT8BrN^n|Ns9WMI1n!T2YXgmy((SWHP8Qa7_NlBsqzhZ88@# a7bh!FC^xerHD$6Qv-o5Q7OlxmEJXmn#T#z` From b3bb55357ac8b88cab889f0672f6f1c15ee5ebf5 Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Wed, 21 Jun 2023 01:16:24 -0700 Subject: [PATCH 308/468] Add dev mode check for direct events following naming convention (#37939) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37939 # Changelog: [Internal] - This addresses potential problem with inconsistent naming of direct events on Android, as we've recently found out that there are several such occasions, which can be potentially a source of errors. Reviewed By: javache Differential Revision: D46801798 fbshipit-source-id: 01050f53c1efa382021400e803214ae1aafff3fa --- .../UIManagerModuleConstantsHelper.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java index cd10e3a76d0698..01acd5aebd2f34 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java @@ -11,7 +11,9 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; +import com.facebook.common.logging.FLog; import com.facebook.react.common.MapBuilder; +import com.facebook.react.common.build.ReactBuildConfig; import com.facebook.react.config.ReactFeatureFlags; import com.facebook.systrace.SystraceMessage; import java.util.ArrayList; @@ -26,7 +28,7 @@ * registered view managers. */ /* package */ class UIManagerModuleConstantsHelper { - + private static final String TAG = "UIManagerModuleConstantsHelper"; private static final String BUBBLING_EVENTS_KEY = "bubblingEventTypes"; private static final String DIRECT_EVENTS_KEY = "directEventTypes"; @@ -50,6 +52,31 @@ DIRECT_EVENTS_KEY, UIManagerModuleConstants.getDirectEventTypeConstants()); } + private static void validateDirectEventNames( + String viewManagerName, Map directEvents) { + if (!ReactBuildConfig.DEBUG || directEvents == null) { + return; + } + + for (String key : directEvents.keySet()) { + Object value = directEvents.get(key); + if (value != null && (value instanceof Map)) { + String regName = (String) ((Map) value).get("registrationName"); + if (regName != null + && key.startsWith("top") + && regName.startsWith("on") + && !key.substring(3).equals(regName.substring(2))) { + FLog.e( + TAG, + String.format( + "Direct event name for '%s' doesn't correspond to the naming convention," + + " expected 'topEventName'->'onEventName', got '%s'->'%s'", + viewManagerName, key, regName)); + } + } + } + } + /** * Generates map of constants that is then exposed by {@link UIManagerModule}. Provided list of * {@param viewManagers} is then used to populate content of those predefined fields using {@link @@ -133,6 +160,7 @@ } Map viewManagerDirectEvents = viewManager.getExportedCustomDirectEventTypeConstants(); + validateDirectEventNames(viewManager.getName(), viewManagerDirectEvents); if (viewManagerDirectEvents != null) { recursiveMerge(cumulativeDirectEventTypes, viewManagerDirectEvents); recursiveMerge(viewManagerDirectEvents, defaultDirectEvents); From 7a2a3278d08b13dbde7a6e967474c20d6a5c76a5 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Wed, 21 Jun 2023 04:14:25 -0700 Subject: [PATCH 309/468] fix(virtualized-lists): `react-test-renderer` is not a runtime dependency (#37955) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Installing `react-native` 0.72.x causes a warning about `react-test-renderer` because `react-native/virtualized-lists` has declared a peer dependency on it. As far as I know, it is not used for anything but tests. ``` ➤ YN0002: │ react-native@npm:0.72.0-rc.6 [292eb] doesn't provide react-test-renderer (p5a2fb), requested by react-native/virtualized-lists ``` Note that while many package managers default to warnings in this case, there are still a number of users out there for which this is an error. ## Changelog: [GENERAL] [FIXED] - `react-native/virtualized-lists` does not need `react-test-renderer` at runtime Pull Request resolved: https://github.com/facebook/react-native/pull/37955 Test Plan: n/a Reviewed By: rshest Differential Revision: D46871536 Pulled By: NickGerleman fbshipit-source-id: 1e5e15608ab394bc43cd4e6ac727a74734874642 --- packages/virtualized-lists/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/virtualized-lists/package.json b/packages/virtualized-lists/package.json index 00b078ac22af4c..e640a73b2b5b88 100644 --- a/packages/virtualized-lists/package.json +++ b/packages/virtualized-lists/package.json @@ -22,7 +22,6 @@ "react-test-renderer": "18.2.0" }, "peerDependencies": { - "react-native": "*", - "react-test-renderer": "18.2.0" + "react-native": "*" } } From 859083e9630eff4d9252f9d5ca6501801f890797 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 04:45:13 -0700 Subject: [PATCH 310/468] translation auto-update for i18n/creatorstudio.config.json on master Summary: Chronos Job Instance ID: 1125907903824394 Sandcastle Job Instance ID: 36028797996670317 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46894916 fbshipit-source-id: 045309665f3b6b4521c16daf5658a84a88de7d5d --- .../src/main/res/views/uimanager/values-ru/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml index 8d1e8856c1ef46..6d9de6e1da3a3b 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ru/strings.xml @@ -25,7 +25,7 @@ развернуто свернуто не выбрано - вкл + включено выкл смешанный From c8eb235bf79b032a16ec2bbd8bbad87f34fa4e61 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 04:45:13 -0700 Subject: [PATCH 311/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907903824394 Sandcastle Job Instance ID: 36028797996670317 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46894920 fbshipit-source-id: 7c1c4c1ef83f07b211efa745c78d00a1f6bcae36 --- .../res/views/uimanager/values-si/strings.xml | 10 ++++++++++ .../res/views/uimanager/values-sw/strings.xml | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml index 08fdba8c54dc85..ddce17d51b188b 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml @@ -3,13 +3,23 @@ + සබැඳිය + රූපය ‍බොත්තම, රූපය + සිරස්තලය ඇඟවීම සංයුක්ත පෙට්ටිය + ‍මෙනු අයිතමය ප්‍රගති තීරුව ගුවන්විදුලි සමූහය + අනුචලන තීරුව වේගයෙන් කරකවන බොත්තම + ටැබය + ටැබ ලැයිස්තුව කාල ගණකය + කාර්යබහුලයි + විහිදුවන ලදි හකුළන ලදී + ක්‍රියාත්මකයි අක්‍රියයි diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml index d7c4b54c2d5e34..a26adb80d40d43 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sw/strings.xml @@ -3,13 +3,29 @@ + Kiungo + Picha Kitufe, Picha + Kichwa Arifa Kisanduku cha Combo + Menyu + Upau wa Menyu + Kipengee cha Menyu Upau wa Hatua Kundi la Redio + Mwambaa wa Kubiringiza Kitufe cha Kuzungusha + Kichupo + Orodha ya Kichupo Kipima muda + Upau wa Zana + Muhtasari + shughulini + imepanuliwa imekunjwa + haijateuliwa + imewashwa imezimwa + mchanganyiko From e5c824ced73a076384040f65c37d9bae7d6c9a43 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 04:45:13 -0700 Subject: [PATCH 312/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907903824394 Sandcastle Job Instance ID: 36028797996670317 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46894914 fbshipit-source-id: 4b1e1071b1cb277a8d187b380665980f6172e7d4 --- .../views/uimanager/values-pt-rPT/strings.xml | 20 +++++++++++++++++++ .../res/views/uimanager/values-tl/strings.xml | 6 ++++++ 2 files changed, 26 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml index 5a1f664c4c3173..f3afd9bf3e5595 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt-rPT/strings.xml @@ -3,8 +3,28 @@ + Ligação + Imagem + Botão, Imagem + Título + Aviso + Caixa de combinação + Barra do menu + Item do menu + Barra de progresso + Grupo de opções + Barra de deslocamento + Botão giratório + Separador + Lista de separadores + Temporizador + Barra de ferramentas + Resumo ocupado expandido fechado + não selecionado + ativado + desativado misto diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml index 6dc341aa4d7188..6fabf6bc463432 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tl/strings.xml @@ -3,6 +3,12 @@ + Combox Box + Item sa Menu + Grupo ng Radio naka-expand naka-collapse + na-unselect + naka-ON + naka-OFF From 5f7c5a88a1022c0307579d6d96899ae4819bc2ed Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 21 Jun 2023 06:26:53 -0700 Subject: [PATCH 313/468] Undeprecated GuardedAsyncTask constructor (#37864) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37864 This was deprecated as part of bridgeless development, but since we now have `BridgelessReactContext`, which is also a `ReactContext`, this deprecation is no longer necessary. Changelog: [Internal] Reviewed By: rshest Differential Revision: D46685374 fbshipit-source-id: 4d13418419ac987261b1d10bd50aeb311caadc95 --- .../main/java/com/facebook/react/bridge/GuardedAsyncTask.java | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/GuardedAsyncTask.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/GuardedAsyncTask.java index 4c7c57665cac0c..4c3151cd080fec 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/GuardedAsyncTask.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/GuardedAsyncTask.java @@ -20,7 +20,6 @@ public abstract class GuardedAsyncTask extends AsyncTask Date: Wed, 21 Jun 2023 10:14:29 -0700 Subject: [PATCH 314/468] add 0.72.0 changelog (#36553) Summary: Adds changelog for new minor 0.72.0 ## Changelog: [Internal] [Changed] - add changelog entry for 0.72.0 Pull Request resolved: https://github.com/facebook/react-native/pull/36553 Test Plan: N/A Reviewed By: rshest Differential Revision: D45778748 Pulled By: cipolleschi fbshipit-source-id: c3cca1327db0f0d3c579137f7368a2861bb72bf7 --- CHANGELOG.md | 347 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 347 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbd665ac8382e5..22277de95769ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,352 @@ # Changelog +## v0.72.0 + +### Breaking + +- Bump version of Node used to 18 ([f75b92a](https://github.com/facebook/react-native/commit/f75b92a12b829d74f202aded7d4c8f4e1d23e402) by [@leotm](https://github.com/leotm)), and minimum Node JS version to 16 ([afc91de79a](https://github.com/facebook/react-native/commit/afc91de79a8804696f05219214e0e67235d34d77) by [@robhogan](https://github.com/robhogan)) +- Constrain data type in `getItemLayout` callback ([febf6b7f33](https://github.com/facebook/react-native/commit/febf6b7f33fdb4904669f99d795eba4c0f95d7bf) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix react-native/eslint-config linting of jsx files ([59ee573527](https://github.com/facebook/react-native/commit/59ee57352738f030b41589a450209e51e44bbb06) by [@NickGerleman](https://github.com/NickGerleman)) + +#### iOS specific + +- Generates RNCore components inside the ReactCommon folder and create a new pod for platform-specific ImageManager classes ([5d175c6775](https://github.com/facebook/react-native/commit/5d175c6775d0c630fb53b41df4e2a08f15bd94a4) by [@cipolleschi](https://github.com/cipolleschi)) +- Moved the RCTAppSetupUtils to the AppDelegate library to break a dependency cycle ([36a64dc2bd](https://github.com/facebook/react-native/commit/36a64dc2bd9de52841a52c549f35b944020bdb53) by [@cipolleschi](https://github.com/cipolleschi)) +- Split the `ReactCommon/react/nativemodule/core/platform/ios` and `ReactCommon/react/nativemodule/samples` in two separate pods to break circular dependencies. ([21d530208f](https://github.com/facebook/react-native/commit/21d530208f57feda87dce9f93f471bbf57635477) by [@cipolleschi](https://github.com/cipolleschi)) + +### Added + +- Improve handling of invalid DimensionValue usage ([02e29abead](https://github.com/facebook/react-native/commit/02e29abeada3d78dd7d90d1d89049cd1517afb55) by [@NickGerleman](https://github.com/NickGerleman)) +- Add new JS performance API to support getting RN app startup timings ([c1023c73b0](https://github.com/facebook/react-native/commit/c1023c73b010245f2e8182b75cc3bccd112d5e2e)) +- Add performance memory API with native memory Info ([70fb2dce45](https://github.com/facebook/react-native/commit/70fb2dce4557da1195289a24638b1e4d2c2edbf7)) +- Added Web-compatible `DOMRect` and `DOMRectReadOnly` classes to the global scope. ([673c7617bc](https://github.com/facebook/react-native/commit/673c7617bcf90a892a0afc2c0d9cf9c0493fdf27) by [@rubennorte](https://github.com/rubennorte)) +- Add onStartReached and onStartReachedThreshold to VirtualizedList ([7683713264](https://github.com/facebook/react-native/commit/76837132649d740e1ec2c3c78f0085b444a4367c) by [@janicduplessis](https://github.com/janicduplessis)) +- Added `setColorScheme` to `Appearance` module ([c18566ffdb](https://github.com/facebook/react-native/commit/c18566ffdb44103a3e24cd8017d0ae6a69c68e40), ([0a4dcb0309](https://github.com/facebook/react-native/commit/0a4dcb0309fdc8f4529ed7599c4170341b42c9b1) by [@birkir](https://github.com/birkir)) +- Add logical border block color properties ([597a1ff60b](https://github.com/facebook/react-native/commit/597a1ff60b3e1844b4794fb4acd40fa073f2e93b) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Add logical border-radius implementation ([4ae4984094](https://github.com/facebook/react-native/commit/4ae4984094e4846bc2bc0e3374ab5d934ee6bc5f) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Added CSS logical properties. ([3681df2878](https://github.com/facebook/react-native/commit/3681df287835f5467a2ad5afe950eae16b95fd8b) by [@necolas](https://github.com/necolas)) +- Concurrent rendering safe implementation of Animated ([5cdf3cf726](https://github.com/facebook/react-native/commit/5cdf3cf72613a2068884151efb08fd4c17fec5fd), ([5e863fc42c](https://github.com/facebook/react-native/commit/5e863fc42c8a2b27f4a785766eb643de9a243b2d) by [@sammy-SC](https://github.com/sammy-SC)) +- Create explicit error message for TypeScript functions used as props in Codegen components, redirecting devs to the supported function types `BubblingEventHandler` and `DirectEventHandler`. ([dc2cbed07c](https://github.com/facebook/react-native/commit/dc2cbed07c82b5b80e66f5c6a1bd6244f4972ede) by [@gtomitsuka](https://github.com/gtomitsuka)) +- Generate enum types that would be allowed to be used as well as string/number in c++ turbo modules generators ([ceb1d0dea6](https://github.com/facebook/react-native/commit/ceb1d0dea694739f357d86296b94f5834e5ee7f7) by [@vzaidman](https://github.com/vzaidman)) +- Add enum example to Android/iOS rn-tester TurboModule ([7c82a3fa11](https://github.com/facebook/react-native/commit/7c82a3fa110a618c7bd59555a3ae94304ab25b1f) by [@christophpurrer](https://github.com/christophpurrer)) +- Allow the use of "Partial" in Turbo Module specs. ([97e707d897](https://github.com/facebook/react-native/commit/97e707d897e63715023dc68bb059f4aa5332fc78) by [@vzaidman](https://github.com/vzaidman)) +- Added newline to UTFSequence ([9cf35bfcc4](https://github.com/facebook/react-native/commit/9cf35bfcc47c928392ac524cd9e3fd30a1130fbb)) +- Added "coverage" folder generated from `jest --coverage` to .gitignore ([7324c22ff9](https://github.com/facebook/react-native/commit/7324c22ff91c572b4022a1d22c6c7751a73ad76a) by [@Adnan-Bacic](https://github.com/Adnan-Bacic)) +- Add support for getting/setting reload-and-profile-related settings in iOS + Android ([96d6680e00](https://github.com/facebook/react-native/commit/96d6680e00c28575d6ebf95d5f55487d69fda51f)) +- For supporting Dev Loading View across platforms, adding the DevLoadingViewController without an activity/context. ([662b51fad2](https://github.com/facebook/react-native/commit/662b51fad2fb4c267da519c9122ab4d12dcfdaae)) +- Pass DevTools Settings Manager to connectToDevTools ([a9bed8e75d](https://github.com/facebook/react-native/commit/a9bed8e75d9b9613c5fcb69436a2d3af763f456d)) +- React-native-code-gen Add Union Type support for Java/ObjC TurboModules ([2eccd59d7c](https://github.com/facebook/react-native/commit/2eccd59d7c735df3c29fc7ca342555890eb7055b) by [@christophpurrer](https://github.com/christophpurrer)) +- Making Dev Loading View cross platform by abstracting out the activity/context logic from the controller in a polymorph class. ([1a4fa92b25](https://github.com/facebook/react-native/commit/1a4fa92b253aeb70162322e9d4135fb34901dcf1)) +- Added CSS logical properties by mapping layout props. ([cf3747957a](https://github.com/facebook/react-native/commit/cf3747957ab210e31504109bb6b3e34e773a5b9a) by [@mayank-96](https://github.com/mayank-96)) +- Add, but don't use, DevTools Settings Manager. ([6152763398](https://github.com/facebook/react-native/commit/6152763398efe60521fc86fcf992b6a84361df12)) + +#### Android specific + +- Adding pager, scrollview, viewgroup, webview, drawer accessibility roles ([55c0df43b9](https://github.com/facebook/react-native/commit/55c0df43b9859853e41b6e2ef271b78b783538f0) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Add TYPE_VIEW_HOVER_ENTER to AccessibilityNodeInfo sendAccessibilityEvent ([a0adf57e50](https://github.com/facebook/react-native/commit/a0adf57e509dbb9074b2fa14339c5add140f5332) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Add maintainVisibleContentPosition support on Android ([c19548728c](https://github.com/facebook/react-native/commit/c19548728c9be3ecc91e6fefb35bc14929109d60) by [@janicduplessis](https://github.com/janicduplessis)) +- For supporting Dev Loading View across multiple platforms, changing the Loading View of Android to rely on the native implementation instead of Toast while keeping backwards comptability. ([9f6b532bdb](https://github.com/facebook/react-native/commit/9f6b532bdb7e60eddec62b7a0b89141e4c8df127)) +- For supporting Dev Loading View across multiple platforms, adding native implementation for showMessage() & hide() of Dev Loading Module ([4923a0997b](https://github.com/facebook/react-native/commit/4923a0997b1a8c827b11ec15e45e6ce00f398d99)) +- For supporting Dev Loading View across multiple platforms, altering the javascript implementation of Loading view of android to also rely on native implementation as iOS instead of Toast, thereby unifying both platforms ([068a20842d](https://github.com/facebook/react-native/commit/068a20842d349318db2236676415e96be2a663f9)) +- Added possibility to mark Fresco image pipeline as already initialized ([605a52fe3e](https://github.com/facebook/react-native/commit/605a52fe3ec099b652fc222947d1ddffa41cfd7f) by [@oprisnik](https://github.com/oprisnik)) +- Support generating `getName` in react-native-codegen for Java TurboModules ([90538909f9](https://github.com/facebook/react-native/commit/90538909f988a8be9475cf12471269b70dbc179e) by [@javache](https://github.com/javache)) +- Override default Talkback automatic content grouping and generate a custom contentDescription ([759056b499](https://github.com/facebook/react-native/commit/759056b49975c30cd561826e1499ebdf7aa8674d) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Enable AnimatedInterpolation to interpolate arbitrary color types. ([e7dbfb2dbd](https://github.com/facebook/react-native/commit/e7dbfb2dbd98059ddd6e982e2e43c1e7df91a4cc) by [@javache](https://github.com/javache)) +- Added getter for line height in CustomLineHeightSpan ([2d2f9da80b](https://github.com/facebook/react-native/commit/2d2f9da80b86505dace0ee8ffbadde151067cb8f)) +- Add POST_NOTIFICATIONS permission to AndroidManifest of RNTester ([c84cc4b46c](https://github.com/facebook/react-native/commit/c84cc4b46c8dfbb62c3b95fc26aa59f0105f0438) by [@makovkastar](https://github.com/makovkastar)) + +#### iOS specific + +- Added examples of direct manipulation ([a44d8a0f8a](https://github.com/facebook/react-native/commit/a44d8a0f8a9b6533b50ac6318fa5993bd41d444b) by [@cipolleschi](https://github.com/cipolleschi)) +- Support workspace and isolated setups with `pod install` ([0eff8d66c9](https://github.com/facebook/react-native/commit/0eff8d66c9acfad91c9e6a37b321034358ee4719) by [@robhogan](https://github.com/robhogan)) +- Add example in the Interop Layer to use constants ([a5866ca3aa](https://github.com/facebook/react-native/commit/a5866ca3aad53802e8010295a205e956e8e26120) by [@cipolleschi](https://github.com/cipolleschi)) +- Add example in the Interop Layer to use events ([c005830958](https://github.com/facebook/react-native/commit/c005830958921a030fd46b6968b778509d3bcb45) by [@cipolleschi](https://github.com/cipolleschi)) +- Add invoking dev menu on iOS by pressing `d` in terminal. ([f72f8daeaf](https://github.com/facebook/react-native/commit/f72f8daeaf20ae53e778143aecbb96303852aeb0) by [@szymonrybczak](https://github.com/szymonrybczak)) +- Add comments for specifying the path to React Native ([3876368f0c](https://github.com/facebook/react-native/commit/3876368f0c5e5dcbafee9a71da80a4a7226096a0) by [@sottar](https://github.com/sottar)) +- Add explicit support for M2 iPad Apple Pencil hovering in the Pointer Events implementation ([0c150b2289](https://github.com/facebook/react-native/commit/0c150b2289818267c940b6e726ec2f7725659817) by [@vincentriemer](https://github.com/vincentriemer)) +- Add message with instructions about what to do if the cleanup of the build folder fails. ([1b7127bb05](https://github.com/facebook/react-native/commit/1b7127bb052096509de60ee5eb098d669c616f32)) +- Enable AnimatedInterpolation to interpolate arbitrary color types. ([56b10a8351](https://github.com/facebook/react-native/commit/56b10a83511ee509c36eb91f53da58d5eda643d5) by [@javache](https://github.com/javache)) +- Allow for custom project dir in react-native-xcode script ([436da18fce](https://github.com/facebook/react-native/commit/436da18fce99af6361bae5719cfce0ed4539a3f7) by [@itxch](https://github.com/itxch)) +- Enable AnimatedInterpolation to interpolate arbitrary color types. ([6003e70e84](https://github.com/facebook/react-native/commit/6003e70e84c369d7dc2c6bea50ea41f0bac79595) by [@javache](https://github.com/javache)) + +### Changed + +- Default condition set for experimental Package Exports is now `['require', 'react-native']` ([308838c0ff](https://github.com/facebook/react-native/commit/308838c0ff3cdc4c7817afe349eddfab80c0c76c) by [@huntie](https://github.com/huntie)) +- Run commit hooks before layout calculation ([8d0b5af1fc](https://github.com/facebook/react-native/commit/8d0b5af1fc13928c024663f10b0257e816bd6696) by [@tomekzaw](https://github.com/tomekzaw)) +- Support mixed props for components in codegen ([0ae5e50e37](https://github.com/facebook/react-native/commit/0ae5e50e3753f03712e796dc28a36083bde87dc1) by [@genkikondo](https://github.com/genkikondo)) +- Switch from `types/jest` to `jest/globals` for new react-native projects ([9af3c9654a](https://github.com/facebook/react-native/commit/9af3c9654ae8e2cb10d49770dd3438aec038fcef) by [@UNIDY2002](https://github.com/UNIDY2002)) +- Move virtualized lists to react-native/virtualized-lists package ([2e3dbe9c2f](https://github.com/facebook/react-native/commit/2e3dbe9c2fbff52448e2d5a7c1e4c96b1016cf25) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Add minimum necessary .d.ts files to react-native-codegen ([ac5aec3f5c](https://github.com/facebook/react-native/commit/ac5aec3f5caa732f4565328447ffa9da7ede8dec), ([be3845adec](https://github.com/facebook/react-native/commit/be3845adec324e4b3ae6efd8f85d3569f1cb60b8) by [@ZihanChen-MSFT](https://github.com/ZihanChen-MSFT)) +- Change PerformanceApiExample to use ModulePathing ([6a395cb2d7](https://github.com/facebook/react-native/commit/6a395cb2d722761825c9f24468b6d036e3e0f52c) by [@TatianaKapos](https://github.com/TatianaKapos)) +- Re-organize the parameters of TurboModuleBinding::install() ([cbdbb47467](https://github.com/facebook/react-native/commit/cbdbb474675bb6fbd5857873234d825c52ca16b3)) +- `EventEmitter#addListener` now throws if the 2nd argument is not a function. ([2780ba38ff](https://github.com/facebook/react-native/commit/2780ba38ff23f4c5e717b8fd8a733b649701f00c) by [@yungsters](https://github.com/yungsters)) +- When a ScrollView's `ref` or `innnerViewRef` changes, the old ref will now be invoked with `null` and the new ref with the active instance. (Previously, changing `ref` or `innerViewRef` on a `ScrollView` would be treated as though the ref had not changed at all.) ([7cf4cf3afb](https://github.com/facebook/react-native/commit/7cf4cf3afbea4463427944fbed30768a796db724) by [@yungsters](https://github.com/yungsters)) +- Turbo Module supports intersection type for TypeScript ([bbed15d4ae](https://github.com/facebook/react-native/commit/bbed15d4ae6df23bab2f0730562396ef61f0bc59) by [@ZihanChen-MSFT](https://github.com/ZihanChen-MSFT)) +- Find node binary when using asdf as the node version manager with custom `$ASDF_DIR` ([f6a4e4f20f](https://github.com/facebook/react-native/commit/f6a4e4f20f0d3b5fe2aad171cded9aba06d3c8f8) by [@MuhmdRaouf](https://github.com/MuhmdRaouf)) +- Turbo module codegen support interface with inheritance in module ([bf34810c5c](https://github.com/facebook/react-native/commit/bf34810c5c188cd1c42e2ac0c52d08790209bc1e) by [@ZihanChen-MSFT](https://github.com/ZihanChen-MSFT)) +- Use number literals in TypeScript types for `FileReader` and `XMLHttpRequest` states ([8568b93733](https://github.com/facebook/react-native/commit/8568b937335b152c2836e7790c1db75e93365787) by [@eps1lon](https://github.com/eps1lon)) +- Moved jest config from package.json to dedicated jest.config.js file ([473eb1dd87](https://github.com/facebook/react-native/commit/473eb1dd870a4f62c4ebcba27e12bde1e99e3d07) by [@Adnan-Bacic](https://github.com/Adnan-Bacic)) +- Removed iOS flag from `scrollEventThrottle` docs ([8ea1cba06a](https://github.com/facebook/react-native/commit/8ea1cba06a78fba023e5a441ad5c4755d0d504ac) by [@robwalkerco](https://github.com/robwalkerco)) +- Renamed App-test.tsx to App.test.tsx to unify naming convention with create-react-app ([3c03aef151](https://github.com/facebook/react-native/commit/3c03aef1511844262f38149ad261e26703f55ead) by [@Adnan-Bacic](https://github.com/Adnan-Bacic)) +- Turbo module codegen support interface like alias in module ([8befb740d6](https://github.com/facebook/react-native/commit/8befb740d6cd3de6ead067ac01b70c37d4b5b1bc) by [@ZihanChen-MSFT](https://github.com/ZihanChen-MSFT)) +- Append RCTRedBoxGetEnabled() in RCTExceptionsManager.mm ([2217ea4136](https://github.com/facebook/react-native/commit/2217ea4136e96185c46947b5afe0a24574b3f23a) by [@nxdm](https://github.com/nxdm)) +- ActivityIndicator and remove .flow ([9c57a7f209](https://github.com/facebook/react-native/commit/9c57a7f20925765da69590256ca8755b71735cdb) by [@lunaleaps](https://github.com/lunaleaps)) +- Mark methods on JSI references as const. ([03b17d9af7](https://github.com/facebook/react-native/commit/03b17d9af7e4e3ad3f9ec078b76d0ffa33a3290e) by [@neildhar](https://github.com/neildhar)) +- Fix codegen output for object with indexer ([f07490b1f1](https://github.com/facebook/react-native/commit/f07490b1f1b492b75cfa06df00f6e89b404a1ee8) by [@ZihanChen-MSFT](https://github.com/ZihanChen-MSFT)) +- Fix codegen to add `T` of `Promise` in CodegenSchema.js ([8a38e03e0f](https://github.com/facebook/react-native/commit/8a38e03e0f25528063d24a429c1d650363a0eee7) by [@ZihanChen-MSFT](https://github.com/ZihanChen-MSFT)) +- Renamed react-native/polyfills -> react-native/js-polyfills and align with other packages versions (0.72.0) as a part of migration to monorepo ([71399d0891](https://github.com/facebook/react-native/commit/71399d089187c3e2e58b3cbf31977368d0f216fa) by [@hoxyq](https://github.com/hoxyq)) +- Rename normalize-color to normalize-colors as part of https://github.com/react-native-community/discussions-and-proposals/pull/480 ([dc3355920d](https://github.com/facebook/react-native/commit/dc3355920d7f6f4ef887e0ff01153e23e660b5ea) by [@Titozzz](https://github.com/Titozzz)) +- Renamed react-native-codegen package to react-native/codegen and updated references ([b7a85b59b5](https://github.com/facebook/react-native/commit/b7a85b59b5798add4e9dbfb5f5f2fc62756e30b5) by [@shivenmian](https://github.com/shivenmian)) +- Rename assets to assets-registry ([3c5a8290ae](https://github.com/facebook/react-native/commit/3c5a8290ae1645672ee585feaf6ff38df1e30b34) by [@fortmarek](https://github.com/fortmarek)) +- Rename polyfills to js-polyfills as part of https://github.com/react-native-community/discussions-and-proposals/pull/480 ([ca1ae5c44f](https://github.com/facebook/react-native/commit/ca1ae5c44ffa0b1a149e69e47b7f51cb6a914734) by [@Titozzz](https://github.com/Titozzz)) +- Rename react-native-gradle-plugin to react-native/gradle-plugin ([6f11b10a88](https://github.com/facebook/react-native/commit/6f11b10a88235ad7de1a5777e5cdf7a582a231b7) by [@hoxyq](https://github.com/hoxyq)) +- Renamed `react-native-community/eslint-plugin` to `react-native/eslint-plugin` v0.72.0 to align with other packages ([5aead70e80](https://github.com/facebook/react-native/commit/5aead70e8026e6567cb79e585ab2c6cf6e396892) by [@afoxman](https://github.com/afoxman)) +- Untrack Test Reports generated by test libraries (reporters E.g. `jest-junit`) ([0ba1127c15](https://github.com/facebook/react-native/commit/0ba1127c15182564ac25b41b55433ed8f9512a9c) by [@Pranav-yadav](https://github.com/Pranav-yadav)) +- Add `TSMethodSignature` to react-native-codegen ([ae1d54bc5a](https://github.com/facebook/react-native/commit/ae1d54bc5ac5ecdf5f7e17b709c53872c606277e) by [@ZihanChen-MSFT](https://github.com/ZihanChen-MSFT)) +- Any `ref` set on `TextInput` will now be updated less frequently (when the underlying `ref` has not changed). ([666f56bff3](https://github.com/facebook/react-native/commit/666f56bff318549b62ae5f68f0a046ef8d81c545) by [@yungsters](https://github.com/yungsters)) +- Add intersection types in react-native-codegen for TypeScript ([813fd04118](https://github.com/facebook/react-native/commit/813fd04118c30054cc7c30e231cd9d4002423d32) by [@ZihanChen-MSFT](https://github.com/ZihanChen-MSFT)) +- Update TextInput inputMode to map "none" to showSoftInputOnFocus ([b6869be1ac](https://github.com/facebook/react-native/commit/b6869be1ac0bedcb846722160f29fb4591ae5013) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- LogBox now makes URL links tappable. ([d9ade19b71](https://github.com/facebook/react-native/commit/d9ade19b711fae03838581ff2564185d5b7a24cb) by [@sammy-SC](https://github.com/sammy-SC)) +- Upgrade to deprecated-react-native-prop-types@4.1.0 ([f84256a924](https://github.com/facebook/react-native/commit/f84256a924ef8aee8ac5773dbf569ee627472101) by [@yungsters](https://github.com/yungsters)) +- Flipper to 0.182.0 ([8fae37eaea](https://github.com/facebook/react-native/commit/8fae37eaeab0c75c0be2885ce9198131e4d74c92) by [@cortinico](https://github.com/cortinico)) +- Bump metro to 0.76.5 and CLI to 11.3.1 ([7c5dc1d9bc](https://github.com/facebook/react-native/commit/7c5dc1d9bc57c9b07ecabaff53b5ed79c9dd586f)) +- Bump tsconfig/react-native to 3.0.0 ([5c4649af27](https://github.com/facebook/react-native/commit/5c4649af279d40c83b181f2a35b7cf58a50eac2a) by [@NickGerleman](https://github.com/NickGerleman)) +- Brew overwrites system Python 3. ([ed8a3e08e2](https://github.com/facebook/react-native/commit/ed8a3e08e2f227a37730b697b0e4e2c7d63e27ff) by [@blakef](https://github.com/blakef)) +- Change the way types for New Architecture/experimental APIs are exposed. ([f9bf14d09d](https://github.com/facebook/react-native/commit/f9bf14d09d70fb89f7425c6c7f99aec96cbb2bf8) by [@lunaleaps](https://github.com/lunaleaps)) +- Backporting babel bumps to 0.72 ([97986561f6](https://github.com/facebook/react-native/commit/97986561f60d7cf17eed3e264743198429b54a8b) by [@hoxyq](https://github.com/hoxyq)) + +#### Android specific + +- Migrate packages to not eager initialize view managers ([d7eb3bfcb3](https://github.com/facebook/react-native/commit/d7eb3bfcb3df43d787af34cbd16730b2a12b6714)) +- Do not explicitely depend on androidx.swiperefreshlayout:swiperefreshlayout ([179d5ab8ee](https://github.com/facebook/react-native/commit/179d5ab8eeb4393737049655876f5853b07f2560) by [@cortinico](https://github.com/cortinico)) +- Remove the enableSeparateBuildPerCPUArchitecture from the template entirely ([dadf74fb68](https://github.com/facebook/react-native/commit/dadf74fb68980f4cba3d23e3802ee431a0713cca) by [@cortinico](https://github.com/cortinico)) +- Convert Bridge-only calls to overridable functions ([1058bb8096](https://github.com/facebook/react-native/commit/1058bb809602a5223fa0adba74e7cab4df766685)) +- Use ThemedReactContext explicitly to reduce confusion ([9f78517d64](https://github.com/facebook/react-native/commit/9f78517d6401f3a7ece453825a059a13b73f6140)) +- Add notes to `aria-labelledby` from Text props ([72d3da19ce](https://github.com/facebook/react-native/commit/72d3da19cecca6a1bc8119f963311e1126e4c04b) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Add POST_NOTIFICATION runtime permission to RNTester ([63a4539e4d](https://github.com/facebook/react-native/commit/63a4539e4d36ac90137eea6cdde0154ca06878c0) by [@makovkastar](https://github.com/makovkastar)) +- Removing code for Android API level < 21 ([22ba1e45c5](https://github.com/facebook/react-native/commit/22ba1e45c52edcc345552339c238c1f5ef6dfc65) by [@mdvacca](https://github.com/mdvacca)) +- Align creation of FabricUIManager with bridge ([6d45e49dc7](https://github.com/facebook/react-native/commit/6d45e49dc783d0af3a39be2df5e8495541d65e5f)) +- For supporting Dev Loading View across multiple platforms, changed the Loading View of Android to rely on the native implementation instead of Toast. Getting rid of the JS changes relying on Toast for Dev Loading View now that the native module is released. ([208f559505](https://github.com/facebook/react-native/commit/208f5595055426305a9f23e92546b2ad09a8a52c)) +- Remove unnecessary repositories{} block from top level build.gradle ([51a48d2e2c](https://github.com/facebook/react-native/commit/51a48d2e2c64a18012692b063368e369cd8ff797) by [@cortinico](https://github.com/cortinico)) +- Include the inspector in all build modes, and only turn it off/on at runtime. ([8284303ec8](https://github.com/facebook/react-native/commit/8284303ec8d670a421745b3f580f184afa892592)) +- Bump Soloader to 0.10.5 ([92a705b0e0](https://github.com/facebook/react-native/commit/92a705b0e0654429068d9de130f2216373124bbb) by [@simpleton](https://github.com/simpleton)) +- Bump AGP to 7.4.x ([4c5eb8dd2a](https://github.com/facebook/react-native/commit/4c5eb8dd2a8cfb78783ab9cc3ac5a1c3f7937b63), ([5647d79dc9](https://github.com/facebook/react-native/commit/5647d79dc97ab2787a9575cb1621725d865b9814) by [@cortinico](https://github.com/cortinico)) +- Bump Gradle to 8.x ([81dd3afe0b](https://github.com/facebook/react-native/commit/81dd3afe0bb88fbfa5b11d6f4c95f8684c9e1b47), ([10a8f186eb](https://github.com/facebook/react-native/commit/10a8f186eb41441ebad0c91be4f88deb4f9c6366) by [@cortinico](https://github.com/cortinico)) +- Kotlin to 1.7.22 for Gradle ([270584ac79](https://github.com/facebook/react-native/commit/270584ac79ebb5b8e256bf7422615a5311e0c080) by [@cortinico](https://github.com/cortinico)) + +#### iOS specific + +- Fixed URL to New Arch info ([6714b99289](https://github.com/facebook/react-native/commit/6714b99289d68b2f1efdb38d9977da725778e949) by [@frankcalise](https://github.com/frankcalise)) +- Prefer `Content-Location` header in bundle response as JS source URL ([671ea383fe](https://github.com/facebook/react-native/commit/671ea383fe45dd9834a0c0481360de050df7f0c9) by [@robhogan](https://github.com/robhogan)) +- Add support to enable the Hermes Sampling Profiler ([dce9d8d5de](https://github.com/facebook/react-native/commit/dce9d8d5de381fe53760ddda0d6cbbdfb5be00e4) by [@cipolleschi](https://github.com/cipolleschi)) +- Enable layout animations on iOS in OSS ([0a30aa3612](https://github.com/facebook/react-native/commit/0a30aa361224639dbec0bbf33351673b67d31e75) by [@sammy-SC](https://github.com/sammy-SC)) +- Update how the `react-native.config.js` is consumed to add elements in the interop layer. ([a055e07c3e](https://github.com/facebook/react-native/commit/a055e07c3ecd82dad6b2f9d9cc0088bce689d07e) by [@cipolleschi](https://github.com/cipolleschi)) +- Use contents of sdks/.hermesversion to let cocoapods recognize Hermes updates. ([9f496e2be5](https://github.com/facebook/react-native/commit/9f496e2be5cfa55cd993c94f3a9210955bea085c) by [@dmytrorykun](https://github.com/dmytrorykun)) +- Rename "Debug Menu" title to "Dev Menu" ([6971540c90](https://github.com/facebook/react-native/commit/6971540c90ae9e56bcc65e0c33c1ffb3db0a1e06) by [@huntie](https://github.com/huntie)) +- Give precedence to `textContentType` property for backwards compat as mentioned in https://github.com/facebook/react-native/issues/36229#issuecomment-1470468374 ([c0abff11b6](https://github.com/facebook/react-native/commit/c0abff11b66d9ec3a8e1d09333a3fb6c05678bed) by [@lunaleaps](https://github.com/lunaleaps)) +- Use SocketRocket for web socket library ([9ee0e1c78e](https://github.com/facebook/react-native/commit/9ee0e1c78e422a83de01d045657c10454f66980a)) +- Pull out CGContext early in UIImage+Diff ([7f2dd1d49c](https://github.com/facebook/react-native/commit/7f2dd1d49cc3c0bf5e24fdb37f6457151c1f06c4) by [@Saadnajmi](https://github.com/Saadnajmi)) +- Remove assumptions on super's description ([a5bc6f0574](https://github.com/facebook/react-native/commit/a5bc6f0574b6eff52b65d5324749d89de01b63a5) by [@Saadnajmi](https://github.com/Saadnajmi)) +- Automatically update Search Path on pods ([ad686b0ce1](https://github.com/facebook/react-native/commit/ad686b0ce1ce69e8414e0c385ce0c7b4277f7a2f) by [@cipolleschi](https://github.com/cipolleschi)) +- Install the -DNDEBUG flag on Release configurations, without requiring PRODUCTION=1 flag ([93fdcbaed0](https://github.com/facebook/react-native/commit/93fdcbaed0f69b268e1ae708a52df9463aae2d53) by [@cipolleschi](https://github.com/cipolleschi)) +- Create a new compile time flag to enable remote sample profiling. ([de28f9b8ea](https://github.com/facebook/react-native/commit/de28f9b8ea2c4c2e3584da76145b9d6ce0e68b02)) +- Bumbed version of Cocoapods to support Ruby 3.2.0 ([0f56cee8e1](https://github.com/facebook/react-native/commit/0f56cee8e1fca9575e83f439274b83e01bdd98e2) by [@cipolleschi](https://github.com/cipolleschi)) +- Automatically install the RuntimeScheduler ([3e88fd01ce](https://github.com/facebook/react-native/commit/3e88fd01cecfa9c627506c8ab0081d1e4865862a) by [@cipolleschi](https://github.com/cipolleschi)) +- Generate RCTFabric framework's headers in the React folder ([e7becb06c1](https://github.com/facebook/react-native/commit/e7becb06c16718a38570ba3a06d5059276be4b23) by [@cipolleschi](https://github.com/cipolleschi)) +- Properly install dependencies with `use_frameworks!` ([6d34952420](https://github.com/facebook/react-native/commit/6d349524201e150029202134910de445328072e8) by [@cipolleschi](https://github.com/cipolleschi)) +- Moved the files from `.../textlayoutmanager/platform/ios` to `.../textlayoutmanager/platform/ios/react/renderer/textlayoutmanager` ([0e09d6f8a6](https://github.com/facebook/react-native/commit/0e09d6f8a665357f0dc642067eceb8f51ae24b76) by [@cipolleschi](https://github.com/cipolleschi)) +- Moved the files from `.../imagemanager/platform/ios` to `.../imagemanager/platform/ios/react/renderer/imagemanager` ([931a4c5e23](https://github.com/facebook/react-native/commit/931a4c5e239a006ecc81becf3252d23d44c969ef) by [@cipolleschi](https://github.com/cipolleschi)) +- Moved the files from `.../textinput/iostextinput` to `.../textinput/iostextinput/react/renderer/components/iostextinput` ([5588e0fe0b](https://github.com/facebook/react-native/commit/5588e0fe0b78bfcbc32b6880e9c985853aea5653) by [@cipolleschi](https://github.com/cipolleschi)) +- Moved the files from `.../nativemodule/xxx/platform/ios` to `.../nativemodule/xxx/platform/ios/ReactCommon` ([d1e500c3b1](https://github.com/facebook/react-native/commit/d1e500c3b19182897ccfb8abfe87e3f32dcacd3e) by [@cipolleschi](https://github.com/cipolleschi)) +- Moved the files from `.../platform/ios` to `.../platform/ios/react/renderer/graphics` ([b5e4fea86e](https://github.com/facebook/react-native/commit/b5e4fea86ef9df1ed0edb438f918dfc8330f649c) by [@cipolleschi](https://github.com/cipolleschi)) +- Build hermesc in Xcode run script phase. ([a5c77115ae](https://github.com/facebook/react-native/commit/a5c77115ae94b46823dc788add516493ee8e82cb) by [@dmytrorykun](https://github.com/dmytrorykun)) +- Do not add "Copy Hermes Framework" script phase to hermes-engine target. ([af6c9e2183](https://github.com/facebook/react-native/commit/af6c9e218305c70e479c75e5ce1a8d633b1e2947) by [@dmytrorykun](https://github.com/dmytrorykun)) +- Refactor RCTEventEmitter initialization ([25a00520d8](https://github.com/facebook/react-native/commit/25a00520d80b8b456b1eccfb106b75929f2f3bc2) by [@cipolleschi](https://github.com/cipolleschi)) + +### Deprecated + +#### iOS specific + +- Deprecate the `ReactCommon/react/renderer/graphics/conversions.h` in favor of `ReactCommon/react/core/graphicsConversions.h` ([d72697ca95](https://github.com/facebook/react-native/commit/d72697ca95820ebc7594b11bb5a6effeb84f2d90) by [@cipolleschi](https://github.com/cipolleschi)) + +### Removed + +- Remove inline props from experimental ([8c4694f708](https://github.com/facebook/react-native/commit/8c4694f708fec310fc13193cc7fda40d971ed847)) +- Refactor(react-native-github): internalized Slider JS files ([05968d16e1](https://github.com/facebook/react-native/commit/05968d16e1c4714a7ebfb08fff60ec7d5c914de1) by [@hoxyq](https://github.com/hoxyq)) +- Remove `.node_version` from app template. ([a80578afc4](https://github.com/facebook/react-native/commit/a80578afc456c352edb52fc9b7e19899553a359a) by [@robhogan](https://github.com/robhogan)) +- Clean up unnecessary lambda function for preallocate after D40403682 ([0569f6500e](https://github.com/facebook/react-native/commit/0569f6500e1ba9dbf021c8d693d5ac31af5dd586)) +- Remove unused type imports 1/1 ([58a6cf840a](https://github.com/facebook/react-native/commit/58a6cf840afc9522b6cd9f3b15d119ddba7dab31) by [@alunyov](https://github.com/alunyov)) +- Remove force_static from ReactCommon/react/renderer/core ([e088f81375](https://github.com/facebook/react-native/commit/e088f81375aa0216625bc38c964f50af6c4107b7) by [@javache](https://github.com/javache)) + +#### Android specific + +- Deprecate LazyReactPackage.getReactModuleInfoProviderViaReflection() ([11570e71a2](https://github.com/facebook/react-native/commit/11570e71a2747602ff485552094b413375b19a96)) +- UIManager.preInitializeViewManagers ([848ac0c3be](https://github.com/facebook/react-native/commit/848ac0c3bea5f38c002d316dbfb54c2d740bedfe) by [@javache](https://github.com/javache)) +- Removed android sources of Slider module ([4c40014d43](https://github.com/facebook/react-native/commit/4c40014d43abe88b17db75aca9de9cca349ecbcc) by [@hoxyq](https://github.com/hoxyq)) +- Remove the react.gradle file as it's unused ([d4a9bdc40e](https://github.com/facebook/react-native/commit/d4a9bdc40e06bdda9565cc43ea5af5a13ff6f1cf) by [@cortinico](https://github.com/cortinico)) +- Remove .mk prebuilt file and .mk file generation from codegen ([7933dd78da](https://github.com/facebook/react-native/commit/7933dd78daed84581f3013c0a8e0130b6fdf81f9) by [@cortinico](https://github.com/cortinico)) +- Remove deprecated POST_NOTIFICATION from `PermissionsAndroid` ([deb6b380b2](https://github.com/facebook/react-native/commit/deb6b380b251564163939fbf04cf62e07c9820bb) by [@cortinico](https://github.com/cortinico)) + +#### iOS specific + +- Removed unused RCTWeakProxy helper ([2fbefff178](https://github.com/facebook/react-native/commit/2fbefff178b11a61089bd41296c918fa1b8857b9) by [@javache](https://github.com/javache)) +- Removed Slider module ([465e937533](https://github.com/facebook/react-native/commit/465e9375338c8a3baab963c1f699c1c67af01029) by [@hoxyq](https://github.com/hoxyq)) +- Removed DatePickerIOS module ([0ff7b7fac2](https://github.com/facebook/react-native/commit/0ff7b7fac2750f149592e41bb8825dcc65dea71d) by [@hoxyq](https://github.com/hoxyq)) +- Removed iOS sources of Slider module ([fee9510b2d](https://github.com/facebook/react-native/commit/fee9510b2d8ff73be632dbe6f07003f001104836) by [@hoxyq](https://github.com/hoxyq)) +- Removed native iOS sources of ProgressViewIOS ([1453ef1a88](https://github.com/facebook/react-native/commit/1453ef1a8836ead03f66792bd36bfcde333434c0) by [@hoxyq](https://github.com/hoxyq)) +- Remove conformance to RCTComponentViewFactoryComponentProvider which does not exists in 0.72 ([ee177cab75](https://github.com/facebook/react-native/commit/ee177cab7583fa305d43c66342fb9b3693a4769a)) + +### Fixed + +- Improved support for AnimatedInterpolation of color props. ([b589123a3d](https://github.com/facebook/react-native/commit/b589123a3dc0c6190137fbd2e6c18f24b98642f1) by [@javache](https://github.com/javache)) +- Improved handling of native colors in Animated.Colors ([dccb57fb50](https://github.com/facebook/react-native/commit/dccb57fb50874e31dd0d3f6e39666e4a5b9a079d) by [@javache](https://github.com/javache)) +- Patch AnimatedStyle to avoid discarding the initial style info ([c06323f463](https://github.com/facebook/react-native/commit/c06323f46334ee720cc46d48405ce584de16163d) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Gracefully handle out-of-bounds initialScrollIndex ([aab9df3710](https://github.com/facebook/react-native/commit/aab9df37102b6b8661a9e22ee8ae63166c8c632e) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix VirtualizedList onViewableItemsChanged won't trigger if first item in data is null ([011ea3306f](https://github.com/facebook/react-native/commit/011ea3306f02479b8003f519f7fc568a743b2019) by [@gauravroy1995](https://github.com/gauravroy1995)) +- Fix VirtualizedList `onViewableItemsChanged` won't trigger if first item in data evaluate to false ([1f0c2c2895](https://github.com/facebook/react-native/commit/1f0c2c289506aa0a5e1fc0e77e1fe48351e2050d) by [@samchan0221](https://github.com/samchan0221)) +- Calculate VirtualizedList render mask for focused cell during batched state updates ([cab865be79](https://github.com/facebook/react-native/commit/cab865be797b724d2fda5441e0ef23559180f722) by [@NickGerleman](https://github.com/NickGerleman)) +- Bail on realizing region around last focused cell if we don't know where it is ([776fe7a292](https://github.com/facebook/react-native/commit/776fe7a29271d1b4678a0913315487724d201449) by [@NickGerleman](https://github.com/NickGerleman)) +- Avoid VirtualizedList viewability updates during state updates ([62a0640e4a](https://github.com/facebook/react-native/commit/62a0640e4a8297177e857530e46010e83315e70a) by [@NickGerleman](https://github.com/NickGerleman)) +- Add `lineBreakStrategyIOS` prop type for Text and TextInput ([0c5c07fc9b](https://github.com/facebook/react-native/commit/0c5c07fc9bf2ca13aece3dd9fa35d6c822f1fd84) by [@jeongshin](https://github.com/jeongshin)) +- Fix negative value rounding issue for nodes across an axis ([37171ec78f](https://github.com/facebook/react-native/commit/37171ec78f377fbae89ce43010f9cf69c1e60fbc)) +- Reduce use of assertions when parsing accessibility props passed from JS ([a064de151f](https://github.com/facebook/react-native/commit/a064de151f8314abacbd0f17127597266644fd78) by [@motiz88](https://github.com/motiz88)) +- Fixes crash when using togglebutton accessibilityRole with Text ([dcc5dbe562](https://github.com/facebook/react-native/commit/dcc5dbe562cedd3bb9e954736c18780830e5f719) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Fixes an issue with the EventEmitter type definition file ([4acef8e4a4](https://github.com/facebook/react-native/commit/4acef8e4a4d1ec51eeea751c7ee6aa36d8b7f457) by [@helenaford](https://github.com/helenaford)) +- Fix animated components ref type inferred `any` ([419b41f06d](https://github.com/facebook/react-native/commit/419b41f06dfd7c75d9734ce2d61b511f11097c63) by [@jeongshin](https://github.com/jeongshin)) +- Allow out-of-range initialScrollIndex after first scroll ([d595fbcc5a](https://github.com/facebook/react-native/commit/d595fbcc5a1a6c4a9fd9f20b6cabe1093ea346a6) by [@NickGerleman](https://github.com/NickGerleman)) +- Delete refs to unmounted CellRenderers ([c376e78224](https://github.com/facebook/react-native/commit/c376e782247766d2c1f92cadf3ce1ab368933d25) by [@NickGerleman](https://github.com/NickGerleman)) +- Enforce compatibility with `exactOptionalPropertyTypes` ([7858a2147f](https://github.com/facebook/react-native/commit/7858a2147fde9f754034577932cb5b22983f658f) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix touch handling so that hitSlop can extend beyond parent view bounds. ([96659f8e83](https://github.com/facebook/react-native/commit/96659f8e83e68f6330aaa59e3d5fb0953c67f1d1) by [@genkikondo](https://github.com/genkikondo)) +- Export EmitterSubscription TypeScript Type ([eb83356cee](https://github.com/facebook/react-native/commit/eb83356ceee1ff3bca3073d7c4050981f2c01a4c) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix: remove gap if its last element in line (fix flex gap extra spacing when children determine parents main axis size) ([d867ec0abb](https://github.com/facebook/react-native/commit/d867ec0abb6cf6da6e2be44d28bbf9fc38319298) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Fixes JSDoc in Clipboard setString ([0ecb4e64f0](https://github.com/facebook/react-native/commit/0ecb4e64f0006a0dd2fb64cb64f97ed01c638781) by [@mikemikhaylov](https://github.com/mikemikhaylov)) +- Fix typing for TS AnimatableStringValue ([eb2f86a46a](https://github.com/facebook/react-native/commit/eb2f86a46a89765de3bd32541d3e7043fe236108) by [@rshest](https://github.com/rshest)) +- Fix types + documentation for CellRendererComponent ([2d41e6642e](https://github.com/facebook/react-native/commit/2d41e6642eaee636f90d5737ecdcddf2d89cfa2a) by [@NickGerleman](https://github.com/NickGerleman)) +- Fixed error during native DAG creation when there are multiple AnimatedValue props ([c72c592ecd](https://github.com/facebook/react-native/commit/c72c592ecd9d31ec1661958d4e5f77f8dfb37cac) by [@genkikondo](https://github.com/genkikondo)) +- Fix YogaLayoutableShadowNode handling of non-layoutable children ([024a8dc8ff](https://github.com/facebook/react-native/commit/024a8dc8ffd694426912c6abb0852e5d5f6c90c8) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix type definition for `unstable_batchedUpdates` ([71157f6ba6](https://github.com/facebook/react-native/commit/71157f6ba604a57b9fa79bc0401b89dc0b01145b) by [@k-yle](https://github.com/k-yle)) +- Add missing SectionList types for Animated SectionList ([ed39d639ea](https://github.com/facebook/react-native/commit/ed39d639ea196181732186df735f5e58543ace32) by [@jeongshin](https://github.com/jeongshin)) +- Add objectFit to the ImageStyle interface located in the StyleSheetTypes.d.ts file ([32d03c250c](https://github.com/facebook/react-native/commit/32d03c250c52e1d6e87c6eb0e2b87add4b56f031) by [@alvessteve](https://github.com/alvessteve)) +- Add src, srcSet, referrerPolicy, tintColor to Image.d.ts declaration file ([74cb6073f3](https://github.com/facebook/react-native/commit/74cb6073f3ae926de712d883d08eb19ed2339788) by [@alvessteve](https://github.com/alvessteve)) +- Fix missing `height`, `width`, `crossOrigin` props on Typescript Image.d.ts file ([bcf493f346](https://github.com/facebook/react-native/commit/bcf493f346e320d683ced471750bb8d8e3b1a5ae) by [@alvessteve](https://github.com/alvessteve)) +- Fixed typo in the initialNumToRenderOrDefault description's comment ([ba7f9b40a6](https://github.com/facebook/react-native/commit/ba7f9b40a65c0dbf59341ba61adc8ef736d0239e) by [@ellouzeskandercs](https://github.com/ellouzeskandercs)) +- Fixed string key calculation in constexpr from Performance C++ native module. ([6faddc3870](https://github.com/facebook/react-native/commit/6faddc3870b9dad0ed6d178492e92b03e8c00a8c)) +- Fix computation of relative layout to return empty layout for nodes with display: none and children. ([6018c19991](https://github.com/facebook/react-native/commit/6018c199917403c5f9f5159697dbc61903b9642d) by [@rubennorte](https://github.com/rubennorte)) +- Fix edge case when layout animation caused delete and create mutations in the same batch ([d9f2491a71](https://github.com/facebook/react-native/commit/d9f2491a713d872f2f3c8447dbf789fb17b94524)) +- Fix edge case when delete is queued with conflict layout animation ([cf9c7d51ef](https://github.com/facebook/react-native/commit/cf9c7d51efd99b65527f9b9d2fef0334b972a461)) +- VirtualizedList scrollToEnd with no data ([98009ad94b](https://github.com/facebook/react-native/commit/98009ad94b92320307f2721ee39dbeb9152c0a58) by [@Andarius](https://github.com/Andarius)) +- Fixed a typo in interface.js ([7fedd7577a](https://github.com/facebook/react-native/commit/7fedd7577a249b1dd4f51b5b4a03858fd09cb7ef) by [@rj1](https://github.com/rj1)) +- Add `borderCurve` and `pointerEvents` to `ViewStyle` ([a0800ffc7a](https://github.com/facebook/react-native/commit/a0800ffc7a676555aa9e769fc8fd6d3162de0ea6) by [@eps1lon](https://github.com/eps1lon)) +- Fix whitespace and newline at EOF in template ([efe5f62f91](https://github.com/facebook/react-native/commit/efe5f62f91754ce8101fde24d6a984a5b56186c6) by [@friederbluemle](https://github.com/friederbluemle)) +- Jest mocked requestAnimationFrame callbacks now receive a timestamp parameter ([b44fe4deee](https://github.com/facebook/react-native/commit/b44fe4deee505382698a98d2573691303b0159c3) by [@kmagiera](https://github.com/kmagiera)) +- Removes duplicate DoubleTypeAnnotation label ([1bab3e24b8](https://github.com/facebook/react-native/commit/1bab3e24b887259e29626835e6bb944d105dff59) by [@mikemikhaylov](https://github.com/mikemikhaylov)) +- Filter out Hermes internal bytecode frames (Promise implementation) from error stack traces ([4c911a2dec](https://github.com/facebook/react-native/commit/4c911a2deceb59fc07735205ae3a4622b4334f88) by [@motiz88](https://github.com/motiz88)) +- Add missing AccessibilityInfo Types to TS Typings ([76a14454d7](https://github.com/facebook/react-native/commit/76a14454d7f1f2b2ba8f5a79c2f640fafb42de6d) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix Errors with TypeScript Tests ([c4862a2322](https://github.com/facebook/react-native/commit/c4862a2322e3401eece360bc6b2ed97c26764121) by [@NickGerleman](https://github.com/NickGerleman)) +- Add missing VirtualizedList Imperative Types ([621969b8d8](https://github.com/facebook/react-native/commit/621969b8d85d10f4f9b66be7d5deae58651dc6aa) by [@NickGerleman](https://github.com/NickGerleman)) +- Add missing types for AppRegistry ([8d6e2f86f5](https://github.com/facebook/react-native/commit/8d6e2f86f5685264ee5fe7a1f7c24d6d9e40bbaa) by [@NickGerleman](https://github.com/NickGerleman)) +- Add type for RootTagContext ([4e5421fd9a](https://github.com/facebook/react-native/commit/4e5421fd9a5eb110e27e40b3ab283f973d38408b) by [@NickGerleman](https://github.com/NickGerleman)) +- Add missing types to PushNotificationIOS ([079312895b](https://github.com/facebook/react-native/commit/079312895b3bdc6b934ca51a377cf44419306e8d) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix types for deprecated scrollTo fields ([0d091318ed](https://github.com/facebook/react-native/commit/0d091318ed047c9f6cfe32d70b47fd5c4092c923) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix Vibration.vibrate() allowing null params ([2c2cb09c00](https://github.com/facebook/react-native/commit/2c2cb09c00b4eac98f59a4fcb874b6fbfdc839ff) by [@NickGerleman](https://github.com/NickGerleman)) +- Mark scrollToEnd animated as optional ([e1af6302fc](https://github.com/facebook/react-native/commit/e1af6302fc189948ed0e123a39e0b08cd253fc27) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix type for `StyleSheet.compose()` ([1752fdc0f5](https://github.com/facebook/react-native/commit/1752fdc0f573be4348e4e6e7e31bc53b00aa00c6) by [@NickGerleman](https://github.com/NickGerleman)) +- Add missing type for AnimatedValue.resetAnimation() and AnimatedValue.animate() ([25a25ea234](https://github.com/facebook/react-native/commit/25a25ea234fc60c7a0b99e9c70253f77a69edc60) by [@NickGerleman](https://github.com/NickGerleman)) +- Fixed a backwards compatibility issue with AnimatedInterpolation ([9b280ad1c5](https://github.com/facebook/react-native/commit/9b280ad1c5995f4d5bd5220dee778df3cd65db3f) by [@motiz88](https://github.com/motiz88)) +- Explicitly set parser for jsx in ESLint config ([cdb88a2427](https://github.com/facebook/react-native/commit/cdb88a24273262a64f0706169557dc02d8592568) by [@NickGerleman](https://github.com/NickGerleman)) +- Move flex gap props to the correct type ([ff984ac9b5](https://github.com/facebook/react-native/commit/ff984ac9b55c9c1af50d5785863f5f36f92b62d2) by [@NickGerleman](https://github.com/NickGerleman)) +- Remove constexpr from RectangleEdges.h ([879d303fc7](https://github.com/facebook/react-native/commit/879d303fc7084972d9a04c2aff27ea518b6449c6) by [@TatianaKapos](https://github.com/TatianaKapos)) +- Move certain list prop TS types from SectionList, FlatList to VirtualizedList([6c33fd1c48](https://github.com/facebook/react-native/commit/6c33fd1c4889a5d3dfb7f914c2518c3daa8a5337) by [@aliakbarazizi](https://github.com/aliakbarazizi)) +- Limit diagnostics width output by `hermesc` ([260bcf7f1b](https://github.com/facebook/react-native/commit/260bcf7f1bf78022872eb2f40f33fb552a414809) by [@tido64](https://github.com/tido64)) +- Fix autoComplete type for TextInput ([94356e14ec](https://github.com/facebook/react-native/commit/94356e14ec0562a1fd5a208d93021f102ba9565e) by [@iRoachie](https://github.com/iRoachie)) +- Fix performance issues in Hermes when Debug ([60a452b485](https://github.com/facebook/react-native/commit/60a452b4853dc5651c465867344904dd6fc86703)) +- Fix hermesc for linux ([32327cc177](https://github.com/facebook/react-native/commit/32327cc17779659bc441580d44784a60a74ede32) by [@cipolleschi](https://github.com/cipolleschi)) + +#### Android specific + +- Read GROUP name in gradle-plugin dependency code ([615d9aefc4](https://github.com/facebook/react-native/commit/615d9aefc4274ed7a193c0410ed7f86e90ad1bff) by [@douglowder](https://github.com/douglowder)) +- Fix letters duplication when using autoCapitalize https://github.com/facebook/react-native/issues/29070" ([cbe934bcff](https://github.com/facebook/react-native/commit/cbe934bcff0bdbd26f669fd9ace4fc818ca39e98) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Reset accessibility value when it gets a null value ([aacf28778e](https://github.com/facebook/react-native/commit/aacf28778eadfcae2ca33f66697620f7222d804c)) +- Fix check of "reduce motion" setting on android ([790df10fa9](https://github.com/facebook/react-native/commit/790df10fa9bac18a60bd52178cc222f5e368a44b) by [@baranga](https://github.com/baranga)) +- Fixed text measurement issue related to hyphenation frequency ([01e7ff5513](https://github.com/facebook/react-native/commit/01e7ff5513e2f5ca6f03bb8ac1b9a1a31612cc9a) by [@javache](https://github.com/javache)) +- Fix layout width calculation in onTextLayout ([ccbbcaab9c](https://github.com/facebook/react-native/commit/ccbbcaab9cf3e6148e72f94fe63f77ce5f92416c) by [@reepush](https://github.com/reepush)) +- Fix a bug that returns a random number from callback argument `timeRemaining` of `idleCallbacks` registered by `requestIdleCallbacks`. ([d9ab5e81cf](https://github.com/facebook/react-native/commit/d9ab5e81cf6a030438b36e0c27d45f20317c316e) by [@mir597](https://github.com/mir597)) +- Fix android emulator detection for packager host ([64ff077a66](https://github.com/facebook/react-native/commit/64ff077a6640f9eaed695287469735cb03478927) by [@deecewan](https://github.com/deecewan)) +- Invalid prop values no longer trigger Java exceptions in the legacy renderer ([e328fc2e24](https://github.com/facebook/react-native/commit/e328fc2e2429c7917e33125feafd26ad4699ee00) by [@motiz88](https://github.com/motiz88)) +- Fixed crash occurring in certain native views when handling keyboard events. ([f7e35d4ef7](https://github.com/facebook/react-native/commit/f7e35d4ef7d68d06fba1439c0aa6d9ed05b58a7f) by [@aleqsio](https://github.com/aleqsio)) +- Fixed ScrollView momentum not stopping when calling scrollTo programmatically ([681b35daab](https://github.com/facebook/react-native/commit/681b35daab2d0443278fe18c364b0e72c8c85673) by [@tomekzaw](https://github.com/tomekzaw)) +- Fix memory leak in Android ([bc766ec7f8](https://github.com/facebook/react-native/commit/bc766ec7f8b18ddc0ff72a2fff5783eeeff24857)) +- Address New Architecture performance regressions by properly setting NDEBUG ([8486e191a1](https://github.com/facebook/react-native/commit/8486e191a170d9eae4d1d628a7539dc9e3d13ea4) by [@cortinico](https://github.com/cortinico)) +- LoadingView of Android to use the Toast till the native implementation is functional ([8ccb861231](https://github.com/facebook/react-native/commit/8ccb861231a7cd620ad3cab8fc52088360082f22)) +- Linking.getInitialUrl should not wait for InteractionManager ([3921f05f59](https://github.com/facebook/react-native/commit/3921f05f594691285e79a379897ed698e081a705) by [@javache](https://github.com/javache)) +- Using AccessibilityNodeInfo#addAction to announce Expandable/Collapsible State ([082a033fbb](https://github.com/facebook/react-native/commit/082a033fbbe7d7094af78bafc3b2048194a02bd5) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Corrected Nullable annotations for parameters and return values in TurboModules codegen ([6db3995175](https://github.com/facebook/react-native/commit/6db39951755cef82f06e23a5464cf1caf53c7966) by [@javache](https://github.com/javache)) +- Fix measurement of uncontrolled TextInput after edit ([8a0fe30591](https://github.com/facebook/react-native/commit/8a0fe30591e21b90a3481c1ef3eeadd4b592f3ed) by [@NickGerleman](https://github.com/NickGerleman)) +- Mimimize EditText Spans 9/9: Remove `addSpansForMeasurement()` ([92b8981499](https://github.com/facebook/react-native/commit/92b898149956a301a44f99019f5c7500335c5553) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize EditText Spans 8/N: CustomStyleSpan ([b384bb613b](https://github.com/facebook/react-native/commit/b384bb613bf533aebf3271ba335c61946fcd3303) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize EditText Spans 6/N: letterSpacing ([5791cf1f7b](https://github.com/facebook/react-native/commit/5791cf1f7b43aed1d98cad7bcc272d97ab659111) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 5/N: Strikethrough and Underline ([0869ea29db](https://github.com/facebook/react-native/commit/0869ea29db6a4ca20b9043d592a2233ae1a0e7a2) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 4/N: ReactForegroundColorSpan ([8c9c8ba5ad](https://github.com/facebook/react-native/commit/8c9c8ba5adb59f7f891a5307a0bce7200dd3ac7d) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 3/N: ReactBackgroundColorSpan ([cc0ba57ea4](https://github.com/facebook/react-native/commit/cc0ba57ea42d876155b2fd7d9ee78604ff8aa57a) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 1/N: Fix precedence ([1743dd7ab4](https://github.com/facebook/react-native/commit/1743dd7ab40998c4d3491e3b2c56c531daf5dc47) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix the setup to allow the build-from-source on host projects ([fec5658a32](https://github.com/facebook/react-native/commit/fec5658a321a3c0d5da34efaa59fe8d05575f674) by [@cortinico](https://github.com/cortinico)) +- Fix a crash new app template when `createRootView` is invoked with null bundle ([990971186f](https://github.com/facebook/react-native/commit/990971186fccf1e14c8715cb35ab82ad8e43f99c) by [@cortinico](https://github.com/cortinico)) +- Resolved bug with Text components in New Architecture losing text alignment state. ([31a8e92cad](https://github.com/facebook/react-native/commit/31a8e92caddcdbef9fe74de53e7f412a7e998591) by [@javache](https://github.com/javache)) +- Fix border rendering issue when bottom borders has no width ([1d51032278](https://github.com/facebook/react-native/commit/1d5103227851ab92de889d5e7e910393b5d8743a) by [@BeeMargarida](https://github.com/BeeMargarida)) +- Fix possible `ConcurrentModificationException` in `UIManagerModuleConstantsHelper::createConstants` ([805b88c7a4](https://github.com/facebook/react-native/commit/805b88c7a41084ec7b82d18807b585e267b69352) by [@j-piasecki](https://github.com/j-piasecki)) +- Fixed incorrect logging of `isCatalystInstanceAlive` in exception handler ([daeee2a661](https://github.com/facebook/react-native/commit/daeee2a6619db59391de3b7c6e08db0dbe2331aa) by [@jonnycaley](https://github.com/jonnycaley)) +- Make sure the Native RuntimeScheduler is initialized on Old Arch ([133ccdcc67](https://github.com/facebook/react-native/commit/133ccdcc67a7d19ffa5130949893c2792e3ad9fb) by [@cortinico](https://github.com/cortinico)) +- RNGP dependency substitutions for fork with different Maven group ([012e4bd654](https://github.com/facebook/react-native/commit/012e4bd654f1eee2b00a066ba50a7f9c44cc305b) by [@douglowder](https://github.com/douglowder)) +- Make sure the -DANDROID compilation flag is always included ([3a321ae2bb](https://github.com/facebook/react-native/commit/3a321ae2bb623a8f5c7f064d82ca8ca9df3ebff4) by [@cortinico](https://github.com/cortinico)) +- Remove license header from android/app/build.gradle ([5e847c4309](https://github.com/facebook/react-native/commit/5e847c43097dc93ad2c6a5cdf542041b10f00634) by [@cortinico](https://github.com/cortinico)) +- Make sure Java Toolchain and source/target level is applied to all projects ([52d2065910](https://github.com/facebook/react-native/commit/52d20659105abe2b065148b33c441941104f4d30) by [@cortinico](https://github.com/cortinico)) +- Fix copy / paste menu and simplify controlled text selection on Android ([dfc64d5bcc](https://github.com/facebook/react-native/commit/dfc64d5bcc50c25bab40ba853af9f7b0c1c46d7a) by [@janicduplessis](https://github.com/janicduplessis)) +- Fixed random styling for text nodes with many children ([73f4a788f1](https://github.com/facebook/react-native/commit/73f4a788f18aed2277f6711f689b75ab8ce13b1b) by [@cubuspl42](https://github.com/cubuspl42)) +- Fix Android border clip check ([2d15f50912](https://github.com/facebook/react-native/commit/2d15f50912927b5214473b53cce7043fa128d6b3) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Revert "fix: border width top/bottom not matching the border radius" ([0817eaa301](https://github.com/facebook/react-native/commit/0817eaa3012abc0104ffa0d41b844e1c2db1dcc2) by [@gabrieldonadel](https://github.com/gabrieldonadel)) + +#### iOS specific + +- Fix Flipper by moving podfile modification of preprocessor def `FB_SONARKIT_ENABLED` from React-Core to React-RCTAppDelegate where it is now used. ([34d5212f5c](https://github.com/facebook/react-native/commit/34d5212f5ca468ec28a2a82097c0f7cf8722739d)) +- Invalid prop values no longer trigger redbox in the legacy renderer ([cb28a2c46e](https://github.com/facebook/react-native/commit/cb28a2c46e1c65fbe71a69ee0b0e0bb4b2e20a35) by [@motiz88](https://github.com/motiz88)) +- Fix issue where keyboard does not open when `TextInput` `showSoftInputOnFocus` changes from `false` to `true` ([7425c24cbe](https://github.com/facebook/react-native/commit/7425c24cbe66ec743794b6ffc4cc1a653e821dde) by [@christianwen](https://github.com/christianwen)) +- Fix ScrollView `automaticallyAdjustKeyboardInsets` not resetting when Prefer Cross-Fade Transitions is enabled and keyboard hides ([b8f1bb50f7](https://github.com/facebook/react-native/commit/b8f1bb50f7734cbccb19808aae6f86a92fa8eea5) by [@grgmo](https://github.com/grgmo)) +- Unrecognized fontFamily values no longer trigger a redbox ([d6e9891577](https://github.com/facebook/react-native/commit/d6e9891577c81503407adaa85db8f5bf97557db0) by [@motiz88](https://github.com/motiz88)) +- Do not send extra onChangeText even wnen instantianting multiline TextView ([a804c0f22b](https://github.com/facebook/react-native/commit/a804c0f22b4b11b3d9632dc59a6da14f6c4325e3) by [@dmytrorykun](https://github.com/dmytrorykun)) +- Support 120 FPS or more in `RCTFPSGraph` ([987dd6a358](https://github.com/facebook/react-native/commit/987dd6a35842acde9d540fc42dfe4a2f34fd2ddf) by [@mrousavy](https://github.com/mrousavy)) +- Fix duplicate [RCTConvert UIUserInterfaceStyle:] ([d8b4737ca6](https://github.com/facebook/react-native/commit/d8b4737ca67591737e277cc43b7e352bd113dc7f) by [@NickGerleman](https://github.com/NickGerleman)) +- Blob data is no longer prematurely deallocated when using blob.slice ([36cc71ab36](https://github.com/facebook/react-native/commit/36cc71ab36aac5e5a78f2fbae44583d1df9c3cef) by [@awinograd](https://github.com/awinograd)) +- Unbreak cocoapods build ([419025df22](https://github.com/facebook/react-native/commit/419025df226dfad6a2be57c8d5515f103b96917b) by [@javache](https://github.com/javache)) +- Don't download hermes nightly tarball if it exists ([d2dd79f3c5](https://github.com/facebook/react-native/commit/d2dd79f3c5bd5684a10d40670e2351e4252020b3) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix nullability warnings ([346b028227](https://github.com/facebook/react-native/commit/346b02822710152292eca25a711e9eeca68ab941) by [@tido64](https://github.com/tido64)) +- Use NSCAssert() in react_native_assert instead of C assert() ([c5bc3f1373](https://github.com/facebook/react-native/commit/c5bc3f1373d223d4068f762c597bdc45261fb6c5) by [@NickGerleman](https://github.com/NickGerleman)) +- Honour background color customisation in RCTAppDelegate ([5d6f21d744](https://github.com/facebook/react-native/commit/5d6f21d744d3a910eb82489404f0fe5dd1020d98) by [@cipolleschi](https://github.com/cipolleschi)) +- Turn on NDEBUG when pods are installed for production. ([421df9ffd5](https://github.com/facebook/react-native/commit/421df9ffd58092b1a2dec455a048edb6db1739de) by [@cipolleschi](https://github.com/cipolleschi)) +- Fix a crash when reloading JS bundle ([60f381a8b9](https://github.com/facebook/react-native/commit/60f381a8b9094e7dfaf01bea1b745d576cc458f6) by [@sammy-SC](https://github.com/sammy-SC)) +- Fix missing node error message not printed correctly when deprecated `find-node-for-xcode.sh` is used. ([0d82b402aa](https://github.com/facebook/react-native/commit/0d82b402aa546aa773e91921989fb8389aee81dc) by [@uloco](https://github.com/uloco)) +- Build codegen package while using old architecture ([90327d9fba](https://github.com/facebook/react-native/commit/90327d9fba9417577a14f293103ec84dbba5300a) by [@Saadnajmi](https://github.com/Saadnajmi)) +- Fix cocoapods warning about merging user_target_xcconfig ([2bfb53c2fb](https://github.com/facebook/react-native/commit/2bfb53c2fba366d3476892f2384265aac212fbeb) by [@yhkaplan](https://github.com/yhkaplan)) +- `-[RCTUITextField textView:shouldChangeTextInRange:replacementString:]` no longer crashes when we pass in a `nil` replacement string ([d5e6d9cecd](https://github.com/facebook/react-native/commit/d5e6d9cecd1a8b02d47c4dfaffc550167b093b32) by [@Saadnajmi](https://github.com/Saadnajmi)) +- Remove UIKit import from RCTDevLoadingView.h ([e7dcad2ba1](https://github.com/facebook/react-native/commit/e7dcad2ba14d8188cce0ff976187fe045ee7f9a4) by [@christophpurrer](https://github.com/christophpurrer)) +- Pod install with --project-directory ([efd39eea6f](https://github.com/facebook/react-native/commit/efd39eea6f553638b2430cbf0c3eed519995a940) by [@dcangulo](https://github.com/dcangulo)) +- Fixed Mac Catalyst availability checks ([70d9b56d71](https://github.com/facebook/react-native/commit/70d9b56d717a13450d3e18ccb62bcfcb71cf4008) by [@Saadnajmi](https://github.com/Saadnajmi)) +- Fix path issue to properly run the codegen cleanup step ([e71b094b24](https://github.com/facebook/react-native/commit/e71b094b24ea5f135308b1e66c86216d9d693403) by [@cipolleschi](https://github.com/cipolleschi)) +- Make sure to add the New Arch flag to libraries ([ef11e15ca3](https://github.com/facebook/react-native/commit/ef11e15ca357be56afcf36969979442a235f7aa9) by [@cipolleschi](https://github.com/cipolleschi)) +- Fix dataContentType may be [NSNull null] issue ([c0834b884b](https://github.com/facebook/react-native/commit/c0834b884bcaf2fd97a47bcb0320369b0b4469d2) by [@malacca](https://github.com/malacca)) +- Properly support static libraries and static frameworks ([be895c870c](https://github.com/facebook/react-native/commit/be895c870c897705e65513574c459e85c38d5f7d)) +- Use the right logic to decide when we have to build from source ([67d02640ba](https://github.com/facebook/react-native/commit/67d02640ba2465e4533ac050cb5baa9b34f58f0b)) +- Fix application of _progressViewOffset in RCTRefreshControl to not occur by default (when value is unset) ([0062b10b56](https://github.com/facebook/react-native/commit/0062b10b56985c4556011fbbb8d43f0a038d359e) by [@objectivecosta](https://github.com/objectivecosta)) +- Unexpected useEffects flushing semantics ([7211ef1962](https://github.com/facebook/react-native/commit/7211ef19624304b6a4d5219a8e0a2c67651b8b33) by [@sammy-SC](https://github.com/sammy-SC)) +- Add support for building with Xcode 15 ([8ed2cfded5](https://github.com/facebook/react-native/commit/8ed2cfded51d47731686c1060915bee7dd63647e) by [@AlexanderEggers](https://github.com/AlexanderEggers)) + +### Security + +- Update and Fixed Prototype Pollution in JSON5 via Parse Method ([4ac4a5c27d](https://github.com/facebook/react-native/commit/4ac4a5c27dc5705a42ed7f607e2333d363c0a6c5) by [@imhunterand](https://github.com/imhunterand)) + +#### iOS specific + +- Enable Address and Undefined Behavior Sanitizers on RNTester ([65e61f3c88](https://github.com/facebook/react-native/commit/65e61f3c88388d4a2ed88bcc9a2cb5ba63fd8afa) by [@Saadnajmi](https://github.com/Saadnajmi)) + ## v0.71.11 ### Changed From 4715e043cc64f6b63f07912f0680d9197ce53cc2 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 12:22:03 -0700 Subject: [PATCH 315/468] translation auto-update for Apps/Wilde/scripts/intl-config.json on master Summary: Chronos Job Instance ID: 1125907904247194 Sandcastle Job Instance ID: 9007200230628689 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46908607 fbshipit-source-id: 6d4eea12412578ed2603adc622342894730397de --- .../strings/ar.lproj/fbt_language_pack.bin | Bin 1488 -> 1500 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/react-native/React/I18n/strings/ar.lproj/fbt_language_pack.bin b/packages/react-native/React/I18n/strings/ar.lproj/fbt_language_pack.bin index 0348a1d6c6c735a1760f263aac96b7fb4d2130f4..6809123690dcb5903d4881aab15f27cfdc5bd9cd 100644 GIT binary patch delta 418 zcmZY2F-t;G7{>AUTn#Ldg0hT+go>8HAcqEnh6X=?gAG9q!5#VtK_Vt14aRAxF}UDO z0?~?UYiMX_XlOVG9Qpu`4MCLsEs3B5KVI&6pZlDra64R0ZKnrB#ze$rjxdYNzh|6} zYCt4|S-d$SZQQ{_89Ag8Lr00+;{Yy}5j#AYTK9t@N62FbIjmt3afI;7121^Q4LtN7 z--U}TRg2?EInoyg1PEAkdKe}CNWC(WOc(!1xrY>@n&$K`usn6owzu4l7TNG!+93~ delta 388 zcmYk&ze>YE9KiA4r3%F=b`Wb&Xh6lW0XuZ?0URngI4HE>;^v^>;Lu4Tl;WV=Qo*rc zT9gtkh?|d)p~D^Y0UUe)g=+n#cJScCkKFGcxj`n*To;f0X^{mHsSvZobK?KA$VZS8 z*}@V&9FZ73G*LqtKGGN{a;RY+C9K@sE+5=YiPUk1LzGd%8nPHN{2hI~;Q>t~%TG|j zHj3~ti%%Br={c2C$9i4m-K+1>h*6S;y)-R*VLHjrv~*P!s{KjU<;J|)z}!>Q_6ULL zn9$a3!-V99le(Ftj)dvjh7EY8pTFtz$^DawJd)jUS0ujvQhBwjU1w7TddFE+p+0ps W+<4NHOL}@HV#UjNY-xZ1 From 46c15c39564466ae7e7d64423a5f358ce825e0b2 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 14:26:31 -0700 Subject: [PATCH 316/468] translation auto-update for i18n/anna.config.json on master Summary: Chronos Job Instance ID: 1125907903983344 Sandcastle Job Instance ID: 13510799859528763 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46913427 fbshipit-source-id: 52d607dfa15956261627d405e61e360798ea9a96 --- .../res/views/uimanager/values-pl/strings.xml | 18 ++++++++++++++++++ .../res/views/uimanager/values-ro/strings.xml | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml index 8e14e16ca00381..040ce847300b41 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pl/strings.xml @@ -3,8 +3,26 @@ + Obraz + Przycisk, obraz + Nagłówek + Pole kombi + Pasek menu + Pozycja menu + Pasek postępu + Grupa przycisków radiowych + Pasek przewijania + Przycisk kręcenia + Karta + Lista kart + Czasomierz + Pasek narzędzi + Podsumowanie zajęte rozwinięte zwinięte + nie wybrano + wł. + wył. mieszane diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml index 8339b5612596e9..0237a88fdb67db 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml @@ -3,8 +3,18 @@ + Imagine + Buton, imagine + Alertă + Meniu + Element din meniu + Bară de derulare + Bară de instrumente + Rezumat ocupat extins restrâns + neselectat + dezactivat mixt From 03b5bc29af2761e6bbb26b43e47116f390cf7d68 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 14:26:31 -0700 Subject: [PATCH 317/468] translation auto-update for i18n/messenger.config.json on master Summary: Chronos Job Instance ID: 1125907903983344 Sandcastle Job Instance ID: 13510799859528763 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46913426 fbshipit-source-id: 3d13f0838deec311dc800d189de2dc3453b81317 --- .../res/views/uimanager/values-hu/strings.xml | 21 +++++++++++++++++++ .../res/views/uimanager/values-tr/strings.xml | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml index 809c0582ec8fde..ea922b64737f02 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hu/strings.xml @@ -3,8 +3,29 @@ + Hivatkozás + Kép + Gomb, kép + Címsor + Figyelmeztetés + Kombinált lista + Menü + Menüsor + Menüelem + Folyamatjelző + Választógomb-csoport + Görgetősáv + Forgó gomb + Lapfül + Lapfülek listája + Időmérő + Eszköztár + Összegzés elfoglalt kibontva összecsukva + nincs kiválasztva + be + ki vegyes diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml index 8668849f5e6c8a..f8866dfe87d6f0 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-tr/strings.xml @@ -3,8 +3,29 @@ + Bağlantı + Görsel + Düğme, Görsel + Başlık + Uyarı + Karma Kutu + Menü + Menü Çubuğu + Menü Seçeneği + İlerleme Çubuğu + Radyo Grubu + Kaydırma Çubuğu + Döndürme Düğmesi + Sekme + Sekme Listesi + Zamanlayıcı + Araç Çubuğu + Özet meşgul genişletilmiş daraltılmış + seçili değil + açık + kapalı karışık From 8cd3b50ecccf031e5d9498f489631fc9f6eec28d Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 14:26:31 -0700 Subject: [PATCH 318/468] translation auto-update for i18n/adsmanager.config.json on master Summary: Chronos Job Instance ID: 1125907903983344 Sandcastle Job Instance ID: 13510799859528763 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46913417 fbshipit-source-id: 91a190711913cf9750cb430ee53a9e763d825929 --- .../res/views/uimanager/values-ar/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml index 9e9fb55c5013eb..09606420a91f48 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ar/strings.xml @@ -3,8 +3,29 @@ + رابط + صورة + زر، صورة + العنوان + تنبيه + مربع تحرير وسرد + القائمة + شريط القائمة + عنصر القائمة + شريط التقدم + مجموعة أزرار اختيار + شريط التمرير + زر زيادة ونقصان + علامة التبويب + قائمة علامات التبويب + مؤقِت + شريط الأدوات + ملخص مشغول موسع مطوي + غير محدَد + تشغيل + إيقاف تشغيل مختلط From 7920ae854eccb1827be479959fb67c57e52eb8ba Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 14:26:31 -0700 Subject: [PATCH 319/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907903983344 Sandcastle Job Instance ID: 13510799859528763 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46913433 fbshipit-source-id: 0ed0541a69babfbbe516bf15fa3050696cc1f963 --- .../src/main/res/views/uimanager/values-bg/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml index 8bbecbb0b4aeb9..0c9a74b4f26a40 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml @@ -7,13 +7,18 @@ Заглавие Сигнал Комбинирана кутия + Лента с менюта Лента за напредък Радио група + Лента за превъртане Бутон за завъртане Таймер + Лента с инструменти заето разширено свито + неизбрано + включено изключено смесено From a1b64b7f15c475415977d2f57afe55ca6c6e4881 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 21 Jun 2023 18:30:09 -0700 Subject: [PATCH 320/468] Introduce SampleLegacyModule example in RNTester (#38008) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38008 Introduce a legacy module (+ example) in RNTester. In the future, SampleLegacyModule will be used to: - Showcase the TurboModule interop layer in RNTester, once Bridgeless mode is ready - E2E Test the TurboModule interop layer. The TurboModule interop layer is just an extension to the TurboModule system that allows the system to create legacy modules. Unlike regular TurboModules, these legacy modules don't need codegen for JavaScript -> native method dispatch. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D46874160 fbshipit-source-id: f9810d0bdb3bd0c0a74099fcb6f74ca547977a53 --- .../ios/ReactCommon/RCTSampleLegacyModule.h | 16 ++ .../ios/ReactCommon/RCTSampleLegacyModule.mm | 225 ++++++++++++++++++ .../TurboModule/LegacyModuleExample.js | 29 +++ .../TurboModule/SampleLegacyModuleExample.js | 188 +++++++++++++++ .../rn-tester/js/utils/RNTesterList.ios.js | 4 + 5 files changed, 462 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.h create mode 100644 packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.mm create mode 100644 packages/rn-tester/js/examples/TurboModule/LegacyModuleExample.js create mode 100644 packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.h b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.h new file mode 100644 index 00000000000000..0f1e4ff55926e8 --- /dev/null +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.h @@ -0,0 +1,16 @@ +/* + * 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 + +#import +#import +#import +#import + +@interface RCTSampleLegacyModule : NSObject +@end diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.mm b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.mm new file mode 100644 index 00000000000000..b69fa307973cf8 --- /dev/null +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleLegacyModule.mm @@ -0,0 +1,225 @@ +/* + * 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 "RCTSampleLegacyModule.h" + +@implementation RCTSampleLegacyModule { + RCTBridge *_bridge; +} + +// Backward-compatible export +RCT_EXPORT_MODULE() + +// Backward-compatible queue configuration ++ (BOOL)requiresMainQueueSetup +{ + return YES; +} + +- (void)setBridge:(RCTBridge *)bridge +{ + _bridge = bridge; +} + +- (dispatch_queue_t)methodQueue +{ + return dispatch_get_main_queue(); +} + +// Backward compatible invalidation +- (void)invalidate +{ + // Actually do nothing here. + NSLog(@"Invalidating RCTSampleTurboModule..."); +} + +- (NSDictionary *)getConstants +{ + __block NSDictionary *constants; + RCTUnsafeExecuteOnMainQueueSync(^{ + UIScreen *mainScreen = UIScreen.mainScreen; + CGSize screenSize = mainScreen.bounds.size; + + constants = @{ + @"const1" : @YES, + @"const2" : @(screenSize.width), + @"const3" : @"something", + }; + }); + + return constants; +} + +// TODO: Remove once fully migrated to TurboModule. +- (NSDictionary *)constantsToExport +{ + return [self getConstants]; +} + +RCT_EXPORT_METHOD(voidFunc) +{ + // Nothing to do +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getBool : (BOOL)arg) +{ + return @(arg); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getEnum : (double)arg) +{ + return @(arg); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getNumber : (double)arg) +{ + return @(arg); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getFloat : (float)arg) +{ + return @(arg); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getInt : (int)arg) +{ + return @(arg); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getLongLong : (int64_t)arg) +{ + return @(arg); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getUnsignedLongLong : (uint64_t)arg) +{ + return @(arg); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getNSInteger : (NSInteger)arg) +{ + return @(arg); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getNSUInteger : (NSUInteger)arg) +{ + return @(arg); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSArray> *, getArray : (NSArray *)arg) +{ + return arg; +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSDictionary *, getObject : (NSDictionary *)arg) +{ + return arg; +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSString *, getString : (NSString *)arg) +{ + return arg; +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getNSNumber : (nonnull NSNumber *)arg) +{ + return arg; +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSDictionary *, getUnsafeObject : (NSDictionary *)arg) +{ + return arg; +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSNumber *, getRootTag : (double)arg) +{ + return @(arg); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSDictionary *, getValue : (double)x y : (NSString *)y z : (NSDictionary *)z) +{ + return @{ + @"x" : @(x), + @"y" : y ?: [NSNull null], + @"z" : z ?: [NSNull null], + }; +} + +RCT_EXPORT_METHOD(getValueWithCallback : (RCTResponseSenderBlock)callback) +{ + if (!callback) { + return; + } + callback(@[ @"value from callback!" ]); +} + +RCT_EXPORT_METHOD(getValueWithPromise + : (BOOL)error resolve + : (RCTPromiseResolveBlock)resolve reject + : (RCTPromiseRejectBlock)reject) +{ + if (!resolve || !reject) { + return; + } + + if (error) { + reject( + @"code_1", + @"intentional promise rejection", + [NSError errorWithDomain:@"RCTSampleTurboModule" code:1 userInfo:nil]); + } else { + resolve(@"result!"); + } +} + +RCT_EXPORT_METHOD(voidFuncThrows) +{ + NSException *myException = [NSException exceptionWithName:@"Excepption" + reason:@"Intentional exception from ObjC voidFuncThrows" + userInfo:nil]; + @throw myException; +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSDictionary *, getObjectThrows : (NSDictionary *)arg) +{ + NSException *myException = [NSException exceptionWithName:@"Excepption" + reason:@"Intentional exception from ObjC getObjectThrows" + userInfo:nil]; + @throw myException; +} + +RCT_EXPORT_METHOD(promiseThrows + : (BOOL)error resolve + : (RCTPromiseResolveBlock)resolve reject + : (RCTPromiseRejectBlock)reject) +{ + NSException *myException = [NSException exceptionWithName:@"Excepption" + reason:@"Intentional exception from ObjC promiseThrows" + userInfo:nil]; + @throw myException; +} + +RCT_EXPORT_METHOD(voidFuncAssert) +{ + RCTAssert(false, @"Intentional assert from ObjC voidFuncAssert"); +} + +RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(NSDictionary *, getObjectAssert : (NSDictionary *)arg) +{ + RCTAssert(false, @"Intentional assert from ObjC getObjectAssert"); + return arg; +} + +RCT_EXPORT_METHOD(promiseAssert + : (BOOL)error resolve + : (RCTPromiseResolveBlock)resolve reject + : (RCTPromiseRejectBlock)reject) +{ + RCTAssert(false, @"Intentional assert from ObjC promiseAssert"); +} + +@end diff --git a/packages/rn-tester/js/examples/TurboModule/LegacyModuleExample.js b/packages/rn-tester/js/examples/TurboModule/LegacyModuleExample.js new file mode 100644 index 00000000000000..65d269e4aa7014 --- /dev/null +++ b/packages/rn-tester/js/examples/TurboModule/LegacyModuleExample.js @@ -0,0 +1,29 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @flow + */ + +'use strict'; + +const React = require('react'); +const { + default: SampleLegacyModuleExample, +} = require('./SampleLegacyModuleExample'); + +exports.displayName = (undefined: ?string); +exports.title = 'Legacy Native Module'; +exports.category = 'Basic'; +exports.description = 'Usage of legacy Native Module'; +exports.examples = [ + { + title: 'SampleLegacyModule', + render: function (): React.Element { + return ; + }, + }, +]; diff --git a/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js b/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js new file mode 100644 index 00000000000000..8d08c79e88e683 --- /dev/null +++ b/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js @@ -0,0 +1,188 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @flow strict-local + */ + +import type {RootTag} from 'react-native/Libraries/ReactNative/RootTag'; + +import * as React from 'react'; +import { + FlatList, + NativeModules, + RootTagContext, + Text, + TouchableOpacity, + View, +} from 'react-native'; + +import styles from './TurboModuleExampleCommon'; + +type State = {| + testResults: { + [string]: { + type: string, + value: mixed, + ... + }, + ... + }, +|}; + +let triedLoadingModuleOnce = false; +let module = null; + +function getSampleLegacyModule() { + if (triedLoadingModuleOnce) { + return module; + } + triedLoadingModuleOnce = true; + try { + module = NativeModules.SampleLegacyModule; + } catch (ex) { + console.error('Failed to load SampleLegacyModule. Message: ' + ex.message); + } + return module; +} + +class SampleLegacyModuleExample extends React.Component<{||}, State> { + static contextType: React$Context = RootTagContext; + + state: State = { + testResults: {}, + }; + + // Add calls to methods in TurboModule here + // $FlowFixMe[missing-local-annot] + _tests = { + voidFunc: () => getSampleLegacyModule()?.voidFunc(), + getBool: () => getSampleLegacyModule()?.getBool(true), + getEnum: () => getSampleLegacyModule()?.getEnum(1.0), + getNumber: () => getSampleLegacyModule()?.getNumber(99.95), + getFloat: () => getSampleLegacyModule()?.getNumber(99.95), + getInt: () => getSampleLegacyModule()?.getInt(99), + getLongLong: () => getSampleLegacyModule()?.getLongLong(99), + getUnsignedLongLong: () => getSampleLegacyModule()?.getUnsignedLongLong(99), + getNSInteger: () => getSampleLegacyModule()?.getNSInteger(99), + getNSUInteger: () => getSampleLegacyModule()?.getNSUInteger(99), + getArray: () => + getSampleLegacyModule()?.getArray([ + {a: 1, b: 'foo'}, + {a: 2, b: 'bar'}, + null, + ]), + getObject: () => + getSampleLegacyModule()?.getObject({a: 1, b: 'foo', c: null}), + getString: () => getSampleLegacyModule()?.getString('Hello'), + getNullString: () => getSampleLegacyModule()?.getString(null), + getNSNumber: () => getSampleLegacyModule()?.getNSNumber(20.0), + getUnsafeObject: () => + getSampleLegacyModule()?.getObject({a: 1, b: 'foo', c: null}), + getRootTag: () => getSampleLegacyModule()?.getRootTag(this.context), + getValue: () => + getSampleLegacyModule()?.getValue(5, 'test', {a: 1, b: 'foo'}), + callback: () => + getSampleLegacyModule()?.getValueWithCallback(callbackValue => + this._setResult('callback', callbackValue), + ), + promise: () => + getSampleLegacyModule() + ?.getValueWithPromise(false) + .then(valuePromise => this._setResult('promise', valuePromise)), + rejectPromise: () => + getSampleLegacyModule() + ?.getValueWithPromise(true) + .then(() => {}) + .catch(e => this._setResult('rejectPromise', e.message)), + // voidFuncThrows: () => getSampleLegacyModule()?.voidFuncThrows(), + // getObjectThrows: () => getSampleLegacyModule()?.getObjectThrows({}), + // promiseThrows: () => getSampleLegacyModule()?.promiseThrows(true), + // voidFuncAssert: () => getSampleLegacyModule()?.voidFuncAssert(), + // getObjectAssert: () => getSampleLegacyModule()?.getObjectAssert({}), + // promiseAssert: () => getSampleLegacyModule()?.promiseAssert(true), + getConstants: () => getSampleLegacyModule()?.getConstants(), + getConst1: () => getSampleLegacyModule()?.const1, + getConst2: () => getSampleLegacyModule()?.const2, + getConst3: () => getSampleLegacyModule()?.const3, + }; + + _setResult(name: string, result: mixed) { + this.setState(({testResults}) => ({ + /* $FlowFixMe[cannot-spread-indexer] (>=0.122.0 site=react_native_fb) + * This comment suppresses an error found when Flow v0.122.0 was + * deployed. To see the error, delete this comment and run Flow. */ + testResults: { + ...testResults, + /* $FlowFixMe[invalid-computed-prop] (>=0.111.0 site=react_native_fb) + * This comment suppresses an error found when Flow v0.111 was + * deployed. To see the error, delete this comment and run Flow. */ + [name]: {value: result, type: typeof result}, + }, + })); + } + + _renderResult(name: string): React.Node { + const result = this.state.testResults[name] || {}; + return ( + + {JSON.stringify(result.value)} + {result.type} + + ); + } + + _getContent(): React.Node { + if (getSampleLegacyModule() == null) { + return null; + } + + return ( + <> + + + Object.keys(this._tests).forEach(item => { + try { + this._setResult(item, this._tests[item]()); + } catch (ex) { + this._setResult(item, 'Fail: ' + ex.message); + } + }) + }> + Run all tests + + this.setState({testResults: {}})} + style={[styles.column, styles.button]}> + Clear results + + + item} + renderItem={({item}) => ( + + this._setResult(item, this._tests[item]())}> + {item} + + {this._renderResult(item)} + + )} + /> + + ); + } + + render(): React.Node { + return {this._getContent()}; + } +} + +export default SampleLegacyModuleExample; diff --git a/packages/rn-tester/js/utils/RNTesterList.ios.js b/packages/rn-tester/js/utils/RNTesterList.ios.js index 019887eb9e08d4..63e31e4edd31ef 100644 --- a/packages/rn-tester/js/utils/RNTesterList.ios.js +++ b/packages/rn-tester/js/utils/RNTesterList.ios.js @@ -262,6 +262,10 @@ const APIs: Array = [ key: 'TurboModuleExample', module: require('../examples/TurboModule/TurboModuleExample'), }, + { + key: 'LegacyModuleExample', + module: require('../examples/TurboModule/LegacyModuleExample'), + }, { key: 'TurboCxxModuleExample', module: require('../examples/TurboModule/TurboCxxModuleExample'), From c018c7bda2a352e9ba38c354e00cbc9fd98841ee Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 21 Jun 2023 19:26:40 -0700 Subject: [PATCH 321/468] Move BridgelessReactPackage to com.facebook.react package (#38013) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38013 Move BridgelessReactPackage to com.facebook.react package. This is necessary because BridgelessReactPackage is a core package that needs to be part of RN (and should not be re-defined by all apps) I will revisit naming in a later diff changelog: [internal] internal Reviewed By: fkgozali Differential Revision: D46918732 fbshipit-source-id: c0d0dd0147a6e160189a8cfabc713c348f2499a2 --- .../react/BridgelessReactPackage.java | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java new file mode 100644 index 00000000000000..14d361b0499475 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/BridgelessReactPackage.java @@ -0,0 +1,118 @@ +/* + * 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.react; + +import com.facebook.infer.annotation.Nullsafe; +import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactApplicationContext; +import com.facebook.react.devsupport.LogBoxModule; +import com.facebook.react.devsupport.interfaces.DevSupportManager; +import com.facebook.react.module.annotations.ReactModule; +import com.facebook.react.module.annotations.ReactModuleList; +import com.facebook.react.module.model.ReactModuleInfo; +import com.facebook.react.module.model.ReactModuleInfoProvider; +import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; +import com.facebook.react.modules.core.DeviceEventManagerModule; +import com.facebook.react.modules.debug.DevSettingsModule; +import com.facebook.react.modules.debug.SourceCodeModule; +import com.facebook.react.modules.deviceinfo.DeviceInfoModule; +import com.facebook.react.modules.systeminfo.AndroidInfoModule; +import com.facebook.react.turbomodule.core.interfaces.TurboModule; +import java.util.HashMap; +import java.util.Map; + +@Nullsafe(Nullsafe.Mode.LOCAL) +@ReactModuleList( + nativeModules = { + AndroidInfoModule.class, + DeviceInfoModule.class, + DevSettingsModule.class, + SourceCodeModule.class, + LogBoxModule.class, + DeviceEventManagerModule.class, + }) +public class BridgelessReactPackage extends TurboReactPackage { + + private DevSupportManager mDevSupportManager; + private DefaultHardwareBackBtnHandler mHardwareBackBtnHandler; + + public BridgelessReactPackage( + DevSupportManager devSupportManager, DefaultHardwareBackBtnHandler hardwareBackBtnHandler) { + mDevSupportManager = devSupportManager; + mHardwareBackBtnHandler = hardwareBackBtnHandler; + } + + @Override + public NativeModule getModule(String name, ReactApplicationContext reactContext) { + switch (name) { + case AndroidInfoModule.NAME: + return new AndroidInfoModule(reactContext); + case DeviceInfoModule.NAME: + return new DeviceInfoModule(reactContext); + case SourceCodeModule.NAME: + return new SourceCodeModule(reactContext); + case DevSettingsModule.NAME: + return new DevSettingsModule(reactContext, mDevSupportManager); + case DeviceEventManagerModule.NAME: + return new DeviceEventManagerModule(reactContext, mHardwareBackBtnHandler); + case LogBoxModule.NAME: + return new LogBoxModule(reactContext, mDevSupportManager); + default: + throw new IllegalArgumentException( + "In BridgelessReactPackage, could not find Native module for " + name); + } + } + + @Override + public ReactModuleInfoProvider getReactModuleInfoProvider() { + try { + Class reactModuleInfoProviderClass = + Class.forName("com.facebook.react.CoreModulesPackage$$ReactModuleInfoProvider"); + return (ReactModuleInfoProvider) reactModuleInfoProviderClass.newInstance(); + } catch (ClassNotFoundException e) { + // In OSS case, the annotation processor does not run. We fall back on creating this byhand + Class[] moduleList = + new Class[] { + AndroidInfoModule.class, + DeviceInfoModule.class, + SourceCodeModule.class, + DevSettingsModule.class, + DeviceEventManagerModule.class, + LogBoxModule.class, + }; + final Map reactModuleInfoMap = new HashMap<>(); + for (Class moduleClass : moduleList) { + ReactModule reactModule = moduleClass.getAnnotation(ReactModule.class); + if (reactModule != null) { + reactModuleInfoMap.put( + reactModule.name(), + new ReactModuleInfo( + reactModule.name(), + moduleClass.getName(), + reactModule.canOverrideExistingModule(), + reactModule.needsEagerInit(), + reactModule.hasConstants(), + reactModule.isCxxModule(), + TurboModule.class.isAssignableFrom(moduleClass))); + } + } + return new ReactModuleInfoProvider() { + @Override + public Map getReactModuleInfos() { + return reactModuleInfoMap; + } + }; + } catch (InstantiationException e) { + throw new RuntimeException( + "No ReactModuleInfoProvider for CoreModulesPackage$$ReactModuleInfoProvider", e); + } catch (IllegalAccessException e) { + throw new RuntimeException( + "No ReactModuleInfoProvider for CoreModulesPackage$$ReactModuleInfoProvider", e); + } + } +} From 74e6c95572bc2fdfd32ebe53d0d997926ffcff4f Mon Sep 17 00:00:00 2001 From: David Vacca Date: Wed, 21 Jun 2023 19:26:40 -0700 Subject: [PATCH 322/468] Refactor integration of BridgelessReactPackage into ReactHost (#38010) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38010 This diff refactors the integration of ReactPackages into ReactHost and ReactHostDelegate. As part of this diff I'm also modifying ReactHostDelegate to depend on TurboModuleManagerDelegate.Builder instead of TurboModuleManagerDelegateBuilder. This is necessary to be able to create BridgelessReactPackage inside ReactInstance bypass-github-export-checks changelog: [internal] internal Reviewed By: luluwu2032 Differential Revision: D46410795 fbshipit-source-id: 221f0f5ce06b7c57410dc4d351d1a1eae29f2733 --- .../react/bridgeless/ReactHostDelegate.kt | 12 ++++------- .../react/bridgeless/ReactInstance.java | 20 ++++++++++++++++--- .../defaults/DefaultReactHostDelegate.kt | 11 +++------- .../react/bridgeless/ReactHostDelegateTest.kt | 8 ++++---- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHostDelegate.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHostDelegate.kt index 3d9ab63ad5afd5..1a409a98aab0dc 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHostDelegate.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactHostDelegate.kt @@ -9,12 +9,11 @@ package com.facebook.react.bridgeless import com.facebook.infer.annotation.ThreadSafe import com.facebook.react.ReactPackage +import com.facebook.react.ReactPackageTurboModuleManagerDelegate import com.facebook.react.bridge.JSBundleLoader -import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.common.annotations.UnstableReactNativeAPI import com.facebook.react.fabric.ReactNativeConfig import com.facebook.react.turbomodule.core.TurboModuleManager -import com.facebook.react.turbomodule.core.TurboModuleManagerDelegate /** * [ReactHostDelegate] is an interface that defines parameters required to initialize React Native. @@ -49,7 +48,7 @@ interface ReactHostDelegate { val jSBundleLoader: JSBundleLoader /** TODO: combine getTurboModuleManagerDelegate inside [ReactPackage] */ - fun getTurboModuleManagerDelegate(context: ReactApplicationContext): TurboModuleManagerDelegate + val turboModuleManagerDelegateBuilder: ReactPackageTurboModuleManagerDelegate.Builder /** * Callback that can be used by React Native host applications to react to exceptions thrown by @@ -68,17 +67,14 @@ interface ReactHostDelegate { override val jSMainModulePath: String, override val jSBundleLoader: JSBundleLoader, override val jSEngineInstance: JSEngineInstance, + override val turboModuleManagerDelegateBuilder: + ReactPackageTurboModuleManagerDelegate.Builder, override val reactPackages: List = emptyList(), override val bindingsInstaller: BindingsInstaller? = null, - private val turboModuleManagerDelegate: - (context: ReactApplicationContext) -> TurboModuleManagerDelegate, private val reactNativeConfig: ReactNativeConfig = ReactNativeConfig.DEFAULT_CONFIG, private val exceptionHandler: (error: Exception) -> Unit = {} ) : ReactHostDelegate { - override fun getTurboModuleManagerDelegate(context: ReactApplicationContext) = - turboModuleManagerDelegate(context) - override fun getReactNativeConfig(turboModuleManager: TurboModuleManager) = reactNativeConfig override fun handleInstanceException(error: Exception) = exceptionHandler(error) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java index 85dbe4abe0601f..7f5c3acf492a37 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java @@ -16,6 +16,7 @@ import com.facebook.infer.annotation.ThreadSafe; import com.facebook.jni.HybridData; import com.facebook.proguard.annotations.DoNotStrip; +import com.facebook.react.BridgelessReactPackage; import com.facebook.react.ReactPackage; import com.facebook.react.ViewManagerOnDemandReactPackage; import com.facebook.react.bridge.JSBundleLoader; @@ -78,6 +79,7 @@ final class ReactInstance { private final ReactHostDelegate mDelegate; private final BridgelessReactContext mBridgelessReactContext; + private final List mReactPackages; private final ReactQueueConfiguration mQueueConfiguration; private final TurboModuleManager mTurboModuleManager; @@ -186,8 +188,20 @@ public void onHostDestroy() { // Set up TurboModules Systrace.beginSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactInstance.initialize#initTurboModules"); + + mReactPackages = mDelegate.getReactPackages(); + mReactPackages.add( + new BridgelessReactPackage( + bridgelessReactContext.getDevSupportManager(), + bridgelessReactContext.getDefaultHardwareBackBtnHandler())); + TurboModuleManagerDelegate turboModuleManagerDelegate = - mDelegate.getTurboModuleManagerDelegate(mBridgelessReactContext); + mDelegate + .getTurboModuleManagerDelegateBuilder() + .setPackages(mReactPackages) + .setReactApplicationContext(mBridgelessReactContext) + .build(); + mTurboModuleManager = new TurboModuleManager( // Use unbuffered RuntimeExecutor to install binding @@ -442,7 +456,7 @@ public void registerSegment(int segmentId, String path) { private @Nullable ViewManager createViewManager(String viewManagerName) { if (mDelegate != null) { - List packages = mDelegate.getReactPackages(); + List packages = mReactPackages; if (packages != null) { synchronized (packages) { for (ReactPackage reactPackage : packages) { @@ -465,7 +479,7 @@ public void registerSegment(int segmentId, String path) { private @NonNull Collection getViewManagerNames() { Set uniqueNames = new HashSet<>(); if (mDelegate != null) { - List packages = mDelegate.getReactPackages(); + List packages = mReactPackages; if (packages != null) { synchronized (packages) { for (ReactPackage reactPackage : packages) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt index c56417f35f8b86..f789bdd03acdaa 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt @@ -9,8 +9,8 @@ package com.facebook.react.defaults import com.facebook.jni.annotations.DoNotStrip import com.facebook.react.ReactPackage +import com.facebook.react.ReactPackageTurboModuleManagerDelegate import com.facebook.react.bridge.JSBundleLoader -import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridgeless.BindingsInstaller import com.facebook.react.bridgeless.JSEngineInstance import com.facebook.react.bridgeless.ReactHostDelegate @@ -18,7 +18,6 @@ import com.facebook.react.bridgeless.hermes.HermesInstance import com.facebook.react.common.annotations.UnstableReactNativeAPI import com.facebook.react.fabric.ReactNativeConfig import com.facebook.react.turbomodule.core.TurboModuleManager -import com.facebook.react.turbomodule.core.TurboModuleManagerDelegate /** * A utility class that allows you to simplify the initialization of React Native by setting up a @@ -46,15 +45,11 @@ class DefaultReactHostDelegate( override val reactPackages: List = emptyList(), override val jSEngineInstance: JSEngineInstance = HermesInstance(), override val bindingsInstaller: BindingsInstaller = DefaultBindingsInstaller(), - private val turboModuleManagerDelegate: - (context: ReactApplicationContext) -> TurboModuleManagerDelegate, private val reactNativeConfig: ReactNativeConfig = ReactNativeConfig.DEFAULT_CONFIG, - private val exceptionHandler: (Exception) -> Unit = {} + private val exceptionHandler: (Exception) -> Unit = {}, + override val turboModuleManagerDelegateBuilder: ReactPackageTurboModuleManagerDelegate.Builder ) : ReactHostDelegate { - override fun getTurboModuleManagerDelegate(context: ReactApplicationContext) = - turboModuleManagerDelegate(context) - override fun getReactNativeConfig(turboModuleManager: TurboModuleManager) = reactNativeConfig override fun handleInstanceException(error: Exception) = exceptionHandler(error) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostDelegateTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostDelegateTest.kt index 4bc2ed9c6b2b5e..fc89a8fc46efe0 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostDelegateTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridgeless/ReactHostDelegateTest.kt @@ -7,11 +7,11 @@ package com.facebook.react.bridgeless +import com.facebook.react.ReactPackageTurboModuleManagerDelegate import com.facebook.react.bridge.JSBundleLoader import com.facebook.react.bridgeless.hermes.HermesInstance import com.facebook.react.common.annotations.UnstableReactNativeAPI import com.facebook.react.defaults.DefaultReactHostDelegate -import com.facebook.react.turbomodule.core.TurboModuleManagerDelegate import com.facebook.testutils.shadows.ShadowSoLoader import org.assertj.core.api.Assertions.assertThat import org.junit.Test @@ -32,8 +32,8 @@ class ReactHostDelegateTest { @Test fun testDefaultReactHostDelegateCreation() { val jsBundleLoader: JSBundleLoader = Mockito.mock(JSBundleLoader::class.java) - val turboModuleManagerDelegateMock: TurboModuleManagerDelegate = - Mockito.mock(TurboModuleManagerDelegate::class.java) + val turboModuleManagerDelegateBuilderMock: ReactPackageTurboModuleManagerDelegate.Builder = + Mockito.mock(ReactPackageTurboModuleManagerDelegate.Builder::class.java) val hermesInstance: JSEngineInstance = Mockito.mock(HermesInstance::class.java) val jsMainModulePathMocked = "mockedJSMainModulePath" val delegate = @@ -41,7 +41,7 @@ class ReactHostDelegateTest { jSMainModulePath = jsMainModulePathMocked, jSBundleLoader = jsBundleLoader, jSEngineInstance = hermesInstance, - turboModuleManagerDelegate = { turboModuleManagerDelegateMock }) + turboModuleManagerDelegateBuilder = turboModuleManagerDelegateBuilderMock) assertThat(delegate.jSMainModulePath).isEqualTo(jsMainModulePathMocked) } From 90186cd9b71bc6ffb593448c9bb5a3df66b3a0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanno=20J=2E=20G=C3=B6decke?= Date: Wed, 21 Jun 2023 19:57:19 -0700 Subject: [PATCH 323/468] Add workaround for android API 33 ANR when inverting ScrollView (#37913) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: As explained in this issue: - https://github.com/facebook/react-native/issues/35350 starting from android API 33 there are severe performance issues when using `scaleY: -1` on a view, and its child view, which is what we are doing when inverting the `ScrollView` component (e.g. in `FlatList`). This PR adds a workaround. The workaround is to also scale on the X-Axis which causes a different transform matrix to be created, that doesn't cause the ANR (see the issue for details). However, when doing that the vertical scroll bar will be on the wrong side, thus we switch the position in the native code once we detect that the list is inverted. The goal of this PR is that react-native users can just use `` without running into any ANRs or the need to apply manual hot fixes 😄 ## Changelog: [ANDROID] [FIXED] - ANR when having an inverted `FlatList` on android API 33+ Pull Request resolved: https://github.com/facebook/react-native/pull/37913 Test Plan: - The change is minimal, and only affects android. - Run the RNTesterApp for android and confirm that in the flatlist example the inverted list is still working as expected. Reviewed By: rozele Differential Revision: D46871197 Pulled By: NickGerleman fbshipit-source-id: 872a2ce5313f16998f0e4d2804d61e4d8dca7bfd --- .../views/scroll/ReactScrollViewManager.java | 18 ++++++++++++++++++ .../components/scrollview/ScrollViewProps.cpp | 15 +++++++++++++-- .../components/scrollview/ScrollViewProps.h | 1 + .../virtualized-lists/Lists/VirtualizedList.js | 11 ++++++++++- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java index 46e0ccf36c6e9d..34e21553d39343 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java @@ -379,4 +379,22 @@ public void setPointerEvents(ReactScrollView view, @Nullable String pointerEvent public void setScrollEventThrottle(ReactScrollView view, int scrollEventThrottle) { view.setScrollEventThrottle(scrollEventThrottle); } + + @ReactProp(name = "inverted") + public void setInverted(ReactScrollView view, boolean inverted) { + // Usually when inverting the scroll view we are using scaleY: -1 on the list + // and on the parent container. HOWEVER, starting from android API 33 there is + // a bug that can cause an ANR due to that. Thus we are using different transform + // commands to circumvent the ANR. This however causes the vertical scrollbar to + // be on the wrong side. Thus we are moving it to the other side, when the list + // is inverted. + // See also: + // - https://github.com/facebook/react-native/issues/35350 + // - https://issuetracker.google.com/issues/287304310 + if (inverted) { + view.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_LEFT); + } else { + view.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_DEFAULT); + } + } } diff --git a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp index fb70d8a6176cab..6222223a822e1b 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp @@ -319,7 +319,15 @@ ScrollViewProps::ScrollViewProps( rawProps, "scrollToOverflowEnabled", sourceProps.scrollToOverflowEnabled, - {})) {} + {})), + inverted( + CoreFeatures::enablePropIteratorSetter ? sourceProps.inverted + : convertRawProp( + context, + rawProps, + "inverted", + sourceProps.inverted, + {})) {} void ScrollViewProps::setProp( const PropsParserContext &context, @@ -368,6 +376,7 @@ void ScrollViewProps::setProp( RAW_SET_PROP_SWITCH_CASE_BASIC(snapToEnd); RAW_SET_PROP_SWITCH_CASE_BASIC(contentInsetAdjustmentBehavior); RAW_SET_PROP_SWITCH_CASE_BASIC(scrollToOverflowEnabled); + RAW_SET_PROP_SWITCH_CASE_BASIC(inverted); } } @@ -492,7 +501,9 @@ SharedDebugStringConvertibleList ScrollViewProps::getDebugProps() const { debugStringConvertibleItem( "snapToStart", snapToStart, defaultScrollViewProps.snapToStart), debugStringConvertibleItem( - "snapToEnd", snapToEnd, defaultScrollViewProps.snapToEnd)}; + "snapToEnd", snapToEnd, defaultScrollViewProps.snapToEnd), + debugStringConvertibleItem( + "inverted", inverted, defaultScrollViewProps.inverted)}; } #endif diff --git a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h index dea44da3af5d2b..a734c14d5687ed 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h +++ b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h @@ -68,6 +68,7 @@ class ScrollViewProps final : public ViewProps { ContentInsetAdjustmentBehavior contentInsetAdjustmentBehavior{ ContentInsetAdjustmentBehavior::Never}; bool scrollToOverflowEnabled{false}; + bool inverted{false}; #pragma mark - DebugStringConvertible diff --git a/packages/virtualized-lists/Lists/VirtualizedList.js b/packages/virtualized-lists/Lists/VirtualizedList.js index 0c078e085957c3..30f456d52b4df5 100644 --- a/packages/virtualized-lists/Lists/VirtualizedList.js +++ b/packages/virtualized-lists/Lists/VirtualizedList.js @@ -14,6 +14,7 @@ import type { LayoutEvent, ScrollEvent, } from 'react-native/Libraries/Types/CoreEventTypes'; +import Platform from 'react-native/Libraries/Utilities/Platform'; import type {ViewToken} from './ViewabilityHelper'; import type { Item, @@ -1969,7 +1970,15 @@ class VirtualizedList extends StateSafePureComponent { const styles = StyleSheet.create({ verticallyInverted: { - transform: [{scaleY: -1}], + transform: + // Android 13 Bug Workaround: + // On Android, we need to invert both axes to mitigate a native bug + // that could lead to ANRs. + // Simply using scaleY: -1 leads to the application of scaleY and + // rotationX natively, resulting in the ANR. + // For more information, refer to the following Android tracking issue: + // https://issuetracker.google.com/issues/287304310 + Platform.OS === 'android' ? [{scale: -1}] : [{scaleY: -1}], }, horizontallyInverted: { transform: [{scaleX: -1}], From d5e820c980e986a99d1c699b664a97004662282c Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 20:44:35 -0700 Subject: [PATCH 324/468] translation auto-update for i18n/barcelona.config.json on master Summary: Chronos Job Instance ID: 1125907904351530 Sandcastle Job Instance ID: 980317346 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46924711 fbshipit-source-id: c40725601f11f063db349c72470063c2615254d8 --- .../res/views/uimanager/values-af/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml index d3c5b193cf5cb8..82932ee371b283 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-af/strings.xml @@ -3,8 +3,29 @@ + Skakel + Prent + Knoppie, prent + Opskrif + Opletnota + Kombinasiekassie + Kieslys + Kieslysbalk + Kieslysitem + Vorderingbalk + Radiogroep + Rolleesbalk + Tolknoppie + Oortjie + Oortjielys + Afteller + Nutsbalk + Opsomming besig is uitgevou is ingevou + ontkies + aan + af is gemeng From 7f4a972ab18fcb38c5a6ad9b56b0b2ff520076cf Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 20:44:35 -0700 Subject: [PATCH 325/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907904351530 Sandcastle Job Instance ID: 980317346 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46924705 fbshipit-source-id: a50d017ac411fed113d63f77fbb33b23905d7dc9 --- .../src/main/res/views/uimanager/values-lt/strings.xml | 7 +++++++ .../src/main/res/views/uimanager/values-lv/strings.xml | 1 + 2 files changed, 8 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml index c3177bbf23299d..fccf449c4d836d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml @@ -3,4 +3,11 @@ + Mygtukas, vaizdas + Įspėjimas + Sudėtinis laukelis + Akučių grupė + Laikmatis + sutraukta + išjungta diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml index a66be9d1d970c9..7ae695b2a9faf3 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml @@ -3,4 +3,5 @@ + sakļauts From fba5b4db5903d081f270cfd045f55085aca5ea91 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 20:44:35 -0700 Subject: [PATCH 326/468] translation auto-update for i18n/anna.config.json on master Summary: Chronos Job Instance ID: 1125907904351530 Sandcastle Job Instance ID: 980317346 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46924714 fbshipit-source-id: ac7eeb3a05818ff48b17a2afea1b2b9aac5c0b10 --- .../res/views/uimanager/values-jv/strings.xml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-jv/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-jv/strings.xml index 5bc93b9a564110..27ff29b45b5fa8 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-jv/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-jv/strings.xml @@ -3,4 +3,24 @@ + Pranala + Judhul + Pengenget + Kothak Kombo + Wilah Menu + Item Menu + Wilah Progres + Grup Radio + Wilah Nggulung + Tombol Muter + Daftar Tab + Wilah Alat + Ringkesan + sibuk + dijembarake + diciutake + wurung dipilih + urip + mati + mix From 84d278d107f18ab7ddb094efe9787d928bc48137 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 20:44:35 -0700 Subject: [PATCH 327/468] translation auto-update for i18n/pages-manager.config.json on master Summary: Chronos Job Instance ID: 1125907904351530 Sandcastle Job Instance ID: 980317346 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46924707 fbshipit-source-id: 473fada8057f37698c3b31d385087057dc2d38ed --- .../src/main/res/views/uimanager/values-pt/strings.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml index 02fcc2c8e37523..66c8eebe8ccd1d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml @@ -3,6 +3,16 @@ + Link + Imagem + Botão, imagem + Caixa de combinação + Menu + Item do menu + Barra de progresso + Botão para girar + Aba + Temporizador ocupado expandido recolhido From 0e41ad09b0c7e1b7ac28dd2a8344df3bb6132879 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Wed, 21 Jun 2023 20:44:35 -0700 Subject: [PATCH 328/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907904351530 Sandcastle Job Instance ID: 980317346 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46924702 fbshipit-source-id: ad103cbe0f4c019c9b2cb9add8aac3137c53a253 --- .../main/res/views/uimanager/values-fa/strings.xml | 9 +++++++++ .../main/res/views/uimanager/values-in/strings.xml | 10 ++++++++++ .../main/res/views/uimanager/values-sr/strings.xml | 13 +++++++++++++ 3 files changed, 32 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml index 72270d97102a7c..429728fc5d1c48 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml @@ -3,4 +3,13 @@ + پیوند + تصویر + هشدار + جعبه گفتگو + برگه + فهرست برگه + خلاصه + بزرگ‌شده + خاموش diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml index 7e3350ce987f11..8f8adf4b0de088 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml @@ -3,8 +3,18 @@ + Gambar + Tombol, Gambar + Peringatan + Item Menu + Bilah Gulir + Pengatur Waktu + Bilah Fitur + Ringkasan sibuk diperluas diciutkan + batal dipilih + nonaktif campuran diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml index c068ba1b686f04..656eb026405d41 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml @@ -3,8 +3,21 @@ + Веза + Слика + Дугме, слика + Заглавље + Обавештење + Комбиновано поље + Трака са напретком + Група за радио + Картица + Листа картица + Тајмер + Резиме заузето проширено скупљено + искључено мешано From f544376f7c8d008e79a1ab5efdb0da81ab9f73ac Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 22 Jun 2023 01:34:56 -0700 Subject: [PATCH 329/468] Revert D46871197: Add workaround for android API 33 ANR when inverting ScrollView Differential Revision: D46871197 Original commit changeset: 872a2ce5313f Original Phabricator Diff: D46871197 fbshipit-source-id: d07e9e536d578f0612126bae07a83a02b5e6b792 --- .../views/scroll/ReactScrollViewManager.java | 18 ------------------ .../components/scrollview/ScrollViewProps.cpp | 15 ++------------- .../components/scrollview/ScrollViewProps.h | 1 - .../virtualized-lists/Lists/VirtualizedList.js | 11 +---------- 4 files changed, 3 insertions(+), 42 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java index 34e21553d39343..46e0ccf36c6e9d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java @@ -379,22 +379,4 @@ public void setPointerEvents(ReactScrollView view, @Nullable String pointerEvent public void setScrollEventThrottle(ReactScrollView view, int scrollEventThrottle) { view.setScrollEventThrottle(scrollEventThrottle); } - - @ReactProp(name = "inverted") - public void setInverted(ReactScrollView view, boolean inverted) { - // Usually when inverting the scroll view we are using scaleY: -1 on the list - // and on the parent container. HOWEVER, starting from android API 33 there is - // a bug that can cause an ANR due to that. Thus we are using different transform - // commands to circumvent the ANR. This however causes the vertical scrollbar to - // be on the wrong side. Thus we are moving it to the other side, when the list - // is inverted. - // See also: - // - https://github.com/facebook/react-native/issues/35350 - // - https://issuetracker.google.com/issues/287304310 - if (inverted) { - view.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_LEFT); - } else { - view.setVerticalScrollbarPosition(View.SCROLLBAR_POSITION_DEFAULT); - } - } } diff --git a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp index 6222223a822e1b..fb70d8a6176cab 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp @@ -319,15 +319,7 @@ ScrollViewProps::ScrollViewProps( rawProps, "scrollToOverflowEnabled", sourceProps.scrollToOverflowEnabled, - {})), - inverted( - CoreFeatures::enablePropIteratorSetter ? sourceProps.inverted - : convertRawProp( - context, - rawProps, - "inverted", - sourceProps.inverted, - {})) {} + {})) {} void ScrollViewProps::setProp( const PropsParserContext &context, @@ -376,7 +368,6 @@ void ScrollViewProps::setProp( RAW_SET_PROP_SWITCH_CASE_BASIC(snapToEnd); RAW_SET_PROP_SWITCH_CASE_BASIC(contentInsetAdjustmentBehavior); RAW_SET_PROP_SWITCH_CASE_BASIC(scrollToOverflowEnabled); - RAW_SET_PROP_SWITCH_CASE_BASIC(inverted); } } @@ -501,9 +492,7 @@ SharedDebugStringConvertibleList ScrollViewProps::getDebugProps() const { debugStringConvertibleItem( "snapToStart", snapToStart, defaultScrollViewProps.snapToStart), debugStringConvertibleItem( - "snapToEnd", snapToEnd, defaultScrollViewProps.snapToEnd), - debugStringConvertibleItem( - "inverted", inverted, defaultScrollViewProps.inverted)}; + "snapToEnd", snapToEnd, defaultScrollViewProps.snapToEnd)}; } #endif diff --git a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h index a734c14d5687ed..dea44da3af5d2b 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h +++ b/packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h @@ -68,7 +68,6 @@ class ScrollViewProps final : public ViewProps { ContentInsetAdjustmentBehavior contentInsetAdjustmentBehavior{ ContentInsetAdjustmentBehavior::Never}; bool scrollToOverflowEnabled{false}; - bool inverted{false}; #pragma mark - DebugStringConvertible diff --git a/packages/virtualized-lists/Lists/VirtualizedList.js b/packages/virtualized-lists/Lists/VirtualizedList.js index 30f456d52b4df5..0c078e085957c3 100644 --- a/packages/virtualized-lists/Lists/VirtualizedList.js +++ b/packages/virtualized-lists/Lists/VirtualizedList.js @@ -14,7 +14,6 @@ import type { LayoutEvent, ScrollEvent, } from 'react-native/Libraries/Types/CoreEventTypes'; -import Platform from 'react-native/Libraries/Utilities/Platform'; import type {ViewToken} from './ViewabilityHelper'; import type { Item, @@ -1970,15 +1969,7 @@ class VirtualizedList extends StateSafePureComponent { const styles = StyleSheet.create({ verticallyInverted: { - transform: - // Android 13 Bug Workaround: - // On Android, we need to invert both axes to mitigate a native bug - // that could lead to ANRs. - // Simply using scaleY: -1 leads to the application of scaleY and - // rotationX natively, resulting in the ANR. - // For more information, refer to the following Android tracking issue: - // https://issuetracker.google.com/issues/287304310 - Platform.OS === 'android' ? [{scale: -1}] : [{scaleY: -1}], + transform: [{scaleY: -1}], }, horizontallyInverted: { transform: [{scaleX: -1}], From cd56347dca4e948f5038643bcd804c41f037727a Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Thu, 22 Jun 2023 02:09:45 -0700 Subject: [PATCH 330/468] Prevent LogBox from crashing on long messages (#38005) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38005 Fixes https://github.com/facebook/react-native/issues/32093 by guarding the expensive `BABEL_CODE_FRAME_ERROR_FORMAT` regex with a cheaper initial scan. (Longer term, we should reduce our reliance on string parsing and propagate more structured errors.) Changelog: [General][Fixed] Prevent LogBox from crashing on very long messages Reviewed By: GijsWeterings Differential Revision: D46892454 fbshipit-source-id: 3afadcdd75969c2589bbb06f47d1c4c1c2690abd --- flow-typed/npm/ansi-regex_v5.x.x.js | 14 ++++ .../Libraries/LogBox/Data/parseLogBoxLog.js | 72 +++++++++++++------ packages/react-native/package.json | 1 + 3 files changed, 66 insertions(+), 21 deletions(-) create mode 100644 flow-typed/npm/ansi-regex_v5.x.x.js diff --git a/flow-typed/npm/ansi-regex_v5.x.x.js b/flow-typed/npm/ansi-regex_v5.x.x.js new file mode 100644 index 00000000000000..150902f4a12e6c --- /dev/null +++ b/flow-typed/npm/ansi-regex_v5.x.x.js @@ -0,0 +1,14 @@ +/** + * @flow strict + * @format + */ + +declare module 'ansi-regex' { + declare export type Options = { + /** + * Match only the first ANSI escape. + */ + +onlyFirst?: boolean, + }; + declare export default function ansiRegex(options?: Options): RegExp; +} diff --git a/packages/react-native/Libraries/LogBox/Data/parseLogBoxLog.js b/packages/react-native/Libraries/LogBox/Data/parseLogBoxLog.js index b41bade7fd0be5..744fa5e4e367ef 100644 --- a/packages/react-native/Libraries/LogBox/Data/parseLogBoxLog.js +++ b/packages/react-native/Libraries/LogBox/Data/parseLogBoxLog.js @@ -14,12 +14,38 @@ import type {LogBoxLogData} from './LogBoxLog'; import parseErrorStack from '../../Core/Devtools/parseErrorStack'; import UTFSequence from '../../UTFSequence'; import stringifySafe from '../../Utilities/stringifySafe'; +import ansiRegex from 'ansi-regex'; + +const ANSI_REGEX = ansiRegex().source; const BABEL_TRANSFORM_ERROR_FORMAT = /^(?:TransformError )?(?:SyntaxError: |ReferenceError: )(.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/; + +// https://github.com/babel/babel/blob/33dbb85e9e9fe36915273080ecc42aee62ed0ade/packages/babel-code-frame/src/index.ts#L183-L184 +const BABEL_CODE_FRAME_MARKER_PATTERN = new RegExp( + [ + // Beginning of a line (per 'm' flag) + '^', + // Optional ANSI escapes for colors + `(?:${ANSI_REGEX})*`, + // Marker + '>', + // Optional ANSI escapes for colors + `(?:${ANSI_REGEX})*`, + // Left padding for line number + ' +', + // Line number + '[0-9]+', + // Gutter + ' \\|', + ].join(''), + 'm', +); + const BABEL_CODE_FRAME_ERROR_FORMAT = // eslint-disable-next-line no-control-regex /^(?:TransformError )?(?:.*):? (?:.*?)(\/.*): ([\s\S]+?)\n([ >]{2}[\d\s]+ \|[\s\S]+|\u{001b}[\s\S]+)/u; + const METRO_ERROR_FORMAT = /^(?:InternalError Metro has encountered an error:) (.*): (.*) \((\d+):(\d+)\)\n\n([\s\S]+)/u; @@ -243,28 +269,32 @@ export function parseLogBoxException( }; } - const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT); + // Perform a cheap match first before trying to parse the full message, which + // can get expensive for arbitrary input. + if (BABEL_CODE_FRAME_MARKER_PATTERN.test(message)) { + const babelCodeFrameError = message.match(BABEL_CODE_FRAME_ERROR_FORMAT); - if (babelCodeFrameError) { - // Codeframe errors are thrown from any use of buildCodeFrameError. - const [fileName, content, codeFrame] = babelCodeFrameError.slice(1); - return { - level: 'syntax', - stack: [], - isComponentError: false, - componentStack: [], - codeFrame: { - fileName, - location: null, // We are not given the location. - content: codeFrame, - }, - message: { - content, - substitutions: [], - }, - category: `${fileName}-${1}-${1}`, - extraData: error.extraData, - }; + if (babelCodeFrameError) { + // Codeframe errors are thrown from any use of buildCodeFrameError. + const [fileName, content, codeFrame] = babelCodeFrameError.slice(1); + return { + level: 'syntax', + stack: [], + isComponentError: false, + componentStack: [], + codeFrame: { + fileName, + location: null, // We are not given the location. + content: codeFrame, + }, + message: { + content, + substitutions: [], + }, + category: `${fileName}-${1}-${1}`, + extraData: error.extraData, + }; + } } if (message.match(/^TransformError /)) { diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 67225d5695f41f..d7fb83ab397cbf 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -105,6 +105,7 @@ "@react-native/virtualized-lists": "^0.73.0", "abort-controller": "^3.0.0", "anser": "^1.4.9", + "ansi-regex": "^5.0.0", "base64-js": "^1.5.1", "deprecated-react-native-prop-types": "4.1.0", "event-target-shim": "^5.0.1", From 8ddb334bb08851ea7b5ed68246fcfd0bc36165c0 Mon Sep 17 00:00:00 2001 From: Abdennour JEBBAR Date: Thu, 22 Jun 2023 02:54:59 -0700 Subject: [PATCH 331/468] Convert BaseJavaModuleTest to Kotlin (#37822) Summary: As part of the effort to Kotlin-fy React Native tests, I've converted [BaseJavaModuleTest](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.java) to Kotlin. ## Changelog: [Internal] [Changed] - Convert BaseJavaModuleTest to Kotlin Pull Request resolved: https://github.com/facebook/react-native/pull/37822 Test Plan: Tests pass: ./gradlew :packages:react-native:ReactAndroid:test Formatted with [KtFmt](https://facebook.github.io/ktfmt/) Reviewed By: cortinico Differential Revision: D46639573 Pulled By: rshest fbshipit-source-id: d971d3a86ad05195885b8fbed8a165ab9efa9e78 --- .../react/bridge/BaseJavaModuleTest.java | 131 ------------------ .../react/bridge/BaseJavaModuleTest.kt | 99 +++++++++++++ 2 files changed, 99 insertions(+), 131 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.java create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.kt diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.java deleted file mode 100644 index 76a75bb3d67ea8..00000000000000 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.java +++ /dev/null @@ -1,131 +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.react.bridge; - -import static org.mockito.Mockito.when; - -import com.facebook.react.turbomodule.core.interfaces.TurboModule; -import com.facebook.testutils.shadows.ShadowSoLoader; -import java.util.List; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.robolectric.RobolectricTestRunner; -import org.robolectric.annotation.Config; - -/** Tests for {@link BaseJavaModule} and {@link JavaModuleWrapper} */ -@Config( - shadows = { - ShadowSoLoader.class, - }) -@RunWith(RobolectricTestRunner.class) -public class BaseJavaModuleTest { - private List mMethods; - private JavaModuleWrapper mModuleWrapper; - - private List mGeneratedMethods; - private JavaModuleWrapper mGeneratedModuleWrapper; - - private ReadableNativeArray mArguments; - - @Before - public void setup() { - ModuleHolder moduleHolder = new ModuleHolder(new MethodsModule()); - mModuleWrapper = new JavaModuleWrapper(null, moduleHolder); - mMethods = mModuleWrapper.getMethodDescriptors(); - - ModuleHolder generatedModuleHolder = new ModuleHolder(new GeneratedMethodsModule()); - mGeneratedModuleWrapper = new JavaModuleWrapper(null, generatedModuleHolder); - mGeneratedMethods = mGeneratedModuleWrapper.getMethodDescriptors(); - - mArguments = Mockito.mock(ReadableNativeArray.class); - } - - private int findMethod(String mname, List methods) { - int posn = -1; - for (int i = 0; i < methods.size(); i++) { - JavaModuleWrapper.MethodDescriptor md = methods.get(i); - if (md.name == mname) { - posn = i; - break; - } - } - return posn; - } - - @Test(expected = NativeArgumentsParseException.class) - public void testCallMethodWithoutEnoughArgs() throws Exception { - int methodId = findMethod("regularMethod", mMethods); - when(mArguments.size()).thenReturn(1); - mModuleWrapper.invoke(methodId, mArguments); - } - - @Test - public void testCallMethodWithEnoughArgs() { - int methodId = findMethod("regularMethod", mMethods); - when(mArguments.size()).thenReturn(2); - mModuleWrapper.invoke(methodId, mArguments); - } - - @Test - public void testCallAsyncMethodWithEnoughArgs() { - // Promise block evaluates to 2 args needing to be passed from JS - int methodId = findMethod("asyncMethod", mMethods); - when(mArguments.size()).thenReturn(3); - mModuleWrapper.invoke(methodId, mArguments); - } - - @Test - public void testCallSyncMethod() { - int methodId = findMethod("syncMethod", mMethods); - when(mArguments.size()).thenReturn(2); - mModuleWrapper.invoke(methodId, mArguments); - } - - @Test - public void testCallGeneratedMethod() { - int methodId = findMethod("generatedMethod", mGeneratedMethods); - when(mArguments.size()).thenReturn(2); - mGeneratedModuleWrapper.invoke(methodId, mArguments); - } - - private static class MethodsModule extends BaseJavaModule { - @Override - public String getName() { - return "Methods"; - } - - @ReactMethod - public void regularMethod(String a, int b) {} - - @ReactMethod - public void asyncMethod(int a, Promise p) {} - - @ReactMethod(isBlockingSynchronousMethod = true) - public int syncMethod(int a, int b) { - return a + b; - } - } - - private abstract class NativeTestGeneratedModuleSpec extends BaseJavaModule - implements TurboModule { - @ReactMethod - public abstract void generatedMethod(String a, int b); - } - - private class GeneratedMethodsModule extends NativeTestGeneratedModuleSpec { - @Override - public String getName() { - return "GeneratedMethods"; - } - - @Override - public void generatedMethod(String a, int b) {} - } -} diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.kt new file mode 100644 index 00000000000000..04299d15af0bc6 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.kt @@ -0,0 +1,99 @@ +/* + * 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.react.bridge + +import com.facebook.react.turbomodule.core.interfaces.TurboModule +import com.facebook.testutils.shadows.ShadowSoLoader +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.Mockito.mock +import org.mockito.Mockito.`when` as whenever +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config + +/** Tests for [BaseJavaModule] and [JavaModuleWrapper] */ +@Config(shadows = [ShadowSoLoader::class]) +@RunWith(RobolectricTestRunner::class) +class BaseJavaModuleTest { + private lateinit var methods: List + private lateinit var moduleWrapper: JavaModuleWrapper + private lateinit var generatedMethods: List + private lateinit var generatedModuleWrapper: JavaModuleWrapper + private lateinit var arguments: ReadableNativeArray + + @Before + fun setup() { + val moduleHolder = ModuleHolder(MethodsModule()) + moduleWrapper = JavaModuleWrapper(null, moduleHolder) + methods = moduleWrapper.methodDescriptors + val generatedModuleHolder = ModuleHolder(GeneratedMethodsModule()) + generatedModuleWrapper = JavaModuleWrapper(null, generatedModuleHolder) + generatedMethods = generatedModuleWrapper.methodDescriptors + arguments = mock(ReadableNativeArray::class.java) + } + + private fun findMethod(mname: String, methods: List): Int = + methods.indexOfFirst({ it.name === mname }) + + @Test(expected = NativeArgumentsParseException::class) + fun testCallMethodWithoutEnoughArgs() { + val methodId = findMethod("regularMethod", methods) + whenever(arguments.size()).thenReturn(1) + moduleWrapper.invoke(methodId, arguments) + } + + @Test + fun testCallMethodWithEnoughArgs() { + val methodId = findMethod("regularMethod", methods) + whenever(arguments.size()).thenReturn(2) + moduleWrapper.invoke(methodId, arguments) + } + + @Test + fun testCallAsyncMethodWithEnoughArgs() { + // Promise block evaluates to 2 args needing to be passed from JS + val methodId = findMethod("asyncMethod", methods) + whenever(arguments.size()).thenReturn(3) + moduleWrapper.invoke(methodId, arguments) + } + + @Test + fun testCallSyncMethod() { + val methodId = findMethod("syncMethod", methods) + whenever(arguments.size()).thenReturn(2) + moduleWrapper.invoke(methodId, arguments) + } + + @Test + fun testCallGeneratedMethod() { + val methodId = findMethod("generatedMethod", generatedMethods) + whenever(arguments.size()).thenReturn(2) + generatedModuleWrapper.invoke(methodId, arguments) + } + + private class MethodsModule : BaseJavaModule() { + override fun getName(): String = "Methods" + + @ReactMethod fun regularMethod(a: String?, b: Int?) {} + + @ReactMethod fun asyncMethod(a: Int, p: Promise) {} + + @ReactMethod(isBlockingSynchronousMethod = true) fun syncMethod(a: Int, b: Int): Int = a + b + } + + private abstract inner class NativeTestGeneratedModuleSpec : BaseJavaModule(), TurboModule { + @ReactMethod abstract fun generatedMethod(a: String?, b: Int?) + } + + private inner class GeneratedMethodsModule : NativeTestGeneratedModuleSpec() { + override fun getName(): String = "GeneratedMethods" + + override fun generatedMethod(a: String?, b: Int?) {} + } +} From 0daf9e19d1c04635681e467b7a31c91649c7f9b6 Mon Sep 17 00:00:00 2001 From: Lorenzo Sciandra Date: Thu, 22 Jun 2023 04:19:40 -0700 Subject: [PATCH 332/468] split the changelog into decades (#38017) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Well, looks like we've hit a GH limit 🤣 Screenshot 2023-06-22 at 10 32 19 This PR splits the changelog into (for lack of better term) decades: * lower than 0.60 (turns out we only started having proper changelogs in the mid 0.50-ish) * 60->69 * 70+ This also works well because anything lower than 0.70 is now in the unsupported range. ## Changelog: [Internal] [Changed] - split the changelog into decades Pull Request resolved: https://github.com/facebook/react-native/pull/38017 Test Plan: N/A Reviewed By: GijsWeterings Differential Revision: D46932308 Pulled By: cipolleschi fbshipit-source-id: f384d24cdf73c932b0b560919ac732bd993e93da --- CHANGELOG-pre-060.md | 2316 ++++++++++++++++++++ CHANGELOG-pre-070.md | 2436 ++++++++++++++++++++++ CHANGELOG.md | 4748 +----------------------------------------- 3 files changed, 4754 insertions(+), 4746 deletions(-) create mode 100644 CHANGELOG-pre-060.md create mode 100644 CHANGELOG-pre-070.md diff --git a/CHANGELOG-pre-060.md b/CHANGELOG-pre-060.md new file mode 100644 index 00000000000000..1a652307415582 --- /dev/null +++ b/CHANGELOG-pre-060.md @@ -0,0 +1,2316 @@ +# Changelog (pre 0.60) + +This file contains all changelogs for releases in the pre-0.60 range. Please check out the other `CHANGELOG-*.md` files for newer versions. + +## v0.59.10 + +This is likely the last patch release for version 59 of React Native for the foreseeable future: it contains an important Android side update for the JavaScript Core, to prevent a great number of crashes mostly related to Samsung devices - thanks to [@Kudo](https://github.com/Kudo) for his work on fixing this via [557989a86f](https://github.com/facebook/react-native/commit/557989a86f8730113393ed229927d607a478e524)! + +Thanks everyone who participated in the [discussion](https://github.com/react-native-community/releases/issues/127). + +## v0.59.9 + +This is a patch fix release addressing a couple ScrollView regressions, and "future-proof" RN 59 from crashes caused by upgrading Gradle (now can support up to 5.4.1 & 3.4.0 for the plugin) and Xcode 11 Beta 1. You can upgrade to this version without upgrading your tooling. + +Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/124) for cherry-picking commits. You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/127). + +### Changed + +- If `isInteraction` is not specified in the config, it would always default to `true` which would block interactions like VirtualizedList updates. This is generally not what you want with useNativeDriver since the animation won't be interrupted by JS. If something does end up interfering with an animation and causes frame drops, `isInteraction` can be set manually. ([8f186b84ae](https://github.com/facebook/react-native/commit/8f186b84aeeb2613bf6ae08f20a8547d40179007) by [@sahrens](https://github.com/sahrens)) + +- Update detox to match master ([c6a5c09e2b](https://github.com/facebook/react-native/commit/c6a5c09e2b330891242af5c0b3ed7875f32c189e) by [@kelset](https://github.com/kelset)) + +#### Android specific + +- Bump Gradle to 5.4.1 & Android Gradle plugin to 3.4.0 ([b4017a9923](https://github.com/facebook/react-native/commit/b4017a9923b09fed4b693a8e4cfadd30ce34c88d), [d9f5a9dc16](https://github.com/facebook/react-native/commit/d9f5a9dc16f68cecc995bf8ba64fb726e397fadf), [30348f7899](https://github.com/facebook/react-native/commit/30348f789946dc99f5ccd02c85c8decbdb9ac29b), [6976a93126](https://github.com/facebook/react-native/commit/6976a931266126f249458a099bfaf509f9d81a05) by [@dulmandakh](https://github.com/dulmandakh)) + +### Fixed + +- Fixes wrong time unit of scroll event throttle ([1148c03f6f](https://github.com/facebook/react-native/commit/1148c03f6f51329710e23fba99a6916fff3ba42c) by [@zhongwuzw](https://github.com/zhongwuzw)) + +#### Android specific + +- Fix indexed RAM bundle ([d8fa1206c3](https://github.com/facebook/react-native/commit/d8fa1206c3fecd494b0f6abb63c66488e6ced5e0) by [@dratwas](https://github.com/dratwas)) + +#### iOS specific + +- Fix Xcode 11 Beta 1 builds ([46c7ada535](https://github.com/facebook/react-native/commit/46c7ada535f8d87f325ccbd96c24993dd522165d) by [@ericlewis](https://github.com/ericlewis)) + +## v0.59.8 + +This is a patch fix release addressing regressions, crashes, and a few developer-experience pain points (in particular, check the `KeyboardAvoidingView` change). Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/118) for cherry-picking commits. + +### Fixed + +- Fix regexp on `hasteImpl` ([bcd1e2](https://github.com/facebook/react-native/commit/28e0de070d2dae9a486ab5915b6fd76723bd84ef) by [@CaptainNic](https://github.com/CaptainNic)) +- Fix sparse array handling in `EventEmitter#listeners()` ([f68dc8](https://github.com/facebook/react-native/commit/f68dc8) by [@ide](https://github.com/ide)) +- Fix **VirtualizedList** to call `_updateViewableItems` immediately ([08141e](https://github.com/facebook/react-native/commit/efe6a0f0b56191907e8f13be2aee28fe1dcdf555) by [@sahrens](https://github.com/sahrens)) +- Fix prop overrides of **TouchableWithoutFeedback** ([0c4206](https://github.com/facebook/react-native/commit/68825f9ca5a6c8c70390e8499d9663c5be475639) by [@aleclarson](https://github.com/aleclarson)) +- Fix resolve relative size rendering error in inspector ([4884ab](https://github.com/facebook/react-native/commit/972ee2edbd4e1c4201da1606bf5a4c5add9f0083) by [@gandreadis](https://github.com/gandreadis)) +- Fix **VirtualizedSectionList** by making sure to check array bounds ([54f91d](https://github.com/facebook/react-native/commit/929908f28728c217ab4a16c8596e0957295f4d67) by [@vonovak](https://github.com/vonovak)) +- Update `_scrollAnimatedValue` offset of **ScrollView** ([e0d1b3](https://github.com/facebook/react-native/commit/58c956768af75047b2acdca429a28945a6a8b8c0) by [@miyabi](https://github.com/miyabi)) +- Fix infinite `setState` in **VirtualizedList** ([c40a93](https://github.com/facebook/react-native/commit/88787b5e7a7f6dd9c3b258b9dfb60b93ca5a5cea) by [@sahrens](https://github.com/sahrens)) + +#### iOS specific + +- Fix incorrect opacity behavior for **Text** component ([f71357](https://github.com/facebook/react-native/commit/d99e657e3909ff14cd623d1df7d3d13056fdd851) by [@shergin](https://github.com/shergin)) +- Fix **Text** shadow displays when `text Offset` is `{0,0}` ([17a81b](https://github.com/facebook/react-native/commit/9b63b50ad562c8567336898c7511a9a5198a4d6b) by [@Woodpav](https://github.com/Woodpav)) +- Add convert compatible of **NSString** for bridge message data ([c37e9c](https://github.com/facebook/react-native/commit/ffa3b0d4d601fe6788319a7cfd4185b8e4bf462f) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix nullability warnings in **RCTExceptionsManager** ([2b7d79](https://github.com/facebook/react-native/commit/31850df116fdd1595dddcd7b37a21568e679ffa7) by [@jtreanor](https://github.com/jtreanor)) +- Fix app to reconnect with metro after the bundler is closed and reopened ([c28676](https://github.com/facebook/react-native/commit/62bac80f90cf5a4ab216488b4ede441f0e3f86ba) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Fix throttle below 16ms on **ScrollView** ([39776a](https://github.com/facebook/react-native/commit/c87de765f6a9ebf656c188fa2115a1ba01b7939c) by [@sahrens](https://github.com/sahrens)) + +#### Android specific + +- Fix JS errors during bundle load were reported as `UnknownCppException` ([84e263](https://github.com/facebook/react-native/commit/6f6696fa63dc5f7029cb121c7e0ee98f8d271602)) +- Add logic to catch `MissingWebViewPackageException` ([379874](https://github.com/facebook/react-native/commit/954f715b25d3c47c35b5a23ae23770a93bc58cee) by [@thorbenprimke](https://github.com/thorbenprimke)) +- Revert "[improve RTL](https://github.com/facebook/react-native/commit/b3c74967ca6b20d7bda84c690ae3a99dfe255843)" ([f3801d](https://github.com/facebook/react-native/commit/8d3e16831a93079fc5a855a7b0f8b4be508c6942) by [@thorbenprimke](https://github.com/thorbenprimke)) + +### Added + +- Add listener for non-value animated node ([4a82dc](https://github.com/facebook/react-native/commit/68a5ceef312c7e3ac74d616b960c1cfde46a109d) by [@osdnk](https://github.com/osdnk)) +- Set **ScrollView** throttle by default ([74d740](https://github.com/facebook/react-native/commit/b8c8562ffb424831cc34a18aeb25e5fec0954dd0) by [@sahrens](https://github.com/sahrens)) + +### Changed + +- Make **KeyboardAvoidingView** with `behavior="height"` resize on keyboard close ([7140a7](https://github.com/facebook/react-native/commit/3711ea69375ea420800bac97914aa0d24fc9b1a6) by [@WaldoJeffers](https://github.com/WaldoJeffers)) +- Update network inspector to have smarter scroll stickiness ([57dc37](https://github.com/facebook/react-native/commit/c06473ab464e07edbb4715f58cd13674273bb29b) by [@AlanFoster](https://github.com/AlanFoster)) + +## v0.59.7 + +This patch release was unpublished. + +## v0.59.6 + +This patch release was unpublished. + +## v0.59.5 + +This is a patch fix release addressing regressions, crashes, and a few developer-experience pain points. Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/113) for cherry-picking commits. + +### Fixed + +- Remove wrapper around **ListEmptyComponent** ([54af5b](https://github.com/facebook/react-native/commit/46276444508581bac7b9f27edd56ec0c8ec450bc) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) + +#### Android specific + +- Enforced thread safety on UIImplementation methods that mutate the shadowNodeRegistry ([f5a318](https://github.com/facebook/react-native/commit/f5a31801a03b61df3d7bc2fc86df7bad272082e2) by [@SudoPlz](https://github.com/sunnylqm)) +- Fixed a `NoSuchKeyException` when parsing JS stack frames without line numbers ([d7bd6c](https://github.com/facebook/react-native/commit/c953e0b4319da0976ece877c09b648a55bc57d9f) by [@Salakar](https://github.com/Salakar)) +- Fixed `mostRecentEventCount` is not updated ([b8aac0](https://github.com/facebook/react-native/commit/60c0a60c508346f7639d32fde0376fabded9f3f0) by [@jainkuniya](https://github.com/jainkuniya)) + +#### iOS specific + +- Pass back correct dimensions for application window in Dimensions module ([72b4cc](https://github.com/facebook/react-native/commit/33b55ccccad56e0b97af294749d728b67b03e658) by [@rdonnelly](https://github.com/rdonnelly)) +- Fixed warning: "RCTImagePickerManager requires main queue setup" ([effb02](https://github.com/facebook/react-native/commit/6508b88cfdccdb2da6bfde05faac4647436ce4e7) by [@scarlac](https://github.com/scarlac)) + +## v0.59.4 + +This is a patch fix release addressing regressions, crashes, and a few developer-experience pain points. Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/100) for cherry-picking commits. + +### Changed + +- Make Jest transform @react-native-community packages by default ([7e23c7c565](https://github.com/facebook/react-native/commit/7e23c7c5654818fa076eeb627b709d39130f57f6) by [@thymikee](https://github.com/thymikee)) + +#### iOS specific + +- Add `scrollToOverflowEnabled` prop to **ScrollView** ([6f4239b37c](https://github.com/facebook/react-native/commit/6f4239b37c3059d6cb1fdaf2dcd3b6c962dde471) by [@mysport12](https://github.com/mysport12)) + +### Fixed + +- Fix **Touchable** long-press ([59e50237bf](https://github.com/facebook/react-native/commit/59e50237bff9521d2b78d7576abf4e23d844ac1b) by [@Kida007](https://github.com/Kida007)) + +#### Android specific + +- Fix a crash when setting `underlineColorAndroid` in **TextInput** ([556aa93ed7](https://github.com/facebook/react-native/commit/556aa93ed72d9dc0f18a1c6d7dec3d9c182fee85) by [@sunnylqm](https://github.com/sunnylqm)) + +#### iOS specific + +- Fix universal links not working in iOS 12 / Xcode 10 ([56679ed359](https://github.com/facebook/react-native/commit/56679ed359834c2177c8837d744cc7bf2ceb6b0a) by [@IljaDaderko](https://github.com/IljaDaderko)) +- Fix triangle views ([7a6fe0cda0](https://github.com/facebook/react-native/commit/7a6fe0cda0a1089c1c82fdd5f7f2db940f70feae) by [@zhongwuzw](https://github.com/zhongwuzw)) + +## v0.59.3 + +This is a patch fix release addressing regressions, crashes, and a few developer-experience pain points. Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/100) for cherry-picking commits. + +### Changed + +#### Android specific + +- Improve RTL support ([b3c74967ca](https://github.com/facebook/react-native/commit/b3c74967ca6b20d7bda84c690ae3a99dfe255843) by [@dulmandakh](https://github.com/dulmandakh)) + +### Fixed + +- Fix **VirtualizedList**, **SectionList** and **FlatList** behavior on rendering list headers with inverted prop and zero items ([c13f5d48cf](https://github.com/facebook/react-native/commit/c13f5d48cfe3e7c0f6c6d0b745b50a089d6993ef) by [@michalchudziak](https://github.com/michalchudziak)) +- Fix **VirtualizedList** debug mode crash ([02e8e531dd](https://github.com/facebook/react-native/commit/02e8e531ddfd86e9abf7ef47fbf30445afeb37cf)) +- Fix running Metro on Windows ([43d3313788](https://github.com/facebook/react-native/commit/43d3313788a5f0a36abdbfadc000b06b2188fc06) and [9db347fabc](https://github.com/facebook/react-native/commit/9db347fabca19c66f669faf4054c81cc3624be03) by [@aliazizi](https://github.com/aliazizi) and [@nazreinkaram](https://github.com/nazreinkaram)) + +#### Android specific + +- Fix IllegalStateException when invalid URL or headers are passed ([aad4dbbbfe](https://github.com/facebook/react-native/commit/aad4dbbbfe937d1924e5359556979ab067198a58) by [@dryganets](https://github.com/dryganets)) +- Fix IllegalStateException when tapping next on Android Keyboard ([b943db418f](https://github.com/facebook/react-native/commit/b943db418f4f0b9d0865642aaca3e1a2f1529663) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific + +- Show Perf Monitor after reloading JS ([15619c22e5](https://github.com/facebook/react-native/commit/15619c22e57f73dfbed7bbe5fd6d9b3d2a8c9225) by [@usrbowe](https://github.com/usrbowe)) +- Fix **TextInput**'s `maxLength` when inserting characters at begin ([17415938c7](https://github.com/facebook/react-native/commit/17415938c7180a95811db949122b8ad24a442866) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix runtime crash in Xcode 10.2 when using `RCT_EXTERN_MODULE` for swift classes ([ff66600224](https://github.com/facebook/react-native/commit/ff66600224e78fec5d0e902f8a035b78ed31a961)) + +## v0.59.2 + +This is a patch fix release addressing regressions, crashes, and a few developer-experience pain points. Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/100) for cherry-picking commits. + +### Fixed + +#### Android specific + +- Crash on pre-26 Android devices when setting **TextInput** content type ([d4aa1e7a52](https://github.com/facebook/react-native/commit/d4aa1e7a52b51fa5d7fc9ded132b7b50170f2190) by [@hramos](https://github.com/hramos)) +- Crash when scroll to index 0 in a **SectionList** ([8fa116cc0e](https://github.com/facebook/react-native/commit/8fa116cc0e1cadbb6cf0734cfde0e0b8060f6b59) by [@danilobuerger](https://github.com/danilobuerger)) +- **Switch**'s `trackColor` being reset when toggled ([7652e31d8c](https://github.com/facebook/react-native/commit/7652e31d8c233c1c831f6597c8a2f7ce3d9c0b6e) and [d6ee448e15](https://github.com/facebook/react-native/commit/d6ee448e15a25a7485482a4702aadb2e396445c7) by [@dulmandakh](https://github.com/dulmandakh) and [@ejanzer](https://github.com/ejanzer)) + +#### iOS specific + +- **ScrollView** offset out of content size ([9c1c5a7455](https://github.com/facebook/react-native/commit/9c1c5a7455d90ec837a9a6141c096de70b798e43) by [@zhongwuzw](https://github.com/zhongwuzw)) +- **RefreshControl** state's race condition ([95d399bc82](https://github.com/facebook/react-native/commit/95d399bc825c5471e08b83eff4b1b1b510e384a0) by [@rostislav-simonik](https://github.com/rostislav-simonik)) +- Start Metro packager from project root ([fe3aebf87b](https://github.com/facebook/react-native/commit/fe3aebf87b4123f8b16cdfcb9e2e774e6e0bf0b6) by [@MatthieuLemoine](https://github.com/MatthieuLemoine)) +- **TextInput**s that are single-line reverting to default text ([e38be82dfa](https://github.com/facebook/react-native/commit/e38be82dfa8b49385b990629318f027de26500cf) by [@PeteTheHeat](https://github.com/PeteTheHeat)) + +### Changed + +#### Android specific + +- Add TLS 1.3 support to all Android versions using Conscrypt; to use this, you must add `implementation('org.conscrypt:conscrypt-android:2.0.0')` to `build.gradle` ([75af15ede4](https://github.com/facebook/react-native/commit/75af15ede44135110e40de75a649d5b15430c590) by [@dulmandakh](https://github.com/dulmandakh)) +- Turn off Metro JS Deltas by default for Android ([845189c17d](https://github.com/facebook/react-native/commit/845189c17de621cc5aa373503220c1c12f649c3c) by [@PeteTheHeat](https://github.com/PeteTheHeat)) + +## v0.59.1 + +This is a small patch release that addresses two critical issues from the 0.59.0 release. + +### Fixed + +#### Android specific + +- Template build gradle error on x86_64 ([4b996da470](https://github.com/facebook/react-native/commit/4b996da470b43f97fd0426b54bda739d7717fb28) by [@grabbou](https://github.com/grabbou)) + +#### iOS specific + +- Build error warning of **Text** module ([d834197746](https://github.com/facebook/react-native/commit/d834197746371b203bd7d7aaabdc2bc581acc867) by [@zhongwuzw](https://github.com/zhongwuzw)) + +## v0.59.0 + +Welcome to release 0.59 of React Native! For highlights of this release, please view the dedicated [blog post](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059). Thanks to those who gave feedback during the [release candidate phase](https://github.com/react-native-community/react-native-releases/issues/79). If you're interested in helping evaluate our next release (0.60), subscribe to the dedicated issue [here](https://github.com/react-native-community/react-native-releases/issues/99). + +### Added + +- Add a Metro configuration to the template with inline require/import options; read more about it [in the blog post](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059) ([ae11993d0f](https://github.com/facebook/react-native/commit/ae11993d0f6c6de661867b5d032d844e91c83c6f) by [@cpojer](https://github.com/cpojer)) + +#### Android specific + +- **Text** and **TextInput** now has prop [maxFontSizeMultiplier](https://reactnative.dev/docs/text#maxfontsizemultiplier) ([4936d284df](https://github.com/facebook/react-native/commit/4936d284df36071047ce776d9e2486c0371f7b97) by [@rigdern](https://github.com/rigdern)) +- **TextInput** now has prop [autoComplete](https://reactnative.dev/docs/textinput#autocomplete) prop ([f15145639d](https://github.com/facebook/react-native/commit/f15145639dab1e8d7a1c79a127b7d45c91d025a8)) +- **CameraRoll**'s `getPhotos` now supports `assetType: "All"` to let users pick from video and photos simultaneously ([54534e79d7](https://github.com/facebook/react-native/commit/54534e79d724ff57572efc43f65100067f35d4c1) by [@kesha-antonov](https://github.com/kesha-antonov)) +- **Text** and **TextInput** now support `textAlign:justify` for android O+ (api level >=26) ([d2153fc58d](https://github.com/facebook/react-native/commit/d2153fc58d825006076a3fce12e0f7eb84479132) by [sunnylqm](https://github.com/sunnylqm)) + +#### iOS specific + +- **TextInput** now has prop `rejectResponderTermination` to enable TextInputs inside Swipeables to function properly ([11df0eae5f](https://github.com/facebook/react-native/commit/11df0eae5ff8f530bfaf56aaf2209ff48f3ed9ac) by [@cmcewen](https://github.com/cmcewen)) +- **ActionSheetIOS** has a new prop `destructiveButtonIndexes` for an `Array` of destructive indexes ([67e7f16944](https://github.com/facebook/react-native/commit/67e7f16944530aa0d1a4d375b0de5efd5c432865) by [@sdg9](https://github.com/sdg9)) +- Add `isEventFromThisApp` to `KeyboardEvent` notifications to disambiguate keyboard events when apps are running side-by-side ([05f35c296d](https://github.com/facebook/react-native/commit/05f35c296d91d946acf4edd94106fbdd0dd69a29) by [@nossbigg](https://github.com/nossbigg)) +- Allow changing the project path in `react-native-xcode.sh` using env var `PROJECT_ROOT` ([9ccde378b6](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) by [@janicduplessis](https://github.com/janicduplessis)) + +### Changed + +- `React` is now at `v16.8.3` ([ccefc700d0](https://github.com/facebook/react-native/commit/ccefc700d0120539eba73747d1d6b65effb0645d) and ([2af13b4477](https://github.com/facebook/react-native/commit/2af13b4477342d3498ab302ceb5297fcbc17e097) by [@cpojer](https://github.com/cpojer) and [@hramos](https://github.com/hramos)) +- `Flow` dependency is now at `v0.92.0` ([5ee738659b](https://github.com/facebook/react-native/commit/5ee738659b4ac7b0e73b9dba09a63091d4571ed9) by [@pakoito](https://github.com/pakoito)) +- `@react-native-community/cli` dependency is at `v1.2.1` ([a252aee2ea](https://github.com/facebook/react-native/commit/a252aee2eabd9eeffb279b9fcf1827093ef4039c) and [5e1504b0fc](https://github.com/facebook/react-native/commit/5e1504b0fca99cad3bfe2339ac0e7862b2315f9c) by [@grabbou](https://github.com/grabbou)) +- Enhance Flow types definitions for **ViewPropTypes** ([7ff9456f2e](https://github.com/facebook/react-native/commit/7ff9456f2e5fd72286f5be52598988707eaef69c) by [@danibonilha](https://github.com/danibonilha)) + +#### Android specific + +- Clarify error message to direct people to `react-native start` rather than `react-native bundle` ([46aaa02274](https://github.com/facebook/react-native/commit/46aaa02274a51ebe2aaa9fca2422dcebf9323475) by [@sunnylqm](https://github.com/sunnylqm)) +- **BREAKING** - removed `OkHttpClientProvider.replaceOkHttpClient` method; please use `OkHttpClientProvider.setOkHttpClientFactory` from 0.54+ ([7cbdd7b6ac](https://github.com/facebook/react-native/commit/7cbdd7b6ac7db2192f7d0193d22326041517a63e) by [@cdlewis](https://github.com/cdlewis)) +- **BREAKING** - remove `ViewHelper`, use `ViewCompat` instead; this may also require changing the `android:theme` to be from `Theme.AppCompat`; read more about it [in the blog post](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059) ([c493cfe708](https://github.com/facebook/react-native/commit/c493cfe7083a6b97b6ec9eb9cb59cf1fdec45458) by [@dulmandakh](https://github.com/dulmandakh)) +- Add nullable annotations to `ReadableMap`, `WritableMap`, `ReadableArray`, `Writable`, `ReactPackage`, and native module interfaces; this may impact Kotlin usage ([b640b6faf7](https://github.com/facebook/react-native/commit/b640b6faf77f7af955e64bd03ae630ce2fb09627), [c93cbdf1b2](https://github.com/facebook/react-native/commit/c93cbdf1b272cfd60124d9ddb4c52b58ca59d319), [7b33d6b0b9](https://github.com/facebook/react-native/commit/7b33d6b0b96578a548e9a7f973eb59ac9236697b), and [84f40da990](https://github.com/facebook/react-native/commit/84f40da990dfd21eb1c21e20f2be0f8b2c5a78e4) by [@dulmandakh](https://github.com/dulmandakh)) +- `Soloader` is now at `v0.6.0` ([07d1075f37](https://github.com/facebook/react-native/commit/07d1075f372bb864ddc62b9c8f613b03becfa568) by [@dulmandakh](https://github.com/dulmandakh)) +- Android Support Library is now at `v28.0.0` ([5bbed43854](https://github.com/facebook/react-native/commit/5bbed43854957a37c4b51f49f30669665a72e7f7) by [@dulmandakh](https://github.com/dulmandakh)) +- `targetSdkVersion` is now at `v28` ([57f444bd8a](https://github.com/facebook/react-native/commit/57f444bd8a175038c367fa1b7d93e2e8ba9de7ed) by [@dulmandakh](https://github.com/dulmandakh)) +- Android Plugin is now at `v3.3.1` ([da5b5d2fa1](https://github.com/facebook/react-native/commit/da5b5d2fa134aa09dda4a620be9fa4d3d419201f) by [@dulmandakh](https://github.com/dulmandakh)) +- Enable Java 8 support ([38eb2a70af](https://github.com/facebook/react-native/commit/38eb2a70afa87c49c1e62754f5ae3cd26e7f59c3) by [@dulmandakh](https://github.com/dulmandakh)) +- Suppress misleading missing permission warnings ([d53dbb0dfb](https://github.com/facebook/react-native/commit/d53dbb0dfb99bdee5cd7eeaaa6f4ae51dcca00c5) by [@dulmandakh](https://github.com/dulmandakh)) +- Add back `buildToolsVersion` to build.gradle ([cf52ab561d](https://github.com/facebook/react-native/commit/cf52ab561d9fa0e4d14de7a8f3324cbc2b25bf92) by [@dulmandakh](https://github.com/dulmandakh)) +- **TimePickerAndroid** has better Flow types definitions ([2ed1bb2e01](https://github.com/facebook/react-native/commit/2ed1bb2e01ab7360d9bf13e4f9e13cb9c9c9d32e) by [@yushimatenjin](https://github.com/yushimatenjin)) +- `ReactActivity`, `ReactSlider`, `ReactTextView`, and `ReactPicker` extends `AppCompatActivity`; updates to `TimePickerDialogModule` and `DatePickerDialogModule` as well ([dda2b82a0a](https://github.com/facebook/react-native/commit/dda2b82a0a49da52b43b50db5a2bda50a216c09b), [3b9604feda](https://github.com/facebook/react-native/commit/3b9604feda8f9e8fe3dd884912ec7d9be67d7f1d), [ba0c3ffd5b](https://github.com/facebook/react-native/commit/ba0c3ffd5b46963a8bb27b40eb396965535cd927), [833429dd63](https://github.com/facebook/react-native/commit/833429dd633b33fff71224a7ce663b60681a7f81), [adc1410572](https://github.com/facebook/react-native/commit/adc14105727f708c990b7a744a0ea270ff0fba13), [c6c5a173bc](https://github.com/facebook/react-native/commit/c6c5a173bce3d8c847931d26eddb295956285438), and [be361d0fc1](https://github.com/facebook/react-native/commit/be361d0fc1930b1679c4226e15c1a5b416b94105) by [@dulmandakh](https://github.com/dulmandakh)) +- Fix lint error/warnings that cause older Android crashes ([d2fc19f4aa](https://github.com/facebook/react-native/commit/d2fc19f4aa94888b7c3d3f4a5fb621bf96a1aff9) by [@dulmandakh](https://github.com/dulmandakh)) +- The error message on getting Android drawable folder suffix now gives more information ([a159a33c02](https://github.com/facebook/react-native/commit/a159a33c02e0c0d7aa245adfd540a066ec065362) by [@BrunoVillanova](https://github.com/BrunoVillanova)) +- `SYSTEM_ALERT_WINDOW` permissions available only in debug builds ([84a2fb0a4a](https://github.com/facebook/react-native/commit/84a2fb0a4a67cd9dc37cf4e5bab814f25181cfb7) by [@dulmandakh](https://github.com/dulmandakh)) +- Add talkback navigation support for links and header ([b9d3743cda](https://github.com/facebook/react-native/commit/b9d3743cda95d1f475dbec8f6d72935941519deb) by [@yangweigbh](https://github.com/yangweigbh)) +- **FlatList** has `removeClippedSubviews` default to `true` on Android ([1a499f43b2](https://github.com/facebook/react-native/commit/1a499f43b2d03cc27dd6c25c8f13a767862afba1) by [@fred2028](https://github.com/fred2028)) + +#### iOS specific + +- Moved iOS build cache directory from `~/.rncache` to `~/Library/Caches/com.facebook.ReactNativeBuild` ([1024dc251e](https://github.com/facebook/react-native/commit/1024dc251e1f4777052b7c41807ea314672bb13a) by [@sryze](https://github.com/sryze)) +- Keyboard API Event flow types have been improved ([7ee13cc84c](https://github.com/facebook/react-native/commit/7ee13cc84c342244d3aa9e485de0e759482287ea) by [@nossbigg](https://github.com/nossbigg)) +- Expose **AsyncLocalStorage** get/set methods to native code ([7b8235a95a](https://github.com/facebook/react-native/commit/7b8235a95ad9519e9735cc1555a8d3aa5bb7c0ee) by [@ejmartin504](https://github.com/ejmartin504)) +- Clear RCTBridge **launchOptions** when bridge is reloaded ([19d04a312b](https://github.com/facebook/react-native/commit/19d04a312bf4221cd26beff6d0da6dd296a28cd0) by [@venik](https://github.com/venik)) + +### Deprecated + +The following deprecations are part of our Lean Core initiative; read more about it [in the blog post](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059). + +- Deprecated [MaskedViewIOS](https://reactnative.dev/docs/maskedviewios) as it has now been moved to [react-native-community/masked-view](https://github.com/react-native-community/react-native-masked-view) ([4ac65f5413](https://github.com/facebook/react-native/commit/4ac65f5413ee59f7546b88a2eae2c4ce6fa8826b) by [@FonDorn](https://github.com/FonDorn)) +- Deprecated [ViewPagerAndroid](https://reactnative.dev/docs/viewpagerandroid) as it has now been moved to [react-native-community/viewpager](https://github.com/react-native-community/react-native-viewpager) ([77300ca91c](https://github.com/facebook/react-native/commit/77300ca91c17d371f6ba04230b8c2e8f5cd99ab8) by [@ferrannp](https://github.com/ferrannp)) +- Deprecated [AsyncStorage](https://reactnative.dev/docs/asyncstorage) as it has now been moved to [react-native-community/asyncstorage](https://github.com/react-native-community/react-native-async-storage) ([ffe37487b2](https://github.com/facebook/react-native/commit/ffe37487b228b77a3697c32767e91f1dd68041d8) by [@Krizzu](https://github.com/Krizzu)) +- Deprecated [Slider](https://reactnative.dev/docs/slider) as it has now been moved to [react-native-community/slider](https://github.com/react-native-community/react-native-slider) ([bf888a7582](https://github.com/facebook/react-native/commit/bf888a7582763a593d8b36874d242653fc0a9575) by [@michalchudziak](https://github.com/michalchudziak)) +- Deprecated [NetInfo](https://reactnative.dev/docs/netinfo) as it has now been moved to [react-native-community/netinfo](https://github.com/react-native-community/react-native-netinfo) ([d9c0dfe353](https://github.com/facebook/react-native/commit/d9c0dfe353eceb91efcec774bab0f65b6792e4fa) by [@matt-oakes](https://github.com/matt-oakes)) +- Deprecated [ImageStore](https://reactnative.dev/docs/imagestore) and directed users to `expo-file-system` and `react-native-fs` ([62599fa8ff](https://github.com/facebook/react-native/commit/62599fa8ff7f308259fe178fa37b7bcf3c1a408c) by [@EvanBacon](https://github.com/EvanBacon)) + +#### iOS specific + +- Replace deprecated `stringByReplacingPercentEscapesUsingEncoding:` with `stringByAddingPercentEncodingWithAllowedCharacters:` ([61ca119650](https://github.com/facebook/react-native/commit/61ca11965046f75e7500e5152c5f2b60df2a2cd5) by [@pvinis](https://github.com/pvinis)) + +### Removed + +- `react-native-git-upgrade` is now officially dead; use `react-native upgrade` instead (which uses [rn-diff-purge](https://github.com/react-native-community/rn-diff-purge) under the covers) ([a6bdacb257](https://github.com/facebook/react-native/commit/a6bdacb2575dcc3be2acec95d8a6db6e2db909c4) by [@cpojer](https://github.com/cpojer)) + +#### iOS specific + +- Remove the previously deprecated **TabBarIOS** ([02697291ff](https://github.com/facebook/react-native/commit/02697291ff41ddfac5b85d886e9cafa0261c8b98) by [@axe-fb](https://github.com/axe-fb)) +- **AlertIOS** is now replaced with **Alert** ([e2bd7db732](https://github.com/facebook/react-native/commit/e2bd7db732602b2c477fe040f2946bd8293df297) by [@wellmonge](https://github.com/wellmonge)) + +### Fixed + +- **KeyboardAvoidingView** now shows the correct height after the keyboard is toggled ([745484c892](https://github.com/facebook/react-native/commit/745484c892e40cfe15ded128f5a589edb28d8f6b) by [@shauns](https://github.com/shauns)) +- Adds fixes for react-native-windows UWP ([dfcbf9729f](https://github.com/facebook/react-native/commit/dfcbf9729fab64c4bd8c00e1d092ec4e9bae717f) by [@rozele](https://github.com/rozele)) +- The `Map` and `Set` polyfills no longer reject non-extensible object keys; also fix hash collision scenario ([90850cace9](https://github.com/facebook/react-native/commit/90850cace9991ed0a02605586ea5c32ce099de65) by [@benjamn](https://github.com/benjamn)) +- Corrected StyleSheet's transformation perspective to match iOS's behavior, regardless of screen density ([4c10f9321c](https://github.com/facebook/react-native/commit/4c10f9321c9d01dbcac4808e7e6674cba12f3aa5) by [@syaau](https://github.com/syaau)) +- Fix `yarn test` in new projects ([5218932b13](https://github.com/facebook/react-native/commit/5218932b13ad0649ff2a57aaf1ec682fe278c47d) by [@Esemesek](https://github.com/Esemesek)) +- Fix issue with `getInspectorDataForViewTag` that caused red screen when toggling inspector ([46f3285a3f](https://github.com/facebook/react-native/commit/46f3285a3f240f9325a548e677a1927402d76bd7) by [@TranLuongTuanAnh](https://github.com/TranLuongTuanAnh)) +- Fix `displayName` for `Image`; this will make tests no longer mistake it as `Component` ([4989123f8c](https://github.com/facebook/react-native/commit/4989123f8cab37c95b020e23b9a925746a3f3677) by [@linnett](https://github.com/linnett)) +- Fix regression of **VirtualizedList** jumpy header ([e4fd9babe0](https://github.com/facebook/react-native/commit/e4fd9babe03d82fcf39ba6a46376f746a8a3e960) by [@danilobuerger](https://github.com/danilobuerger)) +- Set `wait_for_recheck=true` to work around crash in Flow ([ffc9908bef](https://github.com/facebook/react-native/commit/ffc9908bef535ba1392c370ca4e9e4e528c3c4c5) by [@gabelevi](https://github.com/gabelevi)) +- Fix flow typing of **Text** ([10c8352141](https://github.com/facebook/react-native/commit/10c835214160cc5a5726c8dd9f0d42a0275d198b) by [@sahrens](https://github.com/sahrens)) +- Fix `jest` and `jest-junit` to be only development dependencies ([c7b57f1986](https://github.com/facebook/react-native/commit/c7b57f19869f31474c8ee17f7a1ac1551bab1b6e) by [@vovkasm](https://github.com/vovkasm)) +- Fix layout issue with **SwipeableQuickActionButton** ([ad52f52624](https://github.com/facebook/react-native/commit/ad52f526247af6eebadd2ea436b86ff7eb874f27) by [@varungupta85](https://github.com/varungupta85)) + +#### Android specific + +- Fix textTransform when used with other text styles on Android (#22670) ([3a33e75183](https://github.com/facebook/react-native/commit/3a33e75183bf196d61b46e662b4c3f84a5f570bd) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix warnings related to updating to gradle 4.10.1 or higher ([5be50d4820](https://github.com/facebook/react-native/commit/5be50d482082917351b46ee2e339e56e7e34e111) by [@misaku](https://github.com/misaku)) +- Fix issue with use of Android API 28 by adding security config for metro access ([5747094532](https://github.com/facebook/react-native/commit/5747094532bace3fe6b1ebdf55235e53189baa71), [19492b730b](https://github.com/facebook/react-native/commit/19492b730b6779486f83d5ddbaeeb870cb3d5e9c), [3b0b7ce8c3](https://github.com/facebook/react-native/commit/3b0b7ce8c3c3679610c14ca72beb1a9dcf84d930), and [84572c4051](https://github.com/facebook/react-native/commit/84572c4051f11f68ddf0928d2c3df5850ae15491) by [@Salakar](https://github.com/Salakar) and [@dulmandakh](https://github.com/dulmandakh)) +- Fix Inverted Horizontal **ScrollView** ([32cb9ec49c](https://github.com/facebook/react-native/commit/32cb9ec49c801fcebe61486149134ab542d9364b) by [@dmainas](https://github.com/dmainas)) +- Fix crash on **CheckBox** on older Android versions ([58437cd10a](https://github.com/facebook/react-native/commit/58437cd10a667bbcbc16781df855fd7c3d73bf49) by [@vonovak](https://github.com/vonovak)) +- Fix undefined error description in **Image** `onError` callback ([7795a672d3](https://github.com/facebook/react-native/commit/7795a672d3a24a5b50df6ad6d30555d856b557cc) by [@Jyrno42](https://github.com/Jyrno42)) +- Fix Android crash on animating with `useNativeDriver` ([e405e84fc3](https://github.com/facebook/react-native/commit/e405e84fc35923888442df748757787698040010) by [@scisci](https://github.com/scisci)) +- Fix dev settings menu not appearing for certain codebases due to namespace conflicts ([9968d0c203](https://github.com/facebook/react-native/commit/9968d0c2030c1065979db34cc9a244bd52b7b2a5) by [@khaled-cliqz](https://github.com/khaled-cliqz)) +- Fix exception occurring while fading a **TextView** ([f83281e2ce](https://github.com/facebook/react-native/commit/f83281e2ce2aece44b1207844d8a5149d5d2e78d) by [@mdvacca](https://github.com/mdvacca)) +- Fix **StatusBar** overwriting previously set `SystemUiVisibility` flags ([8afa0378cd](https://github.com/facebook/react-native/commit/8afa0378cd09b8fa6c30d759539fc9a680e8cae2) by [@rogerkerse](https://github.com/rogerkerse)) +- Prevent `fetch()` POST requests from appending `charset=utf-8` to `Content-Type` header ([4a807761a4](https://github.com/facebook/react-native/commit/4a807761a4aca9e551ff2cee8ca18a2450fb11ca) and [0d5aebbd9a](https://github.com/facebook/react-native/commit/0d5aebbd9ac92a90ec7ab1426ed92dd22ae8c736) by [@nhunzaker](https://github.com/nhunzaker)) +- Fix issue with **Location** that led to exceptions in two cases ([f32dc63546](https://github.com/facebook/react-native/commit/f32dc635467a2e93371f0cf2e40b07a712349288) by [@mikelambert](https://github.com/mikelambert)) + +#### iOS specific + +- Fix **TextInput** mistakenly capitalizing I's after emojiis ([f307ac7c5e](https://github.com/facebook/react-native/commit/f307ac7c5e3adb9b4c0f8b2e4b8cdc2f980c7733) by [@dchersey](https://github.com/dchersey)) +- Fix **TextView**'s `setAttributedText` for CJK languages on single-line text fields ([e38be82dfa](https://github.com/facebook/react-native/commit/e38be82dfa8b49385b990629318f027de26500cf) by [@mandrigin](https://github.com/mandrigin)) +- Fix RCTImageLoader multi thread crash ([5ed31ce524](https://github.com/facebook/react-native/commit/5ed31ce5240a7392afdc522120edef182e0014ed)) +- Fix removing keys of large values from **AsyncStorage** ([27b4d21564](https://github.com/facebook/react-native/commit/27b4d215641f9397ef415cbb2acfc1275e6110ac) by [@esprehn](https://github.com/esprehn)) +- Fix overscroll behavior on virtualized lists; behavior is now consistent ([4d5f85ed42](https://github.com/facebook/react-native/commit/4d5f85ed426cfb43dc5e63f915e416a47d76b965)) +- Fix **Alert** to not block input focus and blur ([e4364faa3c](https://github.com/facebook/react-native/commit/e4364faa3cab150b82272819fc92086fb4da297e) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix broken JSIexecutor search path ([2aa2401766](https://github.com/facebook/react-native/commit/2aa24017667721ba17a859ca4e13d43e52d86bc5) by [@amccarri](https://github.com/amccarri)) +- Fix potential linker issues when using Xcode project ([9f72e6a5d0](https://github.com/facebook/react-native/commit/9f72e6a5d02d84fe8ed545e0c0904199b9cb3c7a) by [@tyrone-sudeium](https://github.com/tyrone-sudeium)) +- Fix crash when `scrollEnabled` used in singleline textinput ([9ff43abe65](https://github.com/facebook/react-native/commit/9ff43abe653ac5af0e591b369228f0809caad204) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix crash in gif image usage ([d0cd3cae13](https://github.com/facebook/react-native/commit/d0cd3cae13a1b1fff8a2e378b5228d3cdccd695f) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix **geolocation** to not constantly reset accuracy to default of 100 meters ([bbcb97a29a](https://github.com/facebook/react-native/commit/bbcb97a29adc2a3a05728b47d28e28fa78d84df2) by [@omnikron](https://github.com/omnikron)) +- Fix iOS build issue related to missing `DoubleConversion` and `glog` to `cxxreact`, `jsi` and `jsiexecutor` subspecs in `React.podspec` file ([00392ac46b](https://github.com/facebook/react-native/commit/00392ac46b6319dcff2b6df2e5f7bb4ee094612f) by [@alexruperez](https://github.com/alexruperez)) +- Fix "'folly/folly-config.h' file not found" build error when using React via CocoaPods ([5560a47c1d](https://github.com/facebook/react-native/commit/5560a47c1dbc7daab1e4f4aac0667080fdea836a) by [@Salakar](https://github.com/Salakar)) +- Fix image cache to follow [MDN strategy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Freshness) ([fb8ba3fe95](https://github.com/facebook/react-native/commit/fb8ba3fe959fd2a0c4ef0025fd84f6deffd9d03b) and [fb8ba3fe95](https://github.com/facebook/react-native/commit/fb8ba3fe959fd2a0c4ef0025fd84f6deffd9d03b) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix crash due to IllegalArgumentException when creating CookieManage ([cda8171af3](https://github.com/facebook/react-native/commit/cda8171af30815edfa331e07d1bbf605f0926303) by [@mdvacca](https://github.com/mdvacca)) +- Fix cursor placement after toggling `secureTextEntry` cursor spacing ([8ce3c1b43e](https://github.com/facebook/react-native/commit/8ce3c1b43edd47191c8e5ee8432c58f6e93dfca7) by [@ericlewis](https://github.com/facebook/react-native/commits?author=ericlewis)) + +## v0.58.6 + +This release is fairly small, as we approach stable status for [0.59](https://github.com/react-native-community/react-native-releases/issues/79). + +Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/95) for cherry-picking commits - you can participate in the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/97). + +### Fixed + +#### Android specific + +- Fix Inverted Horizontal ScrollView on Android (#23233) ([32cb9ec49c](https://github.com/facebook/react-native/commit/32cb9ec49c801fcebe61486149134ab542d9364b) by [@dmainas](https://github.com/dmainas)) + +#### iOS specific + +- Map TextInput textContentType strings to Objective-C constants (#22611) ([a89fe4165c](https://github.com/facebook/react-native/commit/a89fe4165c2a331a9d88636d89a5a48151ab8660) by [@levibuzolic](https://github.com/levibuzolic)) +- Don't reconnect inspector if connection refused (#22625) ([d9489c4e9c](https://github.com/facebook/react-native/commit/d9489c4e9c646b79025f07635b840e9974be8cd5) by [@msand](https://github.com/msand)) + +## v0.58.5 + +This release resolves a few bugs and includes a few improvements, listed below. + +Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/86) for cherry-picking commits - you can participate in the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/95). + +### Removed + +- Remove fallback cache ([9d60c20cb3](https://github.com/facebook/react-native/commit/9d60c20cb35074e92a90b803d3d6f420f6671635) by [@grabbou](https://github.com/grabbou)) + +### Fixed + +- Fixes capitalized I's when emojis are present after the text being edited. (#21951) ([f307ac7c5e](https://github.com/facebook/react-native/commit/f307ac7c5e3adb9b4c0f8b2e4b8cdc2f980c7733) by [@dchersey](https://github.com/dchersey)) +- Fix broken jsiexecutor search path. (#23274) ([2aa2401766](https://github.com/facebook/react-native/commit/2aa24017667721ba17a859ca4e13d43e52d86bc5) by [@amccarri](https://github.com/amccarri)) +- Fix duplicate symbols linker error in xcodeproj (#23284) ([9f72e6a5d0](https://github.com/facebook/react-native/commit/9f72e6a5d02d84fe8ed545e0c0904199b9cb3c7a) by [@tyrone-sudeium](https://github.com/tyrone-sudeium)) +- apply Network Security Config file (fixes #22375) (part 2 of #23105) (#23135) ([84572c4051](https://github.com/facebook/react-native/commit/84572c4051f11f68ddf0928d2c3df5850ae15491) by [@Salakar](https://github.com/Salakar)) +- Fix crash for web socket in some race conditions (#22439) ([dd209bb789](https://github.com/facebook/react-native/commit/dd209bb7891ed5f05b96a9922c7b0e39bf3ac9e9) by [@zhongwuzw](https://github.com/zhongwuzw)) + +#### iOS specific + +- Don't attempt to load RCTDevLoadingView lazily ([a9dd828c68](https://github.com/facebook/react-native/commit/a9dd828c68338dbf0e55ffa1838bf8ff574f317d) by [@fkgozali](https://github.com/fkgozali)) + +### Security + +#### Android specific + +- improve Android Network Security config (#23429) ([5747094532](https://github.com/facebook/react-native/commit/5747094532bace3fe6b1ebdf55235e53189baa71) by [@dulmandakh](https://github.com/dulmandakh)) + +## v0.58.4 + +This release resolves a few bugs and includes a few improvements, listed below. + +Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/81) for cherry-picking commits - you can participate in the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/86). + +### Added + +#### Android specific + +- Add error description to Image onError callback ([7795a672d3](https://github.com/facebook/react-native/commit/7795a672d3a24a5b50df6ad6d30555d856b557cc) by [@Jyrno42](https://github.com/Jyrno42)) + +### Changed + +#### Android specific + +- bump soloader to `0.6.0` ([07d1075f37](https://github.com/facebook/react-native/commit/07d1075f372bb864ddc62b9c8f613b03becfa568) by [@dulmandakh](https://github.com/dulmandakh)) + +### Removed + +- Remove jest and jest-junit from runtime dependencies (#23276) ([c7b57f1986](https://github.com/facebook/react-native/commit/c7b57f19869f31474c8ee17f7a1ac1551bab1b6e) by [@vovkasm](https://github.com/vovkasm)) + +### Fixed + +#### Android specific + +- Fixes Android crash on animated style with string rotation ([e405e84fc3](https://github.com/facebook/react-native/commit/e405e84fc35923888442df748757787698040010) by [@scisci](https://github.com/scisci)) + +#### iOS specific + +- fix incorrect type which makes animated gifs not loop forever on device (#22987) ([728a35fcf2](https://github.com/facebook/react-native/commit/728a35fcf2a2b0d695a4d7083b266eda486b1392) by [@chrisnojima](https://github.com/chrisnojima)) +- Fixes for running the simulator ([9a8c9596eb](https://github.com/facebook/react-native/commit/9a8c9596ebe41e27d37ba18d6bf09f1c931c1ff2) by [@osunnarvik](https://github.com/osunnarvik)), ([98bcfe00fb](https://github.com/facebook/react-native/commit/98bcfe00fbca066d6914a2680c3647b678caccc5) by [@cpojer](https://github.com/cpojer)) and ([8bddcb6cb0](https://github.com/facebook/react-native/commit/8bddcb6cb0914373a0aeb927f12a6d48ffc5bb84) by [@cpojer](https://github.com/cpojer)) + +## v0.58.3 + +This release resolves a regression in **StatusBar** using [these fixes](https://github.com/facebook/react-native/compare/v0.58.2...v0.58.3). + +Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/81) for cherry-picking commits - you can participate in the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/81). + +## v0.58.2 + +This release fixes an issue caused by a wrongly reverted merge commit, that caused a short timeframe of commits to not actually be in the original 0.58.0. Those commits have been added to the 0.58 changelog below, as many are intertwined with the original work. + +Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/81) for cherry-picking commits - you can participate in the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/81). + +## v0.58.1 + +There were some regressions with developer tools that prevented `react-native run-ios` from working properly in 0.58.0; this patch fix addresses that. + +Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/81) for cherry-picking commits - you can participate to the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/81). + +## v0.58.0 + +Welcome to first stable release of React Native of 2019! +There are a number of significant changes in this version, and we'd like to especially draw your attention to them: + +- [Modernizing](https://github.com/facebook/react-native/issues/21581) and [strengthening flow types](https://github.com/facebook/react-native/issues/22100) for core components +- Breaking changes to `ScrollView`, `CameraRollView`, and `SwipeableRow` that make it no longer bound to the component instance in certain methods +- Support for mutual TLS in WebKit +- Asset serving from directories besides `/assets` +- Numerous crash fixes and resolutions for unexpected behavior + +Aside from those: + +- if you are an iOS developer, you'll need to manually link `JavaScriptCore.framework` when upgrading; this can be done via Xcode, and following the steps shown [here](https://camo.githubusercontent.com/c09cd42747364b498efa7c82fcb73978ba076eae/687474703a2f2f646f63732e6f6e656d6f62696c6573646b2e616f6c2e636f6d2f696f732d61642d73646b2f616464696e672d6672616d65776f726b732e706e67). + +- Android developers, please note that Android's target SDK 27 is supported. Work is still underway to land target SDK 28 support, and it will come soon. + +Thanks to those who gave feedback during the [release candidate phase](https://github.com/react-native-community/react-native-releases/issues/41). If you're interested in helping evaluate our next release (0.59), subscribe to the dedicated issue [here](https://github.com/react-native-community/react-native-releases/issues/79). + +### Added + +- Add support for `publicPath` to enable serving static assets from different locations ([0b314960aa](https://github.com/facebook/react-native/commit/0b314960aa34c71fc731bac9c1f2b48f3223c5cb) by [@gdborton](https://github.com/gdborton)) +- Add **TouchableBounce** now has a simple `bounce()` function that can be used to trigger a bounce without callbacks ([7fe3f90156](https://github.com/facebook/react-native/commit/7fe3f90156e879fe53665efb5a90ba3a711475fa)) + +#### Android specific + +- Bundler server host can now be set using Android System Properties, making for easier debugging across multiple apps or app installs `adb shell setprop metro.host` ([e02a154787](https://github.com/facebook/react-native/commit/e02a154787274be1da3632cb1412554cbd53928b) by [@stepanhruda](https://github.com/stepanhruda)) +- Native Modules can now reject a promise with an additional `WritableMap` arg for extra properties (`userInfo`). See the interface defined in [`Promise.java`](https://github.com/facebook/react-native/blob/60b3942/ReactAndroid/src/main/java/com/facebook/react/bridge/Promise.java) for available methods. This is accessible in JavaScript as `Error.userInfo`. This is to match iOS's existing `Error.userInfo` behavior. See PR for examples. (#20940 by @Salakar) +- Native Modules now expose a `nativeStackAndroid` property to promises rejected with an Exception/Throwable - making native error stacks available inside Javascript: `Error.nativeStackAndroid`. This is to match iOS's existing `Error.nativeStackIOS` support. See PR for examples. (#20940 by @Salakar) + +#### iOS specific + +- Add `moduleForName: lazilyLoadIfNecessary` to **RCTBridge.h** to lookup modules by name and force load them, plus various improvements to LazyLoading ([d7a0c44590](https://github.com/facebook/react-native/commit/d7a0c44590bcf3fb9d055aeae3391d5bcd7e21be), [6534718a18](https://github.com/facebook/react-native/commit/6534718a1898aa472e255d2aa9a0a6cae305619a), [d7865ebde8](https://github.com/facebook/react-native/commit/d7865ebde879983b355d6f6e64232e4bd264081d), [04ea9762e2](https://github.com/facebook/react-native/commit/04ea9762e2013dcebf9f8a51d8974fa799e41cd5), [1f394fa673](https://github.com/facebook/react-native/commit/1f394fa673a876753fdc9ac2cb86a4d4a58cd8cd), [80f92adf1f](https://github.com/facebook/react-native/commit/80f92adf1f35e74ee6db0b2f445cc851463059cf), and [81b74ec1ed](https://github.com/facebook/react-native/commit/81b74ec1ed3792c0b406c30b0a1c01219a2d6243) by [@dshahidehpour](https://github.com/dshahidehpour), [@fkgozali](https://github.com/fkgozali), and [@mmmulani](https://github.com/mmmulani)) +- Add ability for **WebView** to `setClientAuthenticationCredential` when `useWebKit={true}` for mutual TLS authentication ([8911353c47](https://github.com/facebook/react-native/commit/8911353c47af018f78c1cff59dfab05b975e39ed) and [8911353c47](https://github.com/facebook/react-native/commit/8911353c47af018f78c1cff59dfab05b975e39ed) by [@mjhu](https://github.com/mjhu)) + +### Changed + +- Major improvements to Flow types for Core Components ([499c195eba](https://github.com/facebook/react-native/commit/499c195ebab0f276e3a58baf1e6172c1ba046a9e), [fbc5a4f5e6](https://github.com/facebook/react-native/commit/fbc5a4f5e65e024c10ad43d84f2b2353c9e92461), [f9050e0908](https://github.com/facebook/react-native/commit/f9050e09084cf3700bfc1954f97adf0f60cd8d88), [6476151717](https://github.com/facebook/react-native/commit/6476151717f44d3a90679f0f5293bed62a4f420e), [c03fc4087f](https://github.com/facebook/react-native/commit/c03fc4087ff9ac3ccbd1ab2261a1af329b354d99), [69213eea95](https://github.com/facebook/react-native/commit/69213eea9512c81ed998d240a6f5a3be05346b48), [136dfc8312](https://github.com/facebook/react-native/commit/136dfc831230e5418db02d1202e60d23a95c17b6), [3c0211b61a](https://github.com/facebook/react-native/commit/3c0211b61a1e723c3aaeba42c61b60bc724a3729), [c127000a7d](https://github.com/facebook/react-native/commit/c127000a7d2bb54599c9d80503528c3e8d75fddc), [636e146c4a](https://github.com/facebook/react-native/commit/636e146c4a27990547c81c2d36411d36b2c8e788), [c3dea894bd](https://github.com/facebook/react-native/commit/c3dea894bdb07d0b7ec18ab0388626d0340e6b69), [35a65cd704](https://github.com/facebook/react-native/commit/35a65cd704f2da67cd759c4d91251f8d4964b251), [79274979b7](https://github.com/facebook/react-native/commit/79274979b775e89d5f54a557a34062f873134199), [45c51835d6](https://github.com/facebook/react-native/commit/45c51835d69e111b67b4fcf1af39a13f7df1ee48), [a97d104b44](https://github.com/facebook/react-native/commit/a97d104b44daa068fa3848cc6c3225356f9dc318), [fb4825a2c6](https://github.com/facebook/react-native/commit/fb4825a2c65fba3aa905f7defb7d0c125fff644d), [84c5416617](https://github.com/facebook/react-native/commit/84c541661729dd20ab260c7468e48abbbe82affb), [3649a503cf](https://github.com/facebook/react-native/commit/3649a503cf52feac0386b4a10aab5ef6c4ec5ca0) by [@mottox2](https://github.com/mottox2), [@saitoxu](https://github.com/saitoxu), [@RSNara](https://github.com/RSNara), [@watanabeyu](https://github.com/watanabeyu), [@Tnarita0000](https://github.com/Tnarita0000), [@exced](https://github.com/exced), [@nd-02110114](https://github.com/nd-02110114), [@flowkraD](https://github.com/flowkraD)) +- Many public components were converted to ES6 classes ([ScrollView](https://github.com/facebook/react-native/commit/010e3302b8101287f231254086f3a8788a5a2c3e) by [@thymikee](https://github.com/thymikee), [CameraRollView](https://github.com/facebook/react-native/pull/21619), [SwipeableRow](https://github.com/facebook/react-native/pull/21876/files) and [ProgressBarAndroid](https://github.com/facebook/react-native/pull/21874) by [@exceed](https://github.com/exceed), [ProgressViewIOS](https://github.com/facebook/react-native/pull/21588) by [@empyrical](https://github.com/empyrical), [SegmentedControlIOS](https://github.com/facebook/react-native/pull/21888/files), [ToolbarAndroid](https://github.com/facebook/react-native/pull/21893/files) by [@nd-02110114](https://github.com/nd-02110114) +- Flow dependency is now at `v0.85.0` ([adc8a33fcf](https://github.com/facebook/react-native/commit/adc8a33fcfeb8fc163f48ae4a4bc5aaac98bcb0d) by [@samwgoldman](https://github.com/samwgoldman)) +- metro dependency is now at `v0.49.1` ([f867db366a](https://github.com/facebook/react-native/commit/f867db366aa4f0ead5a20c0d3154ca58be43fc20), [88882951e1](https://github.com/facebook/react-native/commit/88882951e1607b0af6f1772ef13135e037f9c4e3), [31bb551e75](https://github.com/facebook/react-native/commit/31bb551e75bda155b4821381e5497dc423326e3c), [de60e8643a](https://github.com/facebook/react-native/commit/de60e8643ac4e13a7f92175351268dd3c3e768db), and [de60e8643a](https://github.com/facebook/react-native/commit/de60e8643ac4e13a7f92175351268dd3c3e768db) by [@alexkirsz](https://github.com/alexkirsz) and [@rafeca](https://github.com/rafeca)) +- jest dependency is now at `v24.0.0-alpha.6` ([1b4fd64325](https://github.com/facebook/react-native/commit/1b4fd643256817d29163b37101da612867a225a1), [66aba09251](https://github.com/facebook/react-native/commit/66aba092514abd2b278a4fb66c30abffbdd5d5ff), and [06c13b3e06](https://github.com/facebook/react-native/commit/06c13b3e066636b414f5dc19c919dcb138763c71) by [@rafeca](https://github.com/rafeca) and [@rubennorte](https://github.com/rubennorte)) +- fbjs-scripts dependency is now at `v1.0.0` (#21880) ([cdbf719307](https://github.com/facebook/react-native/commit/cdbf719307f41e94a62307ec22463bb562d1c8de) by [@jmheik](https://github.com/jmheik)) +- folly dependency is now at `v2018.10.22.00` ([a316dc6ec3](https://github.com/facebook/react-native/commit/a316dc6ec34655981c0f226186f4fb668e4a01e2), [287934dba9](https://github.com/facebook/react-native/commit/287934dba943cd954164bde8b06f9ba85940b45f), and [a70625abd7](https://github.com/facebook/react-native/commit/a70625abd7bf4fba3dafb8a969a73854b7ddcd42) by [@Kudo](https://github.com/Kudo) and [@radko93](https://github.com/radko93)) +- React is set to `16.6.3` now via sync for revisions 4773fdf...6bf5e85 ([0cb59b5c23](https://github.com/facebook/react-native/commit/0cb59b5c23b76771a30f59cdcedaa3c95c4dd280) and [073ad6a036](https://github.com/facebook/react-native/commit/073ad6a0367c3156e03680c0ab0648feed2bf89c) by [@yungsters](https://github.com/yungsters)) +- Clearer error messages when hot reloading ([c787866d64](https://github.com/facebook/react-native/commit/c787866d644be4c8d30bb17c237a50fdd6e1a82d) by [@alexkirsz](https://github.com/alexkirsz)) +- Allow CxxModules to implement functions which take two callbacks ([8826d8b233](https://github.com/facebook/react-native/commit/8826d8b233c1e3325a575d5012b713c4786e6062) by [@acoates-ms](https://github.com/acoates-ms)) + +#### Breaking Changes 💥 + +- Public methods of components converted to ES6 classes are no longer bound to their component instance. For `ScrollView`, the affected methods are `setNativeProps`, `getScrollResponder`, `getScrollableNode`, `getInnerViewNode`, `scrollTo`, `scrollToEnd`, `scrollWithoutAnimationTo`, and `flashScrollIndicators`. For `CameraRollView`, the affected methods are: `rendererChanged`. For `SwipeableRow`, the affected methods are: `close`. Therefore, it is no longer safe to pass these method by reference as callbacks to functions. Auto-binding methods to component instances was a behaviour of `createReactClass` that we decided to not preserve when switching over to ES6 classes. (you can refer to [this example](https://github.com/react-native-community/react-native-releases/issues/81#issuecomment-459252692)) +- Native Modules in Android now require `@ReactModule` annotations to access `.getNativeModule` method on the `ReactContext`. This is how your updated Native Module should look like: + + ```diff + // CustomModule.java + + // ... + + import com.facebook.react.module.annotations.ReactModule; + + + @ReactModule(name="CustomBridge") + public class CustomModule extends ReactContextBaseJavaModule { + // ... + + @Override + public String getName() { + return "CustomBridge"; + } + + // ... + } + ``` + +#### Android specific + +- Optimize `PlatformConstants.ServerHost`, `PlatformConstants.isTesting`, and `PlatformConstants.androidID` for performance ([2bf0d54f15](https://github.com/facebook/react-native/commit/2bf0d54f155c28244fa60230871b3eed60a20c6d), [339d9d3afb](https://github.com/facebook/react-native/commit/339d9d3afba45bb28073db59e365caea37258891), and [9f9390ddfc](https://github.com/facebook/react-native/commit/9f9390ddfccab706ff2d346fdbd408c1cfc1c312) by [@stepanhruda](https://github.com/stepanhruda), [@fkgozali](https://github.com/fkgozali), and [@axe-fb](https://github.com/axe-fb)) + +#### iOS specific + +- Suppress yellow box about missing export for native modules ([5431607c6d](https://github.com/facebook/react-native/commit/5431607c6d4983e0adccf0192dd4dc4f5dc85443) by [@fkgozali](https://github.com/fkgozali)) + +### Removed + +- Remove `UIManager.measureViewsInRect()` ([d6236796b2](https://github.com/facebook/react-native/commit/d6236796b285e6ad19c53c5308a0ad9c10792a05) by [@shergin](https://github.com/shergin)) + +### Fixed + +- Fix potential UI thread stalling scenario from Yoga JNI bindings ([2a8f6c3028](https://github.com/facebook/react-native/commit/2a8f6c3028feec7fc9a01cbdfad45955c4771bf8) by [@davidaurelio](https://github.com/davidaurelio)) +- Fix crash happening due to race condition around bridge cxx module registry ([188cbb04ad](https://github.com/facebook/react-native/commit/188cbb04ad264aea32ae235b85b61e626b767b83), [188cbb04ad](https://github.com/facebook/react-native/commit/188cbb04ad264aea32ae235b85b61e626b767b83), and [188cbb04ad](https://github.com/facebook/react-native/commit/188cbb04ad264aea32ae235b85b61e626b767b83) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Fix **View** and **Text**'s displayName; show the specific name rather than generic "Component" ([7a914fcef4](https://github.com/facebook/react-native/commit/7a914fcef4ae035221e1f984c104ba20430d6fad) by [@rajivshah3](https://github.com/rajivshah3)) +- Fix `react-native init --help` so that it doesn't return `undefined` ([58732a88b6](https://github.com/facebook/react-native/commit/58732a88b629b40b2d223a76fac46ecee5ae7295) by [@ignacioola](https://github.com/ignacioola)) +- Fix `react-native --sourceExts` ([ce860803a4](https://github.com/facebook/react-native/commit/ce860803a4341c4121a0bb504dc669349ac0db35) by [@elyalvarado](https://github.com/elyalvarado)) +- Fix accidental showing of **Modal** when `visible` prop is undefined or null ([cc13a7367b](https://github.com/facebook/react-native/commit/cc13a7367b08bd766749ddbfaacc25ade1f33a8f) by [@MateusAndrade](https://github.com/MateusAndrade)) +- Fix crash during **VirtualizedList** pagination ([5803772017](https://github.com/facebook/react-native/commit/580377201793314ca643250c1bd7cf1c47d49920)) +- Fix scenario where removing a module with remote debugging and Delta bundles may cause incorrect stack traces ([bea57d871f](https://github.com/facebook/react-native/commit/bea57d871f6b5bed76d1625b3e3f483695bd13e9) by [@alexkirsz](https://github.com/alexkirsz)) +- Fix regression in **StyleSheet** `setStyleAttributePreprocessor` ([04085337bc](https://github.com/facebook/react-native/commit/04085337bc47392922c7911b95b8fdaea98800e8) by [@brentvatne](https://github.com/brentvatne)) +- Fix React Native AsyncMode and DevTools ([aacb06c594](https://github.com/facebook/react-native/commit/aacb06c594dcd4581918035f713a69cf73bf125b) by [@bvaughn](https://github.com/bvaughn)) + +#### Android specific + +- Fix crash when removing root nodes ([b649fa96a0](https://github.com/facebook/react-native/commit/b649fa96a088a9e8ccbf3f979ebfa4a5e28a066f) by [@ayc1](https://github.com/ayc1)) +- Fix various **ReactInstanceManager** deadlocks and race conditions ([df7e8c64ff](https://github.com/facebook/react-native/commit/df7e8c64ff8f5ff739fba2ba5ed6b0610567235e), [df7e8c64ff](https://github.com/facebook/react-native/commit/df7e8c64ff8f5ff739fba2ba5ed6b0610567235e), and [be282b5287](https://github.com/facebook/react-native/commit/be282b5287f7eecf8a3fd14b06ab36454dbba5fe) by [@ayc1](https://github.com/ayc1)) +- Fix IllegalArgumentException when dismissing ReactModalHostView and DialogManager ([e57ad4ee37](https://github.com/facebook/react-native/commit/e57ad4ee37b02cd4c9e10a97d7a1d2b799204d7d) and [38e01a20c3](https://github.com/facebook/react-native/commit/38e01a20c343e60d5f8cd92fb26454e9940565df) by [@mdvacca](https://github.com/mdvacca)) +- Fix incorrect merged asset path with flavor for Android Gradle Plugin 3.2 ([e90319e9fa](https://github.com/facebook/react-native/commit/e90319e9fa18661144ad29faf36efba3750edb32) by [@yatatsu](https://github.com/yatatsu)) +- Fix HTTP connection ontimeout callback ([a508134724](https://github.com/facebook/react-native/commit/a50813472450f51d2ef24b40be99a22beefec33c)) +- Fix websocket properly closing when remote server initiates close ([2e465bca15](https://github.com/facebook/react-native/commit/2e465bca158ae9cfa89448e2a3bb8cc009397ac8) by [@syaau](https://github.com/syaau)) +- Fix compatibility issue for Android 16 device ([5939d078a0](https://github.com/facebook/react-native/commit/5939d078a01edc9f83fce102317540ffbcac17c1), [f22473e9e9](https://github.com/facebook/react-native/commit/f22473e9e9f73605cd27c5e38298bd793478c84d), and [f22473e9e9](https://github.com/facebook/react-native/commit/f22473e9e9f73605cd27c5e38298bd793478c84d) by [@gengjiawen](https://github.com/gengjiawen)) +- Fix issue where `Image.resizeMode` isn't respected while source is loading, resulting in unexpected padding ([673ef39561](https://github.com/facebook/react-native/commit/673ef39561ce6640e447fa40299c263961e4f178) by [@dulmandakh](https://github.com/dulmandakh)) +- Fix Android 28's inverted **ScrollView** so that momentum is in the proper direction ([b971c5beb8](https://github.com/facebook/react-native/commit/b971c5beb8c7f90543ea037194790142f4f57c80) by [@mandrigin](https://github.com/mandrigin)) +- Fix HTTP connection timeout callback to be appropriately called ([a508134724](https://github.com/facebook/react-native/commit/a50813472450f51d2ef24b40be99a22beefec33c)) +- Fix compatibility issue with Android 16 device ([5939d078a0](https://github.com/facebook/react-native/commit/5939d078a01edc9f83fce102317540ffbcac17c1) by [@gengjiawen](https://github.com/gengjiawen)) +- Fix crash when releasing RN views and removing root nodes([83405ff316](https://github.com/facebook/react-native/commit/83405ff3167eaba6fa59ca52c54943221a05ee09) and [b649fa96a0](https://github.com/facebook/react-native/commit/b649fa96a088a9e8ccbf3f979ebfa4a5e28a066f) by [@ayc1](https://github.com/ayc1)) +- Close websocket properly when remote server initiates close ([2e465bca15](https://github.com/facebook/react-native/commit/2e465bca158ae9cfa89448e2a3bb8cc009397ac8) by [@syaau](https://github.com/syaau)) +- Workaround a wrong fling direction for inverted ScrollViews on Android P ([b971c5beb8](https://github.com/facebook/react-native/commit/b971c5beb8c7f90543ea037194790142f4f57c80) by [@mandrigin](https://github.com/mandrigin)) +- Fix **Image** to respect `resizeMode` for `defaultSource` images rather than showing padding while loading ([673ef39561](https://github.com/facebook/react-native/commit/673ef39561ce6640e447fa40299c263961e4f178) by [@dulmandakh](https://github.com/dulmandakh)) + +#### iOS specific + +- Fix case where content of inline views didn't get relaid out ([798517a267](https://github.com/facebook/react-native/commit/798517a267841675956cb52a1c0ae493a913962a) by [@rigdern](https://github.com/rigdern)) +- Fix issue with **ImagePickerIOS**'s inconsistent image when using the front-facing camera ([4aeea4d2dc](https://github.com/facebook/react-native/commit/4aeea4d2dc14cf02dc3766043e2938bf367c6170)) +- Fix race condition and crash around shutdown of the JSC for iOS 11 and earlier ([bf2500e38e](https://github.com/facebook/react-native/commit/bf2500e38ec06d2de501c5a3737e396fe43d1fae) by [@mhorowitz](https://github.com/mhorowitz)) +- Fix crash in **NetInfo**'s \_firstTimeReachability ([eebc8e230a](https://github.com/facebook/react-native/commit/eebc8e230a9f72c3dde34a5cfd59bbffba55e53d) by [@mmmulani](https://github.com/mmmulani)) +- Fix case where inline view is visible even though it should have been truncated ([70826dbafc](https://github.com/facebook/react-native/commit/70826dbafcb00c08e0038c5066e33848141be77b) by [@rigdern](https://github.com/rigdern)) +- Fix crash with **ScrollView** related to content offsets ([585f7b916d](https://github.com/facebook/react-native/commit/585f7b916d63b7b4d22a7347334765ffcd7945e9) by [@shergin](https://github.com/shergin)) +- Fix an issue where **CameraRoll** wasn't showing the front-facing camera consistently during capture and preview ([4aeea4d2dc](https://github.com/facebook/react-native/commit/4aeea4d2dc14cf02dc3766043e2938bf367c6170)) +- Fix case where inline view is visible even though it should have been truncated ([70826dbafc](https://github.com/facebook/react-native/commit/70826dbafcb00c08e0038c5066e33848141be77b) by [@rigdern](https://github.com/rigdern)) + +### Known issues + +It is possible that you'll face an AAPT error regarding missing resources, [here](https://github.com/infinitered/ignite-andross/issues/244) is an example of this error, in this case, you should try to update the build tools versions to `buildToolsVersion = "28.0.2"` in your android/build.gradle file. If you maintain a react-native library which uses native code you should avoid using hardcoded versions of the build tools and use the packaged version numbers, here is an example you can [follow](https://github.com/react-native-community/react-native-linear-gradient/blob/master/android/build.gradle) + +## v0.57.8 + +**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.3"`. + +Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/71) for cherry-picking commits - you can participate to the decision process for the next release [here](https://github.com/react-native-community/react-native-releases/issues/75). + +### Added + +- Fix: Add displayName to ActivityIndicator (#22417) ([53da585832](https://github.com/facebook/react-native/commit/53da5858326bbddd2df112f86b2c1e935adc3882)) + +### Changed + +- Switch: Improve Accessibility ([0c8db08f51](https://github.com/facebook/react-native/commit/0c8db08f519fdf5162dff1d9a18b58885c4c7d2f) by [@yungsters](https://github.com/yungsters)) +- React sync for revisions 3ff2c7c...6bf5e85 ([073ad6a036](https://github.com/facebook/react-native/commit/073ad6a0367c3156e03680c0ab0648feed2bf89c) by [@yungsters](https://github.com/yungsters)) + +#### iOS specific + +- Extend reason message for `RCTFatalException` (#22532) ([2831d9ef61](https://github.com/facebook/react-native/commit/2831d9ef614280d08699f3134eeaeda84c30234e) by [@zackzachariah](https://github.com/zackzachariah)) + +### Removed + +- Remove trailing slash from origin header if no port is specified (#22290) ([cbe7d41f3f](https://github.com/facebook/react-native/commit/cbe7d41f3f509aaa8b8b0819b0d8ad4996fd7296)) + +### Fixed + +- Fix text alpha bug ([fd78eee11b](https://github.com/facebook/react-native/commit/fd78eee11b71799aa7fa57bbd70d59c6c642c3b3) by [@necolas](https://github.com/necolas)) +- fix possible NPE in StatusBarModule ([0f3be77b7d](https://github.com/facebook/react-native/commit/0f3be77b7d4177c8f94d775bf8ef2a2b68f1e828) by [@mdvacca](https://github.com/mdvacca)) +- Fixes animated gifs incorrectly looping/not stopping on last frame (#21999) ([de759b949e](https://github.com/facebook/react-native/commit/de759b949e4aa4904fd60a2fcbb874a3c857b50c) by [@staufman](https://github.com/staufman)) +- Fix ListEmptyComponent is rendered upside down when using inverted flag. (#21496) ([198eb02697](https://github.com/facebook/react-native/commit/198eb0269781803cc16254916b0477916afbcb0e) by [@hyochans](https://github.com/hyochans)) +- Fix bug in comparison logic of object property (#22348) ([c3b3eb7f73](https://github.com/facebook/react-native/commit/c3b3eb7f73b0fb4035d4b2478bf9827caf746372) by [@vreality64](https://github.com/vreality64)) +- Fix dispatch of OnLayout event for first render ([844e11967d](https://github.com/facebook/react-native/commit/844e11967d9292bd5cfe423d0fd57e34388f2337) by [@mdvacca](https://github.com/mdvacca)) +- KeyboardAvoidingView: Duration cannot be less then 10ms (#21858) ([87b6533937](https://github.com/facebook/react-native/commit/87b65339379362f9db77ae3f5c9fa8934da34b25)) +- default hitSlop values to 0 (#22281) ([f6d3a61677](https://github.com/facebook/react-native/commit/f6d3a6167730cc9253b796b859d8f1f33f821687) by [@Taylor123](https://github.com/Taylor123)) + +#### iOS specific + +- Fixed for supporting mediaPlaybackRequiresUserAction under iOS 10. (#22208) ([c45d290b07](https://github.com/facebook/react-native/commit/c45d290b079f95466ad4054acf7b93c66cabc429) by [@ifsnow](https://github.com/ifsnow)) +- Use main.jsbundle in iOS template for production build (#22531) ([a2ef5b85d8](https://github.com/facebook/react-native/commit/a2ef5b85d8c46cefd5873bf5fc6dddabf1d51d13) by [@radeno](https://github.com/radeno)) +- Use relative path for SCRIPTDIR (#22598) ([0314fca63a](https://github.com/facebook/react-native/commit/0314fca63a035c95864e5b198e1fbd9a5ee1d2a7) by [@sunnylqm](https://github.com/sunnylqm)) +- Fix UIScrollView crash ([585f7b916d](https://github.com/facebook/react-native/commit/585f7b916d63b7b4d22a7347334765ffcd7945e9) by [@shergin](https://github.com/shergin)) +- Avoid using `-[UITextView setAttributedString:]` while user is typing (#19809) ([f77aa4eb45](https://github.com/facebook/react-native/commit/f77aa4eb459b9dcb7f0b558ad3f04e0c507955e9)) + +### Security + +- Bump ws package to 1.1.5 due to vulnerability issues (#21769) ([96ce6f9538](https://github.com/facebook/react-native/commit/96ce6f9538ed3559ffea6040a47b1d6a30546ab9) by [@prog1dev](https://github.com/prog1dev)) + +## v0.57.7 + +**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.1"`. + +This patch release fixes version 0.57.6 about losing focus in `TextInput` because of [ada7089066](https://github.com/facebook/react-native/commit/ada70890663503b65b42bb5f6f98d3df412ecdc4). + +Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/64) for cherry-picking commits. + +## v0.57.6 + +**INFO NOTE**: It's highly recommended that you skip this version and upgrade to 0.57.7. + +**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.1"`. +This patch release fixes a number of crashes, resolves build issues (both for iOS and Android). Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/64) for cherry-picking commits. + +### Added + +#### iOS specific + +- Add iOS 12 textContentType options (#21079) ([644fc57fad](https://github.com/facebook/react-native/commit/644fc57fad4b163e96c3b3d6ec441c7b566d2d43) by [@ultramiraculous](https://github.com/ultramiraculous)) + +### Removed + +- Remove useless additional blur call (#22156) ([ada7089066](https://github.com/facebook/react-native/commit/ada70890663503b65b42bb5f6f98d3df412ecdc4)) + +### Fixed + +- Improving Modal `visible` prop check to handle undefined and null (#22072) ([cc13a7367b](https://github.com/facebook/react-native/commit/cc13a7367b08bd766749ddbfaacc25ade1f33a8f) by [@MateusAndrade](https://github.com/MateusAndrade)) +- Fix crash in nativeInjectHMRUpdate (#22412) ([0b4fd621e3](https://github.com/facebook/react-native/commit/0b4fd621e3ab511510d6852af67183a3581d1aad) by [@vovkasm](https://github.com/vovkasm)) +- Fix IllegalArgumentException when dismissing ReactModalHostView ([e57ad4ee37](https://github.com/facebook/react-native/commit/e57ad4ee37b02cd4c9e10a97d7a1d2b799204d7d) by [@mdvacca](https://github.com/mdvacca)) +- Fix regression in StyleSheet.setStyleAttributePreprocessor (#22262) ([04085337bc](https://github.com/facebook/react-native/commit/04085337bc47392922c7911b95b8fdaea98800e8) by [@brentvatne](https://github.com/brentvatne)) +- Fix React Native AsyncMode and DevTools ([f41383fb6d](https://github.com/facebook/react-native/commit/f41383fb6d6d0858e1b09dda79a74632d7932d07) by [@bvaughn](https://github.com/bvaughn)) +- CxxReact: Silence 'unused lambda capture' warnings in open-source (#22240) ([0c0540965a](https://github.com/facebook/react-native/commit/0c0540965ad9e3cdd9af16f606e141eca8ab2193) by [@empyrical](https://github.com/empyrical)) + +#### Android specific + +- Fixed HTTP connection timeout on Android (#22164) ([a508134724](https://github.com/facebook/react-native/commit/a50813472450f51d2ef24b40be99a22beefec33c)) +- resizeMode applies to Image.defaultSource (#22216) ([673ef39561](https://github.com/facebook/react-native/commit/673ef39561ce6640e447fa40299c263961e4f178) by [@dulmandakh](https://github.com/dulmandakh)) +- Android: Close websocket properly when remote server initiates close (#22248) ([2e465bca15](https://github.com/facebook/react-native/commit/2e465bca158ae9cfa89448e2a3bb8cc009397ac8) by [@syaau](https://github.com/syaau)) +- Workaround a wrong fling direction for inverted ScrollViews on Android P (#21117) ([b971c5beb8](https://github.com/facebook/react-native/commit/b971c5beb8c7f90543ea037194790142f4f57c80) by [@mandrigin](https://github.com/mandrigin)) +- Fix crash when releasing RN views ([83405ff316](https://github.com/facebook/react-native/commit/83405ff3167eaba6fa59ca52c54943221a05ee09) by [@ayc1](https://github.com/ayc1)) + +#### iOS specific + +- iOS: Support inline view truncation (#21456) ([70826dbafc](https://github.com/facebook/react-native/commit/70826dbafcb00c08e0038c5066e33848141be77b) by [@rigdern](https://github.com/rigdern)) +- NetInfo: try to solve crash with releasing \_firstTimeReachability ([eebc8e230a](https://github.com/facebook/react-native/commit/eebc8e230a9f72c3dde34a5cfd59bbffba55e53d) by [@mmmulani](https://github.com/mmmulani)) +- Generate ip.txt before SKIP_BUNDLING check (#20554) ([9c1ea45d38](https://github.com/facebook/react-native/commit/9c1ea45d38a6ec731894443debe8879fa3876ab7) by [@keatongreve](https://github.com/keatongreve)) +- Revert [Performance improvement for loading cached images on iOS ] ([7eeb305933](https://github.com/facebook/react-native/commit/7eeb305933fca695c5a15d675bb10569c3385109) by [@kelset](https://github.com/kelset)) +- Fix inability to remove 'Disabled' state from AccessibilityStates ([5eaa2d29c0](https://github.com/facebook/react-native/commit/5eaa2d29c0c4c633a40f7241408737c754edea84)) + +## v0.57.5 + +**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.1"`. + +This patch release fixes a number of crashes, resolves build issues (both for iOS and Android), and brings React to v16.6.1. Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/54) for cherry-picking commits. + +### Changed + +- React is now at v16.6.1 ([8325e09e5c](https://github.com/facebook/react-native/commit/8325e09e5cd8538fded1b5a1b4fff1854e17eb22) and [76c99f20e3](https://github.com/facebook/react-native/commit/76c99f20e39ef1b5fa93487bc8c82e7c6aede5dd) by [@yungsters](https://github.com/yungsters)) + +#### iOS specific + +- Performance improvement for loading cached images ([54f7eb3424](https://github.com/facebook/react-native/commit/54f7eb34243715a1d4bc821ccbadeec12486d22c) and [3a98318c91](https://github.com/facebook/react-native/commit/3a98318c91283a1bba35c0bca93b975d4a550330) by [@esamelson](https://github.com/esamelson) and others) + +### Fixed + +- Fix crash in **VirtualizedList** during pagination ([5803772017](https://github.com/facebook/react-native/commit/580377201793314ca643250c1bd7cf1c47d49920)) +- Fix polyfilling of **regeneratorRuntime** to avoid setting it to undefined in some situations ([2a7e02edf6](https://github.com/facebook/react-native/commit/2a7e02edf64c20410b2f95f35e313279545b40db) by [@rafeca](https://github.com/rafeca)) +- Fix **View**, **Text**, and **ActivityIndicator**'s `displayName` ([7a914fcef4](https://github.com/facebook/react-native/commit/7a914fcef4ae035221e1f984c104ba20430d6fad) and [53da585832](https://github.com/facebook/react-native/commit/53da5858326bbddd2df112f86b2c1e935adc3882) by [@rajivshah3](https://github.com/rajivshah3) and others) +- Fix crash that happens when a component throws an exception that contains a null message ([6debfdf6d6](https://github.com/facebook/react-native/commit/6debfdf6d6172cec2d87fd1e780c3b347d41dc1d) by [@mdvacca](https://github.com/mdvacca)) + +#### Android specific + +- Fix incorrect merged asset path with flavor for Android Gradle Plugin 3.2 ([e90319e9fa](https://github.com/facebook/react-native/commit/e90319e9fa18661144ad29faf36efba3750edb32) by [@yatatsu](https://github.com/yatatsu)) +- Fix crash in **ReadableNativeArray.getType** when size of ReadableNativeArray's length > 512 ([09c78fe968](https://github.com/facebook/react-native/commit/09c78fe968e1bb71108c4058e76ebf70178e5a8b) by [@dryganets](https://github.com/dryganets)) + +#### iOS specific + +- Fix crash in rapid use of **NetInfo.getCurrentConnectivity** ([67afaefa78](https://github.com/facebook/react-native/commit/67afaefa78c314b38249a7e2758e0af38c18f34a) by [@mmmulani](https://github.com/mmmulani)) +- Fix Xcode 10 errors relating to third-party ([277c19c93e](https://github.com/facebook/react-native/commit/277c19c93eacf3e3ce63f71236fd399214d6e6d0) by [@mmccartney](https://github.com/mmccartney)) +- Fix build errors when path to `$NODE_BINARY` contains spaces ([7d4e94edcc](https://github.com/facebook/react-native/commit/7d4e94edccfc2f642fcbd1d6aa00756f02e3a525) by [@sundbry](https://github.com/sundbry)) +- Fix case where content of inline views didn't get relaid out ([798517a267](https://github.com/facebook/react-native/commit/798517a267841675956cb52a1c0ae493a913962a) by [@rigdern](https://github.com/rigdern)) +- Fix **InputAccessoryView**'s safe area when not attached to a **TextInput** ([2191eecf54](https://github.com/facebook/react-native/commit/2191eecf54b5c4bf278dfaf23fec46d44ac9a1f0) by [@janicduplessis](https://github.com/janicduplessis)) + +## v0.57.4 + +**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.0-alpha.8af6728"` (next version, 0.57.5, will update to `16.6.0`, and it will come soon). Also, please check the _Known issues_ section below, especially if you are using Xcode 10. + +Thanks to everyone that contributed to the [discussion](https://github.com/react-native-community/react-native-releases/issues/48) for cherry-picking the commits that landed in this release, and the developers who submitted those commits! + +### Added: new features + +#### Android specific additions + +- Android textTransform style support ([22cf5dc566](https://github.com/facebook/react-native/commit/22cf5dc5660f19b16de3592ccae4c42cc16ace69) by Stephen Cook) + +### Changes: existing functionality that is now different + +- Add deprecation notice to SwipeableListView ([99471f87b9](https://github.com/facebook/react-native/commit/99471f87b944b26bbdaa0fb0881db91c1118b741) by [@TheSavior](https://github.com/TheSavior)) + +#### Android specific changes + +- Consolidate native dependencies versions ([ba608a2db7](https://github.com/facebook/react-native/commit/ba608a2db786a8e983a6e30b31662fac254286c0) by [@dulmandakh](https://github.com/dulmandakh)) +- bump okhttp3 to 3.11 ([10fc548809](https://github.com/facebook/react-native/commit/10fc548809cc08db209ae6696b723341925137d1) by [@dulmandakh](https://github.com/dulmandakh)) +- Android: Send `` metrics in onTextLayout events ([737f93705c](https://github.com/facebook/react-native/commit/737f93705ca8b5d3fdd207f870cf27adcf1e885b) by [@mmmulani](https://github.com/mmmulani)) +- Use TextLegend example in Android as well ([335927db44](https://github.com/facebook/react-native/commit/335927db44fe47e20db4503a1ab5fcf8d62144a8) by [@mmmulani](https://github.com/mmmulani)) + +#### iOS specific changes + +- Bump xcode@1.0.0 ([b9514995a2](https://github.com/facebook/react-native/commit/b9514995a26b4c3f6d555257740457dd4d6cfeae) by [@peat-psuwit](https://github.com/peat-psuwit)) +- Text: send metrics after rendering (iOS) ([737f93705c](https://github.com/facebook/react-native/commit/737f93705ca8b5d3fdd207f870cf27adcf1e885b) by [@mmmulani](https://github.com/mmmulani)) +- Allow specifying iOS version for run-ios with simulator option ([0fab27cbac](https://github.com/facebook/react-native/commit/0fab27cbaca57b90119ab36104af4d0b3052ae30) by [@elyalvarado](https://github.com/elyalvarado)) +- Relax the requirement that lazy module cannot be initialized on the main thread ([dbc864c9cd](https://github.com/facebook/react-native/commit/dbc864c9cd95f9df268d85a642742e84e2360db4) by [@spredolac](https://github.com/spredolac)) + +### Fixed: bugs that have been resolved + +- Fix crashes on invalid regex ([298f14da12](https://github.com/facebook/react-native/commit/298f14da1210460b3e25c6002e8d1aa5f7b4e0ef) by [@RSNara](https://github.com/RSNara)) +- Fix pull to refresh refresh component clipping on Android ([8a3a0ad2d0](https://github.com/facebook/react-native/commit/8a3a0ad2d0f894a3d8c1e403a9336dab17c2dde8) by Andy Huang) +- ListView requestAnimationFrame leak ([70b5eb3aa2](https://github.com/facebook/react-native/commit/70b5eb3aa27822fa11571c3d8d3628ecf03268ab) by [@exced](https://github.com/exced)) + +#### Android specific fixes + +- reverted [Update bad method](https://github.com/facebook/react-native/commit/1592a8d42411d1f91c8ceb738c0533c1cee73f71) +- Fix accessibility role crash ([1f96ff62cf](https://github.com/facebook/react-native/commit/1f96ff62cf786f93c91e6625bf2b819077902251) by Haseeb Saeed) +- Fix accessibilityRole value lookup ([1f96ff62cf](https://github.com/facebook/react-native/commit/1f96ff62cf786f93c91e6625bf2b819077902251) by [@ayc1](https://github.com/ayc1)) +- Fix DynamicFromMap object pool synchronization ([b0d68c0bb9](https://github.com/facebook/react-native/commit/b0d68c0bb971a44dfdf7722682933f1e96e1cd45) by [@haitaoli](https://github.com/haitaoli)) +- Back out "[react-native][pr] Rounded corner rendering fixed on Android N." ([bb407fa1ec](https://github.com/facebook/react-native/commit/bb407fa1ec0bd0367373961fdc0e840150840068) by Jonathan Lee) +- Fix onTextLayout metrics on Android when using alignText ([1c240ae898](https://github.com/facebook/react-native/commit/1c240ae898e26534b8d9a09a334dec02e96faa05) by [@mmmulani](https://github.com/mmmulani)) +- Cleaning up imports in ViewGroupManager ([082a869dae](https://github.com/facebook/react-native/commit/082a869daef3cf602a088d0418c185279052b8c3) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific fixes + +- Fix issue when inserting text at 0 when maxLength is set ([17415938c7](https://github.com/facebook/react-native/commit/17415938c7180a95811db949122b8ad24a442866) by [@ejanzer](https://github.com/ejanzer)) + +### Known issues + +There are a few issues that don't have a finalized solution (as it happens for 0.x projects). In particular: + +- when using Xcode 10 and `react-native init`, your build may fail due to third-party build steps ([#20774](https://github.com/facebook/react-native/issues/20774)). There is a [commit](https://github.com/facebook/react-native/commit/b44c5ae92eb08125d466cf151cb804dabfbbc690) we are planning to cherry pick in a future release that should help - in the meantime, you should be able to run these commands from the project folder to fix the issue (you should need to do it only once per project): + + ```bash + cd node_modules/react-native + scripts/ios-install-third-party.sh + cd third-party/glog-0.3.5/ + ../../scripts/ios-configure-glog.sh + ``` + +- React `16.6.0` works for the most part, aside from the Context API (check [this issue](https://github.com/facebook/react-native/issues/21975)) - and if you are eager to test the new React Hooks you will have to be patient, as they are not production ready and `16.7.alpha` is **not** yet [supported](https://github.com/facebook/react-native/issues/21967) by React Native. + +## v0.57.3 + +**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.0-alpha.8af6728"`. Also, please check the _Known issues_ section below, especially if you are using Xcode 10. + +Thanks to everyone that contributed to the [discussion](https://github.com/react-native-community/react-native-releases/issues/46) for cherry-picking the commits that landed in this release, and the developers who submitted those commits! + +### Added: new features + +- Expose enableBabelRuntime config param externally ([89a358f347](https://github.com/facebook/react-native/commit/89a358f34786198c8a9a2d379588efd57b6a0eec) by [@rafeca](https://github.com/rafeca)) + +#### Android specific additions + +- Add test for InterpolatorType ([b7526b2095](https://github.com/facebook/react-native/commit/b7526b2095e4a5c8641e8264786d1622d6390029) by [@ejanzer](https://github.com/ejanzer)) + +### Changes: existing functionality that is now different + +- React sync for revisions ade5e69...d836010 ([fa6035bda6](https://github.com/facebook/react-native/commit/7142e9b1c5f95e82ceb04798b166318385004147) by [@yungsters](https://github.com/yungsters)) +- React: Bump Canary Version ([8258b6a280](https://github.com/facebook/react-native/commit/8258b6a2801121bebb25272bfcc5d3da1fb5ae39) by [@yungsters](https://github.com/yungsters)) +- FBJS: Upgrade to ^1.0.0 ([ee034596fe](https://github.com/facebook/react-native/commit/ee034596fecfb47ff9e6e1fc30cefb0e970e7d80) by [@yungsters](https://github.com/yungsters)) +- Bump metro@0.48.1 ([bf47589b8b](https://github.com/facebook/react-native/commit/bf47589b8be145750e954d09684370463a616779) by [@rafeca](https://github.com/rafeca)) +- Update to Detox 9 ([15c05988e9](https://github.com/facebook/react-native/commit/15c05988e980118151bdf41ed82ebb8c8e30a0f3) by [@kelset](https://github.com/kelset)) +- Add Deprecation Warning to ListView ([e90f5fa263](https://github.com/facebook/react-native/commit/e90f5fa2630f8a89e15fa57c70ada83e75a20642) by [@TheSavior](https://github.com/TheSavior)) +- Deprecate legacyImplementation of FlatList ([3aa8f09b44](https://github.com/facebook/react-native/commit/3aa8f09b4437eab8b91429b7325f8a6173ffa49a) by [@TheSavior](https://github.com/TheSavior)) + +#### Android specific changes + +- bump Android NDK to r17c ([436cf154bb](https://github.com/facebook/react-native/commit/436cf154bb9cf4fc0bcafd7115d33544ce36b759) by [@dulmandakh](https://github.com/dulmandakh)) +- Resolve protocol http, https when not in lowercase ([d00bdb9bb8](https://github.com/facebook/react-native/commit/d00bdb9bb8b9b11bce900689c7e28cebd2eb0807) by [@hyunjongL](https://github.com/hyunjongL)) +- Normalize scheme for URL on Android ([4b6f02ea75](https://github.com/facebook/react-native/commit/4b6f02ea758a9ab5853a29ebfc054eaa98e6dc53) by [@radeno](https://github.com/radeno)) + +#### iOS specific changes + +- Bump up the buffer size and show a warning if the trace might be truncated ([1fc8a46570](https://github.com/facebook/react-native/commit/1fc8a46570561a32657ffccb0f5a12c6f4d6a3dd) by [@alexeylang](https://github.com/alexeylang)) + +### Fixed: bugs that have been resolved + +- Fix deprecation warning message in Switch ([997f382adc](https://github.com/facebook/react-native/commit/997f382adcc7f82fccd97ac671d13e86aef7171e) by [@radko93](https://github.com/radko93)) + +#### Android specific fixes + +- Fix default accessibility delegate ([fa6035bda6](https://github.com/facebook/react-native/commit/fa6035bda6c606868977179534cb941f26fbdb92) by [@ayc1](https://github.com/ayc1)) +- Fix accessibility role/label ([fa6035bda6](https://github.com/facebook/react-native/commit/fa6035bda6c606868977179534cb941f26fbdb92) by [@ayc1](https://github.com/ayc1)) +- When converting arguments JS->Java, handle integers correctly ([bb9b9a8b9d](https://github.com/facebook/react-native/commit/bb9b9a8b9d5868c7ab5034117b785943496f6405) by [@mhorowitz](https://github.com/mhorowitz)) +- Fix CameraRoll.getPhotos() crash on Android if device has a problematic video asset ([4768bea0cf](https://github.com/facebook/react-native/commit/4768bea0cf288cf9c8097fc498b896610728c645) by [@naxel](https://github.com/naxel)) +- Android ScrollView fix for snapToInterval not snapping to end ([6eeff75849](https://github.com/facebook/react-native/commit/6eeff75849c9b8bf91592c1b7906b4dab8fba518) by [@olegbl](https://github.com/olegbl)) +- Fix for InterpolatorType crash ([01a1004808](https://github.com/facebook/react-native/commit/01a1004808928e29a6d6c698b3b18312fed17a02) by [@ejanzer](https://github.com/ejanzer)) +- Update bad method ([1592a8d424](https://github.com/facebook/react-native/commit/1592a8d42411d1f91c8ceb738c0533c1cee73f71) by [@grabbou](https://github.com/grabbou)) + +#### iOS specific fixes + +- Dealloc first time RCTNetInfo reachability callback ([e7e63fd409](https://github.com/facebook/react-native/commit/e7e63fd4092a81beec482fc48d05f1a048801037) by [@mmmulani](https://github.com/mmmulani)) +- iOS: fix the baseline issue when displaying a mixture of different-language characters ([c1561ab441](https://github.com/facebook/react-native/commit/c1561ab4411854bef96b5d268d38002a013d6d3e) by [@BingBingL](https://github.com/BingBingL)) +- Fix artifacting on RN-drawn borders with asymmetric radii ([9e6522374b](https://github.com/facebook/react-native/commit/9e6522374bc605bb1a92ff02842878ace35e9f3d) by [@jamesreggio](https://github.com/jamesreggio)) +- check isAvailable key on simulator object ([1031872784](https://github.com/facebook/react-native/commit/1031872784e9373082797e5bf5c815816af2105b) by [@antonychan](https://github.com/antonychan)) +- ios-simulator: change default iphone version ([6d09df5b72](https://github.com/facebook/react-native/commit/6d09df5b726ac951417b87a49bc345ebc9142951) by Vitor Capretz) + +### Known issues + +There are a few issues that don't have a finalized solution. In particular, when using Xcode 10 and `react-native init`, your build may fail due to third-party build steps ([#20774](https://github.com/facebook/react-native/issues/20774)). There is an open pull request which we are testing and hope to land soon ([#21458](https://github.com/facebook/react-native/pull/21458)). In the meantime, you can find a workaround here: [https://github.com/facebook/react-native/issues/20774](https://github.com/facebook/react-native/issues/20774). + +## v0.57.2 + +Thanks to everyone that contributed to the [discussion](https://github.com/react-native-community/react-native-releases/issues/45) for cherry-picking the commits that landed in this release, and the developers who submitted those commits! + +### Added: new features + +#### Android specific additions + +- Android subpixel text ([65e4e674fc](https://github.com/facebook/react-native/commit/65e4e674fca7127fd7800ae011cab449561f475b) by [@kevinresol](https://github.com/kevinresol)) + +### Changes: existing functionality that is now different + +- ReactScrollView should account for `overflow: scroll` ([201f2f189f](https://github.com/facebook/react-native/commit/201f2f189f2c41092397e5457eda83b0764ee4cd) by [@mcolotto](https://github.com/mcolotto)) +- bump metro 0.47.0 ([4750f52b34](https://github.com/facebook/react-native/commit/4750f52b34f524cae8ca08fcacec063c0725e4de) by [@rafeca](https://github.com/rafeca)) +- Use babel runtime instead of relying on global babelHelpers and regenerator ([36033bd0ed](https://github.com/facebook/react-native/commit/36033bd0edecd20fe2ae5edd56408bcc134378e7) by [@janicduplessis](https://github.com/janicduplessis)) +- React: Upgrade to react-devtools@^3.4.0 ([25119f95c8](https://github.com/facebook/react-native/commit/25119f95c81039761dd505c216c1e499003c6294) by [@yungsters](https://github.com/yungsters)) +- Change new Date() to Date.now() to save on date allocations ([bbb2d9a5b3](https://github.com/facebook/react-native/commit/bbb2d9a5b358bc0c150fe6ff74c45594c987e949) by [@dulinriley](https://github.com/dulinriley)) +- Make config object read-only ([2c1057062e](https://github.com/facebook/react-native/commit/2c1057062e81f8b43d3f942a35371fb3db841bed) by [@rafeca](https://github.com/rafeca)) +- Cleanup the transformer flow types ([28dedfb6d6](https://github.com/facebook/react-native/commit/28dedfb6d61e64a50d78aa06ee4f744665a54c2a) by [@rafeca](https://github.com/rafeca)) +- bump metro 0.47.1 ([12ab08a5aa](https://github.com/facebook/react-native/commit/12ab08a5aab3e14c9b2fb35454b16708b8ce093d) by [@rafeca](https://github.com/rafeca)) + +#### Android specific changes + +- Android ScrollView support for `overflow: visible` ([4af4da9089](https://github.com/facebook/react-native/commit/4af4da9089e20aa84bc5660bfb37763556442a4e) by [@olegbl](https://github.com/olegbl)) +- Expose a getter for overflow setting in ReactViewGroup ([02ad56f541](https://github.com/facebook/react-native/commit/02ad56f5419675572d684c3cc8a28644f29afffa) by [@kmagiera](https://github.com/kmagiera)) +- Add workaround for Android Gradle Plugin 3.2 change to asset dir ([ff084a4e80](https://github.com/facebook/react-native/commit/ff084a4e8071adb4ff6198b32aa8a7e8e29cca1c) by [@edilaic](https://github.com/edilaic)) + +### Fixed: bugs that have been resolved + +- Fix HEAD request failing with `Invalid response for blob` ([7e9c3f77cc](https://github.com/facebook/react-native/commit/7e9c3f77cce881dbb47af266993da5a2b6e98b5b) by [@anthonyhumphreys](https://github.com/anthonyhumphreys)) +- Check if child view != null before dropping ([af181fb192](https://github.com/facebook/react-native/commit/af181fb192c83e1dd0575c24e38d8814bbf187d6) by [@chrusart](https://github.com/chrusart)) + +#### Android specific fixes + +- Fix event handlers for DPad arrows on Android TV ([4d71b1525d](https://github.com/facebook/react-native/commit/4d71b1525d357a61a1740d6de5c1b97b6527f986) by [@krzysztofciombor](https://github.com/krzysztofciombor)) +- Rounded corner rendering fixed on Android N ([748cf82c97](https://github.com/facebook/react-native/commit/748cf82c974d6cf5d5df64b6e6013211c870530c) by [@dryganets](https://github.com/dryganets)) +- Android: fix cookies lost on Android 5.0 and above ([ea53727e16](https://github.com/facebook/react-native/commit/ea53727e16223d412fcbba49df79cc68b39f5d93) by chenwenyu) +- allow zero offset when shadow radius is nonzero ([97f0e43710](https://github.com/facebook/react-native/commit/97f0e43710a990c30e14d66bf67c7d612377d3f2) by Timothy Kukulski) +- Android ScrollView fix for pagingEnabled ([e0170a9445](https://github.com/facebook/react-native/commit/e0170a944501bb487e899b92363bf5aa64b29299) by [@olegbl](https://github.com/olegbl)) + +### Removed: features that have been removed; these are breaking + +- Remove global babelHelpers and regenerator ([458d56c0a1](https://github.com/facebook/react-native/commit/458d56c0a1ac73c088660830a8bf2db65de7d9a2) by [@janicduplessis](https://github.com/janicduplessis)) +- Remove overflow hidden killswitch ([59aada873e](https://github.com/facebook/react-native/commit/59aada873e13bf0b1f5e3a10cfe9a5a45c28f9fb) by [@ayc1](https://github.com/ayc1)) +- Remove absolute path parameter from transformers ([2e0d5c87e9](https://github.com/facebook/react-native/commit/2e0d5c87e93bb970ef1c8864ca44b47b36d6ae2e) by [@rafeca](https://github.com/rafeca)) + +## v0.57.1 + +We are trying, for 0.57, to approach it as a version with a longer "support", while waiting for some features to land that will allow for [0.58 to be cut](https://github.com/react-native-community/react-native-releases/issues/41). + +Thanks to everyone that contributed to the [discussion](https://github.com/react-native-community/react-native-releases/issues/34) for cherry-picking the commits that landed in this release, and the developers who submitted those commits! + +### Added: new features + +- Expose AllowFileAccess property in WebView ([0c576ef84a](https://github.com/facebook/react-native/commit/0c576ef84a1c7f79b228f205cc687ab1b945bda1) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific additions + +- Expose scrollEnabled as iOS prop for TextInput ([b9c28c236b](https://github.com/facebook/react-native/commit/b9c28c236bc971a5fbc51a3bda09c3980d547b96) by Chun Chen) + +### Changes: existing functionality that is now different + +- Give RNPM the ability to look for plugins in `@Scoped` modules ([4b106be477](https://github.com/facebook/react-native/commit/4b106be47765dd391f7a4cc6cf0e705ae977b90a) by [empyrical](https://github.com/empyrical)) +- Upgrade babel-eslint to 9.0.0 ([44dc283bcd](https://github.com/facebook/react-native/commit/44dc283bcd0a75826d9be86cdc727e32d5697ef2) by [@rafeca](https://github.com/rafeca)) +- bump metro 0.45.6 ([7bac0565e8](https://github.com/facebook/react-native/commit/7bac0565e82981d4a6e2b500d376ba9fa8aba721) by [@rafeca](https://github.com/rafeca)) + +#### iOS specific changes + +- Making RCTIsIPhoneX() return true for the R and Max models ([5e7c3ca005](https://github.com/facebook/react-native/commit/5e7c3ca0057f6084d692e30ae4db863fb20968ff) by [@shergin](https://github.com/shergin)) +- Way to register RCT_MODULE in Plugin2.0 instead of +load ([5c160e5ded](https://github.com/facebook/react-native/commit/5c160e5dedae713c686d88d4b9d4308b596e68a7) by Jeff Thomas) +- Update RCTLinkingManager.h to explicitly state the 'nullability' of parameters ([2271d1f912](https://github.com/facebook/react-native/commit/2271d1f912435eba7da2414ea4665ba8e56c7ad7) by Warren Knox) + +### Fixed: bugs that have been resolved + +- Pass the maxWorkers config param correctly to Metro ([7a69f1aa27](https://github.com/facebook/react-native/commit/7a69f1aa272a9b71755033a80f6f4aa5e9dcbaf6) by [@rafeca](https://github.com/rafeca)) +- Fix ignored --projectRoot/watchFolders arguments (([9fca769e76](https://github.com/facebook/react-native/commit/9fca769e7666df696299b422c140d6509e726ec6) by [@oblador](https://github.com/oblador)) +- Debug only code were leaking into release builds on iOS. (([d1ff0b0cc5](https://github.com/facebook/react-native/commit/d1ff0b0cc51c31cae89689b2ad2f4b35f29531d8) by [@dryganets](https://github.com/dryganets)) + +#### iOS specific fixes + +- Fix RCTNetInfo first time connection status ([e7e63fd409](https://github.com/facebook/react-native/commit/e7e63fd4092a81beec482fc48d05f1a048801037) by [@karanjthakkar](https://github.com/karanjthakkar)) + +### Removed: features that have been removed; these are breaking + +#### iOS specific removals + +- Removing development team from Xcode project ([8103c431c8](https://github.com/facebook/react-native/commit/8103c431c897c02d47cfad1e71bb2e6ddaabbdc0) by [@hramos](https://github.com/hramos)) + +## v0.57.0 + +Welcome to the 0.57 release of React Native! This release addresses a number of issues and has some exciting improvements. We again skipped a monthly release, focused on quality by extending the release candidate phase, and let some upstream packages reach stable for inclusion. + +This release includes [599 commits by 73 different contributors](https://github.com/facebook/react-native/compare/0.56-stable...0.57-stable)! In response to feedback, we've prepared a changelog that contains only user-impacting changes. Please share your input and let us know how we can make this even more useful, and as always [let us know](https://github.com/react-native-community/react-native-releases/issues/34) if you have any feedback on this process. + +### Highlights + +#### New features + +- Accessibility APIs now support accessibility hints, inverted colors, and easier usage of defining the element's role and states; read more at [@ziqichen6's excellent blog post](https://reactnative.dev/blog/2018/08/13/react-native-accessibility-updates) +- On iOS, `WKWebView` can now be used within the `WebView` component; read more at [@rsnara's awesome blog post](https://reactnative.dev/blog/2018/08/27/wkwebview) +- Better support for out-of-tree platforms. For details, please refer to [the discussion](https://github.com/react-native-community/discussions-and-proposals/issues/21) that the community used to get this up and running (there will be a new page in the docs dedicated to it too) - huge props to @empyrical for working on this! + +#### Tooling updates + +- Android tooling has been updated to match newer configuration requirements (SDK 27, gradle 4.4, and support library 27); building with Android plugin 3.2 doesn't work due to the gradle scripts, so **please** stay on Android Studio 3.1 for now +- Support Babel 7 stable landed! Be sure to read [here](https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/) about using TypeScript and check out the [Babel 7 migration guide](https://babeljs.io/docs/en/next/v7-migration) for help migrating. +- Metro has been upgraded (with Babel 7 and better transformer support), and in the next major release we plan on having two new features (ram bundles and inline requires) optional for you all to use - you can read how it will happen [here](https://github.com/react-native-community/discussions-and-proposals/blob/master/core-meetings/2018-09-metro-meeting.md); moreover, if you have a custom packager config, we recommend you read also the "updating to this version" section. +- Flow, React, and related packages have also been updated; this includes [working support](https://github.com/facebook/react-native/commit/5491c3f942430982ce9cb6140ed1733879ed3d1d) for the [React Profiler](https://react.dev/blog/2018/09/10/introducing-the-react-profiler.html). + +#### The Slimmening is happening + +As mentioned a few times in the past, the core team is reviewing the repository to trim it to the base React Native features in order to make the whole ecosystem more maintainable (by using a _divide-et-impera_ approach, the community will move faster and enable pull requests to be reviewed and merged quicker). This change requires extracting some components into their own separate repos and removing old, unused code ([details here](https://github.com/react-native-community/discussions-and-proposals/issues/6)). + +0.57 is **not** directly affected by any changes, but we want you to know that: + +- `WebView` will be moved to its own repo at [react-native-community/react-native-webview](https://github.com/react-native-community/react-native-webview). There is already a base implementation there. Help us out by giving that a try, and expect that `WebView` will be deprecated soon +- `NavigatorIOS` will be **fully** removed from the main codebase starting 0.58.0 (via [this commit](https://github.com/facebook/react-native/commit/0df92afc1caf96100013935d50bdde359b688658)); it is now deprecated + +### Updating to this version + +1. Upgrade the version of React Native in the `package.json` from `0.56.0` to `0.57.0`, and the React version to `16.5` +2. Change the babel-preset dependency from `"babel-preset-react-native": "^5",` to `"metro-react-native-babel-preset": "^0.45.0",`, then change the `.babelrc` configuration to: + + ```JSON + { + "presets": ["module:metro-react-native-babel-preset"] + } + ``` + +3. Ensure that you have all the babel dependencies to version `^7.0.0` (you may also need to add `"babel-core": "7.0.0-bridge.0"` as a yarn resolution to ensure retro-compatibility). The Babel team has released a tool, [babel-upgrade](https://github.com/babel/babel-upgrade), that should help you in this migration. +4. Upgrading android gradle version to 4.4 + 1. In your project's `android/gradle/wrapper/gradle-wrapper.properties` file, change the `distributionUrl` to `https\://services.gradle.org/distributions/gradle-4.4-all.zip` + 2. In `android/build.gradle` file add `google()` right above `jcenter()` in both `buildscript` and `allprojects` repositories. Then change Android build tools to version 3.1.4 `classpath 'com.android.tools.build:gradle:3.1.4'` + 3. In `android/app/build.gradle` file update all your `compile` statements to be `implementation`, e.g. `implementation 'com.facebook.fresco:animated-gif:1.10.0'` + 4. Do note that when running your app from within Android Studio, you may encounter `Missing Byte Code` errors. This is due to [a known issue](https://issuetracker.google.com/issues/72811718) with version 3.1.x of the android tools plugin. You'll need to disable Instant Run to get past this error. +5. If you have a custom packager configuration via `rn-cli.config.js`, you probably need to update it to work with the updated Metro configuration structure (for full detail refer to Metro's [documentation](https://facebook.github.io/metro/docs/en/configuration)); here are some commonly encountered changes to `rn-cli.config.js`: + + ```diff + -const blacklist = require('metro/src/blacklist') + +const blacklist = require('metro-config/src/defaults/blacklist') + + // ... + + module.exports = { + + watchFolders: alternateRoots, + + resolver: { + + blacklistRE: blacklist + + }, + + transformer: { + + babelTransformerPath: require.resolve('./scripts/transformer.js'), + + }, + - getProjectRoots() { + - return [ + - path.resolve(__dirname), + - ].concat(alternateRoots) + - }, + - getBlacklistRE() { + - return blacklist; + - }, + - transformModulePath: require.resolve('./scripts/transformer.js'), + } + ``` + +6. Run `yarn` to ensure that all the new dependencies have been installed + +### Added: new features + +- Add .nvmrc and ensure node version required is compatible with ESLint 5 ([30b9d81087](https://github.com/facebook/react-native/commit/30b9d81087cb86f5fb272d00bfee63a0632009f5) by [@slorber](https://github.com/slorber)) +- Major improvements to accessibility features ([48b3d1322b](https://github.com/facebook/react-native/commit/48b3d1322b884f62eb5aeb36136bcd76c502e42d), [b5b704dc19](https://github.com/facebook/react-native/commit/b5b704dc19b80a1909d66adcd617220a98c7aace), [c36e8b3307](https://github.com/facebook/react-native/commit/c36e8b3307295690cddf74e3a41ca0ac11ac4c6b), [40f6998b67](https://github.com/facebook/react-native/commit/40f6998b6766e8aa3c038a1416e5c62cbafca109), [c1d0ccde0f](https://github.com/facebook/react-native/commit/c1d0ccde0f6f8615fce077ef7ee0867a14ca0fb7), [5eaa2d29c0](https://github.com/facebook/react-native/commit/5eaa2d29c0c4c633a40f7241408737c754edea84), [10b603fdd3](https://github.com/facebook/react-native/commit/10b603fdd34919f72304720c25d1420668a6213a), [d9eeae91a0](https://github.com/facebook/react-native/commit/d9eeae91a08123c3a458704869acd6f637fc4c53), [3cfa7ae698](https://github.com/facebook/react-native/commit/3cfa7ae69847cc3b687930346016b248f2427864), [5acb7211bb](https://github.com/facebook/react-native/commit/5acb7211bb211e0ef48334630ddccbb3f0ffa2da), [5741f77156](https://github.com/facebook/react-native/commit/5741f771562962110e105114a2c65def4baa805b), [d0b86ecb4f](https://github.com/facebook/react-native/commit/d0b86ecb4f33d6b10a99062f050a4d659db4ddfc), [e739143809](https://github.com/facebook/react-native/commit/e7391438093cd5dd5033204cdce62e66509e66e1), [c27b495a89](https://github.com/facebook/react-native/commit/c27b495a89e71ff13959eb4c34605a527514fa1e), [5aa040dfb7](https://github.com/facebook/react-native/commit/5aa040dfb780c09a6efa5d3072232dea775d432f), [03036f79f7](https://github.com/facebook/react-native/commit/03036f79f7b062ae11015b33cca3dd7e4e67dda6), [3bedc78a35](https://github.com/facebook/react-native/commit/3bedc78a35b9efc259299744f4134ac0e880d1ea), [ca01290d8e](https://github.com/facebook/react-native/commit/ca01290d8e8fe73494f317ed9f81d339e65fdea0), [121e2e5ca6](https://github.com/facebook/react-native/commit/121e2e5ca6cdb17051c6d8072072f7f480ac2015), [1bc52267f5](https://github.com/facebook/react-native/commit/1bc52267f504eb02c8744c380fa2de878b0ab79f), [48b3d1322b](https://github.com/facebook/react-native/commit/48b3d1322b884f62eb5aeb36136bcd76c502e42d), [ef3d8b23c3](https://github.com/facebook/react-native/commit/ef3d8b23c35246d4e088d532c41723e06b688f1b), [ef3d8b23c3](https://github.com/facebook/react-native/commit/ef3d8b23c35246d4e088d532c41723e06b688f1b), [50e400128e](https://github.com/facebook/react-native/commit/50e400128eba554af5de4ca267430524e3eff107), and [f39d0923c7](https://github.com/facebook/react-native/commit/f39d0923c78686118a5d268c0e659d2608d28df0) by [@ziqichen6](https://github.com/ziqichen6)) +- Add `YogaNodeProperties` implementation based on `ByteBuffer` ([0c97e75dfe](https://github.com/facebook/react-native/commit/0c97e75dfeec831abb6cb39889309d8299cdce9f) and [23657ccf5b](https://github.com/facebook/react-native/commit/23657ccf5bcab6c511903660b3c617c3b8248f20) by [@davidaurelio](https://github.com/davidaurelio)) +- Add `FlatList` and `SectionList` to Animated exports ([daa7c78055](https://github.com/facebook/react-native/commit/daa7c78055857cd2d9ea650de0c4b0f72d3f2acf) by [@yunyu](https://github.com/yunyu)) +- Adding new styling props to `FlatList`/`VirtualizedList` for `ListHeaderComponent` and `ListFooterComponent` ([a2675ced4e](https://github.com/facebook/react-native/commit/a2675ced4efe0df7745bf38908efa41d4d7a9841)) +- Added more info to Module Registry systraces ([c7fdd2701f](https://github.com/facebook/react-native/commit/c7fdd2701f7edc1a771a04c890da4d742dca6ffb) by [@axe-fb](https://github.com/axe-fb)) +- Added support for out-of-tree platform plugins via a new `haste` field in `package.json`; read more in the [docs entry](https://reactnative.dev/docs/out-of-tree-platforms) ([03476a225e](https://github.com/facebook/react-native/commit/03476a225e012a0285650780430d64fc79674f0f) by [@empyrical](https://github.com/empyrical)) +- Added `snapToOffsets` to `ScrollView` and made a number of fixes to `snapToInterval` as well ([fd744dd56c](https://github.com/facebook/react-native/commit/fd744dd56ca183933a67e8398e1d20da14a31aab) by [@olegbl](https://github.com/olegbl)) + +#### Android specific additions + +- Allow registering custom packager command handlers ([b3ef1c3a56](https://github.com/facebook/react-native/commit/b3ef1c3a5645793ef42d25bb16ef023a743a1f9f) by [@fkgozali](https://github.com/fkgozali)) +- Implement `AccessibilityInfo.setAccessibilityFocus` for Android ([be715ec705](https://github.com/facebook/react-native/commit/be715ec7053a77fa6c9087990a493d17c1155de2) by [@draperunner](https://github.com/draperunner)) +- Add Support for `overflow` style property ([b81c8b51fc](https://github.com/facebook/react-native/commit/b81c8b51fc6fe3c2dece72e3fe500e175613c5d4) and [bbdc12eda7](https://github.com/facebook/react-native/commit/bbdc12eda7dec135799b7f4c41fe678180970dd2)by [@yungsters](https://github.com/yungsters)) + +#### iOS specific additions + +- `WebView` can now use `WKWebView` internally if you pass `useWebKit={true}` ([7062e5bdb5](https://github.com/facebook/react-native/commit/7062e5bdb5582bb21d1ef890965f08cc20d292b7), [1442c265da](https://github.com/facebook/react-native/commit/1442c265da36601114ce184cd5bc322f45dc1b44), [3703927e7e](https://github.com/facebook/react-native/commit/3703927e7e12ffc8922644ea251cd6f7a384570c), [7a6dd9807c](https://github.com/facebook/react-native/commit/7a6dd9807cda45c2d60641864f2d6c8d401e8ae3), [e5f95aba9b](https://github.com/facebook/react-native/commit/e5f95aba9b23376de498456282ad17113ef44cd9), [1741fe9571](https://github.com/facebook/react-native/commit/1741fe95710556f30dc2442aaaae23e31dad4cc0), [90e85a4adc](https://github.com/facebook/react-native/commit/90e85a4adc749666f81034119f281ac54840e7df), [0022354525](https://github.com/facebook/react-native/commit/0022354525eae0a368704da65c9d0f85f33ba5fb), [03b57d9db6](https://github.com/facebook/react-native/commit/03b57d9db6509fa3e715f23c8270caf6ca091acd), [1584108805](https://github.com/facebook/react-native/commit/1584108805ca6c8eff7a77e15c8553028665b53f), [a997c0ac16](https://github.com/facebook/react-native/commit/a997c0ac16d8863333d057269a8b5e28994b84eb), [4ca949b46e](https://github.com/facebook/react-native/commit/4ca949b46ec8fd72b5305daa06fac3ef58a8fa5f), [721763020a](https://github.com/facebook/react-native/commit/721763020a4a7b4b3cad1a9c074ec2e51a8d840b), [1af17f1648](https://github.com/facebook/react-native/commit/1af17f164828b6d6fa0450af46baf945745363e7), [215fa14efc](https://github.com/facebook/react-native/commit/215fa14efc2a817c7e038075163491c8d21526fd), [bacfd92976](https://github.com/facebook/react-native/commit/bacfd9297657569006bab2b1f024ad1f289b1b27), [95801f1eda](https://github.com/facebook/react-native/commit/95801f1eda2d723d9b87760d88fa9f1a1bb33ab1), [b18fddadfe](https://github.com/facebook/react-native/commit/b18fddadfeae5512690a0a059a4fa80c864f43a3), [28b058c341](https://github.com/facebook/react-native/commit/28b058c341690bd35e1d59885762ec29614a3d45), and [78fcf7c559](https://github.com/facebook/react-native/commit/78fcf7c5598ce7f5d0d62110eb34fe5a4b962e71) by [@rsnara](https://github.com/rsnara)) +- Add `accessibilityHint` for iOS ([253b29dbd8](https://github.com/facebook/react-native/commit/253b29dbd8ddb11824866e423c00a4a68bb856f3) by [@draperunner](https://github.com/draperunner)) + +### Changes: existing functionality that is now different + +- _[BREAKING]_ In the CLI, `unbundle` is now `ram-bundle` ([ebf5aeab28](https://github.com/facebook/react-native/commit/ebf5aeab280f2ebc439ec39d25c48fdf1980cf73) by [@jeanlauliac](https://github.com/jeanlauliac)) +- Bump minimum Node version to 8.3 (#20236) ([e64e13fce3](https://github.com/facebook/react-native/commit/e64e13fce394332ce609f0def35fa573f30138e9) by [@hramos](https://github.com/hramos)) +- Updated React ([70913a4623](https://github.com/facebook/react-native/commit/70913a4623c53db8a0db578eec30cad8671f8319), [b7bb25fe4c](https://github.com/facebook/react-native/commit/b7bb25fe4c1bfbedb5b8c75725721cf901dc54b0), and [672528ffde](https://github.com/facebook/react-native/commit/672528ffde3b467ccdfd6b1ce0352f150b20c922) by [@acdlite](https://github.com/acdlite), [@hramos](https://github.com/hramos), and [@yungsters](https://github.com/yungsters)) +- Upgrade Flow to v0.76.0 ([eac34e3021](https://github.com/facebook/react-native/commit/eac34e30215d88b5fe9056f9678275b894032636) by [@gabelevi](https://github.com/gabelevi)) +- Upgrade jest to 23.4.1 ([51cf9eb3e8](https://github.com/facebook/react-native/commit/51cf9eb3e823a13304570b352b81734f069c18c3) by [@rafeca](https://github.com/rafeca)) +- Upgrade babel-eslint to v9.0.0-beta.2 with better support for Flow ([abf1188de2](https://github.com/facebook/react-native/commit/abf1188de225e4b7d36ecbad316af92ca29c85c2) by [@rubennorte](https://github.com/rubennorte)) +- Upgrade ESLint to 5.1.0 ([0f2f0cad41](https://github.com/facebook/react-native/commit/0f2f0cad41f632d1dbb0c676d5edea5db62eb01c) by [@rubennorte](https://github.com/rubennorte)) +- Upgrade Babel to v7.0.0 ([b9d1c832b0](https://github.com/facebook/react-native/commit/b9d1c832b0bb7161bcec48d655e878af609b8350), [724c7498b6](https://github.com/facebook/react-native/commit/724c7498b6f10f6fd03eb217160508001fb1c5b3) by Peter van der Zee, and [bf8e1b4ffa](https://github.com/facebook/react-native/commit/bf8e1b4ffab4958587efdf3ce97e4ebdd887a20c) by [@rubennorte](https://github.com/rubennorte) and [@rafeca](https://github.com/rafeca)) +- Metro is now at v0.45.0 ([169d6839bb](https://github.com/facebook/react-native/commit/169d6839bb32d0149036ab1641d13318c0eb6f9d), [bda84a32d0](https://github.com/facebook/react-native/commit/bda84a32d08d6de3849d6afac4cbbf309837b676), [877212e18c](https://github.com/facebook/react-native/commit/877212e18c86905feda9faa1b2508c0c39396227), [169812f9ce](https://github.com/facebook/react-native/commit/169812f9ce60317dd7320384007879be16278678), [cfeb60c19b](https://github.com/facebook/react-native/commit/cfeb60c19bd23e683f1809f6535439c81e8ed166) by [@CompuIves](https://github.com/CompuIves) and [@rafeca](https://github.com/rafeca)) +- Hide pre-bundled notification when not on dev mode ([edf71005b5](https://github.com/facebook/react-native/commit/edf71005b5a4d7cfb09eae14f5765d30b9c5704e) by [@yancouto](https://github.com/yancouto)) +- Refined `StyleSheet.compose` Flow Type ([50a481d23a](https://github.com/facebook/react-native/commit/50a481d23ae72a434849d2c85007e411b0c2bb1f) by [@yungsters](https://github.com/yungsters)) +- Catch JS bundle load failure and prevent calls to JS after that ([201ba8c69d](https://github.com/facebook/react-native/commit/201ba8c69d2defc284a04acadcd13df001028ada) by [@fkgozali](https://github.com/fkgozali)) +- Use new Metro configuration in react-native cli ([a32620dc3b](https://github.com/facebook/react-native/commit/a32620dc3b7a0ebd53feeaf7794051705d80f49e) and [aaf797ad67](https://github.com/facebook/react-native/commit/aaf797ad67b965f64450b199c554c65ad8dad351) by [@CompuIves](https://github.com/CompuIves)) +- Whitelist `react-native-dom` in haste/cli config defaults ([c4bcca6685](https://github.com/facebook/react-native/commit/c4bcca66853cd231486de61f11cbcec42427b7b2) by [@vincentriemer](https://github.com/vincentriemer)) +- In the CLI, don't override `metro.config.js` settings ([c5297c75cb](https://github.com/facebook/react-native/commit/c5297c75cb6da58a241c8f91b0d2fefbc5835a46) by [@rozele](https://github.com/rozele)) + +#### Breaking Changes + +- Public methods of Image (`blur`, `focus`, `measure`, `measureInWindow`, `measureLayout`, `setNativeProps`) are no longer bound to the image component instance. Therefore, it is unsafe to pass these methods by reference (i.e: as callbacks) to functions. So, things like `setTimeout(this._imgRef.focus, 1000)` will no longer work. Please instead do: `setTimout(() => this._imgRef.focus(), 1000)`. + +#### Android specific changes + +- `Image` source without a uri now returns null ([28c7ccf785](https://github.com/facebook/react-native/commit/28c7ccf785132458fce32c234ce777a6fe475c93) by [@himabindugadupudi](https://github.com/himabindugadupudi)) +- `targetSdkVersion` is 26 ([bfb68c09ee](https://github.com/facebook/react-native/commit/bfb68c09ee88c6e1d91d3b54c01746f9a98c7c6c) by [@dulmandakh](https://github.com/dulmandakh)) +- Upgrade NDK to r17b ([6117a6c720](https://github.com/facebook/react-native/commit/6117a6c7205c969f93d39ba02e0583881572d5fa) by [@dulmandakh](https://github.com/dulmandakh)) +- Upgrade NDK toolchain to 4.9 ([ccdd450b12](https://github.com/facebook/react-native/commit/ccdd450b1284b73bee80a9709c864816cbfc1108) by [@dulmandakh](https://github.com/dulmandakh)) +- Upgrade Android Support Library to version 27.1.1 and set compileSdkVersion to 27; buildToolsVersion comes along for the ride, too ([874cca1ac2](https://github.com/facebook/react-native/commit/874cca1ac258ec224bade999722d7a34c307def0) and [044b399e65](https://github.com/facebook/react-native/commit/044b399e6590d84065a9b186750f77bc9d851aac) by [@dulmandakh](https://github.com/dulmandakh)) +- Upgrade Android gradle plugin to 3.1.4, Gradle wrapper to 4.4 ([6e356895e7](https://github.com/facebook/react-native/commit/6e356895e79fb92640295a14483af1a430732247) and [33d20da41b](https://github.com/facebook/react-native/commit/33d20da41b814a2fb9ba02cbab8b61a819cad95b) by [@gengjiawen](https://github.com/gengjiawen) and [@dulmandakh](https://github.com/dulmandakh)) +- Upgrade to soloader 0.5.1 ([b6f2aad9c0](https://github.com/facebook/react-native/commit/b6f2aad9c0119d11e52978ff3fa9c6f269f04a14) by [@gengjiawen](https://github.com/gengjiawen)) +- Upgrade mockito to 2.19.1 ([3ea803a814](https://github.com/facebook/react-native/commit/3ea803a814f43edb3ec256dd85d778c652ca99d1) by [@dulmandakh](https://github.com/dulmandakh)) +- Upgrade glog to 0.3.5 ([b5fca80605](https://github.com/facebook/react-native/commit/b5fca806059e628edb504cb1bacf62e89ee6f102) by [@dulmandakh](https://github.com/dulmandakh)) + +### Fixed: bugs that have been resolved + +- Fixed builds on Windows machines ([3ac86c366c](https://github.com/facebook/react-native/commit/3ac86c366c91f8d62f0128057019b94a783b4249) by [@rafeca](https://github.com/rafeca)) +- Fixed building tvOS ([1f1ddd0261](https://github.com/facebook/react-native/commit/1f1ddd0261762bdeff3e747250400b208b18839b)) +- Fixed `TextInputState`'s `currentlyFocusedField()` ([b4b594cec1](https://github.com/facebook/react-native/commit/b4b594cec1d91c38faac11a90a787ae692e35296) by [@janicduplessis](https://github.com/janicduplessis)) +- `` fix for jumpy content when `initialScrollIndex` specified ([e0c73633cf](https://github.com/facebook/react-native/commit/e0c73633cfc0a62df9d39991b0df65fa5875609a) by [@rbrosboel](https://github.com/rbrosboel)) +- Fix local-cli assetRegistryPath and middlewares ([f05943de0a](https://github.com/facebook/react-native/commit/f05943de0abfc16da41163c6b91a04ecc8de8e67) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix issue with when all are `flexGrow` and `flexShrink` set to 0 except for one ([90a408ea6f](https://github.com/facebook/react-native/commit/90a408ea6ff7833e33b4058f490073e04460d00b) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) +- Fix react-native CLI's debugger UI path and metro host/port arg usage ([5067540487](https://github.com/facebook/react-native/commit/50675404873c1ffac0deedc51fe745168051148b) by [@Kureev](https://github.com/Kureev)) +- Hotfix to include `react-native-windows` in hasteImpl accepted paths ([54942746d4](https://github.com/facebook/react-native/commit/54942746d4037e1153e14fcfc95e4edc772d296a) by [@rubennorte](https://github.com/rubennorte)) +- Fix some classes of incorrect Flow errors for `Animated` ([db2159d0b3](https://github.com/facebook/react-native/commit/db2159d0b3fd57556383eff68d32d32246dd9081) by [@yunyu](https://github.com/yunyu)) +- Fixed a typo in DockerTests.md ([c1831d50cf](https://github.com/facebook/react-native/commit/c1831d50cfd35b7a7393e50bc71d8389b36021ce) by [@kant](https://github.com/kant)) +- Fix invalid use of destructuring in jest preprocessor ([9d5bd50737](https://github.com/facebook/react-native/commit/9d5bd507372c7b63e59a94383c3e3091d96409de) by [@umairda](https://github.com/umairda)) +- Fixed a CLI crash when using old versions of node ([e61176d650](https://github.com/facebook/react-native/commit/e61176d650e2b5fe51dd6cd4c429ff47a1a9b1dc) by [@keksipurkki](https://github.com/keksipurkki)) + +#### Android specific fixes + +- Fix issue with AsyncStorage not behaving properly on Android 7+ ([1b09bd7fba](https://github.com/facebook/react-native/commit/1b09bd7fba92431d63d2cecb83565491e91db396)) +- Fixed extreme `` slowness ([5017b86b52](https://github.com/facebook/react-native/commit/5017b86b525e3ef6023f0f8a88e6fd1cf98024e0) by [@gnprice](https://github.com/gnprice)) +- Fixed `` placeholder not being completely visible ([84022321c4](https://github.com/facebook/react-native/commit/84022321c437e597660ecd8a773e51bdf8855f4e) and [86f24ccf71](https://github.com/facebook/react-native/commit/86f24ccf71f4c41904838c8c7e13268c300fd745) by [@jainkuniya](https://github.com/jainkuniya)) +- Fix Horizontal ``'s scroll position during layout changes with RTL content ([de573277bf](https://github.com/facebook/react-native/commit/de573277bf64703aefdeb52db2c2524b2c241bab)) +- Fix Horizontal `` overflow issue ([d5465a9a0a](https://github.com/facebook/react-native/commit/d5465a9a0a840f7e759bb8fb6679b01017eb3d05)) +- Fixing crash on SDK 15 on ReactTextInputLocalData ([1bb2bead8b](https://github.com/facebook/react-native/commit/1bb2bead8bef850037c8b72209cd72a442572821)) +- Fix Drawing Rect for ReactScrollView ([6a16bec882](https://github.com/facebook/react-native/commit/6a16bec882cba809bdf9027367b76f6543b6617d) by [@yungsters](https://github.com/yungsters)) +- Fixed NoSuchKeyException Thrown From ReadableNativeMap bysafely unwrapping ReadableMap by defaulting to 0 if key not present ([1a6666a116](https://github.com/facebook/react-native/commit/1a6666a116fd8b9e8637956de2b41a1c315dd470) by [@Bhavik-P](https://github.com/Bhavik-P)) +- Fixed runAndroid to enable the use of a package on port <> 8081 for Windows ([3cd0737fe2](https://github.com/facebook/react-native/commit/3cd0737fe2dce9df29822854bfbfaf2f22346c69) by [@ihenshaw](https://github.com/ihenshaw)) +- Don't crash on upload retry when trying to fetch on a varying quality network ([79fe925f1d](https://github.com/facebook/react-native/commit/79fe925f1daa053d5a5d92a228e5c7beff565ab4) by [@dryganets](https://github.com/dryganets)) + +#### iOS specific fixes + +- Fix `TextInput.clear()` and `TextInput.setNativeProps({text: ''})` to work ([2307ea60d0](https://github.com/facebook/react-native/commit/2307ea60d03edd234511bfe32474c453f30c1693) by [@magicien](https://github.com/magicien)) +- Correct fishhook import in RCTReconnectingWebSocket ([75a0273de2](https://github.com/facebook/react-native/commit/75a0273de21948b0b959263100f09111f738ec35)) +- Change in RCTImagePickerManager to handle crashes if height/width is nil ([82af7c989b](https://github.com/facebook/react-native/commit/82af7c989be42a516f438f162d21f699be297e79) by [@abhi06276](https://github.com/abhi06276)) +- Fix controlled `` on iOS when inputting in Chinese/Japanese ([892212bad2](https://github.com/facebook/react-native/commit/892212bad2daadd373f4be241e4cd9889b0a1005) by [@mmmulani](https://github.com/mmmulani)) +- Fixed `` bug encountered with brownfield apps ([fab5fffbb3](https://github.com/facebook/react-native/commit/fab5fffbb3eb8668c9202dec5e770330d49880b0) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Fixed missing selection indicator lines on `` ([e592d6f8c7](https://github.com/facebook/react-native/commit/e592d6f8c7b0409ab6f0a2dbf6ebe3cea28c3e79) by [@VSchlattinger](https://github.com/VSchlattinger)) +- Fix crash in RCTImagePicker on iOS ([934c50fbe0](https://github.com/facebook/react-native/commit/934c50fbe07e49391ba27c3469f99bec65e48d39) by [@mmmulani](https://github.com/mmmulani)) +- Fix `undefined_arch` error received when building in Xcode 10 beta ([e131fffb37](https://github.com/facebook/react-native/commit/e131fffb37a545363daf11735a0243165b57f63f) by [@futuun](https://github.com/futuun)) +- Add support for connecting to the Packager when running the iOS app on device when using custom Debug configuration ([079bf3f206](https://github.com/facebook/react-native/commit/079bf3f2067cb268b60e75cd9e1bc51a9c85359c)) +- Fixed RCTAnimation import for integrating with cocoapods ([eef8d47a37](https://github.com/facebook/react-native/commit/eef8d47a37211bf7d4978db75df1fedd9cacbde8) by [@LukeDurrant](https://github.com/LukeDurrant)) + +### Removed: features that have been removed; these are breaking + +- _[BREAKING]_ Removed `ScrollView.propTypes`; use flow or typescript for verifying correct prop usage instead ([5b6ff01764](https://github.com/facebook/react-native/commit/5b6ff01764502c88848867c7e04cab969da384a2) by [@sahrens](https://github.com/sahrens)) + +#### Android specific removals + +- `ReactInstancePackage` is now deprecated; use `@link ReactPackage` or `@link LazyReactPackage` ([b938cd524a](https://github.com/facebook/react-native/commit/b938cd524a20c239a5d67e4a1150cd19e00e45ba) by [@axe-fb](https://github.com/axe-fb)) + +## v0.56.0 + +Welcome to the June 2018 release of React Native! +Over 60 contributors made [821 commits](https://github.com/facebook/react-native/compare/0.55-stable...0.56-stable) since March - and we are extremely grateful to every single one of you. + +As you'll see in a second, this new version has some important **breaking changes** that required a lot of extra efforts to bring to a stable 0.56. This was the main reason behind skipping April and May from the monthly release cycle, but looking forward we are planning on going back to do a rollout every month. + +### Highlights + +#### React Native now uses **Babel 7** + +When upgrading to 0.56, make sure to bump your `babel-preset-react-native` `package.json` dependency to `5.0.2` or newer (but still as _fixed_ value). + +React Native library authors will need to update their libraries to make use of the updated Babel preset as Babel 7 is **not** backwards compatible. + +If you have issues upgrading to Babel 7, please double check the [related documentation](https://new.babeljs.io/docs/en/next/v7-migration.html#versioning-dependencies-blog-2017-12-27-nearing-the-70-releasehtml-peer-dependencies-integrations), in particular the sections related to _Package Renames_ and _Scoped Packages_. + +The [`babel-bridge`](https://github.com/babel/babel-bridge) library may be used if you need to use libraries that have not yet upgraded to Babel 7. You may also enforce the Babel 7 dependency via tools like [yarn resolutions](https://yarnpkg.com/lang/en/docs/selective-version-resolutions/). Overall, you need to ensure all the `@babel/*` deps are fixed at version `7.0.0-beta.47`. + +#### **Node 8** is now the minimum required version + +Trailing commas are now allowed. + +#### **iOS 9** is now the minimum required version + +Any device that can run iOS 8, can upgrade to iOS 9. Developers who support iOS 8 in their apps may continue doing so as this is a Xcode-level setting (`IPHONEOS_DEPLOYMENT_TARGET`). + +#### **Xcode 9** is now the minimum required version + +We recommend using Xcode 9.4 as that is what we use to run our tests. + +#### **Android** projects are now compiled using the _Android 26 SDK_ + +The target API level is left unchanged in this release. + +Starting August 2018, new apps submitted to the Play Store will need to target API 26 as a minimum. You can now opt your project in to use API 26 (or newer) as the target. Please let us know about any issues, as we'd like to finalize support for Android API 26 by the time `0.57.0` is released. + +#### `WebView` will only load http(s) URLs by default + +Geolocation is disabled by default. + +#### Consistently Throw for `` + +Removes a pitfall that people may run into when releasing an app for Android if the bulk of the testing has been performed on iOS only. Nesting a `` within a `` component (e.g. ``) is unsupported on Android, but using this pattern on iOS has not thrown errors in the past. With this release, nesting a `` inside a `` will now throw an error on iOS in order to reduce the parity gap between the platforms. + +#### Flow improvements, migrating away from PropTypes + +Added Flow types for several components. + +We're migrating away from PropTypes and runtime checks and instead relying on **Flow**. You'll notice many improvements related to Flow in this release. + +- Fix project settings warnings on newer Xcode versions, remove unnecessary console logging. +- Modernized `YellowBox`. + Sort warnings by recency, group warnings by format string, present stack traces, show status of loading source maps, support inspecting each occurrence of a warning, and bug fixes. +- Prettier files! +- Lots of bug fixes. + +#### State of React Native + +Heads-up: the Facebook internal team is [currently working on a rewrite of some core architecture pieces](https://reactnative.dev/blog/2018/06/14/state-of-react-native-2018). This is a **work in progress** and we do not expect it to be ready for use in open source quite yet, but we felt the need to let you know what those commits mentioning Fabric are about. + +--- + +### Added: new features + +- Update `babelHelpers` with Babel 7 support ([fbd1beaf66](https://github.com/facebook/react-native/commit/fbd1beaf666be9c09a380784f8c0cd34ba083a6b)) +- `FlatList` is now Strict Mode compliant ([a90d0e3614](https://github.com/facebook/react-native/commit/a90d0e3614c467c33cf85bcbe65be71903d5aecc)) +- Enable `?.` optional chaining operator plugins ([aa6f394c42](https://github.com/facebook/react-native/commit/aa6f394c4236e5a4998c3be8ed61ec1bab950775)) +- Support `flexWrap: 'wrap-reverse'` ([d69e55060f](https://github.com/facebook/react-native/commit/d69e55060fd76d91eccc45905d250a9fce4b2c49)) +- Add prop type `accessibilityTraits` to `Text` ([654435d1ed](https://github.com/facebook/react-native/commit/654435d1ed9e584e65fff601e1fa50591e042664)) +- Add devDependencies support for templates ([c4ab03a18e](https://github.com/facebook/react-native/commit/c4ab03a18e75e6ed55444b5d86f3ceee435b9a78)) +- Add support for springDamping in `SpringInterpolator` ([1dde989919](https://github.com/facebook/react-native/commit/1dde989919d2c272ca7fcaa5c4b2d9ee02c490a0)) + +#### Android specific additions + +- Add support for build.gradle with CRLF for use with `react-native link` ([843cfc3b20](https://github.com/facebook/react-native/commit/843cfc3b202433aad9a236b1b623da7c45e1ac15)) +- add decimal pad to android ([75e49a0637](https://github.com/facebook/react-native/commit/75e49a0637eaa3bd3bb7e445648f084a42d9c8af)) +- Add a way to dismiss PopupMenu elements ([353c070be9](https://github.com/facebook/react-native/commit/353c070be9e9a5528d2098db4df3f0dc02d758a9)) +- Implement `Image.defaultSource` ([b0fa3228a7](https://github.com/facebook/react-native/commit/b0fa3228a77d89d6736da6fcae5dd32f74f3052c)) +- Support Image resizeMode=repeat ([0459e4ffaa](https://github.com/facebook/react-native/commit/0459e4ffaadb161598ce1a5b14c08d49a9257c9c)) +- Yoga: Add back deprecated `getParent` methods for non-breaking API change ([c3c5c3cbce](https://github.com/facebook/react-native/commit/c3c5c3cbce24a31f73ae6339e377ee76ca6401ad)) + +#### iOS specific additions + +- Run tests using Xcode 9.4 and iOS 11.4 ([c55bcd6ea7](https://github.com/facebook/react-native/commit/c55bcd6ea729cdf57fc14a5478b7c2e3f6b2a94d)) +- Add support for Homebrew-installed Node ([0964135a17](https://github.com/facebook/react-native/commit/0964135a178b459e06b44a49a4ecb0dd6c5bec9b)) +- Add textTransform style support ([8621d4b797](https://github.com/facebook/react-native/commit/8621d4b79731e13a0c6e397abd93c193c6219000)) +- Add docs for Swift usage to `RCTBridgeModule.h` ([ca898f4367](https://github.com/facebook/react-native/commit/ca898f4367083e0943603521a41c48dec403e6c9)) + +--- + +### Changes: existing functionality that is now different + +- Upgrade React Native to Babel 7 ([f8d6b97140](https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c)) +- New projects created using `react-native init` will use Babel 7 ([e315ec9891](https://github.com/facebook/react-native/commit/e315ec9891eb0bcb51afb0e797dbd49aa8f9ac71)) +- Restrict `WebView` to only http(s) URLs: ([634e7e11e3](https://github.com/facebook/react-native/commit/634e7e11e3ad39e0b13bf20cc7722c0cfd3c3e28), [23f8f7aecb](https://github.com/facebook/react-native/commit/23f8f7aecb1f21f4f5e44fb9e4a7456ea97935c9)) +- Node 8 is now the minimum required version ([c1e6f27823](https://github.com/facebook/react-native/commit/c1e6f278237e84c8ed26d3d2eb45035f250e2d40)) +- Upgrade React to v16.4.1, sync React Renderer to revision ae14317 ([c749d951ad](https://github.com/facebook/react-native/commit/c749d951ada829c6f6fb76f35e68142e61054433)) +- Update new project template's Flow config to fix `Cannot resolve module X` isse due to removal of `@providesModule` ([843a433e87](https://github.com/facebook/react-native/commit/843a433e87b0ccaa64ab70d07e22bffbabad8045)) +- Upgrade Flow to v0.75 ([3bed272a62](https://github.com/facebook/react-native/commit/3bed272a620ac806a6142327013265ea8138641a), [bc2f12c68c](https://github.com/facebook/react-native/commit/bc2f12c68cf8cfdf8c060354e84392fd9a3645d8), [6264b6932a](https://github.com/facebook/react-native/commit/6264b6932a08e1cefd83c4536ff7839d91938730)) +- Upgrade Flow definitions ([f8b4850425](https://github.com/facebook/react-native/commit/f8b4850425f115c8a23dead7ec0716b61663aed6)) +- Upgrade Prettier to v1.13.6 ([29fb2a8e90](https://github.com/facebook/react-native/commit/29fb2a8e90fa3811f9485d4b89d9dbcfffea93a6), [bc2f12c68c](https://github.com/facebook/react-native/commit/bc2f12c68cf8cfdf8c060354e84392fd9a3645d8)) +- Upgrade Jest to v23.2.0 ([536c937269](https://github.com/facebook/react-native/commit/536c9372692712b12317e657fc3e4263ecc70164), [bc2f12c68c](https://github.com/facebook/react-native/commit/bc2f12c68cf8cfdf8c060354e84392fd9a3645d8)) +- Upgrade Metro to v0.38 ([d081f83a04](https://github.com/facebook/react-native/commit/d081f83a0487ffbc7d19f8edc7532611b359dfc6)) +- Modernized `YellowBox` ([d0219a0301](https://github.com/facebook/react-native/commit/d0219a0301e59e8b0ef75dbd786318d4b4619f4c)) +- Disallow requiring from invariant/warning ([521fb6d041](https://github.com/facebook/react-native/commit/521fb6d041167ec8a8d0e98ac606db1f27f0c5c8)) +- Remove native prop type validation ([8dc3ba0444](https://github.com/facebook/react-native/commit/8dc3ba0444c94d9bbb66295b5af885bff9b9cd34)) +- Add `$FlowFixMe` to invalid prop accesses where Flow wasn't complaining before ([f19ee28e7d](https://github.com/facebook/react-native/commit/f19ee28e7d896aaacf26c6f850230019bdef0d3d)) +- Create Flow props for `Image` ([8bac869f5d](https://github.com/facebook/react-native/commit/8bac869f5d1f2ef42e707d0ec817afc6ac98b3b2)) +- Flow type for `SegmentedControlIOS` ([113f009698](https://github.com/facebook/react-native/commit/113f009698dbd8f1b4c1048d77ff1eb373021083)) +- Flow type for `ProgressViewIOS` ([c87701ba05](https://github.com/facebook/react-native/commit/c87701ba05a8524756e87c089eb92c8f3c81823e)) +- Flow type for `PickerIOS` ([1c66cdc7e8](https://github.com/facebook/react-native/commit/1c66cdc7e8ce8190dfbef76629601497446b2b0a)) +- Flow type for `Switch` ([06052a2330](https://github.com/facebook/react-native/commit/06052a2330fc9c1dd0d56c6bbe5a17703f80c6b9)) +- Flow type for `Slider` ([cbe045a95f](https://github.com/facebook/react-native/commit/cbe045a95f1ca53d99ae521742a93299a53d6136)) +- Flow type for `RefreshControl` ([891dfc3da4](https://github.com/facebook/react-native/commit/891dfc3da4b5825097aedf73ff04e8982c00aeff)) +- Flow type for `ListView` ([4b1ecb6204](https://github.com/facebook/react-native/commit/4b1ecb62045fbb78764d1f51030f2253be705c5c)) +- Flow type for `TextInput` ([c8bcda8150](https://github.com/facebook/react-native/commit/c8bcda8150278fde07331ca6958976b2b3395688)) +- Flow type for `TouchableBounce` ([8454a36b0b](https://github.com/facebook/react-native/commit/8454a36b0bc54cb1e267bc264657cc693607da71)) +- Flow type for `TouchableOpacity` ([44743c07ad](https://github.com/facebook/react-native/commit/44743c07ad672e39668f92a801578906ec92996a)) +- Flow type for `TouchableHighlight` ([f0c18dc820](https://github.com/facebook/react-native/commit/f0c18dc820537892dcc33d5aebbf4f52cf299b95)) +- Flow type for `TouchableWithoutFeedback` ([0b79d1faa2](https://github.com/facebook/react-native/commit/0b79d1faa21eb3c29aeeba08ee0fb2ed62e6cc54)) +- Flow type for `ScrollView` ([b127662279](https://github.com/facebook/react-native/commit/b1276622791d5dbe4199bb075f473908c3e62b31)) +- Flow type for `DatePickerIOS` ([97e572ea6d](https://github.com/facebook/react-native/commit/97e572ea6d7b1fd829ca20f5d5c8ff970d88e68b)) +- Flow type for `KeyboardAvoidingView` ([188b118b60](https://github.com/facebook/react-native/commit/188b118b6075be1614c553596b85d430767f2dbc)) +- Flow type for `ActivityIndicator` ([0b71d1ddb0](https://github.com/facebook/react-native/commit/0b71d1ddb03c036ed118574c105b0af505da19fc)) +- Remove `$FlowFixMe` in `TouchableBounce` ([ffda017850](https://github.com/facebook/react-native/commit/ffda0178509ed92396f15db37a41d3d668ade4e6)) +- Remove `$FlowFixMe` in `ScrollView` ([af6e2eb02d](https://github.com/facebook/react-native/commit/af6e2eb02d3651f869b5436e68e61ef3ab3405a0)) +- Remove `$FlowFixMe` in `ListView` ([af6e2eb02d](https://github.com/facebook/react-native/commit/af6e2eb02d3651f869b5436e68e61ef3ab3405a0)) +- Remove `$FlowFixMe` in `Text` ([6042592cf4](https://github.com/facebook/react-native/commit/6042592cf46787f089e76b661376705380607207)) +- Remove `$FlowFixMe` in `RTLExample` ([206ef54aa4](https://github.com/facebook/react-native/commit/206ef54aa415e3e2bb0d48111104dfc372b97e0f)) +- Remove `$FlowFixMe` in `AppContainer` ([a956551af7](https://github.com/facebook/react-native/commit/a956551af73cf785ee4345e92e71fd5b17c5644e)) +- Remove `$FlowFixMe` in `Slider` ([1615f9d161](https://github.com/facebook/react-native/commit/1615f9d16149c7082ce0e1485aa04a6f2108f7ba)) +- `StyleSheet`: Support animated values for border dimensions ([3e3b10f404](https://github.com/facebook/react-native/commit/3e3b10f4044ada7b523d363afb614720468c217f)) +- Update `react-devtools-core` and `plist` to include security fixes reported by `npm audit` ([3a1d949906](https://github.com/facebook/react-native/commit/3a1d949906acb0c3b44d125d54d0c99305bbbb56)) +- Update `Switch` to ES6 Class ([970caa4552](https://github.com/facebook/react-native/commit/970caa4552d4ba87c1a954391535ff42b00832e7)) +- Update `Slider` to ES6 Class ([5259450c14](https://github.com/facebook/react-native/commit/5259450c143f71c65e157d6b7d3f0e1655eb7aa1)) +- Update `ActivityIndicator` to ES6 Class ([edd7acbb1e](https://github.com/facebook/react-native/commit/edd7acbb1e6fe185600a19cc1cbb38feb16c85ad)) +- Update `RefreshControl` to ES6 Class ([a35a238317](https://github.com/facebook/react-native/commit/a35a23831789030e17f766f72d307ae315be107d)) +- Update `KeyboardAvoidingView` to ES6 Class ([c017dcb0f2](https://github.com/facebook/react-native/commit/c017dcb0f2903b49b2f21cc150226aeb7f5026ee)) +- Update `DatePickerIOS` to ES6 Class ([f8c8231706](https://github.com/facebook/react-native/commit/f8c8231706492b588331354d45b833aa21434e13)) +- Update `Text` to ES6 Class ([ab92c00245](https://github.com/facebook/react-native/commit/ab92c00245c0ce717819ddb0ab8b9204d4c13c34)) +- Replace `context.isInAParentText` w/ `React.createContext` ([e1339bc183](https://github.com/facebook/react-native/commit/e1339bc18303ca5394cd0c9dc97cededb2261581)) +- Cleanup `Text` implementation ([06c05e744d](https://github.com/facebook/react-native/commit/06c05e744d8af9582bde348210f254d76dae48b9)) +- Switch `Text` to `React.forwardRef` ([e708010d18](https://github.com/facebook/react-native/commit/e708010d18f938e2d6b6424cfc9485d8e5dd2800)) +- Switch `View` to `React.forwardRef` ([3e534b9aab](https://github.com/facebook/react-native/commit/3e534b9aab5156adac67762877b2457408fe8934)) +- Update uses of `genMockFunction` and `genMockFn` to `fn` in tests ([390ded871c](https://github.com/facebook/react-native/commit/390ded871cb905d149e9c1f4a082e67a7ec7addb)) +- Make `ViewProps` exact ([65c336f38f](https://github.com/facebook/react-native/commit/65c336f38f4afd43c8b5f81745abf38bd9b8ddbf)) +- Spread `TVViewProps` into `ViewProps` instead of intersection ([bc658d3c44](https://github.com/facebook/react-native/commit/bc658d3c4405676643d952a126295dbc7fc26217)) +- Allow trailing commas ([1e2de71290](https://github.com/facebook/react-native/commit/1e2de712907e5fe0d17648f0ff5c81d4384ca85b)) +- Use `let`/`const` ([8f5ebe5952](https://github.com/facebook/react-native/commit/8f5ebe5952d0675b463137103a82f3fb0c26ae0d)) +- Refactor `MockNativeMethods` in Jest ([5d4c542c58](https://github.com/facebook/react-native/commit/5d4c542c58d84bbe05f76bf01d9efdd9d438572c)) +- Use app name from `app.json` after ejecting ([57774a4a98](https://github.com/facebook/react-native/commit/57774a4a981e2f12cfe9b029447e34f203221b18)) +- Suggest `git apply --reject` for failed upgrades ([4fbd244b9a](https://github.com/facebook/react-native/commit/4fbd244b9a6b62e0efe1b4b5a7ec3de468f020f6)) +- Moved `TouchHistoryMath` from React to React Native ([06085d3836](https://github.com/facebook/react-native/commit/06085d38366373f3135074dc14e2c9871ca4fe29)) +- Refactor `RCTInputAccessoryView` ([c136c54ff0](https://github.com/facebook/react-native/commit/c136c54ff0211e2bf149fab600cd6e295f9d19dd)) +- Don't wrap `ListEmptyComponent` in an extra view ([db061ea8c7](https://github.com/facebook/react-native/commit/db061ea8c7b78d7e9df4a450c9e7a24d9b2382b4)) +- Move `Text` PropTypes to its own file ([cd8128b2ec](https://github.com/facebook/react-native/commit/cd8128b2eccf6898cdf798a1e1be1f7a5762a0d4)) +- Mock `ReactNative.NativeComponent` native methods in Jest ([3e9a371ace](https://github.com/facebook/react-native/commit/3e9a371ace5f25b2eb7a0d30177251f8a0c10ed9)) +- Tightening types for `View` and `VirtualizedList` ([5035af80ec](https://github.com/facebook/react-native/commit/5035af80ecddb44e2a8444780f25f336b760bf32)) +- Make values optional in `ViewPropTypes` ([f1316cab6c](https://github.com/facebook/react-native/commit/f1316cab6c351852ef1da9939d4c8f0244fb8a6f)) +- propTypes are optional for native components ([dbdf43b428](https://github.com/facebook/react-native/commit/dbdf43b428da19a9eba012753904bcf33339ea9a)) +- Rename `Style` to `DangerouslyImpreciseStyle` ([4895c645ea](https://github.com/facebook/react-native/commit/4895c645ea17ff939811f3d5ec6218cd4e31c5fb)) +- _[BREAKING]_ `requireNativeComponent`'s signature has been simplified to only take extraOptions ([820673e707](https://github.com/facebook/react-native/commit/820673e7076b5906ba50e09e40fb9a32cf500c1b), [b549e364e0](https://github.com/facebook/react-native/commit/b549e364e0025e0e1b4005f04a9de2d767006da1), [28d37781c6](https://github.com/facebook/react-native/commit/28d37781c6589574de1113bd12077f6d54053ffb), [1c90a2b47b](https://github.com/facebook/react-native/commit/1c90a2b47b420a4b6aa16a55a344cc08f0eacbe3), and [1ab7d49c2d](https://github.com/facebook/react-native/commit/1ab7d49c2df5673dd214eb8a9b7fd3defb0ff857) by [@yungsters](https://github.com/yungsters)) + +#### Breaking Changes + +- Public methods of Text (`blur`, `focus`, `measure`, `measureInWindow`, `measureLayout`, `setNativeProps`) are no longer bound to the text component instance. It is therefore unsafe to pass these methods by reference (i.e: as callbacks) to functions. So, things like `setTimeout(this._txtRef.focus, 1000)` will no longer work. Please instead do: `setTimeout(() => this._txtRef.focus(), 1000)`. + +### iOS specific changes + +- _[BREAKING]_ WebViews now can only use https; do not use it for `file://` ([634e7e11e3](https://github.com/facebook/react-native/commit/634e7e11e3ad39e0b13bf20cc7722c0cfd3c3e28) by [@mmmulani](https://github.com/mmmulani)) +- iOS 9 is now the minimum required version ([f50df4f5ec](https://github.com/facebook/react-native/commit/f50df4f5eca4b4324ff18a49dcf8be3694482b51)) +- Update podspecs to target iOS 9 ([092103e752](https://github.com/facebook/react-native/commit/092103e7525e58e04346e0a1a16a67ca4f31c2e9)) +- Xcode 9.4 is now used to run tests ([c55bcd6ea7](https://github.com/facebook/react-native/commit/c55bcd6ea729cdf57fc14a5478b7c2e3f6b2a94d)) +- Prevent console logging on iOS 11.3+ within WebSocket ([8125be942b](https://github.com/facebook/react-native/commit/8125be942bd5fd8fe851bad04ae6b9bcb0af4727)) +- Expose `RCTFont` size overrides ([6611fefef7](https://github.com/facebook/react-native/commit/6611fefef7559c4cd3d1824235d263bff210d5e2)) + +### Android specific changes + +- Projects are now compiled using Android SDK 26 ([065c5b6590](https://github.com/facebook/react-native/commit/065c5b6590de18281a8c592a04240751c655c03c)) +- Use Google Maven repo in new Android projects ([6d56a234e3](https://github.com/facebook/react-native/commit/6d56a234e3cf5984335ff2713236260fac977f5f)) +- Upgrade Buck to v2018.03.26.01 ([1324e7b558](https://github.com/facebook/react-native/commit/1324e7b5580db815471172cf6dd140124bd2f11a)) +- Upgrade gradle-plugin to 2.3.3, gradle to 3.5.1, gradle-download-task to 3.4.3 ([699e5eebe8](https://github.com/facebook/react-native/commit/699e5eebe807d1ced660d2d2f39b5679d26925da)) +- Bump NDK APP_PLATFORM to android-16 ([b5dc45420a](https://github.com/facebook/react-native/commit/b5dc45420a0d3aa54d2d2075d7f14ff1835df78a)) +- Bump glog to 0.3.5 (added libc++ support) ([b5fca80605](https://github.com/facebook/react-native/commit/b5fca806059e628edb504cb1bacf62e89ee6f102)) +- `ReactFragmentActivity` deprecated as it's not necessary when targeting API level 14 and above ([77a02c0d83](https://github.com/facebook/react-native/commit/77a02c0d83dbfcd9a5397cf63e1ab2e6c94cfdde)) +- Touchables now play a sound on press ([722f88ca90](https://github.com/facebook/react-native/commit/722f88ca9058c5d902c416b826a7a7ab347326b8)) +- Default `underlineColorAndroid` to transparent ([a3a98eb1c7](https://github.com/facebook/react-native/commit/a3a98eb1c7fa0054a236d45421393874ce8ce558)) +- Disable `WebView` geolocation by default ([23d61b35fb](https://github.com/facebook/react-native/commit/23d61b35fb6fdbfb84f77b6d99ff155a0ff868e6)) +- Ensure cookies with illegal characters are not sent to okhttp ([04028bf216](https://github.com/facebook/react-native/commit/04028bf2169b01f79bd86ecd6b0d8aa5f99599f1)) +- Update app icons to match recent Android releases ([94393f8652](https://github.com/facebook/react-native/commit/94393f8652c414806fc861c214ad36e9ac1b6114)) +- Better error messages for `ReadableNativeMap` ([30d06b4286](https://github.com/facebook/react-native/commit/30d06b42862fc5e8704e109db652d62f86f8eabc)) +- Update Fresco to v1.9.0, okhttp3 to v3.10.0 ([6b07602915](https://github.com/facebook/react-native/commit/6b07602915157f54c39adbf0f9746ac056ad2d13)) +- Add tint color to inline icons ([e8e2a6e410](https://github.com/facebook/react-native/commit/e8e2a6e4102c1ba0ee3d068769e47fa61c160524)) +- Fix antialiasing rounded background ([e4f88c66e3](https://github.com/facebook/react-native/commit/e4f88c66e300505d3c86329dacd84d84e8109837)) +- `react-native link` will now replace '/' by '\_' when linking projects. If you previously linked scoped packages, they will get linked again. ([dbd47592a1](https://github.com/facebook/react-native/commit/dbd47592a18ed09ee6e94c79bed16d63be625af6)) +- New project template now uses project-wide properties ([0a3055d98a](https://github.com/facebook/react-native/commit/0a3055d98a36e49746144e883edc7e20afec4fcb)) + +--- + +### Fixed: bugs that have been resolved + +- `VirtualizedList` now accounts for `ListHeaderComponent` length when calculating offset ([604bcfa4a8](https://github.com/facebook/react-native/commit/604bcfa4a83396c402ba8beaa13f40d05d6e9f5c)) +- Prevent showing a hidden status bar when opening modals ([076b1cea35](https://github.com/facebook/react-native/commit/076b1cea3563cae30e11d63cc100ceaed9082692)) +- Fix crash when reloading while Perf Monitor is enabled ([4fcd9970bd](https://github.com/facebook/react-native/commit/4fcd9970bd2dfb24890bc87e9c82e16dab71ec09)) +- Fixed concurrency issue in remote debugger ([578b0b2a51](https://github.com/facebook/react-native/commit/578b0b2a51fc0c2aba5d27cdd5335396d5351463)) +- Fix `Modal` + `FlatList` scrolling ([45b0907f61](https://github.com/facebook/react-native/commit/45b0907f619f455825f459838615a5a7cc59a204)) +- Fix bug in `RCTNetworking` where not all tasks/handlers were being cleared during invalidation ([b805172034](https://github.com/facebook/react-native/commit/b8051720344f3716e964eaf7cfdd2a91dc703602)) +- Fix keyboard handling with `keyboardShouldPersistTaps: never` ([ffe6c110f7](https://github.com/facebook/react-native/commit/ffe6c110f7ce33460fe0399ccbda16a6adbe90ca)) +- Fix Responder Logic in `Text` ([e2ce22b823](https://github.com/facebook/react-native/commit/e2ce22b823661a7dcf6b70a825921a2910383bd1)) +- Fix `VirtualizedSectionList` lint warnings ([26a1eba1ce](https://github.com/facebook/react-native/commit/26a1eba1cef853b0dab7aad5731699c06d36b781)) +- Fix `VirtualizedSectionList:ItemWithSeparators` ([488a4c7e1c](https://github.com/facebook/react-native/commit/488a4c7e1c86ac5900ff9194106511fbf5a8e3cb)) +- Fix `TextInput`'s initial layout measurements ([c6b4f9f2ce](https://github.com/facebook/react-native/commit/c6b4f9f2ce59bc757d9e211f46294faa03df55c6)) +- Fix `requireNativeComponent` check ([1c90a2b47b](https://github.com/facebook/react-native/commit/1c90a2b47b420a4b6aa16a55a344cc08f0eacbe3)) +- Fix `TextInput` autocapitalization bug ([ff70ecf868](https://github.com/facebook/react-native/commit/ff70ecf868cf12fc66b45dc1496391d0a1e9011f)) +- Add missing events to `ViewPropTypes` ([41a940392c](https://github.com/facebook/react-native/commit/41a940392cea497bc5eb627b24083d0211d1eb89)) +- Add missing Jest mock in `StatusBarManager` ([4a2c560768](https://github.com/facebook/react-native/commit/4a2c560768abb2d8407900fdb2fbe4971ae00a1c)) +- Add Flow declaration for Metro module ([1853e15190](https://github.com/facebook/react-native/commit/1853e1519030caaeeb7f31017d98823aa5696daf)) +- Fix type for `ReactNative.NativeComponent` (1/2) ([de11ba2a5e](https://github.com/facebook/react-native/commit/de11ba2a5ee90929dbc67d914de59bdd2ebc29ca)) +- Fix type for `ReactNative.NativeComponent` (2/2) ([752863629d](https://github.com/facebook/react-native/commit/752863629d63bca6d96a101bfeccc4e7ad3e953e)) +- Move Image PropTypes to new file ([67656991b3](https://github.com/facebook/react-native/commit/67656991b32075e8b4a99c6409b0a131206c6941)) +- Tests: Fix JUnit report location when running Jest ([85fc98d437](https://github.com/facebook/react-native/commit/85fc98d437c08cdec883a73161e120478737ba72)) +- Tests: Fix ReactImagePropertyTest SoLoader failures (#19607) ([a52d84d7e1](https://github.com/facebook/react-native/commit/a52d84d7e1cdb287f2877c4d85f2e9866c248d43)) +- Tests: Fix jest snapshot testing on Windows ([216bce3163](https://github.com/facebook/react-native/commit/216bce31632480ce70cc03b1b2a57ec12440afd7)) +- Fixes "Cannot resolve module" errors in new `react-native init` projects ([843a433e87](https://github.com/facebook/react-native/commit/843a433e87b0ccaa64ab70d07e22bffbabad8045)) +- Haste hotfix for `react-native-windows` ([54942746d4](https://github.com/facebook/react-native/commit/54942746d4037e1153e14fcfc95e4edc772d296a)) + +#### iOS specific fixes + +- Fix undefined_arch error in Xcode 10 beta - e131fff +- Make `react-native run-ios` command play nicely with multiple Xcode versions ([a130239257](https://github.com/facebook/react-native/commit/a1302392577789faab79dad0cb39b147464e0e42)) +- Correct fishhook import ([75a0273de2](https://github.com/facebook/react-native/commit/75a0273de21948b0b959263100f09111f738ec35)) +- Fix bug where a Backspace event was emitted when entering characters after clearing a text in `TextInput` by an empty string ([1ffb2b63be](https://github.com/facebook/react-native/commit/1ffb2b63be4c4af331fece0b4286e5c92b1e575d)) +- Expose `InputAccessoryView` so it can be imported ([80fc415cf1](https://github.com/facebook/react-native/commit/80fc415cf179ffe26d020bc8d6e4451352da94fd)) +- Fix `InputAccessoryView` safe area conformance ([490f22ae72](https://github.com/facebook/react-native/commit/490f22ae72ba43fa9364ce0f6c238744c07ac830)) +- Fix use of C++ syntax in header file ([bfcfe7961d](https://github.com/facebook/react-native/commit/bfcfe7961db0970e2575eafe2f3c9c668bd8940d)) +- Fix install step when running `run-ios` ([0934c1778f](https://github.com/facebook/react-native/commit/0934c1778f0e3c0b691e1a3ca2df1d486eb905dd)) +- Fix `run-ios` not turning on Simulator ([9736ddc061](https://github.com/facebook/react-native/commit/9736ddc061e9c4291df8a3185c7f9d6f73e435c7)) +- Use correct library reference for Fishhook. This fixes the build for the new Xcode build system, on both Xcode 9 and Xcode 10 ([a8b74576da](https://github.com/facebook/react-native/commit/a8b74576da6f1a42fde4e39f97e88c8f45a3a51d)) +- Add missing `onChange` event definition to `DatePickerIOS` ([3b53091869](https://github.com/facebook/react-native/commit/3b53091869b673ea33a4af34242e2227ca944768)) +- Fix crash during Archive phase on Xcode 9.3 ([344c205070](https://github.com/facebook/react-native/commit/344c205070d5ad670c97984dd86ec9ac13c73f81)) +- `RNTesterPods`: Add missing folly include ([128c9343c4](https://github.com/facebook/react-native/commit/128c9343c464f3e7898d6e245f135f8bdf6caa6a)) +- `RNTesterPods`: folly::Optional's `has_value()` to `hasValue()` until folly is upgraded ([128c9343c4](https://github.com/facebook/react-native/commit/128c9343c464f3e7898d6e245f135f8bdf6caa6a)) +- `RNTesterPods`: Fix import for `RCTTestAttributes.h` ([128c9343c4](https://github.com/facebook/react-native/commit/128c9343c464f3e7898d6e245f135f8bdf6caa6a)) +- `RNTesterPods`: Fix `conversions.h` to use namespaced includes ([128c9343c4](https://github.com/facebook/react-native/commit/128c9343c464f3e7898d6e245f135f8bdf6caa6a)) +- Fix or mark enum conversions surfaced by `-Wenum-conversion` ([b8f30db0ae](https://github.com/facebook/react-native/commit/b8f30db0ae21d5f96547702abbf50aefa93b1094)) +- Fix CocoaPods integration without DevSupport subspec ([c09d509c2b](https://github.com/facebook/react-native/commit/c09d509c2b8a5a02701829e1f0ace8081ce64277)) +- Update Yoga to handle being in a Xcode framework project ([cf036dbc7a](https://github.com/facebook/react-native/commit/cf036dbc7af16a8453c115372694dc51e8086fcf)) +- Fix Blob memory leak ([122b3791ed](https://github.com/facebook/react-native/commit/122b3791ede095345f44666691aa9ce5aa7f725a)) +- Avoid double reload event when reloading JS ([7b9b1559a7](https://github.com/facebook/react-native/commit/7b9b1559a7f6719c3c9ad8e894fcdd99ed109afe)) +- Suppress spurious warning about RCTCxxModule ([569061dd83](https://github.com/facebook/react-native/commit/569061dd8384a86cd27719b8b068360d8379f4c3)) + +#### Android specific fixes + +- Fix extreme `TextInput` slowness on Android ([5017b86b52](https://github.com/facebook/react-native/commit/5017b86b525e3ef6023f0f8a88e6fd1cf98024e0)) +- Correct draw path dimensions while doing even border, fixes blurred borders ([c5ca26a0e5](https://github.com/facebook/react-native/commit/c5ca26a0e5c0660196300ee34d6007c63879611f)) +- Don't pass additional arguments to `requireNativeComponent` in `.android.js` files ([a51e8b19cc](https://github.com/facebook/react-native/commit/a51e8b19cc4dc36dee42ac95278b883c06b2e40f)) +- Prevent `RefreshControl` from getting stuck when a parent is scrolled horizontally ([33ffa79a51](https://github.com/facebook/react-native/commit/33ffa79a51d4db9ba69148861f2da304646175cd)) +- Prevent crash due to unsupported ellipsize mode ([85e33aaf90](https://github.com/facebook/react-native/commit/85e33aaf908996e99220bff4a2bdbbdf7c0d12b0)) +- Fix okhttp3 response handling in `DevServerHelper` ([56d48bd9ec](https://github.com/facebook/react-native/commit/56d48bd9ecd2d0f08625259121312531064a09f2)) +- Fix `ReactInstanceManager` unmountApplication to support `ReactRootView` recycling ([4a9b2a7302](https://github.com/facebook/react-native/commit/4a9b2a73021fb547febe1fa193c3effb7ff8da4e)) +- Fix `NullPointerException` when emitting event using `UIManagerModule` ([291c01f4ff](https://github.com/facebook/react-native/commit/291c01f4ffe614760852e36b05d78b42cb4271df)) +- Fix link to Android build guide ([57e7556b8d](https://github.com/facebook/react-native/commit/57e7556b8db61e5fcc3ccea56c1b163b82a091a6)) +- Fix Android open source test failures ([3e0ebc7663](https://github.com/facebook/react-native/commit/3e0ebc76632238f21c60caa92c7a2b5ee8102b71)) +- Fix view indices with LayoutAnimation ([05b75b9ebf](https://github.com/facebook/react-native/commit/05b75b9ebfa3ce6d67b2a3aee446ff0cd515311b)) +- Fix originalNode memory leak ([8102e35271](https://github.com/facebook/react-native/commit/8102e35271ab68e0525a9c60d86a855bbeef9c1a)) +- Fix `ScrollView` with a `TextInput` ([2f1421dec7](https://github.com/facebook/react-native/commit/2f1421dec7cd3a35779caceac108e872033c7d72)) +- Disable onKeyPRess logic when handler not defined ([41975f75d9](https://github.com/facebook/react-native/commit/41975f75d96ef4b606b4618461bf24d5db063b77)) +- fix permission requests on pre-M android ([4e1abdd74d](https://github.com/facebook/react-native/commit/4e1abdd74dc4127a86d62e7750d01d39bb781c08)) + +--- + +### Removed: features that have been removed; these are breaking + +- Deprecate `focusTextInput` and `blurTextInput` ([ce3b7b8204](https://github.com/facebook/react-native/commit/ce3b7b8204dad0fd62a76a0ce66472eca4b25bc8)) +- _[BREAKING]_ `ImageResizeMode` on `Image` is no longer exposed; check your usage of `resizeMode`; the same resize modes exist, but pass them as strings instead ([870775ee73](https://github.com/facebook/react-native/commit/870775ee738e9405c6545500f9a637df9b513a02) by [@TheSavior](https://github.com/TheSavior)) + +#### Android specific removals + +- Remove native extensions ([7c5845a5a2](https://github.com/facebook/react-native/commit/7c5845a5a26592598c9380df078766a680a23f06)) +- Remove Fresco ProGuard rules ([07df36557c](https://github.com/facebook/react-native/commit/07df36557c8cbbaee5e870460162aa725a606ff4)) + +#### iOS specific removals + +- Disallow nesting of `` within `` (e.g. ``) ([6a1b41643a](https://github.com/facebook/react-native/commit/6a1b41643a5f5035c61a96263220d11d3462e8f2) +- Removed deprecated `UIActionSheetDelegate` methods ([5863b564f8](https://github.com/facebook/react-native/commit/5863b564f84b9fe97b256f8cde0f7f2e1db9b641)) + +--- + +### Known issues + +During the RC testing of this version, a few issues that have been opened don't have yet a finalized solution ( [19827](https://github.com/facebook/react-native/issues/19827), [19763](https://github.com/facebook/react-native/issues/19763), [19859](https://github.com/facebook/react-native/issues/19859), [19955](https://github.com/facebook/react-native/issues/19955) ). We are aware of them and we hope that by releasing 0.56.0 the surface of developers interacting to find solutions to them will allow for faster resolution and an even better 0.56.1 release. So please check the already opened issues before submitting new ones. + +If you are using Windows to develop React Native apps, we suggest you keep an eye on [this issue in particular](https://github.com/facebook/react-native/issues/19953) since there have been many reports of issues related to Win 10 and RN 0.56. + +## v0.55.0 + +Welcome to the March 2018 release of React Native ! Over 81 contributors made 247 commits since February. Thanks for another exciting release. + +Here are a few highlights: + +- React Native is now using the MIT license +- Android TV device support + +[![RNAndroidTVDemo](http://img.youtube.com/vi/EzIQErHhY20/0.jpg)](http://www.youtube.com/watch?v=EzIQErHhY20) + +- Animated tracking with native driver - check out the [silky smooth framerate](https://t.co/dE1KST1i3g) +- Lots of Flow improvements +- Bugfixes + +### Added: new features + +- Added support for animated tracking to native driver. Now you can use `useNativeDriver` flag with animations that track other `Animated.Values` ([b48f7e5605](https://github.com/facebook/react-native/commit/b48f7e560545d53db7c906ced51a91c4cce6ee94) by [@kmagiera](https://github.com/kmagiera)) +- There's a new UTFSequence module in the library for common Unicode sequences (Emoji!) ([54870e0c6c](https://github.com/facebook/react-native/commit/54870e0c6ca8611fed775e5ba12a0d6d9b1cdbd7) and [4761d5a83e](https://github.com/facebook/react-native/commit/4761d5a83e707e0ed651f02a9e02fc5d66b1869a) by [@sahrens](https://github.com/sahrens)) +- Added `contextMenuHidden` property for **TextInput** ([2dd2529b3a](https://github.com/facebook/react-native/commit/2dd2529b3ab3ace39136a6e24c09f80ae421a17e) by [@amhinson](https://github.com/amhinson)) +- Add `testOnly_pressed` to **TouchableHighlight** for snapshot tests ([3756d41de1](https://github.com/facebook/react-native/commit/3756d41de1feb167482f01b26f9a5f2563ef8bff) by [@sahrens](https://github.com/sahrens)) + +#### Android specific additions + +- Added support for Android TV devices ([b7bb2e5745](https://github.com/facebook/react-native/commit/b7bb2e5745f2bdbfeeccef8d97d469730942e01c) by [@krzysztofciombor](https://github.com/krzysztofciombor)) +- Implemented style `letterSpacing` for **Text** and **TextInput** ([5898817fc1](https://github.com/facebook/react-native/commit/5898817fc1a66bd317d65ce96520159df2f96045) by [@motiz88](https://github.com/motiz88)) +- Bundle download progress is now shown [d06e143420](https://github.com/facebook/react-native/commit/d06e143420462344ea6fc21c0446db972f747404) by [@janicduplessis](https://github.com/janicduplessis)) +- **AndroidInfoModule** now also returns Android ID ([216c8ec04b](https://github.com/facebook/react-native/commit/216c8ec04b22704f722ecaac4718157af4434a0c) by [@L33tcodex0r](https://github.com/L33tcodex0r)) + +#### iOS specific additions + +- Introducing **InputAccessoryView**, "a component which enables customization of the keyboard input accessory view" ([38197c8230](https://github.com/facebook/react-native/commit/38197c8230657d567170cdaf8ff4bbb4aee732b8), [84ef7bc372](https://github.com/facebook/react-native/commit/84ef7bc372ad870127b3e1fb8c13399fe09ecd4d), and [6d9fe455dc](https://github.com/facebook/react-native/commit/6d9fe455dc815cdce86c00f81c71c9ca0c724964) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- `base-line` metric exposure for **Text** and **TextInput** ([51b3529f6c](https://github.com/facebook/react-native/commit/51b3529f6c2ca354800c0cf6ecb8eb3115eaa36e), [0dbe18375e](https://github.com/facebook/react-native/commit/0dbe18375ebb712be8bebd3b6592170f90f8b7bc), and [7630a614e4](https://github.com/facebook/react-native/commit/7630a614e4bd56c1a3ac728e1dfafd114340f2b7) by [@shergin](https://github.com/shergin)) +- **DatePickerIOS** now has `initialDate` prop ([446ce49e9b](https://github.com/facebook/react-native/commit/446ce49e9b097d2a5e95b0f17aa23756733c27ec)) +- Expose version via `RCTVersion.h`'s `RCTGetReactNativeVersion()` ([30469ed001](https://github.com/facebook/react-native/commit/30469ed00170a74743d2ba5aadce61aae742715c) by [@LeoNatan](https://github.com/LeoNatan)) +- Allow running multiple simulators simultaneously with `react-native run-ios --simulator ...` ([2ad34075f1](https://github.com/facebook/react-native/commit/2ad34075f1d048bebb08ef30799ac0d081073150) by [@koenpunt](https://github.com/koenpunt)) +- Introduced **RCTSurfaceHostingProxyRootView** for migration to **RCTSurfaceHostingView** ([34b8876ac6](https://github.com/facebook/react-native/commit/34b8876ac6510398e03a03c94f4ffb9aaa7519d3) by [@fkgozali](https://github.com/fkgozali)) +- New UIManager API allowing intercept/delay mounting process ([402ae2f01f](https://github.com/facebook/react-native/commit/402ae2f01fd91051be5b717b0578e18b863854af) and [b90c1cf6c3](https://github.com/facebook/react-native/commit/b90c1cf6c30454859579278be18ac650c66f516b) by [@shergin](https://github.com/shergin)) + +### Changes: existing functionality that is now different + +- React Native has now adopted the MIT license ([1490ab12ef](https://github.com/facebook/react-native/commit/1490ab12ef156bf3201882eeabfcac18a1210352) and [26684cf3ad](https://github.com/facebook/react-native/commit/26684cf3adf4094eb6c405d345a75bf8c7c0bf88) by [@sophiebits](https://github.com/sophiebits)) +- The HelloWorld template now exclude `*.jsbundle` files from Git ([21231084db](https://github.com/facebook/react-native/commit/21231084dbccc8abe7823d4444a7e772c08e3e72) by [@aneophyte](https://github.com/aneophyte)) +- `react-native-git-upgrade` now shows files merged with conflicts in red ([e53a8f7097](https://github.com/facebook/react-native/commit/e53a8f7097965f38d87eade1407661bc63adc68e) by [@alvinthen](https://github.com/alvinthen)) +- `ResolvedAssetSource` type to have all read-only members ([4d0ee37293](https://github.com/facebook/react-native/commit/4d0ee37293b5e21fc3c7a8c6edd72c9ff899df7d) by [@sahrens](https://github.com/sahrens)) +- Flow types improvements ([b6c7e551a9](https://github.com/facebook/react-native/commit/b6c7e551a91c406884cbbe8ee37c0038a1b7f0be), [b98bf1e097](https://github.com/facebook/react-native/commit/b98bf1e09739860d82e37225f1635bba3bc817b3), [80c18395e2](https://github.com/facebook/react-native/commit/80c18395e24760cd12b69592a10037f071255437), [70a3ececc3](https://github.com/facebook/react-native/commit/70a3ececc368a8d0fe4b57b13ac956ad99a637c7), [f7343576fc](https://github.com/facebook/react-native/commit/f7343576fc2ca941b03145d9e97208bcbc8c345b), [a817c64043](https://github.com/facebook/react-native/commit/a817c6404338b7b15aaeac5693ae3635a0a3dde0), [3fd82d3c89](https://github.com/facebook/react-native/commit/3fd82d3c89f2d7e5103b024b54250f2ded970d88), [cd8128b2ec](https://github.com/facebook/react-native/commit/cd8128b2eccf6898cdf798a1e1be1f7a5762a0d4), [5035af80ec](https://github.com/facebook/react-native/commit/5035af80ecddb44e2a8444780f25f336b760bf32), [26734a8473](https://github.com/facebook/react-native/commit/26734a8473ac2f5715f2b7a016f0cc8a15c6f073), [321ba067a8](https://github.com/facebook/react-native/commit/321ba067a8323c80262e51c94a931199d5ff5cd7), [b6b80f6a70](https://github.com/facebook/react-native/commit/b6b80f6a70c6d790c52b58453fefc2cea6cd06fe), [f1316cab6c](https://github.com/facebook/react-native/commit/f1316cab6c351852ef1da9939d4c8f0244fb8a6f), [2520c645f8](https://github.com/facebook/react-native/commit/2520c645f863c299e8dccb844bac3dc6a9d553e0), [214da52fe7](https://github.com/facebook/react-native/commit/214da52fe76c1688d0c1a402b3e6c4d0fc19d882), [dbdf43b428](https://github.com/facebook/react-native/commit/dbdf43b428da19a9eba012753904bcf33339ea9a), [49396aa78d](https://github.com/facebook/react-native/commit/49396aa78d218625c1933fa864acd70853faa9f9), [4895c645ea](https://github.com/facebook/react-native/commit/4895c645ea17ff939811f3d5ec6218cd4e31c5fb), [a3c07c95ef](https://github.com/facebook/react-native/commit/a3c07c95effd891c2bd5f3257efe5b24d85862be), [49ffc9fada](https://github.com/facebook/react-native/commit/49ffc9fada4266c3ba9751c5e8e4c475174c7e6c), and [c129457d3a](https://github.com/facebook/react-native/commit/c129457d3a6622d7c28e8b27829ffc2b0a03c5eb) by [@TheSavior](https://github.com/TheSavior), [@yungsters](https://github.com/yungsters), and [@alex288ms](https://github.com/alex288ms)) +- Better enable cross-platform support of WebSocket.js ([b9be28915c](https://github.com/facebook/react-native/commit/b9be28915cf323eb36f1d7c77821cdf994954074) by [@rozele](https://github.com/rozele)) +- Better error handling in the CLI around making directories ([d2817f48a1](https://github.com/facebook/react-native/commit/d2817f48a1146b469d544ee78015251551d358c3) by [@BridgeAR](https://github.com/BridgeAR)) +- Verify that the component passed to createAnimatedComponent is not functional ([10b642a7af](https://github.com/facebook/react-native/commit/10b642a7af097bd508dab7b5d4723ccb4339d35f) by [@janicduplessis](https://github.com/janicduplessis)) +- Don't truncate in the middle of an emoji ([9c8c597000](https://github.com/facebook/react-native/commit/9c8c5970002d048e8b18088f7c63b39431def50b) by [@Vince0613](https://github.com/Vince0613)) +- Loosen Platform check to allow better code sharing for out-of-tree platforms ([84affbd6a3](https://github.com/facebook/react-native/commit/84affbd6a371dd865a3550b1fde1ebabee921341)) +- In CLI, fix issue with `isInstalled` check for Android and references to unregister ([ec884890b1](https://github.com/facebook/react-native/commit/ec884890b1f40da42e84202e082b4cef2506bbfc) by [@rozele](https://github.com/rozele)) + +#### iOS specific changes + +- tvOS `onPress` magnification animation now works via the `tvParallaxProperties` prop object taking `pressMagnification`, `pressDuration`, and `pressDelay` ([6c353fd7e9](https://github.com/facebook/react-native/commit/6c353fd7e9fd324717951ad62754d817537d7339) by [@JulienKode](https://github.com/JulienKode)) + +### Fixed: bugs that have been resolved + +- In **TouchableOpacity**, trigger animation on `opacity` upon change in `disabled` prop ([9366ce416f](https://github.com/facebook/react-native/commit/9366ce416fbf015e4795987d39a65199b1b335c2) by [@maxkomarychev](https://github.com/maxkomarychev)) +- Fixed an issue encountered when using `react-native-vector-icons` ([a759a44358](https://github.com/facebook/react-native/commit/a759a44358711180b37cf4ad25f28af47e3de298) and [54dc11a5fb](https://github.com/facebook/react-native/commit/54dc11a5fbafaccc9c0a781f1151225909717597) by [@jeanlauliac](https://github.com/jeanlauliac) and [@t4deu](https://github.com/t4deu))) +- Add missing mock for Jest for `removeEventListener` method ([59c7b2cfac](https://github.com/facebook/react-native/commit/59c7b2cfac534a79ff2461af5fd2034b280812a3) by [@MoOx](https://github.com/MoOx)) +- Fix main size calculation from the aspect ratio ([f751c3460e](https://github.com/facebook/react-native/commit/f751c3460e5dc48c1f1a2d72a56173285899de21)) +- Fix crash in Subscribable due to uglify-es ([b57a78c3de](https://github.com/facebook/react-native/commit/b57a78c3def50eda11e57542be0e5233a62d173b) by [@iMagdy](https://github.com/iMagdy)) +- Update `node-notifier` dependency to fix memory leak ([860fcd458a](https://github.com/facebook/react-native/commit/860fcd458a1873ebcf977be01670be5912ae7104) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Fix issues with pollParams and link ([ca8ce83cc3](https://github.com/facebook/react-native/commit/ca8ce83cc3c38751604afce5a3e2f0473d9cba91) by [@grabbou](https://github.com/grabbou)) + +#### iOS specific fixes + +- DevLoadingView now supports the iPhone X screen shape ([47b36d3ff0](https://github.com/facebook/react-native/commit/47b36d3ff0dbb99fd3fc98f6e981a38084dd4d2c) by [@mrtnrst](https://github.com/mrtnrst)) +- Added bounds check to prevent ScrollView from scrolling to an offset which is out of bounds of the ScrollView ([16c9e5b715](https://github.com/facebook/react-native/commit/16c9e5b71500135a631480035af6cd2de3dafdc9) by [@siddhantsoni](https://github.com/siddhantsoni)) +- **NetInfo** `isConnected` works again ([dbafc29e60](https://github.com/facebook/react-native/commit/dbafc29e60aba1d5b24c2b0d321834c40e0b9bca) by [@alburdette619](https://github.com/alburdette619)) +- In **AlertIOS**, fix duplicate var name declaration ([6893a26bfb](https://github.com/facebook/react-native/commit/6893a26bfb06a2d8ad9d23a572f4d9143305d905)) +- Permit `react-native run-ios --device [id]` by passing port when running on device ([f8fee0a631](https://github.com/facebook/react-native/commit/f8fee0a631d77313d7cb5e65a3dd04a5a8ba3d03) by [@jozan](https://github.com/jozan)) +- Fixed issue with `run-ios` where `Entry, ":CFBundleIdentifier", Does Not Exist` was being received ([5447ca6707](https://github.com/facebook/react-native/commit/5447ca67076a110e2b0df03b014f53d1df4646ab) by [@blackneck](https://github.com/blackneck)) +- Fixed problem in Text measurement on iOS ([a534672e13](https://github.com/facebook/react-native/commit/a534672e132136e7bbd17c94a7f4e67149bcc67a) by [@shergin](https://github.com/shergin)) +- Fix crash when reloading in tvOS ([3a3d884df2](https://github.com/facebook/react-native/commit/3a3d884df253dbc1c02ffef33e99c4a91ea8751b) by [@dlowder-salesforce](https://github.com/dlowder-salesforce)) +- Fixed a bug with positioning of nested views inside **Text** ([7d20de412b](https://github.com/facebook/react-native/commit/7d20de412b37a35951e615d98509573dc1a24bcb) by [@shergin](https://github.com/shergin)) +- Fix blob response parsing for empty body ([f5207ba9c7](https://github.com/facebook/react-native/commit/f5207ba9c764f33ef83fa897f6014d67193be0e2) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix tvOS react-native init release build ([3002c4eb98](https://github.com/facebook/react-native/commit/3002c4eb981d439f0ea304556d8dbd4ffd62a80b) by [@dlowder-salesforce](https://github.com/dlowder-salesforce) +- Fix RedBox from bridge reload due is not re-registering its root view ([2e51fa5f5d](https://github.com/facebook/react-native/commit/2e51fa5f5d4f229329ae457ab1a77ba5bcea0448) by [@fkgozali](https://github.com/fkgozali)) + +#### Android specific fixes + +- Fix: incorrect line-height calculation ([74e54cbcc4](https://github.com/facebook/react-native/commit/74e54cbcc408a8bbdd70f47cc8728d30cdc0d299) by [@strindhaug](https://github.com/strindhaug)) +- Fix crashes with TextInput introduced in 0.53 ([b60a727adb](https://github.com/facebook/react-native/commit/b60a727adbcfa785e3d1b13bf069b766216e60f8) by [@joshyhargreaves](https://github.com/joshyhargreaves)) +- Update ReactAndroid build script to support gradle 2.3.0 ([d8bb990abc](https://github.com/facebook/react-native/commit/d8bb990abc226e778e2f32c2de3c6661c0aa64e5)) +- Allow "unexpected URL" exception to be caught on Android when using fetch ([da84eba318](https://github.com/facebook/react-native/commit/da84eba318ae69fea28f40418178bdeb35c4a99b) by [@jcurtis](https://github.com/jcurtis)) +- Fix `onLayout` prop for **TextInput** ([8a073c1d8b](https://github.com/facebook/react-native/commit/8a073c1d8b89305a9a2561a7c33740919730f408) by [@rozele](https://github.com/rozele)) +- Fix ViewPager when using native navigation ([a1295e1707](https://github.com/facebook/react-native/commit/a1295e1707a856b9cd5c3129320d386aa9166310) by [@ruiaraujo](https://github.com/ruiaraujo)) +- Fix localization crash in **DevSettingsActivity** ([427e464bb9](https://github.com/facebook/react-native/commit/427e464bb95e4e0ecc7455e71b5d477014618200) by [@ayc1](https://github.com/ayc1)) +- Fix pinch crash in touch-responsive views ([67c3ad4e6a](https://github.com/facebook/react-native/commit/67c3ad4e6a1847cbac43115b01f72cc5c8932a61) by [@tobycox](https://github.com/tobycox)) +- Fix IllegalStateException thrown in looped timing native animation ([ef9d1fba23](https://github.com/facebook/react-native/commit/ef9d1fba237c08a158c8f32e823f229921e7c052) by [@kmagiera](https://github.com/kmagiera)) +- Workaround android-only js module resolution issue ([c20e0f94fe](https://github.com/facebook/react-native/commit/c20e0f94feb42a71633212114b42c62494fd4ff0) by [@fkgozali](https://github.com/fkgozali)) +- Fix ReadableNativeMap.toHashMap() for nested maps and arrays ([15fa2250fd](https://github.com/facebook/react-native/commit/15fa2250fdd0865ce1d0c6ac13b817e7b2c7757a) by [@esamelson](https://github.com/esamelson)) +- Fix Android Sanity Buck version check ([e0573225d5](https://github.com/facebook/react-native/commit/e0573225d5fe28e5ad61690eda3060289bdbf3a4) by [@hramos](https://github.com/hramos)) +- Fixes the connection to Firestore by following whatwg.org's XMLHttpRequest send() method ([d52569c4a1](https://github.com/facebook/react-native/commit/d52569c4a1b6bd19792e4bda23e3a8c3ac4ad8df) by [@samsafay](https://github.com/samsafay)) +- `invertStickyHeaders` can now be set from **SectionList** or **FlatList** ([dd479a9377](https://github.com/facebook/react-native/commit/dd479a93772c3a52561fc32ee84b25ce822a30fa) by [@dannycochran](https://github.com/dannycochran)) + +### Removed: features that have been removed; these are breaking + +- Removed various types ([b58e377961](https://github.com/facebook/react-native/commit/b58e377961ddd278bfa36df0e15953f976875de6), [ee26d9bcb0](https://github.com/facebook/react-native/commit/ee26d9bcb0719246efa51af404aa7805404675cc), [d89517d60a](https://github.com/facebook/react-native/commit/d89517d60a8a6cabc9013b603fa3f63a1face6a2), [852084ad45](https://github.com/facebook/react-native/commit/852084ad454565bb856e85f09e098f1a4a0771a6) by [@TheSavior](https://github.com/TheSavior)) +- Deleted `Systrace.swizzleJSON()` ([3e141cb6c9](https://github.com/facebook/react-native/commit/3e141cb6c957143e998bf2926b8fe1aabccbce2d) by [@yungsters](https://github.com/yungsters)) + +#### Android specific removals + +- `ReactInstanceManager#registerAdditionalPackages` has been removed; Create UIManager interface and extract common classes in uimanager/common ([6b45fb2cb1](https://github.com/facebook/react-native/commit/6b45fb2cb1ca44fa7375bc7696bf90a68a85df3c) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific removals + +- Remove callFunctionSync experimental APIs ([19a4a7d3cb](https://github.com/facebook/react-native/commit/19a4a7d3cb6d00780ccbbbd7b0062896f64ab24d) by [@danzimm](https://github.com/danzimm)) + +## v0.54.0 + +Welcome to the February 2018 release of React Native! This release includes work done by the React Native team and the community in January, and there are some big changes here after the holidays. Thanks for 270 commits from 87 contributors, you all are great! Here are a few highlights from the release: + +- Long awaited **Blob** changes: upload, download, fetch locally, and more +- Sticky headers now work on inverted Lists +- Update to the newest React, which deprecated some lifecycle methods and added new ones – expect Yellowbox until React Native is updated +- `Space-evenly` is now there (sorry for the confusion with 0.52's release notes) +- A lot of under-the-covers work on Yoga, iOS's **Text** and **TextInput**, and a ton of other areas +- Multiple crash fixes + +The changelog is arranged by the customary added, removed, changed, and fixed plus internal; the changes are also organized by platform. + +### Added + +- ✨ **Blob**s now can be: made from Strings, loaded by File using a FileReader API, uploaded and downloaded via `XMLHttpRequest#fetch`, and fetched on files to a local blob consistently ([be56a3efee](https://github.com/facebook/react-native/commit/be56a3efeefefa6dca816ca5149a3dabfa5164e2) and [854c2330eb](https://github.com/facebook/react-native/commit/854c2330ebe748eb0508bb788685232b6cff0022) by [@satya164](https://github.com/satya164) and [@fkgozali](https://github.com/fkgozali)) +- Dynamic node_module dependencies are now supported ([b5e19adc02](https://github.com/facebook/react-native/commit/b5e19adc02a3293cd3fdbe54cc45adc78f94d325) by [@jeanlauliac](https://github.com/jeanlauliac)) +- Support sticky headers for inverted Lists with `invertStickyHeaders` ([ecaca80d42](https://github.com/facebook/react-native/commit/ecaca80d42b686e4cf91aa4bb0c8fce69eba18bb) by [@janicduplessis](https://github.com/janicduplessis)) +- `space-evenly` is now supported (sorry for the confusion with 0.52 notes) ([b1cdb7d553](https://github.com/facebook/react-native/commit/b1cdb7d553146160f99319f9dbe4083b18db60e4) by [@gedeagas](https://github.com/gedeagas)) +- Platform plugins can participate in RNConfig, `link`, and `unlink` – keep an eye on [react-native-window's use of it](https://github.com/Microsoft/react-native-windows/pull/1601)! ([a40bfa730e](https://github.com/facebook/react-native/commit/a40bfa730e05c68da49e6f217ae0f161dcc7ba98) by [@rozele](https://github.com/rozele)) +- Add `minify` flag to react-native bundle command ([3f969cb1db](https://github.com/facebook/react-native/commit/3f969cb1db3a39dd8a4fd622abbb7e4270a84216) by [@tomduncalf](https://github.com/tomduncalf)) + +#### VR Specific Additions + +- Added **ScrollView** support ([6fa039dab0](https://github.com/facebook/react-native/commit/6fa039dab0b9f738a3cb464aeca378c6210a5747) by [@MartinSherburn](https://github.com/MartinSherburn)) + +#### Android Specific Additions + +- Bundle download progress is now shown like iOS ([d06e143420](https://github.com/facebook/react-native/commit/d06e143420462344ea6fc21c0446db972f747404) by [@janicduplessis](https://github.com/janicduplessis)) +- Add back ability to customise OkHttp client ([22efd95be1](https://github.com/facebook/react-native/commit/22efd95be1f0b236eeaaa8a8e6d01e89771c9543) by [@cdlewis](https://github.com/cdlewis)) + +#### iOS specific additions + +- **ScrollView** now supports smooth bi-directional content loading and takes new prop `maintainVisibleContentPosition` ([cae7179c94](https://github.com/facebook/react-native/commit/cae7179c9459f12b1cb5e1a1d998a9dc45f927dc) and [65184ec6b0](https://github.com/facebook/react-native/commit/65184ec6b0ef2d136c0db239d65e0624efac8a2d) by [@sahrens](https://github.com/sahrens)) +- Allow substituting a default font handler ([a9c684a0ff](https://github.com/facebook/react-native/commit/a9c684a0ff45852087310d5218062acfdab673f7) by [@mmmulani](https://github.com/mmmulani)) +- Add `accessibilityElementsHidden` prop ([31288161e1](https://github.com/facebook/react-native/commit/31288161e188723456fdb336c494f3c8a3f5b0a8) by [@aputinski](https://github.com/aputinski)) +- Add EXTRA_PACKAGER_ARGS extensibility point on `scripts/react-native-xcode.sh` (PR rev [0d4ff1b7ea](https://github.com/facebook/react-native/commit/0d4ff1b7ea768cceca0405c665e322c0d6b5ba20) by [@brunolemos](https://github.com/brunolemos) with landing assists [b8c86b8dec](https://github.com/facebook/react-native/commit/b8c86b8deced01027b609959576ffcf5d2d0f520) and [0d4ff1b7ea](https://github.com/facebook/react-native/commit/0d4ff1b7ea768cceca0405c665e322c0d6b5ba20)) + +### Removed + +- Remove internal `utf8` utility - use the **utf8** package now instead ([431670f908](https://github.com/facebook/react-native/commit/431670f90860936c24260d36fc73e0c5fbf4e02a) by [@mathiasbynens](https://github.com/mathiasbynens)) + +#### iOS specific removals + +- Removed outdated assertion in RCTShadowView related to breaking change in Yoga ([e3ff3cf6cb](https://github.com/facebook/react-native/commit/e3ff3cf6cbc137e315eff6ac8aed43954b3668eb) by [@shergin](https://github.com/shergin)) + +#### Android specific removals + +- Fix an issue when swapping to and from the `visible-password` or `phone-pad` keyboard types. ([164f6b6afd](https://github.com/facebook/react-native/commit/164f6b6afd7e0050d63134fcdc65ec6969ab03a0) by [@BrandonWilliamsCS](https://github.com/BrandonWilliamsCS)) +- Remove redundant config in AndroidManifest.xml ([d7a9ca2893](https://github.com/facebook/react-native/commit/d7a9ca2893fb240c25d1cd1e0778f6b93b1e3ded) by [@gengjiawen](https://github.com/gengjiawen)) + +#### iOS specific removals + +- Delete RCTBatchedBridge ([816d417189](https://github.com/facebook/react-native/commit/816d41718998868f276d83b0c21e17d11ad392a2) by [@mhorowitz](https://github.com/mhorowitz)) + +### Changed + +- Docs clarifications ([7abffc3f8c](https://github.com/facebook/react-native/commit/7abffc3f8ce69fab5bbb4147f9b8bcb85a7d2c38) by [@IgorGanapolsky](https://github.com/IgorGanapolsky)) + +#### iOS Specific Changes + +- ⚡️ **Text** and **TextInput** have been re-implemented from the ground up for performance, flexibility, and reduced technical debt ([2716f53220](https://github.com/facebook/react-native/commit/2716f53220f947c690d5f627286aad51313256a0), [74963eb945](https://github.com/facebook/react-native/commit/74963eb945438a6fd269b5764a6cb251c86deda8), [d7fa81f181](https://github.com/facebook/react-native/commit/d7fa81f18110f0dc0f310a5c066d9a30020ca830), [74963eb945](https://github.com/facebook/react-native/commit/74963eb945438a6fd269b5764a6cb251c86deda8), [6c4ef287ad](https://github.com/facebook/react-native/commit/6c4ef287ad95eb14475a9f512487e5d05949309a), [ebc98840e9](https://github.com/facebook/react-native/commit/ebc98840e93c336e8c9e4a93c78e6ca03591f0ec), [d7fa81f181](https://github.com/facebook/react-native/commit/d7fa81f18110f0dc0f310a5c066d9a30020ca830), [7d1ec7a3dc](https://github.com/facebook/react-native/commit/7d1ec7a3dc66654b13a8e9cb3ddf912e92506f55), [52648326e6](https://github.com/facebook/react-native/commit/52648326e6ac4470eeffc0a56d91bc487bc1eae4), [6bb8617f3a](https://github.com/facebook/react-native/commit/6bb8617f3a2f3f80f89eb00595a621aec35aca83), [5dbb3c586c](https://github.com/facebook/react-native/commit/5dbb3c586c9e8483aa7e6f1edd35ffb12bd4305d), [7e7d00aebe](https://github.com/facebook/react-native/commit/7e7d00aebefd2416f948066c65c739581c6e3f54), [46fd864348](https://github.com/facebook/react-native/commit/46fd8643485b21147c780d22ee8cf751b2dc8750), [9dfa2e7f3c](https://github.com/facebook/react-native/commit/9dfa2e7f3cfa5009f6c54382e90681d99a9c3cb8), [8a882fe6d6](https://github.com/facebook/react-native/commit/8a882fe6d6bb35776551eb8b0cd6892f41cab492), and [0f9fc4b295](https://github.com/facebook/react-native/commit/0f9fc4b2953d52fa1754e786dc5c74bfecbeaaca) by [@shergin](https://github.com/shergin) and [@hovox](https://github.com/hovox)) +- **Image**'s `resizeMode="center"` is now documented and has an example present ([be7037fd8e](https://github.com/facebook/react-native/commit/be7037fd8e1c4b92646caf7a70b9d6d28ef2c30a) by [@motiz88](https://github.com/motiz88)) +- Geolocation API no longer timeouts when `skipPermissionRequests: true` ([5c17db8352](https://github.com/facebook/react-native/commit/5c17db8352abfd94f094deb9b550284ec17f1fcd) by [@ngandhy](https://github.com/ngandhy)) +- Rounding pixels is now done with an algorithm from Yoga rather than React Native, reducing debt and improving performance ([ceb1d1ca5b](https://github.com/facebook/react-native/commit/ceb1d1ca5bc7c04b9d9ad16dcd9583f05b0ef498) and [114c258045](https://github.com/facebook/react-native/commit/114c258045ccca3a4433de206c7983b42d14c03b) by [@shergin](https://github.com/shergin)) + +#### Android specific changes + +- Numerous refactors around bundle handling and the `DevServerHelper` ([644123aa6f](https://github.com/facebook/react-native/commit/644123aa6fc6132125f56b485e5ab3b16f28f666), [e756251413](https://github.com/facebook/react-native/commit/e7562514130f614a9f138c0b855bfe4516150add), [6e44356c9b](https://github.com/facebook/react-native/commit/6e44356c9bb364195280aafc69aae48cdcb2ab84), [1019bda930](https://github.com/facebook/react-native/commit/1019bda930fa4c26fc0006efa023ee2c586705c6), [06d8f96a64](https://github.com/facebook/react-native/commit/06d8f96a64f00a003e34b0c1e93033893173ccc8), [f88c9d6382](https://github.com/facebook/react-native/commit/f88c9d63828e975a9792969e27accd851ead3e86), and [108f9664bf](https://github.com/facebook/react-native/commit/108f9664bffd1a4e0a7b2c2da3dc3810f1b29de2) by [@davidaurelio](https://github.com/davidaurelio)) + +### Fixed + +- Fix JS debugger issues related to CORS ([29f8354c19](https://github.com/facebook/react-native/commit/29f8354c1946a6325e9020b9ef5ee4ccdf0fa51f) by [@njbmartin](https://github.com/njbmartin)) +- Keep the `.gitignore`d files during the `react-native-git-upgrade` process ([7492860ffb](https://github.com/facebook/react-native/commit/7492860ffb3a010ff2273abf45c7414c098bdc37) by [@ncuillery](https://github.com/ncuillery)) +- Fix re-render case on SwipeableRow ([a580a44b0d](https://github.com/facebook/react-native/commit/a580a44b0d51ca7f33a4394b0a22d1c7d2234190)) +- Fix display of syntax error messages when HMR is enabled ([2b80cdf1bb](https://github.com/facebook/react-native/commit/2b80cdf1bba3b756915117139474440c203cbd8d) by [@ide](https://github.com/ide)) +- Add fixtures to metro blacklist in order to let build succeed ([54dc11a5fb](https://github.com/facebook/react-native/commit/54dc11a5fbafaccc9c0a781f1151225909717597) by [@t4deu](https://github.com/t4deu)) + +#### Android specific fixes + +- Don't crash when using decimal `Animated.modulo` values with `useNativeDriver: true` ([6c38972327](https://github.com/facebook/react-native/commit/6c389723274712bc52d6642cc6c1907b5523726d) by [@motiz88](https://github.com/motiz88)) +- Don't crash when receiving unknown websocket IDs ([1a790f8703](https://github.com/facebook/react-native/commit/1a790f8703d44c2322000dbf40a55678ca8a436a) by [@sunweiyang](https://github.com/sunweiyang)) +- Dont crash when `NativeModules.UIManager.showPopupMenu` method calls error callback ([0c18ec5b9c](https://github.com/facebook/react-native/commit/0c18ec5b9c64613dbdcd4be9f80e470e9532483d) by [@dryganets](https://github.com/dryganets)) +- Maintain cursor position when **TextInput**'s `secureTextEntry` changes ([09b43e479e](https://github.com/facebook/react-native/commit/09b43e479e97dfe31910503190b5d081c78e4ea2) by [@jainkuniya](https://github.com/jainkuniya)) +- Race condition fix in Dialogs module ([d5e3f081c6](https://github.com/facebook/react-native/commit/d5e3f081c6b41697533775d378969fcf554c7290) by [@dryganets](https://github.com/dryganets)) +- Fix NPE in Android Switch during measure ([7b1915e74d](https://github.com/facebook/react-native/commit/7b1915e74daa82d0a94e90ff266e9271bc43f4d8) by [@4ndroidev](https://github.com/4ndroidev)) +- Fix initialScrollIndex ([ef596dec49](https://github.com/facebook/react-native/commit/ef596dec49975dd4f8860ad8adcd29dd23e04c14) by [@olegbl](https://github.com/olegbl)) +- Fix redbox style ([f363dfe766](https://github.com/facebook/react-native/commit/f363dfe766244c8fc10eab3d2c4acdd8fc4b576b) by [@ayc1](https://github.com/ayc1)) +- Fix crash due to mishandling of UTF-8 in progressive download. ([9024f56bda](https://github.com/facebook/react-native/commit/9024f56bda4186fbade7bbd1e61f8e0252585c02) by [@dryganets](https://github.com/dryganets)) +- Fix crash because ClassCastException fix: getText() returns CharSequence not Spanned ([46cc4907e3](https://github.com/facebook/react-native/commit/46cc4907e3e49f5c7b1ac0a1088866f2958f43a1) by [@dryganets](https://github.com/dryganets)) +- Fix and re-enable "view flattening" optimizations ([877f1cde2e](https://github.com/facebook/react-native/commit/877f1cde2ebe8f304d6fd0855fc4a874d1d5ee27) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific fixes + +- Fix Crash when **CameraRoll** is getting assets from iCloud and no filename is provided ([2ae24361c5](https://github.com/facebook/react-native/commit/2ae24361c5e0fc4aed9a321123bba8ca416a35ff) by [@pentarex](https://github.com/pentarex)) +- Fix Xcode Archive task failing if project path contains whitespace ([8aa568e867](https://github.com/facebook/react-native/commit/8aa568e867bbbe7e23ded3651f23581ff2753323) by [@jevakallio](https://github.com/jevakallio)) +- `react-native link` has been fixed to correctly link iOS and tvOS targets ([a63fd378a4](https://github.com/facebook/react-native/commit/a63fd378a47173cc9f750e9980f18dc12dd7ea51) by [@dlowder-salesforce](https://github.com/dlowder-salesforce)) +- `GLog` fix on case sensitive APFS macOS ([2fef1bafc8](https://github.com/facebook/react-native/commit/2fef1bafc8bee33432486212caf4fef5c659dd37) by [@hovox](https://github.com/hovox)) +- Fixed issue where you cannot launch tvOS app on Apple TV simulator ([afd988f85a](https://github.com/facebook/react-native/commit/afd988f85a8cf0980b5844cb88c1803e41502d03)) + +### Internal work + +- A **massive** amount of Yoga optimizations, cleanups, refactors, and test fixes ([62d01006a1](https://github.com/facebook/react-native/commit/62d01006a125517c8991fa93979aaec6ccc18823), [1475fc4856](https://github.com/facebook/react-native/commit/1475fc4856d366f8ec2027374971ed5aefcdeafa), [9daa17458a](https://github.com/facebook/react-native/commit/9daa17458a5f4ab8ead4d7c29de331f08b1a4a46), [d4517ddb9f](https://github.com/facebook/react-native/commit/d4517ddb9f2ad6d6175cbe6a8be2b819e4aa2c29), [ca91f0e3ac](https://github.com/facebook/react-native/commit/ca91f0e3ac55cb1e7a0fa2399d594a47de80a100), [34b7ec82b5](https://github.com/facebook/react-native/commit/34b7ec82b5d22efbdaa8b74b930d3c4da87414ec), [fda861a889](https://github.com/facebook/react-native/commit/fda861a88914a008b94c12078c9e579a99929643), [9f7cedbe14](https://github.com/facebook/react-native/commit/9f7cedbe14321d24b7aee1ba969b3d23d5c9d204), [ac1c8c265e](https://github.com/facebook/react-native/commit/ac1c8c265e6030c52434f99e882639c67c8c175d), [fcf2c7cf61](https://github.com/facebook/react-native/commit/fcf2c7cf61ca454f10d398d57b78b5b29ed05ae2), [2b27f1aa19](https://github.com/facebook/react-native/commit/2b27f1aa1964eba749876100be1f3ac4c085fa8f), [210ae5b95a](https://github.com/facebook/react-native/commit/210ae5b95a9c94194e95a21fdb93f88ddfdc5ce2), [82088580ab](https://github.com/facebook/react-native/commit/82088580ab17417a51386722f98b83d6cad0a6a0), [7f94bff89a](https://github.com/facebook/react-native/commit/7f94bff89a09547e76b50ae4c96ec59de73a153a), [bd7bf94af9](https://github.com/facebook/react-native/commit/bd7bf94af9ddfc9221ac3f6f62821b7e53e9b0ea), [2fe65b032e](https://github.com/facebook/react-native/commit/2fe65b032e9ec3faf3cef31290372b9face2d3f1), [9658d9f82b](https://github.com/facebook/react-native/commit/9658d9f82ba536c2f39937d61b3954e3dcc6a54e), [ee5c91c031](https://github.com/facebook/react-native/commit/ee5c91c0317b0defbb8da21f7e6d8d3ac8967381), [64d530ba07](https://github.com/facebook/react-native/commit/64d530ba0785af21555d48ddc9e7d561af37db4c), [400a29e151](https://github.com/facebook/react-native/commit/400a29e15134f5264cc55b239bd2a18a107911dd), [f75e21f1ca](https://github.com/facebook/react-native/commit/f75e21f1caf9117ae3eda31c23e286116ebf586c), [528bbacf6b](https://github.com/facebook/react-native/commit/528bbacf6b8a5a62faf4db5bfc8dfe063f0b82a3), [be8e7c6e65](https://github.com/facebook/react-native/commit/be8e7c6e65724d4915862098238506172dbe9657), [d0f7d4d107](https://github.com/facebook/react-native/commit/d0f7d4d107a90fdfbf795d842f4bd4a81290ec62), [4b4959a21c](https://github.com/facebook/react-native/commit/4b4959a21cb1e9e356eab51bfba0f16b76e8ec7f), [fdef3784f0](https://github.com/facebook/react-native/commit/fdef3784f00e8c3233a30aa2e35aaaadaa867489), [831a1bb4b1](https://github.com/facebook/react-native/commit/831a1bb4b1cc201b53685874a9dbdd6c3c1615ad), [2a22d998f8](https://github.com/facebook/react-native/commit/2a22d998f8a7f896db6c0708ba92ed9c9082ee7c), [9f57dedc17](https://github.com/facebook/react-native/commit/9f57dedc1712733ce4a490121138a97917fd3a52), and [ff2658c3de](https://github.com/facebook/react-native/commit/ff2658c3de111ef745d9582c6863ab0d6c90f960) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar), [@passy](https://github.com/passy), [@ryu2](https://github.com/ryu2), and others) +- 🚧 Lifecycle methods were renamed to be consistent with [React RFC6](https://github.com/reactjs/rfcs/blob/master/text/0006-static-lifecycle-methods.md) – note that there are Yellowbox warnings right now because of this, it's work-in-progress ([6f007e8957](https://github.com/facebook/react-native/commit/6f007e8957c9bf5652b0184cba65f385050a8236) by [@bvaughn](https://github.com/bvaughn)) +- Some autogenerated mystery string files were added ([c7846c4bfb](https://github.com/facebook/react-native/commit/c7846c4bfb5b944714d95382210f83c83da1ac52), [bb6fceac27](https://github.com/facebook/react-native/commit/bb6fceac274422102b347ec7aedb36efd9b701cd), [8bd00a2361](https://github.com/facebook/react-native/commit/8bd00a2361bb39f1bda58a260b7ffd278a05d79d), [faa9519021](https://github.com/facebook/react-native/commit/faa951902161201846f20a4dc55950e8f96cb0ff), [f49f7932d5](https://github.com/facebook/react-native/commit/f49f7932d581fe1f9569fb460196801528cfb591)) +- Improvements to the cli's implementation ([1673c570f9](https://github.com/facebook/react-native/commit/1673c570f984d86e88a3b6b44eb78f4848eb0515), [752427b7b8](https://github.com/facebook/react-native/commit/752427b7b8221bbb8304a158b2dad12b26afd7a5), and [619a8c9f29](https://github.com/facebook/react-native/commit/619a8c9f298356db68f8cd7e5d25e5bcf48bab05) by [@arcanis](https://github.com/arcanis), [@voideanvalue](https://github.com/voideanvalue), and [@rozele](https://github.com/rozele)) +- Measure touch events from nearest "root view" ([a70fdac5bd](https://github.com/facebook/react-native/commit/a70fdac5bdd4500b4ca3074dac26d414bd931fb9) by [@mmmulani](https://github.com/mmmulani)) +- Allow to attach the HMR server to an external http server ([8c6b816caa](https://github.com/facebook/react-native/commit/8c6b816caa908845471460f453f9d761bfba3f3d) by [@rafeca](https://github.com/rafeca)) +- Split folly/Memory out from headers-only targets in Buck ([b8e79a7e8b](https://github.com/facebook/react-native/commit/b8e79a7e8be1f3db1482a849352fda6e23c1c78a) by [@mzlee](https://github.com/mzlee)) +- Code cleanup of **ReactHorizontalScrollView** in Android ([71ec85f24c](https://github.com/facebook/react-native/commit/71ec85f24c3a1007a9e1f036a140cce43b38019f) by [@mdvacca](https://github.com/mdvacca)) +- Always create a debugger websocket connection when in iOS dev builds ([fa334ce464](https://github.com/facebook/react-native/commit/fa334ce464da39625f4e4fbfee259e9dcea31abc) by [@bnham](https://github.com/bnham)) +- Make the React Native HMR client extend from the generic metro HMR client ([9a19867798](https://github.com/facebook/react-native/commit/9a198677989930971912b98487ec68d162636411) by [@rafeca](https://github.com/rafeca)) +- Removed use of xip.io ([40a8434bde](https://github.com/facebook/react-native/commit/40a8434bde855ecae42408ec1240622152432de7) by [@jvranish](https://github.com/jvranish)) +- Fix Buck dependencies ([cec2e80fc2](https://github.com/facebook/react-native/commit/cec2e80fc251e4ea45ce1e446323716a3792390d), [4f6c157250](https://github.com/facebook/react-native/commit/4f6c157250676f07619af2a935bddd8301b50caa) by [@swolchok](https://github.com/swolchok)) +- Fix permissions on test script ([42c410ac84](https://github.com/facebook/react-native/commit/42c410ac84619a3d12a4619e59a0a526a3ebdca9) by [@mzlee](https://github.com/mzlee)) +- Better handling exception in loadScript() ([3fbf7856d9](https://github.com/facebook/react-native/commit/3fbf7856d9acb0909357d6b315388471a6b5a69c)) +- Fix ESLint upgrade "parsing error" ([9d214967d2](https://github.com/facebook/react-native/commit/9d214967d2c8184ce26addec150e392e3b519fcd) by [@zertosh](https://github.com/zertosh)) +- Fixing 🤡 in RCTSurfaceRootShadowView ([5fba82deff](https://github.com/facebook/react-native/commit/5fba82deffde731176e3e118193c212f5d2c2bca) by [@shergin](https://github.com/shergin)) +- Handle invalidation error in RCTObjcExecutor ([493f3e8da5](https://github.com/facebook/react-native/commit/493f3e8da5a112e1b33bfb3e9f51e7a2bd7edc7a) by [@fromcelticpark](https://github.com/fromcelticpark)) +- Check for nullptr when accessing isInspectable method ([70d23e82ad](https://github.com/facebook/react-native/commit/70d23e82ad21a4cfde1ce7c3b1c00fe7c7d5adbd) by [@fromcelticpark](https://github.com/fromcelticpark)) +- Introduce new Fabric API in RNAndroid ([2d35bde101](https://github.com/facebook/react-native/commit/2d35bde10130167018791c1b2fe4fece27cefddc) by [@mdvacca](https://github.com/mdvacca)) +- Fixing Prepack model for latest global.nativeExtensions changes. ([01a58d182a](https://github.com/facebook/react-native/commit/01a58d182abd19c9e089ec38b08ffd4b45e2076c) by [@NTillmann](https://github.com/NTillmann)) +- General code cleanup: unused code and configurations ([e233646d09](https://github.com/facebook/react-native/commit/e233646d095a272091b07c29fa87b206831ad6e3) and [e7010348d8](https://github.com/facebook/react-native/commit/e7010348d8b2f703fcc057c2914bd45ca6238f98) by [@bvaughn](https://github.com/bvaughn) and others) +- Add support for finding multiple views with NativeIds using a single listener to Android ([f5efc460ad](https://github.com/facebook/react-native/commit/f5efc460ad30cc60a62edd540c3b0f45c67bcda3) by [@axe-fb](https://github.com/axe-fb)) +- Add CountingOutputStream ([a5e135aed6](https://github.com/facebook/react-native/commit/a5e135aed6941772c663adffd67729f7a5026d08) by [@hramos](https://github.com/hramos)) +- Changes from Prettier ([b815eb59be](https://github.com/facebook/react-native/commit/b815eb59bef7bed9825027adc676b8d09db463c6), [e758cb7f39](https://github.com/facebook/react-native/commit/e758cb7f397b37b5621a4e0afcabc1c74443bc06), [bf9cabb03c](https://github.com/facebook/react-native/commit/bf9cabb03c7245930c270a19816545eae1b9007d), and [a5af841d25](https://github.com/facebook/react-native/commit/a5af841d259b6b29d95a9fb346a0ffce9c6efbfe) by [@shergin](https://github.com/shergin)) +- Typos in code ([8ffc16c6e7](https://github.com/facebook/react-native/commit/8ffc16c6e7d25dd434ca3fc7f9ffd6d5917f7bcd) by [@ss18](https://github.com/ss18)) +- Support for inherited events in view managers ([2afe7d4765](https://github.com/facebook/react-native/commit/2afe7d4765ffc0d0c71d233211edd1d21972040e) by [@shergin](https://github.com/shergin)) +- Flow types changes ([3fc33bb54f](https://github.com/facebook/react-native/commit/3fc33bb54fc5dcf7ef696fe245addc320f85a269), [e485cde187](https://github.com/facebook/react-native/commit/e485cde187e4cd92bc821e58047b149a789dd713), [83ed9d170b](https://github.com/facebook/react-native/commit/83ed9d170b8fd750a345fc608ec69db2fe3ca9b2), [52ffa5d13e](https://github.com/facebook/react-native/commit/52ffa5d13ef6fe2752bc8f838dc1c2dfe651bb64), [d37cdd97ae](https://github.com/facebook/react-native/commit/d37cdd97aee4c1bac864cb28b686f2d1a128128e), [6e7fb01c02](https://github.com/facebook/react-native/commit/6e7fb01c02f3e91777c8292389c09a15d24cf800), [d99ba70c49](https://github.com/facebook/react-native/commit/d99ba70c492d3cd15ef6aded3f8712976d251f88), [bcfbdf4fbe](https://github.com/facebook/react-native/commit/bcfbdf4fbec1a05da151a2255f44a87b651965d6), and [a1c479fb3b](https://github.com/facebook/react-native/commit/a1c479fb3be674511131b46f856bc9b197a38cda) by [@alexeylang](https://github.com/alexeylang), [@sahrens](https://github.com/sahrens), [@yungsters](https://github.com/yungsters), and [@zjj010104](https://github.com/zjj010104)) +- Give IInspector a virtual destructor for correct InspectorImpl destruction ([2a3c37f424](https://github.com/facebook/react-native/commit/2a3c37f424a4d1b9f4c5a2960a1cbe3517eac007) by [@toulouse](https://github.com/toulouse)) +- Migrated `SourceCode` and `DeviceInfoModule` out of Native Modules ([47fe52380a](https://github.com/facebook/react-native/commit/47fe52380a232a1c364e21f71e2644a5a3348366) and [429fcc8cab](https://github.com/facebook/react-native/commit/429fcc8cab3ca877275d7deb1040fdff17a414c7)) +- Jest config change as part of bringing back support for the `assetPlugin` option in Metro ([af6450c660](https://github.com/facebook/react-native/commit/af6450c660d3055d9c5c70d200471541a1ce7e12) by [@ide](https://github.com/ide)) +- Nested virtualized lists should receive recordInteration events ([ae2d5b1e68](https://github.com/facebook/react-native/commit/ae2d5b1e68a2207c27ef2f1b533f86c86d6d849b)) +- Upgrade connect dependency ([709ede799c](https://github.com/facebook/react-native/commit/709ede799cc9820acadaf22aa84f0fe6dd2be319) by [@rafeca](https://github.com/rafeca)) +- xplat/js: asyncRequire: redirect async modules to control modules ([5e11b8870a](https://github.com/facebook/react-native/commit/5e11b8870aa855a56cfafa6575aed5e33b272065) by [@jeanlauliac](https://github.com/jeanlauliac)) +- More progress towards split bundle support ([1a1a956831](https://github.com/facebook/react-native/commit/1a1a956831aec93a4fe2c6e2f63f558271fb466b) and [9e34cbda9d](https://github.com/facebook/react-native/commit/9e34cbda9de8f7350cfb02c884fbef2da18e0e3a) by [@fromcelticpark](https://github.com/fromcelticpark)) +- Implement bundle sync status ([88980f2ef7](https://github.com/facebook/react-native/commit/88980f2ef7331aa630ff19e54427cdc3b7510869)) +- Various improvements to RCTSurface and RCTShadowView ([7d9e902d72](https://github.com/facebook/react-native/commit/7d9e902d72e240f54ea01225cc3272698ff70014), [06ebaf2205](https://github.com/facebook/react-native/commit/06ebaf2205f979b6e6595ec7985447a07d25c4d4), [6882132421](https://github.com/facebook/react-native/commit/688213242130536c5d4db8b9aa17dc418372aadf), and [193a2bd4cd](https://github.com/facebook/react-native/commit/193a2bd4cdffbbc79b69c067b31420663dc9b03a) by [@shergin](https://github.com/shergin)) +- Progress towards experimental ReactFabric and FabricUIManager ([b1e5c01483](https://github.com/facebook/react-native/commit/b1e5c01483a69b181c75d242231077cb2f96e846), [fa0ac92b2c](https://github.com/facebook/react-native/commit/fa0ac92b2c9cfc302314ff18325a96354bb1f432), [94dac23583](https://github.com/facebook/react-native/commit/94dac23583dc6b693475769c196c4b51954e74f1) by [@fkgozali](https://github.com/fkgozali)) +- (almost) kill fbjsc ([702b7e877e](https://github.com/facebook/react-native/commit/702b7e877e09afede0dcdc7f8c680be63e942153) by [@michalgr](https://github.com/michalgr)) +- Refactored bridge ReadableNativeMap and ReadableNativeArray to add centralized accesses ([7891805d22](https://github.com/facebook/react-native/commit/7891805d22e3fdc821961ff0ccc5c450c3d625c8), [28be33ac34](https://github.com/facebook/react-native/commit/28be33ac34d9214ffd452f88a4d19468683a6a0d), and [5649aed6d3](https://github.com/facebook/react-native/commit/5649aed6d3223ec49c42416f242249eb0c4fd890)) +- Removed unused core from Image.android.js ([ce3146a6f3](https://github.com/facebook/react-native/commit/ce3146a6f3162141c7dc06d2c91ec291d3756a92) by [@shergin](https://github.com/shergin)) +- Capture StackOverflowExceptions triggered when drawing a ReactViewGroup or ReactRootView and log more debugging information for it ([1aac962378](https://github.com/facebook/react-native/commit/1aac9623789e3d2a428b51ae699d4c340b3afb99) and [4d3519cc6a](https://github.com/facebook/react-native/commit/4d3519cc6af5bb33c6f21d9392b82379780d79dc) by [@mdvacca](https://github.com/mdvacca)) +- `babel-preset-react-native`: only require plugins once ([df6c48cf36](https://github.com/facebook/react-native/commit/df6c48cf36d39a75a6196462d661ce75c6aef104) by [@davidaurelio](https://github.com/davidaurelio)) +- Report module id as string and as double, in case of invalid values are passed to nativeRequire ([8f358a2088](https://github.com/facebook/react-native/commit/8f358a20881b61cf3256fa1e404b86d5f104932d) by [@fromcelticpark](https://github.com/fromcelticpark)) +- More work moving build configurations to Skylark ([d3db764f38](https://github.com/facebook/react-native/commit/d3db764f383fc588a87e0d1e4267b310d6188bc8), [869866cc5c](https://github.com/facebook/react-native/commit/869866cc5c639d8c0257c776368381987a7f7159), [a8c95d2417](https://github.com/facebook/react-native/commit/a8c95d241757fefaa06ff49193975f7c103a6418), and [79a63d040f](https://github.com/facebook/react-native/commit/79a63d040f1346a0e320104fb35da405502aae19) by [@mzlee](https://github.com/mzlee), [@ttsugriy](https://github.com/ttsugriy), and others) +- `[RCTShadowView isHidden]` was removed ([c19bc79688](https://github.com/facebook/react-native/commit/c19bc7968855e85758df9e1a47dc2a52e69668ed) by [@shergin](https://github.com/shergin)) +- Remove unused `packagerInstance` option and rename it to `server` ([bbbc18c4ee](https://github.com/facebook/react-native/commit/bbbc18c4ee9b13a5aeca10edcb29694db3f15769)) +- The blog has moved to [react-native-website](https://github.com/facebook/react-native-website/tree/master/website/blog) ([e16d67340e](https://github.com/facebook/react-native/commit/e16d67340e0ad1724afeee78f9d820177abbd8b6) by [@hramos](https://github.com/hramos)) +- Remove SoLoaderShim, use SoLoader ([fc6dd78935](https://github.com/facebook/react-native/commit/fc6dd78935a41106aa6a44058c1abb7d0ba0fa24) by [@foghina](https://github.com/foghina)) +- Removed broken link for 'Getting Help' in the README ([b3a306a667](https://github.com/facebook/react-native/commit/b3a306a66709a0ab0ff29151a38eaa3f8f845c1f) by [@rickydam](https://github.com/rickydam)) +- Changed to use boost-for-react-native cocoapod, which speeds up `pod install` a ton; this was in 0.53 originally but had to be re-added ([d40db3a715](https://github.com/facebook/react-native/commit/d40db3a715afaf1cde4a5e231e96e46b2808bbef) by [@CFKevinRef](https://github.com/CFKevinRef)) +- Remove fbobjc's RN copy ([af0c863570](https://github.com/facebook/react-native/commit/af0c8635709b8014c68ce88ebb1e9e94ec56768a)) +- Measure time to create **ReactInstanceManager** ([6224ef5301](https://github.com/facebook/react-native/commit/6224ef5301d67266b28c77e5e46816f319122f38) by [@alexeylang](https://github.com/alexeylang)) +- Upgrade create-react-class to v15.6.3 ([74f386633d](https://github.com/facebook/react-native/commit/74f386633d5e123b2ea73b4773d0ee7d83832fb5) by [@bvaughn](https://github.com/bvaughn)) +- Upgrade react-devtools to v3.1.0 ([8235a49a33](https://github.com/facebook/react-native/commit/8235a49a33cc8e84cd4ba1cc15bc09eed6712b4c) by [@bvaughn](https://github.com/bvaughn)) +- Upgrade flow to v0.65.0 ([7aba456b04](https://github.com/facebook/react-native/commit/7aba456b04ff6a4e4721bcf1064f22a8a87f90c7) and [298f3bb69a](https://github.com/facebook/react-native/commit/298f3bb69abecdcd83adb64e043a2974bd52b1ab) by [@avikchaudhuri](https://github.com/avikchaudhuri) and [@mroch](https://github.com/mroch)) +- Upgrade Jest to v22.2.1 ([46f4d3e1bc](https://github.com/facebook/react-native/commit/46f4d3e1bc9340009c53f366ebd98600c485c993) and [24e521c063](https://github.com/facebook/react-native/commit/24e521c063035e470587bb279976a955ff03717a) by [@mjesun](https://github.com/mjesun)) +- Upgrade ESLint to v4.17.0 (plus update related deps) ([bba19e846e](https://github.com/facebook/react-native/commit/bba19e846e377241826475906f642264409a3990) by [@zertosh](https://github.com/zertosh)) +- Upgrade React to v16.3.0-alpha.1 ([03d7b2aa0e](https://github.com/facebook/react-native/commit/03d7b2aa0e7f239c78b6fe3a96c0ddf3de00a58b) and [5e80d95e03](https://github.com/facebook/react-native/commit/5e80d95e034259af8c41b50756a623756cc81a77) by [@grabbou](https://github.com/grabbou) and [@hramos](https://github.com/hramos)) +- Synced React and ReactFabric render ([c7ed03a95c](https://github.com/facebook/react-native/commit/c7ed03a95c8c372c7631c11e0778cf9753afdabc), [13829751b1](https://github.com/facebook/react-native/commit/13829751b11330f8e1400c5c70c59c49ac2f091f), and [d676746f14](https://github.com/facebook/react-native/commit/d676746f14fb6d714d2576871655b13c005480e7) by [@bvaughn](https://github.com/bvaughn)) +- Upgrade metro to v0.26.0 ([9e6f3b8aff](https://github.com/facebook/react-native/commit/9e6f3b8aff7572f5e9008a2641c70846da0817bb), [ce50f25d22](https://github.com/facebook/react-native/commit/ce50f25d22d56f24bdb7d80a3f9a279863d5dc2a), [e9b83e608e](https://github.com/facebook/react-native/commit/e9b83e608e8487ef8fcbfc956a52bfa7ee1d727f), [2fe7483c36](https://github.com/facebook/react-native/commit/2fe7483c36b10146f737f0a84799c2eb01aaba79), [0f96ebd93b](https://github.com/facebook/react-native/commit/0f96ebd93b634ec3fb0e6036a4960bb4af167e7b), [0de470ec19](https://github.com/facebook/react-native/commit/0de470ec19f2b9f3f4f3ab3dd4322c0f0ece2868), [e8893a021f](https://github.com/facebook/react-native/commit/e8893a021f60ffeea27443998b1716e9a1963d64), and [b1d8af48ae](https://github.com/facebook/react-native/commit/b1d8af48ae251f57bdcd55f89d8fc62aa9eca872) by [@rafeca](https://github.com/rafeca) and [@grabbou](https://github.com/grabbou)) +- Add Context to Redbox report api ([e3c27f585a](https://github.com/facebook/react-native/commit/e3c27f585aaeb685e86250f45fc790c06932af0d) by [@ayc1](https://github.com/ayc1)) +- GitHub bot commands have been disabled in the short term ([b973fe45bd](https://github.com/facebook/react-native/commit/b973fe45bdbc84e12fd0a3afbd6fdd327bcb9d02) by [@hramos](https://github.com/hramos)) +- Various CI configuration changes ([17bd6c8e84](https://github.com/facebook/react-native/commit/17bd6c8e84d9f5d42767a6f42a9a2cf812aa778b), [51b6749c07](https://github.com/facebook/react-native/commit/51b6749c075bb87a340096a0dc06cd6cf9a19907), [a2f3ba864e](https://github.com/facebook/react-native/commit/a2f3ba864ed17ca32e71f15724a8ebf2b1e640c1), [2ef9b7f2da](https://github.com/facebook/react-native/commit/2ef9b7f2da5b875ac1a4fee0ade3cc16ad96772a), [40b17926bb](https://github.com/facebook/react-native/commit/40b17926bb2c724f1580b2eb0c30a37f5d48030a), [613afbab7f](https://github.com/facebook/react-native/commit/613afbab7f30748ba767b055f23d0d294562805f), [da8bec9f8b](https://github.com/facebook/react-native/commit/da8bec9f8b62b46e58e0e98413aa915ece05b71b), [fa11faecb6](https://github.com/facebook/react-native/commit/fa11faecb69f385a5c0aba60f4039612e46b87f3), [f50af7f8a4](https://github.com/facebook/react-native/commit/f50af7f8a48e9cae2cb512962870d5692da5aaf2), [9227ba73ab](https://github.com/facebook/react-native/commit/9227ba73ab8c2b8b8ce4086b5f4667a8a55cdcfa), [365a4d4b43](https://github.com/facebook/react-native/commit/365a4d4b4315d4ca7a0e1236012b763d7e5bb1fd), [b58d848d9c](https://github.com/facebook/react-native/commit/b58d848d9cf78d755fe38392e26826ed481175cd), [c8e98bbaf5](https://github.com/facebook/react-native/commit/c8e98bbaf58b7a7f866e831982355b78dfa43b9d), [f5975a97ad](https://github.com/facebook/react-native/commit/f5975a97adcf3ae9c2988d7e267947a84ab60cee), and [605a6e4031](https://github.com/facebook/react-native/commit/605a6e4031fc9b63edbb9120ffacf7b045dc9db8) by [@hramos](https://github.com/hramos), [@grabbou](https://github.com/grabbou), and [@dryganets](https://github.com/dryganets)) +- Restore copyright header ([4f883bd0bc](https://github.com/facebook/react-native/commit/4f883bd0bcdc015e2cf70bcc29bbe05fd5b8a40b) by [@hramos](https://github.com/hramos)) +- Trim docs that are already present in the open source docs site ([28d60b68ad](https://github.com/facebook/react-native/commit/28d60b68ad7bc5b7ebda6b720981feacd3bde337) by [@hramos](https://github.com/hramos)) +- Fix obsolete instructions about editing docs ([2f46712074](https://github.com/facebook/react-native/commit/2f46712074d187f5456723499e6885bf0941cfbc) by [@ExplodingCabbage](https://github.com/ExplodingCabbage)) +- Fix links to beginner friendly issues ([c355a34de1](https://github.com/facebook/react-native/commit/c355a34de107befd26bc495272b91c11957f3fd0) by [@hotchemi](https://github.com/hotchemi)) +- Typos in comments and log messages ([d2c569795c](https://github.com/facebook/react-native/commit/d2c569795ca07b6b7c0227cfc6d0b3bf5dd23b99) by [@ss18](https://github.com/ss18)) +- Don't run the Danger CI tool through Flow ([1ea3065feb](https://github.com/facebook/react-native/commit/1ea3065feb265bef738bd53e835567d595266725) by [@hramos](https://github.com/hramos)) +- Namespace custom ESLint rules through eslint-plugin-lint ([488b6825c5](https://github.com/facebook/react-native/commit/488b6825c5fb4ec68a8b7315559c4d34e012de12) by [@zertosh](https://github.com/zertosh)) + +- ... and now we're at 0.54 🎉 ([67e67ec83c](https://github.com/facebook/react-native/commit/67e67ec83ce83d4a1a38bc29dd52bf5c28723752), [21dd3dd296](https://github.com/facebook/react-native/commit/21dd3dd296989f4de2d4e9b1ba0df88ea2d32413), [49e35bd939](https://github.com/facebook/react-native/commit/49e35bd9399716a2734e824bab14faf1683cdfdd), [829f675b8b](https://github.com/facebook/react-native/commit/829f675b8b4abae696151e404552af515a2da1ce), and [294d95a236](https://github.com/facebook/react-native/commit/294d95a23687b2e3155fe4ae1bc5e4a649e6b014) by [@grabbou](https://github.com/grabbou) and [@hramos](https://github.com/hramos)) + +## v0.53.0 + +Welcome to the January 2018 release of React Native. The CLI now supports `--port` for both platforms, a few components were made to support consistent props across both platforms, and various fixes were made. There was a lot of under-the-cover work done with more test improvements and dependency updates. 118 commits were made by 43 contributors 🎉. + +### Added + +- ✨ **Keyboard** events now include `easing` and `duration` ([4d33080f0f](https://github.com/facebook/react-native/commit/4d33080f0fa7b2eb7b0e9ff7bbd50c222f461786) by [@sahrens](https://github.com/sahrens)) + +#### iOS exclusive additions + +- `react-native run-ios` now supports the `--port` argument for metro ([33d710e8c5](https://github.com/facebook/react-native/commit/33d710e8c58ef1dc69816a59ac1cf390894e7cb9)) + +#### Android exclusive additions + +- On Android, **ScrollView** now takes `snapToInterval` like iOS ([ddd65f1ba9](https://github.com/facebook/react-native/commit/ddd65f1ba9cca945313d116c1dcf75f3a0556099) and [b2848a54b0](https://github.com/facebook/react-native/commit/b2848a54b05470b3e258c935dd33b8c11a31b3c3) ) +- On Android, **TextInput** now takes `onKeyPress` like iOS ([c9ff0bc212](https://github.com/facebook/react-native/commit/c9ff0bc212b680232f7379fba7b9332927075c3c) by [@joshyhargreaves](https://github.com/joshyhargreaves)) + +### Changed + +- ⬆️ Metro to v0.24.2 ([2e008bc464](https://github.com/facebook/react-native/commit/2e008bc464f94df013794d3da6e9d4e4722151a0) and [0b5e8b4852](https://github.com/facebook/react-native/commit/0b5e8b485229957086d416c307f07c75a4139ffa) by [@rafeca](https://github.com/rafeca)) +- ⬆️ Flow to v0.63 ([6b95c4fb14](https://github.com/facebook/react-native/commit/6b95c4fb142a7015b2afca50cc19eec0b8913d8c) by [@gabelevi](https://github.com/gabelevi)) +- ⬆️ Danger to v2.0 ([b750e3b21b](https://github.com/facebook/react-native/commit/b750e3b21bc5c135773e8de53c5663bdf6266951) by [@hramos](https://github.com/hramos)) +- ⬆️ Jest to v22.0.0 ([4803419dc8](https://github.com/facebook/react-native/commit/4803419dc8406b6892f20cdfb448a01c16ad4338) by [@mjesun](https://github.com/mjesun)) +- 💄 Bundler is now called Metro Bundler in the terminal ([654d7595fe](https://github.com/facebook/react-native/commit/654d7595fe5766667c015307129e75d8986482e1) by [@edcs](https://github.com/edcs)) +- 📝 Update getting started url on Android CLI ([6661633390](https://github.com/facebook/react-native/commit/6661633390276f707faa60509b2805a83929e747)) +- 🐳 Dockerfile uses newest Android SDK, Buck, and new Docker tags have been pushed ([4fbfbe6bb0](https://github.com/facebook/react-native/commit/4fbfbe6bb0e0eaaf12ec713888bf2c6a347f0f96) and [c547f783c4](https://github.com/facebook/react-native/commit/c547f783c440019a4a87ba55b668b3af5ff8fc91) by [@hramos](https://github.com/hramos)) +- 📝 Update repo docs to use HTTPS ([33a2e533b7](https://github.com/facebook/react-native/commit/33a2e533b76d35c1b9fb32e926f7c2c27cb616e9) by [@him2him2](https://github.com/him2him2)) +- 🎨 Make **ScrollResponder** follow code style ([45e6fcdba0](https://github.com/facebook/react-native/commit/45e6fcdba089900555faa63fe8e37b4bd4a7700a) by [@TheSavior](https://github.com/TheSavior)) +- **VirtualizedList** now requires a windowSize greater than 0 ([3559e42c55](https://github.com/facebook/react-native/commit/3559e42c55366bacd9bb5178ecab64f95e9a8ea7)) +- react-devtools works with emulator and real devices now without needing to tweak the devServer value ([fa574c6092](https://github.com/facebook/react-native/commit/fa574c60920588e29d7b642e547e240ac8655e66) by [@jhen0409](https://github.com/jhen0409)) +- 📝 Clarify use of Flow props types in react-native-cli's template project ([9b147a53d1](https://github.com/facebook/react-native/commit/9b147a53d1ab1e14d7ef5b436f1e140a28a5d6a3) by [@hramos](https://github.com/hramos)) +- 📝 Add docs for `isInspectable` ([59c7967627](https://github.com/facebook/react-native/commit/59c79676277abaaaf61388309429c77164c3de4b) by [@bnham](https://github.com/bnham)) +- ✅ More Flow improvements (**Text**, **SectionList**, and others) ([f71f4e7906](https://github.com/facebook/react-native/commit/f71f4e7906648766e1a5b630abbad8935daef955), [632f1202ab](https://github.com/facebook/react-native/commit/632f1202ab3f9dd300a53f096bc15325e0d8f6c1), and [a8391bde7d](https://github.com/facebook/react-native/commit/a8391bde7d757d01521a6d12170fb9090c17a6a0) by [@yungsters](https://github.com/yungsters), [@samwgoldman](https://github.com/samwgoldman), and others) +- Various code cleanup to satisfy linting errors and standards ([b0319f3293](https://github.com/facebook/react-native/commit/b0319f3293b553c105b813dd12bff7d55940e60b), [dd4611721d](https://github.com/facebook/react-native/commit/dd4611721d0ad49ceaf4514df1b47cf2753b9ae6), and [7f58189605](https://github.com/facebook/react-native/commit/7f5818960596a2a18b7d427fd23d46396c05bee5) by [@ayc1](https://github.com/ayc1), [@grabbou](https://github.com/grabbou), and [@ide](https://github.com/ide)) + +#### iOS exclusive changes + +- 🔥⚡️ iOS UI Manager cleanup and optimizations ([0ec1017660](https://github.com/facebook/react-native/commit/0ec1017660602d6b3ae84b4d7a444cbd49ba0d53), [0ae4c47daa](https://github.com/facebook/react-native/commit/0ae4c47daa6280d2931d8bbf89612b2f1cb106d4), [2679f3efb6](https://github.com/facebook/react-native/commit/2679f3efb69bc7b0db1840b4ea59ebe791a54dd2),and [d9e5b313bb](https://github.com/facebook/react-native/commit/d9e5b313bb63a1ec0d402a96539c6df29bc72c42) by [@shergin](https://github.com/shergin)) +- If the inspector tries to handle a wrapped event but there is no connection, log a warning rather than a Redbox ([30da2622e2](https://github.com/facebook/react-native/commit/30da2622e222c338421508ce6e5663155fc874ef) by [@bnham](https://github.com/bnham)) +- Various under-the-covers changes around the bridge, RCTShadowView, RCTSurface, and a few others ([c3139d798a](https://github.com/facebook/react-native/commit/c3139d798af633bb81bf0da6df05b3c0beb0ced4), [2789ba016b](https://github.com/facebook/react-native/commit/2789ba016bfddace1407473769e933795333cfab), [b8e60a3ca3](https://github.com/facebook/react-native/commit/b8e60a3ca3314d79e9c38ee8c7995df81a27624c), [099b28006b](https://github.com/facebook/react-native/commit/099b28006b59abb11eae1f27424566b280860b0d), [b263560c73](https://github.com/facebook/react-native/commit/b263560c73af5559fdc3bba411f16c588abbffef), [19a9c5e41d](https://github.com/facebook/react-native/commit/19a9c5e41da0aa6ee28a54772edcb92daa498561), [d3b41e0da3](https://github.com/facebook/react-native/commit/d3b41e0da37c08ab0637d9f70d612e50b6f5e63c), [b2a251948f](https://github.com/facebook/react-native/commit/b2a251948f3309d2b1d0d533fb2fa74d2f8a10b8), [870bc4807a](https://github.com/facebook/react-native/commit/870bc4807a8c3f90498cf4c2ed3c030cb7b43ef9), [176a578238](https://github.com/facebook/react-native/commit/176a578238566ad857c0911e127669f1ee82107d), [c491b22233](https://github.com/facebook/react-native/commit/c491b2223313676bd4900de7a8c70a10051fa9f0), [c75612219e](https://github.com/facebook/react-native/commit/c75612219ef0c99d1ddca0aadf354f20de27608c), and[c01a171ed8](https://github.com/facebook/react-native/commit/c01a171ed881fb91a972ed475011f85697a29341) by [@shergin](https://github.com/shergin)) +- Changed to use _boost-for-react-native_ cocoapod, which speeds up `pod install` a ton ([d40db3a715](https://github.com/facebook/react-native/commit/d40db3a715afaf1cde4a5e231e96e46b2808bbef) by [@CFKevinRef](https://github.com/CFKevinRef)) + +#### Android exclusive changes + +- Include scroll momentum info when there are scroll events from Android ([c49d249fd7](https://github.com/facebook/react-native/commit/c49d249fd7c274f02e6018892992bcd273d6a465) by [@wwalser](https://github.com/wwalser)) +- Yoga's mkfile for Android now uses wildcard instead of manual file addition ([d89901fa60](https://github.com/facebook/react-native/commit/d89901fa6002802dc9d744bfe3e5e712d6a411a1) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) + +### Removed + +- **TextInput** no longer has the `autoGrow` prop, since this is platform-default behavior now ([dabb78b127](https://github.com/facebook/react-native/commit/dabb78b1278d922e18b2a84059460689da12578b) by [@shergin](https://github.com/shergin)) + +#### iOS exclusive removals + +- Updates to the bridge in order to enable future rendering optimizations ([d2dc451407](https://github.com/facebook/react-native/commit/d2dc4514077ae868f85d45ccdcc7c69df7b7648b) by [@shergin](https://github.com/shergin)) + +### Fixed + +- Do not set `minify=true` when calculating the list of dependencies for the CLI ([4a1bb8fe8d](https://github.com/facebook/react-native/commit/4a1bb8fe8dfd36ea207c0683d683bb8b22a282a5) by [@rafeca](https://github.com/rafeca)) +- 👷 Update CODEOWNERS now that the docs are in a separate repository ([85ff264445](https://github.com/facebook/react-native/commit/85ff264445aa4b9cf0b91aaca5764bb56caba997) by [@hramos](https://github.com/hramos)) +- Fixed a broken link in react-native-git-upgrade's readme ([bbedf2da9a](https://github.com/facebook/react-native/commit/bbedf2da9a3a091eeb687d43029f7d2450cf2612) by [@Taym95](https://github.com/Taym95)) +- 🤡 Do not use Node 8.x specific Stream.final for FS mocks ([4216cdef13](https://github.com/facebook/react-native/commit/4216cdef13c9ed47b9c746b39a0ddfdaf846d495) by [@hramos](https://github.com/hramos)) +- Fix virtualized cell keys for list headers and footers ([a010a0cebd](https://github.com/facebook/react-native/commit/a010a0cebd4afc0d88336c2c265a5d9dbb19918f)) +- Fix warnings of casting and null pointer handling in Yoga ([a8d4666651](https://github.com/facebook/react-native/commit/a8d46666518944a178e85c179da8047234c2d8fb) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) +- Fix broken buck failures on master ([4e767013ed](https://github.com/facebook/react-native/commit/4e767013ed73fb89f69f2e59626d6dcf3bb77684) by [@hramos](https://github.com/hramos)) +- **RefreshControl** appears correctly when expected on initial render of a **FlatList** again ([ed5872e2cc](https://github.com/facebook/react-native/commit/ed5872e2cca955ee407e87e37e13c7fed182199a) by [@vonovak](https://github.com/vonovak)) +- Fixed JS debugger CORS issue ([29f8354c19](https://github.com/facebook/react-native/commit/29f8354c1946a6325e9020b9ef5ee4ccdf0fa51f) by [@njbmartin](https://github.com/njbmartin)) + +#### Android exclusive fixes + +- Fix position of dev loading view on Android API < 20 ([7ff6657985](https://github.com/facebook/react-native/commit/7ff6657985a09bd2572615d16403fba3af709859) by [@kmagiera](https://github.com/kmagiera)) +- Fix Modal not disappearing when navigating from inside a Modal to another activity ([e5c2a66897](https://github.com/facebook/react-native/commit/e5c2a66897b9c562c549e63adcf70783ea34c418) + +#### iOS exclusive fixes + +- Fix regression introduced where layout wouldn't occur in some situations ([46be5bf71c](https://github.com/facebook/react-native/commit/46be5bf71c78d33cda5cb496c475dcfb8e229346) by [@shergin](https://github.com/shergin)) +- Fixed double initial prop applying for newly created views ([0ec1017660](https://github.com/facebook/react-native/commit/0ec1017660602d6b3ae84b4d7a444cbd49ba0d53) by [@shergin](https://github.com/shergin)) +- tvOS build now works again ([3bd89867d6](https://github.com/facebook/react-native/commit/3bd89867d6f23547f07b9b3a569d5a62971004f6) by [@dlowder-salesforce](https://github.com/dlowder-salesforce)) + +### Other + +Below is a list of the remaining, low-level changes that made it into this release of React Native. + +- Remove "prepareReact" call from the bridge ([80f9e1f7de](https://github.com/facebook/react-native/commit/80f9e1f7de407ea417cecb04b3ba20b05696b478) and [56a42e57d0](https://github.com/facebook/react-native/commit/56a42e57d05ff609e8fce35dcb5e9db7938db801) by [@fromcelticpark](https://github.com/fromcelticpark)) +- Add explicit componentControllerClass to CKComponent for RCTSurface ([ab972708a8](https://github.com/facebook/react-native/commit/ab972708a8dcc9b37c19843f2fe134928a7c7a3f)) +- Changes to RCTShadowView to increase RCTSurface performance ([f96f9c5fd6](https://github.com/facebook/react-native/commit/f96f9c5fd692000f561e87cba68642ef7daf43e7) by [@shergin](https://github.com/shergin)) +- Designated methods to control dirty propagation ([af226ef949](https://github.com/facebook/react-native/commit/af226ef949f3a21ef68a6e6b9fbd4cc06fa05152) by [@shergin](https://github.com/shergin)) +- Add missing tvOS header ([49cbca7464](https://github.com/facebook/react-native/commit/49cbca7464e27c34105122459ae29cc3b1247513) by [@grabbou](https://github.com/grabbou)) +- On Android, seperate logic to initialize JS from starting the app ([4996b9aeb4](https://github.com/facebook/react-native/commit/4996b9aeb4127892b7579b45927dec14833b8b4d) by [@axe-fb](https://github.com/axe-fb)) +- ♻️ JS linting was cleaned up: removed unused libs, strengthened the rules, removed unneeded rules, prevent disabled tests, and more ([2815ada238](https://github.com/facebook/react-native/commit/2815ada23872fc28dc8dd5a9833962cb73f452eb), [183c316f4c](https://github.com/facebook/react-native/commit/183c316f4c869804b88cffe40614c84ac0a472d0), [9c67e749d8](https://github.com/facebook/react-native/commit/9c67e749d8f63cf14ece201ec19eee4676f96a85), [79902f99b8](https://github.com/facebook/react-native/commit/79902f99b81f538042b38a857182c2e5adbfd006), [9a36872f0c](https://github.com/facebook/react-native/commit/9a36872f0c7ba03a92fabf65e4d659d6861ea786), [67a3c42d1a](https://github.com/facebook/react-native/commit/67a3c42d1a29b6fa1375f7445d1c9b4429939bae), [b826596700](https://github.com/facebook/react-native/commit/b82659670041d0e472f68c0a14b3ef5b962db09b), [a1a0a69546](https://github.com/facebook/react-native/commit/a1a0a6954635141ce6c167816b67674aa5c31062), and [11a495cb32](https://github.com/facebook/react-native/commit/11a495cb3235ebbc2ad890e92ec612fd5316bffb) by [@TheSavior](https://github.com/TheSavior)) +- 👷 Separate JS lint and flow checks from tests ([5ea5683d01](https://github.com/facebook/react-native/commit/5ea5683d01487b49c814fca6e11a818b9a777239) by [@hramos](https://github.com/hramos)) +- 👷 Fix Buck in build config to enable CI ([796122d8f3](https://github.com/facebook/react-native/commit/796122d8f3b825c0bf0c138c662f3477f8bab123), [7c3a61f3b6](https://github.com/facebook/react-native/commit/7c3a61f3b610e219fd798eccd330deb9a2471253), [82b123e744](https://github.com/facebook/react-native/commit/82b123e744b87cc59c96b4e82af9ed03981b4f42) by [@grabbou](https://github.com/grabbou)) +- ♻️ Various refactoring within the YGNode implementation ([28968e2c0b](https://github.com/facebook/react-native/commit/28968e2c0ba23db9af12b47681f165d29d0f132d), [0a9e652bdd](https://github.com/facebook/react-native/commit/0a9e652bdd031d53d712e2e9610fb608bfa54ff1), [6627d7723c](https://github.com/facebook/react-native/commit/6627d7723c2df244ccc8a462bd98499cc11da2e2), and [d85da86dc7](https://github.com/facebook/react-native/commit/d85da86dc7c7833e71099c6a621547bc3cec8d4f), [a163f70f87](https://github.com/facebook/react-native/commit/a163f70f875dff4428eebd989bfaf28dda6551bf) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) +- Fix ReactLegacy and delete RCTViewControllerProtocol ([a0ff8c7706](https://github.com/facebook/react-native/commit/a0ff8c7706fc37bdce78c9ec51da320f78d16a24) by [@javache](https://github.com/javache)) +- Define internal FB macro for OSS builds; remove some unused definitions ([077c3ab349](https://github.com/facebook/react-native/commit/077c3ab34952f4b442abdd7a47ab54ca4bd0ba2e) and ([a6a66c5b39](https://github.com/facebook/react-native/commit/a6a66c5b3943443e4016f32407e4a4f8d707e387) by [@ttsugriy](https://github.com/ttsugriy)) +- RNTester: Relax Bridge Release Check ([e3c6f38773](https://github.com/facebook/react-native/commit/e3c6f38773d0b578794726033d4fabbfa48d1c7b) by [@yungsters](https://github.com/yungsters)) +- Remove embeddedBundleURL from the asset resolver ([489b98bf10](https://github.com/facebook/react-native/commit/489b98bf1006818ba985e93478a088c0e1e1aae7)) +- Do not set FB_ASSERTION_ENABLED ([4cdbb77c33](https://github.com/facebook/react-native/commit/4cdbb77c3363e120877ff66f39cdcf51d668df7d) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) +- JSBigString to MAP_PRIVATE not MAP_SHARED ([f9f40cd3e4](https://github.com/facebook/react-native/commit/f9f40cd3e486314cd75bda8722147f2f0f5b8fe1)) +- Fixed black ARTSurfaceView ([5c8481e836](https://github.com/facebook/react-native/commit/5c8481e83646b9cae482a803c878fb007f370035) by [@shergin](https://github.com/shergin)) +- Kill orphaned marker end in JSCExecutor ([6ad1f0957a](https://github.com/facebook/react-native/commit/6ad1f0957a020cb57b177ab015c17aa883e1f0ad) by [@michalgr](https://github.com/michalgr)) +- Make YGNode as c++ struct with properties exposed through accessors ([f1055bcac8](https://github.com/facebook/react-native/commit/f1055bcac8b580c40f9646687e7a950fb6864c74) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) +- 🔖 ...and now we're at 0.53.0-rc.0 🎁 ([0b996577e3](https://github.com/facebook/react-native/commit/0b996577e321d439aa6ede4c7400ea76efb7816a) by [@grabbou](https://github.com/grabbou)) + +## v0.52.0 + +> This changelog has been prepared by Ryan Turner (@turnrye) - thank you for +> your time and making such a detailed changelog 🔥🔥 + +This release had a lot of work around the bundler and packager, a ton of +bugfixes, and updates to many of React Native's dependencies. Lots of +under-the-hood work was done as well to improve the layout engine. Happy new +year! + +> If you would like to help us with the next release changelog, please contact +> @grabbou + +### Added + +- Prettier has a config and an npm script; try it out with `npm run prettier` + ([164591218f](https://github.com/facebook/react-native/commit/164591218f5fab7d386e057e0d51b9c1fe30b0a9) by + [@janicduplessis](https://github.com/janicduplessis)) +- **Debug JS in Nuclide** is now an option in the dev menu 🐜 + ([7c7108a1e8](https://github.com/facebook/react-native/commit/7c7108a1e8e9354d8aeb2f0ff712561d8aa19408) and + [de424cc291](https://github.com/facebook/react-native/commit/de424cc291523a8f4e3d33059b725d5b85f31611)) +- Introducing **PlatformOS** – it looks a lot like **Platform**, but with a + simplified API + ([5ee27ff755](https://github.com/facebook/react-native/commit/5ee27ff7552a5707a6e6bdb3f23e7378f978a2f7) by + [@brishin](https://github.com/brishin)) +- New experimental _RCTSurface_: measure and layout a UI in a thread-safe and + synchronous manner + ([be6976d6fa](https://github.com/facebook/react-native/commit/be6976d6faa333311405bd6184300bbd8da6cbca), + [7df58e23a3](https://github.com/facebook/react-native/commit/7df58e23a3a265b0df0edc753cc79a153fec90d8), + [e75bd87a76](https://github.com/facebook/react-native/commit/e75bd87a76726a9b075061ef76156705b3c1e872), + [aa83b5a0ca](https://github.com/facebook/react-native/commit/aa83b5a0ca30736b2800833bcc6149dcbe8436fa), + [081f7d14ad](https://github.com/facebook/react-native/commit/081f7d14aded077a7627404e5e2d48163a5707ad), + [da17b237e1](https://github.com/facebook/react-native/commit/da17b237e15e20adf20d6b917349d6389efb17fd), + [e9e0cd7ab8](https://github.com/facebook/react-native/commit/e9e0cd7ab86c98bcd3201e306e96532685d8de1d), + [43b2509320](https://github.com/facebook/react-native/commit/43b25093202472c5af07d4f393d831e4d1484b07), + [ba6075120a](https://github.com/facebook/react-native/commit/ba6075120af9c0086b449aafa7420913fa58f746), + [d71d28f094](https://github.com/facebook/react-native/commit/d71d28f09495a1e2802db169e2d0cd1ec5bd5973), + [4d37cf0fbc](https://github.com/facebook/react-native/commit/4d37cf0fbcc529ad75eb4a04a185036a887e42c2), and + [d021dd25da](https://github.com/facebook/react-native/commit/d021dd25da92d84c62c9a77049bb798e3b891447) by + [@maicki](https://github.com/maicki) and + [@shergin](https://github.com/shergin)) +- Experimental **SwipeableRow**'s datasource now has a `getLastRowID` method + ([d79e245d19](https://github.com/facebook/react-native/commit/d79e245d19f7f246322bc657b407198b15cb1b98)) +- [React Native monthly + #5](https://reactnative.dev/blog/2017/11/06/react-native-monthly-5.html) + was added ([3c5a55ddc2](https://github.com/facebook/react-native/commit/3c5a55ddc21197cfa013dc6222e398138759b5d3) + by [@tenodi](https://github.com/tenodi)) + +#### iOS Specific + +- **DatePickerIOS** now takes **locale** 🌍 + ([fd9c3618fc](https://github.com/facebook/react-native/commit/fd9c3618fcd3dc80f9abf3da779627704c7350e4) by + [@RobertPaul01](https://github.com/RobertPaul01)) +- **CameraRoll** can now **deletePhotos** 📸 + ([554e873f58](https://github.com/facebook/react-native/commit/554e873f585ea05ce1e9fe4ff71173c47b3c259c) by + [@fxfactorial](https://github.com/fxfactorial)) +- There's now an API to specify a different directory for iOS image assets + ([8f9b291224](https://github.com/facebook/react-native/commit/8f9b291224d1ca57a5f90200ec4687abb4706f4b)) +- Support for [custom accessibility + actions](https://developer.apple.com/documentation/uikit/uiaccessibilitycustomaction) + on iOS ([36ad813899](https://github.com/facebook/react-native/commit/36ad8138997c195b8728906ceb51bd31338b6a24) by + [@ericdavmsft](https://github.com/ericdavmsft)) + +### Deprecated + +- Ignore YellowBox warnings with `YellowBox.ignoreWarnings([...])` rather than + `console.ignoredYellowBox = [...]` + ([26038f50bb](https://github.com/facebook/react-native/commit/26038f50bb003eec3770e2b66d428fbb739f1ce2) by + [@wli](https://github.com/wli)) + +### Changed + +- Metro-bundler is now metro, and it's v0.24.1; there were some performance + increases at the cost of a few breaking changes; improved tests of the bundler + too ([0bbd9f042a](https://github.com/facebook/react-native/commit/0bbd9f042a8ad7c7be094bd7636ca767c6f7b231), + [a2fd3fcef8](https://github.com/facebook/react-native/commit/a2fd3fcef84e916b36ef7753dff69b7c1b307890), + [503b4521a6](https://github.com/facebook/react-native/commit/503b4521a6ce6bb2282631df616440fa71416d25), + [654fed46f4](https://github.com/facebook/react-native/commit/654fed46f49b5002096ff55c2e8523af48b22c24), + [0091496891](https://github.com/facebook/react-native/commit/009149689119e180415f8138b2827366768fc1d3), + [aba148f733](https://github.com/facebook/react-native/commit/aba148f733e85a88d4be07b3b8ca37c43cf6a51e), + [3d5dc872a4](https://github.com/facebook/react-native/commit/3d5dc872a4eefa1557554b3b338227959d166370), + [48019a0c2a](https://github.com/facebook/react-native/commit/48019a0c2a9a45d51a4faab1d5bef52949f4b5c5), + [ecec4319c4](https://github.com/facebook/react-native/commit/ecec4319c4fda9bebc90216d5340442b2a5725df), + [f4d627c8fa](https://github.com/facebook/react-native/commit/f4d627c8faeb034eac8053fd253f17e42b85f2f2), + [f871d25eb4](https://github.com/facebook/react-native/commit/f871d25eb48dca224bb3796aa9cb5d714292662f), + [a7b231a327](https://github.com/facebook/react-native/commit/a7b231a3278e4fc2d7e4269ce106f22712f2e5a8), + [830b431453](https://github.com/facebook/react-native/commit/830b43145381e6e322569450affddba73f7dc2d1), + [29dafa1a86](https://github.com/facebook/react-native/commit/29dafa1a8644f7a537499074df334bab8da4ad00), + [7a5d5a4035](https://github.com/facebook/react-native/commit/7a5d5a40357bedfb24a01ff1160481656fda9554), + [4cd685a1e0](https://github.com/facebook/react-native/commit/4cd685a1e0a2ae07df02702dbf4702e407773df5), + [d326c86051](https://github.com/facebook/react-native/commit/d326c860519c5165c6e86fb4f3ce378ed055157c), + [231c7a0304](https://github.com/facebook/react-native/commit/231c7a03043b9fb3c4bf81251ad099bab0ba05c2), + [7d969a05de](https://github.com/facebook/react-native/commit/7d969a05de6a45543bc31a3b982828865bc57cdb), + [ae517307e7](https://github.com/facebook/react-native/commit/ae517307e76d977f813e5b880f3b7f42a20f461d), + [f587f8d51d](https://github.com/facebook/react-native/commit/f587f8d51dc57e6b9eb66edfbe58ee520a6cc568), + [fbf0aed3ac](https://github.com/facebook/react-native/commit/fbf0aed3acc056b5fd069af75fcae14246439a48), + [e9393f694d](https://github.com/facebook/react-native/commit/e9393f694d8f0d0190a3576fd65a65f747f8cce2), and + [968c88d141](https://github.com/facebook/react-native/commit/968c88d1410eac5b793345bacce6052f518fda8f) by + [@cpojer](https://github.com/cpojer), [@hramos](https://github.com/hramos), + [@jeanlauliac](https://github.com/jeanlauliac), and + [@rafeca](https://github.com/rafeca) + ) +- React is now v16.2.0, and it took react-test-renderer along with it; [now with + more + fragments!](https://react.dev/blog/2017/11/28/react-v16.2.0-fragment-support.html) + 🎉 ([c7f37074ac](https://github.com/facebook/react-native/commit/c7f37074ac89f7e568ca26a6bad3bdb02812c39f) and + [cd938d731c](https://github.com/facebook/react-native/commit/cd938d731c7531a683c050cd829a543d145e3dc1) by + [@bvaughn](https://github.com/bvaughn)) +- Jest is now v21.3.0-beta.13 + ([16bbd908e7](https://github.com/facebook/react-native/commit/16bbd908e72577e7d109397916323a0eeffce8d4) and + [ec2ea58e57](https://github.com/facebook/react-native/commit/ec2ea58e57872bfa077d9c9a5e1e8b253c6b37b3) by + [@mjesun](https://github.com/mjesun)) +- Flow is now v0.61.0, and there were a ton of Flow fixes/coverage improvements + made ([914ae93336](https://github.com/facebook/react-native/commit/914ae9333678df4888e3c72898991c8430625cce), + [eb0d6470e5](https://github.com/facebook/react-native/commit/eb0d6470e54663538610a70ab0bae9847eb33673), + [c8e72bb8b8](https://github.com/facebook/react-native/commit/c8e72bb8b8317bcdcb4fe2ff85978c7db70f4461), + [2d4bedba0f](https://github.com/facebook/react-native/commit/2d4bedba0f6a8f2cfe597a1044822eb635d5e243), + [e0202e459f](https://github.com/facebook/react-native/commit/e0202e459fd0181db551d0025ef562d7998186b0), + [2be3ae1ff2](https://github.com/facebook/react-native/commit/2be3ae1ff2441c0ee3f2b9255c23dc49ada852fe), + [22a1419900](https://github.com/facebook/react-native/commit/22a14199000ea994f24f6fe387ea26647af3c128), + [6ae0b344e5](https://github.com/facebook/react-native/commit/6ae0b344e5c221657287d1fc1511be520a6f6e58), + [76a2ca4c9c](https://github.com/facebook/react-native/commit/76a2ca4c9c09c9bdf922154c28040138a44ae672), + [3259353fce](https://github.com/facebook/react-native/commit/3259353fcec0dd9ea66de750a694c226f99f483d), + [e6c1fb7212](https://github.com/facebook/react-native/commit/e6c1fb72128fb13436028c2df9cdccf6ccfccb67), + [61d046be3c](https://github.com/facebook/react-native/commit/61d046be3c9b00f6a4d4f492d558a961a6d4210f), + [820cfa1f3b](https://github.com/facebook/react-native/commit/820cfa1f3b79406e47cb873773cadafefe0effb1), + [240039c6f2](https://github.com/facebook/react-native/commit/240039c6f2d8db700ebc15404b0acc2a49068249), + [343c5a97a0](https://github.com/facebook/react-native/commit/343c5a97a013669745cf3938728539001d3076e6), + [5f8d8e90c2](https://github.com/facebook/react-native/commit/5f8d8e90c2c43127b8a5d2fc5d18f16185c7a67e), and + [da047966e4](https://github.com/facebook/react-native/commit/da047966e4c2064a48e02ff74830c99808d8194b) by + [@Ashoat](https://github.com/Ashoat), + [@calebmer](https://github.com/calebmer), + [@cdlewis](https://github.com/cdlewis), + [@deecewan](https://github.com/deecewan), + [@grabbou](https://github.com/grabbou), + [@jamesisaac](https://github.com/jamesisaac), + [@mroch](https://github.com/mroch), [@nmn](https://github.com/nmn), + [@nmote](https://github.com/nmote), [@sahrens](https://github.com/sahrens), + [@samwgoldman](https://github.com/samwgoldman), + [@TheSavior](https://github.com/TheSavior), and others) +- react-devtools-core is now v3.0.0 + ([a7d46ea970](https://github.com/facebook/react-native/commit/a7d46ea97012bdcc644e3397bbf60bd3cb37e9eb) by + [@rsnara](https://github.com/rsnara)) +- Split out docs to [their own + repo](https://github.com/facebook/react-native-website/tree/master/docs) (and + a few formatting fixes along the journey) 👋 + ([2d86618e7e](https://github.com/facebook/react-native/commit/2d86618e7ef477cdfc2ed510c7bc05d41dbfe972), + [64d80b13db](https://github.com/facebook/react-native/commit/64d80b13db3dd28bb5d93cbedf511ae8f91e2127), + [3362da421c](https://github.com/facebook/react-native/commit/3362da421ce919fc6f4f1bda29b59e2e3bfe02de), + [75123c614b](https://github.com/facebook/react-native/commit/75123c614bb5a61c383cdc247230b3a76c76e14d), and + [79e24ede40](https://github.com/facebook/react-native/commit/79e24ede40b2508aaa77b8ff3876d3dbf4cfe6d8) by + [@hramos](https://github.com/hramos)). +- **TouchableHighlight** now has a default delayPressOut value of 100; it was + also refactored a bit for style + ([9a31fa5fd6](https://github.com/facebook/react-native/commit/9a31fa5fd62fa101b2a76c69b56248d7f5ba9876) by + [@sahrens](https://github.com/sahrens)) +- When in a dev build, more robustly validate arguments for native methods + ([ea2e2c54cb](https://github.com/facebook/react-native/commit/ea2e2c54cb4d1a99b41aaa98eaf51696d34770dd) by + [@mhorowitz](https://github.com/mhorowitz)) +- On integration tests, report _all_ errors + ([3bcb912786](https://github.com/facebook/react-native/commit/3bcb9127866ef60b3697553e98a3ae279d02290a) by + [@sahrens](https://github.com/sahrens)) +- Yoga has less technical debt, thanks to replacing _YGNodeList_ with vectors + ([b08a912f11](https://github.com/facebook/react-native/commit/b08a912f11c729f3fe76700c6614f9e6165ae1a1) by + [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) +- Yoga is now cpp, compiled as _c++1y_ + ([d7ab9496bc](https://github.com/facebook/react-native/commit/d7ab9496bc95f7b720fd6db1ed503af1c461e84d) by + [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) +- Bundle segments are handled better and used more + ([681278947e](https://github.com/facebook/react-native/commit/681278947eb4039a1d7a65f1edfeef25ae055a4f), + [a47431ed74](https://github.com/facebook/react-native/commit/a47431ed74f0b7b2a03ca48e84f2243d08ef3bdd), + [963c61d4d5](https://github.com/facebook/react-native/commit/963c61d4d546c94b689281ca1f5105ad050e10ff), + [b9f21dc2be](https://github.com/facebook/react-native/commit/b9f21dc2be14cd51543e6b2d1e63a861e5f433d1), + [f1258181ee](https://github.com/facebook/react-native/commit/f1258181eec84f73651d2fabd0d23764b8990ff8), and + [1988ba1d79](https://github.com/facebook/react-native/commit/1988ba1d7967dca04376e7e631e8910e5e79a6a7) by + [@fromcelticpark](https://github.com/fromcelticpark) and + [@jeanlauliac](https://github.com/jeanlauliac)) +- _packager-worker-for-buck_ has better tests + ([7fd5aa84a1](https://github.com/facebook/react-native/commit/7fd5aa84a1ef1744d01e7e877183b1f004216d00) by + [@jeanlauliac](https://github.com/jeanlauliac)) +- _RCTUIManager_ has less technical debt + ([46be5bf71c](https://github.com/facebook/react-native/commit/46be5bf71c78d33cda5cb496c475dcfb8e229346), + [60dc9bed00](https://github.com/facebook/react-native/commit/60dc9bed00cc13652752bf84f83c920ce66d5e39), and + [21714fe197](https://github.com/facebook/react-native/commit/21714fe1979ccbd62d665f383625f4ece8cf888e) by + [@shergin](https://github.com/shergin)) +- Numerous bridge changes, especially around URL resolution + ([e7bd0f056b](https://github.com/facebook/react-native/commit/e7bd0f056bf4edca1f0529d6eed03bbaaaca586a), + [260e6d2355](https://github.com/facebook/react-native/commit/260e6d23554a8e7f1743263894c9ca9a0cfbf01e), + [4894ac430d](https://github.com/facebook/react-native/commit/4894ac430d6df1118ce48f644fd8cf5bfce6344f), + [b983de9c54](https://github.com/facebook/react-native/commit/b983de9c5460e24c95a9a67f02695cd1c5f31bc5), + [b0193b098c](https://github.com/facebook/react-native/commit/b0193b098cdbd915bba90e1ab0b695ba44346f44), + [ae5ef653cb](https://github.com/facebook/react-native/commit/ae5ef653cbc4c03fe5edb5d4b0002e38cbb6f458), and + [1d6ce2311f](https://github.com/facebook/react-native/commit/1d6ce2311f6a51821b33c5473414d70c8bd34425) by + [@fromcelticpark](https://github.com/fromcelticpark) and others) +- Various cleanup and refactoring + ([053776338e](https://github.com/facebook/react-native/commit/053776338ea44c31f3671cb4502853da0c88e55a), + [0984f29a32](https://github.com/facebook/react-native/commit/0984f29a320ce7e40e8bc2a6c78b080908fa1384), + [6c70975689](https://github.com/facebook/react-native/commit/6c70975689d0f0839e6c2db9a9a25c3023f5be7b), + [d950dc6a21](https://github.com/facebook/react-native/commit/d950dc6a21c5cc1e736993b2ecc16abae086389e), + [70c359000a](https://github.com/facebook/react-native/commit/70c359000a2df091c3939f4c19db6024af992d43), + [cfa2bbf2f6](https://github.com/facebook/react-native/commit/cfa2bbf2f692d0bc5600d7e369a9a91272930ca6), and + [850efa8650](https://github.com/facebook/react-native/commit/850efa86508b19d800ff8cbdc725402c006db1a2) by + [@bnham](https://github.com/bnham), + [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar), and others) +- Jest preprocessing now uses the AST from metro + ([2ae255a6ea](https://github.com/facebook/react-native/commit/2ae255a6eaf820992bdf19799bb4403f3bbdcd5b) and + [d5b59517c2](https://github.com/facebook/react-native/commit/d5b59517c274874d7ce21e5c26d28b42ae389723) by + [@rafeca](https://github.com/rafeca)) +- `renderApplication()` now supports async initial render + ([1b22d49ae8](https://github.com/facebook/react-native/commit/1b22d49ae8945680dee4fd01e3fbb78b1e443e01) by + [@bvaughn](https://github.com/bvaughn)) +- Welcome [@lwinkyawmyat](https://github.com/lwinkyawmyat) to the React Native + GitHub Issue Task Force + ([4ebe76d559](https://github.com/facebook/react-native/commit/4ebe76d5598621160ffcf3ea8bc87c3ad1c1a2f8) by + [@lwinkyawmyat](https://github.com/lwinkyawmyat)) + +#### Android exclusive changes + +- Native components on Android register lazily rather than via ViewManager + ([1b71e03932](https://github.com/facebook/react-native/commit/1b71e03932f44e212b297b2c1e02100b6de74b93)) +- Android debug overlays (like **RedBox**, dev menu, loading) are no longer are + system overlays; they're now part of the _currentActivity_ + ([d19afc73f5](https://github.com/facebook/react-native/commit/d19afc73f5048f81656d0b4424232ce6d69a6368) by + [@kmagiera](https://github.com/kmagiera)) + +#### iOS exclusive changes + +- Improve iOS's _accessibilityLabel_ performance by up to 20% 📈 + ([19b0a65c5e](https://github.com/facebook/react-native/commit/19b0a65c5ecc4f41fea98a1e752785d6dbb6ea05) by + [@chendo](https://github.com/chendo)) + +### Fixed + +- Fix `backgroundColor` on **TouchableHighlight** + ([5a1171ebfa](https://github.com/facebook/react-native/commit/5a1171ebfaaedd9c7d5f1bfcf306049c3671a733) by + [@sahrens](https://github.com/sahrens)) +- Various corrections in messages, comments, and docblocks + ([58c3bc4901](https://github.com/facebook/react-native/commit/58c3bc490143b8d7831a00289e2565f49f5389ef), + [354e1cb508](https://github.com/facebook/react-native/commit/354e1cb5088a43fd4116504a34a65ca53c4de71b), + [58edf024a1](https://github.com/facebook/react-native/commit/58edf024a1ed3a71ef04f124546ee97496b6502f), + [b9e7006cc6](https://github.com/facebook/react-native/commit/b9e7006cc6dc2b0801ea0c776ba00cdea2204151), + [d2f0abdf4e](https://github.com/facebook/react-native/commit/d2f0abdf4ea94fbb3e2a5c7fb53ff5d1cf6abede), + [94cd9f5591](https://github.com/facebook/react-native/commit/94cd9f55915973355cdb63276b71f90df10281db), + [8547b7e111](https://github.com/facebook/react-native/commit/8547b7e11163d545b7b99d4bdd063ef71129d62c), + [44c16499fd](https://github.com/facebook/react-native/commit/44c16499fdc4665298f6c88b9ffee626fa1fc969), + [c91d87213e](https://github.com/facebook/react-native/commit/c91d87213e6862019b9ef7df7c38551bd6d659fd), + [85503a0612](https://github.com/facebook/react-native/commit/85503a0612b0c74b4d204e8748e9ed7010d838e4), and + [5b83dbe25a](https://github.com/facebook/react-native/commit/5b83dbe25af151d183009006b1fe323b2658d025) by + [@behrends](https://github.com/behrends), + [@bvaughn](https://github.com/bvaughn), + [@charpeni](https://github.com/charpeni), + [@dsandmark](https://github.com/dsandmark), + [@gusgard](https://github.com/gusgard), + [@nkabrown](https://github.com/nkabrown), + [@petterh](https://github.com/petterh), [@solon](https://github.com/solon), + [@swashcap](https://github.com/swashcap), and others) +- Various dev doc and project doc fixes for correctness and completeness + ([92c0980540](https://github.com/facebook/react-native/commit/92c0980540dde0053bad05fae6414cf8275a71b1), + [3c9092acf3](https://github.com/facebook/react-native/commit/3c9092acf39ecdb7c137a3cb0d4282694e95cbf5), + [e906525e84](https://github.com/facebook/react-native/commit/e906525e84f69a98de4d06ed1ec4c43d8589e350), + [60828566a7](https://github.com/facebook/react-native/commit/60828566a759dc579dbae1d76a8426e1e479166e), + [c49b97c4ef](https://github.com/facebook/react-native/commit/c49b97c4ef65a6351af437ef28033cb31ea0446f), + [45ed142596](https://github.com/facebook/react-native/commit/45ed14259677cff4cbd133e705ec4f0ec84bc216), + [cb6ec7c321](https://github.com/facebook/react-native/commit/cb6ec7c32141ef5bdde837d7f9d71b7adb83b751), + [9ec9567390](https://github.com/facebook/react-native/commit/9ec95673909beac7798f589e0e9821b4225f8fa9), + [e5a4ea97d9](https://github.com/facebook/react-native/commit/e5a4ea97d9e1b13509a3f36d0b469a6a88a90dc4), + [c544c0d2dc](https://github.com/facebook/react-native/commit/c544c0d2dca1d0e9f0b2a5565e03676ad71a36f5), + [33d5e5bd5a](https://github.com/facebook/react-native/commit/33d5e5bd5a5365ab712a2b9d33f33cbec305e128), + [95dac8db60](https://github.com/facebook/react-native/commit/95dac8db601ba48fe03da52e1adbdef0cac23546), + [6e1db1f1ee](https://github.com/facebook/react-native/commit/6e1db1f1ee263c3a8b68c3e1584e79ae86d5be86), + [e11d496e9d](https://github.com/facebook/react-native/commit/e11d496e9d907abb5bf58a8300c5a8f85aa03bbb), + [6da897945f](https://github.com/facebook/react-native/commit/6da897945f823728dbc82dd9f01c672354b1e76d), + [0ff576081b](https://github.com/facebook/react-native/commit/0ff576081b156ea26c4e7886f7266f3e4d8e3d5e), + [1ee64ccb8a](https://github.com/facebook/react-native/commit/1ee64ccb8a257210be3a74fb9b0adc83f2a8bb2b), + [3aa38564f7](https://github.com/facebook/react-native/commit/3aa38564f7b91c8588c8484140bc4221d50d55e0), + [6b26971a56](https://github.com/facebook/react-native/commit/6b26971a56fdd919d11cc338893d0b7a3f7a45ba), and + [de3976a486](https://github.com/facebook/react-native/commit/de3976a48655a248a2417fcf2d3a511be02e1996) by + [@adrianomelo](https://github.com/adrianomelo), + [@blargity](https://github.com/blargity), + [@charpeni](https://github.com/charpeni), + [@garlic-rice-with-butter](https://github.com/garlic-rice-with-butter), + [@gwmccull](https://github.com/gwmccull), + [@harikrishnanp](https://github.com/harikrishnanp), + [@hramos](https://github.com/hramos), + [@johnthewilson](https://github.com/johnthewilson), + [@jsdario](https://github.com/jsdario), [@kelset](https://github.com/kelset), + [@patrickkempff](https://github.com/patrickkempff), + [@ryanml](https://github.com/ryanml), + [@tiagomoraismorgado88](https://github.com/tiagomoraismorgado88), + [@timwangdev](https://github.com/timwangdev), and others) +- Stop `RCTRefreshControl` from jumping around + ([2e1707d0e6](https://github.com/facebook/react-native/commit/2e1707d0e600a30057511390dd87c18c00f19a59) by + [@sophiebits](https://github.com/sophiebits)) +- Fix a race condition in the animation module + ([515eb0e801](https://github.com/facebook/react-native/commit/515eb0e8012a7a8f085a8e410c6c694011fd8c1d) by + [@mhorowitz](https://github.com/mhorowitz)) +- Fix Windows local-cli's to not wrongfully identify as globally installed + ([ca106043fc](https://github.com/facebook/react-native/commit/ca106043fc655a1c51332aedf9b001a512269550) by + [@sballew](https://github.com/sballew)) +- Fix Jest mocks for **NetInfo**, **Dimensions**, and **ScrollView** modules + ([7fb3a9229d](https://github.com/facebook/react-native/commit/7fb3a9229df52bd45076470d059f245a8147cd2a), + [11a2a35c63](https://github.com/facebook/react-native/commit/11a2a35c63ae68de46482f5cd25271f8b0fb5ad4), and + [0c8a3e4f79](https://github.com/facebook/react-native/commit/0c8a3e4f797563c99e988ec2f42ec2a618a8b196) by + [@alvaromb](https://github.com/alvaromb), + [@timwangdev](https://github.com/timwangdev), and + [@uk-ar](https://github.com/uk-ar)) +- packager-worker-for-buck: `transformCommand`: add missing test + ([73a01be9bc](https://github.com/facebook/react-native/commit/73a01be9bcd9059f3172987fd30d8b6dc0125759) by + [@jeanlauliac](https://github.com/jeanlauliac)) +- Fixed issue where CLI wasn't following the config value for postMinifyProcess + when its running with `dev=false` + ([6d92046c56](https://github.com/facebook/react-native/commit/6d92046c56794a6a62bc07598545a23a7b53cdc0) by + [@rafeca](https://github.com/rafeca)) +- Fix asset resolver url handling + ([28d5d6baf1](https://github.com/facebook/react-native/commit/28d5d6baf1e6ac52e8672a653f56c3898e4e11d2) by + [@fkgozali](https://github.com/fkgozali)) +- Fix crash when destroying catalyst + ([f1015664e9](https://github.com/facebook/react-native/commit/f1015664e92f02c33417a591a2438db7c0cd3811)) +- You can now `justifyContent` while you're `minWidth`ing and `marginLeft`ing; + before the justification wasn't honored + ([f5becebc07](https://github.com/facebook/react-native/commit/f5becebc0710d5bb875bb9c0a2d3809a00f62605) by + [@woehrl01](https://github.com/woehrl01)) +- `marginLeft: auto` and `alignItem: stretch` now play nicely together; before + the width and height ended up incorrect + ([5f99b1a55f](https://github.com/facebook/react-native/commit/5f99b1a55f4002c105a7005cabf720aad422b628) by + [@woehrl01](https://github.com/woehrl01)) +- Fix assertion preventing YGNodeLayoutGet\* with YGEdgeEnd + ([a383b8ca05](https://github.com/facebook/react-native/commit/a383b8ca0545ba3704a51a78972107119f5683c0) by + [@justjake](https://github.com/justjake)) +- Fix shrinking in non-strech alignments + ([1d62848535](https://github.com/facebook/react-native/commit/1d6284853514be4da2b68d45732386eb81cc4253) by + [@woehrl01](https://github.com/woehrl01)) +- Correctly calculate min/max percentage constraints + ([4fdaf2de98](https://github.com/facebook/react-native/commit/4fdaf2de989c039a62681cc1f7a8407ec32b593e) by + [@woehrl01](https://github.com/woehrl01)) +- When running `react-native-git-upgrade`, don't execute git's hooks + ([0182086350](https://github.com/facebook/react-native/commit/018208635069311c1a7c7776c6f359f7ded45362) by + [@adrienthiery](https://github.com/adrienthiery)) +- When running `react-native-git-upgrade` and failing with a signal, return that + to the terminal + ([b9a5862f67](https://github.com/facebook/react-native/commit/b9a5862f670f52d48f1d3789c3f08ec139368da4) by + [@mateusz-](https://github.com/mateusz-)) +- In **KeyboardAvoidingView**, don't mistakenly try to layout when a hardware + keyboard changes + ([ad4450ac13](https://github.com/facebook/react-native/commit/ad4450ac1364710f052a927ceda7ae353440f682) by + [@koenpunt](https://github.com/koenpunt)) +- Don't endlessly collect websockets when not connected to the packager (dev + memory leak) + ([1e1e491246](https://github.com/facebook/react-native/commit/1e1e49124678f447d980bb22891d25db60fa83b3) by + [@mmmulani](https://github.com/mmmulani)) +- Fixed a bug in the sample project random `selection` prop that made it + not-so-random + ([766f020e68](https://github.com/facebook/react-native/commit/766f020e68abfc121ea6a9f92e0640368d69dae7) by + [@rozele](https://github.com/rozele)) + +#### Android exclusive fixes + +- Explicitly `#define isnan __builtin_isnan` for Android _clang-5_ to mimic + **gcc**'s default behavior + ([f8fe6b0c70](https://github.com/facebook/react-native/commit/f8fe6b0c70d1b7b626d05d9675c16b2f89339e8c)) +- Correctly update **NetInfo** on Android even if connection types change while + the app is in the background + ([e6f542d620](https://github.com/facebook/react-native/commit/e6f542d62037e9830c0ae5749a32874c44cf2334) by + [@berickson1](https://github.com/berickson1)) +- Direction-aware borders now work with Android APIs >= 17 + ([7170543e80](https://github.com/facebook/react-native/commit/7170543e8012250b7643a960b54cce7fd6d3a1e9) by + [@rsnara](https://github.com/rsnara)) +- Don't throw _BadTokenException_ and _IllegalArgmentException_ when showing or + dismissing Modal on Android + ([e57a43b97a](https://github.com/facebook/react-native/commit/e57a43b97ad24dc5b993753a45aa575b2a757b4f)) +- Fix Android crash when blurRadius is between 0 and 1 + ([dc01eff72d](https://github.com/facebook/react-native/commit/dc01eff72d23e1dd3f7ecf30859992ee3bf7c664) by + [@jamesreggio](https://github.com/jamesreggio)) +- Fix `borderRadius` with Android API level < 18 + ([5aa1fb3ff3](https://github.com/facebook/react-native/commit/5aa1fb3ff326a429e33a443576da866f2a63c20c) and + [ca7fe72c31](https://github.com/facebook/react-native/commit/ca7fe72c31fd7c7cbe4734118019f5808235560e) by + [@rsnara](https://github.com/rsnara)) +- Make Android `lineHeight` behavior match iOS's 📏 + ([3f1b021506](https://github.com/facebook/react-native/commit/3f1b0215060e4c27c286359cc90f3b2189956c4e)) +- Fixed autoscroll to cursor on Android **TextInput** + ([0bef872f3f](https://github.com/facebook/react-native/commit/0bef872f3fc8b1cd78c574d03eacc886bef4e239) by + [@shergin](https://github.com/shergin)) +- Fix logging unpacking time on Android when it happens concurrently with eager + unpacking ([028b64bcd3](https://github.com/facebook/react-native/commit/028b64bcd36c1c8dd76c0de95eeff80cf660aa23) + by [@alexeylang](https://github.com/alexeylang)) +- Prevent an Android crash when **TextInput** has `selectionColor` defined but + there is no drawable cursor + ([1e18d907bf](https://github.com/facebook/react-native/commit/1e18d907bfb8cc5f4f2e1a1ede0dd98aec40ab11) by + [@gpeal](https://github.com/gpeal)) + +#### iOS exclusive fixes + +- Don't have Xcode warnings for _YGDefaultLog_ in newly created projects + ([72e762d4bc](https://github.com/facebook/react-native/commit/72e762d4bca8d00cc2c73c390a654ae6143731bd) by + [@woehrl01](https://github.com/woehrl01)) +- iOS _RCTEventEmitter_ uses a `double` for count, not _NSInteger_ + ([eaa84997ce](https://github.com/facebook/react-native/commit/eaa84997cedc8dc4d46308e2217d2b094a51ed02)) +- Fix `isNuclideDebuggingAvailable` on iOS + ([59c3e33f63](https://github.com/facebook/react-native/commit/59c3e33f637d11e33204e8a912e98459ffad7fab)) +- iOS ScrollView is now rendered correctly with RefreshControl + ([75d62bf0a8](https://github.com/facebook/react-native/commit/75d62bf0a802b91a979d03ef497e84c3179e7767) by + [@vonovak](https://github.com/vonovak)) +- Fix a crash when keyboard is visible and bridge reload happens on iOS + ([d9c658566a](https://github.com/facebook/react-native/commit/d9c658566a14ce8767d87435264997aa18dd08e4) by + [@fromcelticpark](https://github.com/fromcelticpark)) +- **RedBox** now appears beneath the status bar on iOS + ([33cefc1760](https://github.com/facebook/react-native/commit/33cefc176096e03a4b3c3130a70abfabe9d40f38) by + [@adamjernst](https://github.com/adamjernst)) +- Fractional border widths on iOS are now the right size, honoring insets + ([15179f1798](https://github.com/facebook/react-native/commit/15179f1798b277c1836441fcf7f3b7f0bd5a4636) by + [@Nikita2k](https://github.com/Nikita2k)) +- Implement `requiresMainQueueSetup` in _RCTTVNavigationEventEmitter_ to satisfy + Xcode warning + ([ee3532b5c2](https://github.com/facebook/react-native/commit/ee3532b5c266d5ee7fb12920cb611a41b1daf750) by + [@charpeni](https://github.com/charpeni)) +- Support the iPhone X in the sample project's header + ([ad4b124aa1](https://github.com/facebook/react-native/commit/ad4b124aa117483b4a0ec9dfa145b8e9a17f06c6) by + [@vincentriemer](https://github.com/vincentriemer)) +- `testID` works on **TabBarItem** on iOS + ([e19d9dec9b](https://github.com/facebook/react-native/commit/e19d9dec9b3b257b5db3dc77ed8b95b93570f1e3)) +- On iOS, don't error on the first live-reload of large codebases because of too + little wait time + ([b6f1a6085f](https://github.com/facebook/react-native/commit/b6f1a6085f7470c16ae8850e7da8f4f9ae5c23ee) by + [@lelandrichardson](https://github.com/lelandrichardson)) +- Prevent iOS crash on receiving bad unicode in _XMLHTTPRequest_ + ([1c04ceeb4b](https://github.com/facebook/react-native/commit/1c04ceeb4ba954eee7ab34fc5b6c660d9772d9f6) by + [@cdlewis](https://github.com/cdlewis)) +- Define `pod_target_xcconfig` for PrivateDatabase + ([38b96cd7bb](https://github.com/facebook/react-native/commit/38b96cd7bb391f64066a6c91daa4173db1f33445) by + [@ide](https://github.com/ide)) +- Fixed podspec include/excludes around tvOS + ([ba1d7e92e4](https://github.com/facebook/react-native/commit/ba1d7e92e4f251b90a96be192214b5015cf6244e) by + [@yygene](https://github.com/yygene)) +- Don't spam the logs for iOS when receiving `ECONNREFUSED` on connecting to + packager ([b1701ccaef](https://github.com/facebook/react-native/commit/b1701ccaefa0c8cbb6d820b2ad07e0d911027d7c) + and [ff3dc2ed19](https://github.com/facebook/react-native/commit/ff3dc2ed19cdd4137ae8092599b16c09d4e2c711) by + [@adamjernst](https://github.com/adamjernst)) +- Don't crash Systrace when debugging JS remotely on iOS + ([e8eec24706](https://github.com/facebook/react-native/commit/e8eec24706e792314ee574bbf7f7c0066c4f3a7a) by + [@alexeylang](https://github.com/alexeylang)) + +### Removed + +- Removing `reactBridgeDidFinishTransaction` from _RCTScrollView_ + ([a255204e3e](https://github.com/facebook/react-native/commit/a255204e3e7fddefd2d7b0de224101768757ca7a) by + [@shergin](https://github.com/shergin)) +- Removing inherited background color optimization from _RCTText_ to reduce code + complexity – please give feedback if you find performance differences! + ([8c8944c10f](https://github.com/facebook/react-native/commit/8c8944c10fb7dc30ea99657225f25ea438cf6e14) by + [@shergin](https://github.com/shergin)) + +### Other + +Below is a list of the remaining, low-level changes that made it into this +release of React Native. + +- Foundational work for a new justifyContent value **space-evenly** + ([1050e0b476](https://github.com/facebook/react-native/commit/1050e0b47611602b758f73d99f51a1dd5ceabade) by + [@woehrl01](https://github.com/woehrl01)) +- Add Systrace-based telemetry to Hermes GC + ([05e862d48d](https://github.com/facebook/react-native/commit/05e862d48d363a8af765b2f0283569419dbd2e5c)) +- Unify Systrace native hook argument passing + ([52e3ae9063](https://github.com/facebook/react-native/commit/52e3ae9063705bac53bad99ffe23976c29c8f1b2) by + [@amnn](https://github.com/amnn)) +- Use different symbols for SystraceSection depending on `WITH_FBYSTRACE` + ([03956c4ecf](https://github.com/facebook/react-native/commit/03956c4ecfda381396336f725ea1c12d913df17d)) +- Don't set global.performance to undefined if it was initialized already + ([dfebcb70a5](https://github.com/facebook/react-native/commit/dfebcb70a5c948db94d1cd580bbcaa0aaa702349) by + [@alexeylang](https://github.com/alexeylang)) +- Autofixes for migrating to Buck's source-only ABI feature + ([801cbdb047](https://github.com/facebook/react-native/commit/801cbdb04788403cee022dec688136540da36fc5) by + [@jkeljo](https://github.com/jkeljo)) +- Add remote API to uninstall the global error handler in RN + ([1d16923063](https://github.com/facebook/react-native/commit/1d16923063940606dda89de94a83cbdf5f98e1f1)) +- Add _RCTLibraryPathForURL_ in _RCTUtil_ + ([2fecbf6171](https://github.com/facebook/react-native/commit/2fecbf61711f610124fc2453a79120932024f613)) +- Fix sections that come from React Fiber + ([1f40c95076](https://github.com/facebook/react-native/commit/1f40c95076297258a4194fd9c1b5af7002187c99) by + [@alexeylang](https://github.com/alexeylang)) +- Fix boolean conversion in sync RN method calls. + ([dd888d3346](https://github.com/facebook/react-native/commit/dd888d3346ef9477eae2cd2d29cef867467cb503)) +- Fix `embeddedBundleURL` update situation + ([d1fc8ef3a3](https://github.com/facebook/react-native/commit/d1fc8ef3a3cb3590b9cff4d1b3cc5d440b52ec8c)) +- Remove `android_react_native_perf.use_separate_ui_bg_thread` experiment. + ([4f886a29a1](https://github.com/facebook/react-native/commit/4f886a29a1234c967deae2354bbc5092e0e6595e)) +- ScrollView related files were moved to dedicated folder + ([098a63a1ce](https://github.com/facebook/react-native/commit/098a63a1cee1196a2f3eb5135eeb8fe59e7e8272) by + [@shergin](https://github.com/shergin)) +- move page registration logic in to jsinspector + ([bef7967f9a](https://github.com/facebook/react-native/commit/bef7967f9a485dc136d2cb32f552b2199ae3e2b8) by + [@bnham](https://github.com/bnham)) +- Type global hooks as function pointers + ([eca51eb46a](https://github.com/facebook/react-native/commit/eca51eb46a47112c8933d0a3b932f59008cadc78) by + [@johnislarry](https://github.com/johnislarry)) +- `std::string` to `const char*` + ([b952365ba6](https://github.com/facebook/react-native/commit/b952365ba6bd86f0e80a24aedec1f447cb3ec566) by + [@johnislarry](https://github.com/johnislarry)) +- Allow extending props supported by native animations + ([71751e9cc7](https://github.com/facebook/react-native/commit/71751e9cc7c67306ca038c5b254e6e81fe0aff1b) by + [@andrewimm](https://github.com/andrewimm)) +- Meyers singleton jsc error extractor + ([434f432d5d](https://github.com/facebook/react-native/commit/434f432d5d5ea2756c1adac8b1c36e82e60a2b13) by + [@johnislarry](https://github.com/johnislarry)) +- Do not overwrite the same text in **TextInput** + ([29f3f55298](https://github.com/facebook/react-native/commit/29f3f5529827579101f0d8bd6afe72f1cb0caeca)) +- Renaming _uiManagerWillFlushUIBlocks_ -> _uiManagerWillPerformMounting_ + ([0a8721c340](https://github.com/facebook/react-native/commit/0a8721c340480a972bb597cacdbddd9eb2015716) by + [@shergin](https://github.com/shergin)) +- Skylarkify flags macros. + ([ed2bfcb35a](https://github.com/facebook/react-native/commit/ed2bfcb35a2756eb700882ab8e21b6b273efa80a) by + [@ttsugriy](https://github.com/ttsugriy)) +- Skylarkify `config_utils_defs` macros. + ([88f6f69152](https://github.com/facebook/react-native/commit/88f6f69152e4b68609f28e80ee70705969529af8) by + [@ttsugriy](https://github.com/ttsugriy)) +- Round size geometry for Button and RichText components. + ([4034febb7e](https://github.com/facebook/react-native/commit/4034febb7ef9d9daa894a75b038226af74026163) by + [@iaroslav-pavlov](https://github.com/iaroslav-pavlov) +- Temporarily patched Map/Set non-extensible check into RN dev renderer + ([a99f0d6100](https://github.com/facebook/react-native/commit/a99f0d6100c9779f5f6df6008af54c06113355f6) by + [@bvaughn](https://github.com/bvaughn)) +- Run buildifier over all BUCK files + ([d674d48a7b](https://github.com/facebook/react-native/commit/d674d48a7b9b71169af59ceb886529371c26a2e5) by + [@zertosh](https://github.com/zertosh)) +- Pass `scriptURL` to _RCTTestRunner_ + ([266ab7a006](https://github.com/facebook/react-native/commit/266ab7a0061c11c4da7ccde9e0d461c0d7331563)) +- Make _RCTNativeModule::invokeInner_ explicitely return `folly::none` in case + of error ([0ac5a5230c](https://github.com/facebook/react-native/commit/0ac5a5230c4b5dd44db6a8dd7bb7752aff64d71c) + by [@fromcelticpark](https://github.com/fromcelticpark)) +- Make _RCTPackagerConnection_ a singleton + ([9180d4eb82](https://github.com/facebook/react-native/commit/9180d4eb82fb70a0fd396b15660c2ac6770183c9) by + [@adamjernst](https://github.com/adamjernst)) +- Register split segment paths with _RAMBundleRegistry_ + ([cff0d8e0e5](https://github.com/facebook/react-native/commit/cff0d8e0e599d1ab21b36779b41fbb26512874aa) by + [@fromcelticpark](https://github.com/fromcelticpark)) +- check if listener is still in the set before calling `onHostResume` + ([ad89ea7b50](https://github.com/facebook/react-native/commit/ad89ea7b5046c2cf9ca1cba88c387eb1db8dc042)) +- export _SeparatorsObj_ type for re-use in **ListItem**s etc. + ([c6fe101cdc](https://github.com/facebook/react-native/commit/c6fe101cdcc0b8d640a86108d8a76f7292b5f799) by + [@sahrens](https://github.com/sahrens)) +- Do not mark node as dirty if, new and old values are undefined + ([41da6e3128](https://github.com/facebook/react-native/commit/41da6e31284d46bb1dd2053c3c3100c075ace019) by + [@woehrl01](https://github.com/woehrl01)) +- Remove _RAMBundleRegistry_ subclasses + ([6ecae73fe5](https://github.com/facebook/react-native/commit/6ecae73fe5915863c27ac7e407f5b151fd0c5fc3) by + [@fromcelticpark](https://github.com/fromcelticpark)) +- Fix `minimumViewTime` in _ViewabilityHelper_ + ([d19d137cc1](https://github.com/facebook/react-native/commit/d19d137cc18f10957b5ac64ac727d15fde57f018)) + +[0.56]: https://github.com/facebook/react-native/compare/0.55-stable...0.56-stable +[0.55]: https://github.com/facebook/react-native/compare/0.54-stable...0.55-stable +[0.54]: https://github.com/facebook/react-native/compare/0.53-stable...0.54-stable +[0.53]: https://github.com/facebook/react-native/compare/0.52-stable...0.53-stable +[0.52.0]: https://github.com/facebook/react-native/compare/0.51-stable...0.52-stable diff --git a/CHANGELOG-pre-070.md b/CHANGELOG-pre-070.md new file mode 100644 index 00000000000000..bba50a996a780e --- /dev/null +++ b/CHANGELOG-pre-070.md @@ -0,0 +1,2436 @@ +# Changelog (pre 0.70) + +This file contains all changelogs for releases in the 0.60-0.69 range. Please check out the other `CHANGELOG-*.md` files for newer and older versions. + +## v0.69.11 + +### Fixed + +#### iOS specific + +- Make 0.69 compatible with Xcode 15 (thanks to @AlexanderEggers for the commit in main) ([37e8df1cdc](https://github.com/facebook/react-native/commit/37e8df1cdce4a66763c720b1b0768d049def9518)) + +## v0.69.10 + +### Fixed + +#### Android specific + +- Minimize EditText Spans 8/N: CustomStyleSpan ([b384bb613b](https://github.com/facebook/react-native/commit/b384bb613bf533aebf3271ba335c61946fcd3303) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize EditText Spans 6/N: letterSpacing ([5791cf1f7b](https://github.com/facebook/react-native/commit/5791cf1f7b43aed1d98cad7bcc272d97ab659111) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 5/N: Strikethrough and Underline ([0869ea29db](https://github.com/facebook/react-native/commit/0869ea29db6a4ca20b9043d592a2233ae1a0e7a2) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 4/N: ReactForegroundColorSpan ([8c9c8ba5ad](https://github.com/facebook/react-native/commit/8c9c8ba5adb59f7f891a5307a0bce7200dd3ac7d) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 3/N: ReactBackgroundColorSpan ([cc0ba57ea4](https://github.com/facebook/react-native/commit/cc0ba57ea42d876155b2fd7d9ee78604ff8aa57a) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 1/N: Fix precedence ([1743dd7ab4](https://github.com/facebook/react-native/commit/1743dd7ab40998c4d3491e3b2c56c531daf5dc47) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix measurement of uncontrolled TextInput after edit ([8a0fe30591](https://github.com/facebook/react-native/commit/8a0fe30591e21b90a3481c1ef3eeadd4b592f3ed) by [@NickGerleman](https://github.com/NickGerleman)) + +## v0.69.9 + +### Changed + +#### iOS specific + +- Relax Ruby requirements ([4e015c69d6](https://github.com/facebook/react-native/commit/4e015c69d646b320d58888f70af566c1d753eaed) by [@cipolleschi](https://github.com/cipolleschi)) + +### Fixed + +#### iOS specific + +- Fix React Codegen podspec to build on Xcode 14.3 ([74ba411b55](https://github.com/facebook/react-native/commit/74ba411b55535cee1b98062875b7b4b1428c931a) by [@cipolleschi](https://github.com/cipolleschi)) +- Blob data is no longer prematurely deallocated when using blob.slice ([36cc71ab36](https://github.com/facebook/react-native/commit/36cc71ab36aac5e5a78f2fbae44583d1df9c3cef) by [@awinograd](https://github.com/awinograd)) + +## v0.69.8 + +### Fixed + +#### Android specific + +- Mitigation for Samsung TextInput Hangs ([be69c8b5a7](https://github.com/facebook/react-native/commit/be69c8b5a77ae60cced1b2af64e48b90d9955be5) by [@NickGerleman](https://github.com/NickGerleman)) + +## v0.69.8 + +### Fixed + +#### Android specific + +- Mitigation for Samsung TextInput Hangs ([be69c8b5a7](https://github.com/facebook/react-native/commit/be69c8b5a77ae60cced1b2af64e48b90d9955be5) by [@NickGerleman](https://github.com/NickGerleman)) + +## v0.69.7 + +### Fixed + +- Force dependencies resolution to minor series for 0.69 ([c4da74c463](https://github.com/facebook/react-native/commit/c4da74c4636cbbd6bbf681d39a8a8cca49f11f56) by [@Titozzz](https://github.com/Titozzz)) + +## v0.69.6 + +### Changed + +- Bump version of `promise` from 8.0.3 to 8.2.0, enabling `Promise.allSettled` ([951538c080](https://github.com/facebook/react-native/commit/951538c080ef745da304fb308fa91d597e0dd98a) by [@retyui](https://github.com/retyui)) + +### Fixed + +- Fix hermes profiler ([81564c1a3d](https://github.com/facebook/react-native/commit/81564c1a3dae4222858de2a9a34089097f665e82) by [@janicduplessis](https://github.com/janicduplessis)) + +#### Android specific + +- Correctly resolve classes with FindClass(..) ([361b310bcc](https://github.com/facebook/react-native/commit/361b310bcc8dddbff42cf63495649291c894d661) by [@evancharlton](https://github.com/evancharlton)) + +#### iOS specific + +- Fix the way the orientation events are published, to avoid false publish on orientation change when app changes state to inactive ([7d42106d4c](https://github.com/facebook/react-native/commit/7d42106d4ce20c644bda4d928fb0abc163580cee) by [@lbaldy](https://github.com/lbaldy)) +- Fix React module build error with swift integration on new architecture mode ([3afef3c167](https://github.com/facebook/react-native/commit/3afef3c16702cefa5115b059a08741fba255b2db) by [@Kudo](https://github.com/Kudo)) + +## v0.69.5 + +### Changed + +- Bump react-native-codegen to 0.69.2 ([df3d52bfbf](https://github.com/facebook/react-native/commit/df3d52bfbf4254cd16e1dc0ca0af2743cd7e11c1) by [@dmytrorykun](https://github.com/dmytrorykun)) + +#### Android specific + +- Replaced reactnativeutilsjni with reactnativejni in the build process to reduce size ([54a4fcbfdc](https://github.com/facebook/react-native/commit/54a4fcbfdcc8111b3010b2c31ed3c1d48632ce4c) by [@SparshaSaha](https://github.com/SparshaSaha)) + +### Fixed + +- Codegen should ignore `.d.ts` files ([0f0d52067c](https://github.com/facebook/react-native/commit/0f0d52067cb89fdb39a99021f0745282ce087fc2) by [@tido64](https://github.com/tido64)) + +## v0.69.4 + +### Changed + +- Upgrade RN CLI to v8.0.4 ([66c68c37ce](https://github.com/facebook/react-native/commit/66c68c37ce94f6c1160e7f260c0d1887539c6605) by [@thymikee](https://github.com/thymikee)) + +#### Android specific + +- Modified **getDefaultJSExecutorFactory** method ([87cfd386cb](https://github.com/facebook/react-native/commit/87cfd386cb2e02bfa440c94706d9d0274f83070c) by [@KunalFarmah98](https://github.com/KunalFarmah98)) + +## v0.69.3 + +### Fixed + +#### iOS specific + +- Fix React-bridging header not found for third party modules ([fa2acc32d1](https://github.com/facebook/react-native/commit/fa2acc32d1490f6e418689dec321f8bd4ef7bb28) by [@Kudo](https://github.com/Kudo)) + +## v0.69.2 + +### Changed + +- Set react-shallow-renderer v16.15.0 for react v18 compat ([a39a7c453d](https://github.com/facebook/react-native/commit/a39a7c453d87086935ff07d549ba8220cbcf30bd) by [@mikehardy](https://github.com/mikehardy)) +- Upgrade RN CLI to v8.0.3 ([28cbd21d21](https://github.com/facebook/react-native/commit/28cbd21d21f2ffb3f38b2449a4983f013947ce0a) by [@thymikee](https://github.com/thymikee)) + +#### iOS specific + +- Hermes pod: change logic to use the hermes tag to set the pod source correctly ([46a9edc854](https://github.com/facebook/react-native/commit/46a9edc8544ae070149a97ea3d919b88dd6e2942) by [@kelset](https://github.com/kelset)) +- Fix the race condition when calling readAsDataURL after new Blob(blobs) ([bd12e41188](https://github.com/facebook/react-native/commit/bd12e41188c8d85c0acbd713f10f0bd34ea0edca) by [@wood1986](https://github.com/wood1986)) +- Make sure that Flipper pods are not installed when creating a release build ([23accbf58d](https://github.com/facebook/react-native/commit/23accbf58d2fa03ad020e07f00012a32609c7218) by [@cipolleschi](https://github.com/cipolleschi)) + +## v0.69.1 + +### Changed + +#### iOS specific + +- Make all Yoga headers public and add #ifdef __cplusplus ([43f831b23c](https://github.com/facebook/react-native/commit/43f831b23caf22e59af5c6d3fdd62fed3d20d4ec) by [@janicduplessis](https://github.com/janicduplessis)) + +### Fixed + +- Use monotonic clock for performance.now() ([114d31feee](https://github.com/facebook/react-native/commit/114d31feeeb47f5a57419e5088c3cbe9340f757a)) + +#### iOS specific + +- Fix build for React-RCTText ([4ea38e16bf](https://github.com/facebook/react-native/commit/4ea38e16bf533955557057656cba5346d2372acd) by [@ph4r05](https://github.com/ph4r05)) +- Fix RCT-Folly build error when use_frameworks! and hermes are both enabled ([79baca678a](https://github.com/facebook/react-native/commit/79baca678a743560fa16fdd551f1d0d018d34304) by [@Kudo](https://github.com/Kudo)) +- Fix use_frameworks! for 0.69 ([f97c6a5b49](https://github.com/facebook/react-native/commit/f97c6a5b498eec95e99a02c7842cb2ae160cd6cd) by [@Kudo](https://github.com/Kudo)) + +## v0.69.0 + +### Breaking + +- Support for `console.disableYellowBox` [has been dropped](https://github.com/facebook/react-native/commit/b633cc130533f0731b2577123282c4530e4f0abe) +- Already deprecated prop types have been removed ([cdfddb4dad](https://github.com/facebook/react-native/commit/cdfddb4dad7c69904850d7e5f089a32a1d3445d1), [3e229f27bc](https://github.com/facebook/react-native/commit/3e229f27bc9c7556876ff776abf70147289d544b), [10199b1581](https://github.com/facebook/react-native/commit/10199b158138b8645550b5579df87e654213fe42)) +- `removeListener`, deprecated since RN0.65, [was removed](https://github.com/facebook/react-native/commit/8dfbed786b40082a7a222e00dc0a621c0695697d) from Appearance +- If you were using `SegmentedComponentIOS`, you will now need to move to the [segmented-control](https://github.com/react-native-segmented-control/segmented-control) library ([235f168574](https://github.com/facebook/react-native/commit/235f1685748442553e53f8ec6d904bc0314a8ae6)) + +### Added + +- Add Hermes scripts to package ([004b8609d9](https://github.com/facebook/react-native/commit/004b8609d97b14a6d5cb8c9e63afdbe343c500da) by [@hramos](https://github.com/hramos)) +- Expose scheduler through FabricUIManager ([1730949e94](https://github.com/facebook/react-native/commit/1730949e94aa23927a90d2a64d91977b7e2904d6) by [@cortinico](https://github.com/cortinico)) +- Add event listeners to Scheduler ([e51e19ecc1](https://github.com/facebook/react-native/commit/e51e19ecc1d1b8ac5c860eac55338ef13471844f) by [@cortinico](https://github.com/cortinico)) +- C++ TurboModule methods can return functions ([c7380ba113](https://github.com/facebook/react-native/commit/c7380ba1131b26b487ecae87239a4cf82afefd15) by [@appden](https://github.com/appden)) +- Add support for devtools' profiler ([fefa7b6ac8](https://github.com/facebook/react-native/commit/fefa7b6ac8a1e0e33fa7a1070936c5c83c873c0a) by [@jpporto](https://github.com/jpporto)) +- Add getAll function to FormData class for getting all parts containing that key. This is also available in web API. ([d05a5d1551](https://github.com/facebook/react-native/commit/d05a5d15512ab794ef80b31ef91090d5d88b3fcd) by [@matinzd](https://github.com/matinzd)) +- Automatic type conversions for C++ TurboModules ([31f0796237](https://github.com/facebook/react-native/commit/31f079623732fb017b1fa38d56abe855d7738ece) by [@appden](https://github.com/appden)) +- New bridging API for JSI <-> C++ ([30cb78e709](https://github.com/facebook/react-native/commit/30cb78e709bccb4f7bf7aab3f6b0f1ba4261f577) by [@appden](https://github.com/appden)) +- Add asBool() method to JSI ([603620b739](https://github.com/facebook/react-native/commit/603620b7394da5855e2255790bfea9ad7d80ddf9) by [@appden](https://github.com/appden)) +- CustomEvent and Event polyfills for React Native ([6abbef1200](https://github.com/facebook/react-native/commit/6abbef1200af9adab1848de17955d77fbe0ad5da) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Implement Runtime.getHeapUsage for hermes chrome inspector ([cff9590864](https://github.com/facebook/react-native/commit/cff9590864c4be153a4eb49757b7cac8b3f23f66) by [@janicduplessis](https://github.com/janicduplessis)) +- Introduce ReactNativeFeatureFlags file to control FeatureFlags in React Native ([33aba77456](https://github.com/facebook/react-native/commit/33aba774564acdec216e02e28f17ad08ad7bc26b) by [@mdvacca](https://github.com/mdvacca)) +- Added fail-safe check to catch MissingWebViewPackage Exception ([8c573d9336](https://github.com/facebook/react-native/commit/8c573d933652ae4da1008502c53fce93057101c0) by [@Kunal-Airtel2022](https://github.com/Kunal-Airtel2022)) +- Add ability to access properties with symbol keys through JSI ([9010bfe457](https://github.com/facebook/react-native/commit/9010bfe457b77862024214ce6210504ff1786ef5) by [@neildhar](https://github.com/neildhar)) +- Allow color styles to be animated using native driver ([201f355479](https://github.com/facebook/react-native/commit/201f355479cafbcece3d9eb40a52bae003da3e5c) by [@genkikondo](https://github.com/genkikondo)) +- Make react-native depend on react-native-gradle-plugin ([3346efb7d4](https://github.com/facebook/react-native/commit/3346efb7d422bd8eb7f48650b454071f9981fa0b) by [@cortinico](https://github.com/cortinico)) +- Add RawEventTelemetryEventEmitter interface to ReactNativePrivateInterface ([1f15a64028](https://github.com/facebook/react-native/commit/1f15a6402869b001cae049facc17126924b97197) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Implement Runtime.getHeapUsage for hermes chrome inspector ([3568a72987](https://github.com/facebook/react-native/commit/3568a7298738a651d76c70763362c297ab601ee8) by [@janicduplessis](https://github.com/janicduplessis)) +- Add support for C++17 in OSS ([c2e4ae39b8](https://github.com/facebook/react-native/commit/c2e4ae39b8a5c6534a3fa4dae4130166eda15169) by [@sammy-SC](https://github.com/sammy-SC)) + +#### Android specific + +- Generate `Nullable` for optional objects and arrays in module codegen. ([ffaa5d69bc](https://github.com/facebook/react-native/commit/ffaa5d69bc268918891121e2d60e7ca08ee82530)) +- Expose an API to enable Concurrent Root on Android ([d7b64b8d4b](https://github.com/facebook/react-native/commit/d7b64b8d4b2f403ce00b27c5df89ffb3a64dc6de) by [@cortinico](https://github.com/cortinico)) +- Add scrollEventThrottle prop support in Android ([cf55fd587e](https://github.com/facebook/react-native/commit/cf55fd587e6cc82a73079be6076d244ab72fa359) by [@ryancat](https://github.com/ryancat)) +- Accessibility announcement for list and grid in FlatList ([dd6325bafe](https://github.com/facebook/react-native/commit/dd6325bafe1a539d348f3710e717a6344576b859) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Introduce ModuleDataCleaner.cleanDataFromModules(ReactContext) ([184dfb8f8b](https://github.com/facebook/react-native/commit/184dfb8f8bd4dfbb8d1575e9554e3f3361793015) by [@RSNara](https://github.com/RSNara)) +- Introduce ReactContext.getNativeModules() ([b978308519](https://github.com/facebook/react-native/commit/b978308519f71c6c7fda4b38a842aa219a349275) by [@RSNara](https://github.com/RSNara)) +- MapBuffer implementation for JVM -> C++ communication ([cf6f3b680b](https://github.com/facebook/react-native/commit/cf6f3b680b43fae31e97b14af681293503025a0c)) +- Make links independently focusable by Talkback ([7b5b114d57](https://github.com/facebook/react-native/commit/7b5b114d578142d18bf4a7a5279b179a9ac8d958) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Support animating text color with native driver ([87cdb607e4](https://github.com/facebook/react-native/commit/87cdb607e4792156d433c44b89932e7dae3371da) by [@genkikondo](https://github.com/genkikondo)) +- Added an experimental prop serialization path based on MapBuffer ([cbcdaae2b5](https://github.com/facebook/react-native/commit/cbcdaae2b5dda2a44c95d83dcb5b5aa0f43bc6f9)) +- Allow to setup a Gradle Enterprise instance via an external script ([f11dcfaea1](https://github.com/facebook/react-native/commit/f11dcfaea14249b059aea2474ce36a0665140d4f) by [@cortinico](https://github.com/cortinico)) +- Support platform color with AnimatedColor ([cb42049e0a](https://github.com/facebook/react-native/commit/cb42049e0ae262afe907ace1099414836ab0018d) by [@genkikondo](https://github.com/genkikondo)) +- Support running animations with AnimatedColor with native driver ([3f49e6763e](https://github.com/facebook/react-native/commit/3f49e6763e66447f6ae17dc2f032e27330b7b74a) by [@genkikondo](https://github.com/genkikondo)) +- Add public API to ReactRootView to control if JS touch events are dispatched ([0a517ae438](https://github.com/facebook/react-native/commit/0a517ae43892fb764d829f8bae56c1ac58356b1b) by [@ryancat](https://github.com/ryancat)) + +#### iOS specific + +- Prepare a method in the AppDelegate to control the concurrentRoot. ([8ac8439e0d](https://github.com/facebook/react-native/commit/8ac8439e0dcc0cc4a9c0cc99f614a5e19bae56eb) by [@cipolleschi](https://github.com/cipolleschi)) +- `hotkeysEnabled` property is added to `RCTDevMenu` which allows enabling/disabling hotkeys that triggers developer menu popup ([1a1a304ed2](https://github.com/facebook/react-native/commit/1a1a304ed2023d60547aef65b1a7bf56467edf08)) +- Allow modifying iOS image cache limits ([61b013e7ad](https://github.com/facebook/react-native/commit/61b013e7ad8a1cc28ee39434d2fd96b74b96cf5f) by [@danilobuerger](https://github.com/danilobuerger)) +- Add dismissActionSheet method to ActionSheetIOS ([64ebe5bbdd](https://github.com/facebook/react-native/commit/64ebe5bbdd32fc3b3a243a8a81a6f724d8f81267) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Integrated the `accessibilityLanguage` prop to all the available components. The prop is available for any platform but it will work only on iOS. ([7b05b091fd](https://github.com/facebook/react-native/commit/7b05b091fd97f95b778369277ac2147730abc7b8) by [@dgopsq](https://github.com/dgopsq)) +- Support running animations with AnimatedColor with native driver ([49f3f47b1e](https://github.com/facebook/react-native/commit/49f3f47b1e9b840e4374d46b105604f4d2c22dd5) by [@genkikondo](https://github.com/genkikondo)) + +### Changed + +- Update direct Metro dependencies to 0.70.1 ([b74e964e70](https://github.com/facebook/react-native/commit/b74e964e705c40834acad7020562e870cdad9db1), ([c92b64b16a](https://github.com/facebook/react-native/commit/c92b64b16a5710c1dfaea9af4c271931e4669636) by [@arushikesarwani94](https://github.com/arushikesarwani94)), ([f89a0b765c](https://github.com/facebook/react-native/commit/f89a0b765c09c9aba573f03777cc76673989628f) by [@robhogan](https://github.com/robhogan)) +- Upgrade RN CLI to v8.0.0 ([0605880c9e](https://github.com/facebook/react-native/commit/0605880c9ed0aec812f3198eb5075db64fba969a), [1e0226f933](https://github.com/facebook/react-native/commit/1e0226f933814bf9ada87eaa14348bfff863ead1), [24bb7f7380](https://github.com/facebook/react-native/commit/24bb7f7380662925f078d78a03fbc954af2da3d6), [7dceb9b63c](https://github.com/facebook/react-native/commit/7dceb9b63c0bfd5b13bf6d26f9530729506e9097) by [@thymikee](https://github.com/thymikee)) +- Replace use-subscripton with use-sync-external-store ([93b50be8c2](https://github.com/facebook/react-native/commit/93b50be8c2341a0daf41f6fdc656896c4907c4dc) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Expose UIManager from Scheduler ([54db5f2012](https://github.com/facebook/react-native/commit/54db5f201292ebf267800d92b7dd5bfa22431963) by [@cortinico](https://github.com/cortinico)) +- Optimized VirtualizedList context when used with nested lists ([ceb0a54608](https://github.com/facebook/react-native/commit/ceb0a546083509192c059cdd93d6aa379e38ef4e) by [@javache](https://github.com/javache)) +- Remove usage of std::string in EarlyJsErrorHandler. ([30051b2c41](https://github.com/facebook/react-native/commit/30051b2c4185bff015c72069488b5f6ba3391ad7) by [@sshic](https://github.com/sshic)) +- `eslint-config`: add support for ESLint 8 ([864a8c11b2](https://github.com/facebook/react-native/commit/864a8c11b2a7540f607ebc0e084edd7393169359) by [@wcandillon](https://github.com/wcandillon)) +- `eslint-config`: add support for TypeScript 4.5+ ([199ac680c7](https://github.com/facebook/react-native/commit/199ac680c7867a982e25620219bffa18f85f5404) by [@rnike](https://github.com/rnike)) +- Upgraded react-devtools-core dependency to 4.24.0 ([a7a781ff4a](https://github.com/facebook/react-native/commit/a7a781ff4a13e744f4eb3007ef0657740b277a72)) +- Avoid flattening nodes with event props ([980c52de41](https://github.com/facebook/react-native/commit/980c52de41258f6cf2d2360144ea7ca16a19c9f8)) +- Type the argument of Animated.interpolate as read-only ([6584304c10](https://github.com/facebook/react-native/commit/6584304c100ce4d51a5c4d606170a6ad0dc00875) by [@motiz88](https://github.com/motiz88)) +- Update gradle-download-task to 5.0.1 to support concurrent downloads ([a86cae7aac](https://github.com/facebook/react-native/commit/a86cae7aacc9837536e7d679870a57dcd0f45475) by [@michel-kraemer](https://github.com/michel-kraemer)) +- Logging a soft error when ReactRootView has an id other than -1 instead of crashing the app in hybrid apps ([1ca2c24930](https://github.com/facebook/react-native/commit/1ca2c2493027c1b027146cd41e17dd8a4fc33a41) by [@Kunal-Airtel2022](https://github.com/Kunal-Airtel2022)) +- Upgrade to React 18 ([41cbccd98d](https://github.com/facebook/react-native/commit/41cbccd98dd6c98d1f662674164cf455105a1359) by [@rickhanlonii](https://github.com/rickhanlonii)) + +#### Android specific + +- Gradle: extend the algoritm to find hermesc paths ([aeac6ab677](https://github.com/facebook/react-native/commit/aeac6ab6773cd2c0ca7abe9e5aa3f22fa81683e5) by [@cortinico](https://github.com/cortinico)) +- Bump boost for Android to 1.76 to align with iOS ([5cd6367f0b](https://github.com/facebook/react-native/commit/5cd6367f0b86543274a15bb6d0e53a8545fed845) by [@kelset](https://github.com/kelset)) +- Adopt `MapBuffer` interface for `ReadableMapBuffer` ([81e4249315](https://github.com/facebook/react-native/commit/81e42493158edd5e7b88f98c19c87e9d61ba4aba)) +- Mark intent as nullable ([5ffa0b0aa6](https://github.com/facebook/react-native/commit/5ffa0b0aa6c523234c634167be1f94b0d9edb0f7) by [@sshic](https://github.com/sshic)) +- Use CMake to build ReactAndroid module ([e3830ddffd](https://github.com/facebook/react-native/commit/e3830ddffd9260fe071e0c9f9df40b379d54cf26)) +- Update template/android and RN Tester to use `hermes-engine` from the `react-native` NPM package. ([4d91f40fbd](https://github.com/facebook/react-native/commit/4d91f40fbdf0012689b04084113299676342c0dc) by [@cortinico](https://github.com/cortinico)) +- Build Hermes from Source ([a3d9892ed9](https://github.com/facebook/react-native/commit/a3d9892ed9c993d16fa36fa6b713e2ead43fcc77) by [@cortinico](https://github.com/cortinico)) +- Rename field with default values for ReactConfig to DEFAULT_CONFIG ([964e816752](https://github.com/facebook/react-native/commit/964e81675286c80a8e322127aa7c052f62621098)) +- Moved `com/react/facebook/uimanager/interfaces` files into `com/react/facebook/uimanager` to enable Kotlin build ([b1a779392d](https://github.com/facebook/react-native/commit/b1a779392d483c649d428debfe4a6405247b8c0e)) +- Bump AGP to 7.1.0 and fix bundle inclusion in release mode ([200488e87c](https://github.com/facebook/react-native/commit/200488e87cf4bc355e03c78cd814b97b23452117) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Release react-native-gradle-plugin 0.0.5 ([42272211e4](https://github.com/facebook/react-native/commit/42272211e4a1b7cff7770b59cf1bcf649cbdd6fc) by [@cortinico](https://github.com/cortinico)) +- ViewPagerAndroid recommendation link. ([7e8cce3d2d](https://github.com/facebook/react-native/commit/7e8cce3d2ddffbe36bcb3c9ec2f006f7e1b42a79) by [@maaxg](https://github.com/maaxg)) +- Bump android Appcompat to 1.4.1 ([6b61995647](https://github.com/facebook/react-native/commit/6b61995647c789a567845521fed7b0cc1e0cddb7) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Remove `react-native-gradle-plugin` as a dependency from template's package.json ([cd79317672](https://github.com/facebook/react-native/commit/cd79317672e5c99636346f2abb641a688a4ceb82) by [@cortinico](https://github.com/cortinico)) +- Use 2g as a default heap size for gradle builds ([09e418ef8e](https://github.com/facebook/react-native/commit/09e418ef8e98fd026cf828696ff2475993b76ac2)) +- Use new StatusBar API on Android 11 (API 30)+ ([50c8e973f0](https://github.com/facebook/react-native/commit/50c8e973f067d4ef1fc3c2eddd360a0709828968) by [@ieatfood](https://github.com/ieatfood)) +- Change static string to public ([ab45138394](https://github.com/facebook/react-native/commit/ab45138394f41aeb13370882837968636de04c24) by [@sshic](https://github.com/sshic)) + +#### iOS specific + +- Use pre-built HermesC if available in current React Native release ([644fe430fd](https://github.com/facebook/react-native/commit/644fe430fdecc0bf1fa098d1c2d52178da6c987c) by [@hramos](https://github.com/hramos)) +- When building Hermes from source, the filesystem will now be prepared using the new hermes-utils.js scripts, outside of CocoaPods ([aaa01f7710](https://github.com/facebook/react-native/commit/aaa01f77106f891696d9ec508e2ee71111a6af2a) by [@hramos](https://github.com/hramos)) +- Expose scheduler through RCTSurfacePresenter ([614aa86916](https://github.com/facebook/react-native/commit/614aa86916394d8ee2ecb236f38de6bb7e161ca2) by [@cortinico](https://github.com/cortinico)) +- Adopt UIGraphicsImageRenderer API ([d70d7fd0b3](https://github.com/facebook/react-native/commit/d70d7fd0b3984ee54622afc4692a6c945618c345) by [@matrush](https://github.com/matrush)) +- Build Hermes from source when Hermes is used ([bb01b75637](https://github.com/facebook/react-native/commit/bb01b75637edc1159a3bdb3af86936e1c92f39c1) by [@hramos](https://github.com/hramos)) +- Update CodeGen scripts to accept custom node executable ([323db75c36](https://github.com/facebook/react-native/commit/323db75c36d26d771f6b231c8eabc5afc0da74d3) by [@cipolleschi](https://github.com/cipolleschi)) +- Fixed the fallback behavior when the `.xcode.env` file is missing, actually using the old `find-node-for-xcode.sh` script ([705c6f57d6](https://github.com/facebook/react-native/commit/705c6f57d66b4499f43489292183a58413402a74) by [@cipolleschi](https://github.com/cipolleschi)) +- Adding a link in a message for the users. ([2c52131f5e](https://github.com/facebook/react-native/commit/2c52131f5e0eb4668681242fcdd8150afe3c5827) by [@cipolleschi](https://github.com/cipolleschi)) +- Bump ruby to 2.7.5 ([2c87b7466e](https://github.com/facebook/react-native/commit/2c87b7466e098c5cd230e02b279fc7bc7a357615) by [@danilobuerger](https://github.com/danilobuerger)) +- This PR removes the `find-node.sh` scripts and replaces it with an `.xcode.env` file that is sourced by the script phases that needs it. The `.xcode.env` file is versioned: to customize a local environment, an unversioned `.xcode.local.env` can be used. ([0480f56c5b](https://github.com/facebook/react-native/commit/0480f56c5b5478b6ebe5ad88e347cad2810bfb17) by [@cipolleschi](https://github.com/cipolleschi)) +- Update `PushNotificationIOS.checkPermissions` to include iOS 10+ notification settings. ([17ecd2fb5b](https://github.com/facebook/react-native/commit/17ecd2fb5b3cfb8aa0282ed406b16dc3b9777018)) +- Enable SonarKit in React-Core when the configuration is `'Debug'` ([b5343a6b0d](https://github.com/facebook/react-native/commit/b5343a6b0dd07c1b4ef9dac549df67a4d68ebd1e) by [@cipolleschi](https://github.com/cipolleschi)) +- When Hermes is enabled, the Hermes Engine will be built from source instead of using the pre-built `hermes-engine` CocoaPod. ([12ad1fffe8](https://github.com/facebook/react-native/commit/12ad1fffe87c0c5ab2e001f318ff4f8d3eda7479) by [@hramos](https://github.com/hramos)) +- Replaced folly::Optional with std::optional from C++17 in Objc module generator. ([45e2941367](https://github.com/facebook/react-native/commit/45e2941367fbf13584193bbda598173802289167) by [@philIip](https://github.com/philIip)) +- Removed methodName parameter that was used only for a warning message and moved the warning parameter to be calculated inline. ([cfb11ca2f6](https://github.com/facebook/react-native/commit/cfb11ca2f67c59c090b8a58b2b7bdaacef0e19df)) +- Fix the crash caused by nil partialLoadHandler ([46bc521513](https://github.com/facebook/react-native/commit/46bc521513c9c78e5ffc49cf3e571757e1a91cef)) +- Synchronously render cached images ([189c2c8958](https://github.com/facebook/react-native/commit/189c2c8958442541c6b4f42860b2943ece612da2)) +- Updated Flipper-Glog to 0.5.0.4 ([cd60ffdb62](https://github.com/facebook/react-native/commit/cd60ffdb62b2183cd24baef3075d56f758cea24a)) +- Add function to report early js errors ([1804951595](https://github.com/facebook/react-native/commit/180495159517dc0bfa103621e5ff62fc04cb3c8b) by [@sshic](https://github.com/sshic)) + +### Deprecated + +- Deprecate the use of `react-native/jest/preprocessor.js` by external projects ([c1e9aa9a27](https://github.com/facebook/react-native/commit/c1e9aa9a272aed3cba60c4aeff783eeb8bffce68) by [@motiz88](https://github.com/motiz88)) +- Deprecate the Promise.prototype.done method and log a warning when it's called in development. ([35800962c1](https://github.com/facebook/react-native/commit/35800962c16a33eb8e9ff1adfd428cf00bb670d3) by [@motiz88](https://github.com/motiz88)) + +#### iOS specific + +- Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required ([5f2835b14d](https://github.com/facebook/react-native/commit/5f2835b14d35681c268dd64d6ec284ea5f053be3), ([c71e6efbcd](https://github.com/facebook/react-native/commit/c71e6efbcd2b95faee327d9763d321488120bc5e), ([982ca30de0](https://github.com/facebook/react-native/commit/982ca30de079d7e80bd0b50365d58b9048fb628f) by [@philIip](https://github.com/philIip)) + +#### iOS specific + +- Removed lint restricting `DynamicColorIOS` to only two properties ([13b0b06522](https://github.com/facebook/react-native/commit/13b0b0652259ada468cc044b0b604edb666b2eb9)) + +### Fixed + +- Remove unactionable warning about `codegenNativeComponent` when on 'Paper' ([494b73cb33](https://github.com/facebook/react-native/commit/494b73cb33197fa865e9ead8fdca11bce6822917) by [@tido64](https://github.com/tido64)) +- Fix typo in Value's constructor with a Symbol ([a7a0f86a73](https://github.com/facebook/react-native/commit/a7a0f86a73ab51be31fb2c3205612d7ff1fb5384) by [@jpporto](https://github.com/jpporto)) +- Avoid full copy of large folly::dynamic objects by switching to std::move semantics ([3f98c8e4c2](https://github.com/facebook/react-native/commit/3f98c8e4c2c8f40b81c1a90aa65c1bdc9327faed) by [@NikoAri](https://github.com/NikoAri)) +- Fix performance issue on Animated.interpolate with big input range ([f503b21203](https://github.com/facebook/react-native/commit/f503b212039f79f00ea56b65ecf3cd150b82f087) by [@Almouro](https://github.com/Almouro)) +- Update function spacing linting rules ([8650220cf9](https://github.com/facebook/react-native/commit/8650220cf99739c4b904a37ce4f19ce7dfd3bdbb) by [@joeframbach](https://github.com/joeframbach)) +- Add supportsFromJs and supportsToJs template variables ([087624ccaf](https://github.com/facebook/react-native/commit/087624ccaf2e484c0b6425e57edf9afd62a06e9a) by [@appden](https://github.com/appden)) +- The Array appended to FormData is transmitted as a string ([d2e8e7d58e](https://github.com/facebook/react-native/commit/d2e8e7d58e680e0bb3b4da1f820dd4dd840639f5) by [@bang9](https://github.com/bang9)) +- AppState.removeEventListener correctly removes listener for blur and focus events ([9aab25ec53](https://github.com/facebook/react-native/commit/9aab25ec536473ffe6d22c5efeae8fea6bd769be) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) +- `focus()` on TextInput to respect its `editable` state ([8a5460ce80](https://github.com/facebook/react-native/commit/8a5460ce80e69c11a007121d4278d55642f6b10e) by [@vonovak](https://github.com/vonovak)) +- Restore Windows build with RawPropsParser.cpp ([2d64d1d693](https://github.com/facebook/react-native/commit/2d64d1d69360161c047c86a026403d8074ba28bb) by [@TatianaKapos](https://github.com/TatianaKapos)) +- Fix babel-plugin-codegen crash when export init is null ([ae756647c9](https://github.com/facebook/react-native/commit/ae756647c9b8a88ba615fd30185f621825a33427) by [@janicduplessis](https://github.com/janicduplessis)) +- Fixed compilation warning due to `using namespace` being used as part of header ([009d80bf5a](https://github.com/facebook/react-native/commit/009d80bf5a55dd74be448960b1344ac7599c6bae) by [@arhelmus](https://github.com/arhelmus)) +- Allow including TurboModule.h in mixed rtti/no-rtti environment, even if TurboModule.h/cpp is compiled without RTTI. ([1f87729697](https://github.com/facebook/react-native/commit/1f87729697370a4ab31e2bb9ab1780438d9e146f) by [@nlutsenko](https://github.com/nlutsenko)) +- Remove prettier from dependencies in eslint-config ([2db1bca952](https://github.com/facebook/react-native/commit/2db1bca95224ce39484c3f27508aec9a21ce126a) by [@Kerumen](https://github.com/Kerumen)) +- Switch Component doesn't disable click functionality when disabled ([b2e625a517](https://github.com/facebook/react-native/commit/b2e625a51723becea4cef0433448fbec679669ee) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Support numeric color values in StyleSheet's Flow types ([83b1975b90](https://github.com/facebook/react-native/commit/83b1975b90569a36020da33156615a13fcc7ba92) by [@motiz88](https://github.com/motiz88)) +- Fix build break on Windows with ReactCommon ([42b391775f](https://github.com/facebook/react-native/commit/42b391775f663df335f6f2553104fc2fa35b1bee) by [@chiaramooney](https://github.com/chiaramooney)) +- Fixed opacity value in TouchableOpacity ([3eddc9abb7](https://github.com/facebook/react-native/commit/3eddc9abb70eb54209c68aab7dbd69e363cc7b29) by [@hetanthakkar1](https://github.com/hetanthakkar1)) +- Remove illegal private property access in VirtualizedSectionList.scrollToLocation ([b2f871a6fa](https://github.com/facebook/react-native/commit/b2f871a6fa9c92dd0712055384b9eca6d828e37d) by [@motiz88](https://github.com/motiz88)) +- JS animated node value updates properly when listener is attached ([1f778014a7](https://github.com/facebook/react-native/commit/1f778014a7e95c5c473898c38d5b1e0725cd373c) by [@genkikondo](https://github.com/genkikondo)) +- Working around Long paths limitation on Windows ([7b76abc0d3](https://github.com/facebook/react-native/commit/7b76abc0d3a0a5bec37f314c80954e412fc5f5ec) by [@mganandraj](https://github.com/mganandraj)) +- Fix VirtualizedList with initialScrollIndex not rendering all elements when data is updated ([c5c17985da](https://github.com/facebook/react-native/commit/c5c17985dae402725abb8a3a94ccedc515428711) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) + +#### Android specific + +- Add back hermes inspector support ([6b6adcc111](https://github.com/facebook/react-native/commit/6b6adcc111123bec2c4c110070b2506385e74664) by [@Kudo](https://github.com/Kudo)) +- Fixed issue where any node with an AccessibilityDelegate set (which was any node with any accessibility propoerty), was using ExploreByTouchHelper's built in AccessibilityNodeProvider, and not properly populating their AccessibilityNodeInfo's, leading to focus issues and issues with automated test services like UIAutomator. ([70fcab76a4](https://github.com/facebook/react-native/commit/70fcab76a4dcf65e628ac897620fe050758574e3) by [@blavalla](https://github.com/blavalla)) +- Fix Extras usage in Android implementation of Linking.sendIntent() ([86f8d0bb52](https://github.com/facebook/react-native/commit/86f8d0bb528a75777c357ae214643ed58c326ca9)) +- Fix typo in gradle plugin deprecation message ([41cfd2f976](https://github.com/facebook/react-native/commit/41cfd2f9768e4742eedd299ab467d316d016705e) by [@mikehardy](https://github.com/mikehardy)) +- Fixed `TimingModule` related functions for headless JS tasks, eg. `setTimeout` ([dac56ce077](https://github.com/facebook/react-native/commit/dac56ce0776e0e4d23ed4f8b324f2e2432aefa6a) by [@marcesengel](https://github.com/marcesengel)) +- Improve support for Android users on M1 machine ([c5babd993a](https://github.com/facebook/react-native/commit/c5babd993a2bed2994ecc4710fa9e424b3e6cfc2) by [@cortinico](https://github.com/cortinico)) +- Do not use `rootProject` directly in Gradle scripts ([b2bc5aa5c9](https://github.com/facebook/react-native/commit/b2bc5aa5c903ad057a53d4caa82b0fe74e01c07c) by [@cortinico](https://github.com/cortinico)) +- Adding null check for context in redbox surface delegate ([9527ab1584](https://github.com/facebook/react-native/commit/9527ab1584869d7966c562e8aa7cbf48788156a3) by [@ryancat](https://github.com/ryancat)) +- Fix crash on empty snapToOffsets array ([145fd041c7](https://github.com/facebook/react-native/commit/145fd041c7afe9a18f08f461487bb515ab2f516a) by [@ryancat](https://github.com/ryancat)) +- Fix StatusBar not updating to use translucent values when set to the same value across different activities ([d34a75e9e5](https://github.com/facebook/react-native/commit/d34a75e9e5932adcac4a16f5b815bb909c3aa0dd)) +- Fix underlineColorAndroid transparent not working on API 21 ([52aee50a70](https://github.com/facebook/react-native/commit/52aee50a704bbeab91f5fa05fe3220dee304422f) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Fixed regression on content in scroll view not responding to touch when fling got interrupted ([bb8ff9260f](https://github.com/facebook/react-native/commit/bb8ff9260fe6a783171f35ce1a459927d8179d08) by [@ryancat](https://github.com/ryancat)) +- Fixes android build error when compiling as library ([c34ef5841c](https://github.com/facebook/react-native/commit/c34ef5841cf3a63a9cc96add577d6bf6d52e4397) by [@nickfujita](https://github.com/nickfujita)) +- Cancel post touch process when new touch is received ([0368081858](https://github.com/facebook/react-native/commit/0368081858193d7c2537acd9080d11bb701ee98b) by [@ryancat](https://github.com/ryancat)) +- Improve rendering of images when resampled and corner radius applied ([f743bed657](https://github.com/facebook/react-native/commit/f743bed657591b078300a6519e3d68db542fd757) by [@javache](https://github.com/javache)) +- Fix transform when calculate overflowInset ([0975e96d53](https://github.com/facebook/react-native/commit/0975e96d53546ac05b2154352fe56e5d82e2a1f8) by [@ryancat](https://github.com/ryancat)) +- Fix ReactHorizontalScrollView contentOffset ([9f6f97151c](https://github.com/facebook/react-native/commit/9f6f97151c44a0f727c9dd938222be1860ecf3f9) by [@genkikondo](https://github.com/genkikondo)) +- Text Component does not announce disabled and disables click functionality when disabled ([7b2d8178b1](https://github.com/facebook/react-native/commit/7b2d8178b155f5f1b247614c46e5e20f31bbd438) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Fix StatusBar on Android API 30 ([9ed2df628d](https://github.com/facebook/react-native/commit/9ed2df628ddd410cc3383e68b0386471432445c0) by [@ieatfood](https://github.com/ieatfood)) +- Use root locale when converting string case. ([5341ad8962](https://github.com/facebook/react-native/commit/5341ad896245c40a00b6faead1b90d01aac58f8c) by [@halaei](https://github.com/halaei)) +- Fix DarkMode on Calendar DateTimePicker ([97064ae1fb](https://github.com/facebook/react-native/commit/97064ae1fbf84a8a6b653c02c5872191b7d2d622) by [@mdvacca](https://github.com/mdvacca)) +- Fix ScrollView contentOffset ([be260b9f47](https://github.com/facebook/react-native/commit/be260b9f479a3b55ee43d2959d2c49fd3c1eb4ac) by [@genkikondo](https://github.com/genkikondo)) +- Do not bundle libhermes.so or libjsc.so inside the React Native Android AAR ([fa85417179](https://github.com/facebook/react-native/commit/fa854171798e67b8a10820f77d7198315e1784ed) by [@cortinico](https://github.com/cortinico)) +- Enable hitSlop to be set using a single number. ([d682753244](https://github.com/facebook/react-native/commit/d682753244feba28c6a15c31966a3da075a090e6) by [@javache](https://github.com/javache)) +- Fix crash caused by Image.queryCache parsing null ([ae3d4f7008](https://github.com/facebook/react-native/commit/ae3d4f700843ae4cbb6927ee620095136d1abc3f) by [@skychx](https://github.com/skychx)) +- Fix NullPointerException when disaptching events ([fbeb51ef51](https://github.com/facebook/react-native/commit/fbeb51ef5133303a5cb71569507d44403ded3447) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific + +- ScrollView's contentInsetAdjustmentBehavior is reset to Never at every reuse to avoid layout artifacts. ([28a65f4387](https://github.com/facebook/react-native/commit/28a65f438789c29309d6e7c58063a73ca721ef43)) +- Prevent Nullptr segfault in TurboModule init path ([7f3cc256b5](https://github.com/facebook/react-native/commit/7f3cc256b5bcbf2e64540ca69401f62ec6869f0e) by [@RSNara](https://github.com/RSNara)) +- Expose the extraData dict attached to JavaScript errors to the native ExceptionManager on iOS, similar to Android ([a65ae8eff6](https://github.com/facebook/react-native/commit/a65ae8eff6ec6f9ad283ac8e96f00802421a14da) by [@GijsWeterings](https://github.com/GijsWeterings)) +- `RCTLocalizationProvider` Fall back to input when no localization is available ([18196512db](https://github.com/facebook/react-native/commit/18196512db6b8b4469a5e1b098d8892ae72d743a) by [@robhogan](https://github.com/robhogan)) +- Update iOS LogBox to render its UIWindow with the key window's UIWindowScene ([d31d83f410](https://github.com/facebook/react-native/commit/d31d83f4109c167ec612058c805fd65f69b82476) by [@vincentriemer](https://github.com/vincentriemer)) +- Remove Gemfile.lock from template ([1907bd31f0](https://github.com/facebook/react-native/commit/1907bd31f066865aa1c5fe4ec88e98ee46448771) by [@danilobuerger](https://github.com/danilobuerger)) +- Fix `pod install` when `RCT-Folly` version has been updated. ([b2517c3bdc](https://github.com/facebook/react-native/commit/b2517c3bdccc3f9d935f4ee06f959d6ce8f27bbe) by [@fortmarek](https://github.com/fortmarek)) +- Fix usage of cocoapods with --project-directory flag and new arch ([2f813f873a](https://github.com/facebook/react-native/commit/2f813f873a1692044ea3461e59ca732a4d952300) by [@danilobuerger](https://github.com/danilobuerger)) +- Ensure LogBoxView is sized relative to the key window instead of the full screen ([84f8c9ad55](https://github.com/facebook/react-native/commit/84f8c9ad550f98295d2e718b4b1d6b1ac724b898) by [@vincentriemer](https://github.com/vincentriemer)) +- Improved template fastlane gitignore ([f43f05d292](https://github.com/facebook/react-native/commit/f43f05d292fd2fbdf3d5fdfd194ed81b0e346657) by [@danilobuerger](https://github.com/danilobuerger)) +- Set RCTView borderColor to UIColor ([267d36d0af](https://github.com/facebook/react-native/commit/267d36d0afb4b3713df9b679c2019c44ac6bcc3f) by [@danilobuerger](https://github.com/danilobuerger)) +- Fix action sheet callback invoked more than once on iPad ([8935d6e697](https://github.com/facebook/react-native/commit/8935d6e697dffb0971f5a8ee1dfbc580080de3e0) by [@janicduplessis](https://github.com/janicduplessis)) +- Resolve border platform color based on current trait collection ([9a35818797](https://github.com/facebook/react-native/commit/9a3581879764f3f1b2743905e3e54611e96bb618) by [@danilobuerger](https://github.com/danilobuerger)) +- Enable custom sound for local push notifications. ([eb19499484](https://github.com/facebook/react-native/commit/eb1949948406195c4c02c6041d07cba074ae820c)) +- Invoke registerForRemoteNotifications on main UI thread. ([3633a05299](https://github.com/facebook/react-native/commit/3633a05299d99b12acc5c3c056b977463df1924e)) +- Bump flipper pods to get arm64 catalyst slice ([f811da7cc2](https://github.com/facebook/react-native/commit/f811da7cc20cc49ca5c8d4e023d6c61e36e15dd1) by [@fortmarek](https://github.com/fortmarek)) +- Fix `pod install --project-directory=ios` failing when Hermes is enabled ([1b22e8a039](https://github.com/facebook/react-native/commit/1b22e8a039081887ffd450596d822bff975d6900), ([eb7cc85a91](https://github.com/facebook/react-native/commit/eb7cc85a9146d058694247178f03d57cc125c97a) by [@tido64](https://github.com/tido64)) +- Fix compilation warning in yoga ([52d8a797e7](https://github.com/facebook/react-native/commit/52d8a797e7a6be3fa472f323ceca4814a28ef596) by [@cuva](https://github.com/cuva)) +- Prevent deadlock when dispatching events from observers on the same thread. ([68fd1e5508](https://github.com/facebook/react-native/commit/68fd1e55085e871a854563721ee29ca698239607) by [@Pickleboyonline](https://github.com/Pickleboyonline)) +- In RCTSurfaceHostingComponent, access ckComponent from main queue to pass assertion ([1874c81003](https://github.com/facebook/react-native/commit/1874c81003b468554c227541fec5e29c4adfb82f) by [@p-sun](https://github.com/p-sun)) +- Fix modal redbox for onDismiss ([46f68aceb2](https://github.com/facebook/react-native/commit/46f68aceb20a10c95c92b5ffeb90f289b015a559) by [@HeyImChris](https://github.com/HeyImChris)) +- Attempt to fix crash during app termination ([9cd43340a7](https://github.com/facebook/react-native/commit/9cd43340a7e2443564c2ff5e8e85d37f6e1e47ef) by [@sammy-SC](https://github.com/sammy-SC)) + +### Security + +- Encode URL params in URLSearchParams.toString() ([1042a8012f](https://github.com/facebook/react-native/commit/1042a8012fb472bd5c882b469fe507dd6279d562) by [@sshic](https://github.com/sshic)) + +## v0.68.7 + +### Fixed + +- Use logical operator instead of bit operation in Yoga ([c3ad8](https://github.com/facebook/react-native/commit/c3ad8ec7eb01b7236e0081ac7c7f888630caac21) by [@cuva](https://github.com/cuva)) + +#### Android specific + +- Minimize EditText Spans 8/N: CustomStyleSpan ([b384bb613b](https://github.com/facebook/react-native/commit/b384bb613bf533aebf3271ba335c61946fcd3303) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize EditText Spans 6/N: letterSpacing ([5791cf1f7b](https://github.com/facebook/react-native/commit/5791cf1f7b43aed1d98cad7bcc272d97ab659111) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 5/N: Strikethrough and Underline ([0869ea29db](https://github.com/facebook/react-native/commit/0869ea29db6a4ca20b9043d592a2233ae1a0e7a2) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 4/N: ReactForegroundColorSpan ([8c9c8ba5ad](https://github.com/facebook/react-native/commit/8c9c8ba5adb59f7f891a5307a0bce7200dd3ac7d) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 3/N: ReactBackgroundColorSpan ([cc0ba57ea4](https://github.com/facebook/react-native/commit/cc0ba57ea42d876155b2fd7d9ee78604ff8aa57a) by [@NickGerleman](https://github.com/NickGerleman)) +- Minimize Spans 1/N: Fix precedence ([1743dd7ab4](https://github.com/facebook/react-native/commit/1743dd7ab40998c4d3491e3b2c56c531daf5dc47) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix measurement of uncontrolled TextInput after edit ([8a0fe30591](https://github.com/facebook/react-native/commit/8a0fe30591e21b90a3481c1ef3eeadd4b592f3ed) by [@NickGerleman](https://github.com/NickGerleman)) + +## v0.68.6 + +### Fixed + +#### Android specific + +- Mitigation for Samsung TextInput Hangs ([be69c8b5a7](https://github.com/facebook/react-native/commit/be69c8b5a77ae60cced1b2af64e48b90d9955be5) by [@NickGerleman](https://github.com/NickGerleman)) + +## v0.68.6 + +### Fixed + +#### Android specific + +- Mitigation for Samsung TextInput Hangs ([be69c8b5a7](https://github.com/facebook/react-native/commit/be69c8b5a77ae60cced1b2af64e48b90d9955be5) by [@NickGerleman](https://github.com/NickGerleman)) + +## v0.68.5 + +### Fixed + +- Force dependencies resolution to minor series for 0.68 ([edcb3ca996](https://github.com/facebook/react-native/commit/edcb3ca996fb3296762af300a36c1d46356f1b24) by [@Titozzz](https://github.com/Titozzz)) + +## v0.68.4 + +### Changed + +- Bump version of `promise` from 8.0.3 to 8.2.0, enabling `Promise.allSettled` ([951538c080](https://github.com/facebook/react-native/commit/951538c080ef745da304fb308fa91d597e0dd98a) by [@retyui](https://github.com/retyui)) +- Bump react-native-codegen to 0.0.18 ([40a3ae3613](https://github.com/facebook/react-native/commit/40a3ae3613394fe5f0d728bada538d2d5b78a8a4) by [@dmytrorykun](https://github.com/dmytrorykun)) + +#### Android specific + +- Correctly resolve classes with FindClass(..) ([361b310bcc](https://github.com/facebook/react-native/commit/361b310bcc8dddbff42cf63495649291c894d661) by [@evancharlton](https://github.com/evancharlton)) + +### Fixed + +- Codegen should ignore `.d.ts` files ([0f0d52067c](https://github.com/facebook/react-native/commit/0f0d52067cb89fdb39a99021f0745282ce087fc2) by [@tido64](https://github.com/tido64)) + +#### iOS specific + +- Fix the way the orientation events are published ([7d42106d4c](https://github.com/facebook/react-native/commit/7d42106d4ce20c644bda4d928fb0abc163580cee) by [lbaldy](https://github.com/lbaldy)) + +## v0.68.3 + +### Changed + +#### Android specific + +- Let's not build reactnativeutilsjni shared library ([af9225ec5f](https://github.com/facebook/react-native/commit/af9225ec5fd22da802e3da4d786fa7f6ec956b0f) by [@SparshaSaha](https://github.com/SparshaSaha)) +- Modified **getDefaultJSExecutorFactory** method ([87cfd386cb](https://github.com/facebook/react-native/commit/87cfd386cb2e02bfa440c94706d9d0274f83070c) by [@KunalFarmah98](https://github.com/KunalFarmah98)) + +### Fixed + +- Use monotonic clock for performance.now() ([114d31feee](https://github.com/facebook/react-native/commit/114d31feeeb47f5a57419e5088c3cbe9340f757a)) + +#### Android specific + +- Logging a soft error when ReactRootView has an id other than -1 instead of crashing the app in hybrid apps ([1ca2c24930](https://github.com/facebook/react-native/commit/1ca2c2493027c1b027146cd41e17dd8a4fc33a41) by [@Kunal-Airtel2022](https://github.com/Kunal-Airtel2022)) + +## v0.68.2 + +### Changed + +- Bump used version of react-native-codegen to 0.0.17 ([dfda480a98](https://github.com/facebook/react-native/commit/dfda480a9888d95c542cea40f25e8e783565c1db) by [@cortinico](https://github.com/cortinico)) +- Bump react-native-codegen to 0.0.17 ([a5ddc2e165](https://github.com/facebook/react-native/commit/a5ddc2e16523ea336ffbecf7acfd4820469a29e7) by [@cortinico](https://github.com/cortinico)) + +### Fixed + +#### Android specific + +- Working around Long paths limitation on Windows ([62ef6f5fa1](https://github.com/facebook/react-native/commit/62ef6f5fa1ecb918bde130a6024b65afcd34c7e3) by [@mganandraj](https://github.com/mganandraj)) + +## v0.68.1 + +### Changed + +#### Android specific + +- Bump React Native Gradle plugin to 0.0.6 ([9573d7b84d](https://github.com/facebook/react-native/commit/9573d7b84d35233fbb39a4067cfef65490aa34a7) by [@cortinico](https://github.com/cortinico)) +- Don't require yarn for codegen tasks ([d5da70e17e](https://github.com/facebook/react-native/commit/d5da70e17e8c8210cd79a4d7b09c6a5ded4b5607) by [@danilobuerger](https://github.com/danilobuerger)) + +### Fixed + +- Fix dynamic_cast (RTTI) by adding key function to ShadowNodeWrapper and related classes ([58a2eb7f37](https://github.com/facebook/react-native/commit/58a2eb7f37c2dc27ad3575618778ad5b23599b27) by [@kmagiera](https://github.com/kmagiera)) +- Pin use-subscription to < 1.6.0 ([5534634892](https://github.com/facebook/react-native/commit/5534634892f47a3890e58b661faa2260373acb25) by [@danilobuerger](https://github.com/danilobuerger)) + +#### Android specific + +- Use NDK 23 only for Windows users. ([e48a580080](https://github.com/facebook/react-native/commit/e48a580080bdae58b375f30fbcf8a83cc1915b2f) by [@cortinico](https://github.com/cortinico)) +- Improve support for Android users on M1 machine ([4befd2a29c](https://github.com/facebook/react-native/commit/4befd2a29cb94b026d9c048a041aa9f1817295b5) by [@cortinico](https://github.com/cortinico)) +- Template: Specify abiFilters if enableSeparateBuildPerCPUArchitecture is not set. ([5dff920177](https://github.com/facebook/react-native/commit/5dff920177220ae5f4e37c662c63c27ebf696c83) by [@cortinico](https://github.com/cortinico)) +- Fix for building new architecture sources on Windows ([5a8033df98](https://github.com/facebook/react-native/commit/5a8033df98296c941b0a57e49f2349e252339bf9) by [@mganandraj](https://github.com/mganandraj)) + +## v0.68.0 + +### Breaking Changes + +- CI moved to Node 16. ([f1488db109](https://github.com/facebook/react-native/commit/f1488db109d13e748b071c02b40e90cdca1cc79d) by [@kelset](https://github.com/kelset)). + This change enforces Node >= 14 for React Native builds. +- Bump Android Gradle Plugin to 7.0.1. ([272cfe5d13](https://github.com/facebook/react-native/commit/272cfe5d1371c38a281cf3883ff0254a8d3505a3) by [@dulmandakh](https://github.com/dulmandakh)) + This version of Android Gradle plugin enforces JDK 11 for Android builds. Do not upgrade to AGP 7.1 as it is not supported by this version of react-native. +- Removed `fallbackResource` from `RCTBundleURLProvider` API ([0912ee179c](https://github.com/facebook/react-native/commit/0912ee179c210fb6b2ed9afbb3f2fbc5fb8a2bb3)) by [@philIip](https://github.com/philIip) + +### New Architecture + +*If you are interested in enabling the new architecture, please refer to [the dedicated documentation](https://reactnative.dev/docs/next/new-architecture-intro).* + +- Do not include Facebook license on users codegen'd code ([450967938a](https://github.com/facebook/react-native/commit/450967938ab25c4dabb9d5ecd9f7b57afb1c78dd) by [@cortinico](https://github.com/cortinico)) + +#### Android specific + +- Setup a `newArchEnabled` property to Opt-in the New Architecture in the template ([8d652fba4c](https://github.com/facebook/react-native/commit/8d652fba4ce07256784a1b7e86713c810336856d) by [@cortinico](https://github.com/cortinico)) + +#### iOS specific + +- Add fabric option to the default app template. ([2e9a376c84](https://github.com/facebook/react-native/commit/2e9a376c8488d1fb11c0b5d604137712321fd90d) by [@sota000](https://github.com/sota000)) +- Add turbo module support in the default app template. ([8ec0e6919c](https://github.com/facebook/react-native/commit/8ec0e6919c5fab118c8b54538860ee36009bfaa7) by [@sota000](https://github.com/sota000)) +- Rename the new architecture flag to RCT_NEW_ARCH_ENABLED. ([c0c5439959e](https://github.com/facebook/react-native/commit/c0c5439959e21d7806178bb9139c2cd19b857506) by [@sota000](https://github.com/sota000)) + +### Added + +- Create @fb-tools-support/yarn package ([7db294d6d5](https://github.com/facebook/react-native/commit/7db294d6d5b00a38f305dd52be3e0961f35695c8) by [@motiz88](https://github.com/motiz88)) +- Support string color values in Animated.Color ([d3a0c4129d](https://github.com/facebook/react-native/commit/d3a0c4129d6a5a7beced4e9aa62b2da4e3f4fed4)) +- New Animated.Color node ([ea90a76efe](https://github.com/facebook/react-native/commit/ea90a76efef60df0f46d29228289f8fc1d26f350)) +- Added linter warning config for unstable nested components ([988fefc44d](https://github.com/facebook/react-native/commit/988fefc44d39957e8c5e1eecb02dfd1ce119f34c) by [@javache](https://github.com/javache)) +- Option to supply `platformConfig` to NativeAnimated ([4a227ce2ab](https://github.com/facebook/react-native/commit/4a227ce2ab3f8c181150461ab28b831979093db0) by [@rozele](https://github.com/rozele)) +- Animated.event can be used to extract values with numeric keys from native events ([b2105711a0](https://github.com/facebook/react-native/commit/b2105711a0b90859f8e3fc1aaec4998e252c2d14) by [@javache](https://github.com/javache)) +- Adds a setSelection imperative method to TextInput ([771ca921b5](https://github.com/facebook/react-native/commit/771ca921b59cc3b3fd12c8fe3b08ed150bcf7a04) by [@lyahdav](https://github.com/lyahdav)) +- Native-only prop to optimize text hit testing on some RN platforms ([f3bf2e4f51](https://github.com/facebook/react-native/commit/f3bf2e4f51897f1bb71e37002c288ebf3b23cf78) by [@rozele](https://github.com/rozele)) + +#### Android specific + +- Added DoNotStripAny proguard rules ([48318b1542](https://github.com/facebook/react-native/commit/48318b1542910b939ab977c0bc82e98f098abe50) by [@ShikaSD](https://github.com/ShikaSD)) +- Add new API in ScrollView and HorizontalScrollView to process pointerEvents prop. ([48f6967ae8](https://github.com/facebook/react-native/commit/48f6967ae88100110160e1faf03e6c0d37e404bd) by [@ryancat](https://github.com/ryancat)) +- Add `accessibilityLabelledBy` props ([36037fa81b](https://github.com/facebook/react-native/commit/36037fa81bbdcc460057e7e7cf608cd364ca48a6) by [@grgr-dkrk](https://github.com/grgr-dkrk)) +- Added missing constructor to WritableNativeArray ([c68c47d2ba](https://github.com/facebook/react-native/commit/c68c47d2bafa8e8e25b534d6cdd1a63bc77a1cf4) by [@piaskowyk](https://github.com/piaskowyk)) +- Add new API for custom fling animator to provide predicted travel distance for its fling animation. ([fe6277a30d](https://github.com/facebook/react-native/commit/fe6277a30d3ec19e4772991e30ae20c3a9cfe565) by [@ryancat](https://github.com/ryancat)) +- Adding new API `onChildEndedNativeGesture` to the RootView interface to let its implementations notify the JS side that a child gesture is ended. ([9b33c31ee0](https://github.com/facebook/react-native/commit/9b33c31ee024bae30e441107f838e1b5044525ba) by [@ryancat](https://github.com/ryancat)) +- Make the `reactNativeArchitectures` property more discoverable ([0f39a1076d](https://github.com/facebook/react-native/commit/0f39a1076dc154995a2db79352adc36452f46210) by [@cortinico](https://github.com/cortinico)) +- Added `isAccessibilityServiceEnabled` to get if accessibility services are enabled ([c8b83d4e0b](https://github.com/facebook/react-native/commit/c8b83d4e0b33c2af45093f7b2262ee578ece2faf) by [@grgr-dkrk](https://github.com/grgr-dkrk)) +- Add bundleForVariant option ([d2c10da5d5](https://github.com/facebook/react-native/commit/d2c10da5d5687833545691f281473381e4466c2e) by [@grit96](https://github.com/grit96)) +- Add ACCEPT_HANDOVER, ACTIVITY_RECOGNITION, ANSWER_PHONE_CALLS, READ_PHONE_NUMBERS & UWB_RANGING to PermissionsAndroid ([4b25a0aaa0](https://github.com/facebook/react-native/commit/4b25a0aaa077caf9c437bcfeef8a226eda5a102e) by [@iBotPeaches](https://github.com/iBotPeaches)) + +#### iOS specific + +- Add new argument to announceForAccessibility to allow queueing on iOS ([4d1357918a](https://github.com/facebook/react-native/commit/4d1357918a4dcb331ccea2140699f487ca45ea30) by [@peterc1731](https://github.com/peterc1731)) +- Add volta support to find-node.sh ([765844055b](https://github.com/facebook/react-native/commit/765844055ba0d02262a11114bad5da67e935d8df) by [@liamjones](https://github.com/liamjones)) +- Support fnm when detecting node binary ([c9e4d34885](https://github.com/facebook/react-native/commit/c9e4d3488578d65e55198ad597252a2ac8cc5f73) by [@MoOx](https://github.com/MoOx)) +- Find-node.sh now respects .nvmrc ([35bcf934b1](https://github.com/facebook/react-native/commit/35bcf934b186e581d100d43e563044300759557f) by [@igrayson](https://github.com/igrayson)) +- Add macros to be able to stub C functions in tests ([749a9207b6](https://github.com/facebook/react-native/commit/749a9207b6f0545c03ca83efbda7971ffd4d2d57) by [@philIip](https://github.com/philIip)) + + +### Changed + +- Bump RN CLI to v7.0.3, and Metro to 67 ([848ba6fb1d](https://github.com/facebook/react-native/commit/848ba6fb1db81bbb44efd373af9e81f31f227aef) by [@kelset](https://github.com/kelset)) and ([df2e934a69](https://github.com/facebook/react-native/commit/df2e934a697b5b207053db3bbcf71492932a6062) by [@kelset](https://github.com/kelset)) +- Upgraded react-devtools-core dependency to 4.23.0 ([1cc217d5ef](https://github.com/facebook/react-native/commit/1cc217d5effdbee4cf2f64063a443ecb331673d4) by [@bvaughn](https://github.com/bvaughn)) +- Bump Flipper to 0.125.0 ([50057158ca](https://github.com/facebook/react-native/commit/50057158ca32842d70160541e3cb5d4bd512f8f5) by [@cortinico](https://github.com/cortinico)) +- Export Flow type for deceleration rate for use in other files to keep deceleration rate prop values consistently typed ([9b0ed920ef](https://github.com/facebook/react-native/commit/9b0ed920ef087c4c18504adacf9d4f557812cf1b)) +- Upgrade deprecated-react-native-prop-types dependency ([badd30885f](https://github.com/facebook/react-native/commit/badd30885fb999124b6b54b3fb016edbd988c16b) by [@chiaramooney](https://github.com/chiaramooney)) +- Improved error message in react.gradle ([7366a866b3](https://github.com/facebook/react-native/commit/7366a866b381db6fc5615153e7788aa4828cfd96) by [@vonovak](https://github.com/vonovak)) +- Upgraded packages to the latest versions for ESLint v7. ([cf763cdf81](https://github.com/facebook/react-native/commit/cf763cdf816e1cad20caf2347c54bc96c7f6dd47) by [@yungsters](https://github.com/yungsters)) +- Updated the links for the discussions and changelog ([daf37a1fce](https://github.com/facebook/react-native/commit/daf37a1fce43403e6320e1e3023e86fd1b970bdf) by [@MikeyAlmighty](https://github.com/MikeyAlmighty)) +- XMLHttpRequest.getAllResponseHeaders() now returns headers with names lowercased and sorted in ascending order, as per specification ([b2415c4866](https://github.com/facebook/react-native/commit/b2415c48669391ee1ab7c6450748c4d91097a666) by [@ascherkus](https://github.com/ascherkus)) +- Bump react-native-codegen to 0.0.9 ([e3a71b019f](https://github.com/facebook/react-native/commit/e3a71b019fa78e2b4b3454ccc59ea9c8cc543b29) by [@cortinico](https://github.com/cortinico)) +- Accessing `Image.propTypes`, `Text.propTypes`, `TextInput.propTypes`, `ColorPropType`, `EdgeInsetsPropType`, `PointPropType`, or `ViewPropTypes` now emits a deprecation warning. ([3f629049ba](https://github.com/facebook/react-native/commit/3f629049ba9773793978cf9093c7a71af15e3e8d) by [@yungsters](https://github.com/yungsters)) +- Bump `core-workflow-apply-version-label` version ([e973b3afc2](https://github.com/facebook/react-native/commit/e973b3afc274f892a0e5a6fdea9004dc5d84eb2b) by [@lucasbento](https://github.com/lucasbento)) +- Add `vendor/bundle` into .gitignore template ([2f67f5d68b](https://github.com/facebook/react-native/commit/2f67f5d68b17010c49f2996a788fe68c1fe2e9f6) by [@MoOx](https://github.com/MoOx)) + +#### Android specific + +- Add allowsEdgeAntialiasing on views with rotations or skew transforms ([e6a3410afe](https://github.com/facebook/react-native/commit/e6a3410afe7d9a4cecf3db0a95503d2ff05bb862)) +- Bump Kotlin version to 1.6.10 ([d0f0234656](https://github.com/facebook/react-native/commit/d0f0234656dc981b422d1e9aa0885afd5fd29879) by [@AKB48](https://github.com/AKB48)) +- Bump Soloader to 0.10.3 ([f45889ef95](https://github.com/facebook/react-native/commit/f45889ef95ec694520e91b0032e591a087e088e5) by [@osartun](https://github.com/osartun)) +- Bump Gradle to 7.3 ([c180627ac7](https://github.com/facebook/react-native/commit/c180627ac7e5e155707b3c9433c4582839e1820e) by [@dulmandakh](https://github.com/dulmandakh)) +- Bump Android compile and target SDK to 31 ([00ac034353](https://github.com/facebook/react-native/commit/00ac034353cbc867991bf79cb1dd103353f47126) by [@ShikaSD](https://github.com/ShikaSD)) +- Use side-by-side NDK for Android ([bd7caa64f5](https://github.com/facebook/react-native/commit/bd7caa64f5d6ee5ea9484e92c3629c9ce711f73c) by [@cortinico](https://github.com/cortinico)) +- Leverage Gradle implicit dependency substitution for Gradle Plugin ([0fccbd53af](https://github.com/facebook/react-native/commit/0fccbd53af86083a8742a33282dc183d07eb27a2) by [@cortinico](https://github.com/cortinico)) +- Remove unused import of JMessageQueueThread.h ([705236e363](https://github.com/facebook/react-native/commit/705236e3637e4f80e5fa4bd7234df9f1e14a5d3d) by [@sshic](https://github.com/sshic)) +- Made `MessageQueueThread#runOnQueue` return a boolean. Made `MessageQueueThreadImpl#runOnQueue` return false when the runnable is not submitted. ([89faf0c9a8](https://github.com/facebook/react-native/commit/89faf0c9a87f6de68ca416d10566dbcbe80d9450)) +- Assume *.ktx assets are packaged as Android drawables ([cb610ddca7](https://github.com/facebook/react-native/commit/cb610ddca79fe29b88568545ab011671fc392c9a) by [@motiz88](https://github.com/motiz88)) +- Add ViewConfigs to support onEnter/onExit/onMove events ([44143b50fd](https://github.com/facebook/react-native/commit/44143b50fdcafe22caa43d76ec3210132ce3af21) by [@mdvacca](https://github.com/mdvacca)) +- Let react_native_assert really abort the app ([2ae06df58f](https://github.com/facebook/react-native/commit/2ae06df58f5f5eaf4386c14d28af25b643401bf3) by [@cortinico](https://github.com/cortinico)) +- Bugfix for multiple shadow threads rendered at the same time, small probability crash. ([9d71b166a6](https://github.com/facebook/react-native/commit/9d71b166a6c9d9afec7186c6a33aedc6975aa43c) by [@chenmo187](https://github.com/chenmo187)) +- RootView's onChildStartedNativeGesture now takes the child view as its first argument ([03e513de41](https://github.com/facebook/react-native/commit/03e513de41bf60f071eacbbb9604c83605abf625) by [@javache](https://github.com/javache)) +- Add ReactInstanceEventListenerV2 for migration ([ce74aa4ed3](https://github.com/facebook/react-native/commit/ce74aa4ed335d4c36ce722d47937b582045e05c4) by [@sshic](https://github.com/sshic)) +- Improved logic of findTargetPathAndCoordinatesForTouch ([dfe42d6b75](https://github.com/facebook/react-native/commit/dfe42d6b75005f519c0e2c87c75e7886dce3345c) by [@javache](https://github.com/javache)) +- Set a resolution strategy for com.facebook.react:react-native when on New Architecture ([e695bc0bb5](https://github.com/facebook/react-native/commit/e695bc0bb50fc1c712e9862ed8fe4e7cc6619fae) by [@cortinico](https://github.com/cortinico)) +- Make hermes-executor-common a static lib ([b2cf24f41c](https://github.com/facebook/react-native/commit/b2cf24f41cb5f15653b34d396ef2a1c90defdf43) by [@janicduplessis](https://github.com/janicduplessis)) +- Static link for hermes-inspector ([20b0eba581](https://github.com/facebook/react-native/commit/20b0eba581a00e5e7e300f6377379b836617c147) by [@janicduplessis](https://github.com/janicduplessis)) + +#### iOS specific + +- Don't capitalize the first letter of a word that is starting by a number ([8b5a5d4645](https://github.com/facebook/react-native/commit/8b5a5d4645136ef3d6ee043348e583cbbac87ee3) by [@MaeIg](https://github.com/MaeIg)) +- updated `jsBundleURLForBundleRoot:fallbackResource` to `jsBundleURLForBundleRoot:` ([aef843bfe6](https://github.com/facebook/react-native/commit/aef843bfe60bda6bcc98d3fb4a6c295c9f4b66e3) by [@philIip](https://github.com/philIip)) +- Remove iOS 11 availability check ([9b059b6709](https://github.com/facebook/react-native/commit/9b059b67092f4e7d568867a2b3a51dfd7c6f1db6) by [@ken0nek](https://github.com/ken0nek)) +- Refactor: Assign string label to each case in RCTPLTag enum for startup performance logging ([60e60a9b3d](https://github.com/facebook/react-native/commit/60e60a9b3d42d342eaf5ddee4841b121f6474a6c) by [@p-sun](https://github.com/p-sun)) +- IOS Ruby Updates ([1e6add1a43](https://github.com/facebook/react-native/commit/1e6add1a43355bb88c57400a7420a656966bef97) by [@barbieri](https://github.com/barbieri)) +- Update Flipper pods to support re-enable macCatalyst ([2a5265dff7](https://github.com/facebook/react-native/commit/2a5265dff7e654f57b43335804840692313f2a56) by [@mikehardy](https://github.com/mikehardy)) +- Apple Silicon builds of glog & Flipper-Glog ([274c617f5b](https://github.com/facebook/react-native/commit/274c617f5bda263ff29115b3dcc013e47085a78d) by [@rayzr522](https://github.com/rayzr522)) + +### Fixed + +- Fix error "mockModal is not a function" ([507b05f4c0](https://github.com/facebook/react-native/commit/507b05f4c02b46109f483a2b79c924a775fd7bd3) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) +- Fixes execution of animation when a toValue of AnimatedValue is used. ([8858c21124](https://github.com/facebook/react-native/commit/8858c2112421be5212c024f9e404e66437a41389)) +- Fix RN version syntax to match new nightly build structure. ([3d1d4ee457](https://github.com/facebook/react-native/commit/3d1d4ee4572600425b8eb5d0d6512bb0d2a6ea44) by [@chiaramooney](https://github.com/chiaramooney)) +- Fix typo in _updateBottomIfNecessary function on KeyboardAvoidingView component ([0cc80b4d0c](https://github.com/facebook/react-native/commit/0cc80b4d0cb78a835977dbe5100262a16882bbea) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Fix: Removes interface only check from third party components GenerateThirdPartyFabricComponentsProvider ([3e6902244a](https://github.com/facebook/react-native/commit/3e6902244a0d189261dbbe327296db1349e37410) by [@Ubax](https://github.com/Ubax)) +- Set CxxModules' Instance before retrieving their Method vector. ([1d45b20b6c](https://github.com/facebook/react-native/commit/1d45b20b6c6ba66df0485cdb9be36463d96cf182) by [@JunielKatarn](https://github.com/JunielKatarn)) +- AnimatedValue.__detach should store getValue result with offset deducted ([fe53cae954](https://github.com/facebook/react-native/commit/fe53cae954b37528eeaa1258ac0060c4298473bb) by [@rozele](https://github.com/rozele)) +- AnimatedValue.stopAnimation callback with correct value for NativeAnimated ([8ba771c3dd](https://github.com/facebook/react-native/commit/8ba771c3ddc00b1499e95a2812b4cd5ac904c8df) by [@rozele](https://github.com/rozele)) +- ESLint no-undef rule clashing with TypeScript compiler for TS files ([ae67c5ac45](https://github.com/facebook/react-native/commit/ae67c5ac45a8044fc1db66aee8eae6e881d660e4) by [@fiznool](https://github.com/fiznool)) +- ESLint `no-shadow` rule returning false positive for TypeScript enums ([722a0ff6f8](https://github.com/facebook/react-native/commit/722a0ff6f88bed4d54579a2b8bc574e87948187f) by [@fiznool](https://github.com/fiznool)) +- Fix support for custom port ([b399c2e3d1](https://github.com/facebook/react-native/commit/b399c2e3d10fa521dbec87243d3e96f6bca7df1e) by [@enniel](https://github.com/enniel)) +- `onLayout` prop is handled correctly in `` ([9c5e177a79](https://github.com/facebook/react-native/commit/9c5e177a79c64c77f281ce727538973e8222e975)) +- Modal accepts a testID but didn't forward it to RCTModalHostView, therefore not making it show up for e2e tests depending on viewhierarchy. ([5050e7eaa1](https://github.com/facebook/react-native/commit/5050e7eaa17cb417baf7c20eb5c4406cce6790a5) by [@GijsWeterings](https://github.com/GijsWeterings)) +- Remove unused and incorrect type declarations in WebSocketInterceptor ([91728e2266](https://github.com/facebook/react-native/commit/91728e2266375b954302ba0cd4b5daf641aefc23) by [@mischnic](https://github.com/mischnic)) +- Complete missing Flow declarations in URL ([98abf1b02f](https://github.com/facebook/react-native/commit/98abf1b02f64ad40d523335e677a2ede15b3650d) by [@mischnic](https://github.com/mischnic)) +- Pressable not passing hover props and event handlers to PressabilityConfig ([1b30dd074b](https://github.com/facebook/react-native/commit/1b30dd074b579c2ae138a1111d07ddb56761315d) by [@Saadnajmi](https://github.com/Saadnajmi)) +- Composite animations will now be ran immediately when the app is in testing mode ([b03e824c52](https://github.com/facebook/react-native/commit/b03e824c52123219a5c8fbd89473391bf0bc31c8) by [@javache](https://github.com/javache)) +- Remove duplicate class members ([c0e489b729](https://github.com/facebook/react-native/commit/c0e489b7293f15858cb706f1b8587600e429af28) by [@bradzacher](https://github.com/bradzacher)) +- Fix: Use same implementation for `performance.now()` on iOS and Android ([1721efb54f](https://github.com/facebook/react-native/commit/1721efb54ff9cc4f577b5ae27f13fcf56801a92c) by [@mrousavy](https://github.com/mrousavy)) + +#### Android specific + +- Enable cliPath to have an absolute path value ([5d560ca99f](https://github.com/facebook/react-native/commit/5d560ca99ff7220de11d2d76dbe77d73990894a8) by [@Krisztiaan](https://github.com/Krisztiaan)) +- Make sure configureNdkBuild* tasks are depending on preBuild ([2fdbf6a10f](https://github.com/facebook/react-native/commit/2fdbf6a10fe67fa3209a51a1105a97c16991f561) by [@cortinico](https://github.com/cortinico)) +- Added a null check to native.value in Switch to fix https://github.com/facebook/react-native/issues/32594 ([8d50bf1133](https://github.com/facebook/react-native/commit/8d50bf113352a6ccdf74c979e1022c6c2ccf6e56) by [@jonathanmos](https://github.com/jonathanmos)) +- Fix overflowInset calculation by using transform values ([8aa87814f6](https://github.com/facebook/react-native/commit/8aa87814f62e42741ebb01994796625473c1310f) by [@ryancat](https://github.com/ryancat)) +- Add missing sources jar into published android artifacts ([384e1a0c7b](https://github.com/facebook/react-native/commit/384e1a0c7bc50d2aab5b59bcedcea5a3e98f1659) by [@Kudo](https://github.com/Kudo)) +- Fix math for detecting if children views are in parent's overflowInset area. ([45244ebce2](https://github.com/facebook/react-native/commit/45244ebce228dfbc3412670e64c11491ba8d8c47) by [@ryancat](https://github.com/ryancat)) +- Fixed empty screen after retrying a BundleDownloader failure in dev mode ([c8d823b9bd](https://github.com/facebook/react-native/commit/c8d823b9bd9619dfa1f5851af003cc24ba2e8830) by [@samkline](https://github.com/samkline)) +- Fix crash from ScrollView that occurs while reporting an error from JS ([2151d11527](https://github.com/facebook/react-native/commit/2151d1152719a230565165f1a8dcfab172689eb3) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Enable hitSlop to be set using a single number. ([589b129581](https://github.com/facebook/react-native/commit/589b129581903a737a64e14eab3f2e29620831d5) by [@javache](https://github.com/javache)) +- Fix fling and snap with recycler viewgroup where fling to the end of scrollable distance when it goes over current rendered children views. ([ead7b97944](https://github.com/facebook/react-native/commit/ead7b97944522e3066ceb2bd50c63c268c961277) by [@ryancat](https://github.com/ryancat)) +- Fixed edge case for quick small scrolls causing unexpected scrolling behaviors. ([f70018b375](https://github.com/facebook/react-native/commit/f70018b37532622f08f20b2c51cdbfca55d730ea) by [@ryancat](https://github.com/ryancat)) +- Fix crash on ReactEditText with AppCompat 1.4.0 ([e21f8ec349](https://github.com/facebook/react-native/commit/e21f8ec34984551f87a306672160cc88e67e4793) by [@cortinico](https://github.com/cortinico)) +- Do not .lowerCase the library name when codegenerating TurboModule Specs ([28aeb7b865](https://github.com/facebook/react-native/commit/28aeb7b8659b38ee3a27fae213c4d0800f4d7e31) by [@cortinico](https://github.com/cortinico)) +- Enable hitSlop to be set using a single number. ([a96bdb7154](https://github.com/facebook/react-native/commit/a96bdb7154b0d8c7f43977d8a583e8d2cbdcb795) by [@javache](https://github.com/javache)) +- Updated TextInput prop types to accomodate for new autoComplete values ([9eb0881c8f](https://github.com/facebook/react-native/commit/9eb0881c8fecd0e974b1cb9f479bad3075854340) by [@TheWirv](https://github.com/TheWirv)) +- Don't reconstruct app components https://github.com/facebook/react-native/issues/25040 ([fc962c9b6c](https://github.com/facebook/react-native/commit/fc962c9b6c4bf9f88decbe014ab9a9d5c1cf51bc) by [@Somena1](https://github.com/Somena1)) +- Do NOT skip the first child view in the scroll view group when measuring the lower and upper bounds for snapping. ([61e1b6f86c](https://github.com/facebook/react-native/commit/61e1b6f86cf98d8a74eeb9353143fe0c624fe6e6) by [@ryancat](https://github.com/ryancat)) +- Fix crash when a Switch is initialised with both backgroundColor and thumbColor. ([456cf3db14](https://github.com/facebook/react-native/commit/456cf3db14c443c483d63aa97c88b45ffd25799b) by [@smarki](https://github.com/smarki)) +- Fix devDisabledIn not working with multiple productFlavors ([055ea9c7b7](https://github.com/facebook/react-native/commit/055ea9c7b7dea030ef16da72d1f6ecb5d95ac468) by [@grit96](https://github.com/grit96)) +- Revert `ReactScrollView` to use `Context` instead of `ReactContext` in the constructor to be less restrictive. ([7b77cc637e](https://github.com/facebook/react-native/commit/7b77cc637e1faf4a2b134853f8415f277d0decdc) by [@ryancat](https://github.com/ryancat)) +- Fix onPress event for nested Text in RN Android ([e494e4beb6](https://github.com/facebook/react-native/commit/e494e4beb6a124008fd116178cbc38335bd87809) by [@mdvacca](https://github.com/mdvacca)) +- Fix enableVmCleanup not working for apps with product flavors ([a2b5e4cd82](https://github.com/facebook/react-native/commit/a2b5e4cd825a358419cef1e3823b72215b689686) by [@cortinico](https://github.com/cortinico)) +- Prevent NPE on ThemedReactContext ([f1b5fe1d3e](https://github.com/facebook/react-native/commit/f1b5fe1d3ea49294d8c89accfa27d76a1a97ccea) by [@sshic](https://github.com/sshic)) +- fix: jvm 11 error message from ReactPlugin.kt and react.gradle ([4e947ecb2d](https://github.com/facebook/react-native/commit/4e947ecb2dabfa0226af7f859c828847b4d891c0) by [@nomi9995](https://github.com/nomi9995)) + +#### iOS specific + +- ScrollView: Respect `contentInset` when animating new items with `autoscrollToTopThreshold`, make `automaticallyAdjustKeyboardInsets` work with `autoscrollToTopThreshold` (includes vertical, vertical-inverted, horizontal and horizontal-inverted ScrollViews) ([49a1460a37](https://github.com/facebook/react-native/commit/49a1460a379e3a71358fb38888477ce6ea17e81a) by [@mrousavy](https://github.com/mrousavy)) +- Prevent RCTConvert error for allowed null blob types ([e1b698c5f2](https://github.com/facebook/react-native/commit/e1b698c5f2b1d689fb3940f8c6a3e298d381ea3a) by [@habovh](https://github.com/habovh)) +- Migrate ScreenshotManager from NativeModule to TurboModule ([b13e41d98e](https://github.com/facebook/react-native/commit/b13e41d98e818279d1941f3425707d3c0ce407fc) by [@p-sun](https://github.com/p-sun)) +- Fix usage of cocoapods with --project-directory flag and new arch ([9e7d91f2fc](https://github.com/facebook/react-native/commit/9e7d91f2fc4d576b8fba81304a24e50134da93d6) by [@danilobuerger](https://github.com/danilobuerger)) +- Post RCTContentDidAppearNotification with new arch ([75105e692c](https://github.com/facebook/react-native/commit/75105e692c2be9bd192089a6a6ffde7572ee1ce1) by [@danilobuerger](https://github.com/danilobuerger)) +- Remove absolute paths from pods project ([42b01a32a1](https://github.com/facebook/react-native/commit/42b01a32a137f18ae9fd2f00914f2edb0e107421) by [@danilobuerger](https://github.com/danilobuerger)) +- Respect RCTSetDefaultFontHandler chosen font ([89efa1a0c1](https://github.com/facebook/react-native/commit/89efa1a0c1b633bf9edee66583800ad3fc54ce63) by [@danilobuerger](https://github.com/danilobuerger)) +- Fixed duplicated UUIDs problem during pod install phase. ([f595a4e681](https://github.com/facebook/react-native/commit/f595a4e681e75aaf737b6582f69855d76a1f33dd)) +- Fix `Time.h` patch not being applied when running `pod install --project-directory=ios` ([60cef850bd](https://github.com/facebook/react-native/commit/60cef850bd3fd12c32ee1196bd19a559592d1465) by [@tido64](https://github.com/tido64)) +- Fix WebSocket control frames having payloads longer than 125 bytes ([86db62b7a8](https://github.com/facebook/react-native/commit/86db62b7a8b28ac82dd0a0627a8b6c351875f682) by [@asmeikal](https://github.com/asmeikal)) +- Stop RedBox from appearing for LogBox handled errors ([9d2df5b8ae](https://github.com/facebook/react-native/commit/9d2df5b8ae95b3cfeae26f64bd1d50bd2b0bbae9) by [@liamjones](https://github.com/liamjones)) +- Enable hitSlop to be set using a single number. ([3addafa525](https://github.com/facebook/react-native/commit/3addafa5257ade685216900bebbad8c35e24e124) by [@javache](https://github.com/javache)) +- Fix `__apply_Xcode_12_5_M1_post_install_workaround` failing when one of the Pods has no IPHONEOS_DEPLOYMENT_TARGET set ([9cd4092336](https://github.com/facebook/react-native/commit/9cd40923362ff717a722f8f36c8250a29a5142b7) by [@Yonom](https://github.com/Yonom)) +- This is a quick speculative fix since we know `CFRunLoopPerformBlock` does not push/pop an autorelease pool. ([3fff164dfa](https://github.com/facebook/react-native/commit/3fff164dfa1c97f69b1701e974effc92a94152d6) by [@christophpurrer](https://github.com/christophpurrer)) +- Fixed RCTImageLoaderTests ([1542f83527](https://github.com/facebook/react-native/commit/1542f835273c08776b960929b5aa7cefbd225971) by [@philIip](https://github.com/philIip)) +- Fix Rosetta2 CocoaPods warning on Apple Silicon ([e918362be3](https://github.com/facebook/react-native/commit/e918362be3cb03ae9dee3b8d50a240c599f6723f) by [@oblador](https://github.com/oblador)) +- Fix `pod install --project-directory=ios` failing due to wrong path to `React-Codegen` ([ebb26cf2e4](https://github.com/facebook/react-native/commit/ebb26cf2e420616c8bf01a5148ca4f8419b238d3) by [@tido64](https://github.com/tido64)) + +### Deprecated + +#### Android specific + +- Gradle: Deprecate `reactRoot` in favor of `root` and `reactNativeDir` ([8bc324fd34](https://github.com/facebook/react-native/commit/8bc324fd34337ab159e2e21e213a6c5b06c548da) by [@cortinico](https://github.com/cortinico)) + + +### Removed + +- DeprecatedPropTypes (deep-link) modules removed from React Native. ([23717c6381](https://github.com/facebook/react-native/commit/23717c6381a41b1c5f189376bfa5bc73c7a4da87) by [@yungsters](https://github.com/yungsters)) +- `accessibilityStates` no longer passed through to RCTView. ([1121ed94ab](https://github.com/facebook/react-native/commit/1121ed94ab470be27207b0c8dbae5d19860c08da) by [@luism3861](https://github.com/luism3861)) + +#### iOS specific + +- Remove RCTUIManagerObserver from RCTNativeAnimatedTurboModule ([e9ed115bab](https://github.com/facebook/react-native/commit/e9ed115babbc82968380dae22fa928d4ce3cd6da) by [@p-sun](https://github.com/p-sun)) + +## v0.67.5 + +🚨 **IMPORTANT:** This is an exceptional release on an unsupported version. We recommend you upgrade to one of [the supported versions, listed here](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported). + +### Fixed + +- Force dependencies resolution to minor series for 0.67 ([9f2acda1b8](https://github.com/facebook/react-native/commit/9f2acda1b807e790b3e7562ce3436b93bcc2ad09) by [@cortinico](https://github.com/cortinico)) + +## v0.67.4 + +### Fixed + +#### Android specific + +- Added a null check to native.value in Switch to fix https://github.com/facebook/react-native/issues/32594 ([8d50bf1133](https://github.com/facebook/react-native/commit/8d50bf113352a6ccdf74c979e1022c6c2ccf6e56) by [@jonathanmos](https://github.com/jonathanmos)) + +## v0.67.3 + +### Fixed + +#### Android specific + +- Text with adjustsFontSizeToFit changes the text layout infinitely ([c1db41f060](https://github.com/facebook/react-native/commit/c1db41f060908e6ab001aaace7c20c610056f59a)) + +#### iOS specific + +- Fix a broken input for the Korean alphabet in TextInput ([1a83dc36ce](https://github.com/facebook/react-native/commit/1a83dc36ce0af33ac7a3c311354fce4bfa5ba1a3) by [@bernard-kms](https://github.com/bernard-kms)) + +## v0.67.2 + +### Fixed + +- Fix error "mockModal is not a function" ([507b05f4c0](https://github.com/facebook/react-native/commit/507b05f4c02b46109f483a2b79c924a775fd7bd3) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) + +#### Android specific + +- Fix potential crash if ReactRootView does not have insets attached. ([6239e2f5ce](https://github.com/facebook/react-native/commit/6239e2f5ce82f7c2e683eb4699b9ce3ff1b58ac5) by [@enahum](https://github.com/enahum)) +- Upgrading OkHttp from 4.9.1 to 4.9.2 to fix CVE-2021-0341. ([e896d21](https://github.com/facebook/react-native/commit/e896d21ced3c0c917c2fc0044d2b93b44df9a081) by [@owjsub](https://github.com/owjsub)) + +#### iOS specific + +- Fix `Time.h` patch not being applied when running `pod install --project-directory=ios` ([60cef850bd](https://github.com/facebook/react-native/commit/60cef850bd3fd12c32ee1196bd19a559592d1465) by [@tido64](https://github.com/tido64)) +- Find-node.sh now respects .nvmrc ([35bcf934b1](https://github.com/facebook/react-native/commit/35bcf934b186e581d100d43e563044300759557f) by [@igrayson](https://github.com/igrayson)) + +## v0.67.1 + +### Fixed + +#### Android specific + +- Do not remove libjscexecutor.so from release builds ([574a773f8f](https://github.com/facebook/react-native/commit/574a773f8f55fe7808fbb672066be8174c64d76d) by [@cortinico](https://github.com/cortinico)) + +#### iOS specific + +- Remove alert's window when call to `hide`. ([a46a99e120](https://github.com/facebook/react-native/commit/a46a99e12039c2b92651af1996489d660e237f1b) by [@asafkorem](https://github.com/asafkorem)) + +## v0.67.0 + +### Added + +#### Android specific +- Add `ACCESS_MEDIA_LOCATION` permission to PermisionsAndroid library. ([79db483568](https://github.com/facebook/react-native/commit/79db4835681f5d0149620ec8e0990411cb882241) by [@Skrilltrax](https://github.com/Skrilltrax)) +- Implement `SnapToAlignment` in `ReactScrollView` ([e774c037bc](https://github.com/facebook/react-native/commit/e774c037bce40a4b48e78d2d0a1085a1e4f5a328)), `ReactScrollViewManager` ([c6e5640e87](https://github.com/facebook/react-native/commit/c6e5640e87e7cb5b514ded2c8d4cbb039bd02c5f)), `ReactHorizontalScrollView` ([b12256394e](https://github.com/facebook/react-native/commit/b12256394e34c375942ca508ef79a8c816317976)), `ReactHorizontalScrollViewManager` ([deec1db9fd](https://github.com/facebook/react-native/commit/deec1db9fdf2848941326ba5bebc11f3592a301e)) and update `ScrollView.js` ([a54cfb9e57](https://github.com/facebook/react-native/commit/a54cfb9e5794f196d3834e19762f3aacf47a177d)) and reach parity with iOS ([04184ef851](https://github.com/facebook/react-native/commit/04184ef851c71141009c523ba59838ae6af19ba5)) by [@mdvacca](https://github.com/mdvacca) +- Show Redbox for C++ errors. ([d6c879edba](https://github.com/facebook/react-native/commit/d6c879edbad068d0f461381875b7fae6db99d18d) by [@sota000](https://github.com/sota000)) +- Added an experimental touch dispatch path ([a2feaeb5f1](https://github.com/facebook/react-native/commit/a2feaeb5f1121a860a9416b5d4e0e96debd45b09) by [@ShikaSD](https://github.com/ShikaSD)) + +#### iOS specific +- Added `cancelButtonTintColor` prop for `ActionSheetIOS` to change only the text color of the cancel button ([01856633a1](https://github.com/facebook/react-native/commit/01856633a1d42ed3b26e7cc93a007d7948e1f76e) by [@nomi9995](https://github.com/nomi9995)) +- Added [`LSApplicationQueriesSchemes`](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW14) in info.plist with entries tel, telprompt, http, fb, geo ([b26f277262](https://github.com/facebook/react-native/commit/b26f2772624c863c91fa1ff627b481c92d7562fb) by [@utkarsh-dixit](https://github.com/utkarsh-dixit)) +- Add `UIAccessibilityTraitUpdatesFrequently` to progressBar role ([1a42bd6e97](https://github.com/facebook/react-native/commit/1a42bd6e97ae44a3b38ca552865bac63a6f35da5) by [@jimmy623](https://github.com/jimmy623)) +- Add `asdf-vm` support in `find-node.sh` ([3e7c310b1d](https://github.com/facebook/react-native/commit/3e7c310b1dcf5643920535eea70afa451888792a) by [@pastleo](https://github.com/pastleo)) + + +### Changed +- `ImageBackground` now respects `imageStyle` width and height ([dbd5c3d8e5](https://github.com/facebook/react-native/commit/dbd5c3d8e5e35685be89156194a96cead553a330) by [@Naturalclar](https://github.com/Naturalclar)) +- Rename deprecated `Keyboard.removeEventListener` to `Keyboard.removeListener`. ([8880c09076](https://github.com/facebook/react-native/commit/8880c09076e4727768ace26a74766cbe6f64021c) by [@yungsters](https://github.com/yungsters)) +- Update `Modal`'s mock to not render its children when it is not visible ([ec614c16b3](https://github.com/facebook/react-native/commit/ec614c16b331bf3f793fda5780fa273d181a8492) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) +- Upgraded `react-devtools-core` dependency to 4.19.1 ([356236471a](https://github.com/facebook/react-native/commit/356236471abc6b5b8c139223e15388fd1eecd2d1) by [@jstejada](https://github.com/jstejada)) +- React-native/normalize-color now supports Node.js ([65e58f26e1](https://github.com/facebook/react-native/commit/65e58f26e1fbd06b1ae32e2ab3a2616c8eef08e0) by [@yungsters](https://github.com/yungsters)) +- Updated to Contributor Covenant v2.1 ([19f8d2f7da](https://github.com/facebook/react-native/commit/19f8d2f7da13f4524f31acf7aa10cc0aa91b5da4)) + + +#### Android specific +- Hermes initialization will no longer need an explicit configuration. ([a40f973f58](https://github.com/facebook/react-native/commit/a40f973f58609ca717fac63bc501d5cf93b748ad) by [@Ashoat](https://github.com/Ashoat)) +- Setting `overflow: scroll` in View component style will clip the children in the View container ([93beb83abe](https://github.com/facebook/react-native/commit/93beb83abef42b92db43ee3bb8b156f486a6c00f) by [@ryancat](https://github.com/ryancat)) +- Native views backing `Animated.View` (w/ JavaScript-driven animations) will no longer be flattened; this should be a transparent change. ([4fdbc44ab5](https://github.com/facebook/react-native/commit/4fdbc44ab5945399338e4ed94ea5611098bd2142) by [@yungsters](https://github.com/yungsters)) +- Use new Locale API on Android 11 (API 30)+ ([b7c023a8c1](https://github.com/facebook/react-native/commit/b7c023a8c1122500c6ceb7de2547569b3b9251ba)) +- Changed `react.gradle` `detectCliPath` function logic for `cliPath` case ([ce51b62494](https://github.com/facebook/react-native/commit/ce51b6249449361ee50b8c99a427c28af7ab3531) by [@vitalyiegorov](https://github.com/vitalyiegorov)) +- Remove `"high"` and `"balanced"` as values for `android_hyphenationFrequency` on `Text` ([a0d30b848a](https://github.com/facebook/react-native/commit/a0d30b848a07480d0fccec608a62a505c71f8cac)) +- Bump Gradle version to 7.2, Bump Kotlin version to 1.5.31 ([9ae3367431](https://github.com/facebook/react-native/commit/9ae3367431428748f5486c782199beb4f9c6b477) by [@svbutko](https://github.com/svbutko)) +- Move mavenCentral repo below local paths ([046b02628d](https://github.com/facebook/react-native/commit/046b02628d32eadd6d44160ab79932f6c26b188d) by [@friederbluemle](https://github.com/friederbluemle)) + +#### iOS specific +- Optimized font handling for iOS ([4ac42d88ef](https://github.com/facebook/react-native/commit/4ac42d88ef60ae3fed7319851d47b93e98ac9afa) by [@Adlai-Holler](https://github.com/Adlai-Holler)) +- Remove iOS 11 version check as minimum deployment is iOS 11 ([398595e074](https://github.com/facebook/react-native/commit/398595e07483fa8f45579de4ca1aee9585e20620) by [@ken0nek](https://github.com/ken0nek)) +- Don't hang app for 60s if packager can't be reached, changed to 10s ([c0e04460f5](https://github.com/facebook/react-native/commit/c0e04460f546dfef2623bff367eb8db8fd75fa34) by [@radex](https://github.com/radex)) + +### Removed + +- Removed unnecessary global variable `GLOBAL`. ([a101fc768c](https://github.com/facebook/react-native/commit/a101fc768cedc7ac9754006e5b7292bb7084ab54) by [@rubennorte](https://github.com/rubennorte)) +- Removed unused files: `StaticContainer.react.js`, `ensurePositiveDelayProps.js`, `InteractionMixin.js`, `queryLayoutByID.js` ([64aa1e5ffe](https://github.com/facebook/react-native/commit/64aa1e5ffe5d577c04cabb3692246b956f65597b) by [@ecreeth](https://github.com/ecreeth)) + +#### Android specific + +- Remove `DatePickerAndroid` from react-native. ([7a770526c6](https://github.com/facebook/react-native/commit/7a770526c626e6659a12939f8c61057a688aa623) by [@andresantonioriveros](https://github.com/andresantonioriveros)) + +#### iOS specific + +### Fixed + +- Update metro config language to `blockList` ([7923804c28](https://github.com/facebook/react-native/commit/7923804c28aac731396f0db112cb6c3a9d30c08f) by [@rh389](https://github.com/rh389)) +- Ignores global npm prefix ([6334ac35ac](https://github.com/facebook/react-native/commit/6334ac35ac3cbc2c84b2d46d46ec118bf9bf714d) by [@redreceipt](https://github.com/redreceipt)) +- Support `Animated.ValueXY` when validating `Animated.event`. ([27dd2ecb70](https://github.com/facebook/react-native/commit/27dd2ecb70f1d08787c93a2e18250ffaff328e5f) by [@javache](https://github.com/javache)) +- Add a function `getIgnorePatterns` in `LogBoxData.js` for tests or other usecases. ([a950634424](https://github.com/facebook/react-native/commit/a950634424cddf31c0adb6c9799adf1cc5f83bf0)) + +#### Android specific + +- TextInput Drawable to avoid Null Pointer Exception RuntimeError https://github.com/facebook/react-native/issues/17530 ([254493e1fb](https://github.com/facebook/react-native/commit/254493e1fb0c3a1e279e2c957e83edac6252d041) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Nested Text Android `onPress` does not work with last character ([132d1d00f8](https://github.com/facebook/react-native/commit/132d1d00f885fe5a45d712fd7698db285c22bc4b) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Fix non selectable Text in FlatList ([c360b1d92b](https://github.com/facebook/react-native/commit/c360b1d92b69e1d298b390ec88c4d29c1023945a) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Set `textBreakStrategy` default to be `'highQuality'` ([3b2d541989](https://github.com/facebook/react-native/commit/3b2d5419899363d84aea4f5cc3a4c75253dd6406)) +- Fix error handling when loading JSC or Hermes ([d839b24b06](https://github.com/facebook/react-native/commit/d839b24b06d31b4ce91fb459742831b942972f56) by [@iqqmuT](https://github.com/iqqmuT)) +- Fix encoding for gradlew.bat files ([ab2bdee735](https://github.com/facebook/react-native/commit/ab2bdee735cd0d53d3dbfbac5cd31f96eefb7e61) by [@yungsters](https://github.com/yungsters)) +- Fix `hermesFlags` not working with multiple variants ([91adb761cf](https://github.com/facebook/react-native/commit/91adb761cf1583598d4d63ce879fd7e0f4ae793c) by [@grit96](https://github.com/grit96)) +- `ScrollTo` API in ScrollView will check the actual scroll position before setting the scroll state ([1a9e2d5d55](https://github.com/facebook/react-native/commit/1a9e2d5d5589ce5cee92868ea5bccceb6e161eff) by [@ryancat](https://github.com/ryancat)) +- Compute Android Notch in `keyboardDidShow` height calculation API 28+ ([8bef3b1f11](https://github.com/facebook/react-native/commit/8bef3b1f1136ab5c2f2309a3101a7d9626ced1f5) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Fix `currentActivity` being null when launching Redbox ([f4fdf4b55e](https://github.com/facebook/react-native/commit/f4fdf4b55e4489c21f4552b4ac01ef253c038b2d)) +- When sending OS intents, always set `"FLAG_ACTIVITY_NEW_TASK"` flag (required by OS). ([04fe3ed80d](https://github.com/facebook/react-native/commit/04fe3ed80d9c201a483a2b477aeebd3d4169fd6d) by [@Krizzu](https://github.com/Krizzu)) +- Fix missing WebView provider crash in ForwardingCookieHandler ([d40cb0e1b0](https://github.com/facebook/react-native/commit/d40cb0e1b0fb233a27b9d476167814d2853acf2a) by [@RodolfoGS](https://github.com/RodolfoGS)) +- Fix `keyboardDismissMode="on-drag"` on Android ([7edf9274cf](https://github.com/facebook/react-native/commit/7edf9274cf6d3398075c19cd1cb020a5d6a346a2) by [@janicduplessis](https://github.com/janicduplessis)) +- Fixed `alignItems: baseline` for elements on Android ([1acf334614](https://github.com/facebook/react-native/commit/1acf33461451834097463f43e70d90bae0f67198)) +- `OnKeyPress` event not fired with numeric keys ([ee3e71f536](https://github.com/facebook/react-native/commit/ee3e71f536127295ba4ea377e618499409a2e9ba) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Exclude unused .so files for reduce android .apk and .aab ([6f126740fa](https://github.com/facebook/react-native/commit/6f126740fa560d7a831979b9f3747baacfb28dba) by [@enniel](https://github.com/enniel)) + +#### iOS specific + +- Fixed an edge case when scroll to item/index is called without animation, the offset position is not updated. This caused the measurement of the position to be wrong. ([55392f65a6](https://github.com/facebook/react-native/commit/55392f65a6addbdd8214b61d4ae286f26d63a94f) by [@ryancat](https://github.com/ryancat)) +- Fixed the issue when moving cursor in multi-line TextInput. ([22801870f0](https://github.com/facebook/react-native/commit/22801870f0613c2544ade1ebc5363e6e2f015c79) by [@xiankuncheng](https://github.com/xiankuncheng)) +- Fix NSInvalidArgumentException for invalid font family names. ([5683932862](https://github.com/facebook/react-native/commit/5683932862ab870e735342342c68e03fb5ca9e09) by [@yungsters](https://github.com/yungsters)) +- Fix Image `defaultSource` not showing on iOS ([900210cacc](https://github.com/facebook/react-native/commit/900210cacc4abca0079e3903781bc223c80c8ac7) by [@cristianoccazinsp](https://github.com/cristianoccazinsp)) +- Warn if Rosetta2 is being used (x86_64 on arm64) ([51bf557948](https://github.com/facebook/react-native/commit/51bf55794899284e1c465d346a3f6ebd8a485da2) by [@barbieri](https://github.com/barbieri)) +- Source map path for schemes containing whitespaces ([f3fe7a0fb5](https://github.com/facebook/react-native/commit/f3fe7a0fb5fc0325fbe062c6df4cbf8b58779189) by [@andersonvom](https://github.com/andersonvom)) +- Fix build error after running `pod install` with `--project-directory=ios` ([ef5ff3e055](https://github.com/facebook/react-native/commit/ef5ff3e055482771cbe866d4961ee2d0a9e00e45) by [@sonicdoe](https://github.com/sonicdoe)) +- Fixed inability to build apps when gflags is installed ([ab8dbdf663](https://github.com/facebook/react-native/commit/ab8dbdf66363f3d65f0dfbcc4ec7c71b1cd69b2a) by [@KDederichs](https://github.com/KDederichs)) + +### Security + +- Avoiding logging root view params outside of dev / debug mode builds ([e612d3a116](https://github.com/facebook/react-native/commit/e612d3a116f39ab354169643bab0d4bb9cfc1a85) by [@sterlingwes](https://github.com/sterlingwes)) + +## v0.66.5 + +🚨 **IMPORTANT:** This is an exceptional release on an unsupported version. We recommend you upgrade to one of [the supported versions, listed here](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported). + +### Fixed + +- Force dependencies resolution to minor series for 0.66 ([201824c89e](https://github.com/facebook/react-native/commit/201824c89ecebd749ba7e603415edbe6a5b9b73d) by [@cortinico](https://github.com/cortinico)) + +## v0.66.4 + +### Fixed + +#### iOS specific + +- Revert "Fix Deadlock in RCTi18nUtil (iOS)" ([70ddf46](https://github.com/facebook/react-native/commit/70ddf46c8afcd720e188b6d82568eac6ac8125e6) by [@Saadnajmi](https://github.com/Saadnajmi)) +- `apply_Xcode_12_5_M1_post_install_workaround` causing pods targetting iOS 12 and above to fail ([a4a3e67554](https://github.com/facebook/react-native/commit/a4a3e675542827bb281a7ceccc7b8f5533eae29f) by [@Yonom](https://github.com/Yonom)) + +## v0.66.3 + +### Changed + +- Rename deprecated `Keyboard.removeEventListener` to `Keyboard.removeListener`. ([8880c09076](https://github.com/facebook/react-native/commit/8880c09076e4727768ace26a74766cbe6f64021c) by [@yungsters](https://github.com/yungsters)) + +### Fixed + +- Revert changes in Jest preprocessor to fix tests in external projects ([142090a5f3fa7](https://github.com/facebook/react-native/commit/142090a5f3fa7c3ab2ed4c536792e3f26582bd3b) by [@rubennorte](https://github.com/rubennorte)) + +## v0.66.2 + +### Fixed + +- Add a function `getIgnorePatterns` in `LogBoxData.js` for tests or other usecases. ([a950634424](https://github.com/facebook/react-native/commit/a950634424cddf31c0adb6c9799adf1cc5f83bf0)) +- Reintroduce generated codegen files ([7382f556d3](https://github.com/facebook/react-native/commit/7382f556d327d51bd09456efda83edec7e05ecd2) by [@kelset](https://github.com/kelset)) + +#### iOS specific + +- Hide the logbox window explicitly. New behavior in iOS SDK appears to retain UIWindow while visible. ([72ea0e111f](https://github.com/facebook/react-native/commit/72ea0e111fccd99456abf3f974439432145585e3) by [@paddlefish](https://github.com/paddlefish)) + +## v0.66.1 + +### Fixed + +- For Android, general fixes to Appearance API and also fixes AppCompatDelegate.setDefaultNightMode(). For iOS, now works correctly when setting window.overrideUserInterfaceStyle ([25a2c608f7](https://github.com/facebook/react-native/commit/25a2c608f790f42cbc4bb0a90fc06cc7bbbc9b95) by [@mrbrentkelly](https://github.com/mrbrentkelly)) + +#### Android specific + +- Fix Android border positioning regression ([d1a33cd139](https://github.com/facebook/react-native/commit/d1a33cd139fab4565b1fc691f5751c4af99d5849) by [@oblador](https://github.com/oblador)) + +#### iOS specific + +- Fix for unable to find `find-node.sh` in `react-native-xcode.sh` script ([cc59a7cbde](https://github.com/facebook/react-native/commit/cc59a7cbde1c0fc6d6ef059321d23bf287f08218) by [@garethknowles](https://github.com/garethknowles)) + +## v0.66.0 + +### Highlights + +- Hermes 0.9.0 + - This Hermes release is primarily about closing gap between Hermes cut and this React Native release. Among ~400 commits, contains memory and size wins, bugfixes and other progress behind the scenes. See [issue for more details](https://github.com/facebook/hermes/issues/586). +- Allow taps on views outside the bounds of a parent with `overflow: visible` ([e35a963bfb](https://github.com/facebook/react-native/commit/e35a963bfb93bbbdd92f4dd74d14e2ad6df5e14a) by [@hsource](https://github.com/hsource)) +- Fixes for building on Apple Silicon and Xcode 13 ([ac4ddec542](https://github.com/facebook/react-native/commit/ac4ddec542febda744de218dae3a3d34edc7da84) thanks to [@mikehardy](https://github.com/mikehardy)) +- New bluetooth permissions for Android ([2bcc6fac38](https://github.com/facebook/react-native/commit/2bcc6fac3844f0752bc7067517c92a643679575e), [eeb8e58](https://github.com/facebook/react-native/commit/eeb8e5829e183f6b5cd5fd327cf6da03a7db0541) by [@iBotPeaches](https://github.com/iBotPeaches)) + +### Breaking + +- Remove Picker and PickerIOS components + [cddb97ad18](https://github.com/facebook/react-native/commit/cddb97ad18cfdb663dcf015af3c9426d5414e396), [77366cd869](https://github.com/facebook/react-native/commit/77366cd8696cb8ada3f84d7fb4d36a27f7007b06), [ad0ccac0d6](https://github.com/facebook/react-native/commit/ad0ccac0d6471fa5428bf137c3aa0646883e8446) +- Remove StatusBarIOS component ([7ce0f40f5c](https://github.com/facebook/react-native/commit/7ce0f40f5cd8c0928ce720d6d121bcc5963958a2) by [@ecreeth](https://github.com/ecreeth)) + +#### Android specific + +- Updated `autoCompleteType` prop of `TextInput` to `autoComplete` ([27fec9569e](https://github.com/facebook/react-native/commit/27fec9569e08a04e0dbdbd5de063a599ad0416fa) by [@jeswinsimon](https://github.com/jeswinsimon)) + +### Added + +- Add `global.queueMicrotask` ([be189cd819](https://github.com/facebook/react-native/commit/be189cd81905a735f08a8519c62a707658c7fb27) by [@Huxpro](https://github.com/Huxpro)) +- Added data field to `markerPoint` to allow callers to add additional arbitrary string data to logged points ([aa98978302](https://github.com/facebook/react-native/commit/aa9897830293955b7cc77fd818a50e8d736e715d)) +- Adds accessibility actions to Button ([44717152ca](https://github.com/facebook/react-native/commit/44717152cadb18c7aff74e9465fdb70efdb1bf81) by [@dennisurtubia](https://github.com/dennisurtubia)) +- Add accessibilityState prop to Slider component ([35dd86180b](https://github.com/facebook/react-native/commit/35dd86180ba730425b97592ef6e5c4d449caee06) by [@sladyn98](https://github.com/sladyn98)) +- Add support for "togglebutton" `accessibilityRole` ([da899c0cc4](https://github.com/facebook/react-native/commit/da899c0cc4372830e5ca053a096b74fff2a19cb8) by [@kacieb](https://github.com/kacieb)) + +#### Android specific + +- Add INFO, and MENU key event support ([bb33c1050b](https://github.com/facebook/react-native/commit/bb33c1050ba6098a68d70055e33186d9438c4374) by [@havlasme](https://github.com/havlasme)) +- Added all autofill types to TextEdit ([d9e0ea77f0](https://github.com/facebook/react-native/commit/d9e0ea77f0111fd8400c65d68e45d54e2f84287b) by [@safaiyeh](https://github.com/safaiyeh)) +- Add support to URI keyboard type in Android ([1465c8f387](https://github.com/facebook/react-native/commit/1465c8f3874cdee8c325ab4a4916fda0b3e43bdb)) +- Add `MEDIA_STOP`, `MEDIA_NEXT`, and `MEDIA_PREVIOUS` event support to Android TV ([3e2bb331fc](https://github.com/facebook/react-native/commit/3e2bb331fc0974bc870b2e7bd3171e585183ed1b) by [@havlasme](https://github.com/havlasme)) +- Allow configuring ndk build architectures ([d6ed1ff58b](https://github.com/facebook/react-native/commit/d6ed1ff58b2ca4d1c8b45416e56fa1da75633c07) by [@janicduplessis](https://github.com/janicduplessis)) +- Added support for accessibility role of "list" for flatlist and sectioned list ([25a16123a6](https://github.com/facebook/react-native/commit/25a16123a610ae377ced23ef81ed4c03ad7d06d9) by [@anaskhraza](https://github.com/anaskhraza)) +- Support for foreground ripple in Pressable ([0823f299e5](https://github.com/facebook/react-native/commit/0823f299e560efda5c0f344fcec86cf68801f4ab) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Support for ScrollAway native nav bars added to `ReactScrollView` ([0ef5beee85](https://github.com/facebook/react-native/commit/0ef5beee855afa592cc647383ba6a3ceae9cc40a) by [@JoshuaGross](https://github.com/JoshuaGross)) + +#### iOS specific + +- Added new prop "selection" to `TextInputProps` ([8434177722](https://github.com/facebook/react-native/commit/8434177722f70a9325f9a6adf46b5315b1f4ffa4)) +- Support for onRequestClose for iOS Modal component. ([c29ec46b0e](https://github.com/facebook/react-native/commit/c29ec46b0eee99670ce7762898fe3a4810db968b) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Allow `PlatformColor` to return user-defined named asset color ([36c0a7dec1](https://github.com/facebook/react-native/commit/36c0a7dec121bd3a4b92d02c03a24771d3c4cf84) by [@oblador](https://github.com/oblador)) +- Add support for the `UIAccessibilityTraitsTabBar` ([11f8d9c7cd](https://github.com/facebook/react-native/commit/11f8d9c7cd4bae0b1a5e880ea9b2da7447ad76c2) by [@jimmy623](https://github.com/jimmy623)) +- Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. ([f1b1ba8963](https://github.com/facebook/react-native/commit/f1b1ba8963ff152d995c3cd132bc0755413bc44f) by [@swittk](https://github.com/swittk)) +- Introduce `RCTInitializing` to allow NativeModules to initialize themselves ([9b45df1fce](https://github.com/facebook/react-native/commit/9b45df1fced066f40034b0a58be6f4caafd5f785) by [@RSNara](https://github.com/RSNara)) +- Introduce `RCTCallableJSModules` API for NativeModules ([ece373d244](https://github.com/facebook/react-native/commit/ece373d24421d96e62dafa9a064b38acd6b71e46) by [@RSNara](https://github.com/RSNara)) +- Attach `RCTBundleManager` to NativeModules ([329f58ee46](https://github.com/facebook/react-native/commit/329f58ee461e7afade36d8c249d3f4930c485312) by [@RSNara](https://github.com/RSNara)) +- Introduce RCTBundleManager for bundleURL access ([4a1bafe591](https://github.com/facebook/react-native/commit/4a1bafe591917482d78be998d45552e2568e3e23) by [@RSNara](https://github.com/RSNara)) + +### Changed + +- Initialized LogBox earlier and centralized access in LogBox module ([8abe737068](https://github.com/facebook/react-native/commit/8abe737068a54a874571c8b5560b2118b1df31ad) by [@rubennorte](https://github.com/rubennorte)) +- ExceptionsManager will no longer report exceptions with `type === 'warn'`. ([883e0d5752](https://github.com/facebook/react-native/commit/883e0d5752b952c829c8d45504d3532f52bb272f) by [@yungsters](https://github.com/yungsters)) +- Disable TouchableOpacity when `accessibilityState.disabled` is set ([ea609defe8](https://github.com/facebook/react-native/commit/ea609defe8462a6beeac4da3aa7a43397ee9a77f) by [@chakrihacker](https://github.com/chakrihacker)) +- Upgrade Babel from 7.12.3 to 7.14.1 ([58a0f9b4e2](https://github.com/facebook/react-native/commit/58a0f9b4e202a921ab0820c79d6a3dd54204da46) by [@MichaReiser](https://github.com/MichaReiser)) +- Upgrade `react-devtools-core` from ~4.6.0 to ^4.13.0 ([9e020ef476](https://github.com/facebook/react-native/commit/9e020ef476e24bb5703fc421225f1a94ae14512b) by [@bvaughn](https://github.com/bvaughn)) +- Update Flipper to 0.99.0 ([41f45a77ad](https://github.com/facebook/react-native/commit/41f45a77ad09b46de328fb2a72775a052dac1e93) by [@swrobel](https://github.com/swrobel)) +- Bump CLI to ^6.0.0 ([c677e196a9](https://github.com/facebook/react-native/commit/c677e196a9c4d6cfdf84d97e4746922bb4ed4823) by [@thymikee](https://github.com/thymikee)) +- Upgrade ESLint TS parser and plugin ([3b751d396b](https://github.com/facebook/react-native/commit/3b751d396ba0acaa1b4c8e1115c79eb45dab403d) by [@wcandillon](https://github.com/wcandillon)) +- Upgrade folly to 2021.06.28.00 and boost to 1.76.0 ([b77948e33b](https://github.com/facebook/react-native/commit/b77948e33bc5e0df422fffca3b4c9253f611d298) by [@Kudo](https://github.com/Kudo)) + +#### Android specific + +- Add BLUETOOTH_ADVERTISE to `PermissionsAndroid` ([2bcc6fac38](https://github.com/facebook/react-native/commit/2bcc6fac3844f0752bc7067517c92a643679575e) by [@iBotPeaches](https://github.com/iBotPeaches)) +- Native ScrollView listeners list maintains weak references to listeners to avoid memory leaks ([b673e352fb](https://github.com/facebook/react-native/commit/b673e352fb0ea44b545edf5a7e8c1b422180838a) by [@dalves](https://github.com/dalves)) +- Rename the "Toggle Inspector" DevMenu item to "Hide/Show Element Inspector" ([e91fb05db7](https://github.com/facebook/react-native/commit/e91fb05db7f576e07114755b9db1eee91c672f25) by [@RSNara](https://github.com/RSNara)) +- Localize "search", "button", and "togglebutton" accessibility roles by using the platform roles ([399285f91c](https://github.com/facebook/react-native/commit/399285f91c2f675dea16fe61a86049ef7fecf35b) by [@kacieb](https://github.com/kacieb)) +- Refactor `AndroidTextInput.AndroidTextInput.color` prop to use SharedColor instead of int ([bc57056cc3](https://github.com/facebook/react-native/commit/bc57056cc3263431d54982426d890ba60b4cadb7) by [@mdvacca](https://github.com/mdvacca)) +- Upgraded `infer-annotation` to 0.18.0. ([b5c94e316c](https://github.com/facebook/react-native/commit/b5c94e316cc9b4ff090d8daa8970bf1becf77959) by [@yungsters](https://github.com/yungsters)) +- Bumped AGP to 4.2.2 ([ae494e7ce1](https://github.com/facebook/react-native/commit/ae494e7ce199cc5d524f791d45ddce51535cdadb) by [@cortinico](https://github.com/cortinico)) +- Upgrade folly to 2021.06.28.00 ([ebe939b18a](https://github.com/facebook/react-native/commit/ebe939b18aa859eb0f7f265222874c292ed771a4) by [@Kudo](https://github.com/Kudo)) +- Bump NDK to 21.4.7075529 ([aa43aab77c](https://github.com/facebook/react-native/commit/aa43aab77c8571632a2b0913c80fbf822dac01bc) by [@dulmandakh](https://github.com/dulmandakh)) + +#### iOS specific + +- ScrollView scrollIndicatorInsets to not automatically add safe area on iOS13+ ([bc1e602e0c](https://github.com/facebook/react-native/commit/bc1e602e0c7922da6bf238675b7bf8b4c3faa493) by [@justinwh](https://github.com/justinwh)) + +### Removed + +- `StyleSheet.create` will no longer do DEV-time validation. ([2e8c0bd7ea](https://github.com/facebook/react-native/commit/2e8c0bd7ea7db1aac183eb7f656772d3cffcb132) by [@yungsters](https://github.com/yungsters)) + +### Fixed + +- Fix `window` not existing in jest setup ([bc1c533833](https://github.com/facebook/react-native/commit/bc1c533833bfe25a22f1abd105b8bcb1babce3b5) by [@timomeh](https://github.com/timomeh)) +- Clamp negative values for `numberOfLines` in component ([3bc883c6c6](https://github.com/facebook/react-native/commit/3bc883c6c60632f6a41df3867368f16f684b3865) by [@ShikaSD](https://github.com/ShikaSD)) +- Add missing `jest/create-cache-key-function` dep root package.json ([9a43eac7a3](https://github.com/facebook/react-native/commit/9a43eac7a32a6ba3164a048960101022a92fcd5a) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix Switch ref forwarding ([1538fa4455](https://github.com/facebook/react-native/commit/1538fa4455fa7095879aceba7f74a519c1337a8b) by [@janicduplessis](https://github.com/janicduplessis)) +- Report fatal errors even if its `type` is "warn". ([e4a4c4d6d7](https://github.com/facebook/react-native/commit/e4a4c4d6d71ab1a747d768e4b518e64e100ddfde) by [@yungsters](https://github.com/yungsters)) +- Parse `accessibilityAction` props into object instead of string ([faaeb778df](https://github.com/facebook/react-native/commit/faaeb778dfe25df67fc00b599d023819c10406e8) by [@ShikaSD](https://github.com/ShikaSD)) +- Avoid downgrading `console.error` when passed warning-like objects. ([0dba0aff18](https://github.com/facebook/react-native/commit/0dba0aff185f4fd46e1146362235e68e52c59556) by [@yungsters](https://github.com/yungsters)) +- Fix natively driven animations not getting reset properly ([129180c77b](https://github.com/facebook/react-native/commit/129180c77b0b99a3acedbeb04ce6ec4667f74cac) by [@tienphaw](https://github.com/tienphaw)) +- Fix compilation errors on Windows. ([6d04a46f74](https://github.com/facebook/react-native/commit/6d04a46f7427b9e107608f8f620fe2a1a84ff42d)) +- Fixed bug parsing hermes call stacks when the file name is empty ([e539e7d0be](https://github.com/facebook/react-native/commit/e539e7d0bed4fef42f458f28d06100ae23f52cb7) by [@MartinSherburn](https://github.com/MartinSherburn)) +- Upgrade dependencies / version of eslint package ([463ec22bb9](https://github.com/facebook/react-native/commit/463ec22bb9f2938164fef6133dfd94d2e428e5b0) by [@mikehardy](https://github.com/mikehardy)) + +#### Android specific + +- Allow taps on views outside the bounds of a parent with `overflow: visible` ([e35a963bfb](https://github.com/facebook/react-native/commit/e35a963bfb93bbbdd92f4dd74d14e2ad6df5e14a) by [@hsource](https://github.com/hsource)) +- Fixed to use correct Android theme color for dark theme ([b3a715f6ea](https://github.com/facebook/react-native/commit/b3a715f6ea3d0faaf6d09e2a49267f2a5fb3fad2) by [@sidverma32](https://github.com/sidverma32)) +- Fixed dynamic behavior of `` on Android ([59021521e7](https://github.com/facebook/react-native/commit/59021521e7aba0f70b91b5c7778ccdd1b30eaae4)) +- Fix Dimensions not updating ([c18a492858](https://github.com/facebook/react-native/commit/c18a492858e94b31e632560ad17499012e688158) by [@jonnyandrew](https://github.com/jonnyandrew)) +- Fix dashed/dotted border-drawing when `borderRadius` is 0 ([3e5998e651](https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) by [@IjzerenHein](https://github.com/IjzerenHein)) +- Fix selectionColor doesn't style Android TextInput selection handles ([5819538a08](https://github.com/facebook/react-native/commit/5819538a087f1f48d564e7b4e273fe43dfb026cc) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard ([f51773ecde](https://github.com/facebook/react-native/commit/f51773ecdedbac19d25eb20894e532edef2cb304) by [@levibuzolic](https://github.com/levibuzolic)) +- Avoid calling setHint with a null parameter causing cursor to jump to the right ([3560753559](https://github.com/facebook/react-native/commit/356075355908f4901b87ad6ce33c157f01c8e748) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Create slider accessibility delegate in createViewInstance ([91cac20289](https://github.com/facebook/react-native/commit/91cac2028900cd18d17e70f9050cc125ed1eb12e) by [@janicduplessis](https://github.com/janicduplessis)) +- Quickfix individual border style dotted or dashed rendering as solid ([cb0e1d603a](https://github.com/facebook/react-native/commit/cb0e1d603aa4439a4d4804ad2987e4cb1f9bbf90) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Make `mHybridData` thread safe ([7929551623](https://github.com/facebook/react-native/commit/7929551623d4e3fbd849500d795755d0c41fdbbd)) +- Exit early from layout in textview if text layout is null ([8dfc3bcda1](https://github.com/facebook/react-native/commit/8dfc3bcda1e77fc982bc98da20dc129c23d8cc77) by [@ShikaSD](https://github.com/ShikaSD)) +- Fix `NullPointerException` caused by race condition in `ReactInstanceManager.getViewManagerNames` method ([fb386fccdd](https://github.com/facebook/react-native/commit/fb386fccddfe381fd6af5656c13fac802bffd316) by [@mdvacca](https://github.com/mdvacca)) +- Pressable ripple subsequent press coordinates. ([961b00d8c0](https://github.com/facebook/react-native/commit/961b00d8c0117750ce147c0b27c59af93f64b65c) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- TouchableNativeFeedback ripple starts on previous touch location. ([d85d72d0d9](https://github.com/facebook/react-native/commit/d85d72d0d9143693f73cef24c8e5bbb4d539a620) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Fix Crash in `ViewProps.isLayoutOnly` ([e6b9508f12](https://github.com/facebook/react-native/commit/e6b9508f12ffd732d773ddcf9c2f633b0eca4232) by [@javache](https://github.com/javache)) +- Fixed a crash when updating `snapToOffsets` to a null value ([ba387b91d3](https://github.com/facebook/react-native/commit/ba387b91d3c7c9c1acd4b08f07fcd45629f3edfb) by [@maxoumime](https://github.com/maxoumime)) +- Adding `setAccessible` to `ReactImageManager` to allow screenreader announce Image accessibilityState of "disabled" ([333b46c4b0](https://github.com/facebook/react-native/commit/333b46c4b0ddee286e6d1d4b971fe8554a5c14cb) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Fixed Android library builds with react.gradle file ([88f0676ae4](https://github.com/facebook/react-native/commit/88f0676ae49fd629331495101248c8e13423aed2) by [@Legion2](https://github.com/Legion2)) + +#### iOS specific + +- Fix deadlock on `RCTi18nUtil` ([fcead14b0e](https://github.com/facebook/react-native/commit/fcead14b0effe2176a5d08ad50ee71e48528ddbd) by [@Saadnajmi](https://github.com/Saadnajmi)) +- Avoid re-encoding images when uploading local files ([f78526ce3d](https://github.com/facebook/react-native/commit/f78526ce3d4004eb4bf8ca5178ca7e2c1c9abc1a) by [@arthuralee](https://github.com/arthuralee)) +- content is reset when emoji is entered at the max length ([f3b8d4976f](https://github.com/facebook/react-native/commit/f3b8d4976f8608c2cda1f071923f14b6d4538967)) +- Use `actionName` in accessibility event callback ([fed6ad5bad](https://github.com/facebook/react-native/commit/fed6ad5badb4196a1895370fc81c522572cb34b4) by [@ShikaSD](https://github.com/ShikaSD)) + +## v0.65.3 + +🚨 **IMPORTANT:** This is an exceptional release on an unsupported version. We recommend you upgrade to one of [the supported versions, listed here](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported). + +### Fixed + +- Force dependencies resolution to minor series for 0.65 ([9548eaea74](https://github.com/facebook/react-native/commit/9548eaea74c6ad242c015d1984503c4b7eb19b6f) by [@kelset](https://github.com/kelset)) + +## v0.65.2 + +### Fixed + +- For Android, general fixes to Appearance API and also fixes AppCompatDelegate.setDefaultNightMode(). For iOS, now works correctly when setting window.overrideUserInterfaceStyle ([25a2c608f7](https://github.com/facebook/react-native/commit/25a2c608f790f42cbc4bb0a90fc06cc7bbbc9b95) by [@mrbrentkelly](https://github.com/mrbrentkelly)) + +## v0.65.1 + +### Changed + +- Set `react-test-renderer` to `17.0.2` in the template ([d272880](https://github.com/facebook/react-native/commit/d27288044e94a248982f596e9885d55d066bc72e) by [@@rickhanlonii](https://github.com/@rickhanlonii)) + +### Fixed + +- Resolve `NODE_BINARY` after finding the right path to node ([d75683](https://github.com/facebook/react-native/commit/d75683ac943205d64dd4142cca713ab2356094b8) by [@santiagofm](https://github.com/santiagofm)) + +#### Android specific + +- `ColorProps` with value null should be defaultColor instead of transparent ([842bcb902e](https://github.com/facebook/react-native/commit/842bcb902ed27928255b60cb20524e9318d9bf70) by [@hank121314](https://github.com/hank121314)) +- Android Gradle Plugin 7 compatibility ([06e31c748f](https://github.com/facebook/react-native/commit/06e31c748fe87a866dbaf4d0c2019e76ec00e309) by [@dulmandakh](https://github.com/dulmandakh)) + +## v0.65.0 + +### Highlights + +- Hermes 0.8.1. Please see the highlighted changes from its [0.8.0](https://github.com/facebook/hermes/releases/tag/v0.8.0) and [0.8.1](https://github.com/facebook/hermes/releases/tag/v0.8.1) release notes. +- `react-native-codegen` version `0.0.7` is now needed as a `devDependency` in the `package.json`. + +### Breaking Changes + +#### iOS specific + +- Replace `flipper_post_install` with `react_native_post_install` hook. Will automatically detect if Flipper is enabled. ([42dde12aac](https://github.com/facebook/react-native/commit/42dde12aac81208c4e69da991f4e08b9e62d18f6) by [@grabbou](https://github.com/grabbou)) + +### Added + +- Add `onPressIn` & `onPressOut` props to Text ([1d924549ca](https://github.com/facebook/react-native/commit/1d924549cad75912191005c8f68dd73e15b07183) by [@adrienharnay](https://github.com/adrienharnay)) +- Stabilize `RootTagContext`. And temporarily export both `unstable_RootTagContext` and `RootTagContext` ([9d489354ae](https://github.com/facebook/react-native/commit/9d489354ae373614b20cd91f588eb25743686ee0) by [@nadiia](https://github.com/nadiia)) +- Implement `sendAccessibilityEvent` in the React(Fabric/non-Fabric) renderer ([99b7052248](https://github.com/facebook/react-native/commit/99b7052248202cee172e0b80e7ee3dfb41316746) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Re-added `localeIdentifier` to `I18nManager` constants ([6b91ae73cd](https://github.com/facebook/react-native/commit/6b91ae73cdf096e15a3235ae76276f9d7fb12f7b) by [@acoates-ms](https://github.com/acoates-ms)) +- Add PressabilityPerformanceEventEmitter ([c4c0065b00](https://github.com/facebook/react-native/commit/c4c0065b0009ced0049c5abc4dddd327ac638928) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Added `displayName` to some RN contexts to make them more easy to differentiate when debugging. ([68a476103a](https://github.com/facebook/react-native/commit/68a476103a95be77f4fc7c582e52cc94946de1b4) by [@bvaughn](https://github.com/bvaughn)) +- Add `displayName` to `TouchableHighlight` and `TouchableOpacity` ([c4e40b81c0](https://github.com/facebook/react-native/commit/c4e40b81c01d061c189a7d28a4f56a588c3d1aea) by [@brunohkbx](https://github.com/brunohkbx)) +- Added context to URL's error messages when the feature is not implemented ([452240bafa](https://github.com/facebook/react-native/commit/452240bafa970578144aedaea0223e17863d2d26) by [@Crash--](https://github.com/Crash--)) +- Add a `stickyHeaderHiddenOnScroll` option to keep the sticky header hidden during scrolling down, and only slide in when scrolling up ([ffba25c648](https://github.com/facebook/react-native/commit/ffba25c648152021dd3fb9e79afd8cade7008d05)) +- Added `debugName` parameter to `renderApplication` to use as the display name for the React root tree ([eeb36f4709](https://github.com/facebook/react-native/commit/eeb36f470929c2fdd8e1ed69898a5ba9144b8715) by [@rubennorte](https://github.com/rubennorte)) +- Adding support for `cancelOnBackground` for UserFlow ([0d4985900b](https://github.com/facebook/react-native/commit/0d4985900b52d5def22fce4371c2259ee65368ee) by [@dmitry-voronkevich](https://github.com/dmitry-voronkevich)) +- Introducing RuntimeScheduler module ([eb13baf2a6](https://github.com/facebook/react-native/commit/eb13baf2a687b53dde04b9a336f18629d94f4b79) by [@sammy-SC](https://github.com/sammy-SC)) +- Roll out TurboModule Promise Async Dispatch ([5c4f145e33](https://github.com/facebook/react-native/commit/5c4f145e33d92969f8a86284360a5a2f09308500) by [@RSNara](https://github.com/RSNara)) + +#### Android specific + +- Add `getRecommendedTimeoutMillis` to AccessibilityInfo ([d29a7e7a89](https://github.com/facebook/react-native/commit/d29a7e7a89f4e5e3489e9723979426bb1b6f0674) by [@grgr-dkrk](https://github.com/grgr-dkrk)) +- TalkBack now announces "unselected" when changing `accessibilityState.selected` to false. ([73bc96ecf9](https://github.com/facebook/react-native/commit/73bc96ecf9a16d420533c12e9e1812ffe21c10a2) by [@yungsters](https://github.com/yungsters)) +- Fbjni version bump to 0.0.3 ([24f9f75bf6](https://github.com/facebook/react-native/commit/24f9f75bf66b8f32a117ba9f9dea3c65b35b1e00) by [@IvanKobzarev](https://github.com/IvanKobzarev)) +- Add `onFocus` and `onBlur` for Pressable on Android. ([cab4da7288](https://github.com/facebook/react-native/commit/cab4da728814bf9d3c0cc7c9921e982bfc090730)) +- Introduce API to allow applications to register `TurboModuleManagerDelegates` with `ReactInstanceManager` ([eb7e89e286](https://github.com/facebook/react-native/commit/eb7e89e2864e941b4a21d55a7403a6028e9a26a2) by [@RSNara](https://github.com/RSNara)) +- Added convenience methods to simplify native Event classes and ease migrations ([72d0ddc16f](https://github.com/facebook/react-native/commit/72d0ddc16f2f631003c3486e0a59e50c145ec613) by [@JoshuaGross](https://github.com/JoshuaGross)) + +#### iOS specific + +- High contrast dynamic color options for dark and light mode. ([4b9d9dda27](https://github.com/facebook/react-native/commit/4b9d9dda270acd4e0314f40490c699ffd0f6e30e) by [@birkir](https://github.com/birkir)) +- Adds an ability to retrieve the notifications authorization status from JavaScript side. ([b86e52a9ec](https://github.com/facebook/react-native/commit/b86e52a9ec9ec828388eb4a717a3782a54c7b3d9)) +- Added reset method to `RCTFabricSurface` to help with reloads ([53858ceaa3](https://github.com/facebook/react-native/commit/53858ceaa3beab02726b1bd6e125e506477d445e) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Allow `RCTRootView` to be initialized with a frame ([00bc09c8f7](https://github.com/facebook/react-native/commit/00bc09c8f76879eb1f9a92a6a643191da9355de8) by [@appden](https://github.com/appden)) +- Allow for configuring the `NSURLSessionConfiguration` ([58444c74f5](https://github.com/facebook/react-native/commit/58444c74f5c18b74e88a6c1cd0f059fe434c1a21) by [@hakonk](https://github.com/hakonk)) +- Use react-native-codegen in iOS app template ([e99b8bbb40](https://github.com/facebook/react-native/commit/e99b8bbb404f8cd1f11b6c7998083be530d7b8a4) by [@hramos](https://github.com/hramos)) + +### Changed + +- Bump Flipper + Bump hermes (#31872 by [@Titozzz](https://github.com/Titozzz)) +- Show warning when native module without `addListener` or `removeListeners` is passed to `NativeEventEmitter` ([114be1d217](https://github.com/facebook/react-native/commit/114be1d2170bae2d29da749c07b45acf931e51e2) by [@rubennorte](https://github.com/rubennorte)) +- Disable `accessibilityState` when the `TouchableWithoutFeedback` is `disabled`. ([697164077c](https://github.com/facebook/react-native/commit/697164077c362cfa9a384b0f4e246d6bd9c470ba) by [@carloscuesta](https://github.com/carloscuesta)) +- Upgraded `react-devtools-core dependency` to 4.12.0 ([5a2693d78f](https://github.com/facebook/react-native/commit/5a2693d78f1a886f0aa5b7f86830d3ddb54a57e9) by [@bvaughn](https://github.com/bvaughn)) +- Set disabled `accessibilityState` when `TouchableHighlight` is disabled ([f69e096bb4](https://github.com/facebook/react-native/commit/f69e096bb4df67474351786f674b1bb1e42d3363) by [@Naturalclar](https://github.com/Naturalclar)) +- Add checks and logs to for better error handling ([ea1f9531f0](https://github.com/facebook/react-native/commit/ea1f9531f00b5cd834e03f58cdfa117a93634624)) +- CreateAnimatedComponent: removed deprecated lifecycles usage ([ba61267015](https://github.com/facebook/react-native/commit/ba61267015567bf180dd3272a295dc262b3e2c97) by [@nadiia](https://github.com/nadiia)) +- Hide caret in the `TextInput` during test runs. ([397bfa6ad7](https://github.com/facebook/react-native/commit/397bfa6ad7dff71f4b6d27ac17acc76fe8a6bbb5) by [@nadiia](https://github.com/nadiia)) +- Use `usePressability` hook in TextInput ([c4aa411ee3](https://github.com/facebook/react-native/commit/c4aa411ee374f2320343b900f1f8b24a47b633c9) by [@nadiia](https://github.com/nadiia)) +- `Keyboard` no longer inherits from `NativeEventEmitter`, so it no longer implements `removeAllListeners`, and `removeSubscription`. ([1049835b50](https://github.com/facebook/react-native/commit/1049835b504cece42ee43ac5b554687891da1349) by [@yungsters](https://github.com/yungsters)) +- `AppState` no longer inherits from `NativeEventEmitter`, so it no longer implements `addListener`, `removeAllListeners`, and `removeSubscription`. ([6f22989e92](https://github.com/facebook/react-native/commit/6f22989e920246a2cd611b93e170024d89903027) by [@yungsters](https://github.com/yungsters)) +- `DevSettings` no longer inherits from `NativeEventEmitter` ([70cd569e7e](https://github.com/facebook/react-native/commit/70cd569e7e4cceac81023eae4ea5089cff2f9b59) by [@yungsters](https://github.com/yungsters)) +- LogBox will not initially collapse stack frames if every frame would be collapsed. ([88a41f180c](https://github.com/facebook/react-native/commit/88a41f180c315bc55e05d77ddc3fc671ad8630e6) by [@yungsters](https://github.com/yungsters)) +- Update package name warning of deprecated modules ([34e1b0ef98](https://github.com/facebook/react-native/commit/34e1b0ef981559adc09cd9f994bef9584f1c82b7) by [@Naturalclar](https://github.com/Naturalclar)) +- Update react-native-codegen to 0.0.7 ([cd6c9f3273](https://github.com/facebook/react-native/commit/cd6c9f3273fbe41052c4ec8512d3b1129daf149b) by [@Naturalclar](https://github.com/Naturalclar)) +- Update template devDependencies ([652e3953f4](https://github.com/facebook/react-native/commit/652e3953f48938580e1bf8ea1ba70105997e59d2) by [@Bardiamist](https://github.com/Bardiamist)) +- Don't minify JS bundle by default when using hermes ([1a67dda668](https://github.com/facebook/react-native/commit/1a67dda668c71d961a4bb3b0cdf6aa22c0e5c138) by [@janicduplessis](https://github.com/janicduplessis)) +- Migrate warnings in index.js to point to new lean core repos ([4421a64ac1](https://github.com/facebook/react-native/commit/4421a64ac1ea9df3827fb99194c8576a0750beab) by [@Naturalclar](https://github.com/Naturalclar)) +- Update Flipper to 0.93.0 ([06c33e9abe](https://github.com/facebook/react-native/commit/06c33e9abe6ed51b1c8bba03982ebce2b6da3860) by [@mweststrate](https://github.com/mweststrate)) +- Update Flipper to 0.91.1, fixed iOS build support for i386, `use_flipper!()` will no longer need custom overrides to build with XCode 12.5 ([4246c75d0d](https://github.com/facebook/react-native/commit/4246c75d0d5b9dccbe0fd5ecec66b4cc0331f815) by [@mweststrate](https://github.com/mweststrate)) +- Find node on m1 via homebrew node managers ([4d40b53c12](https://github.com/facebook/react-native/commit/4d40b53c12c8ad52760c63cacde417ee876bdfb1) by [@danilobuerger](https://github.com/danilobuerger)) +- Clean up EventObjectPropertyType ([0e46080847](https://github.com/facebook/react-native/commit/0e46080847595fb7577b18042c932db958bc0959) by [@RSNara](https://github.com/RSNara)) +- `Appearance.addChangeListener` now returns an `EventSubscription`. ([305b4253c2](https://github.com/facebook/react-native/commit/305b4253c2a9ed4d71be33e02cb12b6d570e2fb1) by [@yungsters](https://github.com/yungsters)) +- `Dimensions.addEventListener` now returns an `EventSubscription`. ([c47a03563d](https://github.com/facebook/react-native/commit/c47a03563db72d1580bf87b7729bd22ce6ca63dd) by [@yungsters](https://github.com/yungsters)) +- Updated react-native-community/cli to v6 (hence updating metro to 0.66) ([0d32aef3aa](https://github.com/facebook/react-native/commit/0d32aef3aa9a75b00d99503b8e4f502c52380dea) by [@Titozzz](https://github.com/Titozzz)) +- Reflect Hermes release version from HermesBadge ([c54aeccf1a](https://github.com/facebook/react-native/commit/c54aeccf1a8e16240e400d783dda5ec07fcf3808) by [@Huxpro](https://github.com/Huxpro)) + +#### Android specific + +- Modified `NativeEventEmitter` to also use the passed native module to report subscriptions on Android ([f5502fbda9](https://github.com/facebook/react-native/commit/f5502fbda9fe271ff6e1d0da773a3a8ee206a453) by [@rubennorte](https://github.com/rubennorte)) +- RefreshControl.size prop changed its type to string, the valid values are: 'default' and 'large' ([dd60414578](https://github.com/facebook/react-native/commit/dd604145781ac07c8db8d9100043bd76f6d6e913), [65975dd28d](https://github.com/facebook/react-native/commit/65975dd28de0a7b8b8c4eef6479bf7eee5fcfb93) by [@mdvacca](https://github.com/mdvacca)) +- TouchableNativeFeedback: sync disabled prop with accessibilityState ([88f2356eed](https://github.com/facebook/react-native/commit/88f2356eedf71183d02cde0826c8a0c6910f83dd) by [@kyamashiro](https://github.com/kyamashiro)) +- Rename `hasActiveCatalystInstance` to `hasActiveReactInstance` ([dfa8eb0558](https://github.com/facebook/react-native/commit/dfa8eb0558338f18ea01f294a64d355f6deeff06)) +- Record latest error type in dev support ([423453e105](https://github.com/facebook/react-native/commit/423453e1050c9aedda2df050a5ee6d40e7c82031)) +- Passing accessibility state in button so it can announce disabled in talkback ([5889cbebe3](https://github.com/facebook/react-native/commit/5889cbebe392dd19c6ce0cfd5fa1f725ece1060a) by [@huzaifaaak](https://github.com/huzaifaaak)) +- Fixed issue that causes HorizontalScrollView to shift to the right when a TextInput is selected and keyboard pops up ([b9b23e1ab1](https://github.com/facebook/react-native/commit/b9b23e1ab138189d2a4c22b13ba6ad8f8957579e) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Fixed jumpy RTL horizontal ScrollViews. If you have Android-specific JS hacks for handling RTL in ScrollViews, you probably can/probably want to remove them, because they should be reliable now and require fewer hacks. ([fc032cd8d8](https://github.com/facebook/react-native/commit/fc032cd8d889d828edad3ea4b735205092cf0d40) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Add a new check to avoid calling this method ([2b708560fc](https://github.com/facebook/react-native/commit/2b708560fc002c26f0b09f09cfa451827a3425ac)) +- Clipping subviews has been temporarily disabled in HorizontalScrollView in RTL mode. Minor/negligible perf impact. ([da8ed6b625](https://github.com/facebook/react-native/commit/da8ed6b6252fd53a83f14ab6da7e9b467f12ffe1) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Change StatusBar style handling strategy ([7324b92dc4](https://github.com/facebook/react-native/commit/7324b92dc45679d3b38526378b7d3e78ad082641)) +- Clean listeners during destroy of `ReactContext` ([d79212120b](https://github.com/facebook/react-native/commit/d79212120b7168015d3d0225ef372ed851a230fa) by [@mdvacca](https://github.com/mdvacca)) +- Bump buildToolsVersion to 30.0.2, ([5d01110b53](https://github.com/facebook/react-native/commit/5d01110b5370f884907b6dbdc56773f03518a54d) by [@dulmandakh](https://github.com/dulmandakh)) +- Initial replacement of jcenter with mavenCentral. ([704dd2812f](https://github.com/facebook/react-native/commit/704dd2812f7b8c79971274cc9e4c717e56847ac0) by [@ShikaSD](https://github.com/ShikaSD)) +- Remove developer tool guard for android ([c7d28bca30](https://github.com/facebook/react-native/commit/c7d28bca308c1654c576df9a0328a3116ed65d54)) +- Bump Android compileSdkVersion and targetSdkVersion from 29 to 30 ([55c8833817](https://github.com/facebook/react-native/commit/55c8833817c3e9cf9882a712c8b9946a262df231), [c7efd5b369](https://github.com/facebook/react-native/commit/c7efd5b369aa7605a1017791440735ab72bc9fa8) by [@mdvacca](https://github.com/mdvacca)) +- Upgrade jsc-android to 250230.2.1 ([341f061ce3](https://github.com/facebook/react-native/commit/341f061ce3ae057f3a958654e0ec3a9c4c8211ad) by [@Kudo](https://github.com/Kudo)) +- Bump Gradle to 6.9, Android Gradle Plugin to 4.2.1 ([547b4c92e4](https://github.com/facebook/react-native/commit/547b4c92e4743f5b5816297f48a608ace9de6bb5) by [@dulmandakh](https://github.com/dulmandakh)) +- Bump gradle wrapper to 6.8.3 ([7258afeea3](https://github.com/facebook/react-native/commit/7258afeea38949dc408c0af79924f6f36f7ade84) by [@dulmandakh](https://github.com/dulmandakh)) +- Bumping OkHttp from 4.9.0 to 4.9.1. ([6caec9d91f](https://github.com/facebook/react-native/commit/6caec9d91fe71bcd80d670218d752c4f251bde81) by [@gedeagas](https://github.com/gedeagas)) +- Bumping OkHttp from v3 to v4. ([8207e97f91](https://github.com/facebook/react-native/commit/8207e97f9174a04e319431193c0f63d47a093c44) by [@arazabishov](https://github.com/arazabishov)) +- Update Okhttp to version 3.14.19 ([6bfd89d277](https://github.com/facebook/react-native/commit/6bfd89d27724f2aac602fa2acbf4753950f4152e) by [@LukasFPV](https://github.com/LukasFPV)) +- Bump Fresco to 2.5.0 ([8fa8934011](https://github.com/facebook/react-native/commit/8fa8934011e4d9f1f7a49c8519fcc97f30a5c74b) by [@dulmandakh](https://github.com/dulmandakh)) +- Bump Fresco to 2.3.0 ([280f524b49](https://github.com/facebook/react-native/commit/280f524b491e7a36bb9f9a26e354bb8e125375ed) by [@dulmandakh](https://github.com/dulmandakh)) + +#### iOS specific + +- Give RCTNetworking handler provider block RCTModuleRegistry ([4c5182c1cc](https://github.com/facebook/react-native/commit/4c5182c1cc8bafb15490adf602c87cb5bf289ffd) by [@RSNara](https://github.com/RSNara)) +- Give RCTImageURLLoader's loader/decoder provider blocks RCTModuleRegistry ([af6bcfa3ab](https://github.com/facebook/react-native/commit/af6bcfa3ab0ef6e1b0f669dda6cd7d6a5e8975ba) by [@RSNara](https://github.com/RSNara)) +- Make RCTTurboModule `getTurboModule`: required ([e0b8f5080f](https://github.com/facebook/react-native/commit/e0b8f5080f814ba2a75807ed6d7f2944aab98d7e) by [@RSNara](https://github.com/RSNara)) +- Update React.podspec to require cocoapods >= 1.10.1 ([b50b7e3a19](https://github.com/facebook/react-native/commit/b50b7e3a191dfa95aa122c259e0df8699cbaccae) by [@sunnylqm](https://github.com/sunnylqm)) +- Fix glog pod install with Xcode 12 ([8a5fd8ea95](https://github.com/facebook/react-native/commit/8a5fd8ea95678a0b4423db2cbcbefc1a33595813) by [@dulmandakh](https://github.com/dulmandakh)) +- Only show Dev Menu on shake if RN view is visible ([7186c4de4f](https://github.com/facebook/react-native/commit/7186c4de4fc76e87fa1386f2839f178dd220a02b) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- `progressViewOffset` prop of `RefreshControl` and `VirtualizedList` now works on iOS ([310a6bcf4b](https://github.com/facebook/react-native/commit/310a6bcf4ba7ca162d3ba1c03e0ab07ff41f9ead) by [@davidbiedenbach](https://github.com/davidbiedenbach)) +- Roll out TurboModule block copy ([5275895af5](https://github.com/facebook/react-native/commit/5275895af5136bc278c0c5eb07ae93e395c5b29b) by [@RSNara](https://github.com/RSNara)) +- Add instructions to template/ios/Podfile for enabling hermes ([a326a30e32](https://github.com/facebook/react-native/commit/a326a30e322f6cdff880734aafe965b299febb8d) by [@SConaway](https://github.com/SConaway)) + +### Deprecated + +- `EventEmitter#removeSubscription` is now deprecated. ([cb6cbd12f8](https://github.com/facebook/react-native/commit/cb6cbd12f80152b4ce742f37e2e6eefadf89d927) by [@yungsters](https://github.com/yungsters)) +- It is now deprecated to pass a constructor argument to `EventEmitter(...)`. ([14f7a2b707](https://github.com/facebook/react-native/commit/14f7a2b70754c92804d746959d1ff091bf49af69) by [@yungsters](https://github.com/yungsters)) +- Deprecate `AccessibilityInfo.removeEventListener`. ([003d63d6e5](https://github.com/facebook/react-native/commit/003d63d6e501411f870ff5dbef819ad2aca20974) by [@yungsters](https://github.com/yungsters)) +- Deprecate `Linking.removeEventListener`. Instead, call `remove()` on the subscription returned by `Linking.addEventListener`. ([6d1aca806c](https://github.com/facebook/react-native/commit/6d1aca806cee86ad76de771ed3a1cc62982ebcd7), [035718ba97](https://github.com/facebook/react-native/commit/035718ba97bb44c68f2a4ccdd95e537e3d28690c) by [@yungsters](https://github.com/yungsters)) +- Old Native method to create ScrollEvent has been deprecated and will be removed at some point in the (distant) future ([62f0dee235](https://github.com/facebook/react-native/commit/62f0dee2353b14ce1524dc62de5e1d2f1883a089) by [@JoshuaGross](https://github.com/JoshuaGross)) + +#### Android specific + +- Deprecate `NativeModule.onCatalystInstanceDestroy()` for `NativeModule.invalidate()` ([18c8417290](https://github.com/facebook/react-native/commit/18c8417290823e67e211bde241ae9dde27b72f17) by [@RSNara](https://github.com/RSNara)) +- Mark `hasActiveCatalystInstance()` as Deprecated ([1b50722a7e](https://github.com/facebook/react-native/commit/1b50722a7e84cd8acffd3f0f84d77057e1e0d955)) + +### Removed + +- Stabilize `RootTagContext` ([9b98edcd01](https://github.com/facebook/react-native/commit/9b98edcd0155a4a8a1f71d19e565c485910a6137) by [@nadiia](https://github.com/nadiia)) +- Removed `getNode()` from animated component refs. ([b914153286](https://github.com/facebook/react-native/commit/b914153286ea537d4a57ff934e63e07172c576a0) by [@yungsters](https://github.com/yungsters)) +- Remove legacy context API usage in AppContainer ([17be3a0032](https://github.com/facebook/react-native/commit/17be3a0032c181a100efc7af17b7366a3d636c52) by [@nadiia](https://github.com/nadiia)) +- Removed `AccessibilityInfo.fetch`, use `isScreenReaderEnabled` instead. ([d831134d51](https://github.com/facebook/react-native/commit/d831134d514c5db6be1ee35cc7e9994b777179c1) by [@yungsters](https://github.com/yungsters)) +- Remove unused VR-only props ([95f7c791c5](https://github.com/facebook/react-native/commit/95f7c791c56b527dadbe0b4ec7a1be5af12d7afe) by [@Simek](https://github.com/Simek)) +- Removed `RCTDeviceEventEmitter.sharedSubscribers`. ([3af0c84aa5](https://github.com/facebook/react-native/commit/3af0c84aa5d1633f058ea3e7aef0d125fe33e01d) by [@yungsters](https://github.com/yungsters)) +- Moved `ScrollResponder.Mixin` methods into ScrollView to Remove ScrollResponder.js ([099f67cf8a](https://github.com/facebook/react-native/commit/099f67cf8aa290592092cfa0cb4e938d0543b696) by [@kacieb](https://github.com/kacieb)) +- `NativeEventEmitter` no longer inherits from `EventEmitter`, so it no longer implements `removeListener` and `removeSubscription`. Instead, use the `remove()` method on the subscription object returned by `addListener`. ([d39643b9de](https://github.com/facebook/react-native/commit/d39643b9de11c6b44984166ede34a7f44de76fe5) by [@yungsters](https://github.com/yungsters)) +- `RCTDeviceEventEmitter` no longer throws for `StatusBar`, `Keyboard`, and `AppState` events. However, you are still recommended to use the more appropriate modules for listening to these events. ([c8c975f0d7](https://github.com/facebook/react-native/commit/c8c975f0d7b8a57e9e90373a2be4d630ed9dd65e) by [@yungsters](https://github.com/yungsters)) +- Removed second optional argument of `NativeEventEmitter` constructor ([f5f47879b8](https://github.com/facebook/react-native/commit/f5f47879b8320a9934914cb8ce7a72269840a83a) by [@yungsters](https://github.com/yungsters)) +- Removed warning on Android for `setTimeout` with delays greater than 1 minute. ([480dabd665](https://github.com/facebook/react-native/commit/480dabd66547a60522249eda203a3eb1934b02e5) by [@yungsters](https://github.com/yungsters)) +- Removed `Touchable.TOUCH_TARGET_DEBUG` property. ([ef765d423c](https://github.com/facebook/react-native/commit/ef765d423cb188957a9fb2fd92c62b0efe8a36a6) by [@yungsters](https://github.com/yungsters)) + +#### Android specific + +- Remove okhttp3 proguard rules ([b4c9f13fe7](https://github.com/facebook/react-native/commit/b4c9f13fe794283d76766c1baef87888d174cb1c) by [@doniwinata0309](https://github.com/doniwinata0309)) +- Remove filter pills ([5cf4ab8dd2](https://github.com/facebook/react-native/commit/5cf4ab8dd28b5a336d7af29d295ede51f0d19587) by [@suminkimm](https://github.com/suminkimm)) +- Remove `ReactFragmentActivity` class. ([2798e7172b](https://github.com/facebook/react-native/commit/2798e7172b01b9e2dbe2937d0163f98ab29230cf) by [@dulmandakh](https://github.com/dulmandakh)) +- Remove jcenter ([70da640946](https://github.com/facebook/react-native/commit/70da64094608f5f2e3c554ed719e9aad624e3459) by [@dulmandakh](https://github.com/dulmandakh)) + +#### iOS specific + +- Removed event methods except `addListener` from `Networking` ([a81b7d18fa](https://github.com/facebook/react-native/commit/a81b7d18fa65a727539c6c7ea17f787673d3c889) by [@yungsters](https://github.com/yungsters)) +- Delete deprecated "live reloading" setting ([b512beb0c4](https://github.com/facebook/react-native/commit/b512beb0c497158f9c861fcc16af960655b1feb5) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Remove iOS10/tvOS10 support ([f2c6279ca4](https://github.com/facebook/react-native/commit/f2c6279ca497b34d5a2bfbb6f2d33dc7a7bea02a), [a1d626739d](https://github.com/facebook/react-native/commit/a1d626739d95d6cbbb1be169b93952cdd1465486) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Remove iOS10/tvOS10 support from remaining podfiles ([f0faa7843c](https://github.com/facebook/react-native/commit/f0faa7843c5a0e9041edb6e77fd6631335ab2b12) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Delete RCTTurboModuleManagerDelegate `getTurboModule:initParams` ([c4c34a1237](https://github.com/facebook/react-native/commit/c4c34a1237ec584c667c62358dc577174bf11033) by [@RSNara](https://github.com/RSNara)) + +### Fixed + +- Don't disconnect DevTools WebSocket connection on Cmd+D ([60a18c138c](https://github.com/facebook/react-native/commit/60a18c138c51d3adcfeba7785315fc222cdfeb35) by [@bvaughn](https://github.com/bvaughn)) +- For native components that accept color arrays, invalid elements will now fallback to transparent with a console error. ([bb6cd56fae](https://github.com/facebook/react-native/commit/bb6cd56fae4118f44ae47fd6978710a22f9e1510) by [@yungsters](https://github.com/yungsters)) +- Fixes usage of std::thread in runtime executor ([75d9ba733f](https://github.com/facebook/react-native/commit/75d9ba733f4a041e4320098b52903f69747df02b) by [@asklar](https://github.com/asklar)) +- Fix sticky header not sticking on first render in ScrollView ([921c9ff165](https://github.com/facebook/react-native/commit/921c9ff165d47a73e9978df918b1761b95f9979d) by [@kacieb](https://github.com/kacieb)) +- Fix ScrollView `getInnerViewNode` and `getInnerViewRef` ref methods ([6e36d046a3](https://github.com/facebook/react-native/commit/6e36d046a313c7961cc2f91e0422f4bf29005eb6) by [@vshab](https://github.com/vshab)) +- Fix stalling UI due to a bug in KeyboardAvoidingView ([67309277fe](https://github.com/facebook/react-native/commit/67309277fe588c4dd64fe0c680d1d00d2f3fb2b6) by [@sammy-SC](https://github.com/sammy-SC)) +- Avoid eating clicks/taps into ScrollView when using physical keyboard ([6d2a527984](https://github.com/facebook/react-native/commit/6d2a5279841886a9a14f82057202bf8950c3f917) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix nested FlatList not firing `onScrollDragEnd` and `onMomentum` methods ([46be292f67](https://github.com/facebook/react-native/commit/46be292f671c70aac4ecc178c96e3a2a6a3d16da) by [@kacieb](https://github.com/kacieb)) +- Fix race condition in Debug Inspector shutdown ([d021000b9e](https://github.com/facebook/react-native/commit/d021000b9e358a9379ca5d6208f24757c0c8ce97) by [@MartinSherburn](https://github.com/MartinSherburn)) +- Fixes layout of nodes with `YGDisplayNone` and `YGPositionTypeAbsolute` ([b15f8a30e7](https://github.com/facebook/react-native/commit/b15f8a30e75b54a8de5cc9456aaa07ebe8d8a176) by [@rozele](https://github.com/rozele)) +- Fix changes of View visibilities ([4076293aa1](https://github.com/facebook/react-native/commit/4076293aa1059005704576530d8fe948b85e6a6d) by [@mdvacca](https://github.com/mdvacca)) +- Fix: save connection url as class variable ([8facc865ab](https://github.com/facebook/react-native/commit/8facc865ab2ec032da34f6f755ee8870ee4741aa) by [@sirpy](https://github.com/sirpy)) +- Fix Hermes build on folly version 2021.04.26.00 ([8eceee744e](https://github.com/facebook/react-native/commit/8eceee744ed9fee1eb2402f6b13bb606f6046f62) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Fix disabled handling for Text ([33ff4445dc](https://github.com/facebook/react-native/commit/33ff4445dcf858cd5e6ba899163fd2a76774b641) by [@lunaleaps](https://github.com/lunaleaps)) +- Fix disabled prop not disabling onPress for voice assistant ([1c7d9c8046](https://github.com/facebook/react-native/commit/1c7d9c8046099eab8db4a460bedc0b2c07ed06df) by [@kacieb](https://github.com/kacieb)) +- Fix unsafe cast and detect overflow in MapBuffer. ([e69f1c9f50](https://github.com/facebook/react-native/commit/e69f1c9f50c64bfcaeb684d763f02b9ccadec960)) +- Fix(deps): bump metro to 0.66.2 + dedup ([e40f58272d](https://github.com/facebook/react-native/commit/e40f58272d51a40e7b5fa77c14767ddaf9ecc006) by [@Titozzz](https://github.com/Titozzz)) + +#### Android specific + +- Fixed crash when using style `borderRadius: any` with `backgroundColor: null` ([42b6e6682c](https://github.com/facebook/react-native/commit/42b6e6682ce0fa9ac6eb5c1bf8ef0c224d2d80c0)) +- Fix font weight numeric values ([3827ca6171](https://github.com/facebook/react-native/commit/3827ca61714b699c866e17d58b4697dde86e3d00) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Fix wrong ripple color on Switch component ([1b0683533a](https://github.com/facebook/react-native/commit/1b0683533a07aa8875b4d494d8c2a3d18ef69438) by [@rnike](https://github.com/rnike)) +- Fix Selected State does not announce when TextInput Component selected on Android ([7ee2acc6c8](https://github.com/facebook/react-native/commit/7ee2acc6c84c9ea6a51908495a6f14a26f346b29) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Fix layout bug in ReactTextView. ([dec1b6ba15](https://github.com/facebook/react-native/commit/dec1b6ba15df8f255d30b696a7c08ef543d1d19c)) +- Fix source build on Windows machines vol. 2 ([c37d49492b](https://github.com/facebook/react-native/commit/c37d49492b20c3815ca10133f971755f659b1b6a)) +- Make NativeModules immediately initializable ([2bf866e401](https://github.com/facebook/react-native/commit/2bf866e4018ea72c1f1c92c806db85378c801fb7) by [@RSNara](https://github.com/RSNara)) +- Restore `android_hyphenationFrequency` on `Text`. ([1433ed6333](https://github.com/facebook/react-native/commit/1433ed6333162189730d6f92cf80f3077ac69120) by [@yungsters](https://github.com/yungsters)) +- Display the `testID` as the `resource-id` for black-box testing frameworks ([381fb395ad](https://github.com/facebook/react-native/commit/381fb395ad9d2d48717a5d082aaedbecdd804554) by [@jdeff](https://github.com/jdeff)) +- Fix support for blobs larger than 64 KB ([f00e348ca7](https://github.com/facebook/react-native/commit/f00e348ca7f031c3577b1335a3163bc3e4eb4b41) by [@tomekzaw](https://github.com/tomekzaw)) +- Fix building React Android on Windows. ([5dc15222b2](https://github.com/facebook/react-native/commit/5dc15222b256e32517df553c5fe7f6f5b7d0d31f)) +- Fix race-condition on the initialization of ReactRootViews ([74a756846f](https://github.com/facebook/react-native/commit/74a756846fdab1ef7d183c4df3069a23fcd0d49e) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific + +- Animated images without loop no longer animate twice ([17aa1e320e](https://github.com/facebook/react-native/commit/17aa1e320e75393d46a54ec0fee8b068eeef142f) by [@comvenger-brandon](https://github.com/comvenger-brandon)) +- Allow PlatformColor to work with border colors ([c974cbff04](https://github.com/facebook/react-native/commit/c974cbff04a8d90ac0f856dbada3fc5a75c75b49) by [@danilobuerger](https://github.com/danilobuerger)) +- RCTSurfaceHostingView default background color is now consistent with RCTRootView ([f31497354b](https://github.com/facebook/react-native/commit/f31497354b72ad51b452a4b8bd3b70de16830025) by [@fkgozali](https://github.com/fkgozali)) +- Invalidate TurboModules with infra-generated method queues on their method queues ([497eb578ab](https://github.com/facebook/react-native/commit/497eb578ab32614744a4ef61d7a6bca0d4251885) by [@RSNara](https://github.com/RSNara)) +- Fix RefreshControl layout when removed from window ([e67811e7a6](https://github.com/facebook/react-native/commit/e67811e7a6df0937ed61d3367ab10fab95b31bfa) by [@janicduplessis](https://github.com/janicduplessis)) +- Tab Accessibility Role had incorrect localization string ([80a10953f9](https://github.com/facebook/react-native/commit/80a10953f9de8cc251e9b8c1e59a173af87febb9) by [@adkenyon](https://github.com/adkenyon)) +- Incorrect ScrollView offset on update ([a4526bcc3f](https://github.com/facebook/react-native/commit/a4526bcc3f89f5b9d3f86c814ade8f55c86e819e) by [@rnike](https://github.com/rnike)) +- Modal's `onDismiss` prop will now be called successfully. ([d85d5d2e19](https://github.com/facebook/react-native/commit/d85d5d2e1974b463318e4c86da29a5ccdd60a977) by [@kkoudev](https://github.com/kkoudev)) +- Fix DatePicker sizing issue ([84d55868e8](https://github.com/facebook/react-native/commit/84d55868e8b4e5a555d324c6162b8e38571524d8) by [@sammy-SC](https://github.com/sammy-SC)) +- First press not working after pull to refresh ([c4950610e4](https://github.com/facebook/react-native/commit/c4950610e40f2019c828bc99e29769cd4089c217) by [@rnike](https://github.com/rnike)) +- Fix Codegen silently failing when Yarn is not installed, or when Yarn v2 is active. ([07e4953514](https://github.com/facebook/react-native/commit/07e4953514636aaadc5915944cc64c12028516f2) by [@ivanmoskalev](https://github.com/ivanmoskalev)) +- Make codegen more reliable on iOS ([12fccdeea3](https://github.com/facebook/react-native/commit/12fccdeea33324b8ddaa3ac0e2dbf81a44ca1eb2) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix crash in RCTCoreModulesClassProvider during quit ([2f62c2892d](https://github.com/facebook/react-native/commit/2f62c2892d9979f80752350d1b949f2770511956) by [@appden](https://github.com/appden)) +- Fix an issue calling stopSurface in bridgeless mode before surface is started ([81096901a8](https://github.com/facebook/react-native/commit/81096901a8a6da75744cef7b663ccea2ff9c4c09)) +- Move hermes to a separate podspec ([0959ff36d1](https://github.com/facebook/react-native/commit/0959ff36d1f3264e117021eb1999d0bdb71377c3) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix cli bundle platform for Mac Catalyst in `react-native-xcode.sh` ([b496a531e0](https://github.com/facebook/react-native/commit/b496a531e0b4b5d828077b0e7dff43dd28fed5eb) by [@robertying](https://github.com/robertying)) +- Fix `prefetchImageWithMetadata` redbox([f27e305056](https://github.com/facebook/react-native/commit/f27e305056152ff9ad7aeb9018bf289d51719eb9) by [@p-sun](https://github.com/p-sun)) +- Roll out RCTNetworking extraneous NativeModule call removal ([0e0d2e84f5](https://github.com/facebook/react-native/commit/0e0d2e84f56ea233e72d980ff6bd9797df250553) by [@RSNara](https://github.com/RSNara)) +- Fix Hermes + no Flipper build on Xcode 12.5 ([b9243e00e3](https://github.com/facebook/react-native/commit/b9243e00e30be057a45af6ed1916af4328c458e4) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Fix(hermes): fixed hermes build on iOS ([59abb5f378](https://github.com/facebook/react-native/commit/59abb5f378e116288cdea2f619de0c128bb0b0eb) by [@Titozzz](https://github.com/Titozzz)) +- Fix builds on Xcode 12.5 ([36b58a824e](https://github.com/facebook/react-native/commit/36b58a824ea20daa22fe7c528a3bf0ff4e6a4cb5) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Fix running React Native project with Xcode 12 in Release on iPhone Simulator ([fdcacd7f76](https://github.com/facebook/react-native/commit/fdcacd7f76ea8ca6dafda32ac431c8adc7bdad00) by [@grabbou](https://github.com/grabbou)) + +## v0.64.4 + +🚨 **IMPORTANT:** This is an exceptional release on an unsupported version. We recommend you upgrade to one of [the supported versions, listed here](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported). + +### Fixed + +- Add an afterEvaluate to solve AGP 4.1.x configuration resolution ([667f1bd21a](https://github.com/facebook/react-native/commit/667f1bd21abfdda19e56f8bbf0520fddba3102ed) by [@cortinico](https://github.com/cortinico)) +- Force dependencies resolution to minor series for 0.64 ([a6a183ad81](https://github.com/facebook/react-native/commit/a6a183ad8106d67e3befce842138e82fb1e136fd) by [@kelset](https://github.com/kelset)) + +## v0.64.3 + +### Fixed + +- For Android, general fixes to Appearance API and also fixes AppCompatDelegate.setDefaultNightMode(). For iOS, now works correctly when setting window.overrideUserInterfaceStyle ([25a2c608f7](https://github.com/facebook/react-native/commit/25a2c608f790f42cbc4bb0a90fc06cc7bbbc9b95) by [@mrbrentkelly](https://github.com/mrbrentkelly)) + +## v0.64.2 + +### Changed + +- Find-node.sh supports Homebrew on M1 ([502b819049](https://github.com/facebook/react-native/commit/502b81904998b800f2d960bb4a8e244988c72958) by [@dulmandakh](https://github.com/dulmandakh)) +- Refactor UIManagerHelper.getUIManager to return null when there's no UIManager registered ([b0e8c1eac0](https://github.com/facebook/react-native/commit/b0e8c1eac0a9edda12ecfa264209a8b3222afe27) by [@mdvacca](https://github.com/mdvacca)) + +### Fixed + +- Fix ScrollViewStickyHeader to push up header above it ([d754bdefc6](https://github.com/facebook/react-native/commit/d754bdefc68ff757ac2b5a2ffa38d5aad234d484) by [@kacieb](https://github.com/kacieb)) + +#### Android specific + +- Font family is not apply when secureTextEntry is true ([cda77c77dd83cba07e6c2e56e938c3e4f7faf8fc](https://github.com/facebook/react-native/commit/cda77c77dd83cba07e6c2e56e938c3e4f7faf8fc) by [@hank121314](https://github.com/hank121314)) +- Dimension update events are now properly sent following orientation change ([a6a4d3365f17332e367c34357a07a73f97d6ec83](https://github.com/facebook/react-native/commit/a6a4d3365f17332e367c34357a07a73f97d6ec83) by [@ajpaulingalls](https://github.com/ajpaulingalls)) + +## v0.64.1 + +### Fixed + +#### iOS specific + +- Fixes to ensure Xcode 12.5 builds ([cf8a364767](https://github.com/facebook/react-native/commit/cf8a364767df830d7255339741350bb53ab1a68a), [1c4ac48a55](https://github.com/facebook/react-native/commit/1c4ac48a55cf0703f0c8a32cbb07474a2d126f3e) and [76f45d35e7](https://github.com/facebook/react-native/commit/76f45d35e710f84a1cc44c90bc128494bc4280ce) by [@kelset](https://github.com/kelset)) + +### Security + +- Update validateBaseUrl to use latest regex ([33ef82ce6d](https://github.com/facebook/react-native/commit/33ef82ce6dfd31e1f990d438c925a0e52723e16b) by [@FBNeal](https://github.com/FBNeal)) + +## v0.64.0 + +### Breaking + +- Enable `inlineRequires` by default in new projects' `metro.config.js`. Gives a performance benefit but slightly different JS execution order ([959365a902](https://github.com/facebook/react-native/commit/959365a90216ee14d0f8b5d2f4653a1ab4c10d7e) by [@GantMan](https://github.com/GantMan)) +- Minimum supported Node version changed to 12 ([4b92e2e53d](https://github.com/facebook/react-native/commit/4b92e2e53d9c79f5b5858b3eb0d1654da79a4a68) by [@safaiyeh](https://github.com/safaiyeh)) +- Remove deprecated `CameraRoll` API (deprecated in 0.61) ([824d3a9770](https://github.com/facebook/react-native/commit/824d3a977057b336d81237ec3cec3a49a9d5e34d) by [@seanyusa](https://github.com/seanyusa)) +- Remove deprecated `CheckBox` component (deprecated in 0.60) ([dff17effe5](https://github.com/facebook/react-native/commit/dff17effe54dc58dda19fcc81ebacbd8f46e9005) by [@poteto](https://github.com/poteto)) +- Removed `DEPRECATED_sendUpdatedChildFrames` prop from `ScrollView` component (deprecated in 0.47) ([345d0c1abb](https://github.com/facebook/react-native/commit/345d0c1abb1afe937a06982c4328caee57820832) by [@ZHUANGPP](https://github.com/ZHUANGPP)) +- On `Image`, `onLoad` event objects' `source.url` is now renamed to `source.uri`. ([74ab8f6e5a](https://github.com/facebook/react-native/commit/74ab8f6e5a61999f1132351ff52df43c91360a09) by [@yungsters](https://github.com/yungsters)) + +#### Android specific + +- Remove support of Android API levels 16 through 20. The new minSDK version will be 21+ moving forward. ([973198667d](https://github.com/facebook/react-native/commit/973198667d7bbbf3b5d8890fc0a53dc99d0bce18), [25a40cbc61](https://github.com/facebook/react-native/commit/25a40cbc61e6c718d8cdea6d67fd82c6309963b1), [f829722b54](https://github.com/facebook/react-native/commit/f829722b54b34f145c41a95edfa5b522c837f9fc), [b133427778](https://github.com/facebook/react-native/commit/b13342777856bc4024d8489de790e7f90cd6b33b), [9b34aa261c](https://github.com/facebook/react-native/commit/9b34aa261c272d96829c9a7d5b166594b3162f9d), and [79d0a7d711](https://github.com/facebook/react-native/commit/79d0a7d71119122d2a2b9954e6038bbee119b8fa) by [@mdvacca](https://github.com/mdvacca); [49f10fd2e5](https://github.com/facebook/react-native/commit/49f10fd2e526b64294777357ab2fef8880739f26) and [a17ff44adc](https://github.com/facebook/react-native/commit/a17ff44adcf003dd4e4ef2301e1f80b77913f712) by [@JoshuaGross](https://github.com/JoshuaGross); [dd4298a377](https://github.com/facebook/react-native/commit/dd4298a3770eee7f66846ef0cc4c41a628b7bf01) by [@safaiyeh](https://github.com/safaiyeh)) +- Fix ReadableArray null annotations. Possibly breaking change for Kotlin apps. ([d76556543f](https://github.com/facebook/react-native/commit/d76556543f96f4d739be3a708b8f6314bb32cc87) by [@dulmandakh](https://github.com/dulmandakh)) +- On `Image`, `onLoad` and `onError` event objects will no longer have an extra `uri` property. ([74ab8f6e5a](https://github.com/facebook/react-native/commit/74ab8f6e5a61999f1132351ff52df43c91360a09) by [@yungsters](https://github.com/yungsters)) +- Deletes the method PlayTouchSound method from UIManagerModule, this method was moved to the SoundManagerModule class. ([d0c4c5eaf9](https://github.com/facebook/react-native/commit/d0c4c5eaf90430c7004621d1596c5f2a55ad03e0) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific + +- Remove `calculateChildFrames` from `RCTScrollView` ([62aa84a325](https://github.com/facebook/react-native/commit/62aa84a3257bd3c513df3fcb4b4eaa350ecf77bb) by [@PeteTheHeat](https://github.com/PeteTheHeat)) + +### Deprecated + +#### Android specific + +- Deprecated method `UIManagerModule.getUIImplementation`. This method will not be part of the new architecture of React Native. ([fe79abb32c](https://github.com/facebook/react-native/commit/fe79abb32ca3425ff689b7641d9200461ea8166d) by [@mdvacca](https://github.com/mdvacca)) + +### Added + +- Adds the Hermes runtime bytecode version number to the JS bundle requestURL. This allows Metro with Bytecode to work with prebuilt binaries. ([34c405462f](https://github.com/facebook/react-native/commit/34c405462f890afbccdfeaa7804791f7e9bcaa83)) +- TextInput now supports `onPressIn` and `onPressOut`. ([b7b0e23202](https://github.com/facebook/react-native/commit/b7b0e232028723794af4c79fc6366c483ae2350b) by [@yungsters](https://github.com/yungsters)) +- Allow setting a custom performance logger in XMLHttpRequest ([57b10f759e](https://github.com/facebook/react-native/commit/57b10f759efed786b46cfe082367f929aa2925d3) by [@rubennorte](https://github.com/rubennorte)) +- Add mock for `DevSettings` to jest preset ([a50f736bb6](https://github.com/facebook/react-native/commit/a50f736bb6ade9ea9caae45e41ca4b92f6707b17) by [@MarcoScabbiolo](https://github.com/MarcoScabbiolo)) +- Added Inspector overlay support for Pressable ([8ac467c51b](https://github.com/facebook/react-native/commit/8ac467c51b94c82d81930b4802b2978c85539925) by [@yungsters](https://github.com/yungsters)) +- Introduce NativeModulePerfLogger ([0486640571](https://github.com/facebook/react-native/commit/0486640571c89a0ce067c0437655a6b375308bcd) by [@RSNara](https://github.com/RSNara)) +- Add default `titlePlaceholder` in template configuration. ([8ffa180d80](https://github.com/facebook/react-native/commit/8ffa180d80b9c9acb76a0631b5a709d2c0adcd86) by [@Esemesek](https://github.com/Esemesek)) +- Modified `renderApplication` to forward `initialProps` to `WrapperComponent` ([4f5a092bf6](https://github.com/facebook/react-native/commit/4f5a092bf68a0cd825328ce4a1e6bb41a8fad2e3) by [@rubennorte](https://github.com/rubennorte)) +- Add warning to `VirtualizedList` when incorrectly using nested Lists or custom scroll components ([7f2515ece8](https://github.com/facebook/react-native/commit/7f2515ece8833f7a8adba025ef544013f89ae26f) by [@kacieb](https://github.com/kacieb)) +- Add native module for loading split JS bundles in development ([fca3a39da5](https://github.com/facebook/react-native/commit/fca3a39da5f1c31514e8969738e7b2c2d22bc230) by [@makovkastar](https://github.com/makovkastar)) +- Added `listenerCount()` to `DeviceEventEmitter` and `NativeEventEmitter`. ([b11d6ecbb8](https://github.com/facebook/react-native/commit/b11d6ecbb8bb2f0d6f423be6775e587f4e9b1c4d) by [@yungsters](https://github.com/yungsters)) + +#### Android specific + +- Upgrade Hermes to version 0.7 and turn on ES6 Proxy support ([776a415d98](https://github.com/facebook/react-native/commit/776a415d98dffd04b11200812a32204aa1c5e157) and [bb003816a3](https://github.com/facebook/react-native/commit/bb003816a389b8655c53fa34444417c14516459c) by [@Huxpro](https://github.com/Huxpro), [a28dd38909](https://github.com/facebook/react-native/commit/a28dd3890974d699070f08ab43781324411e6f5c) by [@janicduplessis](https://github.com/janicduplessis)) +- Add support for `shadowColor` on API level >= 28 ([cfa4260598](https://github.com/facebook/react-native/commit/cfa42605989eee5a9de42bdb1259fb7f4d9451fb) by [@IjzerenHein](https://github.com/IjzerenHein)) +- Add `android_hyphenationFrequency` prop to Text component ([0fda91ffff](https://github.com/facebook/react-native/commit/0fda91ffffa4972ebe58e3d0b610692a1286eaa1) and [7d8aeb4955](https://github.com/facebook/react-native/commit/7d8aeb4955a4101ca7e8e486f935309c21ab76ff) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Add `accessibilityHint` to TouchableNativeFeedback ([72285d808d](https://github.com/facebook/react-native/commit/72285d808dfce748287a19e2620d58517a5f76e7) by [@CMDadabo](https://github.com/CMDadabo)) +- Adds support for the `onProgress` event on `Image` ([fa0e6f8051](https://github.com/facebook/react-native/commit/fa0e6f8051d2208af467b789a2a9306ec7ddad76) by [@yungsters](https://github.com/yungsters)) +- ScrollView now supports `contentOffset` ([ed29ba13f9](https://github.com/facebook/react-native/commit/ed29ba13f97f240c91fdf6c0ef3fb601046697b9) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Add an explicit NDK version to Android template ([18ffe12203](https://github.com/facebook/react-native/commit/18ffe12203d03b4e960d61d7bb50cd02bba94663) by [@safaiyeh](https://github.com/safaiyeh)) +- Exposed `getFlex` method as part of ReactShadowNode API ([6570f7887b](https://github.com/facebook/react-native/commit/6570f7887b8824705ae09b5653d631428e17bc5f) by [@mdvacca](https://github.com/mdvacca)) +- Add `\*.hprof` files to gitignore ([69ce9c21d4](https://github.com/facebook/react-native/commit/69ce9c21d433a23ffb9934062b46fa64277ee255) by [@enesozturk](https://github.com/enesozturk)) +- Move `DevSettingsActivity` from main to debug ([d8e6c45782](https://github.com/facebook/react-native/commit/d8e6c45782a5c9132bb7ec315fe0b9ba3999e830) by [@invalid-email-address](https://github.com/invalid-email-address)) + +#### iOS specific + +- `PlatformColor`: add missing `clearColor` ([b7167c23fc](https://github.com/facebook/react-native/commit/b7167c23fc052f8d9f8c27a7f4ad9c5cdf51281e) by [@Simek](https://github.com/Simek)) +- Update template to Xcode 12 ([6685aba462](https://github.com/facebook/react-native/commit/6685aba462699c696cb6ac95626b9592deb292fc) by [@janicduplessis](https://github.com/janicduplessis)) +- Add `importantForAccessibility` to `AccessibilityProps` ([fd660fd0c5](https://github.com/facebook/react-native/commit/fd660fd0c50a0acca730bd1ecd427e574bbe81c7) by [@ZHUANGPP](https://github.com/ZHUANGPP)) +- Allow hotkeys to be used without command key ([f2b9ec7981](https://github.com/facebook/react-native/commit/f2b9ec798172db76dfb55f390e1fcea90dd341da) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Add `disableButtonsIndices` option to `ActionSheetIOS` component ([a7c1c5aff2](https://github.com/facebook/react-native/commit/a7c1c5aff24671bba609caeb82092a8de3d3b232) by [@lukewalczak](https://github.com/lukewalczak)) +- Add `showSoftInputOnFocus` to `TextInput` ([d54113d8c4](https://github.com/facebook/react-native/commit/d54113d8c4bcd0e0c7a09acca60819724eb69926) by [@gurs1kh](https://github.com/gurs1kh)) +- Added hostname to loading banner. ([96999339b6](https://github.com/facebook/react-native/commit/96999339b6a7aeabd0cd706ef7736fd91d9ecf80) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Allow iOS `PlatformColor` strings to be ObjC or Swift UIColor selectors ([25793eab56](https://github.com/facebook/react-native/commit/25793eab56217a9961620761ea65ec2fcb97dcb0) by [@tom-un](https://github.com/tom-un)) +- Add Dark Mode support to loading banner ([94c45af136](https://github.com/facebook/react-native/commit/94c45af136f44245b5f2e56bded60c8ebd9b1235) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Allow image loaders to enable/disable image telemetry ([e37708dfb6](https://github.com/facebook/react-native/commit/e37708dfb605dd9ee9f4b2dac5d841d98b7d376c) by [@p-sun](https://github.com/p-sun)) +- Add `RCTDevSplitBundleLoader` native module ([ad879e50bc](https://github.com/facebook/react-native/commit/ad879e50bcd51caca76b1073720f2b63df485ff1) by [@cpojer](https://github.com/cpojer)) + +### Changed + +- Update flipper to 0.75.1 ([3399896ae7](https://github.com/facebook/react-native/commit/3399896ae756719b238e837001077a46508849be) by [@janicduplessis](https://github.com/janicduplessis)) +- Refined Flow type for `Text` component. ([a911efaecd](https://github.com/facebook/react-native/commit/a911efaecd005237816ddb480218eb5388460d16) by [@yungsters](https://github.com/yungsters)) +- Changed type definition of IPerformanceLogger from object to interface ([b90f4d978f](https://github.com/facebook/react-native/commit/b90f4d978fa27e37926d9f4a1d13c9168243798c) by [@rubennorte](https://github.com/rubennorte)) +- Removed `fbjs` dependency from `react-native`. ([54e19a6b7f](https://github.com/facebook/react-native/commit/54e19a6b7f217ffc0611e660f2a6b1a8ad14775b) by [@yungsters](https://github.com/yungsters)) +- Refined `ImageSource` Flow type for array-variant and headers. ([a0dc252dc8](https://github.com/facebook/react-native/commit/a0dc252dc89699f7bd0d733642b98762d0db423a) by [@yungsters](https://github.com/yungsters)) +- Some warnings changed to use `console.warn` without the "Warning:" prefix. ([982272932c](https://github.com/facebook/react-native/commit/982272932cee3be599076bd18b290bc812285533) by [@yungsters](https://github.com/yungsters)) +- Core/Differ: detect and optimize reparenting ([1e4d8d902d](https://github.com/facebook/react-native/commit/1e4d8d902daca8e524ba67fc3c1f4b77698c4d08) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Improve "not a registered callable module" error message ([e27d656ef3](https://github.com/facebook/react-native/commit/e27d656ef370958c864b052123ec05579ac9fc01) by [@vonovak](https://github.com/vonovak)) +- Use `VirtualizedList`'s `onEndReachedThreshold` default value when null is provided ([10b4b9505a](https://github.com/facebook/react-native/commit/10b4b9505a51f8bf3fbc12d296a087b784a9201a) by [@fatalsun](https://github.com/fatalsun)) +- Migrate large amount of modules to flow strict and strict-local ([4409642811](https://github.com/facebook/react-native/commit/4409642811c787052e0baeb92e2679a96002c1e3) by [@rubennorte](https://github.com/rubennorte)) +- Enable exact objects by default in the project template Flow config ([050a7dd019](https://github.com/facebook/react-native/commit/050a7dd019be435b848de0a86030599d83f8791d) by [@rubennorte](https://github.com/rubennorte)) +- Minor fix in Hermes Inspector cli tool help message ([6ffb983f83](https://github.com/facebook/react-native/commit/6ffb983f83afdee5d9290c683c5060d2a959818d)) +- Updated the React Hooks ESLint Plugin in the community ESLint config ([ac87e90fa5](https://github.com/facebook/react-native/commit/ac87e90fa517676440c1adf9575cb48f90de8069) by [@gaearon](https://github.com/gaearon)) +- Don't scroll to `initialScrollIndex` if `contentOffset` is provided to the same `VirtualizedList` ([3346ac7f96](https://github.com/facebook/react-native/commit/3346ac7f96d2fd3f77dca5acb283b28e02ad21fa) by [@markv](https://github.com/markv)) +- Migrated `VirtualizedList` legacy context implementation to `React.Context`. ([7bd694fc6f](https://github.com/facebook/react-native/commit/7bd694fc6f4bb027b6d7ee04034cad41a43e5695) by [@yungsters](https://github.com/yungsters)) +- Changed Flow type of `BackHandler` to be more specific. ([a903d1b86a](https://github.com/facebook/react-native/commit/a903d1b86ab56163abcdcb584f335949ba0c85fc) by [@Naturalclar](https://github.com/Naturalclar)) +- Updated transitive dependency `kind-of` to 6.0.3 to resolve vulnerability ([abde0154ba](https://github.com/facebook/react-native/commit/abde0154ba4247d2c9f1451b5de8b3cba1abd316) by [@TheSavior](https://github.com/TheSavior)) +- Upgrade eslint-config dependencies. ([93019dc190](https://github.com/facebook/react-native/commit/93019dc19072776053a88f9ab595e435b83fead0) by [@wcandillon](https://github.com/wcandillon)) +- Upgrade to Jest 25 ([f248ba1c8b](https://github.com/facebook/react-native/commit/f248ba1c8b15a12a0c590ce8211855cde31defe8) by [@cpojer](https://github.com/cpojer)) +- Use `React.Children.count` for counting children of `TextInput` ([92160f3144](https://github.com/facebook/react-native/commit/92160f3144dcfa510ff14b5f2eb231643f107af9) by [@vonovak](https://github.com/vonovak)) +- Annotate components in QPL logging using ImageAnalyticsTagContext ([60b7a3085c](https://github.com/facebook/react-native/commit/60b7a3085c0d83c126023b98e666ecda6f769454) by [@p-sun](https://github.com/p-sun)) +- Upgrade to React 17 ([24bca492c3](https://github.com/facebook/react-native/commit/24bca492c349ab90d40f9444df0f477145a4c311) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Made promise polyfill conditionalized on Hermes ([0a28b34dac](https://github.com/facebook/react-native/commit/0a28b34dacb91a7e74cd5feec59cf8f8fb0487c9) by [@Huxpro](https://github.com/Huxpro)) +- Flow: Remove type union in PickeriOS/PickerNativeComponent ([3113e47b9b](https://github.com/facebook/react-native/commit/3113e47b9bc92e3b0efb96db776f650848093dfc) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Flow: export ColorValue from StyleSheet instead of StyleSheetTypes ([0a67133124](https://github.com/facebook/react-native/commit/0a6713312467d3f5b5dc993e91db9e7b1aa4fc8c)) +- Forward URL parameters from main bundle to hot reloaded bundles ([b4785e5144](https://github.com/facebook/react-native/commit/b4785e514430dc3ba45ed6d136ec63574be88e26) by [@motiz88](https://github.com/motiz88)) +- Add package name / bundle ID to bundle URL in development ([9b5359133b](https://github.com/facebook/react-native/commit/9b5359133b46b16be200e37dba0b03d82b73b4a0) by [@motiz88](https://github.com/motiz88)) + +#### Android specific + +- Bump Gradle Wrapper to 6.7 ([8988a073b4](https://github.com/facebook/react-native/commit/8988a073b48df0f0cd4a7126edf1a421f4537d58), [5bc67b658e](https://github.com/facebook/react-native/commit/5bc67b658e581e0176deb7ed95b51a5c1cbe65c2), and [3a8559b86c](https://github.com/facebook/react-native/commit/3a8559b86c3c0b0ab6d6c6904c6efd97ab2c7b38) by [@friederbluemle](https://github.com/friederbluemle); [e559aee642](https://github.com/facebook/react-native/commit/e559aee64275126eaa135486e6bf09138be70f4d) and [e9fd93f53f](https://github.com/facebook/react-native/commit/e9fd93f53f8b14f921578cd401b3a6529e4e0c9f) by [@dulmandakh](https://github.com/dulmandakh)) +- Bump Android Gradle Plugin to 4.1.0 ([cf8368f204](https://github.com/facebook/react-native/commit/cf8368f2046ae1ff0f6b02bb6857eeeff8f57d7d) and [553fb8b28d](https://github.com/facebook/react-native/commit/553fb8b28d0ad332d75a944d244832be3390b6ba) by [@friederbluemle](https://github.com/friederbluemle), [dfa9db49e3](https://github.com/facebook/react-native/commit/dfa9db49e34c6f54c04148b877de938bf103a059) by [@dulmandakh](https://github.com/dulmandakh)) +- Bump Okio to 1.17.5 ([1e78e0655d](https://github.com/facebook/react-native/commit/1e78e0655d53ac947f523bcadf9c5339ab07bbb8) by [@dulmandakh](https://github.com/dulmandakh)) +- Make Android versionCodeOverride for new apps using the template human-readable ([e1bf515ae8](https://github.com/facebook/react-native/commit/e1bf515ae8e77fb24f76037d9f22e903799fb637) by [@gedeagas](https://github.com/gedeagas)) +- Bump SoLoader to 0.9.0 ([7465239230](https://github.com/facebook/react-native/commit/7465239230881f453d64364d51272f28614c8653) by [@dulmandakh](https://github.com/dulmandakh)) +- Update Okhttp to version 3.12.12 ([0f6fcb2c27](https://github.com/facebook/react-native/commit/0f6fcb2c2788dc7150f6c3673a8f4f9d8f929441) by [@halaei](https://github.com/halaei)) +- Update Android build tools to 29.0.3 ([e629e94b46](https://github.com/facebook/react-native/commit/e629e94b466ebbd5924b1d4493c026004dad707d) by [@friederbluemle](https://github.com/friederbluemle)) +- ViewCommands on Android now execute earlier, as a perf optimization. ([c6b9cc36da](https://github.com/facebook/react-native/commit/c6b9cc36da4f7d190d05122048aa4ada9c152b73) by [@JoshuaGross](https://github.com/JoshuaGross)) +- Effect of `blurRadius` now more closely matches other platforms. ([64860972be](https://github.com/facebook/react-native/commit/64860972be828fb601acbef11b4c2dbc672dee8a) by [@yungsters](https://github.com/yungsters)) +- Migrate Android tests to Robolectric v4 ([6a78b32878](https://github.com/facebook/react-native/commit/6a78b32878aea1b0dac98ff36378fb9392d4aeb1) by [@jselbo](https://github.com/jselbo), [d373a8d88c](https://github.com/facebook/react-native/commit/d373a8d88c30af910133d97ae973d256c4479929) and [18f7abae07](https://github.com/facebook/react-native/commit/18f7abae07b8ea60c7530a5d9f34541c50f5edd9) by [@fkgozali](https://github.com/fkgozali)) +- Get ripple drawables by id instead of by name ([c8ed2dbbb2](https://github.com/facebook/react-native/commit/c8ed2dbbb287deed05a8782fb8665c1edf45bbac) by [@vonovak](https://github.com/vonovak)) +- `TextInput`: Set `caretHidden` default value to `true` on Xiaomi devices to fix the crash ([b5b4a70410](https://github.com/facebook/react-native/commit/b5b4a7041027fd767850a564b5d80fa4a98ba2a2)) +- Update loading banner text and colors ([6afc984e81](https://github.com/facebook/react-native/commit/6afc984e8187ac91f780f125dad4421576131c83) by [@makovkastar](https://github.com/makovkastar)) +- Declare all attrs used in res targets ([05abbd245c](https://github.com/facebook/react-native/commit/05abbd245c2326b12d24698bb13007a7ce11e586) by [@IanChilds](https://github.com/IanChilds)) + +#### iOS specific + +- Upgraded JSI with a new HERMES_ENABLE_BITCODE flag ([311d4e9ef0](https://github.com/facebook/react-native/commit/311d4e9ef080aa429f840236cc23c013c0ae644c) by [@grabbou](https://github.com/grabbou)) +- Remove main queue execution of constantsToExport in NativeModules ([d7ac21cec5](https://github.com/facebook/react-native/commit/d7ac21cec5492e180fbf3817af7be64ab121cb75) by [@RSNara](https://github.com/RSNara)) +- Updated loading banner messages and color ([3729fe8de0](https://github.com/facebook/react-native/commit/3729fe8de0109c80014f6c20fae8b949b3628de2) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Speed up loading banner animations ([3fb37b4326](https://github.com/facebook/react-native/commit/3fb37b4326090def3aea43bd8189a0df648ccb34) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Shrink loading bar down to not cover safe area. ([f0dfd35108](https://github.com/facebook/react-native/commit/f0dfd35108dd3f092d46b65e77560c35477bf6ba) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Build macOS framework and add CocoaPods podspec ([ffa3d7f638](https://github.com/facebook/react-native/commit/ffa3d7f638c820dc208320193e6ba65667d751eb) by [@alloy](https://github.com/alloy)) +- Set `NSAllowsArbitraryLoads` to `false` by default in template ([7b61a968fd](https://github.com/facebook/react-native/commit/7b61a968fd774a6ca2196a731b6cec4282ab25cc) by [@wddwycc](https://github.com/wddwycc)) + +### Removed + +- `Text.viewConfig` is no longer exported. ([06ce643565](https://github.com/facebook/react-native/commit/06ce64356594a921cd9ae4f71c15dd56dd0e53a3) by [@yungsters](https://github.com/yungsters)) +- Removed `once()` and `removeCurrentListener()` from `DeviceEventEmitter` and `NativeEventEmitter`. ([87a2e29f59](https://github.com/facebook/react-native/commit/87a2e29f5928c2e09ac9a98c54732d5f697d8e61) by [@yungsters](https://github.com/yungsters)) +- Removed tvOS related files from the template ([df03228a61](https://github.com/facebook/react-native/commit/df03228a61881cdfa520fa6d8a9d9cfb6e77fdde) by [@Naturalclar](https://github.com/Naturalclar)) + +#### Android specific + +- Remove undocumented ColorAndroid function ([411c344794](https://github.com/facebook/react-native/commit/411c3447946c18743476e7d613358233464d6f58) by [@tom-un](https://github.com/tom-un)) + +### Fixed + +- Fix handling of very deeply nested data across the bridge ([a8c90e6af4](https://github.com/facebook/react-native/commit/a8c90e6af4a4e5ac115016a3e8977ecff90e99a0) by [@mhorowitz](https://github.com/mhorowitz)) +- Prevent TypeError in TaskQueue when cancelling a started but not resolved promise. ([14042fb76f](https://github.com/facebook/react-native/commit/14042fb76fee3573529d590ec6f8ad216aa0b820) by [@robwalkerco](https://github.com/robwalkerco)) +- Fix typo in `ActionSheetManager` invariant message ([9c353b5ab0](https://github.com/facebook/react-native/commit/9c353b5ab060be9392a7aaf437bba4ffc56d78ca) by [@sweatherall](https://github.com/sweatherall)) +- `TouchableHighlight` now correctly fires `onPress` when pressed for >500ms, when `onLongPress` is not supplied. ([bdf3c79110](https://github.com/facebook/react-native/commit/bdf3c7911007f547101d753903da11ea4ee095f9) by [@yungsters](https://github.com/yungsters)) +- `Pressability` now consistently fires `onPressIn` and `onPressOut`, even without an `onPress`. ([0c392bc405](https://github.com/facebook/react-native/commit/0c392bc4052784de7497bf7b5eaf207b02409877) by [@yungsters](https://github.com/yungsters)) +- Remove extraneous argument for `onResponderGrant` Flow type on `Text`. ([49015b0f5b](https://github.com/facebook/react-native/commit/49015b0f5bda83794b88b17dd3cbd834fa235b72) by [@yungsters](https://github.com/yungsters)) +- Prevent `ScrollView` From Stealing Responder Capture When Using Physical Keyboard ([93e7a7a70d](https://github.com/facebook/react-native/commit/93e7a7a70dc2f41fccd3c1e4cce80d92913c4243) by [@NickGerleman](https://github.com/NickGerleman)) +- Fix failure when debugging code in a browser; was caused by `performanceNow()` function. ([db474a47b7](https://github.com/facebook/react-native/commit/db474a47b70e4fa50f594f4dea8a2f531ca9fc07) by [@zerkella](https://github.com/zerkella)) +- Fix test renderer mocks to use the `displayName` more often. ([4b935ae95f](https://github.com/facebook/react-native/commit/4b935ae95f09e4a1eb1e5ac8089eb258222a0f8b) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Make sure `LogBox` is not included in production bundles ([d3b937f990](https://github.com/facebook/react-native/commit/d3b937f990012a31b8d917e220f4ed2f0a4fd2d3) by [@janicduplessis](https://github.com/janicduplessis)) +- Mark `force` as an optional property of the PressEvent object ([ad2f98df8f](https://github.com/facebook/react-native/commit/ad2f98df8f2ad8aff1dcdc11b187f35b372e3f0e) by [@Simek](https://github.com/Simek)) +- Fix invalid `event` objects from `onPressOut` in certain cases ([2c600b7c5a](https://github.com/facebook/react-native/commit/2c600b7c5a0e79bfc632b39b471e6ba774d7b0b3) by [@yungsters](https://github.com/yungsters)) +- When Hermes debugger is enabled continue to send log messages to the console ([77ef8f881f](https://github.com/facebook/react-native/commit/77ef8f881f2e4067894b412f308e2a80042c946f) by [@MartinSherburn](https://github.com/MartinSherburn)) +- Handle nullish `initialProps` correctly in `renderApplication` ([26c120c632](https://github.com/facebook/react-native/commit/26c120c6329d45e27318d82aaf5a50338bd6fa7d) by [@rubennorte](https://github.com/rubennorte)) +- Fix Flow type of Touchable{Opacity,Bounce,Highlight} being exported as `any` ([de7f69a58e](https://github.com/facebook/react-native/commit/de7f69a58ed4e18887f4b9d4d853293fb136afb7) by [@draperunner](https://github.com/draperunner)) +- Clarified the boundaries in error message of `scrollToIndex` ([78d2b3c813](https://github.com/facebook/react-native/commit/78d2b3c8138f54c2433958b0ad6b9f52ca59115a) by [@sasurau4](https://github.com/sasurau4)) +- Fix jsi cmake include dirs ([f5d00e5a29](https://github.com/facebook/react-native/commit/f5d00e5a2922d35a0b44935592da5700518c422b) by [@ryantrem](https://github.com/ryantrem)) +- Fix race condition in `KeyboardAvoidingView` ([b08fff6f86](https://github.com/facebook/react-native/commit/b08fff6f869e00c20c0dcdf7aca71284c2f276f0) by [@sammy-SC](https://github.com/sammy-SC)) +- Fix clone issue in YogaNodeJNIBase ([2707c17b07](https://github.com/facebook/react-native/commit/2707c17b0727f241d404f4a21090021c27c66f2c) by [@pasqualeanatriello](https://github.com/pasqualeanatriello)) +- Fix "Cannot read property 'getNativeScrollRef' of undefined" in createAnimatedComponent ([629e10e91b](https://github.com/facebook/react-native/commit/629e10e91b728c4251f1ed78a50df62820ce0dc4) by [@sammy-SC](https://github.com/sammy-SC)) + +#### Android specific + +- Fix App Bundle/Release build missing index.android.bundle with gradle plugin 4.1.0/gradle 6.5 ([53f55001af](https://github.com/facebook/react-native/commit/53f55001afbf07494de0df064a92dfdd42f37c98) by [@tomoima525](https://github.com/tomoima525)) +- Do not crash when `ScrollView` `snapToOffsets` array is empty ([d238da71aa](https://github.com/facebook/react-native/commit/d238da71aa8cdd7ce519de617a9a200406da794c) by [@makovkastar](https://github.com/makovkastar)) +- Fixed `TextInput` not being selectable in `removeClippedSubviews` FlatLists ([12a50c0a44](https://github.com/facebook/react-native/commit/12a50c0a442b78d9095398d955bec307cfcb0f69) by [@hsource](https://github.com/hsource)) +- Make nested `Text` components accessible as links ([b352e2da81](https://github.com/facebook/react-native/commit/b352e2da8137452f66717cf1cecb2e72abd727d7) by [@ejanzer](https://github.com/ejanzer)) +- Move selection to the end of the text input on accessibility click ([f0e80ae229](https://github.com/facebook/react-native/commit/f0e80ae2292ebf7ce32666900007845724844fb5) by [@ejanzer](https://github.com/ejanzer)) +- Fix secure text entry setting to always hide text ([f19372361f](https://github.com/facebook/react-native/commit/f19372361f22201a453ff38eb69c5fa052b57474) by [@smeenai](https://github.com/smeenai)) +- Make promise NativeModule methods dispatch to NativeModules thread ([9c35b5b8c4](https://github.com/facebook/react-native/commit/9c35b5b8c4710dfe6a4b689a5565aa78ae5b37d3) by [@RSNara](https://github.com/RSNara)) +- Fix `NoSuchMethodException` when calling `DisplayMetricsHolder.initDisplayMetrics` in Android API level <= 16 (though those Android versions are no longer supported) ([35128f45d1](https://github.com/facebook/react-native/commit/35128f45d1ba97010e437423d14fa5ea0faf5fa3) by [@mdvacca](https://github.com/mdvacca)) +- Fixed error message in `DebugCorePackage.getModule` ([a71f37b951](https://github.com/facebook/react-native/commit/a71f37b951ca49c180b037ea8955851654b09afa) by [@TheWirv](https://github.com/TheWirv)) +- ScrollView, HorizontalScrollView: do not ignore `null` `contentOffset` prop ([9e85b7ad88](https://github.com/facebook/react-native/commit/9e85b7ad889900cd57cd2f82286aa8e034b0a32b) by [@vonovak](https://github.com/vonovak)) +- Picker - fix usage of setNativeSelectedPosition in onSelect ([078e386024](https://github.com/facebook/react-native/commit/078e386024474edc9b464f6c0fd8a1429e922289)) +- Fix intermittent crash of ReactSlider on Android ([32888a8b4a](https://github.com/facebook/react-native/commit/32888a8b4a9d75b9d3f6cc4578ce6a6ccd932407) by [@mdvacca](https://github.com/mdvacca)) +- Use actual constructor when throwing GradleScriptException ([8ef0f1d90b](https://github.com/facebook/react-native/commit/8ef0f1d90bbb2fa98e48ce89281718e5ac79365a)) +- Fix `skewX` transform decomposition ([797367c089](https://github.com/facebook/react-native/commit/797367c0890a38ec51cfaf7bd90b9cc7db0e97c7) by [@wcandillon](https://github.com/wcandillon)) +- Allow passing partial contentOffset to ScrollView on Android ([0348953914](https://github.com/facebook/react-native/commit/03489539146556ec5ba6ba07ac338ce200f5b0f4) by [@janicduplessis](https://github.com/janicduplessis)) +- Check if NativeModules returned from CatalystInstanceImpl.getNativeModule are null before using them. ([9263eb5d38](https://github.com/facebook/react-native/commit/9263eb5d3864a42925b699343db2c09cc8934ed0) by [@RSNara](https://github.com/RSNara)) +- Fix calculating view position within the window in split-screen mode ([b020e7c440](https://github.com/facebook/react-native/commit/b020e7c440f58dabd4cc64b72869f3ae9680ef30) by [@jakubkinst](https://github.com/jakubkinst)) +- Text layout no longer ignores parent bounds ([025be8148a](https://github.com/facebook/react-native/commit/025be8148a9abc533a8ae108e49cfd3f4512c581) by [@yungsters](https://github.com/yungsters)) +- Fixed excessive space in Text view with word-wrapping ([dda7f82261](https://github.com/facebook/react-native/commit/dda7f82261cc5684564e2c67071c13e379985308) by [@yungsters](https://github.com/yungsters)) +- `Pressable`: ripple should be applied even when borderless == false ([44ec762e41](https://github.com/facebook/react-native/commit/44ec762e41029bf43530b1ff9b36ca3512c526e2) by [@vonovak](https://github.com/vonovak)) +- Fix `ReadableNativeMap.getNullableValue` to match signature and return null instead of throwing ([1015194ba1](https://github.com/facebook/react-native/commit/1015194ba1a81eab99000d589914100e4b9ea037) by [@dulmandakh](https://github.com/dulmandakh)) +- `Picker`: set color filter so that the arrow matches the text color ([bb8d0f5732](https://github.com/facebook/react-native/commit/bb8d0f57328a20c942991f2d19d86639a7791924) by [@ejanzer](https://github.com/ejanzer)) +- `Modal`: fix crash when updating props after the activity disappeared ([7abcaafd66](https://github.com/facebook/react-native/commit/7abcaafd6600535825aa8330af7290ba8acea245) by [@mdvacca](https://github.com/mdvacca)) +- Fix crash while measuring ReactSlider in Android API < 21 ([75e6f7961f](https://github.com/facebook/react-native/commit/75e6f7961fb3f6de6afbe79d49c42ad55fba1673) by [@mdvacca](https://github.com/mdvacca)) +- Fix measureLayout function for VirtualTexts ([5c48c94f8c](https://github.com/facebook/react-native/commit/5c48c94f8c0441bc78a007f0ea0c5b2763ff6875) by [@mdvacca](https://github.com/mdvacca)) +- Smoother scrolling in ScrollView, HorizontalScrollView ([10314fe621](https://github.com/facebook/react-native/commit/10314fe621e1649654e83df197adf657e0ca8363) by [@JoshuaGross](https://github.com/JoshuaGross)) + +#### iOS specific + +- Synchronize RCTImageLoader loaders initialization ([edb6fa7979](https://github.com/facebook/react-native/commit/edb6fa79791beb804e450ca4a562a248abf730e5) by [@p-sun](https://github.com/p-sun)) +- Make sure js bundle still exists at bundle-output path ([3a41f69f9c](https://github.com/facebook/react-native/commit/3a41f69f9ce1ab778112c0727a69a753fe36c77a) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix crash in WebSocket module ([748aa13747](https://github.com/facebook/react-native/commit/748aa137472d6080427f74bb686c795b925c7d43) by [@marksinkovics](https://github.com/marksinkovics)) +- Align multi-line `TextInput` `onSubmitEditing` behavior: don't call onSubmitEditing when blurOnSubmit=false ([521b16730d](https://github.com/facebook/react-native/commit/521b16730dd07d80261086c2f33eed2a766d404e) by [@tido64](https://github.com/tido64)) +- Fix passing react native path in Podfile template ([e599d6c5d3](https://github.com/facebook/react-native/commit/e599d6c5d338c1b4d1a0d988e0d9ff83c179fb54) by [@janicduplessis](https://github.com/janicduplessis)) +- Call [RCTEventEmitter stopObserving] on correct method queue ([23717e48af](https://github.com/facebook/react-native/commit/23717e48aff3d7fdaea30c9b8dcdd6cfbb7802d5) by [@appden](https://github.com/appden)) +- Persist Enable Fast Refresh across app launches ([845e9eaafb](https://github.com/facebook/react-native/commit/845e9eaafb08b4ca87a9987e840798e0ba011676) by [@stigi](https://github.com/stigi)) +- Fix xcodebuild warnings in React-Core ([cb719a16cc](https://github.com/facebook/react-native/commit/cb719a16cc496b0cdb09d8d971b5e95cc8863b77)) +- Fix that RCTModalHostView can't be dismissed while being presented ([8933724d7d](https://github.com/facebook/react-native/commit/8933724d7d0f9ec012b2708d8e737f02f03e4a6f) by [@Mi-ZAZ](https://github.com/Mi-ZAZ)) +- Fix "'RCTBlobPlugins.h' file not found" when building iOS ([aaeffdb49a](https://github.com/facebook/react-native/commit/aaeffdb49a8412a98bb52477933fd208d1dcc096) by [@tido64](https://github.com/tido64)) +- Improved text rendering on macOS Catalyst ([694e22de84](https://github.com/facebook/react-native/commit/694e22de847e5f789b7d5ffe472b63aabbd7a5b0) by [@andymatuschak](https://github.com/andymatuschak)) +- Fixed showing Alert while closing a Modal ([f319ff321c](https://github.com/facebook/react-native/commit/f319ff321c4b7c0929b99e3ebe7e1ce1fa50b34c) by [@devon94](https://github.com/devon94)) +- Fix `refreshControl` messes up navigationBar largeTitles ([1b0fb9bead](https://github.com/facebook/react-native/commit/1b0fb9bead4d158d14df5a994423d06716b5e377) by [@yogevbd](https://github.com/yogevbd)) +- When Sec-WebSocket-Protocol header is empty vaulue, IIS server will return error 502. ([fd85b84a86](https://github.com/facebook/react-native/commit/fd85b84a863cea9f33e5b39230b27af53c1307e7) by [@bill2004158](https://github.com/bill2004158)) +- Fix multiline `TextInput` crash when inserting/removing lots of text ([15dda0ab5a](https://github.com/facebook/react-native/commit/15dda0ab5a491dcc83539f9ef32c9896be41074a) by [@tido64](https://github.com/tido64)) +- Group accessible views using the view hierarchy ([e2fd9d4f22](https://github.com/facebook/react-native/commit/e2fd9d4f22cda85c995c38875fc3a2a20a198c4a) by [@p-sun](https://github.com/p-sun)) +- Fix Flow types for StatusBar showHideTransition ([e5a8f4270e](https://github.com/facebook/react-native/commit/e5a8f4270ea71749a5ce6bd7ae198f695edb4307) by [@Simek](https://github.com/Simek)) +- Better error message when missing entry file ([e73208e2ca](https://github.com/facebook/react-native/commit/e73208e2ca59a2cf6a8a9c5e4e5b33afb5131f09) by [@petrbela](https://github.com/petrbela)) +- Fix imports in `RCTUtilsUIOverride.h` ([b7e8f66795](https://github.com/facebook/react-native/commit/b7e8f667953c2bc65c25b00968051c063a684d01) by [@Fanghao](https://github.com/Fanghao)) +- Fix skewX/skewY/perspective/matrix transforms. ([4b956fe5a6](https://github.com/facebook/react-native/commit/4b956fe5a6b3a05b1c2883efc82a95c2524aeb56) by [@wcandillon](https://github.com/wcandillon)) +- Fix module lookup race condition on bridge invalidation. ([8ad810717e](https://github.com/facebook/react-native/commit/8ad810717ee1769aa5ff6c73e0c9bfa8c43a3bac) by [@fkgozali](https://github.com/fkgozali)) +- Fix duration calculation for `RCTUIImageViewAnimated` ([12f8b2598f](https://github.com/facebook/react-native/commit/12f8b2598fa46533ea59834a0225cc9e36b20111)) +- Cap loading banner percentage at 100% ([e27542bb13](https://github.com/facebook/react-native/commit/e27542bb13d1f8f422cd307c4d43148c8bd82bc0) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Delay loading banner message to prevent flashing messages ([2b771b0129](https://github.com/facebook/react-native/commit/2b771b0129f2ef921c7cdb9c952e004f931927c3) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Do not update loading banner message while hiding the banner ([131c497aa2](https://github.com/facebook/react-native/commit/131c497aa2c081f9dfd03e45b25fb7ae388b98bd) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Search en0 through en8 for the Metro Bundler's IP address when generating iOS debug builds ([b2b23a2017](https://github.com/facebook/react-native/commit/b2b23a20170d12f6d8bf2733b93d7f9ab9c6cb15)) +- Migrate `frameInterval` to `preferredFramesPerSecond`, fixing Xcode warnings ([335f3aabe2](https://github.com/facebook/react-native/commit/335f3aabe28ec8f9b96fd695edabf0d5ab0b402a) by [@safaiyeh](https://github.com/safaiyeh)) +- Animated image should animate at the same speed regardless of framerate ([b0d0e51a77](https://github.com/facebook/react-native/commit/b0d0e51a7724dcefe3ce1c2dfb334a731b2a385c) by [@p-sun](https://github.com/p-sun)) +- Fix logging lifecycle when image is scrolled out and immediately back in ([1f95c9b62e](https://github.com/facebook/react-native/commit/1f95c9b62e306fdaf0ef351b02fb79713941259c) by [@p-sun](https://github.com/p-sun)) +- Fix image instrumentation lifecycle on image cancel ([6cba4d2006](https://github.com/facebook/react-native/commit/6cba4d20068ef4ca9b9832e4c5cf71a7e361ddbe) by [@p-sun](https://github.com/p-sun)) +- Break retain cycle in RCTLegacyViewManagerInteropCoordinator ([8f90ce26a5](https://github.com/facebook/react-native/commit/8f90ce26a55f2b1aab42d7c44b0d527321fa8c21) by [@sammy-SC](https://github.com/sammy-SC)) +- Respect port information if available from RCTBundleURLProvider ([7d44959940](https://github.com/facebook/react-native/commit/7d44959940b7f7b03feefde0e9a15382f04dad6d) by [@jimmy623](https://github.com/jimmy623)) +- Remove port from JSLocation when returning packager host ([12543d557f](https://github.com/facebook/react-native/commit/12543d557f00545a719b4dfd76cc0d0adfa37a01) by [@jimmy623](https://github.com/jimmy623)) +- Remove requestToken being nil check from [RCTNetworkTask validateRequestToken] ([ffc90c7f92](https://github.com/facebook/react-native/commit/ffc90c7f92e63e1a53ed107833e3deed492ab435) by [@sammy-SC](https://github.com/sammy-SC)) +- Remove unnecessary packager running check when saved JSLocation is empty ([bbb7bef539](https://github.com/facebook/react-native/commit/bbb7bef539f418bdb452e40987d399c9369df5a2) by [@jimmy623](https://github.com/jimmy623)) +- Check whether packager is running in RCTBundleURLProvider for saved JSLocation ([3d882495d5](https://github.com/facebook/react-native/commit/3d882495d5e4415c2ebb8f4280e18e16025e0736) by [@jimmy623](https://github.com/jimmy623)) +- Fix crash inside RCTRedBox when trying to present same UIViewController twice ([46c77dc296](https://github.com/facebook/react-native/commit/46c77dc296dfab754356cd9346a01dae8d4869f4) by [@sammy-SC](https://github.com/sammy-SC)) +- Fix outdated CocoaPods version requirement in a React.podspec ([8a6ac1fef3](https://github.com/facebook/react-native/commit/8a6ac1fef369071405a3bf14a89924c66f28d192) by [@sunnylqm](https://github.com/sunnylqm)) + +## v0.63.5 + +🚨 **IMPORTANT:** This is an exceptional release on an unsupported version. We recommend you upgrade to one of [the supported versions, listed here](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported). + +### Fixed + +- Add an afterEvaluate to solve AGP 3.x configuration resolution ([473a36099c](https://github.com/facebook/react-native/commit/473a36099c80de08591e3cb51687f7d531145ee3) by [@cortinico](https://github.com/cortinico)) +- Force dependencies resolution to minor series for 0.63 ([28cc286cc4](https://github.com/facebook/react-native/commit/28cc286cc4d43b9fe5153d779ea3eecf4d72c51e) by [@cortinico](https://github.com/cortinico)) + +## v0.63.4 + +### Changed + +- [Maintenance] Bump detox to xcode 12 compatible version ([ccd4efac90](https://github.com/facebook/react-native/commit/ccd4efac90191e57b1dd6e7fff0da13e5764bcc4) by [@kelset](https://github.com/kelset)) + +#### Android specific + +- Bump SoLoader to 0.9.0 ([7465239230](https://github.com/facebook/react-native/commit/7465239230881f453d64364d51272f28614c8653) by [@dulmandakh](https://github.com/dulmandakh)) +- Update Okhttp to version 3.12.12 ([0f6fcb2c27](https://github.com/facebook/react-native/commit/0f6fcb2c2788dc7150f6c3673a8f4f9d8f929441) by [@halaei](https://github.com/halaei)) +- ScrollView now supports `contentOffset` ([ed29ba13f9](https://github.com/facebook/react-native/commit/ed29ba13f97f240c91fdf6c0ef3fb601046697b9) by [@JoshuaGross](https://github.com/JoshuaGross)) + +### Fixed + +#### Android specific + +- Fix ReadableNativeMap.getNullableValue to match signature ([1015194ba1](https://github.com/facebook/react-native/commit/1015194ba1a81eab99000d589914100e4b9ea037) by [@dulmandakh](https://github.com/dulmandakh)) +- Dimension update events are now properly sent following orientation change ([0e9296b95d](https://github.com/facebook/react-native/commit/0e9296b95da06789121f052e6cd6d7cac808464c) by [@ajpaulingalls](https://github.com/ajpaulingalls)) +- Font family is not apply when secureTextEntry is true. ([00d9deaf6b](https://github.com/facebook/react-native/commit/00d9deaf6ba26c605694d303bb0cb072fceae5a1) by [@hank121314](https://github.com/hank121314)) +- Fix App Bundle/Release build missing index.android.bundle with gradle plugin 4.1.0/gradle 6.5 ([53f55001af](https://github.com/facebook/react-native/commit/53f55001afbf07494de0df064a92dfdd42f37c98) by [@tomoima525](https://github.com/tomoima525)) +- ScrollView, HorizontalScrollView: do not ignore `null` `contentOffset` prop ([9e85b7ad88](https://github.com/facebook/react-native/commit/9e85b7ad889900cd57cd2f82286aa8e034b0a32b) by [@vonovak](https://github.com/vonovak)) +- SkewX transforms ([797367c089](https://github.com/facebook/react-native/commit/797367c0890a38ec51cfaf7bd90b9cc7db0e97c7) by [@wcandillon](https://github.com/wcandillon)) +- Allow passing partial contentOffset to ScrollView on Android ([0348953914](https://github.com/facebook/react-native/commit/03489539146556ec5ba6ba07ac338ce200f5b0f4) by [@janicduplessis](https://github.com/janicduplessis)) +- Set color filter so that the arrow matches the text color ([bb8d0f5732](https://github.com/facebook/react-native/commit/bb8d0f57328a20c942991f2d19d86639a7791924) by [@ejanzer](https://github.com/ejanzer)) + +#### iOS specific + +- A crash in WebSocket module ([748aa13747](https://github.com/facebook/react-native/commit/748aa137472d6080427f74bb686c795b925c7d43) by [@marksinkovics](https://github.com/marksinkovics)) +- Fixed showing Alert while closing a Modal ([f319ff321c](https://github.com/facebook/react-native/commit/f319ff321c4b7c0929b99e3ebe7e1ce1fa50b34c) by [@devon94](https://github.com/devon94)) +- Bug with skewX/skewY/perspective/matrix transforms. ([4b956fe5a6](https://github.com/facebook/react-native/commit/4b956fe5a6b3a05b1c2883efc82a95c2524aeb56) by [@wcandillon](https://github.com/wcandillon)) + +## v0.63.3 + +### Added + +#### iOS specific + +- Ability to set which configuration to enable flipper for when using use_flipper! ([dc2df75426](https://github.com/facebook/react-native/commit/dc2df754267df3909631d81c22b9fcab58dfa241) by [@nicoburns](https://github.com/nicoburns)) + +### Changed + +- Update Flipper to 0.54 ([d8b70b19b3](https://github.com/facebook/react-native/commit/d8b70b19b39ead4dd41895d666d116a43c56474e) by [@mweststrate](https://github.com/mweststrate)) +- Removed default 130ms delay from Pressability and Pressable. ([86ffb9c41e](https://github.com/facebook/react-native/commit/86ffb9c41e033f59599e01b7ad016706b5f62fc8) by [@yungsters](https://github.com/yungsters)) + +### Fixed + +#### Android specific + +- `KeyboardDidHide` wrong `screenY` coordinates with `windowTranslucentStatus=true` ([45954ac5dc](https://github.com/facebook/react-native/commit/45954ac5dccdfe05de7553a0f08c4f0e66e3d62e) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) +- Fix Xiaomi TextInput crash in native ([07a597ad18](https://github.com/facebook/react-native/commit/07a597ad185c8c31ac38bdd4d022b0b880d02859)) + +#### iOS specific + +- Prefetch images using a lower download priority ([058eeb43b4](https://github.com/facebook/react-native/commit/058eeb43b489f52183f081fb7232be683002a242) by [@p-sun](https://github.com/p-sun)) +- Fix `RCTImageLoader` not using decoders provided. ([663b5a878b](https://github.com/facebook/react-native/commit/663b5a878be9faafd13b41c222a1bc2ac7bb3a65) by [@sjchmiela](https://github.com/sjchmiela)) +- Support Swift based libraries using Xcode 12’s build system. ([6e08f84719](https://github.com/facebook/react-native/commit/6e08f84719c47985e80123c72686d7a1c89b72ed) by [@alloy](https://github.com/alloy)) +- Fix "main.jsbundle does not exist" issue ([83777cb4fb](https://github.com/facebook/react-native/commit/83777cb4fb5dda89c430b7eff9cd1f28d2577831)) +- Fixed headers in `Image.getSizeWithHeaders`. ([0bcc686c1c](https://github.com/facebook/react-native/commit/0bcc686c1cc90fd44de7a28e2f56ea20fe2f5123) by [@PaitoAnderson](https://github.com/PaitoAnderson)) + +### Security + +- Fix security issues with `@react-native-community/cli` by bumping version ([001eb7cbd6](https://github.com/facebook/react-native/commit/001eb7cbd66c7dc1a302ee2a638c1cfc164538f4) by [@alexbrazier](https://github.com/alexbrazier)) + +## v0.63.2 + +### Fixed + +- Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles ([e75557b48f](https://github.com/facebook/react-native/commit/e75557b48fbee1d136b8b7d1a78ea8f9b9467479) by [@NickGerleman](https://github.com/NickGerleman)) + +#### Android specific + +- Set LogBox windowTranslucentNavigation to false ([23036b38bc](https://github.com/facebook/react-native/commit/23036b38bc4443c8db4865e5c2b21aca7ab4f92f) by [@Ashoat](https://github.com/Ashoat)) +- Fix unable to run in debug mode on Android API < 21 ([7694b32a88](https://github.com/facebook/react-native/commit/7694b32a88078278457dd8721eb61da9c4ac0f5a) by [@Shywim](https://github.com/Shywim)) + +#### iOS specific + +- Fix image cannot show in iOS 14 ([123423c2a9](https://github.com/facebook/react-native/commit/123423c2a9258c9af25ca9bffe1f10c42a176bf3)) + +## v0.63.1 + +### Added + +- Added `minPressDuration` to `Pressable`. ([4aaf629982](https://github.com/facebook/react-native/commit/4aaf62998247bcfd8ebf369d73290096fde08012) by [@yungsters](https://github.com/yungsters)) +- Support for array buffers in the JavaScriptCore implementation of JSI ([9c32140068](https://github.com/facebook/react-native/commit/9c32140068463739b91874689f741ea9630d8c3b) by [@ryantrem](https://github.com/ryantrem)) + +#### Android specific + +- ProGuard rule for hermes ([449dc37720](https://github.com/facebook/react-native/commit/449dc37720b24d9d88661314424c9f982e70ec3a) by [@radko93](https://github.com/radko93)) + +### Fixed + +- LogBox.ignoreAllLogs() should ignore logs ([f28c7505fa](https://github.com/facebook/react-native/commit/f28c7505fa5b4a7ddf1e9311d38dfcd15e8953a2) by [@rickhanlonii](https://github.com/rickhanlonii)) + +#### Android specific + +- Fix font variant crash on Android < 4.4 ([f23feced42](https://github.com/facebook/react-native/commit/f23feced42abd1d18a12e413bf79a51bead61379) by [@Almouro](https://github.com/Almouro)) +- Fix border-drawing when changing border-radius back to 0` ([7757ad0576](https://github.com/facebook/react-native/commit/7757ad05762284c059807d7d75fd03559e86f2b2) by [@IjzerenHein](https://github.com/IjzerenHein)) +- Fix rounded border-drawing when border-radius is smaller than border-width` ([28dce3665d](https://github.com/facebook/react-native/commit/28dce3665d8a63e902c165c060400486fe6234f4) by [@IjzerenHein](https://github.com/IjzerenHein)) + +#### iOS specific + +- TextInput color has the same default (#000) on iOS whether in light or dark mode ([a2f8b9c36e](https://github.com/facebook/react-native/commit/a2f8b9c36e5eba6bc354a2f53bf8d3ca11297d00) by [@JonnyBurger](https://github.com/JonnyBurger)) +- Fixes TextInput shaking when typing Chinese ([9cdc19a936](https://github.com/facebook/react-native/commit/9cdc19a93669b37c0518bd32263e156ffc9193c7) by [@zhongwuzw](https://github.com/zhongwuzw)) + +## v0.63.0 + +### Breaking + +- The `target` field of events is now a native component, not a react tag ([3b813cade1](https://github.com/facebook/react-native/commit/3b813cade1f5d6f248a39f6bbd983f68c5794fe6) by [@TheSavior](https://github.com/TheSavior)) +- Modal: Remove support for `animated` prop (deprecated in 0.26) ([1e9db7bd6d](https://github.com/facebook/react-native/commit/1e9db7bd6df3055b9b81d23f15a54bb250621a41) by [@TheSavior](https://github.com/TheSavior)) +- Alert: Remove deprecated support for passing callback as fourth argument to `Alert.prompt` (deprecated in 0.59) ([a26d622d04](https://github.com/facebook/react-native/commit/a26d622d04451d6872eed2491e5d3f7d4689824d) by [@TheSavior](https://github.com/TheSavior)) +- Switch: Remove support for `thumbTintColor`, `tintColor`, `onTintColor` props (deprecated in 0.57) ([26912bd979](https://github.com/facebook/react-native/commit/26912bd9798aeb38931466b8ddcd3a48973b0528) by [@TheSavior](https://github.com/TheSavior)) +- Multiple deprecations and breaking changes to `TextInputState`. Use native component refs instead of react tags ([6286270e4c](https://github.com/facebook/react-native/commit/6286270e4cb10b40cfd7c8193e31d965f6815150) by [@TheSavior](https://github.com/TheSavior)) +- Bump supported Node engines to >= 10 ([f0c7178a3a](https://github.com/facebook/react-native/commit/f0c7178a3a24e7694b765946f0d884104c8cfa4c) by [@safaiyeh](https://github.com/safaiyeh)) + +### Deprecated + +- Add deprecation warnings for `Clipboard`, `SegmentedControlIOS`, `ProgressViewIOS`, `ProgressBarAndroid`. These modules have been moved to [react-native-community](https://github.com/react-native-community) libraries. ([f295d7f608](https://github.com/facebook/react-native/commit/f295d7f60843a45bb09fc366e497f512c2bc0046) by [@Naturalclar](https://github.com/Naturalclar)) +- Deprecated `console.disableYellowBox` in favor of `LogBox.ignoreAllLogs`. ([87f1e22434](https://github.com/facebook/react-native/commit/87f1e22434210ad22f526422bbda0413f59786ce) by [@rickhanlonii](https://github.com/rickhanlonii)) + +#### Android specific + +- We are deprecating the method `UIManagerModule.resolveRootTagFromReactTag`, this will not be supported in the next version of RN ([acbf9e18ea](https://github.com/facebook/react-native/commit/acbf9e18ea666b07c1224a324602a41d0a66985e) by [@mdvacca](https://github.com/mdvacca)) +- Add warning message for trying to use `ToolbarAndroid` which has been removed from the core since 0.61. ([6249d14a61](https://github.com/facebook/react-native/commit/6249d14a61723b22deb1336457b4295978471885) by [@Naturalclar](https://github.com/Naturalclar)) + +#### iOS specific + +- Deprecate iOS 9.x support ([58a6a40eac](https://github.com/facebook/react-native/commit/58a6a40eac9afb5c4de78a63418cc48ea97da1a4), [829a2237d2](https://github.com/facebook/react-native/commit/829a2237d270c03c80467eb6c2b5b18c87135a45), [674b591809](https://github.com/facebook/react-native/commit/674b591809cd1275b5f1c4d203c2f0ec52303396) by [@fkgozali](https://github.com/fkgozali), [d1265077d6](https://github.com/facebook/react-native/commit/d1265077d6638bb9219180628caf6ff83f8d6019) by [@sunnylqm](https://github.com/sunnylqm)) + +### Added + +- Implement `nativePerformanceNow` and `performance.now()` ([232517a574](https://github.com/facebook/react-native/commit/232517a5740f5b82cfe8779b3832e9a7a47a8d3d) by [@emilisb](https://github.com/emilisb)) +- Support `PerformanceLogger` stopTimespan updates ([08c338eebf](https://github.com/facebook/react-native/commit/08c338eebf67ef6c8c8fb7e3a91bbf89bbc2bb4c) by [@sahrens](https://github.com/sahrens)) +- Added `PlatformColor` implementations for iOS and Android ([f4de45800f](https://github.com/facebook/react-native/commit/f4de45800f25930a1c70f757d12269d859066d3d) by [@tom-un](https://github.com/tom-un)) +- Stamp React Native Version Into C++ Code ([427ba359e0](https://github.com/facebook/react-native/commit/427ba359e0c9411438286dd137bbca67f9829fde) by [@NickGerleman](https://github.com/NickGerleman)) +- New `` Component to make it easier to create touchable elements ([3212f7dfe8](https://github.com/facebook/react-native/commit/3212f7dfe82d187e27f1410c8c3cb1d9fb9f5094) by [@TheSavior](https://github.com/TheSavior), [bd3868643d](https://github.com/facebook/react-native/commit/bd3868643d29e93610e19312571a9736df2cbdf8) by [@vonovak](https://github.com/vonovak)) +- Export `LogBox` module ([799bf56f6f](https://github.com/facebook/react-native/commit/799bf56f6f6a46b6bd42ac5a824f44bd1412f3b6) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Export `LayoutAnimationConfig` flow type ([f0dafd34fe](https://github.com/facebook/react-native/commit/f0dafd34fedb0d63eb2499b978a52da9e6b71ea1) by [@sahrens](https://github.com/sahrens)) +- Added `react-native-community/eslint-plugin` as a dependency for `react-native-community/eslint-config` ([2c2e35c634](https://github.com/facebook/react-native/commit/2c2e35c634cd936bd7ea7a7fe444058268308224) by [@Naturalclar](https://github.com/Naturalclar)) +- `DEBUG_NETWORK_SEND_DELAY` can be used to simulate slow network. ([4aac019176](https://github.com/facebook/react-native/commit/4aac019176e3359068ac671ed4157a6e3ada481f) by [@sahrens](https://github.com/sahrens)) +- Support for `accessibilityLabel` prop to the `Picker` component ([0a525b6d9d](https://github.com/facebook/react-native/commit/0a525b6d9d2a88dddf24b85a2485b928fca23b16) by [@KevinGVargas](https://github.com/KevinGVargas)) +- Allow `zIndex` to `useNativeDriver` ([6a4e06faa8](https://github.com/facebook/react-native/commit/6a4e06faa8afbcb607fc2696c45c4f3257b6665d) by [@mackenziemance](https://github.com/mackenziemance)) + +#### Android specific + +- Support item background color in Dialog `Picker` ([22eb711c84](https://github.com/facebook/react-native/commit/22eb711c84587ac92da97e486fecaa79424fa925)) +- Add OverrideColorScheme interface and setOverrideColorScheme method to AppearanceModule([45d7df6cf7](https://github.com/facebook/react-native/commit/45d7df6cf7482b9790c97db613055ff5d3e59a87)) +- Allow setting custom ripple radius on `TouchableNativeFeedback` ([7f2a79f40b](https://github.com/facebook/react-native/commit/7f2a79f40b4a4c41344ca90cefe318af607675e0) by [@vonovak](https://github.com/vonovak)) +- Add `resizeMode` prop support on `TextInlineView` ([6871416328](https://github.com/facebook/react-native/commit/68714163280695c3148544b95b05a2c1464dbbba) by [@mdvacca](https://github.com/mdvacca)) +- Added an API for checking if there are busy timers to `TimingModule` ([22764e6cdc](https://github.com/facebook/react-native/commit/22764e6cdcf45ca5930676f6e95f9ab2f82bc78d) by [@ejanzer](https://github.com/ejanzer)) +- Make packager location customizable in dev mode ([3714f3648a](https://github.com/facebook/react-native/commit/3714f3648a8ac51f2bb7f2791e2381551d0209b4)) + +#### iOS specific + +- `UIScene` support for `RCTImageView` ([f332fac163](https://github.com/facebook/react-native/commit/f332fac16346d2f03d056575cc988a0b2bbb48c6) by [@tido64](https://github.com/tido64)) +- Status bar style is now correctly changed in multi-window iPadOS 13 apps if you use `RCTRootViewController` and set `UIViewControllerBasedStatusBarAppearance=YES` ([80e6d672f3](https://github.com/facebook/react-native/commit/80e6d672f32fdc860c73eabcc63763dcab3c6269) by [@radex](https://github.com/radex)) +- Added `userInterfaceStyle` for `ActionSheetIOS` and `Share` to override user interface style on IOS 13 ([0a9cc34dd8](https://github.com/facebook/react-native/commit/0a9cc34dd82a3a7dba576997ebd424b12876dbaa) by [@Arjan-Zuidema](https://github.com/Arjan-Zuidema)) +- Add localized accessibility strings to `ReactCore` pod ([aebf54aee4](https://github.com/facebook/react-native/commit/aebf54aee41cc892198b055a7a546743297412bd) by [@xuelgong](https://github.com/xuelgong)) +- Resolve and reject promise for `PushNotificationIOS.requestPermissions` ([edfdafc7a1](https://github.com/facebook/react-native/commit/edfdafc7a14e88a2660b95cb220c62f29b1b28c0) by [@p-sun](https://github.com/p-sun)) +- Use autolink script in template on iOS ([a35efb9400](https://github.com/facebook/react-native/commit/a35efb94006bfa3f541bf3fc3ab5262740f00525) by [@janicduplessis](https://github.com/janicduplessis)) +- Added `Flipper` to template app ([52cd9cd6fe](https://github.com/facebook/react-native/commit/52cd9cd6fec0866177aa02f7129a8b3d8b2bdbea) by [@safaiyeh](https://github.com/safaiyeh)) +- Add `textColor` and `backgroundColor` props to `SegmentedControl` for iOS >=13 ([e8f577e541](https://github.com/facebook/react-native/commit/e8f577e541815bfd8adebdf14f70c9e4205f8e4e) by [@Naturalclar](https://github.com/Naturalclar)) +- Adds `RCTOverrideAppearancePreference` to the iOS `Appearance` module ([fa65b156d4](https://github.com/facebook/react-native/commit/fa65b156d4109e6a3121484b601358b11cf0d541)) +- Changed iOS LaunchScreen from `xib` to `storyboard` ([33b3a1a145](https://github.com/facebook/react-native/commit/33b3a1a1453ca51690e59b758eeb61a4fa8f35bc) by [@jeswinsimon](https://github.com/jeswinsimon)) + +### Changed + +- Update `react-native-community/eslint-config` to 1.1.0, adding the new color rule ([780f06cd47](https://github.com/facebook/react-native/commit/780f06cd477f34da48646a949bd25dd3f883a9a2) by [@TheSavior](https://github.com/TheSavior)) +- Update community eslint plugin in the eslint config ([b2d10bc602](https://github.com/facebook/react-native/commit/b2d10bc60272fc2318835ff38655a9eb4a2bbed0) by [@Naturalclar](https://github.com/Naturalclar)) +- Upgrade `eslint-config` and `metro-preset` in project template ([ad86a18305](https://github.com/facebook/react-native/commit/ad86a183052e8b25d599eb395aef55412c02ff7b) by [@Naturalclar](https://github.com/Naturalclar)) +- Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` ([602070f44b](https://github.com/facebook/react-native/commit/602070f44b02220aeb036a7b3c26dad5c611b636) by [@tom-un](https://github.com/tom-un)) +- Make `ScrollView` use `forwardRef` ([d2f314af75](https://github.com/facebook/react-native/commit/d2f314af75b63443db23e131aaf93c2d064e4f44) by [@kacieb](https://github.com/kacieb)) +- Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0 ([93ee5b2cc8](https://github.com/facebook/react-native/commit/93ee5b2cc8391bc5cb12ca7cf08ed0e44c74d29a) by [@bvaughn](https://github.com/bvaughn)) +- Updated the React Hooks ESLint Plugin ([6ce3f0a4f7](https://github.com/facebook/react-native/commit/6ce3f0a4f7495adb82e655d037dc4e5af462f955) by [@gaearon](https://github.com/gaearon)) +- Update to React 16.13.1 ([9637d6214a](https://github.com/facebook/react-native/commit/9637d6214a47e58d7fa8252a3de8c057e5cfb101) by [@gaearon](https://github.com/gaearon)) +- Relax `RefreshControl`'s `onRefresh` flow typing ([884c86ae02](https://github.com/facebook/react-native/commit/884c86ae02b0be7ea1e4b258dab39f4c5aee0b9d) by [@vonovak](https://github.com/vonovak)) +- Improved flowtype support for `Animated` ([bdafc55f50](https://github.com/facebook/react-native/commit/bdafc55f50c7d580ee2e643a02cb95d0196f721c) by [@javache](https://github.com/javache)) +- Upgrade `eslint-plugin-relay` to 1.6.0 ([0483404d82](https://github.com/facebook/react-native/commit/0483404d827416b7270e8a42b84e424035127892) by [@kassens](https://github.com/kassens)) +- Upgrade to latest dependencies in package.json template ([82e8239337](https://github.com/facebook/react-native/commit/82e82393377ddcedba01c401a5d79d5bbcdc4dc9) by [@codler](https://github.com/codler)) +- Make JSStringToSTLString 23x faster ([733532e5e9](https://github.com/facebook/react-native/commit/733532e5e95c85b8295b6c66009ca9efd2a77622) by [@radex](https://github.com/radex)) +- Changed property `disableIntervalMomentum` to work with both horizontal and vertical ScrollViews ([6237cfb325](https://github.com/facebook/react-native/commit/6237cfb325e39571ede0054a67d60f2c978d6d58) by [@Shaninnik](https://github.com/Shaninnik)) +- Upgraded to Flow v0.114.0 ([aa78457343](https://github.com/facebook/react-native/commit/aa7845734352eab2bd32f7d6e683d6674fd6680d) by [@mroch](https://github.com/mroch)) +- Updated CLI to the latest version ([ddc33007ad](https://github.com/facebook/react-native/commit/ddc33007ad0b4a0a24966b833e797227b9c56cca) by [@grabbou](https://github.com/grabbou)) +- Upgrade Prettier from 1.17 to 2.0.2. ([cf44650b3f](https://github.com/facebook/react-native/commit/cf44650b3f4f13df8208ceded60ec5c48bd6baf3) by [@bolinfest](https://github.com/bolinfest)) +- Only set dimensions if the window attributes change ([35c6bb9ac0](https://github.com/facebook/react-native/commit/35c6bb9ac0fc452428e85fee72affb4fc29f500c) by [@cpojer](https://github.com/cpojer)) +- Upgrade internal packages to support ESLint >= 6 ([89d04b5e4a](https://github.com/facebook/react-native/commit/89d04b5e4a3fd0b0f77b5a390c0aa62a3804e2bc) by [@Barbiero](https://github.com/Barbiero)) +- Make `JSCRuntime::createValue` faster ([24e0bad8be](https://github.com/facebook/react-native/commit/24e0bad8bea95ef7ddf72e2f00a93ffd47872d5b) by [@radex](https://github.com/radex)) +- Add perf markers in `XMLHttpRequest` ([71b8ececf9](https://github.com/facebook/react-native/commit/71b8ececf9b298fbf99aa27d0e363b533411e93d) by [@sahrens](https://github.com/sahrens)) +- Update SoLoader to 0.8.2 ([0a6f058b6b](https://github.com/facebook/react-native/commit/0a6f058b6bd0493f7eece972b1f73be3606ca8d5) by [@passy](https://github.com/passy)) +- `console.error` calls, and uncaught exceptions are now displayed in the Metro logs as well ([ffb82cb2f0](https://github.com/facebook/react-native/commit/ffb82cb2f052f276a94a004d5acea0ab44f8098c) by [@mweststrate](https://github.com/mweststrate)) +- Upgrade Flipper to 0.37.0 ([17f025bc26](https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0) by [@sunnylqm](https://github.com/sunnylqm)) + +#### Android specific + +- Upgraded to Hermes 0.5.0 ([4305a291a9](https://github.com/facebook/react-native/commit/4305a291a9408ca65847994bbec42f1fbc97071d) by [@willholen](https://github.com/willholen)) +- Internal storage now will be preferred for caching images from `ImageEditor`. ([79efa43428](https://github.com/facebook/react-native/commit/79efa4342852a3e9271a56e3a0fb7c15be664e9a) by [@kitttn](https://github.com/kitttn)) +- Update Gradle Wrapper to 6.2 ([d4d8887b50](https://github.com/facebook/react-native/commit/d4d8887b5018782eeb3f26efa85125e6bbff73e4) by [@friederbluemle](https://github.com/friederbluemle)) +- Upgrade Folly to v2020.01.13.00 ([6e2131b8fa](https://github.com/facebook/react-native/commit/6e2131b8fa85da8b3fb0391803e7fbecba890ffb) by [@Kudo](https://github.com/Kudo)) +- Only update dimensions in `ReactRootView` if they've changed ([cc3e27d484](https://github.com/facebook/react-native/commit/cc3e27d484d3a412f632454b7f1c637b2c271af2) by [@ejanzer](https://github.com/ejanzer)) +- `ReactEditText` extends `AppCompatEditText` ([aaa2765a92](https://github.com/facebook/react-native/commit/aaa2765a920de8234f0def4cae05ca5d6c8c8ac8) by [@dulmandakh](https://github.com/dulmandakh)) +- Make `ReactApplicationContext` nullable as the constructor argument of `ReactContextBaseJavaModule` ([f8d5c5bfd7](https://github.com/facebook/react-native/commit/f8d5c5bfd79be0e20a205a1856bd9946143eeacf) by [@RSNara](https://github.com/RSNara)) +- Update Android Gradle plugin to 3.5.3 ([e1e081b00e](https://github.com/facebook/react-native/commit/e1e081b00e5efb32bce74211c850212eca8a9412) by [@SaeedZhiany](https://github.com/SaeedZhiany)) +- Don't emit dimensions update event on initial load ([383934a06e](https://github.com/facebook/react-native/commit/383934a06e22e8e1a5ee50d121722240259f95d0) by [@ejanzer](https://github.com/ejanzer)) +- Bump Android build-tools to 29.0.2, compileSdk to 29 ([edcbfb9821](https://github.com/facebook/react-native/commit/edcbfb98210d9aaa6bb1d7c64281ae9cfb41cac2) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific + +- Disambiguate autolinking-ios.rb script from CLI’s “autolinking” feature and bring RNTester & template in line. ([4118d79826](https://github.com/facebook/react-native/commit/4118d798265341061105f3a53550db83c66a71cb) by [@alloy](https://github.com/alloy)) +- Updated Flipper iOS integration to be included by default in the `Debug` configuration ([619d5d60df](https://github.com/facebook/react-native/commit/619d5d60dfa94966e7104febec08166c1b5eca49) by [@alloy](https://github.com/alloy)) +- Use Apple unified logging API (os_log) ([f501ed682a](https://github.com/facebook/react-native/commit/f501ed682ae68136d966aee2b0d3cc0f1e8b90cd) by [@LeoNatan](https://github.com/LeoNatan)) +- Upgrade Folly to v2020.01.13.00 ([a27e31c059](https://github.com/facebook/react-native/commit/a27e31c059971b1d554ad6c7c81706f08eafac87) by [@Kudo](https://github.com/Kudo)) +- Remove the `xcshareddata` from .gitignore ([7980615d37](https://github.com/facebook/react-native/commit/7980615d371a7bf607a3787bca91cfde229c41dc) by [@pvinis](https://github.com/pvinis)) +- Add `complete_nullability = True` to compatible libraries ([796a4ea7e3](https://github.com/facebook/react-native/commit/796a4ea7e31ae05b76e59e02ab05f9c955f7c149)) +- Remove the Flipper pod post install step ([44beb2a685](https://github.com/facebook/react-native/commit/44beb2a685b7ceb0311bde7d0d33cb70bb891d30) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) +- Enable Flipper with CocoaPods `:configuration` ([7bb1c4e1b8](https://github.com/facebook/react-native/commit/7bb1c4e1b8715a5c9cb6f9e4e77a6df783481d3d) by [@alloy](https://github.com/alloy)) + +### Removed + +- Remove unused`ImageProp` ([fbd09b1797](https://github.com/facebook/react-native/commit/fbd09b179759cd90f2be5c24caa11bdb483ad8cd) by [@Naturalclar](https://github.com/Naturalclar)) +- Remove leftover `Incremental` component ([e99800267b](https://github.com/facebook/react-native/commit/e99800267b78aa581aff956d47b8be91858628b9) by [@venits](https://github.com/venits)) +- Remove "Debug with Nuclide" option ([011eb4cea5](https://github.com/facebook/react-native/commit/011eb4cea5d482cef54d7659e7436a04e539ff19) by [@rickhanlonii](https://github.com/rickhanlonii)) + +#### Android specific + +- Remove unused Feature Flag: `lazilyLoadViewManagers` ([3963f34980](https://github.com/facebook/react-native/commit/3963f34980f501ef89a945a1d0e76716af84527d) by [@JoshuaGross](https://github.com/JoshuaGross)) +- `PickFirst` options for RNTester and template ([4bb0b4f205](https://github.com/facebook/react-native/commit/4bb0b4f205b1bc9a91150fe1f609f7d7313eb806) by [@passy](https://github.com/passy)) +- Remove Kotlin version from the default template ([ced959bb3d](https://github.com/facebook/react-native/commit/ced959bb3d6abdab30c5e64af9bff6059b111cdd) by [@grabbou](https://github.com/grabbou)) + +#### iOS specific + +- Remove core `RCTConvert` CoreLocation Libraries ([bcf2a716fb](https://github.com/facebook/react-native/commit/bcf2a716fb8b8954d6f7b801a1699eeea9418e73) by [@maschad](https://github.com/maschad)) +- Remove copyright notices from iOS application template ([9c3fa57337](https://github.com/facebook/react-native/commit/9c3fa573379bb4824bbe02b5b5aa1ae3502772d8) by [@alloy](https://github.com/alloy)) +- Remove three properties: `textColor`, `font` and `textAlignment` from `RCTBackedTextInputViewProtocol`, unifying the usage into `defaultTextAttributes`. ([aff6bad27c](https://github.com/facebook/react-native/commit/aff6bad27c6c2232ba8bde17823d0a0db4ac589b) by [@jimmy623](https://github.com/jimmy623)) + +### Fixed + +- Add support to render `` with no fixed size nested within a `` ([dbb7eacb42](https://github.com/facebook/react-native/commit/dbb7eacb429adb4160e740017c212bfd6df0f03a) by [@mdvacca](https://github.com/mdvacca)) +- Fixes bug where `` would crash. ([66601e755f](https://github.com/facebook/react-native/commit/66601e755fcad10698e61d20878d52194ad0e90c) by [@TheSavior](https://github.com/TheSavior)) +- Use new `setTextCursorDrawable` API for Android 10 ([e7a14b803f](https://github.com/facebook/react-native/commit/e7a14b803fdc8840bbcde51d4bfa9cf9a85a8472) by [@sturmen](https://github.com/sturmen)) +- Fix `Animated.Value` initialized with undefined in `ScrollView` ([cf02bd9b76](https://github.com/facebook/react-native/commit/cf02bd9b765e29ed8aa2bbf62661e89c84bb80e5) by [@janicduplessis](https://github.com/janicduplessis)) +- Do not explicitly include `.js` in Library imports ([161b910494](https://github.com/facebook/react-native/commit/161b9104941663dcc0b08a73789c0ff3410fc661) by [@NickGerleman](https://github.com/NickGerleman)) +- Fixed `Pressability` to properly fire `onLongPress`. ([5ca1d8f260](https://github.com/facebook/react-native/commit/5ca1d8f260bfb64111a6ba39f76a0a935829c0f2) by [@yungsters](https://github.com/yungsters)) +- Fixed typo from `inly` to `only` inside `Modal.js` library code. ([686d8a57f8](https://github.com/facebook/react-native/commit/686d8a57f889fe74dc1c66566c80f0ed6d677729) by [@Darking360](https://github.com/Darking360)) +- Fix viewability calculations for nested `VirtualizedLists` inside of a parent list's `FooterComponent` ([074a2fab74](https://github.com/facebook/react-native/commit/074a2fab74754c28cba0ccc51552a246a3046501) by [@logandaniels](https://github.com/logandaniels)) +- Fix android `TextInput` transitions ([0a17a4fe56](https://github.com/facebook/react-native/commit/0a17a4fe56ff2cabc3c7d1cc5b34bd3fdd032e59)) +- Remove JS autoFocus implementation ([0569d4c431](https://github.com/facebook/react-native/commit/0569d4c4315d61d2d8f4ab628a54eb1e1db45dc2) by [@janicduplessis](https://github.com/janicduplessis)) +- Check null values in `shouldAnimate` ([3498b3b96b](https://github.com/facebook/react-native/commit/3498b3b96b2e27c7c7f6407b3673b44540871a31) by [@axe-fb](https://github.com/axe-fb)) +- Fix `AccessibilityInfo.isScreenReaderEnabled` mock in Jest setup ([ec3327b61a](https://github.com/facebook/react-native/commit/ec3327b61ab1be3fd1565c8a35fe56747bd9069f) by [@rubennorte](https://github.com/rubennorte)) +- Fix crash when passing invalid UTF-16 data from JSC into native code ([011cf3f884](https://github.com/facebook/react-native/commit/011cf3f88428ca83552d0b51c7c3a0c47b9728e5) by [@motiz88](https://github.com/motiz88)) +- Make `YGValue.h` compile with Clang on Windows ([014bc95135](https://github.com/facebook/react-native/commit/014bc95135a38d65b991509492c0979cfd153e71) by [@christophpurrer](https://github.com/christophpurrer)) +- Fix documentation comments for HermesJS's `Function::callWithThis` method to accurately reflect how `this` is handled. ([399bda5284](https://github.com/facebook/react-native/commit/399bda52840161bf7d30c09eca061b4378b8f6e4) by [@Kronopath](https://github.com/Kronopath)) +- Fix resolving assets outside of the project root ([7deeec7396](https://github.com/facebook/react-native/commit/7deeec73966d84140492c2a767819977318c4d2d) by [@janicduplessis](https://github.com/janicduplessis)) +- Transform empty responses into empty `Blob`s ([9a8c06b502](https://github.com/facebook/react-native/commit/9a8c06b502c774f7a0bff1bdc064fbfe16ca75be) by [@RSNara](https://github.com/RSNara)) +- Fix validation of event mappings for `AnimatedEvent` ([19362f6116](https://github.com/facebook/react-native/commit/19362f6116bad441c5e23f2bab420af78664b3d3) by [@javache](https://github.com/javache)) +- Fix `NativeJSCHeapCapture` ([7e3a43c23d](https://github.com/facebook/react-native/commit/7e3a43c23d028a4481bc455dd28c391a81ff1a94) by [@RSNara](https://github.com/RSNara)) +- Add `AnimationInterpolation` as possible type for toValue ([26e8870fbf](https://github.com/facebook/react-native/commit/26e8870fbf310f0fb438a86cb2fe260f0bc419b9) by [@nabati](https://github.com/nabati)) +- Fix return type of `StyleSheet.create` ([4e71a30969](https://github.com/facebook/react-native/commit/4e71a30969d74073309d0350be55cadb84ae43ff) by [@jbrown215](https://github.com/jbrown215)) +- Adjust HelloWorld-tvOSTests/Info.plist `CFBundleIdentifier` to use `PRODUCT_BUNDLE_IDENTIFIER` ([98ebc1ea25](https://github.com/facebook/react-native/commit/98ebc1ea25102049ec53288a458ff16ed5b4ada0) by [@MoOx](https://github.com/MoOx)) +- Fix bug where if `Error` global is not callable when building an error, jsi will throw a JS exception back to JS code. #158 ([a195447539](https://github.com/facebook/react-native/commit/a1954475394dc03704a2e093e6fc4b48188640fa) by [@mhorowitz](https://github.com/mhorowitz)) +- Fix stylesheet validation for functions with custom prototype methods. ([f464dad5d4](https://github.com/facebook/react-native/commit/f464dad5d4f0fbf1cb23e21d22907ffddeaf97e4)) +- Fix sporadic issue with `onEndReached` called on load when not needed ([8ddf231306](https://github.com/facebook/react-native/commit/8ddf231306e3bd85be718940d04f11d23b570a62) by [@sahrens](https://github.com/sahrens)) +- Correct argument types of `NativeJSDevSupport.onSuccess` ([b42371da5a](https://github.com/facebook/react-native/commit/b42371da5a41916522b569a66c0a126333cf9cac) by [@RSNara](https://github.com/RSNara)) +- Add `URLSearchParams` and `Headers` to eslint globals ([7a13a1a88f](https://github.com/facebook/react-native/commit/7a13a1a88fdf26dca817b76399f1c86a8a05eccb) by [@sonnyp](https://github.com/sonnyp)) +- Export exception classes with default visibility ([84adc85523](https://github.com/facebook/react-native/commit/84adc85523770ebfee749a020920e0b216cf69f8) by [@appden](https://github.com/appden)) +- Add `URL` to eslint globals. ([ff9def41ff](https://github.com/facebook/react-native/commit/ff9def41ff3e7760d076bf1b899583d4b36cba0d) by [@sonnyp](https://github.com/sonnyp)) +- Plumb through memory allocation profiler feature to Chrome Inspector ([ed3054927c](https://github.com/facebook/react-native/commit/ed3054927c30c8823f78026b9c4cb42fbe4f8b00) by [@jbower-fb](https://github.com/jbower-fb)) +- Better monorepo support when building release apk ([a8e85026cf](https://github.com/facebook/react-native/commit/a8e85026cfa60056b1bcbcd39cde789e4d65f9cb) by [@grabbou](https://github.com/grabbou)) +- `LogBox` - Fix dependency cycle ([6ba2aeefa8](https://github.com/facebook/react-native/commit/6ba2aeefa8dfe031bf1dc46dbea29235aec31d61) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Always update background color and bar style on Android status bar ([9457efa84c](https://github.com/facebook/react-native/commit/9457efa84c872f029027cdcfc3bae4f403715e48)) +- Disable accessibility state changes of the focused view for Android API < 21 ([f2d58483c2](https://github.com/facebook/react-native/commit/f2d58483c2aec689d7065eb68766a5aec7c96e97) by [@mdvacca](https://github.com/mdvacca)) + +#### Android specific + +- Gradle release config ([0d1fb458ab](https://github.com/facebook/react-native/commit/0d1fb458ab8027dcfac5f2fa11e8c16d6853c59c) by [@vdmtrv](https://github.com/vdmtrv)) +- Change how `TextInput` responds to `requestFocus` to fix a11y focus issue ([d4a498aba2](https://github.com/facebook/react-native/commit/d4a498aba2d2843e7a741a31b0c91c6a79a7386c) by [@ejanzer](https://github.com/ejanzer)) +- Fixed style in `TextInputTestCase` ([8c493804f3](https://github.com/facebook/react-native/commit/8c493804f3f7b3ae3761679a978971ab9d71baa0) by [@ejanzer](https://github.com/ejanzer)) +- Fix template instacrash from missing androidx dependency ([a1b14deb3e](https://github.com/facebook/react-native/commit/a1b14deb3e32df797aae99a75743a4d283e5337b) by [@alloy](https://github.com/alloy)) +- Implement native `TextInput` `autoFocus` on Android ([055a41b081](https://github.com/facebook/react-native/commit/055a41b081c5bc9535b071d9b4b7488b92e71803) by [@janicduplessis](https://github.com/janicduplessis)) +- Support for case insensitive `Origin` headers for `Websockets` ([aeaf286c77](https://github.com/facebook/react-native/commit/aeaf286c77b50a95c4961de0d2355caad8ffa396) by [@brunobar79](https://github.com/brunobar79)) +- RNTester Buck Build ([a3cb377645](https://github.com/facebook/react-native/commit/a3cb377645f2ccb7632ded73c230a41025d38f6f) by [@passy](https://github.com/passy)) +- Fix bug in updating dimensions in JS ([bef845ffd5](https://github.com/facebook/react-native/commit/bef845ffd521aa83d779de584ec370f9f88f27f3) by [@ejanzer](https://github.com/ejanzer)) +- Applied missing changes from bumping Gradle wrapper to 6.0.1 ([aa0ef15335](https://github.com/facebook/react-native/commit/aa0ef15335fe27c0c193e3e968789886d82e82ed) by [@SaeedZhiany](https://github.com/SaeedZhiany)) +- Unregister `JSDevSupport` from `DebugCorePackage` ([c20963e11c](https://github.com/facebook/react-native/commit/c20963e11cc1c10f20a2a0a3c209f5b403c9e899) by [@RSNara](https://github.com/RSNara)) +- Make sure `ServerHost` is optional in `NativePlatformConstants.js` ([048f88a33a](https://github.com/facebook/react-native/commit/048f88a33a53ebd4e45865b319c42291f1d6c7f2) by [@RSNara](https://github.com/RSNara)) +- Removed code that would cause accessibility header role to be spoken twice ([7428271995](https://github.com/facebook/react-native/commit/7428271995adf21b2b31b188ed83b785ce1e9189) by [@KevinGVargas](https://github.com/KevinGVargas)) +- Fail silently in `AppStateModule.sendEvent` if `CatalystInstance` is not available ([c4806fada6](https://github.com/facebook/react-native/commit/c4806fada6532894e2242cf31f7145d2992e3a2b) by [@JoshuaGross](https://github.com/JoshuaGross)) +- RN `Picker` - fix types in `AndroidDialogPickerManagerInterface` ([56b0f5cb6b](https://github.com/facebook/react-native/commit/56b0f5cb6ba48ecefc2890152ebe88e3df61a0ea)) +- Fix Hermes debugger being disabled by default ([b8621f5d30](https://github.com/facebook/react-native/commit/b8621f5d303442ab78dc5d745cfc86a941d4737c) by [@willholen](https://github.com/willholen)) + +#### iOS specific + +- Fixed connection of metro reload command to iOS device ([f9df93385e](https://github.com/facebook/react-native/commit/f9df93385eee0e1cd1144a65e05410dfb48b119c) by [@reyalpsirc](https://github.com/reyalpsirc)) +- Remove `RCTDevLoadingView` jank ([faff19a7c6](https://github.com/facebook/react-native/commit/faff19a7c651c740d8d649b86727b63b63562b20) by [@RSNara](https://github.com/RSNara)) +- Fix crash when passing null value in object parameter of bridged method ([15434c7c43](https://github.com/facebook/react-native/commit/15434c7c435928a40b9cd66fe9f5d1bcdea8d954)) +- Get ready for Clang 10 ([8721ee0a6b](https://github.com/facebook/react-native/commit/8721ee0a6b10e5bc8a5a95809aaa7b25dd5a6043) by [@maxovtsin](https://github.com/maxovtsin)) +- Fix `RCTBlobManager` cleanup crash ([91c5ff4a12](https://github.com/facebook/react-native/commit/91c5ff4a12982ccead56c9c038761e9316d01409) by [@RSNara](https://github.com/RSNara)) +- Make Lambda function called in `NativeModule` mutable ([5290047d09](https://github.com/facebook/react-native/commit/5290047d09c0a41c85a1d47a638877c226d9c191) by [@maschad](https://github.com/maschad)) +- Fix crash in `RCTCxxBridge.executeApplicationScript` ([0c2db3256f](https://github.com/facebook/react-native/commit/0c2db3256f6cbb3ec564e0f183a52a439ed33f52) by [@ahimberg](https://github.com/ahimberg)) +- Fix `RCTDevLoadingView` `RedBox` on reload ([fe5ac2c3f9](https://github.com/facebook/react-native/commit/fe5ac2c3f9e47cfb7c5820a755a5d74d47624953) by [@RSNara](https://github.com/RSNara)) +- Fix `Image` component crashing when `uri` is `null` ([06b8b15b0a](https://github.com/facebook/react-native/commit/06b8b15b0af84b6f8b44d200dc25f29eac51181c) by [@mlazari](https://github.com/mlazari)) +- Fix `RCTDevLoadingView` not showing up with `UIScene` ([74b667dbc2](https://github.com/facebook/react-native/commit/74b667dbc2a48183dec0b9c3b5401bc3f9e54e7b) by [@tido64](https://github.com/tido64)) +- Prevent interactive dismissal for non-fullscreen modals ([1e7ed81d16](https://github.com/facebook/react-native/commit/1e7ed81d16dda4188352e0ccdc0f0bd3ad4741f3)) +- Resolve localization warnings in template ([0e4bcaa296](https://github.com/facebook/react-native/commit/0e4bcaa2960a2b1aa42dbe716fc6a35652aa7207) by [@safaiyeh](https://github.com/safaiyeh)) +- Implement `requiresMainQueueSetup` in `RCTDevSettings.mm` ([adf87dd7ed](https://github.com/facebook/react-native/commit/adf87dd7eddcf65a3300e6ac9092838d9c8a3279) by [@logandaniels](https://github.com/logandaniels)) +- Resolve `React-RCTText` Xcode warning ([04fed6508b](https://github.com/facebook/react-native/commit/04fed6508b74b23c954183af3f6121fb344d2138) by [@safaiyeh](https://github.com/safaiyeh)) +- Resolve Xcode warnings from `React-cxxreact`. ([dc6c57ce0d](https://github.com/facebook/react-native/commit/dc6c57ce0d4f5424bfb047c51fee18eac381a98b) by [@safaiyeh](https://github.com/safaiyeh)) +- `RCTReconnectingWebSocket` is reconnecting infinitely when stopped before getting connected ([0d4b0e9417](https://github.com/facebook/react-native/commit/0d4b0e941725657d8e63940428888aaceff505ad)) +- Fix prop name of `passwordRules` in `TextInput` ([3f5c42f357](https://github.com/facebook/react-native/commit/3f5c42f357d58268d0a0fd1bfc639f41feab937c) by [@Naturalclar](https://github.com/Naturalclar)) +- Remove need for Swift file in the user’s project in order to use Flipper ([8f93dedc6a](https://github.com/facebook/react-native/commit/8f93dedc6a5653edd2220c65ccb4ff8736ee060c) by [@alloy](https://github.com/alloy)) +- Clear all held `jsi::Functions` when `jsi::Runtime` is deleted ([9ae95582e7](https://github.com/facebook/react-native/commit/9ae95582e792a3dca4487bdce9080c6d874c7dd7) by [@RSNara](https://github.com/RSNara)) +- Make framework builds work again by making `RCTImageLoader` C++ requirement opt-in ([25571ec452](https://github.com/facebook/react-native/commit/25571ec4522931193b41723d3f80b3bced1fca3b) by [@alloy](https://github.com/alloy)) +- Enable dev keyboard shortcuts on Mac Catalyst ([56dfc86d64](https://github.com/facebook/react-native/commit/56dfc86d64a2a1f2ad05239b6d11aacac73cbac9) by [@charpeni](https://github.com/charpeni)) +- Fix `RCTTextView` layout issue that happens on some font with `leading` attribute not equal to zero, which causes wrong base-alignment layout ([5d08aab526](https://github.com/facebook/react-native/commit/5d08aab526b2702b46ff75ea7e943a33aa6df288)) +- Fix LAN instead of Wi-Fi device bundle configuration ([d1e6f8d3c4](https://github.com/facebook/react-native/commit/d1e6f8d3c4de1fbb4bddd5205cd3b35c572b495b) by [@Oleg-E-Bakharev](https://github.com/Oleg-E-Bakharev)) +- Add autorelease pool for each run loop for JS Thread ([948cbfdacc](https://github.com/facebook/react-native/commit/948cbfdacc42f8d2640e69f61df55f6adb823fcf) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fixed bug in implementation of ``'s `selectOnFocus` prop ([e020576b34](https://github.com/facebook/react-native/commit/e020576b34fb6ca6d3f9fe38916844b78a45c0e3) by [@shergin](https://github.com/shergin)) +- `RCTRedBox` doesn't appear in apps implementing `UISceneDelegate` ([d0a32c2011](https://github.com/facebook/react-native/commit/d0a32c2011ca00991be45ac3fa320f4fc663b2e8) by [@tido64](https://github.com/tido64)) +- Fixes the `InputAccessoryView.backgroundColor` prop’s typing to use `ColorValue`. ([a43fd60e18](https://github.com/facebook/react-native/commit/a43fd60e18aff9ee6bcaf8ec576adb8678d5bcf4) by [@alloy](https://github.com/alloy)) +- Fix `Animated` image crash when `CADisplayLink` target in `RCTWeakProxy` is `nil` ([e5a6655e71](https://github.com/facebook/react-native/commit/e5a6655e71d41a58ce0e51d37aa9fb8792e37dd5) by [@p-sun](https://github.com/p-sun)) + +## v0.62.3 + +### Security + +- Update validateBaseUrl to use latest regex ([33ef82ce6d](https://github.com/facebook/react-native/commit/33ef82ce6dfd31e1f990d438c925a0e52723e16b) by [@FBNeal](https://github.com/FBNeal)) + +### Fixed + +#### iOS specific + +- Change autolink to match requirements for FlipperFolly working with Xcode 12.5 ([c6f4611dcb](https://github.com/facebook/react-native/commit/c6f4611dcbfbb64d5b54e242570e2a1acffcabef) by [@kelset](https://github.com/kelset)) +- Change podfile to rely on the autolink-ios rb file ([c4ea556d64](https://github.com/facebook/react-native/commit/c4ea556d64c7fc146d1412548788c48bbcc0f6bb) by [@kelset](https://github.com/kelset)) +- Update detox to work on Xcode 12 ([158b558e50](https://github.com/facebook/react-native/commit/158b558e500576f434dec09417bb02cc0bc53f7a) by [@kelset](https://github.com/kelset)) + +## v0.62.2 + +### Fixed + +- Fix Appearance module when using Chrome Debugger ([f7b90336be](https://github.com/facebook/react-native/commit/f7b90336be25b78935549aa140131d4d6d133f7b) by [@TheSavior](https://github.com/TheSavior)) +- Fix mock for TextInput ([5a3c6faee9](https://github.com/facebook/react-native/commit/5a3c6faee9c44a2d99b13d113c91dbf98990f8af) by [@SergioEstevao](https://github.com/SergioEstevao)) +- Flow errors from YellowBox and BubblingEventHandler ([a049130f34](https://github.com/facebook/react-native/commit/a049130f34be951c9c67d2a472c7eb7f3d08f070) by [@thymikee](https://github.com/thymikee)) + +#### iOS specific + +- Make Vibration library compatible with TurboModules. ([3904228704](https://github.com/facebook/react-native/commit/390422870466beba571dda04f669380e14055056) by [@brunobar79](https://github.com/brunobar79)) +- Exclude Flipper from iOS Release builds ([e5497ca8f6](https://github.com/facebook/react-native/commit/e5497ca8f6e3b240948fdbeef0ac2a710f25bb56) by [@javiercr](https://github.com/javiercr)) +- Fix crash when enabling Performance Monitor on iOS 13.4 ([e2c417f7cf](https://github.com/facebook/react-native/commit/e2c417f7cf5ae7efa5ea1f9644a51c4c706a983f) by [@IjzerenHein](https://github.com/IjzerenHein)) + +## v0.62.1 + +### Fixed + +- Bump CLI to 4.5.1 to improve DX ([eac56b9749](https://github.com/facebook/react-native/commit/eac56b9749ed624275d4190b5e48b775583acb3f) by [@alloy](https://github.com/alloy)) +- Fix a YellowBox regression in v0.62.0 where the Flipper network inspector causes YellowBox to crash the app due to using base64 images. ([227aa96bb2](https://github.com/facebook/react-native/commit/227aa96bb23b6ff20eebbd8a9335fd172ed6005b) by [@rickhanlonii](https://github.com/rickhanlonii)) + +#### Android specific + +- Add new DoNotStrip class to proguard config ([cfcf5eba43](https://github.com/facebook/react-native/commit/cfcf5eba4317f80ef8902463b7c0b2e1e7b534a7) by [@janicduplessis](https://github.com/janicduplessis)) + +#### iOS specific + +- Fix Performance Monitor in dark appearance ([576ddfb3a8](https://github.com/facebook/react-native/commit/576ddfb3a84a5461679959f0d3f229a000dcea8d) by [@gorhom](https://github.com/gorhom)) +- Inverted ScrollViews scroll to their bottom when the status bar is pressed ([7a4753d76a](https://github.com/facebook/react-native/commit/7a4753d76aab1c52a09f26ec6f7fd43a68da8a97) by [@emilioicai](https://github.com/emilioicai)) +- Revert [previous incomplete fix](https://github.com/facebook/react-native/commit/bd2b7d6c0366b5f19de56b71cb706a0af4b0be43) for [an issue](https://github.com/facebook/react-native/issues/26473) with `Modal`’s `onDismiss` prop. ([27a3248a3b](https://github.com/facebook/react-native/commit/27a3248a3b37410b5ee6dda421ae00fa485b525c) by [@grabbou](https://github.com/grabbou)) +- Fix double call to onEndReached in VirtualizedList ([d3658bc2b6](https://github.com/facebook/react-native/commit/d3658bc2b6437e858d3b3f5688277dedbca779b8) by [@MartinSherburn](https://github.com/MartinSherburn)) + +### Changed + +- Update warning message of deprecated imports ([405200e9a9](https://github.com/facebook/react-native/commit/405200e9a930cded47954f374f2a779ec769cd4c) by [@Naturalclar](https://github.com/Naturalclar)) + +## v0.62.0 + +This major release includes Flipper support by default, improved dark mode support, moving Apple TV to [react-native-tvos](https://github.com/react-native-community/react-native-tvos), and more. See the [blog post](https://reactnative.dev/blog/2020/03/26/version-0.62) for all of the highlights. + +This release comes in the midst of a global pandemic. We’re releasing this version today to respect the work of hundreds of contributors who made this release possible and to prevent the release from falling too far behind master. Please be mindful of the reduced capacity of contributors to help with issues and prepare to delay upgrading if necessary. + +If you're upgrading, manual intervention may be required for your app. Please see the [upgrade-helper](https://react-native-community.github.io/upgrade-helper/) for a detailed breakdown of the changes required and see [this issue](https://github.com/react-native-community/releases/issues/179) for known issues. + +One known issue with workaround is regarding Android builds and [APK size increases](https://github.com/facebook/react-native/issues/28330). + +### Breaking + +- React DevTools v4 integration ([92a3c9da0a](https://github.com/facebook/react-native/commit/92a3c9da0a38870a8bad7c91bdc3ddb494f6e5f2) by [@bvaughn](https://github.com/bvaughn)) +- Remove `TextInput`'s `onTextInput` prop ([3f7e0a2c96](https://github.com/facebook/react-native/commit/3f7e0a2c9601fc186f25bfd794cd0008ac3983ab) by [@shergin](https://github.com/shergin)) +- Remove `TextInput`'s `inputView` prop ([1804e7cbea](https://github.com/facebook/react-native/commit/1804e7cbea707a35046118090966a54031edfae8) by [@TheSavior](https://github.com/TheSavior)) +- Animated: Remove `defaultProps` Parameter ([a70987cee2](https://github.com/facebook/react-native/commit/a70987cee24bcd027b9c4a5aa85dfd6a1aab74b3) by [@yungsters](https://github.com/yungsters)) +- Remove `TextInput`'s `selectionState` prop ([2becdfd404](https://github.com/facebook/react-native/commit/2becdfd4041f7f28138ba3a61c03e17c06dc2e50) by [@yungsters](https://github.com/yungsters)) +- Remove support for `framesToPop` ([8bc02fdd52](https://github.com/facebook/react-native/commit/8bc02fdd52124d0a24d96e4a61d7688328ef1660) [cf4d45ec2b](https://github.com/facebook/react-native/commit/cf4d45ec2bcd301be7793d5840de21ec7d02275b) [a483f802fd](https://github.com/facebook/react-native/commit/a483f802fddfd927f2baa0d95e2b4094d452cddd) by [@motiz88](https://github.com/motiz88)) +- Remove `TimePickerAndroid` ([dbf070c51e](https://github.com/facebook/react-native/commit/dbf070c51ecd14127a8317faa75cb661697b5a6b) by [@cpojer](https://github.com/cpojer)) +- Remove `scrollWithoutAnimationTo` from ScrollView ([c7e89909da](https://github.com/facebook/react-native/commit/c7e89909da70ac5290f9971080eb897567db3e43) by [@TheSavior](https://github.com/TheSavior)) +- Bump CLI to ^4.2.x ([be5088401f](https://github.com/facebook/react-native/commit/be5088401fd8e19d57adda42d275cab437448064) by [@alloy](https://github.com/alloy)) - for details on what v4 of the CLI improves on (like monorepo support), please refer to the [dedicated blog post](https://callstack.com/blog/react-native-cli-3-1-0-and-4-0-0-whats-new/) and the [release notes](https://github.com/react-native-community/cli/releases) +- Remove `accessibilityStates` property ([7b35f427fd](https://github.com/facebook/react-native/commit/7b35f427fd66cb0f36921b992095fe5b3c14d8b9) by [@marcmulcahy](https://github.com/marcmulcahy)) +- Upgraded to Hermes 0.4.0. If you're using ProGuard you will need to add the following rule to `proguard-rules.pro`: `-keep class com.facebook.jni.** { *; }` ([ab3c184555](https://github.com/facebook/react-native/commit/ab3c184555e382b8693cbfcdfe01ba89583ee726) by [@willholen](https://github.com/willholen)) + +#### Android specific + +- Fix setting keyboardType from breaking autoCapitalize ([233fdfc014](https://github.com/facebook/react-native/commit/233fdfc014bb4b919c7624c90e5dac614479076f) by [@safaiyeh](https://github.com/safaiyeh)) +- Limit size of video uploaded from camera roll in android (< 100 MB) ([d21f695edf](https://github.com/facebook/react-native/commit/d21f695edf367166a03af4c6e9376cd498b38665)) +- Remove "Reload on JS change" from RN Android ([478df155e7](https://github.com/facebook/react-native/commit/478df155e70a4ce30219adcac6f0801c4e4d10ec) by [@cpojer](https://github.com/cpojer)) + +### Added + +- Add support for Flipper by default ([multiple commits](https://github.com/facebook/react-native/pulls?q=is%3Apr+Flipper+is%3Aclosed)) +- Add `getNativeScrollRef` method to FlatList component ([bde1d63c85](https://github.com/facebook/react-native/commit/bde1d63c853630609b22c87121c125775dd1f5cb) by [@kacieb](https://github.com/kacieb)) +- Add missing accessibility props on Touchables ([8c0c860e38](https://github.com/facebook/react-native/commit/8c0c860e38f57e18296f689e47dfb4a54088c260) by [@xuelgong](https://github.com/xuelgong)) +- Added missing `console` polyfills in release builds. ([b7ab922bb3](https://github.com/facebook/react-native/commit/b7ab922bb3fd4f9f103e583bed9e9295a9521578) by [@yungsters](https://github.com/yungsters)) +- Platform.select now supports native as an option. ([a6fc0898de](https://github.com/facebook/react-native/commit/a6fc0898de990959d201b9665501deda215e41a4) by [@koke](https://github.com/koke)) +- Export the DevSettings module, add `addMenuItem` method ([cc068b0551](https://github.com/facebook/react-native/commit/cc068b055185e6fb7341bf945f69a74ed3ef4814) by [@janicduplessis](https://github.com/janicduplessis)) +- Expose RCTNetworking as a public 'Networking' API ([42ee5ec934](https://github.com/facebook/react-native/commit/42ee5ec93425c95dee6125a6ff6864ec647636aa) by [@adamchel](https://github.com/adamchel)) +- Add `useColorScheme` hook ([51681e80ab](https://github.com/facebook/react-native/commit/51681e80ab0d1efdaba684b626994b694d53d2a5) by [@hramos](https://github.com/hramos)) +- Add `unstable_enableLogBox` ([dd8e5f468a](https://github.com/facebook/react-native/commit/dd8e5f468a29e299647ffbd0887f53afd24936e3) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Expose Hermes Sampling Profiler ([15ecb60d6d](https://github.com/facebook/react-native/commit/15ecb60d6deb96fcb7b0ef70faccd10594ededa3) by [@axe-fb](https://github.com/axe-fb)) +- Add `error-subclass-name` lint rule ([6611c4b8f4](https://github.com/facebook/react-native/commit/6611c4b8f42520add983cc48fe4e14f7a02cc7cf) by [@motiz88](https://github.com/motiz88)) +- Add `HostComponent` to the public API of React Native ([a446a38aaa](https://github.com/facebook/react-native/commit/a446a38aaab5bea2e279f1958cfd90090bfd7e09) by [@TheSavior](https://github.com/TheSavior)) +- Add `RCTExceptionsManager.reportException` ([9a57145f52](https://github.com/facebook/react-native/commit/9a57145f52a03678da02d5d00cbe11eed3f5a0fc) by [@motiz88](https://github.com/motiz88)) +- Add `accessibilityValue` property ([7df3eea1a7](https://github.com/facebook/react-native/commit/7df3eea1a79f12c2dfff1976d0cef605a83232ec) by [@marcmulcahy](https://github.com/marcmulcahy)) +- Add `Appearance` module to expose the user's current Night theme preference ([17862a78db](https://github.com/facebook/react-native/commit/17862a78db59d60fe316961f9111efc330ba2abd) [63fa3f21c5](https://github.com/facebook/react-native/commit/63fa3f21c5ab308def450bffb22054241a8842ef) by [@hramos](https://github.com/hramos)) +- Add `onSlidingComplete` callbacks when sliders adjusted via a11y. ([c7aa6dc827](https://github.com/facebook/react-native/commit/c7aa6dc8270c0eabc913fe6c617c8131e3f4b3c5) by [@marcmulcahy](https://github.com/marcmulcahy)) + +#### Android specific + +- Implement `adjustsFontSizeToFit` on Android ([2c1913f0b3](https://github.com/facebook/react-native/commit/2c1913f0b3d12147654501f7ee43af1d313655d8) by [@janicduplessis](https://github.com/janicduplessis)) +- Allow overriding `EditText` construction in `ReactTextInputShadowNode` ([a5b5d1a805](https://github.com/facebook/react-native/commit/a5b5d1a805a9c54d325763b432be1cf2c8811dc9) by [@mchowning](https://github.com/mchowning)) +- Add Android support for `fontVariant` prop ([c2c4b43dfe](https://github.com/facebook/react-native/commit/c2c4b43dfe098342a6958a20f6a1d841f7526e48) by [@mcuelenaere](https://github.com/mcuelenaere)) +- Custom entry file on android using `ENTRY_FILE` environment variable ([a0d8740878](https://github.com/facebook/react-native/commit/a0d87408782fcf191988612198493d9130736c72)) +- Added `statusBarTranslucent` prop to Modal component ([c35a419e5d](https://github.com/facebook/react-native/commit/c35a419e5d2eca4fe9cd0939df085088fa88423b) by [@pfulop](https://github.com/pfulop)) +- Add `fadingEdgeLength` prop to FlatList and ScrollView ([51aacd5241](https://github.com/facebook/react-native/commit/51aacd5241c4b4c0b9b1e1b8f9dabac45e5b5291)) +- Support `removeClippedSubviews` for horizontal ScrollViews ([42152a3fa3](https://github.com/facebook/react-native/commit/42152a3fa3f949f5112461753eb44a436355dfb1)) +- Introducing `ReactCallerContextFactory` interface ([9713b63d9a](https://github.com/facebook/react-native/commit/9713b63d9ac1e1ae85accd86b78b351ac6295d01) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific + +- Added web socket support for macOS ([f21fa4ecb7](https://github.com/facebook/react-native/commit/f21fa4ecb73551bdc4c3d70db9fc13e93b19b3a6) by [@andymatuschak](https://github.com/andymatuschak)) +- Added Warning message Linking API with Phones in iOS Simulator ([e1d89fbd9d](https://github.com/facebook/react-native/commit/e1d89fbd9df91679ec36e955a3d0f699c2d5e777) by [@espipj](https://github.com/espipj)) +- Added missing deps for React-CoreModules ([15b2353382](https://github.com/facebook/react-native/commit/15b2353382c46dc5f0130ff44b9deb6a2361e3e5) by [@fkgozali](https://github.com/fkgozali)) +- Expose the `isPackagerRunning` methods on RCTBundleURLProvider ([fe9cba74fa](https://github.com/facebook/react-native/commit/fe9cba74fa6241b4c38a3df9481d3634ebd51bf9) by [@afoxman](https://github.com/afoxman)) +- Add `autoFocus` to TextInput ([6adba409e6](https://github.com/facebook/react-native/commit/6adba409e6256fd2dcc27a4272edcedae89927af) by [@janicduplessis](https://github.com/janicduplessis)) + +### Changed + +- Upgrade metro version to 0.56.3 ([4b487ba500](https://github.com/facebook/react-native/commit/4b487ba50025becb6a83c805b99d45651db6b8c1) by [@EssamEmad](https://github.com/EssamEmad)) +- Upgrade `eslint-plugin-relay` to 1.3.12 ([f0bcfbe9be](https://github.com/facebook/react-native/commit/f0bcfbe9be0eb6a06d096a682717a23e43c39d52) by [@jstejada](https://github.com/jstejada)) +- Upgrade to Flow v0.108.0 ([d34bc5fa64](https://github.com/facebook/react-native/commit/d34bc5fa64a54dfc2e780461ee2997a4b17f8c65) by [@mvitousek](https://github.com/mvitousek)) +- Upgrade metro babel preset ([cef001713f](https://github.com/facebook/react-native/commit/cef001713fc6384353bbcb4d45645ceee44ed1a9) by [@alloy](https://github.com/alloy)) +- TextInput now properly sends native the end selection location on change ([dff490d140](https://github.com/facebook/react-native/commit/dff490d140010913d3209a2f3e987914b9c4eee4) by [@TheSavior](https://github.com/TheSavior)) +- TextInput now uses `forwardRef` allowing it to be used directly by new APIs requiring a host component. ([bbc5c35a61](https://github.com/facebook/react-native/commit/bbc5c35a61cd3af47ccb2dc62430e4b6a4d4e08f) by [@TheSavior](https://github.com/TheSavior)) +- TextInput no longer does an extra round trip to native on focus/blur ([e9b4928311](https://github.com/facebook/react-native/commit/e9b4928311513d3cbbd9d875827694eab6cfa932) by [@TheSavior](https://github.com/TheSavior)) +- Render collapsed JavaScript frames in RedBox ([468d1a2d2e](https://github.com/facebook/react-native/commit/468d1a2d2e6c72d7c6d435ecaad8499997584de6) by [@motiz88](https://github.com/motiz88)) +- Enable `no-useless-escape` lint rule ([90977b0e00](https://github.com/facebook/react-native/commit/90977b0e00acc6b3263502017c27094392e89478) by [@motiz88](https://github.com/motiz88)) +- Update `DevSettings.reload` to accept a reason ([549cac63cb](https://github.com/facebook/react-native/commit/549cac63cb252037f73453c5d4e7ae5f15586607) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Move `react-native-implementation.js` to `index.js` ([e54ecf907e](https://github.com/facebook/react-native/commit/e54ecf907e9f0660d05dc807ec0e67127143ebed) by [@cpojer](https://github.com/cpojer)) +- Delete Long Press Error in Touchable ([9a3d722ccb](https://github.com/facebook/react-native/commit/9a3d722ccb523f227ffd7770a809996e6cfe75d9) by [@yungsters](https://github.com/yungsters)) +- Add Intl to eslint globals. ([f6a62f9ae2](https://github.com/facebook/react-native/commit/f6a62f9ae2278c0f3a1e5c1a6ec3b7cca3421a41)) +- Add WebSocket to eslint globals ([af8ea06bb4](https://github.com/facebook/react-native/commit/af8ea06bb44e84ce51d4ca4e76f0d66bf34323bd) by [@dr2009](https://github.com/dr2009)) +- Change default `accessibilityRole` of Switch component from `button` to `switch` ([36672c3851](https://github.com/facebook/react-native/commit/36672c3851a044a1ab0edcfaa2790c02f7909695) by [@alvinmatias69](https://github.com/alvinmatias69)) + +#### Android specific + +- Bump gradle-download-task to 4.0.2 ([088be260b6](https://github.com/facebook/react-native/commit/088be260b6727ba82167fe58cb1ee4410a6920b2) by [@dulmandakh](https://github.com/dulmandakh)) +- Bump Gradle to 6.0.1 ([701e66bde4](https://github.com/facebook/react-native/commit/701e66bde4ea0e404626c7805e2bcdfa0c129c05) by [@dulmandakh](https://github.com/dulmandakh)) +- Bump Gradle wrapper 5.6.4 ([928f4434b9](https://github.com/facebook/react-native/commit/928f4434b9829c90098b1626b03938d932a9c1f6) by [@friederbluemle](https://github.com/friederbluemle)) +- Bump Soloader to 0.8.0 ([614039834b](https://github.com/facebook/react-native/commit/614039834bf255de096f8b1d168832f81b0cf3fa)) +- Update Android Gradle plugin to 3.5.2 ([b41b5ce8ae](https://github.com/facebook/react-native/commit/b41b5ce8ae2902169ae58860da2c70a9233bea53) by [@friederbluemle](https://github.com/friederbluemle)) +- Improve exception message when JSC loading fails ([65d3167a80](https://github.com/facebook/react-native/commit/65d3167a802b2ca04d4f05ff972c2d51765f1e0d) by [@mhorowitz](https://github.com/mhorowitz)) +- Expose `addCookies` method ([cc845ccfb4](https://github.com/facebook/react-native/commit/cc845ccfb4c0f841b876bca55c5f70efd72be538) by [@safaiyeh](https://github.com/safaiyeh)) +- Migrated from libfb to libfbjni for JNI calls ([9ad5e72b77](https://github.com/facebook/react-native/commit/9ad5e72b77013083f925108870ea6b17f4711a1d) by [@passy](https://github.com/passy)) +- Formatted cpp/h code with clang-format ([d5ba113bb2](https://github.com/facebook/react-native/commit/d5ba113bb2cd839ea38768785e527fbbc9636e41) by [@passy](https://github.com/passy)) +- Switch MainActivity launchMode to singleTask ([7a42596438](https://github.com/facebook/react-native/commit/7a42596438018129d52ff04899ab4ddabd27cdcb) by [@dulmandakh](https://github.com/dulmandakh)) +- Changing method signatures for ImageLoaderModule to accept double for requestId ([641e9657dd](https://github.com/facebook/react-native/commit/641e9657ddab5d1b2676e98d86fd369372281d2c) by [@ejanzer](https://github.com/ejanzer)) +- Use Node's module resolution algorithm to find JSC & Hermes ([fc25f288fe](https://github.com/facebook/react-native/commit/fc25f288fe553cb7e8f04b8ce4b56297b7fa40d5) by [@ide](https://github.com/ide)) +- Add `ACCESS_BACKGROUND_LOCATION` to PermissionsAndroid ([8c099b5f53](https://github.com/facebook/react-native/commit/8c099b5f53405fe0806113ca7ccf0bbe1af92a21) by [@dulmandakh](https://github.com/dulmandakh)) + +#### iOS specific + +- Add `xcscheme` files for iOS template back in. ([a715decd2d](https://github.com/facebook/react-native/commit/a715decd2d3bcdab9537f3246c8398ad9869e94e) by [@pvinis](https://github.com/pvinis)) + +### Deprecated + +- Add deprecation warning to `AccessibilityInfo.fetch` ([523ab83338](https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a) by [@TheSavior](https://github.com/TheSavior)) +- Make setting `useNativeDriver` required. Add runtime warning if not specified ([5876052615](https://github.com/facebook/react-native/commit/5876052615f4858ed5fc32fa3da9b64695974238) by [@TheSavior](https://github.com/TheSavior)) +- Refs on an Animated component are now the internal component. The `getNode` call has been deprecated. ([66e72bb4e0](https://github.com/facebook/react-native/commit/66e72bb4e00aafbcb9f450ed5db261d98f99f82a) by [@yungsters](https://github.com/yungsters)) + +#### iOS specific + +- Deprecate `[bridge reload]`, prefer `RCTReloadCommand` ([ffe2306164](https://github.com/facebook/react-native/commit/ffe2306164ed7edfe5ab9d75b5122791037a852a) by [@PeteTheHeat](https://github.com/PeteTheHeat)) + +#### Android specific + +- Deprecate `CallerContext` from `ReactImageManager` ([8accd77c45](https://github.com/facebook/react-native/commit/8accd77c45a4b051bf02904c3485d6a0dcd27631) by [@mdvacca](https://github.com/mdvacca)) + +### Removed + +- Removing experimental `IncrementalPresenter` component ([0ef0d3167e](https://github.com/facebook/react-native/commit/0ef0d3167e291f31ce01ceb729df77cc679d2330) by [@TheSavior](https://github.com/TheSavior)) +- TouchableWithoutFeedback no longer exports Props. Use React.ElementConfig, instead. ([7bcae81299](https://github.com/facebook/react-native/commit/7bcae812997f669de5803cc781dcf3ea65baf0e9) by [@yungsters](https://github.com/yungsters)) +- Remove `Sample` and `CrashyCrash` Modules ([8ec7e0966c](https://github.com/facebook/react-native/commit/8ec7e0966cf83ed29a39aab47c686bc60a124983) by [@RSNara](https://github.com/RSNara)) +- Remove `propTypes` from Animated components. ([86d90c03eb](https://github.com/facebook/react-native/commit/86d90c03ebe39ebc4b2c6dcc0747b4f3a34f5f2f) by [@yungsters](https://github.com/yungsters)) +- Remove `propTypes` from TouchableHighlight. ([7c01172bef](https://github.com/facebook/react-native/commit/7c01172befd07f1d082b18993b87fc880e4b718f) by [@yungsters](https://github.com/yungsters)) +- Remove `propTypes` from TouchableNativeFeedback. ([2185dd298a](https://github.com/facebook/react-native/commit/2185dd298a788c2b713ea17878fd36e06205b4da) by [@yungsters](https://github.com/yungsters)) +- Remove `propTypes` from TouchableOpacity. ([88ae24f719](https://github.com/facebook/react-native/commit/88ae24f719d365b004696aff6461535188ca9f41) by [@yungsters](https://github.com/yungsters)) +- Remove `propTypes` from TouchableWithoutFeedback. ([ebf7d75816](https://github.com/facebook/react-native/commit/ebf7d758164873169937321a4dccc3782359a0d3) by [@yungsters](https://github.com/yungsters)) +- Remove `__skipSetNativeProps_FOR_TESTS_ONLY` from Animated components. ([dcd63078bd](https://github.com/facebook/react-native/commit/dcd63078bdab864830168005b940f638f1e08b23) by [@yungsters](https://github.com/yungsters)) +- Remove Apple TV Props ([548aad4ff1](https://github.com/facebook/react-native/commit/548aad4ff1dfef0d71bdd39aa83ad71e522a2546) by [@yungsters](https://github.com/yungsters)) + +#### Android specific + +- Remove `NativeRunnableDeprecated` ([973253af8a](https://github.com/facebook/react-native/commit/973253af8a47d9ebd137f554054e7a95f8ef2e45) by [@passy](https://github.com/passy)) +- Remove `com.facebook.react.modules.debug.NativeSourceCodeSpec` ([4d9e5f8481](https://github.com/facebook/react-native/commit/4d9e5f8481531000380cf4d3d485fcde1321a37b) by [@RSNara](https://github.com/RSNara)) + +### Fixed + +- Fix `require` cycle warning in ScrollResponder. ([674ac69cee](https://github.com/facebook/react-native/commit/674ac69cee7c1ce6096bee258880e79966322ee0) by [@Naturalclar](https://github.com/Naturalclar)) +- Restore behavior for `underlayColor={null}` in `TouchableHighlight`. ([37d8440a8e](https://github.com/facebook/react-native/commit/37d8440a8e35a53b81914e429502db527790b3cd) by [@yungsters](https://github.com/yungsters)) +- Fix stack traces showing the wrong function name in some cases ([60b4ba16c0](https://github.com/facebook/react-native/commit/60b4ba16c008c23959ebd27ea7215f83878d1343) by [@motiz88](https://github.com/motiz88)) +- Fix `requestAnimationFrame` when focusing input on mount ([5798cf2aa9](https://github.com/facebook/react-native/commit/5798cf2aa9b86bbcb40016aae14eca88fca19fde) by [@janicduplessis](https://github.com/janicduplessis)) +- Reduce overhead of setting up timers in DEV ([75a154b449](https://github.com/facebook/react-native/commit/75a154b4499e44b4ab31ccf28f9eb1dbf21578ac) by [@motiz88](https://github.com/motiz88)) +- Fixed an issue where margin and padding were resolved incorrectly. ([1d683faf1d](https://github.com/facebook/react-native/commit/1d683faf1dc89e4950e7e1f5c5a67f9a7ca1ee24) by [@SidharthGuglani](https://github.com/SidharthGuglani)) +- Fix using width for calculating margin top percent ([0599af2282](https://github.com/facebook/react-native/commit/0599af2282ffbf636604bce1cb4c049201fed393) by [@SidharthGuglani](https://github.com/SidharthGuglani)) +- Don't restore default values in NativeAnimated when components unmount ([686ab49107](https://github.com/facebook/react-native/commit/686ab49107df8ed20d4e810f1366715cd70b4a31) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix eslint-config peer dependency warnings ([1353da5a53](https://github.com/facebook/react-native/commit/1353da5a538d4a6f76fc9530711394cf981034a0) by [@friederbluemle](https://github.com/friederbluemle)) +- Remove style rules from eslint config for prettier options ([e4b62bb139](https://github.com/facebook/react-native/commit/e4b62bb139c258b65a9ebf2a8ee692ea52c3afab) by [@iRoachie](https://github.com/iRoachie)) +- Fix separators displays in wrong places with the inverted list ([dfb4f4af68](https://github.com/facebook/react-native/commit/dfb4f4af68726d2e05f63689a9c74c9bb9a0611b) by [@dy93](https://github.com/dy93)) +- Fix issue where we attempt to connect to React devtools every 2 seconds ([e7f6210d5d](https://github.com/facebook/react-native/commit/e7f6210d5d417c5b6d4ba7f5cf96b40dbf70b9cd) by [@ejanzer](https://github.com/ejanzer)) +- Fix so that early logs don't get dropped by Metro ([4ed05ca241](https://github.com/facebook/react-native/commit/4ed05ca241b791ad629fd154429a4a53c7731556) by [@gaearon](https://github.com/gaearon)) +- Fix to announce accessibility state changes happening in the background ([baa66f63d8](https://github.com/facebook/react-native/commit/baa66f63d8af2b772dea8ff8eda50eba264c3faf) by [@xuelgong](https://github.com/xuelgong)) +- Fix `JSBigString` not compiling on Windows due to Unix-specific headers ([80857f295c](https://github.com/facebook/react-native/commit/80857f295c17e5f8966b3d1c1207d3c4570a1b26) by [@empyrical](https://github.com/empyrical)) +- Fix exception in `scrollResponderScrollNativeHandleToKeyboard` when ref is null ([da8ae011bb](https://github.com/facebook/react-native/commit/da8ae011bbabc8acb7ef7f6903f68dd60aaa1f9d) by [@TheSavior](https://github.com/TheSavior)) +- Fix excessive toggles on the Switch component ([b782934f3f](https://github.com/facebook/react-native/commit/b782934f3f2a80ae7e3872cc7d7a610aa6680ec4) by [@rurikoaraki](https://github.com/rurikoaraki)) +- Fix bare hosts in `URL`. Add missing / between url ([20ab946f34](https://github.com/facebook/react-native/commit/20ab946f34b1d9727ff08c733b2006e84fd79349) by [@jeswinsimon](https://github.com/jeswinsimon)) +- Fix the non-standard usage of `ATOMIC_VAR_INIT` macro from code with systrace enabled ([75a7a52db4](https://github.com/facebook/react-native/commit/75a7a52db496bd3892a367372eea25bf50840fc3)) +- Fix `useWindowDimensions` hook firing continuously after dimensions change ([3b3c95b017](https://github.com/facebook/react-native/commit/3b3c95b0170e60983eb6e89b910d100d08eee141) by [@dulmandakh](https://github.com/dulmandakh)) +- Fix throttling in ScrollView ([4159e20146](https://github.com/facebook/react-native/commit/4159e201462c346c456de1fa869d88a9cce7b6d4) by [@sammy-SC](https://github.com/sammy-SC)) +- Fix `TimingAnimation` rounding error issue ([77b6e26538](https://github.com/facebook/react-native/commit/77b6e2653835af61b186903eae45d67f35351ade) by [@MartinSherburn](https://github.com/MartinSherburn)) +- Fix recycling of Switch ([a261e6dfb2](https://github.com/facebook/react-native/commit/a261e6dfb2680a955943db53c4b0a7bb887bfe22) by [@sammy-SC](https://github.com/sammy-SC)) + +#### Android specific + +- Fix to reset sMatrixDecompositionContext before applying transformations ([bf01dfbc97](https://github.com/facebook/react-native/commit/bf01dfbc97ea8be9d88214ab31809f2f42d6c064) by [@makovkastar](https://github.com/makovkastar)) +- Fix animations in OSS debug builds by modifying `Platform.isTesting()` behavior ([1fbc6a7c17](https://github.com/facebook/react-native/commit/1fbc6a7c178d13421b0b84d6ea01f9174105325f) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Fix Modal not disappearing when reloading ([5ddf00ee1a](https://github.com/facebook/react-native/commit/5ddf00ee1acbf66c7204227c398a58c13e4545cf) by [@sunnylqm](https://github.com/sunnylqm)) +- Fix to support nullable returns NativeModule methods returning Boxed Primitives ([f57b0caaa4](https://github.com/facebook/react-native/commit/f57b0caaa4452c64006c159cd28a1a562b332c21) by [@RSNara](https://github.com/RSNara)) +- Fix crash in TextInput ([6ebd3b046e](https://github.com/facebook/react-native/commit/6ebd3b046e5b71130281f1a7dbe7220eff95d74a) by [@MarcoPolo](https://github.com/MarcoPolo)) +- Fix View.getGlobalVisibleRect() to clip result rect properly when overflow is 'hidden' ([df9abf7983](https://github.com/facebook/react-native/commit/df9abf798351c43253c449fe2c83c2cca0479d80) by [@davidbiedenbach](https://github.com/davidbiedenbach)) +- Fix throwing "Unknown array type" exception ([4b9350061f](https://github.com/facebook/react-native/commit/4b9350061fa3d186fdd3a973e1b46f60a7ac03b9) by [@petterh](https://github.com/petterh)) +- Fix issue with refresh control not working properly on an inverted ScrollView ([0a282c42b4](https://github.com/facebook/react-native/commit/0a282c42b4d1c2316513cd5588a0a92b54db2991) by [@migbot](https://github.com/migbot)) +- Fix to listen to NFC actions for linking url events ([8d8c3d4e1e](https://github.com/facebook/react-native/commit/8d8c3d4e1eb88366074e87385c4d96a46dfdd544) by [@cimitan](https://github.com/cimitan)) +- Fix onPress prop for Touchable Components being called twice on AndroidTV. ([21890e964d](https://github.com/facebook/react-native/commit/21890e964df7674fcf13cefc8cb939441f6eddef) by [@dbarr33](https://github.com/dbarr33)) +- Fix `includeFontPadding` for `TextInput` placeholder ([211ea485cd](https://github.com/facebook/react-native/commit/211ea485cd993ca25d6640be41e54f327ca1629c) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix medium font weights for TextInput on Android ([8b9f790069](https://github.com/facebook/react-native/commit/8b9f7900697b2e4bb72b37ed2e6c3d113185d327) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix close button issue in KeyboardAvoidingView ([f1c6029e48](https://github.com/facebook/react-native/commit/f1c6029e4868084e5a10d81c15ee3cc5e301599a) by [@saxenanickk](https://github.com/saxenanickk)) +- Fix activity recreation on theme change ([83a16b16c9](https://github.com/facebook/react-native/commit/83a16b16c9afa0fe0328ab818470d4fce098876b) by [@Esemesek](https://github.com/Esemesek)) +- Fix ForwardingCookieHandler missing WebView exceptions. ([314eba98b2](https://github.com/facebook/react-native/commit/314eba98b2f2755cb26ed7a268d3fe83a7626efa) by [@siddhantsoni](https://github.com/siddhantsoni)) +- Fix ReactInstanceManagerBuilder.build crashing if SoLoader has not been explicitly initialized ([60e00d9d96](https://github.com/facebook/react-native/commit/60e00d9d96d7b186c1d4c1542caddc1b74eeb3da) by [@petterh](https://github.com/petterh)) +- Fix default accessibility hint not being read. ([f8dff0bcb3](https://github.com/facebook/react-native/commit/f8dff0bcb3147b7a1aa8ac7159952d848e198e29)) +- Fix JS bundle loading progress bar ([7b9d6d19e2](https://github.com/facebook/react-native/commit/7b9d6d19e2c0854aa53587ef68ce715fb7803e2a) by [@makovkastar](https://github.com/makovkastar)) +- Fix Android Q related NaN error - don't try to do math with NaN values ([db5994980d](https://github.com/facebook/react-native/commit/db5994980df136c5cce6cd90348b4bf18180562f)) +- Fix throwing exceptions when the host activity is not FragmentActivity ([7cfabf42b8](https://github.com/facebook/react-native/commit/7cfabf42b816de758d8e52896bbab0c50e3a802a) by [@mganandraj](https://github.com/mganandraj)) +- Fix crash when using `TextInput.FontVariant` prop in Android API level < 26 ([e885ddedb9](https://github.com/facebook/react-native/commit/e885ddedb9b0a025cb8031414dcc4bd22744a0eb) by [@mdvacca](https://github.com/mdvacca)) + +#### iOS specific + +- Fix support for `onRequestClose` in Modal on iOS 13+ ([8e5fac89bb](https://github.com/facebook/react-native/commit/8e5fac89bbdcc3028bb5d81a358969a235abf991) by [@koke](https://github.com/koke)) +- Fix `Dimensions` module to update on initial split screen ([7a72c35a20](https://github.com/facebook/react-native/commit/7a72c35a20a18c19bf6ab883cb2c53a85bd4c5c0) by [@sahrens](https://github.com/sahrens)) +- Fix spinner visibility on `beginRefreshingProgrammatically` ([e341489521](https://github.com/facebook/react-native/commit/e341489521ad495e68e8aba01ff4dd25a5e4ff3e) by [@nnabinh](https://github.com/nnabinh)) +- Reconnect to debugger websocket after Metro is restarted. ([13992f90e4](https://github.com/facebook/react-native/commit/13992f90e48fc11e0b7217ee6d9413f97c32268a) by [@rickhanlonii](https://github.com/rickhanlonii)) +- Fix Slider not disabling properly if the disabled prop is set. ([fa9ff07017](https://github.com/facebook/react-native/commit/fa9ff07017edbc76595fe2f2d964ee13c5f4088a)) +- Fix apps crashing on iOS 13.x when running timer in the background ([e1d03b4cc0](https://github.com/facebook/react-native/commit/e1d03b4cc00c361e10687eb4a9f902563cd1cbe1) by [@radko93](https://github.com/radko93)) +- Fix TextInput blur when tabbing in iOS simulator. ([a7437710d2](https://github.com/facebook/react-native/commit/a7437710d25adfc9150fc079e4525ed59d5404e2) by [@fat](https://github.com/fat)) +- Fix promised returned by `Share.share(content, options)` not resolving if share dialog dismissed ([7468a6c903](https://github.com/facebook/react-native/commit/7468a6c9033ffe8cc2315a3de3a759b8745fe43d) by [@v-fernandez](https://github.com/v-fernandez)) +- Fix maximum searching depth while measuring layout by removing it. ([2f8328dbb0](https://github.com/facebook/react-native/commit/2f8328dbb0d9813c904c0b888b2b7500cf4a4bce) by [@draws](https://github.com/dratwas)) +- Fix SafeAreaInsets call to not crash on older versions of iOS ([03acf57b76](https://github.com/facebook/react-native/commit/03acf57b767553acbee4ff589055fbd239ffffbb) by [@mmmulani](https://github.com/mmmulani)) +- Fix to retain `cropData` struct arg in ImageEditingManager.cropImage call ([002d3c179d](https://github.com/facebook/react-native/commit/002d3c179dd2515f0a4d894d9b7f70c4e538f728) by [@RSNara](https://github.com/RSNara))) +- Fix bug rendering nested text on iOS13 ([06599b3e59](https://github.com/facebook/react-native/commit/06599b3e594355a1d5062ede049ff3e333285516) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Fix longstanding bug where RCTNullIfNil() can return nil ([79b573511b](https://github.com/facebook/react-native/commit/79b573511bd55e6c82c0044e1930549ccfa8a923) by [@PeteTheHeat](https://github.com/PeteTheHeat)) +- Fix crash in RCTScrollViewComponentView ([e7ef9921d3](https://github.com/facebook/react-native/commit/e7ef9921d3f91b02cfec4bbfd88b4968434e201c) by [@shergin](https://github.com/shergin)) +- Fix how the amount of free memory is calculated to mimic the logic Apple uses. ([b53d3d80f9](https://github.com/facebook/react-native/commit/b53d3d80f991937915a87ba8515f403551de139e)) +- Fix animated gifs incorrectly looping ([6f2e6f170e](https://github.com/facebook/react-native/commit/6f2e6f170e3ee785d1ba844971447ea24f91185e) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix `tintColor` in SegmentedControlIOS component ([be89e4d928](https://github.com/facebook/react-native/commit/be89e4d928a504de304f5afb19bd3cc15ae3eb7d) by [@sammy-SC](https://github.com/sammy-SC)) + +## v0.61.5 + +This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/151) to improve the quality of the 0.61 release. Thanks to everyone who contributed! + +### Fixes + +#### Android specific + +- Fix bundling assets in monorepo ([a3b0804867](https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) by [@Esemesek](https://github.com/Esemesek)) +- Fix multiple `set-cookie` not aggregated correctly in response headers ([1df8bd4932](https://github.com/facebook/react-native/commit/1df8bd4932f42958c01dccf44cee92b75a6988ed) by **Vincent Cheung**) + +## v0.61.4 + +This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/150) to improve the quality of the 0.61 release. Thanks to everyone who contributed! + +### Fixed + +- Fix build with Hermes on Windows ([81a6b6ed3c](https://github.com/facebook/react-native/commit/81a6b6ed3c54498f6f2148c106846352405949bf) by [@B27](https://github.com/B27)) +- Fix Chrome debugger showing console.logs at incorrect locations ([42ac240bce](https://github.com/facebook/react-native/commit/42ac240bceb104474494c6007df0089baec00f7a) by [@rickhanlonii](https://github.com/rickhanlonii)) + +#### iOS specific + +- Fix bug in iOS 13 when application would be terminated immediately when in background ([d7c9173b07](https://github.com/facebook/react-native/commit/d7c9173b07171164bcadf73855454e90e07b31be) by [@radko93](https://github.com/radko93)) + +## v0.61.3 + +This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/148) to improve the quality of the 0.61 release. Thanks to everyone who contributed! + +### Fixed + +- Fix bug where ScrollView contentInset top set to undefined wouldn't default to 0 ([d576a5bcc0](https://github.com/facebook/react-native/commit/d576a5bcc0e03dd9c4ccd982f723d6e376e5b680) by [TheSavior](https://github.com/TheSavior)) +- Fix TimingAnimation rounding error issue ([bfd01552af](https://github.com/facebook/react-native/commit/bfd01552af6c074a425da2e7cc1a5908faba2644) by [MartinSherburn](https://github.com/MartinSherburn)) + +#### iOS specific + +- Fix selecting videos from library in iOS 13 ([63769518e0](https://github.com/facebook/react-native/commit/63769518e0c7db60eb39bb5f47fe24f4bc664862) by [fatalsun](https://github.com/fatalsun)) +- Fix bug in iOS13 nested text rendering ([7cf43afa8d](https://github.com/facebook/react-native/commit/7cf43afa8d6a03ccb4cfdc09f81891eabe8b8b70) by [PeteTheHeat](https://github.com/PeteTheHeat)) + +#### Android specific + +- Release underlying resources when JS instance is GC'ed on Android try ([9b2374b542](https://github.com/facebook/react-native/commit/9b2374b542f87b7baefcfb4a3eb4f57029069b57) by [janicduplessis](https://github.com/janicduplessis)) + +## v0.61.2 + +This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/146) to improve the quality of the 0.61 release. Thanks to everyone who contributed! + +### Fixed + +#### Android specific + +- Fix elevation issues on Android ([8fd9ab2f54](https://github.com/facebook/react-native/pull/26682) by [@grabbou](https://github.com/grabbou)) + +### Added + +- Use `warnOnce` for excessive number of callbacks error ([0cafa0f5d1](https://github.com/facebook/react-native/commit/0cafa0f5d1e7fa5369b765f4b97f38bf1608230a) by [@janicduplessis](https://github.com/anicduplessis)) +- Include transform in OUTER_PROPS ([b94438](https://github.com/facebook/react-native/commit/b94438) by [@migbot](https://github.com/migbot)) + +#### iOS specific + +- Better iOS13 support in `StatusBar` API ([796b3a1f88](https://github.com/facebook/react-native/commit/796b3a1f8823c87c9a066ea9c51244710dc0b9b5) by [@gaodeng](https://github.com/gaodeng)) + +#### Android specific + +- Improve error message in NativeModuleRegistryBuilder ([113c4e229c](https://github.com/facebook/react-native/commit/113c4e229c374232c46a89afd74df7117a3447c1) by [@vonovak](https://github.com/vonovak)) + +## v0.61.1 + +This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/144) to improve the quality of the 0.60 release. Thanks to everyone who contributed! + +### Fixed + +#### iOS specific + +- Fix ShareSheet crash on iOS 13 ([a4fbb8e75b](https://github.com/facebook/react-native/commit/a4fbb8e75bd9f521037926a68a8b75eaca2eca74) by [@tomtargosz](https://github.com/tomtargosz)) + +#### Android specific + +- Allow again for injecting custom root view via ReactActivityDelegate ([9f0dede1c9](https://github.com/facebook/react-native/commit/9f0dede1c913612e1241432f4cbccdc74d23a1e4) by [@kmagiera](https://github.com/kmagiera)) + +## v0.61.0 + +This is a major release that includes the new reloading experience Fast Refresh. It also removes the React `.xcodeproj`, fixes `use_frameworks!` for CocoaPods support, adds a `useWindowDimensions` hook, and upgrades to React 16.9. + +### Added + +- Add Fast Refresh by default ([17f8e5810f](https://github.com/facebook/react-native/commit/17f8e5810f3260ce1b24c61665883bab8847aabe) by [@gaearon](https://github.com/gaearon)) +- Add `useWindowDimensions` hook to replace most `Dimensions` usage ([103ec2f770](https://github.com/facebook/react-native/commit/103ec2f770dbb785ef4bc26f8662c74edded796a) by [@sahrens](https://github.com/sahrens)) + +#### Android specific + +- Add exception in .gitignore for `debug.keystore` to the android template. ([d55025694b](https://github.com/facebook/react-native/commit/d55025694be8b4ee5d09c8fdc910d42a5f144883) by [@bondehagen](https://github.com/bondehagen)) +- Add jitpack repository to template ([1a92cf9b2a](https://github.com/facebook/react-native/commit/1a92cf9b2afa718a81299b4be5ab6bdff16f4863) by [@iyegoroff](https://github.com/iyegoroff)) + +#### iOS specific + +- Add RCTWeakProxy to properly deallocate RCTUIImageViewAnimated ([947e71a922](https://github.com/facebook/react-native/commit/947e71a922c0db5d3d3780d249d1a8d183534c22) by [@mmmulani](https://github.com/mmmulani)) + +### Changed + +- Use prettyFormat for Metro logging ([abd7faf354](https://github.com/facebook/react-native/commit/abd7faf3547e165abfc52383d3709b9d4d2e9006) by [@cpojer](https://github.com/cpojer)) +- Tweak messages and fix the warning condition ([2a3ac0429b](https://github.com/facebook/react-native/commit/2a3ac0429b0e4c443d185807a39b41fc5a2ab1d2) by [@gaearon](https://github.com/gaearon)) +- Allow jest globals in **mocks** directories ([e78c01375a](https://github.com/facebook/react-native/commit/e78c01375aef88e0bb4029479acac9e85ecaf080) by [@artdent](https://github.com/artdent)) +- Make Animation EndCallback type allow any return value ([306c8d64d9](https://github.com/facebook/react-native/commit/306c8d64d91f87b248f627333de7f24355248088) by [@draperunner](https://github.com/draperunner)) +- create two layout pass reason flexLayout and flexMeasure instead of flex ([6ce985463b](https://github.com/facebook/react-native/commit/6ce985463b2724451baed8b0486b298f969e36e7) by [@SidharthGuglani](https://github.com/SidharthGuglani)) +- Use shorthand for Fragment in App.js ([7cac6a4b6c](https://github.com/facebook/react-native/commit/7cac6a4b6cfa8c1b54db62f2b1510f7c52f4574d) by [@ferdicus](https://github.com/ferdicus)) +- Use eslint-plugin-prettier recommended config ([d2b92fffb1](https://github.com/facebook/react-native/commit/d2b92fffb1d14dd0ec628e9dcdfd76e39f2067ff) by [@Justkant](https://github.com/Justkant)) +- Support string command arguments ([0314305e12](https://github.com/facebook/react-native/commit/0314305e1202e48c74091e15da8574f1b92ce441) by [@TheSavior](https://github.com/TheSavior)) +- chore: Link to CLA wiki and CLA form. ([e2d55d5c5e](https://github.com/facebook/react-native/commit/e2d55d5c5ef40ccae3220dc0e1fca7cf3592c676) by [@JustinTRoss](https://github.com/JustinTRoss)) +- CLI is now ^3.0.0-alpha.1 ([5edd1c674c](https://github.com/facebook/react-native/commit/5edd1c674c911a6c59aaad8ed36ce12fa98787ff) by [@thymikee](https://github.com/thymikee)) +- Flow is now v0.104.0 ([59db059dbd](https://github.com/facebook/react-native/commit/59db059dbddb8101212f3739eecf0db494cfab41) by [@mroch](https://github.com/mroch)) +- React is now at 16.9 ([40e8a5f685](https://github.com/facebook/react-native/commit/40e8a5f685376300aa5365de4557cd395996b9a2), [0ccedf3964](https://github.com/facebook/react-native/commit/0ccedf3964b1ebff43e4631d1e60b3e733096e56) by [@TheSavior](https://github.com/TheSavior)) +- Use Metro for auto-collapsing internal stack frames ([77125a1ac3](https://github.com/facebook/react-native/commit/77125a1ac364a6b7e2382fdc86cc19a3e2eba089) by [@motiz88](https://github.com/motiz88)) +- Move React error message formatting into ExceptionsManager ([2dadb9e2b0](https://github.com/facebook/react-native/commit/2dadb9e2b0ba26223ed83a30af620ce3e62e245f) by [@motiz88](https://github.com/motiz88)) +- Improve VirtualizedList error message ([bef87b648c](https://github.com/facebook/react-native/commit/bef87b648c4bed228f1c5889abe0181a271edf76) by [@vonovak](https://github.com/vonovak)) + +#### Android specific + +- Bump Hermes to v0.2.1 ([811401bcac](https://github.com/facebook/react-native/commit/811401bcac02f3e6e154c7e0f76f9f82eeaa6959) by [@sunnylqm](https://github.com/sunnylqm)) +- Use centralized package for DoNotStrip annotation ([35fc0add2d](https://github.com/facebook/react-native/commit/35fc0add2d3a278bf90257284fe23e03898008de) by [@passy](https://github.com/passy)) + +#### iOS specific + +- Do not override ActivityIndicator color when setting its size ([14b0ed4c5d](https://github.com/facebook/react-native/commit/14b0ed4c5d872cd992f6e1ca072a2c44c8ece25f) by [@cabelitos](https://github.com/cabelitos)) +- fix display problems when image fails to load ([71d7d6883c](https://github.com/facebook/react-native/commit/71d7d6883cb9a3d18666f04a444de7b4a611b304)) +- Renamed yoga podspec to Yoga ([82a8080f07](https://github.com/facebook/react-native/commit/82a8080f0704e83079d0429e4e367f5131052e64) by [@axe-fb](https://github.com/axe-fb)) +- Update loading pre-bundled message ([eb92f8181f](https://github.com/facebook/react-native/commit/eb92f8181f3119bbc69ff7cb5aff2e03d993b8b3) by [@rickhanlonii](https://github.com/rickhanlonii)) + +### Deprecated + +- Deprecate method UIManagerModule.playTouchSound() ([e3ec8dbe15](https://github.com/facebook/react-native/commit/e3ec8dbe15a07e86530e1fd801c27ad8c1023b5c) by [@mdvacca](https://github.com/mdvacca)) +- Deprecate UIManager.measureLayoutRelativeToParent ([e42009b784](https://github.com/facebook/react-native/commit/e42009b7849f1cfd6d6d34e28c564ec5e39680bb) by [@mdvacca](https://github.com/mdvacca)) + +#### Android specific + +- DrawerLayoutAndroid drawerPosition now expects a string, number is deprecated ([305b0a2814](https://github.com/facebook/react-native/commit/305b0a28142414d559d2d08795a5963716dc4b0f) by [@TheSavior](https://github.com/TheSavior)) + +### Removed + +#### Android specific + +- Remove supportLibVersion variable in build.gradle ([fee7f0617e](https://github.com/facebook/react-native/commit/fee7f0617ee6e4f10edf6b8e36da6c5fb00d22ac) by [@ferdicus](https://github.com/ferdicus)) + +#### iOS Specific + +- Remove 's.static_framework = true' requirement for podspec ([ca9e108110](https://github.com/facebook/react-native/commit/ca9e108110e4a3cc39044805f879d9a9cb637c41) by [@jtreanor](https://github.com/jtreanor)) + +### Fixed + +- Add ErrorUtils to eslint globals ([76af5f9163](https://github.com/facebook/react-native/commit/76af5f916303d7906ea522076c965292145a1370) by [@rodineijf](https://github.com/rodineijf)) +- URL: Do not prepend baseUrl if the URL is not a relative URL ([e104204ae0](https://github.com/facebook/react-native/commit/e104204ae083d31e0b9967373ce79f2f1ca8fbb6) by [@jeswinsimon](https://github.com/jeswinsimon)) +- Memory Leak due to JSStringRelease not called ([b8d6ef3726](https://github.com/facebook/react-native/commit/b8d6ef372663fe6d467144abfc5d2c9352dc28d6) by [@sachinservicemax](https://github.com/sachinservicemax)) +- Fixed rotateZ native animation ([f4f08d3c54](https://github.com/facebook/react-native/commit/f4f08d3c549f2af7cd04ef78fe800d3bc12af1f0) by [@Titozzz](https://github.com/Titozzz)) +- Fix indentation in Gradle files ([9b0adb5ad1](https://github.com/facebook/react-native/commit/9b0adb5ad132b8ff37e707a4943411d92b4e58dc) by [@sonicdoe](https://github.com/sonicdoe)) +- Fix handling of failed image downloads ([71d7d6883c](https://github.com/facebook/react-native/commit/71d7d6883cb9a3d18666f04a444de7b4a611b304) by [@sammy-SC](https://github.com/sammy-SC)) +- Fix SectionList scrollToLocation and prevent regressions ([8a82503b54](https://github.com/facebook/react-native/commit/8a82503b54e3c63230a07de99ec082b2dcb54bc7) by [@vonovak](https://github.com/vonovak)) +- [General][internal] Fix incorrect `module.name_mapper` in template .flowconfig ([e6b2cf0418](https://github.com/facebook/react-native/commit/e6b2cf04188fc9647bae4bef4cca5d4dde22a657) by [@MoOx](https://github.com/MoOx)) +- Fall back to `JSON.stringify` in `console.log` if Symbol is unavailable ([179889704b](https://github.com/facebook/react-native/commit/179889704b6f9d56cb990d5b9bba6ee5ea2cd13f) by [@cpojer](https://github.com/cpojer)) +- Pop frames correctly in console.error handler ([3eaf245540](https://github.com/facebook/react-native/commit/3eaf2455402b5ad73c8a059311f0cb213df9dd28) by [@motiz88](https://github.com/motiz88)) +- Add documentation to TextInput's Flow types ([d00f0882fb](https://github.com/facebook/react-native/commit/d00f0882fbdd532f8698d2569bd771ca5843d0f5) by [@empyrical](https://github.com/empyrical)) + +#### Android specific + +- Add missing Hermes include ([1db96a3c46](https://github.com/facebook/react-native/commit/1db96a3c469b872e851553207e5420d54afc731a) by [@janicduplessis](https://github.com/janicduplessis)) +- Fix UIManager.measure to consider scale and rotation transforms ([28d50189f3](https://github.com/facebook/react-native/commit/28d50189f3350e7550bf03ea5bd1363839ee2911) by [@floriancargoet](https://github.com/floriancargoet)) + +#### iOS specific + +- Fixed iOS packager connection ([4ab9da134c](https://github.com/facebook/react-native/commit/4ab9da134c988db832b1a2daa90ce38bf8c419eb) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fixed compatibility with CocoaPods frameworks. ([8131b7bb7b](https://github.com/facebook/react-native/commit/8131b7bb7b4794e0e7003a6e3d34e1ebe4b8b9bc) by [@jtreanor](https://github.com/jtreanor)) +- Don't call sharedApplication in App Extension ([c5ea18f738](https://github.com/facebook/react-native/commit/c5ea18f7389fe821e7a9882e4b1b30b0a1b266f4) by [@zhongwuzw](https://github.com/zhongwuzw)) + +## v0.60.6 + +This is a small patch release with a commit to fix the build break in MSVC to help the users of react-native-windows. ([9833ee7bc1](https://github.com/facebook/react-native/commit/9833ee7bc19982acd6ccaf6ac222bc24a97667a8) by [@acoates-ms](https://github.com/acoates-ms)) + +## v0.60.5 + +This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/130) to improve the quality of the 0.60 release. Thanks to everyone who contributed! + +### Added + +- Added a default Prettier config for new projects ([7254bab0b3](https://github.com/facebook/react-native/commit/7254bab0b3fa129cd238783ab993fbae1102d60a) by [@jpdriver](https://github.com/jpdriver)) + +#### Android specific + +- Add showSoftInputOnFocus to TextInput ([d88e4701fc](https://github.com/facebook/react-native/commit/d88e4701fc46b028861ddcfa3e6ffb141b3ede3d)) + +### Changed + +- Bump CLI to ^2.6.0 ([fafe5ee072](https://github.com/facebook/react-native/commit/fafe5ee0726061e3590b91d3b5cff04e33781f87) by [@thymikee](https://github.com/thymikee)) + +### Fixed + +- Ensure right version of Metro bundler is used ([1bb197afb1](https://github.com/facebook/react-native/commit/1bb197afb191eab134354386700053914f1ac181) by [@kelset](https://github.com/kelset)) + +#### Android specific + +- Fix `ClassNotFound` exception in Android during Release builds ([ffdf3f22c6](https://github.com/facebook/react-native/commit/ffdf3f22c68583fe77517f78dd97bd2e97ff1b9e) by [@thecodrr](https://github.com/thecodrr)) +- Remove unnecessary flag when running JS server ([a162554f5d](https://github.com/facebook/react-native/commit/a162554f5dc36fa0647b5bf52119a62bd20046e3) by [@thecodrr](https://github.com/thecodrr)) +- Correctly set the border radius on android ([b432b8f13b](https://github.com/facebook/react-native/commit/b432b8f13b4871dcafd690e57d37298662712b50) by [@cabelitos](https://github.com/cabelitos)) +- Fix addition of comma at the end of accessibility labels on Android. ([812abfdbba](https://github.com/facebook/react-native/commit/812abfdbba7c27978a5c2b7041fc4a900f3203ae) by [@marcmulcahy](https://github.com/marcmulcahy)) + +#### iOS specific + +- Don't call sharedApplication in App Extension ([c5ea18f738](https://github.com/facebook/react-native/commit/c5ea18f7389fe821e7a9882e4b1b30b0a1b266f4) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Delete fishhook ([46bdb4161c](https://github.com/facebook/react-native/commit/46bdb4161c84b33f1d0612e9c7cdd824462a31fd) by [@mmmulani](https://github.com/mmmulani)) + +You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/130). + +## v0.60.4 + +This is a patch release that contains two more Hermes related fixes, thanks to the contributors for helping improving the support! + +### Fixed + +#### Android specific + +- Generate correct source map if hermes not enabled ([b1f81be4bc](https://github.com/facebook/react-native/commit/b1f81be4bc21eb9baa39dd7ef97709d9927ad407) by [@HazAT](https://github.com/HazAT)) +- Generate source maps outside of assets/ ([60e75dc1ab](https://github.com/facebook/react-native/commit/60e75dc1ab73b2893ec2e25c0320f32b3cf12b80) by [@motiz88](https://github.com/motiz88)) + +You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/130). + +## v0.60.3 + +This is a patch release that fixes the binary path to Hermes package, thanks to [@zoontek](https://github.com/zoontek)) for creating the PR! + +You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/130). + +## v0.60.2 + +This is a patch release that fixes the path to Hermes package. + +You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/130). + +## v0.60.1 + +This is a patch release that includes the Hermes JavaScript Engine announced at Chain React Conf 2019. + +Check out the documentation to opt-in and give [Hermes a try](https://reactnative.dev/docs/hermes). + +You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/130). + +## v0.60.0 + +This feature release of React Native includes many milestone changes for the platform. Please refer to the [blog post](https://reactnative.dev/blog/2019/07/03/version-60) for selected details. For upgrading users, some of the progress comes with breaking changes; manual intervention may be required for your app. We're also aware that existing CocoaPods integrations using `use_frameworks` are not out-of-the-box compatible with this version, but please consider [various workarounds](https://github.com/facebook/react-native/issues/25349) while we prepare a long-term solution for a future release. If you're interested in helping evaluate our next release (0.61), subscribe to the dedicated issue [here](https://github.com/react-native-community/react-native-releases/issues/130). + +Have you ever considered contributing to React Native itself? Be sure to check out [Contributing to React Native](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md). + +### Added + +- CLI autolinking support ([5954880875](https://github.com/facebook/react-native/commit/5954880875d8dfb9b7868aa316647f8fe2b3d8c3), [da7d3dfc7d](https://github.com/facebook/react-native/commit/da7d3dfc7d3bd83e7522175a720b30fee4c9b3d3) by [@zhongwuzw](https://github.com/zhongwuzw) and [@hramos](https://github.com/hramos)) +- New Intro screen ([6b393b27e1](https://github.com/facebook/react-native/commit/6b393b27e18e663d39b66fd121ee302bce29d77d), [233fddbe01](https://github.com/facebook/react-native/commit/233fddbe012098dce3719ba066d3dc653e05e6c9), [fe88e9e48c](https://github.com/facebook/react-native/commit/fe88e9e48ce99cb8b9da913051cc36575310018b), [aa926e349b](https://github.com/facebook/react-native/commit/aa926e349b1656b02b8c1a2048cc56b25f9567c1), [a9e8a71e53](https://github.com/facebook/react-native/commit/a9e8a71e531510baf126780cecdcbc64c934f4dd), [ad4a5d9a3e](https://github.com/facebook/react-native/commit/ad4a5d9a3eac9794038e93158d45e7f1ceb9e495), and [0245fd713e](https://github.com/facebook/react-native/commit/0245fd713ea9ff6fe334980f537e2254a9e3126c) by [@cpojer](https://github.com/cpojer), [@eliperkins](https://github.com/eliperkins), [@lucasbento](https://github.com/lucasbento), [@orta](https://github.com/orta), [@adamshurson](https://github.com/adamshurson), [@karanpratapsingh](https://github.com/karanpratapsingh) and [@glauberfc](https://github.com/glauberfc)) +- Add enhanced accessibility actions support ([7fb02bd908](https://github.com/facebook/react-native/commit/7fb02bd90884f0a717e8151d4d30767fe38392c1) by [@xuelgong](https://github.com/xuelgong)) +- Add additional accessibility roles and states ([1aeac1c625](https://github.com/facebook/react-native/commit/1aeac1c62528004d994200664368dc85fba1795d)) +- Add `isReduceMotionEnabled()` plus `reduceMotionChanged` to `AccessibilityInfo` ([0090ab32c2](https://github.com/facebook/react-native/commit/0090ab32c2aeffed76ff58931930fe40a45e6ebc) by [@estevaolucas](https://github.com/estevaolucas)]) +- Add support for cancelling fetch requests with `AbortController` ([h5e36b0c](https://github.com/facebook/react-native/commit/5e36b0c6eb2494cefd11907673aa018831526750) by [@janicduplessis](https://github.com/janicduplessis)) + +#### Android specific + +- Enable views to be nested within **Text**; this brings feature parity to Android, but be aware that it [has some limitations](https://github.com/facebook/react-native/commit/a2a03bc68ba062a96a6971d3791d291f49794dfd) ([5c399a9f74](https://github.com/facebook/react-native/commit/5c399a9f74f22c58c11f75abde32ac7dc269ccc0) by [@rigdern](https://github.com/rigdern)) +- Add a `touchSoundDisabled` prop to **Button**, **Touchable**, and **TouchableWithoutFeedback** ([45e77c8324](https://github.com/facebook/react-native/commit/45e77c8324f7dc2d53109e45a4e0b18cbab6a877) by [@yurykorzun](https://github.com/yurykorzun)) + +#### iOS specific + +- Add `announceForAccessibility` and `announcementFinished` APIs for making screen reader announcements ([cfe003238a](https://github.com/facebook/react-native/commit/cfe003238ab8c5686d185f6ce9e0776eeb4bb729) by [@rigdern](https://github.com/rigdern)) +- Ability to force network requests to use WiFi using the `allowsCellularAccess` property. This can ensure that network requests are sent over WiFi if communicating with a local hardware device and is accomplished by setting a flag. Default behavior of allowing network connections over cellular networks when available is unchanged. ([01c70f2fb9](https://github.com/facebook/react-native/commit/01c70f2fb9e8ac78a4d0cbd016d4de47316fe4d1) and [916186a7e6](https://github.com/facebook/react-native/commit/916186a7e6c43b1a1c68652ab82862bcd8fb1e01) by [@bondparkerbond](https://github.com/bondparkerbond)and [@zhongwuzw](https://github.com/zhongwuzw)) +- `$RN_CACHE_DIR` can now be used to manually specify the iOS build cache directory ([845eee403e](https://github.com/facebook/react-native/commit/845eee403e1cd3cb36935ef142f411f2b5075346) by [@hramos](https://github.com/hramos)) + +### Changed + +- _BREAKING_ Migrated to AndroidX; please see [this thread](https://github.com/react-native-community/discussions-and-proposals/issues/129#issuecomment-503829184) for more details on this change +- Cleanup **RedBox** message and stack output; it's now far easier to understand ([49d26eb0c4](https://github.com/facebook/react-native/commit/49d26eb0c4aeb611c6cb37a568708afa67b48c18) by [@thymikee](https://github.com/thymikee)) +- Add default `scrollEventThrottle` value to **Animated.FlatList** and **Animated.SectionList**; this now behaves consistently with **Animated.ScrollView** ([933e65e245](https://github.com/facebook/react-native/commit/933e65e245b30f7dc5a26aa51881153fb7c3628e) by [@janicduplessis](https://github.com/janicduplessis)) +- Remove invariant on nested sibling **VirtualizedLists** without unique listKey props; they now trigger a **RedBox** ([af5633bcba](https://github.com/facebook/react-native/commit/af5633bcba224f71f035ba4214a93b69723c9b93)) +- **FlatList** and **VirtualizedList**'s default `keyExtractor` now checks `item.id` and `item.key` ([de0d7cfb79](https://github.com/facebook/react-native/commit/de0d7cfb79c7f4011d4b6748b1afc656d33fd5ac) by [@sahrens](https://github.com/sahrens)) +- **SectionList**'s `scrollToLocation` on iOS now counts `itemIndex` like Android; both platforms are now consistent, and the `itemIndex` value 0 now represents scrolling to the first heading ([248a108abf](https://github.com/facebook/react-native/commit/248a108abf206b7ae32208537f0b73a8192a4829) by [@vonovak](https://github.com/vonovak)) +- Slightly speedup core initialization by moving native version check to DEV only ([5bb2277245](https://github.com/facebook/react-native/commit/5bb22772452e49dbcfbf183f6ebeee4576e67947) by [@mmmulani](https://github.com/mmmulani)) +- `react` is now at v16.8.6 ([53cec2dc1f](https://github.com/facebook/react-native/commit/53cec2dc1f1f5d143d0bb9752629b72350ebd112), [ee681b72ce](https://github.com/facebook/react-native/commit/ee681b72ce89539e5764ed59e5dfea4fab04d48c), and [6001acb319](https://github.com/facebook/react-native/commit/6001acb319958242f8d8e2dd40cb91a55b5eab2e) by [@kelset](https://github.com/kelset), [@mdvacca](https://github.com/mdvacca), [@gaearon](https://github.com/gaearon)) +- `react-native-community/cli` is now at v2.0.0 (by [@thymikee](https://github.com/thymikee)) +- `flow` is now at v0.98 ([0e1dfd4369](https://github.com/facebook/react-native/commit/0e1dfd436917a78a09da7b57a0b50397e6a0b6e1) by [@nmote](https://github.com/nmote)) +- `prettier` is now at v1.17.0 ([ff9f8f347d](https://github.com/facebook/react-native/commit/ff9f8f347d71630664dc3da1e8be0425799c0ce0)) +- `metro` packages are now at v0.54.1 ([7ff3874ec0](https://github.com/facebook/react-native/commit/7ff3874ec060bce568537a2238aea2c888e6e13f), [343f0a1d50](https://github.com/facebook/react-native/commit/343f0a1d50662aa37ef0b26d5436b2a0b40fbabb) by [@motiz88](https://github.com/motiz88)) +- Replace patched fetch polyfill with `whatwg-fetch@3.0` ([bccc92dfdd](https://github.com/facebook/react-native/commit/bccc92dfdd2d85933f2a9cb5c8d1773affb7acba) by [@janicduplessis](https://github.com/janicduplessis)) + +#### Android specific + +- Use class canonical name for `PARTIAL_WAKE_LOCK` tag ([88dbb4558c](https://github.com/facebook/react-native/commit/88dbb4558cd10f129f2c31e3b0b872924aba5416) by [@timwangdev](https://github.com/timwangdev)) + +#### iOS specific + +- _BREAKING_: Split React.podspec into separate podspecs for each Xcode project; your libraries will need to update for this change as well to avoid CocoaPods build errors ([2321b3fd7f](https://github.com/facebook/react-native/commit/2321b3fd7f666ce30f5dad4cd2673ddf22972056) by [@fson](https://github.com/fson)) +- Improve handling of native module exceptions; they are now propagated to crash reporting tools with the context and callstack ([629708beda](https://github.com/facebook/react-native/commit/629708bedae65a30e39d234da6b04d6fa101a779) by [@pvinis](https://github.com/pvinis)) +- Switch **Slider** `onSlidingComplete` event to a non-bubbling event on iOS to match Android ([7927437a6d](https://github.com/facebook/react-native/commit/7927437a6d5d63de2424d43d58085291c1067091) by [@rickhanlonii](https://github.com/rickhanlonii)) + +### Deprecated + +- **StatusBar** is no longer deprecated; thank you for the feedback ([a203ebe206](https://github.com/facebook/react-native/commit/a203ebe2062b3c12f85783f46030971f3aa5db1d) by [@cpojer](https://github.com/cpojer)) + +### Removed + +- **NetInfo** has been removed; its replacement is now available via the [react-native-community/netinfo](https://github.com/react-native-community/react-native-netinfo) package ([5a30c2a205](https://github.com/facebook/react-native/commit/5a30c2a2052ba76e88dbf71b5b5c92966591bf26) by [@cpojer](https://github.com/cpojer)) +- **WebView** has been removed; its replacement is now available via the [react-native-community/webview](https://github.com/react-native-community/react-native-webview) package ([](https://github.com/facebook/react-native/commit/6ca438a7f4bd7e6b317f0461aebbd5a7186151ed), [1ca9a95537](https://github.com/facebook/react-native/commit/1ca9a9553763a89c977f756b45486f8b9cedab80), and [954f715b25](https://github.com/facebook/react-native/commit/954f715b25d3c47c35b5a23ae23770a93bc58cee) by [@cpojer](https://github.com/cpojer) and [@thorbenprimke](https://github.com/thorbenprimke)) +- **Geolocation** has been removed; its replacement is now available via the [react-native-community/geolocation](https://github.com/react-native-community/react-native-geolocation) package ([17dbf98884](https://github.com/facebook/react-native/commit/17dbf988845bb7815dbb6182218c8c28d027fb91) and [9834c580af](https://github.com/facebook/react-native/commit/9834c580af654366bf0d38b78cd2694b0a0c477f) by [@cpojer](https://github.com/cpojer) and [@mmmulani](https://github.com/mmmulani)) + +### Fixed + +- Fix `Animated.Value` value after animation if component was re-mounted ([b3f7d53b87](https://github.com/facebook/react-native/commit/b3f7d53b87413abdf302c521114e4d77aa92e07f) by [@michalchudziak](https://github.com/michalchudziak)) +- Consistent reporting native module name on crash on native side ([fdd8fadea8](https://github.com/facebook/react-native/commit/fdd8fadea84f475714a16b6f0ec433f898d09558) and [b79d7db9db](https://github.com/facebook/react-native/commit/b79d7db9dbf588085b29274e507d34438e2e2595) by [@DimitryDushkin](https://github.com/DimitryDushkin)) +- Handle null filenames in symbolicated stack trace gracefully in **ExceptionsManager** ([2e8d39bed7](https://github.com/facebook/react-native/commit/2e8d39bed70e2e5eeddeb2dc98155bf70f9abebd) by [@motiz88](https://github.com/motiz88)) +- Fix HasteImpl platform name regex ([28e0de070d](https://github.com/facebook/react-native/commit/28e0de070d2dae9a486ab5915b6fd76723bd84ef) by [@CaptainNic](https://github.com/CaptainNic)) +- Fix a JS memory leak in Blob handling; this resolves multiple leaks around `fetch` ([05baf62721](https://github.com/facebook/react-native/commit/05baf6272143667694585a14fb59657fdc93c3b1) and [9ef5107d04](https://github.com/facebook/react-native/commit/9ef5107d04da374fc566d8b296572ddd992419f0) by [@janicduplessis](https://github.com/janicduplessis)) +- **SectionList**'s `scrollToLocation` now scrolls to the top of the sticky header as expected ([d376a444e3](https://github.com/facebook/react-native/commit/d376a444e318beabd8ebe9ccb41ffc300e12ea76) by [@danilobuerger](https://github.com/danilobuerger)) + +#### Android specific + +- Fix duplicate resource error in Android build ([962437fafd](https://github.com/facebook/react-native/commit/962437fafd02c936754d1e992479056577cafd05) and [eb534bca58](https://github.com/facebook/react-native/commit/eb534bca58a89ae306010626a8bdae92c23b8784) by [@mikehardy](https://github.com/mikehardy) and [@Dbroqua](https://github.com/Dbroqua)) +- Reorder operations of native view hierarchy ([5f027ec64d](https://github.com/facebook/react-native/commit/5f027ec64d6764fbbb9813fabb373194dec79db7) by [@lunaleaps](https://github.com/lunaleaps)) +- Fix performance regression from new custom fonts implementation ([fd6386a07e](https://github.com/facebook/react-native/commit/fd6386a07eb75a8ec16b1384a3e5827dea520b64) by [@dulmandakh](https://github.com/dulmandakh)) +- Fix internal test case around disabled state of buttons ([70e2ab2ec9](https://github.com/facebook/react-native/commit/70e2ab2ec9a1df60b39987946af18cac8621b3b0)) +- Fix extra call of **PickerAndroid**'s `onValueChange` on initialization; now it is only called when `selectedValue` changes ([82148da667](https://github.com/facebook/react-native/commit/82148da6672e613f34ffb48133cdefc235418dea) by [@a-c-sreedhar-reddy](https://github.com/a-c-sreedhar-reddy)) +- Fix **PickerAndroid** will reset selected value during items update ([310cc38a5a](https://github.com/facebook/react-native/commit/310cc38a5acb79ba0f1cda22913bd1d0cb296034) by [@Kudo](https://github.com/Kudo)) +- Fix unexpected PARTIAL_WAKE_LOCK when no headless tasks registered. ([bdb1d4377e](https://github.com/facebook/react-native/commit/bdb1d4377e47c6cd49ff619134d4860519a3cb0c) by [@timwangdev](https://github.com/timwangdev)) +- Fix calling **TextInput**'s `onKeyPress` method when the user types an emoji ([a5c57b4ed4](https://github.com/facebook/react-native/commit/a5c57b4ed4965ac4bb231399fd145da8095cece3)) +- Fix value of **TextInput**'s `onSelectionChange` start and end arguments by normalizing them ([2ad3bb2e2d](https://github.com/facebook/react-native/commit/2ad3bb2e2d62ffb780bab020f645626a16dd3b4a) by [@uqmessias](https://github.com/uqmessias)) +- In `Linking.getInitialURL` method, use the `InteractionManager` to wait for the current activity to finish initializing ([c802d0b757](https://github.com/facebook/react-native/commit/c802d0b757912358d703d4d8a114073377a905b9) by [@mu29](https://github.com/mu29)) +- Disable delta bundles on the first app run ([e4aff423ac](https://github.com/facebook/react-native/commit/e4aff423ac0421f4af7b9a111e5ad954f489da19) by [@wojteg1337](https://github.com/wojteg1337)) +- In **DatePickerAndroid**, work around Android Nougat bug displaying the wrong the spinner mode ([bb060d6cf8](https://github.com/facebook/react-native/commit/bb060d6cf89500778bba27d1da5925e2623c7a99) by [@luancurti](https://github.com/luancurti)) +- Fix crash in Animated Interpolation when inputMin === inputMax ([7abfd23b90](https://github.com/facebook/react-native/commit/7abfd23b90db08b426c3c91b0cb6d01d161a9b9e) by [@olegbl](https://github.com/olegbl)) +- Fix symbolication for **RedBox** and **YellowBox** when using delta bundling ([a05e9f8e09](https://github.com/facebook/react-native/commit/a05e9f8e094b25cc86ee297477cccafc3be5ef52) by [@motiz88](https://github.com/motiz88)) +- Fix **CameraRoll** crash on mime type guessing ([ebeb893b50](https://github.com/facebook/react-native/commit/ebeb893b50b4aa1ad77bdb203e4f8faed75db43a) by [@Sroka](https://github.com/Sroka)) + +#### iOS specific + +- Call designated initializer for SurfaceHostingProxyRootView ([3c125e867f](https://github.com/facebook/react-native/commit/3c125e867f52efd7f18b2bd8c9a21b246afcd788) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix **RedBox** JS symbolication when adding JS engine tag to the message ([920632cadb](https://github.com/facebook/react-native/commit/920632cadb108ceeacad93e9316e706608df2942) by [@motiz88](https://github.com/motiz88)) +- Fix **TextInput**'s `onSelectionChange` behavior in single line text inputs ([0c11d8d9b4](https://github.com/facebook/react-native/commit/0c11d8d9b4edf7830255f5b016d0ba7ef72ae827) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix accessibility problem with **TextInput** Clear Button ([4e37d37cbf](https://github.com/facebook/react-native/commit/4e37d37cbff27e61659440094a662e00eafd8fc4) by [@shergin](https://github.com/shergin)) +- Fix `renderingMode` not applied to GIF **Image**s ([75380aa329](https://github.com/facebook/react-native/commit/75380aa3296210777dc0be70a722701767276117) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix **ScrollView** `centerContent` not work in some cases ([2cdf9694b5](https://github.com/facebook/react-native/commit/2cdf9694b56e76477dde572eb3dc38be31361eab) by [@zhongwuzw](https://github.com/zhongwuzw)) +- Fix crash on performance logger ([5d3d3987d8](https://github.com/facebook/react-native/commit/5d3d3987d8a81b84d43dc88808d7f50c7bf11d19) by [@zhigang1992](https://github.com/zhigang1992)) +- Do not run packager in Release mode ([4ea6204111](https://github.com/facebook/react-native/commit/4ea62041118fb031d7540726df2d29185c6b130d) by [@lucasbento](https://github.com/lucasbento)) +- Fix `code` and `reason` arguments being ignored when calling `WebSocket.close` ([0ac2171c54](https://github.com/facebook/react-native/commit/0ac2171c549b389228c4a37ae645eb0d9813b82d) by [@jeanregisser](https://github.com/jeanregisser)) +- Fix return value of `Linking.openURL()` ([4a5d0bdbd7](https://github.com/facebook/react-native/commit/4a5d0bdbd75c433d2f51f160657a0ad91e440272) by [@thib92](https://github.com/thib92)) +- When an accessibilityLabel can't be discerned, return `nil` instead of `@""` ([d4ff5ed258](https://github.com/facebook/react-native/commit/d4ff5ed258b75fe77c5d801af7b097b04fcd3690) by [@sammy-SC](https://github.com/sammy-SC)) +- Fix Xcode build when the project's path contains whitespace ([f0770b6b37](https://github.com/facebook/react-native/commit/f0770b6b370f483fdd729bdba04069cc783353dc)) +- Move accessibility props to UIView+React ([9261035c2b](https://github.com/facebook/react-native/commit/9261035c2bf2fe9522806fb1c535a1835e7acfa2) by [@janicduplessis](https://github.com/janicduplessis)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22277de95769ec..8599764432ac0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +This file contains all changelogs for latest releases, from 0.70.0 onward. Please check out the other `CHANGELOG-*.md` files for previous versions. + ## v0.72.0 ### Breaking @@ -1354,4749 +1356,3 @@ Read the [announcement blogpost here](https://reactnative.dev/blog/2023/01/12/ve - Add GitHub token permissions for workflows ([3da3d82320](https://github.com/facebook/react-native/commit/3da3d82320bd035c6bd361a82ea12a70dba4e851) by [@varunsh-coder](https://github.com/varunsh-coder)) - Bump RCT-Folly to 2021-07-22 ([68f3a42fc7](https://github.com/facebook/react-native/commit/68f3a42fc7380051714253f43b42175de361f8bd) by [@luissantana](https://github.com/luissantana)) - -## v0.69.11 - -### Fixed - -#### iOS specific - -- Make 0.69 compatible with Xcode 15 (thanks to @AlexanderEggers for the commit in main) ([37e8df1cdc](https://github.com/facebook/react-native/commit/37e8df1cdce4a66763c720b1b0768d049def9518)) - -## v0.69.10 - -### Fixed - -#### Android specific - -- Minimize EditText Spans 8/N: CustomStyleSpan ([b384bb613b](https://github.com/facebook/react-native/commit/b384bb613bf533aebf3271ba335c61946fcd3303) by [@NickGerleman](https://github.com/NickGerleman)) -- Minimize EditText Spans 6/N: letterSpacing ([5791cf1f7b](https://github.com/facebook/react-native/commit/5791cf1f7b43aed1d98cad7bcc272d97ab659111) by [@NickGerleman](https://github.com/NickGerleman)) -- Minimize Spans 5/N: Strikethrough and Underline ([0869ea29db](https://github.com/facebook/react-native/commit/0869ea29db6a4ca20b9043d592a2233ae1a0e7a2) by [@NickGerleman](https://github.com/NickGerleman)) -- Minimize Spans 4/N: ReactForegroundColorSpan ([8c9c8ba5ad](https://github.com/facebook/react-native/commit/8c9c8ba5adb59f7f891a5307a0bce7200dd3ac7d) by [@NickGerleman](https://github.com/NickGerleman)) -- Minimize Spans 3/N: ReactBackgroundColorSpan ([cc0ba57ea4](https://github.com/facebook/react-native/commit/cc0ba57ea42d876155b2fd7d9ee78604ff8aa57a) by [@NickGerleman](https://github.com/NickGerleman)) -- Minimize Spans 1/N: Fix precedence ([1743dd7ab4](https://github.com/facebook/react-native/commit/1743dd7ab40998c4d3491e3b2c56c531daf5dc47) by [@NickGerleman](https://github.com/NickGerleman)) -- Fix measurement of uncontrolled TextInput after edit ([8a0fe30591](https://github.com/facebook/react-native/commit/8a0fe30591e21b90a3481c1ef3eeadd4b592f3ed) by [@NickGerleman](https://github.com/NickGerleman)) - -## v0.69.9 - -### Changed - -#### iOS specific - -- Relax Ruby requirements ([4e015c69d6](https://github.com/facebook/react-native/commit/4e015c69d646b320d58888f70af566c1d753eaed) by [@cipolleschi](https://github.com/cipolleschi)) - -### Fixed - -#### iOS specific - -- Fix React Codegen podspec to build on Xcode 14.3 ([74ba411b55](https://github.com/facebook/react-native/commit/74ba411b55535cee1b98062875b7b4b1428c931a) by [@cipolleschi](https://github.com/cipolleschi)) -- Blob data is no longer prematurely deallocated when using blob.slice ([36cc71ab36](https://github.com/facebook/react-native/commit/36cc71ab36aac5e5a78f2fbae44583d1df9c3cef) by [@awinograd](https://github.com/awinograd)) - -## v0.69.8 - -### Fixed - -#### Android specific - -- Mitigation for Samsung TextInput Hangs ([be69c8b5a7](https://github.com/facebook/react-native/commit/be69c8b5a77ae60cced1b2af64e48b90d9955be5) by [@NickGerleman](https://github.com/NickGerleman)) - -## v0.69.8 - -### Fixed - -#### Android specific - -- Mitigation for Samsung TextInput Hangs ([be69c8b5a7](https://github.com/facebook/react-native/commit/be69c8b5a77ae60cced1b2af64e48b90d9955be5) by [@NickGerleman](https://github.com/NickGerleman)) - -## v0.69.7 - -### Fixed - -- Force dependencies resolution to minor series for 0.69 ([c4da74c463](https://github.com/facebook/react-native/commit/c4da74c4636cbbd6bbf681d39a8a8cca49f11f56) by [@Titozzz](https://github.com/Titozzz)) - -## v0.69.6 - -### Changed - -- Bump version of `promise` from 8.0.3 to 8.2.0, enabling `Promise.allSettled` ([951538c080](https://github.com/facebook/react-native/commit/951538c080ef745da304fb308fa91d597e0dd98a) by [@retyui](https://github.com/retyui)) - -### Fixed - -- Fix hermes profiler ([81564c1a3d](https://github.com/facebook/react-native/commit/81564c1a3dae4222858de2a9a34089097f665e82) by [@janicduplessis](https://github.com/janicduplessis)) - -#### Android specific - -- Correctly resolve classes with FindClass(..) ([361b310bcc](https://github.com/facebook/react-native/commit/361b310bcc8dddbff42cf63495649291c894d661) by [@evancharlton](https://github.com/evancharlton)) - -#### iOS specific - -- Fix the way the orientation events are published, to avoid false publish on orientation change when app changes state to inactive ([7d42106d4c](https://github.com/facebook/react-native/commit/7d42106d4ce20c644bda4d928fb0abc163580cee) by [@lbaldy](https://github.com/lbaldy)) -- Fix React module build error with swift integration on new architecture mode ([3afef3c167](https://github.com/facebook/react-native/commit/3afef3c16702cefa5115b059a08741fba255b2db) by [@Kudo](https://github.com/Kudo)) - -## v0.69.5 - -### Changed - -- Bump react-native-codegen to 0.69.2 ([df3d52bfbf](https://github.com/facebook/react-native/commit/df3d52bfbf4254cd16e1dc0ca0af2743cd7e11c1) by [@dmytrorykun](https://github.com/dmytrorykun)) - -#### Android specific - -- Replaced reactnativeutilsjni with reactnativejni in the build process to reduce size ([54a4fcbfdc](https://github.com/facebook/react-native/commit/54a4fcbfdcc8111b3010b2c31ed3c1d48632ce4c) by [@SparshaSaha](https://github.com/SparshaSaha)) - -### Fixed - -- Codegen should ignore `.d.ts` files ([0f0d52067c](https://github.com/facebook/react-native/commit/0f0d52067cb89fdb39a99021f0745282ce087fc2) by [@tido64](https://github.com/tido64)) - -## v0.69.4 - -### Changed - -- Upgrade RN CLI to v8.0.4 ([66c68c37ce](https://github.com/facebook/react-native/commit/66c68c37ce94f6c1160e7f260c0d1887539c6605) by [@thymikee](https://github.com/thymikee)) - -#### Android specific - -- Modified **getDefaultJSExecutorFactory** method ([87cfd386cb](https://github.com/facebook/react-native/commit/87cfd386cb2e02bfa440c94706d9d0274f83070c) by [@KunalFarmah98](https://github.com/KunalFarmah98)) - -## v0.69.3 - -### Fixed - -#### iOS specific - -- Fix React-bridging header not found for third party modules ([fa2acc32d1](https://github.com/facebook/react-native/commit/fa2acc32d1490f6e418689dec321f8bd4ef7bb28) by [@Kudo](https://github.com/Kudo)) - -## v0.69.2 - -### Changed - -- Set react-shallow-renderer v16.15.0 for react v18 compat ([a39a7c453d](https://github.com/facebook/react-native/commit/a39a7c453d87086935ff07d549ba8220cbcf30bd) by [@mikehardy](https://github.com/mikehardy)) -- Upgrade RN CLI to v8.0.3 ([28cbd21d21](https://github.com/facebook/react-native/commit/28cbd21d21f2ffb3f38b2449a4983f013947ce0a) by [@thymikee](https://github.com/thymikee)) - -#### iOS specific - -- Hermes pod: change logic to use the hermes tag to set the pod source correctly ([46a9edc854](https://github.com/facebook/react-native/commit/46a9edc8544ae070149a97ea3d919b88dd6e2942) by [@kelset](https://github.com/kelset)) -- Fix the race condition when calling readAsDataURL after new Blob(blobs) ([bd12e41188](https://github.com/facebook/react-native/commit/bd12e41188c8d85c0acbd713f10f0bd34ea0edca) by [@wood1986](https://github.com/wood1986)) -- Make sure that Flipper pods are not installed when creating a release build ([23accbf58d](https://github.com/facebook/react-native/commit/23accbf58d2fa03ad020e07f00012a32609c7218) by [@cipolleschi](https://github.com/cipolleschi)) - -## v0.69.1 - -### Changed - -#### iOS specific - -- Make all Yoga headers public and add #ifdef __cplusplus ([43f831b23c](https://github.com/facebook/react-native/commit/43f831b23caf22e59af5c6d3fdd62fed3d20d4ec) by [@janicduplessis](https://github.com/janicduplessis)) - -### Fixed - -- Use monotonic clock for performance.now() ([114d31feee](https://github.com/facebook/react-native/commit/114d31feeeb47f5a57419e5088c3cbe9340f757a)) - -#### iOS specific - -- Fix build for React-RCTText ([4ea38e16bf](https://github.com/facebook/react-native/commit/4ea38e16bf533955557057656cba5346d2372acd) by [@ph4r05](https://github.com/ph4r05)) -- Fix RCT-Folly build error when use_frameworks! and hermes are both enabled ([79baca678a](https://github.com/facebook/react-native/commit/79baca678a743560fa16fdd551f1d0d018d34304) by [@Kudo](https://github.com/Kudo)) -- Fix use_frameworks! for 0.69 ([f97c6a5b49](https://github.com/facebook/react-native/commit/f97c6a5b498eec95e99a02c7842cb2ae160cd6cd) by [@Kudo](https://github.com/Kudo)) - -## v0.69.0 - -### Breaking - -- Support for `console.disableYellowBox` [has been dropped](https://github.com/facebook/react-native/commit/b633cc130533f0731b2577123282c4530e4f0abe) -- Already deprecated prop types have been removed ([cdfddb4dad](https://github.com/facebook/react-native/commit/cdfddb4dad7c69904850d7e5f089a32a1d3445d1), [3e229f27bc](https://github.com/facebook/react-native/commit/3e229f27bc9c7556876ff776abf70147289d544b), [10199b1581](https://github.com/facebook/react-native/commit/10199b158138b8645550b5579df87e654213fe42)) -- `removeListener`, deprecated since RN0.65, [was removed](https://github.com/facebook/react-native/commit/8dfbed786b40082a7a222e00dc0a621c0695697d) from Appearance -- If you were using `SegmentedComponentIOS`, you will now need to move to the [segmented-control](https://github.com/react-native-segmented-control/segmented-control) library ([235f168574](https://github.com/facebook/react-native/commit/235f1685748442553e53f8ec6d904bc0314a8ae6)) - -### Added - -- Add Hermes scripts to package ([004b8609d9](https://github.com/facebook/react-native/commit/004b8609d97b14a6d5cb8c9e63afdbe343c500da) by [@hramos](https://github.com/hramos)) -- Expose scheduler through FabricUIManager ([1730949e94](https://github.com/facebook/react-native/commit/1730949e94aa23927a90d2a64d91977b7e2904d6) by [@cortinico](https://github.com/cortinico)) -- Add event listeners to Scheduler ([e51e19ecc1](https://github.com/facebook/react-native/commit/e51e19ecc1d1b8ac5c860eac55338ef13471844f) by [@cortinico](https://github.com/cortinico)) -- C++ TurboModule methods can return functions ([c7380ba113](https://github.com/facebook/react-native/commit/c7380ba1131b26b487ecae87239a4cf82afefd15) by [@appden](https://github.com/appden)) -- Add support for devtools' profiler ([fefa7b6ac8](https://github.com/facebook/react-native/commit/fefa7b6ac8a1e0e33fa7a1070936c5c83c873c0a) by [@jpporto](https://github.com/jpporto)) -- Add getAll function to FormData class for getting all parts containing that key. This is also available in web API. ([d05a5d1551](https://github.com/facebook/react-native/commit/d05a5d15512ab794ef80b31ef91090d5d88b3fcd) by [@matinzd](https://github.com/matinzd)) -- Automatic type conversions for C++ TurboModules ([31f0796237](https://github.com/facebook/react-native/commit/31f079623732fb017b1fa38d56abe855d7738ece) by [@appden](https://github.com/appden)) -- New bridging API for JSI <-> C++ ([30cb78e709](https://github.com/facebook/react-native/commit/30cb78e709bccb4f7bf7aab3f6b0f1ba4261f577) by [@appden](https://github.com/appden)) -- Add asBool() method to JSI ([603620b739](https://github.com/facebook/react-native/commit/603620b7394da5855e2255790bfea9ad7d80ddf9) by [@appden](https://github.com/appden)) -- CustomEvent and Event polyfills for React Native ([6abbef1200](https://github.com/facebook/react-native/commit/6abbef1200af9adab1848de17955d77fbe0ad5da) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Implement Runtime.getHeapUsage for hermes chrome inspector ([cff9590864](https://github.com/facebook/react-native/commit/cff9590864c4be153a4eb49757b7cac8b3f23f66) by [@janicduplessis](https://github.com/janicduplessis)) -- Introduce ReactNativeFeatureFlags file to control FeatureFlags in React Native ([33aba77456](https://github.com/facebook/react-native/commit/33aba774564acdec216e02e28f17ad08ad7bc26b) by [@mdvacca](https://github.com/mdvacca)) -- Added fail-safe check to catch MissingWebViewPackage Exception ([8c573d9336](https://github.com/facebook/react-native/commit/8c573d933652ae4da1008502c53fce93057101c0) by [@Kunal-Airtel2022](https://github.com/Kunal-Airtel2022)) -- Add ability to access properties with symbol keys through JSI ([9010bfe457](https://github.com/facebook/react-native/commit/9010bfe457b77862024214ce6210504ff1786ef5) by [@neildhar](https://github.com/neildhar)) -- Allow color styles to be animated using native driver ([201f355479](https://github.com/facebook/react-native/commit/201f355479cafbcece3d9eb40a52bae003da3e5c) by [@genkikondo](https://github.com/genkikondo)) -- Make react-native depend on react-native-gradle-plugin ([3346efb7d4](https://github.com/facebook/react-native/commit/3346efb7d422bd8eb7f48650b454071f9981fa0b) by [@cortinico](https://github.com/cortinico)) -- Add RawEventTelemetryEventEmitter interface to ReactNativePrivateInterface ([1f15a64028](https://github.com/facebook/react-native/commit/1f15a6402869b001cae049facc17126924b97197) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Implement Runtime.getHeapUsage for hermes chrome inspector ([3568a72987](https://github.com/facebook/react-native/commit/3568a7298738a651d76c70763362c297ab601ee8) by [@janicduplessis](https://github.com/janicduplessis)) -- Add support for C++17 in OSS ([c2e4ae39b8](https://github.com/facebook/react-native/commit/c2e4ae39b8a5c6534a3fa4dae4130166eda15169) by [@sammy-SC](https://github.com/sammy-SC)) - -#### Android specific - -- Generate `Nullable` for optional objects and arrays in module codegen. ([ffaa5d69bc](https://github.com/facebook/react-native/commit/ffaa5d69bc268918891121e2d60e7ca08ee82530)) -- Expose an API to enable Concurrent Root on Android ([d7b64b8d4b](https://github.com/facebook/react-native/commit/d7b64b8d4b2f403ce00b27c5df89ffb3a64dc6de) by [@cortinico](https://github.com/cortinico)) -- Add scrollEventThrottle prop support in Android ([cf55fd587e](https://github.com/facebook/react-native/commit/cf55fd587e6cc82a73079be6076d244ab72fa359) by [@ryancat](https://github.com/ryancat)) -- Accessibility announcement for list and grid in FlatList ([dd6325bafe](https://github.com/facebook/react-native/commit/dd6325bafe1a539d348f3710e717a6344576b859) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Introduce ModuleDataCleaner.cleanDataFromModules(ReactContext) ([184dfb8f8b](https://github.com/facebook/react-native/commit/184dfb8f8bd4dfbb8d1575e9554e3f3361793015) by [@RSNara](https://github.com/RSNara)) -- Introduce ReactContext.getNativeModules() ([b978308519](https://github.com/facebook/react-native/commit/b978308519f71c6c7fda4b38a842aa219a349275) by [@RSNara](https://github.com/RSNara)) -- MapBuffer implementation for JVM -> C++ communication ([cf6f3b680b](https://github.com/facebook/react-native/commit/cf6f3b680b43fae31e97b14af681293503025a0c)) -- Make links independently focusable by Talkback ([7b5b114d57](https://github.com/facebook/react-native/commit/7b5b114d578142d18bf4a7a5279b179a9ac8d958) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Support animating text color with native driver ([87cdb607e4](https://github.com/facebook/react-native/commit/87cdb607e4792156d433c44b89932e7dae3371da) by [@genkikondo](https://github.com/genkikondo)) -- Added an experimental prop serialization path based on MapBuffer ([cbcdaae2b5](https://github.com/facebook/react-native/commit/cbcdaae2b5dda2a44c95d83dcb5b5aa0f43bc6f9)) -- Allow to setup a Gradle Enterprise instance via an external script ([f11dcfaea1](https://github.com/facebook/react-native/commit/f11dcfaea14249b059aea2474ce36a0665140d4f) by [@cortinico](https://github.com/cortinico)) -- Support platform color with AnimatedColor ([cb42049e0a](https://github.com/facebook/react-native/commit/cb42049e0ae262afe907ace1099414836ab0018d) by [@genkikondo](https://github.com/genkikondo)) -- Support running animations with AnimatedColor with native driver ([3f49e6763e](https://github.com/facebook/react-native/commit/3f49e6763e66447f6ae17dc2f032e27330b7b74a) by [@genkikondo](https://github.com/genkikondo)) -- Add public API to ReactRootView to control if JS touch events are dispatched ([0a517ae438](https://github.com/facebook/react-native/commit/0a517ae43892fb764d829f8bae56c1ac58356b1b) by [@ryancat](https://github.com/ryancat)) - -#### iOS specific - -- Prepare a method in the AppDelegate to control the concurrentRoot. ([8ac8439e0d](https://github.com/facebook/react-native/commit/8ac8439e0dcc0cc4a9c0cc99f614a5e19bae56eb) by [@cipolleschi](https://github.com/cipolleschi)) -- `hotkeysEnabled` property is added to `RCTDevMenu` which allows enabling/disabling hotkeys that triggers developer menu popup ([1a1a304ed2](https://github.com/facebook/react-native/commit/1a1a304ed2023d60547aef65b1a7bf56467edf08)) -- Allow modifying iOS image cache limits ([61b013e7ad](https://github.com/facebook/react-native/commit/61b013e7ad8a1cc28ee39434d2fd96b74b96cf5f) by [@danilobuerger](https://github.com/danilobuerger)) -- Add dismissActionSheet method to ActionSheetIOS ([64ebe5bbdd](https://github.com/facebook/react-native/commit/64ebe5bbdd32fc3b3a243a8a81a6f724d8f81267) by [@gabrieldonadel](https://github.com/gabrieldonadel)) -- Integrated the `accessibilityLanguage` prop to all the available components. The prop is available for any platform but it will work only on iOS. ([7b05b091fd](https://github.com/facebook/react-native/commit/7b05b091fd97f95b778369277ac2147730abc7b8) by [@dgopsq](https://github.com/dgopsq)) -- Support running animations with AnimatedColor with native driver ([49f3f47b1e](https://github.com/facebook/react-native/commit/49f3f47b1e9b840e4374d46b105604f4d2c22dd5) by [@genkikondo](https://github.com/genkikondo)) - -### Changed - -- Update direct Metro dependencies to 0.70.1 ([b74e964e70](https://github.com/facebook/react-native/commit/b74e964e705c40834acad7020562e870cdad9db1), ([c92b64b16a](https://github.com/facebook/react-native/commit/c92b64b16a5710c1dfaea9af4c271931e4669636) by [@arushikesarwani94](https://github.com/arushikesarwani94)), ([f89a0b765c](https://github.com/facebook/react-native/commit/f89a0b765c09c9aba573f03777cc76673989628f) by [@robhogan](https://github.com/robhogan)) -- Upgrade RN CLI to v8.0.0 ([0605880c9e](https://github.com/facebook/react-native/commit/0605880c9ed0aec812f3198eb5075db64fba969a), [1e0226f933](https://github.com/facebook/react-native/commit/1e0226f933814bf9ada87eaa14348bfff863ead1), [24bb7f7380](https://github.com/facebook/react-native/commit/24bb7f7380662925f078d78a03fbc954af2da3d6), [7dceb9b63c](https://github.com/facebook/react-native/commit/7dceb9b63c0bfd5b13bf6d26f9530729506e9097) by [@thymikee](https://github.com/thymikee)) -- Replace use-subscripton with use-sync-external-store ([93b50be8c2](https://github.com/facebook/react-native/commit/93b50be8c2341a0daf41f6fdc656896c4907c4dc) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Expose UIManager from Scheduler ([54db5f2012](https://github.com/facebook/react-native/commit/54db5f201292ebf267800d92b7dd5bfa22431963) by [@cortinico](https://github.com/cortinico)) -- Optimized VirtualizedList context when used with nested lists ([ceb0a54608](https://github.com/facebook/react-native/commit/ceb0a546083509192c059cdd93d6aa379e38ef4e) by [@javache](https://github.com/javache)) -- Remove usage of std::string in EarlyJsErrorHandler. ([30051b2c41](https://github.com/facebook/react-native/commit/30051b2c4185bff015c72069488b5f6ba3391ad7) by [@sshic](https://github.com/sshic)) -- `eslint-config`: add support for ESLint 8 ([864a8c11b2](https://github.com/facebook/react-native/commit/864a8c11b2a7540f607ebc0e084edd7393169359) by [@wcandillon](https://github.com/wcandillon)) -- `eslint-config`: add support for TypeScript 4.5+ ([199ac680c7](https://github.com/facebook/react-native/commit/199ac680c7867a982e25620219bffa18f85f5404) by [@rnike](https://github.com/rnike)) -- Upgraded react-devtools-core dependency to 4.24.0 ([a7a781ff4a](https://github.com/facebook/react-native/commit/a7a781ff4a13e744f4eb3007ef0657740b277a72)) -- Avoid flattening nodes with event props ([980c52de41](https://github.com/facebook/react-native/commit/980c52de41258f6cf2d2360144ea7ca16a19c9f8)) -- Type the argument of Animated.interpolate as read-only ([6584304c10](https://github.com/facebook/react-native/commit/6584304c100ce4d51a5c4d606170a6ad0dc00875) by [@motiz88](https://github.com/motiz88)) -- Update gradle-download-task to 5.0.1 to support concurrent downloads ([a86cae7aac](https://github.com/facebook/react-native/commit/a86cae7aacc9837536e7d679870a57dcd0f45475) by [@michel-kraemer](https://github.com/michel-kraemer)) -- Logging a soft error when ReactRootView has an id other than -1 instead of crashing the app in hybrid apps ([1ca2c24930](https://github.com/facebook/react-native/commit/1ca2c2493027c1b027146cd41e17dd8a4fc33a41) by [@Kunal-Airtel2022](https://github.com/Kunal-Airtel2022)) -- Upgrade to React 18 ([41cbccd98d](https://github.com/facebook/react-native/commit/41cbccd98dd6c98d1f662674164cf455105a1359) by [@rickhanlonii](https://github.com/rickhanlonii)) - -#### Android specific - -- Gradle: extend the algoritm to find hermesc paths ([aeac6ab677](https://github.com/facebook/react-native/commit/aeac6ab6773cd2c0ca7abe9e5aa3f22fa81683e5) by [@cortinico](https://github.com/cortinico)) -- Bump boost for Android to 1.76 to align with iOS ([5cd6367f0b](https://github.com/facebook/react-native/commit/5cd6367f0b86543274a15bb6d0e53a8545fed845) by [@kelset](https://github.com/kelset)) -- Adopt `MapBuffer` interface for `ReadableMapBuffer` ([81e4249315](https://github.com/facebook/react-native/commit/81e42493158edd5e7b88f98c19c87e9d61ba4aba)) -- Mark intent as nullable ([5ffa0b0aa6](https://github.com/facebook/react-native/commit/5ffa0b0aa6c523234c634167be1f94b0d9edb0f7) by [@sshic](https://github.com/sshic)) -- Use CMake to build ReactAndroid module ([e3830ddffd](https://github.com/facebook/react-native/commit/e3830ddffd9260fe071e0c9f9df40b379d54cf26)) -- Update template/android and RN Tester to use `hermes-engine` from the `react-native` NPM package. ([4d91f40fbd](https://github.com/facebook/react-native/commit/4d91f40fbdf0012689b04084113299676342c0dc) by [@cortinico](https://github.com/cortinico)) -- Build Hermes from Source ([a3d9892ed9](https://github.com/facebook/react-native/commit/a3d9892ed9c993d16fa36fa6b713e2ead43fcc77) by [@cortinico](https://github.com/cortinico)) -- Rename field with default values for ReactConfig to DEFAULT_CONFIG ([964e816752](https://github.com/facebook/react-native/commit/964e81675286c80a8e322127aa7c052f62621098)) -- Moved `com/react/facebook/uimanager/interfaces` files into `com/react/facebook/uimanager` to enable Kotlin build ([b1a779392d](https://github.com/facebook/react-native/commit/b1a779392d483c649d428debfe4a6405247b8c0e)) -- Bump AGP to 7.1.0 and fix bundle inclusion in release mode ([200488e87c](https://github.com/facebook/react-native/commit/200488e87cf4bc355e03c78cd814b97b23452117) by [@gabrieldonadel](https://github.com/gabrieldonadel)) -- Release react-native-gradle-plugin 0.0.5 ([42272211e4](https://github.com/facebook/react-native/commit/42272211e4a1b7cff7770b59cf1bcf649cbdd6fc) by [@cortinico](https://github.com/cortinico)) -- ViewPagerAndroid recommendation link. ([7e8cce3d2d](https://github.com/facebook/react-native/commit/7e8cce3d2ddffbe36bcb3c9ec2f006f7e1b42a79) by [@maaxg](https://github.com/maaxg)) -- Bump android Appcompat to 1.4.1 ([6b61995647](https://github.com/facebook/react-native/commit/6b61995647c789a567845521fed7b0cc1e0cddb7) by [@gabrieldonadel](https://github.com/gabrieldonadel)) -- Remove `react-native-gradle-plugin` as a dependency from template's package.json ([cd79317672](https://github.com/facebook/react-native/commit/cd79317672e5c99636346f2abb641a688a4ceb82) by [@cortinico](https://github.com/cortinico)) -- Use 2g as a default heap size for gradle builds ([09e418ef8e](https://github.com/facebook/react-native/commit/09e418ef8e98fd026cf828696ff2475993b76ac2)) -- Use new StatusBar API on Android 11 (API 30)+ ([50c8e973f0](https://github.com/facebook/react-native/commit/50c8e973f067d4ef1fc3c2eddd360a0709828968) by [@ieatfood](https://github.com/ieatfood)) -- Change static string to public ([ab45138394](https://github.com/facebook/react-native/commit/ab45138394f41aeb13370882837968636de04c24) by [@sshic](https://github.com/sshic)) - -#### iOS specific - -- Use pre-built HermesC if available in current React Native release ([644fe430fd](https://github.com/facebook/react-native/commit/644fe430fdecc0bf1fa098d1c2d52178da6c987c) by [@hramos](https://github.com/hramos)) -- When building Hermes from source, the filesystem will now be prepared using the new hermes-utils.js scripts, outside of CocoaPods ([aaa01f7710](https://github.com/facebook/react-native/commit/aaa01f77106f891696d9ec508e2ee71111a6af2a) by [@hramos](https://github.com/hramos)) -- Expose scheduler through RCTSurfacePresenter ([614aa86916](https://github.com/facebook/react-native/commit/614aa86916394d8ee2ecb236f38de6bb7e161ca2) by [@cortinico](https://github.com/cortinico)) -- Adopt UIGraphicsImageRenderer API ([d70d7fd0b3](https://github.com/facebook/react-native/commit/d70d7fd0b3984ee54622afc4692a6c945618c345) by [@matrush](https://github.com/matrush)) -- Build Hermes from source when Hermes is used ([bb01b75637](https://github.com/facebook/react-native/commit/bb01b75637edc1159a3bdb3af86936e1c92f39c1) by [@hramos](https://github.com/hramos)) -- Update CodeGen scripts to accept custom node executable ([323db75c36](https://github.com/facebook/react-native/commit/323db75c36d26d771f6b231c8eabc5afc0da74d3) by [@cipolleschi](https://github.com/cipolleschi)) -- Fixed the fallback behavior when the `.xcode.env` file is missing, actually using the old `find-node-for-xcode.sh` script ([705c6f57d6](https://github.com/facebook/react-native/commit/705c6f57d66b4499f43489292183a58413402a74) by [@cipolleschi](https://github.com/cipolleschi)) -- Adding a link in a message for the users. ([2c52131f5e](https://github.com/facebook/react-native/commit/2c52131f5e0eb4668681242fcdd8150afe3c5827) by [@cipolleschi](https://github.com/cipolleschi)) -- Bump ruby to 2.7.5 ([2c87b7466e](https://github.com/facebook/react-native/commit/2c87b7466e098c5cd230e02b279fc7bc7a357615) by [@danilobuerger](https://github.com/danilobuerger)) -- This PR removes the `find-node.sh` scripts and replaces it with an `.xcode.env` file that is sourced by the script phases that needs it. The `.xcode.env` file is versioned: to customize a local environment, an unversioned `.xcode.local.env` can be used. ([0480f56c5b](https://github.com/facebook/react-native/commit/0480f56c5b5478b6ebe5ad88e347cad2810bfb17) by [@cipolleschi](https://github.com/cipolleschi)) -- Update `PushNotificationIOS.checkPermissions` to include iOS 10+ notification settings. ([17ecd2fb5b](https://github.com/facebook/react-native/commit/17ecd2fb5b3cfb8aa0282ed406b16dc3b9777018)) -- Enable SonarKit in React-Core when the configuration is `'Debug'` ([b5343a6b0d](https://github.com/facebook/react-native/commit/b5343a6b0dd07c1b4ef9dac549df67a4d68ebd1e) by [@cipolleschi](https://github.com/cipolleschi)) -- When Hermes is enabled, the Hermes Engine will be built from source instead of using the pre-built `hermes-engine` CocoaPod. ([12ad1fffe8](https://github.com/facebook/react-native/commit/12ad1fffe87c0c5ab2e001f318ff4f8d3eda7479) by [@hramos](https://github.com/hramos)) -- Replaced folly::Optional with std::optional from C++17 in Objc module generator. ([45e2941367](https://github.com/facebook/react-native/commit/45e2941367fbf13584193bbda598173802289167) by [@philIip](https://github.com/philIip)) -- Removed methodName parameter that was used only for a warning message and moved the warning parameter to be calculated inline. ([cfb11ca2f6](https://github.com/facebook/react-native/commit/cfb11ca2f67c59c090b8a58b2b7bdaacef0e19df)) -- Fix the crash caused by nil partialLoadHandler ([46bc521513](https://github.com/facebook/react-native/commit/46bc521513c9c78e5ffc49cf3e571757e1a91cef)) -- Synchronously render cached images ([189c2c8958](https://github.com/facebook/react-native/commit/189c2c8958442541c6b4f42860b2943ece612da2)) -- Updated Flipper-Glog to 0.5.0.4 ([cd60ffdb62](https://github.com/facebook/react-native/commit/cd60ffdb62b2183cd24baef3075d56f758cea24a)) -- Add function to report early js errors ([1804951595](https://github.com/facebook/react-native/commit/180495159517dc0bfa103621e5ff62fc04cb3c8b) by [@sshic](https://github.com/sshic)) - -### Deprecated - -- Deprecate the use of `react-native/jest/preprocessor.js` by external projects ([c1e9aa9a27](https://github.com/facebook/react-native/commit/c1e9aa9a272aed3cba60c4aeff783eeb8bffce68) by [@motiz88](https://github.com/motiz88)) -- Deprecate the Promise.prototype.done method and log a warning when it's called in development. ([35800962c1](https://github.com/facebook/react-native/commit/35800962c16a33eb8e9ff1adfd428cf00bb670d3) by [@motiz88](https://github.com/motiz88)) - -#### iOS specific - -- Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required ([5f2835b14d](https://github.com/facebook/react-native/commit/5f2835b14d35681c268dd64d6ec284ea5f053be3), ([c71e6efbcd](https://github.com/facebook/react-native/commit/c71e6efbcd2b95faee327d9763d321488120bc5e), ([982ca30de0](https://github.com/facebook/react-native/commit/982ca30de079d7e80bd0b50365d58b9048fb628f) by [@philIip](https://github.com/philIip)) - -#### iOS specific - -- Removed lint restricting `DynamicColorIOS` to only two properties ([13b0b06522](https://github.com/facebook/react-native/commit/13b0b0652259ada468cc044b0b604edb666b2eb9)) - -### Fixed - -- Remove unactionable warning about `codegenNativeComponent` when on 'Paper' ([494b73cb33](https://github.com/facebook/react-native/commit/494b73cb33197fa865e9ead8fdca11bce6822917) by [@tido64](https://github.com/tido64)) -- Fix typo in Value's constructor with a Symbol ([a7a0f86a73](https://github.com/facebook/react-native/commit/a7a0f86a73ab51be31fb2c3205612d7ff1fb5384) by [@jpporto](https://github.com/jpporto)) -- Avoid full copy of large folly::dynamic objects by switching to std::move semantics ([3f98c8e4c2](https://github.com/facebook/react-native/commit/3f98c8e4c2c8f40b81c1a90aa65c1bdc9327faed) by [@NikoAri](https://github.com/NikoAri)) -- Fix performance issue on Animated.interpolate with big input range ([f503b21203](https://github.com/facebook/react-native/commit/f503b212039f79f00ea56b65ecf3cd150b82f087) by [@Almouro](https://github.com/Almouro)) -- Update function spacing linting rules ([8650220cf9](https://github.com/facebook/react-native/commit/8650220cf99739c4b904a37ce4f19ce7dfd3bdbb) by [@joeframbach](https://github.com/joeframbach)) -- Add supportsFromJs and supportsToJs template variables ([087624ccaf](https://github.com/facebook/react-native/commit/087624ccaf2e484c0b6425e57edf9afd62a06e9a) by [@appden](https://github.com/appden)) -- The Array appended to FormData is transmitted as a string ([d2e8e7d58e](https://github.com/facebook/react-native/commit/d2e8e7d58e680e0bb3b4da1f820dd4dd840639f5) by [@bang9](https://github.com/bang9)) -- AppState.removeEventListener correctly removes listener for blur and focus events ([9aab25ec53](https://github.com/facebook/react-native/commit/9aab25ec536473ffe6d22c5efeae8fea6bd769be) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) -- `focus()` on TextInput to respect its `editable` state ([8a5460ce80](https://github.com/facebook/react-native/commit/8a5460ce80e69c11a007121d4278d55642f6b10e) by [@vonovak](https://github.com/vonovak)) -- Restore Windows build with RawPropsParser.cpp ([2d64d1d693](https://github.com/facebook/react-native/commit/2d64d1d69360161c047c86a026403d8074ba28bb) by [@TatianaKapos](https://github.com/TatianaKapos)) -- Fix babel-plugin-codegen crash when export init is null ([ae756647c9](https://github.com/facebook/react-native/commit/ae756647c9b8a88ba615fd30185f621825a33427) by [@janicduplessis](https://github.com/janicduplessis)) -- Fixed compilation warning due to `using namespace` being used as part of header ([009d80bf5a](https://github.com/facebook/react-native/commit/009d80bf5a55dd74be448960b1344ac7599c6bae) by [@arhelmus](https://github.com/arhelmus)) -- Allow including TurboModule.h in mixed rtti/no-rtti environment, even if TurboModule.h/cpp is compiled without RTTI. ([1f87729697](https://github.com/facebook/react-native/commit/1f87729697370a4ab31e2bb9ab1780438d9e146f) by [@nlutsenko](https://github.com/nlutsenko)) -- Remove prettier from dependencies in eslint-config ([2db1bca952](https://github.com/facebook/react-native/commit/2db1bca95224ce39484c3f27508aec9a21ce126a) by [@Kerumen](https://github.com/Kerumen)) -- Switch Component doesn't disable click functionality when disabled ([b2e625a517](https://github.com/facebook/react-native/commit/b2e625a51723becea4cef0433448fbec679669ee) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Support numeric color values in StyleSheet's Flow types ([83b1975b90](https://github.com/facebook/react-native/commit/83b1975b90569a36020da33156615a13fcc7ba92) by [@motiz88](https://github.com/motiz88)) -- Fix build break on Windows with ReactCommon ([42b391775f](https://github.com/facebook/react-native/commit/42b391775f663df335f6f2553104fc2fa35b1bee) by [@chiaramooney](https://github.com/chiaramooney)) -- Fixed opacity value in TouchableOpacity ([3eddc9abb7](https://github.com/facebook/react-native/commit/3eddc9abb70eb54209c68aab7dbd69e363cc7b29) by [@hetanthakkar1](https://github.com/hetanthakkar1)) -- Remove illegal private property access in VirtualizedSectionList.scrollToLocation ([b2f871a6fa](https://github.com/facebook/react-native/commit/b2f871a6fa9c92dd0712055384b9eca6d828e37d) by [@motiz88](https://github.com/motiz88)) -- JS animated node value updates properly when listener is attached ([1f778014a7](https://github.com/facebook/react-native/commit/1f778014a7e95c5c473898c38d5b1e0725cd373c) by [@genkikondo](https://github.com/genkikondo)) -- Working around Long paths limitation on Windows ([7b76abc0d3](https://github.com/facebook/react-native/commit/7b76abc0d3a0a5bec37f314c80954e412fc5f5ec) by [@mganandraj](https://github.com/mganandraj)) -- Fix VirtualizedList with initialScrollIndex not rendering all elements when data is updated ([c5c17985da](https://github.com/facebook/react-native/commit/c5c17985dae402725abb8a3a94ccedc515428711) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) - -#### Android specific - -- Add back hermes inspector support ([6b6adcc111](https://github.com/facebook/react-native/commit/6b6adcc111123bec2c4c110070b2506385e74664) by [@Kudo](https://github.com/Kudo)) -- Fixed issue where any node with an AccessibilityDelegate set (which was any node with any accessibility propoerty), was using ExploreByTouchHelper's built in AccessibilityNodeProvider, and not properly populating their AccessibilityNodeInfo's, leading to focus issues and issues with automated test services like UIAutomator. ([70fcab76a4](https://github.com/facebook/react-native/commit/70fcab76a4dcf65e628ac897620fe050758574e3) by [@blavalla](https://github.com/blavalla)) -- Fix Extras usage in Android implementation of Linking.sendIntent() ([86f8d0bb52](https://github.com/facebook/react-native/commit/86f8d0bb528a75777c357ae214643ed58c326ca9)) -- Fix typo in gradle plugin deprecation message ([41cfd2f976](https://github.com/facebook/react-native/commit/41cfd2f9768e4742eedd299ab467d316d016705e) by [@mikehardy](https://github.com/mikehardy)) -- Fixed `TimingModule` related functions for headless JS tasks, eg. `setTimeout` ([dac56ce077](https://github.com/facebook/react-native/commit/dac56ce0776e0e4d23ed4f8b324f2e2432aefa6a) by [@marcesengel](https://github.com/marcesengel)) -- Improve support for Android users on M1 machine ([c5babd993a](https://github.com/facebook/react-native/commit/c5babd993a2bed2994ecc4710fa9e424b3e6cfc2) by [@cortinico](https://github.com/cortinico)) -- Do not use `rootProject` directly in Gradle scripts ([b2bc5aa5c9](https://github.com/facebook/react-native/commit/b2bc5aa5c903ad057a53d4caa82b0fe74e01c07c) by [@cortinico](https://github.com/cortinico)) -- Adding null check for context in redbox surface delegate ([9527ab1584](https://github.com/facebook/react-native/commit/9527ab1584869d7966c562e8aa7cbf48788156a3) by [@ryancat](https://github.com/ryancat)) -- Fix crash on empty snapToOffsets array ([145fd041c7](https://github.com/facebook/react-native/commit/145fd041c7afe9a18f08f461487bb515ab2f516a) by [@ryancat](https://github.com/ryancat)) -- Fix StatusBar not updating to use translucent values when set to the same value across different activities ([d34a75e9e5](https://github.com/facebook/react-native/commit/d34a75e9e5932adcac4a16f5b815bb909c3aa0dd)) -- Fix underlineColorAndroid transparent not working on API 21 ([52aee50a70](https://github.com/facebook/react-native/commit/52aee50a704bbeab91f5fa05fe3220dee304422f) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Fixed regression on content in scroll view not responding to touch when fling got interrupted ([bb8ff9260f](https://github.com/facebook/react-native/commit/bb8ff9260fe6a783171f35ce1a459927d8179d08) by [@ryancat](https://github.com/ryancat)) -- Fixes android build error when compiling as library ([c34ef5841c](https://github.com/facebook/react-native/commit/c34ef5841cf3a63a9cc96add577d6bf6d52e4397) by [@nickfujita](https://github.com/nickfujita)) -- Cancel post touch process when new touch is received ([0368081858](https://github.com/facebook/react-native/commit/0368081858193d7c2537acd9080d11bb701ee98b) by [@ryancat](https://github.com/ryancat)) -- Improve rendering of images when resampled and corner radius applied ([f743bed657](https://github.com/facebook/react-native/commit/f743bed657591b078300a6519e3d68db542fd757) by [@javache](https://github.com/javache)) -- Fix transform when calculate overflowInset ([0975e96d53](https://github.com/facebook/react-native/commit/0975e96d53546ac05b2154352fe56e5d82e2a1f8) by [@ryancat](https://github.com/ryancat)) -- Fix ReactHorizontalScrollView contentOffset ([9f6f97151c](https://github.com/facebook/react-native/commit/9f6f97151c44a0f727c9dd938222be1860ecf3f9) by [@genkikondo](https://github.com/genkikondo)) -- Text Component does not announce disabled and disables click functionality when disabled ([7b2d8178b1](https://github.com/facebook/react-native/commit/7b2d8178b155f5f1b247614c46e5e20f31bbd438) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Fix StatusBar on Android API 30 ([9ed2df628d](https://github.com/facebook/react-native/commit/9ed2df628ddd410cc3383e68b0386471432445c0) by [@ieatfood](https://github.com/ieatfood)) -- Use root locale when converting string case. ([5341ad8962](https://github.com/facebook/react-native/commit/5341ad896245c40a00b6faead1b90d01aac58f8c) by [@halaei](https://github.com/halaei)) -- Fix DarkMode on Calendar DateTimePicker ([97064ae1fb](https://github.com/facebook/react-native/commit/97064ae1fbf84a8a6b653c02c5872191b7d2d622) by [@mdvacca](https://github.com/mdvacca)) -- Fix ScrollView contentOffset ([be260b9f47](https://github.com/facebook/react-native/commit/be260b9f479a3b55ee43d2959d2c49fd3c1eb4ac) by [@genkikondo](https://github.com/genkikondo)) -- Do not bundle libhermes.so or libjsc.so inside the React Native Android AAR ([fa85417179](https://github.com/facebook/react-native/commit/fa854171798e67b8a10820f77d7198315e1784ed) by [@cortinico](https://github.com/cortinico)) -- Enable hitSlop to be set using a single number. ([d682753244](https://github.com/facebook/react-native/commit/d682753244feba28c6a15c31966a3da075a090e6) by [@javache](https://github.com/javache)) -- Fix crash caused by Image.queryCache parsing null ([ae3d4f7008](https://github.com/facebook/react-native/commit/ae3d4f700843ae4cbb6927ee620095136d1abc3f) by [@skychx](https://github.com/skychx)) -- Fix NullPointerException when disaptching events ([fbeb51ef51](https://github.com/facebook/react-native/commit/fbeb51ef5133303a5cb71569507d44403ded3447) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific - -- ScrollView's contentInsetAdjustmentBehavior is reset to Never at every reuse to avoid layout artifacts. ([28a65f4387](https://github.com/facebook/react-native/commit/28a65f438789c29309d6e7c58063a73ca721ef43)) -- Prevent Nullptr segfault in TurboModule init path ([7f3cc256b5](https://github.com/facebook/react-native/commit/7f3cc256b5bcbf2e64540ca69401f62ec6869f0e) by [@RSNara](https://github.com/RSNara)) -- Expose the extraData dict attached to JavaScript errors to the native ExceptionManager on iOS, similar to Android ([a65ae8eff6](https://github.com/facebook/react-native/commit/a65ae8eff6ec6f9ad283ac8e96f00802421a14da) by [@GijsWeterings](https://github.com/GijsWeterings)) -- `RCTLocalizationProvider` Fall back to input when no localization is available ([18196512db](https://github.com/facebook/react-native/commit/18196512db6b8b4469a5e1b098d8892ae72d743a) by [@robhogan](https://github.com/robhogan)) -- Update iOS LogBox to render its UIWindow with the key window's UIWindowScene ([d31d83f410](https://github.com/facebook/react-native/commit/d31d83f4109c167ec612058c805fd65f69b82476) by [@vincentriemer](https://github.com/vincentriemer)) -- Remove Gemfile.lock from template ([1907bd31f0](https://github.com/facebook/react-native/commit/1907bd31f066865aa1c5fe4ec88e98ee46448771) by [@danilobuerger](https://github.com/danilobuerger)) -- Fix `pod install` when `RCT-Folly` version has been updated. ([b2517c3bdc](https://github.com/facebook/react-native/commit/b2517c3bdccc3f9d935f4ee06f959d6ce8f27bbe) by [@fortmarek](https://github.com/fortmarek)) -- Fix usage of cocoapods with --project-directory flag and new arch ([2f813f873a](https://github.com/facebook/react-native/commit/2f813f873a1692044ea3461e59ca732a4d952300) by [@danilobuerger](https://github.com/danilobuerger)) -- Ensure LogBoxView is sized relative to the key window instead of the full screen ([84f8c9ad55](https://github.com/facebook/react-native/commit/84f8c9ad550f98295d2e718b4b1d6b1ac724b898) by [@vincentriemer](https://github.com/vincentriemer)) -- Improved template fastlane gitignore ([f43f05d292](https://github.com/facebook/react-native/commit/f43f05d292fd2fbdf3d5fdfd194ed81b0e346657) by [@danilobuerger](https://github.com/danilobuerger)) -- Set RCTView borderColor to UIColor ([267d36d0af](https://github.com/facebook/react-native/commit/267d36d0afb4b3713df9b679c2019c44ac6bcc3f) by [@danilobuerger](https://github.com/danilobuerger)) -- Fix action sheet callback invoked more than once on iPad ([8935d6e697](https://github.com/facebook/react-native/commit/8935d6e697dffb0971f5a8ee1dfbc580080de3e0) by [@janicduplessis](https://github.com/janicduplessis)) -- Resolve border platform color based on current trait collection ([9a35818797](https://github.com/facebook/react-native/commit/9a3581879764f3f1b2743905e3e54611e96bb618) by [@danilobuerger](https://github.com/danilobuerger)) -- Enable custom sound for local push notifications. ([eb19499484](https://github.com/facebook/react-native/commit/eb1949948406195c4c02c6041d07cba074ae820c)) -- Invoke registerForRemoteNotifications on main UI thread. ([3633a05299](https://github.com/facebook/react-native/commit/3633a05299d99b12acc5c3c056b977463df1924e)) -- Bump flipper pods to get arm64 catalyst slice ([f811da7cc2](https://github.com/facebook/react-native/commit/f811da7cc20cc49ca5c8d4e023d6c61e36e15dd1) by [@fortmarek](https://github.com/fortmarek)) -- Fix `pod install --project-directory=ios` failing when Hermes is enabled ([1b22e8a039](https://github.com/facebook/react-native/commit/1b22e8a039081887ffd450596d822bff975d6900), ([eb7cc85a91](https://github.com/facebook/react-native/commit/eb7cc85a9146d058694247178f03d57cc125c97a) by [@tido64](https://github.com/tido64)) -- Fix compilation warning in yoga ([52d8a797e7](https://github.com/facebook/react-native/commit/52d8a797e7a6be3fa472f323ceca4814a28ef596) by [@cuva](https://github.com/cuva)) -- Prevent deadlock when dispatching events from observers on the same thread. ([68fd1e5508](https://github.com/facebook/react-native/commit/68fd1e55085e871a854563721ee29ca698239607) by [@Pickleboyonline](https://github.com/Pickleboyonline)) -- In RCTSurfaceHostingComponent, access ckComponent from main queue to pass assertion ([1874c81003](https://github.com/facebook/react-native/commit/1874c81003b468554c227541fec5e29c4adfb82f) by [@p-sun](https://github.com/p-sun)) -- Fix modal redbox for onDismiss ([46f68aceb2](https://github.com/facebook/react-native/commit/46f68aceb20a10c95c92b5ffeb90f289b015a559) by [@HeyImChris](https://github.com/HeyImChris)) -- Attempt to fix crash during app termination ([9cd43340a7](https://github.com/facebook/react-native/commit/9cd43340a7e2443564c2ff5e8e85d37f6e1e47ef) by [@sammy-SC](https://github.com/sammy-SC)) - -### Security - -- Encode URL params in URLSearchParams.toString() ([1042a8012f](https://github.com/facebook/react-native/commit/1042a8012fb472bd5c882b469fe507dd6279d562) by [@sshic](https://github.com/sshic)) - -## v0.68.7 - -### Fixed - -- Use logical operator instead of bit operation in Yoga ([c3ad8](https://github.com/facebook/react-native/commit/c3ad8ec7eb01b7236e0081ac7c7f888630caac21) by [@cuva](https://github.com/cuva)) - -#### Android specific - -- Minimize EditText Spans 8/N: CustomStyleSpan ([b384bb613b](https://github.com/facebook/react-native/commit/b384bb613bf533aebf3271ba335c61946fcd3303) by [@NickGerleman](https://github.com/NickGerleman)) -- Minimize EditText Spans 6/N: letterSpacing ([5791cf1f7b](https://github.com/facebook/react-native/commit/5791cf1f7b43aed1d98cad7bcc272d97ab659111) by [@NickGerleman](https://github.com/NickGerleman)) -- Minimize Spans 5/N: Strikethrough and Underline ([0869ea29db](https://github.com/facebook/react-native/commit/0869ea29db6a4ca20b9043d592a2233ae1a0e7a2) by [@NickGerleman](https://github.com/NickGerleman)) -- Minimize Spans 4/N: ReactForegroundColorSpan ([8c9c8ba5ad](https://github.com/facebook/react-native/commit/8c9c8ba5adb59f7f891a5307a0bce7200dd3ac7d) by [@NickGerleman](https://github.com/NickGerleman)) -- Minimize Spans 3/N: ReactBackgroundColorSpan ([cc0ba57ea4](https://github.com/facebook/react-native/commit/cc0ba57ea42d876155b2fd7d9ee78604ff8aa57a) by [@NickGerleman](https://github.com/NickGerleman)) -- Minimize Spans 1/N: Fix precedence ([1743dd7ab4](https://github.com/facebook/react-native/commit/1743dd7ab40998c4d3491e3b2c56c531daf5dc47) by [@NickGerleman](https://github.com/NickGerleman)) -- Fix measurement of uncontrolled TextInput after edit ([8a0fe30591](https://github.com/facebook/react-native/commit/8a0fe30591e21b90a3481c1ef3eeadd4b592f3ed) by [@NickGerleman](https://github.com/NickGerleman)) - -## v0.68.6 - -### Fixed - -#### Android specific - -- Mitigation for Samsung TextInput Hangs ([be69c8b5a7](https://github.com/facebook/react-native/commit/be69c8b5a77ae60cced1b2af64e48b90d9955be5) by [@NickGerleman](https://github.com/NickGerleman)) - -## v0.68.6 - -### Fixed - -#### Android specific - -- Mitigation for Samsung TextInput Hangs ([be69c8b5a7](https://github.com/facebook/react-native/commit/be69c8b5a77ae60cced1b2af64e48b90d9955be5) by [@NickGerleman](https://github.com/NickGerleman)) - -## v0.68.5 - -### Fixed - -- Force dependencies resolution to minor series for 0.68 ([edcb3ca996](https://github.com/facebook/react-native/commit/edcb3ca996fb3296762af300a36c1d46356f1b24) by [@Titozzz](https://github.com/Titozzz)) - -## v0.68.4 - -### Changed - -- Bump version of `promise` from 8.0.3 to 8.2.0, enabling `Promise.allSettled` ([951538c080](https://github.com/facebook/react-native/commit/951538c080ef745da304fb308fa91d597e0dd98a) by [@retyui](https://github.com/retyui)) -- Bump react-native-codegen to 0.0.18 ([40a3ae3613](https://github.com/facebook/react-native/commit/40a3ae3613394fe5f0d728bada538d2d5b78a8a4) by [@dmytrorykun](https://github.com/dmytrorykun)) - -#### Android specific - -- Correctly resolve classes with FindClass(..) ([361b310bcc](https://github.com/facebook/react-native/commit/361b310bcc8dddbff42cf63495649291c894d661) by [@evancharlton](https://github.com/evancharlton)) - -### Fixed - -- Codegen should ignore `.d.ts` files ([0f0d52067c](https://github.com/facebook/react-native/commit/0f0d52067cb89fdb39a99021f0745282ce087fc2) by [@tido64](https://github.com/tido64)) - -#### iOS specific - -- Fix the way the orientation events are published ([7d42106d4c](https://github.com/facebook/react-native/commit/7d42106d4ce20c644bda4d928fb0abc163580cee) by [lbaldy](https://github.com/lbaldy)) - -## v0.68.3 - -### Changed - -#### Android specific - -- Let's not build reactnativeutilsjni shared library ([af9225ec5f](https://github.com/facebook/react-native/commit/af9225ec5fd22da802e3da4d786fa7f6ec956b0f) by [@SparshaSaha](https://github.com/SparshaSaha)) -- Modified **getDefaultJSExecutorFactory** method ([87cfd386cb](https://github.com/facebook/react-native/commit/87cfd386cb2e02bfa440c94706d9d0274f83070c) by [@KunalFarmah98](https://github.com/KunalFarmah98)) - -### Fixed - -- Use monotonic clock for performance.now() ([114d31feee](https://github.com/facebook/react-native/commit/114d31feeeb47f5a57419e5088c3cbe9340f757a)) - -#### Android specific - -- Logging a soft error when ReactRootView has an id other than -1 instead of crashing the app in hybrid apps ([1ca2c24930](https://github.com/facebook/react-native/commit/1ca2c2493027c1b027146cd41e17dd8a4fc33a41) by [@Kunal-Airtel2022](https://github.com/Kunal-Airtel2022)) - -## v0.68.2 - -### Changed - -- Bump used version of react-native-codegen to 0.0.17 ([dfda480a98](https://github.com/facebook/react-native/commit/dfda480a9888d95c542cea40f25e8e783565c1db) by [@cortinico](https://github.com/cortinico)) -- Bump react-native-codegen to 0.0.17 ([a5ddc2e165](https://github.com/facebook/react-native/commit/a5ddc2e16523ea336ffbecf7acfd4820469a29e7) by [@cortinico](https://github.com/cortinico)) - -### Fixed - -#### Android specific - -- Working around Long paths limitation on Windows ([62ef6f5fa1](https://github.com/facebook/react-native/commit/62ef6f5fa1ecb918bde130a6024b65afcd34c7e3) by [@mganandraj](https://github.com/mganandraj)) - -## v0.68.1 - -### Changed - -#### Android specific - -- Bump React Native Gradle plugin to 0.0.6 ([9573d7b84d](https://github.com/facebook/react-native/commit/9573d7b84d35233fbb39a4067cfef65490aa34a7) by [@cortinico](https://github.com/cortinico)) -- Don't require yarn for codegen tasks ([d5da70e17e](https://github.com/facebook/react-native/commit/d5da70e17e8c8210cd79a4d7b09c6a5ded4b5607) by [@danilobuerger](https://github.com/danilobuerger)) - -### Fixed - -- Fix dynamic_cast (RTTI) by adding key function to ShadowNodeWrapper and related classes ([58a2eb7f37](https://github.com/facebook/react-native/commit/58a2eb7f37c2dc27ad3575618778ad5b23599b27) by [@kmagiera](https://github.com/kmagiera)) -- Pin use-subscription to < 1.6.0 ([5534634892](https://github.com/facebook/react-native/commit/5534634892f47a3890e58b661faa2260373acb25) by [@danilobuerger](https://github.com/danilobuerger)) - -#### Android specific - -- Use NDK 23 only for Windows users. ([e48a580080](https://github.com/facebook/react-native/commit/e48a580080bdae58b375f30fbcf8a83cc1915b2f) by [@cortinico](https://github.com/cortinico)) -- Improve support for Android users on M1 machine ([4befd2a29c](https://github.com/facebook/react-native/commit/4befd2a29cb94b026d9c048a041aa9f1817295b5) by [@cortinico](https://github.com/cortinico)) -- Template: Specify abiFilters if enableSeparateBuildPerCPUArchitecture is not set. ([5dff920177](https://github.com/facebook/react-native/commit/5dff920177220ae5f4e37c662c63c27ebf696c83) by [@cortinico](https://github.com/cortinico)) -- Fix for building new architecture sources on Windows ([5a8033df98](https://github.com/facebook/react-native/commit/5a8033df98296c941b0a57e49f2349e252339bf9) by [@mganandraj](https://github.com/mganandraj)) - -## v0.68.0 - -### Breaking Changes - -- CI moved to Node 16. ([f1488db109](https://github.com/facebook/react-native/commit/f1488db109d13e748b071c02b40e90cdca1cc79d) by [@kelset](https://github.com/kelset)). - This change enforces Node >= 14 for React Native builds. -- Bump Android Gradle Plugin to 7.0.1. ([272cfe5d13](https://github.com/facebook/react-native/commit/272cfe5d1371c38a281cf3883ff0254a8d3505a3) by [@dulmandakh](https://github.com/dulmandakh)) - This version of Android Gradle plugin enforces JDK 11 for Android builds. Do not upgrade to AGP 7.1 as it is not supported by this version of react-native. -- Removed `fallbackResource` from `RCTBundleURLProvider` API ([0912ee179c](https://github.com/facebook/react-native/commit/0912ee179c210fb6b2ed9afbb3f2fbc5fb8a2bb3)) by [@philIip](https://github.com/philIip) - -### New Architecture - -*If you are interested in enabling the new architecture, please refer to [the dedicated documentation](https://reactnative.dev/docs/next/new-architecture-intro).* - -- Do not include Facebook license on users codegen'd code ([450967938a](https://github.com/facebook/react-native/commit/450967938ab25c4dabb9d5ecd9f7b57afb1c78dd) by [@cortinico](https://github.com/cortinico)) - -#### Android specific - -- Setup a `newArchEnabled` property to Opt-in the New Architecture in the template ([8d652fba4c](https://github.com/facebook/react-native/commit/8d652fba4ce07256784a1b7e86713c810336856d) by [@cortinico](https://github.com/cortinico)) - -#### iOS specific - -- Add fabric option to the default app template. ([2e9a376c84](https://github.com/facebook/react-native/commit/2e9a376c8488d1fb11c0b5d604137712321fd90d) by [@sota000](https://github.com/sota000)) -- Add turbo module support in the default app template. ([8ec0e6919c](https://github.com/facebook/react-native/commit/8ec0e6919c5fab118c8b54538860ee36009bfaa7) by [@sota000](https://github.com/sota000)) -- Rename the new architecture flag to RCT_NEW_ARCH_ENABLED. ([c0c5439959e](https://github.com/facebook/react-native/commit/c0c5439959e21d7806178bb9139c2cd19b857506) by [@sota000](https://github.com/sota000)) - -### Added - -- Create @fb-tools-support/yarn package ([7db294d6d5](https://github.com/facebook/react-native/commit/7db294d6d5b00a38f305dd52be3e0961f35695c8) by [@motiz88](https://github.com/motiz88)) -- Support string color values in Animated.Color ([d3a0c4129d](https://github.com/facebook/react-native/commit/d3a0c4129d6a5a7beced4e9aa62b2da4e3f4fed4)) -- New Animated.Color node ([ea90a76efe](https://github.com/facebook/react-native/commit/ea90a76efef60df0f46d29228289f8fc1d26f350)) -- Added linter warning config for unstable nested components ([988fefc44d](https://github.com/facebook/react-native/commit/988fefc44d39957e8c5e1eecb02dfd1ce119f34c) by [@javache](https://github.com/javache)) -- Option to supply `platformConfig` to NativeAnimated ([4a227ce2ab](https://github.com/facebook/react-native/commit/4a227ce2ab3f8c181150461ab28b831979093db0) by [@rozele](https://github.com/rozele)) -- Animated.event can be used to extract values with numeric keys from native events ([b2105711a0](https://github.com/facebook/react-native/commit/b2105711a0b90859f8e3fc1aaec4998e252c2d14) by [@javache](https://github.com/javache)) -- Adds a setSelection imperative method to TextInput ([771ca921b5](https://github.com/facebook/react-native/commit/771ca921b59cc3b3fd12c8fe3b08ed150bcf7a04) by [@lyahdav](https://github.com/lyahdav)) -- Native-only prop to optimize text hit testing on some RN platforms ([f3bf2e4f51](https://github.com/facebook/react-native/commit/f3bf2e4f51897f1bb71e37002c288ebf3b23cf78) by [@rozele](https://github.com/rozele)) - -#### Android specific - -- Added DoNotStripAny proguard rules ([48318b1542](https://github.com/facebook/react-native/commit/48318b1542910b939ab977c0bc82e98f098abe50) by [@ShikaSD](https://github.com/ShikaSD)) -- Add new API in ScrollView and HorizontalScrollView to process pointerEvents prop. ([48f6967ae8](https://github.com/facebook/react-native/commit/48f6967ae88100110160e1faf03e6c0d37e404bd) by [@ryancat](https://github.com/ryancat)) -- Add `accessibilityLabelledBy` props ([36037fa81b](https://github.com/facebook/react-native/commit/36037fa81bbdcc460057e7e7cf608cd364ca48a6) by [@grgr-dkrk](https://github.com/grgr-dkrk)) -- Added missing constructor to WritableNativeArray ([c68c47d2ba](https://github.com/facebook/react-native/commit/c68c47d2bafa8e8e25b534d6cdd1a63bc77a1cf4) by [@piaskowyk](https://github.com/piaskowyk)) -- Add new API for custom fling animator to provide predicted travel distance for its fling animation. ([fe6277a30d](https://github.com/facebook/react-native/commit/fe6277a30d3ec19e4772991e30ae20c3a9cfe565) by [@ryancat](https://github.com/ryancat)) -- Adding new API `onChildEndedNativeGesture` to the RootView interface to let its implementations notify the JS side that a child gesture is ended. ([9b33c31ee0](https://github.com/facebook/react-native/commit/9b33c31ee024bae30e441107f838e1b5044525ba) by [@ryancat](https://github.com/ryancat)) -- Make the `reactNativeArchitectures` property more discoverable ([0f39a1076d](https://github.com/facebook/react-native/commit/0f39a1076dc154995a2db79352adc36452f46210) by [@cortinico](https://github.com/cortinico)) -- Added `isAccessibilityServiceEnabled` to get if accessibility services are enabled ([c8b83d4e0b](https://github.com/facebook/react-native/commit/c8b83d4e0b33c2af45093f7b2262ee578ece2faf) by [@grgr-dkrk](https://github.com/grgr-dkrk)) -- Add bundleForVariant option ([d2c10da5d5](https://github.com/facebook/react-native/commit/d2c10da5d5687833545691f281473381e4466c2e) by [@grit96](https://github.com/grit96)) -- Add ACCEPT_HANDOVER, ACTIVITY_RECOGNITION, ANSWER_PHONE_CALLS, READ_PHONE_NUMBERS & UWB_RANGING to PermissionsAndroid ([4b25a0aaa0](https://github.com/facebook/react-native/commit/4b25a0aaa077caf9c437bcfeef8a226eda5a102e) by [@iBotPeaches](https://github.com/iBotPeaches)) - -#### iOS specific - -- Add new argument to announceForAccessibility to allow queueing on iOS ([4d1357918a](https://github.com/facebook/react-native/commit/4d1357918a4dcb331ccea2140699f487ca45ea30) by [@peterc1731](https://github.com/peterc1731)) -- Add volta support to find-node.sh ([765844055b](https://github.com/facebook/react-native/commit/765844055ba0d02262a11114bad5da67e935d8df) by [@liamjones](https://github.com/liamjones)) -- Support fnm when detecting node binary ([c9e4d34885](https://github.com/facebook/react-native/commit/c9e4d3488578d65e55198ad597252a2ac8cc5f73) by [@MoOx](https://github.com/MoOx)) -- Find-node.sh now respects .nvmrc ([35bcf934b1](https://github.com/facebook/react-native/commit/35bcf934b186e581d100d43e563044300759557f) by [@igrayson](https://github.com/igrayson)) -- Add macros to be able to stub C functions in tests ([749a9207b6](https://github.com/facebook/react-native/commit/749a9207b6f0545c03ca83efbda7971ffd4d2d57) by [@philIip](https://github.com/philIip)) - - -### Changed - -- Bump RN CLI to v7.0.3, and Metro to 67 ([848ba6fb1d](https://github.com/facebook/react-native/commit/848ba6fb1db81bbb44efd373af9e81f31f227aef) by [@kelset](https://github.com/kelset)) and ([df2e934a69](https://github.com/facebook/react-native/commit/df2e934a697b5b207053db3bbcf71492932a6062) by [@kelset](https://github.com/kelset)) -- Upgraded react-devtools-core dependency to 4.23.0 ([1cc217d5ef](https://github.com/facebook/react-native/commit/1cc217d5effdbee4cf2f64063a443ecb331673d4) by [@bvaughn](https://github.com/bvaughn)) -- Bump Flipper to 0.125.0 ([50057158ca](https://github.com/facebook/react-native/commit/50057158ca32842d70160541e3cb5d4bd512f8f5) by [@cortinico](https://github.com/cortinico)) -- Export Flow type for deceleration rate for use in other files to keep deceleration rate prop values consistently typed ([9b0ed920ef](https://github.com/facebook/react-native/commit/9b0ed920ef087c4c18504adacf9d4f557812cf1b)) -- Upgrade deprecated-react-native-prop-types dependency ([badd30885f](https://github.com/facebook/react-native/commit/badd30885fb999124b6b54b3fb016edbd988c16b) by [@chiaramooney](https://github.com/chiaramooney)) -- Improved error message in react.gradle ([7366a866b3](https://github.com/facebook/react-native/commit/7366a866b381db6fc5615153e7788aa4828cfd96) by [@vonovak](https://github.com/vonovak)) -- Upgraded packages to the latest versions for ESLint v7. ([cf763cdf81](https://github.com/facebook/react-native/commit/cf763cdf816e1cad20caf2347c54bc96c7f6dd47) by [@yungsters](https://github.com/yungsters)) -- Updated the links for the discussions and changelog ([daf37a1fce](https://github.com/facebook/react-native/commit/daf37a1fce43403e6320e1e3023e86fd1b970bdf) by [@MikeyAlmighty](https://github.com/MikeyAlmighty)) -- XMLHttpRequest.getAllResponseHeaders() now returns headers with names lowercased and sorted in ascending order, as per specification ([b2415c4866](https://github.com/facebook/react-native/commit/b2415c48669391ee1ab7c6450748c4d91097a666) by [@ascherkus](https://github.com/ascherkus)) -- Bump react-native-codegen to 0.0.9 ([e3a71b019f](https://github.com/facebook/react-native/commit/e3a71b019fa78e2b4b3454ccc59ea9c8cc543b29) by [@cortinico](https://github.com/cortinico)) -- Accessing `Image.propTypes`, `Text.propTypes`, `TextInput.propTypes`, `ColorPropType`, `EdgeInsetsPropType`, `PointPropType`, or `ViewPropTypes` now emits a deprecation warning. ([3f629049ba](https://github.com/facebook/react-native/commit/3f629049ba9773793978cf9093c7a71af15e3e8d) by [@yungsters](https://github.com/yungsters)) -- Bump `core-workflow-apply-version-label` version ([e973b3afc2](https://github.com/facebook/react-native/commit/e973b3afc274f892a0e5a6fdea9004dc5d84eb2b) by [@lucasbento](https://github.com/lucasbento)) -- Add `vendor/bundle` into .gitignore template ([2f67f5d68b](https://github.com/facebook/react-native/commit/2f67f5d68b17010c49f2996a788fe68c1fe2e9f6) by [@MoOx](https://github.com/MoOx)) - -#### Android specific - -- Add allowsEdgeAntialiasing on views with rotations or skew transforms ([e6a3410afe](https://github.com/facebook/react-native/commit/e6a3410afe7d9a4cecf3db0a95503d2ff05bb862)) -- Bump Kotlin version to 1.6.10 ([d0f0234656](https://github.com/facebook/react-native/commit/d0f0234656dc981b422d1e9aa0885afd5fd29879) by [@AKB48](https://github.com/AKB48)) -- Bump Soloader to 0.10.3 ([f45889ef95](https://github.com/facebook/react-native/commit/f45889ef95ec694520e91b0032e591a087e088e5) by [@osartun](https://github.com/osartun)) -- Bump Gradle to 7.3 ([c180627ac7](https://github.com/facebook/react-native/commit/c180627ac7e5e155707b3c9433c4582839e1820e) by [@dulmandakh](https://github.com/dulmandakh)) -- Bump Android compile and target SDK to 31 ([00ac034353](https://github.com/facebook/react-native/commit/00ac034353cbc867991bf79cb1dd103353f47126) by [@ShikaSD](https://github.com/ShikaSD)) -- Use side-by-side NDK for Android ([bd7caa64f5](https://github.com/facebook/react-native/commit/bd7caa64f5d6ee5ea9484e92c3629c9ce711f73c) by [@cortinico](https://github.com/cortinico)) -- Leverage Gradle implicit dependency substitution for Gradle Plugin ([0fccbd53af](https://github.com/facebook/react-native/commit/0fccbd53af86083a8742a33282dc183d07eb27a2) by [@cortinico](https://github.com/cortinico)) -- Remove unused import of JMessageQueueThread.h ([705236e363](https://github.com/facebook/react-native/commit/705236e3637e4f80e5fa4bd7234df9f1e14a5d3d) by [@sshic](https://github.com/sshic)) -- Made `MessageQueueThread#runOnQueue` return a boolean. Made `MessageQueueThreadImpl#runOnQueue` return false when the runnable is not submitted. ([89faf0c9a8](https://github.com/facebook/react-native/commit/89faf0c9a87f6de68ca416d10566dbcbe80d9450)) -- Assume *.ktx assets are packaged as Android drawables ([cb610ddca7](https://github.com/facebook/react-native/commit/cb610ddca79fe29b88568545ab011671fc392c9a) by [@motiz88](https://github.com/motiz88)) -- Add ViewConfigs to support onEnter/onExit/onMove events ([44143b50fd](https://github.com/facebook/react-native/commit/44143b50fdcafe22caa43d76ec3210132ce3af21) by [@mdvacca](https://github.com/mdvacca)) -- Let react_native_assert really abort the app ([2ae06df58f](https://github.com/facebook/react-native/commit/2ae06df58f5f5eaf4386c14d28af25b643401bf3) by [@cortinico](https://github.com/cortinico)) -- Bugfix for multiple shadow threads rendered at the same time, small probability crash. ([9d71b166a6](https://github.com/facebook/react-native/commit/9d71b166a6c9d9afec7186c6a33aedc6975aa43c) by [@chenmo187](https://github.com/chenmo187)) -- RootView's onChildStartedNativeGesture now takes the child view as its first argument ([03e513de41](https://github.com/facebook/react-native/commit/03e513de41bf60f071eacbbb9604c83605abf625) by [@javache](https://github.com/javache)) -- Add ReactInstanceEventListenerV2 for migration ([ce74aa4ed3](https://github.com/facebook/react-native/commit/ce74aa4ed335d4c36ce722d47937b582045e05c4) by [@sshic](https://github.com/sshic)) -- Improved logic of findTargetPathAndCoordinatesForTouch ([dfe42d6b75](https://github.com/facebook/react-native/commit/dfe42d6b75005f519c0e2c87c75e7886dce3345c) by [@javache](https://github.com/javache)) -- Set a resolution strategy for com.facebook.react:react-native when on New Architecture ([e695bc0bb5](https://github.com/facebook/react-native/commit/e695bc0bb50fc1c712e9862ed8fe4e7cc6619fae) by [@cortinico](https://github.com/cortinico)) -- Make hermes-executor-common a static lib ([b2cf24f41c](https://github.com/facebook/react-native/commit/b2cf24f41cb5f15653b34d396ef2a1c90defdf43) by [@janicduplessis](https://github.com/janicduplessis)) -- Static link for hermes-inspector ([20b0eba581](https://github.com/facebook/react-native/commit/20b0eba581a00e5e7e300f6377379b836617c147) by [@janicduplessis](https://github.com/janicduplessis)) - -#### iOS specific - -- Don't capitalize the first letter of a word that is starting by a number ([8b5a5d4645](https://github.com/facebook/react-native/commit/8b5a5d4645136ef3d6ee043348e583cbbac87ee3) by [@MaeIg](https://github.com/MaeIg)) -- updated `jsBundleURLForBundleRoot:fallbackResource` to `jsBundleURLForBundleRoot:` ([aef843bfe6](https://github.com/facebook/react-native/commit/aef843bfe60bda6bcc98d3fb4a6c295c9f4b66e3) by [@philIip](https://github.com/philIip)) -- Remove iOS 11 availability check ([9b059b6709](https://github.com/facebook/react-native/commit/9b059b67092f4e7d568867a2b3a51dfd7c6f1db6) by [@ken0nek](https://github.com/ken0nek)) -- Refactor: Assign string label to each case in RCTPLTag enum for startup performance logging ([60e60a9b3d](https://github.com/facebook/react-native/commit/60e60a9b3d42d342eaf5ddee4841b121f6474a6c) by [@p-sun](https://github.com/p-sun)) -- IOS Ruby Updates ([1e6add1a43](https://github.com/facebook/react-native/commit/1e6add1a43355bb88c57400a7420a656966bef97) by [@barbieri](https://github.com/barbieri)) -- Update Flipper pods to support re-enable macCatalyst ([2a5265dff7](https://github.com/facebook/react-native/commit/2a5265dff7e654f57b43335804840692313f2a56) by [@mikehardy](https://github.com/mikehardy)) -- Apple Silicon builds of glog & Flipper-Glog ([274c617f5b](https://github.com/facebook/react-native/commit/274c617f5bda263ff29115b3dcc013e47085a78d) by [@rayzr522](https://github.com/rayzr522)) - -### Fixed - -- Fix error "mockModal is not a function" ([507b05f4c0](https://github.com/facebook/react-native/commit/507b05f4c02b46109f483a2b79c924a775fd7bd3) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) -- Fixes execution of animation when a toValue of AnimatedValue is used. ([8858c21124](https://github.com/facebook/react-native/commit/8858c2112421be5212c024f9e404e66437a41389)) -- Fix RN version syntax to match new nightly build structure. ([3d1d4ee457](https://github.com/facebook/react-native/commit/3d1d4ee4572600425b8eb5d0d6512bb0d2a6ea44) by [@chiaramooney](https://github.com/chiaramooney)) -- Fix typo in _updateBottomIfNecessary function on KeyboardAvoidingView component ([0cc80b4d0c](https://github.com/facebook/react-native/commit/0cc80b4d0cb78a835977dbe5100262a16882bbea) by [@gabrieldonadel](https://github.com/gabrieldonadel)) -- Fix: Removes interface only check from third party components GenerateThirdPartyFabricComponentsProvider ([3e6902244a](https://github.com/facebook/react-native/commit/3e6902244a0d189261dbbe327296db1349e37410) by [@Ubax](https://github.com/Ubax)) -- Set CxxModules' Instance before retrieving their Method vector. ([1d45b20b6c](https://github.com/facebook/react-native/commit/1d45b20b6c6ba66df0485cdb9be36463d96cf182) by [@JunielKatarn](https://github.com/JunielKatarn)) -- AnimatedValue.__detach should store getValue result with offset deducted ([fe53cae954](https://github.com/facebook/react-native/commit/fe53cae954b37528eeaa1258ac0060c4298473bb) by [@rozele](https://github.com/rozele)) -- AnimatedValue.stopAnimation callback with correct value for NativeAnimated ([8ba771c3dd](https://github.com/facebook/react-native/commit/8ba771c3ddc00b1499e95a2812b4cd5ac904c8df) by [@rozele](https://github.com/rozele)) -- ESLint no-undef rule clashing with TypeScript compiler for TS files ([ae67c5ac45](https://github.com/facebook/react-native/commit/ae67c5ac45a8044fc1db66aee8eae6e881d660e4) by [@fiznool](https://github.com/fiznool)) -- ESLint `no-shadow` rule returning false positive for TypeScript enums ([722a0ff6f8](https://github.com/facebook/react-native/commit/722a0ff6f88bed4d54579a2b8bc574e87948187f) by [@fiznool](https://github.com/fiznool)) -- Fix support for custom port ([b399c2e3d1](https://github.com/facebook/react-native/commit/b399c2e3d10fa521dbec87243d3e96f6bca7df1e) by [@enniel](https://github.com/enniel)) -- `onLayout` prop is handled correctly in `` ([9c5e177a79](https://github.com/facebook/react-native/commit/9c5e177a79c64c77f281ce727538973e8222e975)) -- Modal accepts a testID but didn't forward it to RCTModalHostView, therefore not making it show up for e2e tests depending on viewhierarchy. ([5050e7eaa1](https://github.com/facebook/react-native/commit/5050e7eaa17cb417baf7c20eb5c4406cce6790a5) by [@GijsWeterings](https://github.com/GijsWeterings)) -- Remove unused and incorrect type declarations in WebSocketInterceptor ([91728e2266](https://github.com/facebook/react-native/commit/91728e2266375b954302ba0cd4b5daf641aefc23) by [@mischnic](https://github.com/mischnic)) -- Complete missing Flow declarations in URL ([98abf1b02f](https://github.com/facebook/react-native/commit/98abf1b02f64ad40d523335e677a2ede15b3650d) by [@mischnic](https://github.com/mischnic)) -- Pressable not passing hover props and event handlers to PressabilityConfig ([1b30dd074b](https://github.com/facebook/react-native/commit/1b30dd074b579c2ae138a1111d07ddb56761315d) by [@Saadnajmi](https://github.com/Saadnajmi)) -- Composite animations will now be ran immediately when the app is in testing mode ([b03e824c52](https://github.com/facebook/react-native/commit/b03e824c52123219a5c8fbd89473391bf0bc31c8) by [@javache](https://github.com/javache)) -- Remove duplicate class members ([c0e489b729](https://github.com/facebook/react-native/commit/c0e489b7293f15858cb706f1b8587600e429af28) by [@bradzacher](https://github.com/bradzacher)) -- Fix: Use same implementation for `performance.now()` on iOS and Android ([1721efb54f](https://github.com/facebook/react-native/commit/1721efb54ff9cc4f577b5ae27f13fcf56801a92c) by [@mrousavy](https://github.com/mrousavy)) - -#### Android specific - -- Enable cliPath to have an absolute path value ([5d560ca99f](https://github.com/facebook/react-native/commit/5d560ca99ff7220de11d2d76dbe77d73990894a8) by [@Krisztiaan](https://github.com/Krisztiaan)) -- Make sure configureNdkBuild* tasks are depending on preBuild ([2fdbf6a10f](https://github.com/facebook/react-native/commit/2fdbf6a10fe67fa3209a51a1105a97c16991f561) by [@cortinico](https://github.com/cortinico)) -- Added a null check to native.value in Switch to fix https://github.com/facebook/react-native/issues/32594 ([8d50bf1133](https://github.com/facebook/react-native/commit/8d50bf113352a6ccdf74c979e1022c6c2ccf6e56) by [@jonathanmos](https://github.com/jonathanmos)) -- Fix overflowInset calculation by using transform values ([8aa87814f6](https://github.com/facebook/react-native/commit/8aa87814f62e42741ebb01994796625473c1310f) by [@ryancat](https://github.com/ryancat)) -- Add missing sources jar into published android artifacts ([384e1a0c7b](https://github.com/facebook/react-native/commit/384e1a0c7bc50d2aab5b59bcedcea5a3e98f1659) by [@Kudo](https://github.com/Kudo)) -- Fix math for detecting if children views are in parent's overflowInset area. ([45244ebce2](https://github.com/facebook/react-native/commit/45244ebce228dfbc3412670e64c11491ba8d8c47) by [@ryancat](https://github.com/ryancat)) -- Fixed empty screen after retrying a BundleDownloader failure in dev mode ([c8d823b9bd](https://github.com/facebook/react-native/commit/c8d823b9bd9619dfa1f5851af003cc24ba2e8830) by [@samkline](https://github.com/samkline)) -- Fix crash from ScrollView that occurs while reporting an error from JS ([2151d11527](https://github.com/facebook/react-native/commit/2151d1152719a230565165f1a8dcfab172689eb3) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Enable hitSlop to be set using a single number. ([589b129581](https://github.com/facebook/react-native/commit/589b129581903a737a64e14eab3f2e29620831d5) by [@javache](https://github.com/javache)) -- Fix fling and snap with recycler viewgroup where fling to the end of scrollable distance when it goes over current rendered children views. ([ead7b97944](https://github.com/facebook/react-native/commit/ead7b97944522e3066ceb2bd50c63c268c961277) by [@ryancat](https://github.com/ryancat)) -- Fixed edge case for quick small scrolls causing unexpected scrolling behaviors. ([f70018b375](https://github.com/facebook/react-native/commit/f70018b37532622f08f20b2c51cdbfca55d730ea) by [@ryancat](https://github.com/ryancat)) -- Fix crash on ReactEditText with AppCompat 1.4.0 ([e21f8ec349](https://github.com/facebook/react-native/commit/e21f8ec34984551f87a306672160cc88e67e4793) by [@cortinico](https://github.com/cortinico)) -- Do not .lowerCase the library name when codegenerating TurboModule Specs ([28aeb7b865](https://github.com/facebook/react-native/commit/28aeb7b8659b38ee3a27fae213c4d0800f4d7e31) by [@cortinico](https://github.com/cortinico)) -- Enable hitSlop to be set using a single number. ([a96bdb7154](https://github.com/facebook/react-native/commit/a96bdb7154b0d8c7f43977d8a583e8d2cbdcb795) by [@javache](https://github.com/javache)) -- Updated TextInput prop types to accomodate for new autoComplete values ([9eb0881c8f](https://github.com/facebook/react-native/commit/9eb0881c8fecd0e974b1cb9f479bad3075854340) by [@TheWirv](https://github.com/TheWirv)) -- Don't reconstruct app components https://github.com/facebook/react-native/issues/25040 ([fc962c9b6c](https://github.com/facebook/react-native/commit/fc962c9b6c4bf9f88decbe014ab9a9d5c1cf51bc) by [@Somena1](https://github.com/Somena1)) -- Do NOT skip the first child view in the scroll view group when measuring the lower and upper bounds for snapping. ([61e1b6f86c](https://github.com/facebook/react-native/commit/61e1b6f86cf98d8a74eeb9353143fe0c624fe6e6) by [@ryancat](https://github.com/ryancat)) -- Fix crash when a Switch is initialised with both backgroundColor and thumbColor. ([456cf3db14](https://github.com/facebook/react-native/commit/456cf3db14c443c483d63aa97c88b45ffd25799b) by [@smarki](https://github.com/smarki)) -- Fix devDisabledIn not working with multiple productFlavors ([055ea9c7b7](https://github.com/facebook/react-native/commit/055ea9c7b7dea030ef16da72d1f6ecb5d95ac468) by [@grit96](https://github.com/grit96)) -- Revert `ReactScrollView` to use `Context` instead of `ReactContext` in the constructor to be less restrictive. ([7b77cc637e](https://github.com/facebook/react-native/commit/7b77cc637e1faf4a2b134853f8415f277d0decdc) by [@ryancat](https://github.com/ryancat)) -- Fix onPress event for nested Text in RN Android ([e494e4beb6](https://github.com/facebook/react-native/commit/e494e4beb6a124008fd116178cbc38335bd87809) by [@mdvacca](https://github.com/mdvacca)) -- Fix enableVmCleanup not working for apps with product flavors ([a2b5e4cd82](https://github.com/facebook/react-native/commit/a2b5e4cd825a358419cef1e3823b72215b689686) by [@cortinico](https://github.com/cortinico)) -- Prevent NPE on ThemedReactContext ([f1b5fe1d3e](https://github.com/facebook/react-native/commit/f1b5fe1d3ea49294d8c89accfa27d76a1a97ccea) by [@sshic](https://github.com/sshic)) -- fix: jvm 11 error message from ReactPlugin.kt and react.gradle ([4e947ecb2d](https://github.com/facebook/react-native/commit/4e947ecb2dabfa0226af7f859c828847b4d891c0) by [@nomi9995](https://github.com/nomi9995)) - -#### iOS specific - -- ScrollView: Respect `contentInset` when animating new items with `autoscrollToTopThreshold`, make `automaticallyAdjustKeyboardInsets` work with `autoscrollToTopThreshold` (includes vertical, vertical-inverted, horizontal and horizontal-inverted ScrollViews) ([49a1460a37](https://github.com/facebook/react-native/commit/49a1460a379e3a71358fb38888477ce6ea17e81a) by [@mrousavy](https://github.com/mrousavy)) -- Prevent RCTConvert error for allowed null blob types ([e1b698c5f2](https://github.com/facebook/react-native/commit/e1b698c5f2b1d689fb3940f8c6a3e298d381ea3a) by [@habovh](https://github.com/habovh)) -- Migrate ScreenshotManager from NativeModule to TurboModule ([b13e41d98e](https://github.com/facebook/react-native/commit/b13e41d98e818279d1941f3425707d3c0ce407fc) by [@p-sun](https://github.com/p-sun)) -- Fix usage of cocoapods with --project-directory flag and new arch ([9e7d91f2fc](https://github.com/facebook/react-native/commit/9e7d91f2fc4d576b8fba81304a24e50134da93d6) by [@danilobuerger](https://github.com/danilobuerger)) -- Post RCTContentDidAppearNotification with new arch ([75105e692c](https://github.com/facebook/react-native/commit/75105e692c2be9bd192089a6a6ffde7572ee1ce1) by [@danilobuerger](https://github.com/danilobuerger)) -- Remove absolute paths from pods project ([42b01a32a1](https://github.com/facebook/react-native/commit/42b01a32a137f18ae9fd2f00914f2edb0e107421) by [@danilobuerger](https://github.com/danilobuerger)) -- Respect RCTSetDefaultFontHandler chosen font ([89efa1a0c1](https://github.com/facebook/react-native/commit/89efa1a0c1b633bf9edee66583800ad3fc54ce63) by [@danilobuerger](https://github.com/danilobuerger)) -- Fixed duplicated UUIDs problem during pod install phase. ([f595a4e681](https://github.com/facebook/react-native/commit/f595a4e681e75aaf737b6582f69855d76a1f33dd)) -- Fix `Time.h` patch not being applied when running `pod install --project-directory=ios` ([60cef850bd](https://github.com/facebook/react-native/commit/60cef850bd3fd12c32ee1196bd19a559592d1465) by [@tido64](https://github.com/tido64)) -- Fix WebSocket control frames having payloads longer than 125 bytes ([86db62b7a8](https://github.com/facebook/react-native/commit/86db62b7a8b28ac82dd0a0627a8b6c351875f682) by [@asmeikal](https://github.com/asmeikal)) -- Stop RedBox from appearing for LogBox handled errors ([9d2df5b8ae](https://github.com/facebook/react-native/commit/9d2df5b8ae95b3cfeae26f64bd1d50bd2b0bbae9) by [@liamjones](https://github.com/liamjones)) -- Enable hitSlop to be set using a single number. ([3addafa525](https://github.com/facebook/react-native/commit/3addafa5257ade685216900bebbad8c35e24e124) by [@javache](https://github.com/javache)) -- Fix `__apply_Xcode_12_5_M1_post_install_workaround` failing when one of the Pods has no IPHONEOS_DEPLOYMENT_TARGET set ([9cd4092336](https://github.com/facebook/react-native/commit/9cd40923362ff717a722f8f36c8250a29a5142b7) by [@Yonom](https://github.com/Yonom)) -- This is a quick speculative fix since we know `CFRunLoopPerformBlock` does not push/pop an autorelease pool. ([3fff164dfa](https://github.com/facebook/react-native/commit/3fff164dfa1c97f69b1701e974effc92a94152d6) by [@christophpurrer](https://github.com/christophpurrer)) -- Fixed RCTImageLoaderTests ([1542f83527](https://github.com/facebook/react-native/commit/1542f835273c08776b960929b5aa7cefbd225971) by [@philIip](https://github.com/philIip)) -- Fix Rosetta2 CocoaPods warning on Apple Silicon ([e918362be3](https://github.com/facebook/react-native/commit/e918362be3cb03ae9dee3b8d50a240c599f6723f) by [@oblador](https://github.com/oblador)) -- Fix `pod install --project-directory=ios` failing due to wrong path to `React-Codegen` ([ebb26cf2e4](https://github.com/facebook/react-native/commit/ebb26cf2e420616c8bf01a5148ca4f8419b238d3) by [@tido64](https://github.com/tido64)) - -### Deprecated - -#### Android specific - -- Gradle: Deprecate `reactRoot` in favor of `root` and `reactNativeDir` ([8bc324fd34](https://github.com/facebook/react-native/commit/8bc324fd34337ab159e2e21e213a6c5b06c548da) by [@cortinico](https://github.com/cortinico)) - - -### Removed - -- DeprecatedPropTypes (deep-link) modules removed from React Native. ([23717c6381](https://github.com/facebook/react-native/commit/23717c6381a41b1c5f189376bfa5bc73c7a4da87) by [@yungsters](https://github.com/yungsters)) -- `accessibilityStates` no longer passed through to RCTView. ([1121ed94ab](https://github.com/facebook/react-native/commit/1121ed94ab470be27207b0c8dbae5d19860c08da) by [@luism3861](https://github.com/luism3861)) - -#### iOS specific - -- Remove RCTUIManagerObserver from RCTNativeAnimatedTurboModule ([e9ed115bab](https://github.com/facebook/react-native/commit/e9ed115babbc82968380dae22fa928d4ce3cd6da) by [@p-sun](https://github.com/p-sun)) - -## v0.67.5 - -🚨 **IMPORTANT:** This is an exceptional release on an unsupported version. We recommend you upgrade to one of [the supported versions, listed here](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported). - -### Fixed - -- Force dependencies resolution to minor series for 0.67 ([9f2acda1b8](https://github.com/facebook/react-native/commit/9f2acda1b807e790b3e7562ce3436b93bcc2ad09) by [@cortinico](https://github.com/cortinico)) - -## v0.67.4 - -### Fixed - -#### Android specific - -- Added a null check to native.value in Switch to fix https://github.com/facebook/react-native/issues/32594 ([8d50bf1133](https://github.com/facebook/react-native/commit/8d50bf113352a6ccdf74c979e1022c6c2ccf6e56) by [@jonathanmos](https://github.com/jonathanmos)) - -## v0.67.3 - -### Fixed - -#### Android specific - -- Text with adjustsFontSizeToFit changes the text layout infinitely ([c1db41f060](https://github.com/facebook/react-native/commit/c1db41f060908e6ab001aaace7c20c610056f59a)) - -#### iOS specific - -- Fix a broken input for the Korean alphabet in TextInput ([1a83dc36ce](https://github.com/facebook/react-native/commit/1a83dc36ce0af33ac7a3c311354fce4bfa5ba1a3) by [@bernard-kms](https://github.com/bernard-kms)) - -## v0.67.2 - -### Fixed - -- Fix error "mockModal is not a function" ([507b05f4c0](https://github.com/facebook/react-native/commit/507b05f4c02b46109f483a2b79c924a775fd7bd3) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) - -#### Android specific - -- Fix potential crash if ReactRootView does not have insets attached. ([6239e2f5ce](https://github.com/facebook/react-native/commit/6239e2f5ce82f7c2e683eb4699b9ce3ff1b58ac5) by [@enahum](https://github.com/enahum)) -- Upgrading OkHttp from 4.9.1 to 4.9.2 to fix CVE-2021-0341. ([e896d21](https://github.com/facebook/react-native/commit/e896d21ced3c0c917c2fc0044d2b93b44df9a081) by [@owjsub](https://github.com/owjsub)) - -#### iOS specific - -- Fix `Time.h` patch not being applied when running `pod install --project-directory=ios` ([60cef850bd](https://github.com/facebook/react-native/commit/60cef850bd3fd12c32ee1196bd19a559592d1465) by [@tido64](https://github.com/tido64)) -- Find-node.sh now respects .nvmrc ([35bcf934b1](https://github.com/facebook/react-native/commit/35bcf934b186e581d100d43e563044300759557f) by [@igrayson](https://github.com/igrayson)) - -## v0.67.1 - -### Fixed - -#### Android specific - -- Do not remove libjscexecutor.so from release builds ([574a773f8f](https://github.com/facebook/react-native/commit/574a773f8f55fe7808fbb672066be8174c64d76d) by [@cortinico](https://github.com/cortinico)) - -#### iOS specific - -- Remove alert's window when call to `hide`. ([a46a99e120](https://github.com/facebook/react-native/commit/a46a99e12039c2b92651af1996489d660e237f1b) by [@asafkorem](https://github.com/asafkorem)) - -## v0.67.0 - -### Added - -#### Android specific -- Add `ACCESS_MEDIA_LOCATION` permission to PermisionsAndroid library. ([79db483568](https://github.com/facebook/react-native/commit/79db4835681f5d0149620ec8e0990411cb882241) by [@Skrilltrax](https://github.com/Skrilltrax)) -- Implement `SnapToAlignment` in `ReactScrollView` ([e774c037bc](https://github.com/facebook/react-native/commit/e774c037bce40a4b48e78d2d0a1085a1e4f5a328)), `ReactScrollViewManager` ([c6e5640e87](https://github.com/facebook/react-native/commit/c6e5640e87e7cb5b514ded2c8d4cbb039bd02c5f)), `ReactHorizontalScrollView` ([b12256394e](https://github.com/facebook/react-native/commit/b12256394e34c375942ca508ef79a8c816317976)), `ReactHorizontalScrollViewManager` ([deec1db9fd](https://github.com/facebook/react-native/commit/deec1db9fdf2848941326ba5bebc11f3592a301e)) and update `ScrollView.js` ([a54cfb9e57](https://github.com/facebook/react-native/commit/a54cfb9e5794f196d3834e19762f3aacf47a177d)) and reach parity with iOS ([04184ef851](https://github.com/facebook/react-native/commit/04184ef851c71141009c523ba59838ae6af19ba5)) by [@mdvacca](https://github.com/mdvacca) -- Show Redbox for C++ errors. ([d6c879edba](https://github.com/facebook/react-native/commit/d6c879edbad068d0f461381875b7fae6db99d18d) by [@sota000](https://github.com/sota000)) -- Added an experimental touch dispatch path ([a2feaeb5f1](https://github.com/facebook/react-native/commit/a2feaeb5f1121a860a9416b5d4e0e96debd45b09) by [@ShikaSD](https://github.com/ShikaSD)) - -#### iOS specific -- Added `cancelButtonTintColor` prop for `ActionSheetIOS` to change only the text color of the cancel button ([01856633a1](https://github.com/facebook/react-native/commit/01856633a1d42ed3b26e7cc93a007d7948e1f76e) by [@nomi9995](https://github.com/nomi9995)) -- Added [`LSApplicationQueriesSchemes`](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW14) in info.plist with entries tel, telprompt, http, fb, geo ([b26f277262](https://github.com/facebook/react-native/commit/b26f2772624c863c91fa1ff627b481c92d7562fb) by [@utkarsh-dixit](https://github.com/utkarsh-dixit)) -- Add `UIAccessibilityTraitUpdatesFrequently` to progressBar role ([1a42bd6e97](https://github.com/facebook/react-native/commit/1a42bd6e97ae44a3b38ca552865bac63a6f35da5) by [@jimmy623](https://github.com/jimmy623)) -- Add `asdf-vm` support in `find-node.sh` ([3e7c310b1d](https://github.com/facebook/react-native/commit/3e7c310b1dcf5643920535eea70afa451888792a) by [@pastleo](https://github.com/pastleo)) - - -### Changed -- `ImageBackground` now respects `imageStyle` width and height ([dbd5c3d8e5](https://github.com/facebook/react-native/commit/dbd5c3d8e5e35685be89156194a96cead553a330) by [@Naturalclar](https://github.com/Naturalclar)) -- Rename deprecated `Keyboard.removeEventListener` to `Keyboard.removeListener`. ([8880c09076](https://github.com/facebook/react-native/commit/8880c09076e4727768ace26a74766cbe6f64021c) by [@yungsters](https://github.com/yungsters)) -- Update `Modal`'s mock to not render its children when it is not visible ([ec614c16b3](https://github.com/facebook/react-native/commit/ec614c16b331bf3f793fda5780fa273d181a8492) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) -- Upgraded `react-devtools-core` dependency to 4.19.1 ([356236471a](https://github.com/facebook/react-native/commit/356236471abc6b5b8c139223e15388fd1eecd2d1) by [@jstejada](https://github.com/jstejada)) -- React-native/normalize-color now supports Node.js ([65e58f26e1](https://github.com/facebook/react-native/commit/65e58f26e1fbd06b1ae32e2ab3a2616c8eef08e0) by [@yungsters](https://github.com/yungsters)) -- Updated to Contributor Covenant v2.1 ([19f8d2f7da](https://github.com/facebook/react-native/commit/19f8d2f7da13f4524f31acf7aa10cc0aa91b5da4)) - - -#### Android specific -- Hermes initialization will no longer need an explicit configuration. ([a40f973f58](https://github.com/facebook/react-native/commit/a40f973f58609ca717fac63bc501d5cf93b748ad) by [@Ashoat](https://github.com/Ashoat)) -- Setting `overflow: scroll` in View component style will clip the children in the View container ([93beb83abe](https://github.com/facebook/react-native/commit/93beb83abef42b92db43ee3bb8b156f486a6c00f) by [@ryancat](https://github.com/ryancat)) -- Native views backing `Animated.View` (w/ JavaScript-driven animations) will no longer be flattened; this should be a transparent change. ([4fdbc44ab5](https://github.com/facebook/react-native/commit/4fdbc44ab5945399338e4ed94ea5611098bd2142) by [@yungsters](https://github.com/yungsters)) -- Use new Locale API on Android 11 (API 30)+ ([b7c023a8c1](https://github.com/facebook/react-native/commit/b7c023a8c1122500c6ceb7de2547569b3b9251ba)) -- Changed `react.gradle` `detectCliPath` function logic for `cliPath` case ([ce51b62494](https://github.com/facebook/react-native/commit/ce51b6249449361ee50b8c99a427c28af7ab3531) by [@vitalyiegorov](https://github.com/vitalyiegorov)) -- Remove `"high"` and `"balanced"` as values for `android_hyphenationFrequency` on `Text` ([a0d30b848a](https://github.com/facebook/react-native/commit/a0d30b848a07480d0fccec608a62a505c71f8cac)) -- Bump Gradle version to 7.2, Bump Kotlin version to 1.5.31 ([9ae3367431](https://github.com/facebook/react-native/commit/9ae3367431428748f5486c782199beb4f9c6b477) by [@svbutko](https://github.com/svbutko)) -- Move mavenCentral repo below local paths ([046b02628d](https://github.com/facebook/react-native/commit/046b02628d32eadd6d44160ab79932f6c26b188d) by [@friederbluemle](https://github.com/friederbluemle)) - -#### iOS specific -- Optimized font handling for iOS ([4ac42d88ef](https://github.com/facebook/react-native/commit/4ac42d88ef60ae3fed7319851d47b93e98ac9afa) by [@Adlai-Holler](https://github.com/Adlai-Holler)) -- Remove iOS 11 version check as minimum deployment is iOS 11 ([398595e074](https://github.com/facebook/react-native/commit/398595e07483fa8f45579de4ca1aee9585e20620) by [@ken0nek](https://github.com/ken0nek)) -- Don't hang app for 60s if packager can't be reached, changed to 10s ([c0e04460f5](https://github.com/facebook/react-native/commit/c0e04460f546dfef2623bff367eb8db8fd75fa34) by [@radex](https://github.com/radex)) - -### Removed - -- Removed unnecessary global variable `GLOBAL`. ([a101fc768c](https://github.com/facebook/react-native/commit/a101fc768cedc7ac9754006e5b7292bb7084ab54) by [@rubennorte](https://github.com/rubennorte)) -- Removed unused files: `StaticContainer.react.js`, `ensurePositiveDelayProps.js`, `InteractionMixin.js`, `queryLayoutByID.js` ([64aa1e5ffe](https://github.com/facebook/react-native/commit/64aa1e5ffe5d577c04cabb3692246b956f65597b) by [@ecreeth](https://github.com/ecreeth)) - -#### Android specific - -- Remove `DatePickerAndroid` from react-native. ([7a770526c6](https://github.com/facebook/react-native/commit/7a770526c626e6659a12939f8c61057a688aa623) by [@andresantonioriveros](https://github.com/andresantonioriveros)) - -#### iOS specific - -### Fixed - -- Update metro config language to `blockList` ([7923804c28](https://github.com/facebook/react-native/commit/7923804c28aac731396f0db112cb6c3a9d30c08f) by [@rh389](https://github.com/rh389)) -- Ignores global npm prefix ([6334ac35ac](https://github.com/facebook/react-native/commit/6334ac35ac3cbc2c84b2d46d46ec118bf9bf714d) by [@redreceipt](https://github.com/redreceipt)) -- Support `Animated.ValueXY` when validating `Animated.event`. ([27dd2ecb70](https://github.com/facebook/react-native/commit/27dd2ecb70f1d08787c93a2e18250ffaff328e5f) by [@javache](https://github.com/javache)) -- Add a function `getIgnorePatterns` in `LogBoxData.js` for tests or other usecases. ([a950634424](https://github.com/facebook/react-native/commit/a950634424cddf31c0adb6c9799adf1cc5f83bf0)) - -#### Android specific - -- TextInput Drawable to avoid Null Pointer Exception RuntimeError https://github.com/facebook/react-native/issues/17530 ([254493e1fb](https://github.com/facebook/react-native/commit/254493e1fb0c3a1e279e2c957e83edac6252d041) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Nested Text Android `onPress` does not work with last character ([132d1d00f8](https://github.com/facebook/react-native/commit/132d1d00f885fe5a45d712fd7698db285c22bc4b) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Fix non selectable Text in FlatList ([c360b1d92b](https://github.com/facebook/react-native/commit/c360b1d92b69e1d298b390ec88c4d29c1023945a) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Set `textBreakStrategy` default to be `'highQuality'` ([3b2d541989](https://github.com/facebook/react-native/commit/3b2d5419899363d84aea4f5cc3a4c75253dd6406)) -- Fix error handling when loading JSC or Hermes ([d839b24b06](https://github.com/facebook/react-native/commit/d839b24b06d31b4ce91fb459742831b942972f56) by [@iqqmuT](https://github.com/iqqmuT)) -- Fix encoding for gradlew.bat files ([ab2bdee735](https://github.com/facebook/react-native/commit/ab2bdee735cd0d53d3dbfbac5cd31f96eefb7e61) by [@yungsters](https://github.com/yungsters)) -- Fix `hermesFlags` not working with multiple variants ([91adb761cf](https://github.com/facebook/react-native/commit/91adb761cf1583598d4d63ce879fd7e0f4ae793c) by [@grit96](https://github.com/grit96)) -- `ScrollTo` API in ScrollView will check the actual scroll position before setting the scroll state ([1a9e2d5d55](https://github.com/facebook/react-native/commit/1a9e2d5d5589ce5cee92868ea5bccceb6e161eff) by [@ryancat](https://github.com/ryancat)) -- Compute Android Notch in `keyboardDidShow` height calculation API 28+ ([8bef3b1f11](https://github.com/facebook/react-native/commit/8bef3b1f1136ab5c2f2309a3101a7d9626ced1f5) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Fix `currentActivity` being null when launching Redbox ([f4fdf4b55e](https://github.com/facebook/react-native/commit/f4fdf4b55e4489c21f4552b4ac01ef253c038b2d)) -- When sending OS intents, always set `"FLAG_ACTIVITY_NEW_TASK"` flag (required by OS). ([04fe3ed80d](https://github.com/facebook/react-native/commit/04fe3ed80d9c201a483a2b477aeebd3d4169fd6d) by [@Krizzu](https://github.com/Krizzu)) -- Fix missing WebView provider crash in ForwardingCookieHandler ([d40cb0e1b0](https://github.com/facebook/react-native/commit/d40cb0e1b0fb233a27b9d476167814d2853acf2a) by [@RodolfoGS](https://github.com/RodolfoGS)) -- Fix `keyboardDismissMode="on-drag"` on Android ([7edf9274cf](https://github.com/facebook/react-native/commit/7edf9274cf6d3398075c19cd1cb020a5d6a346a2) by [@janicduplessis](https://github.com/janicduplessis)) -- Fixed `alignItems: baseline` for elements on Android ([1acf334614](https://github.com/facebook/react-native/commit/1acf33461451834097463f43e70d90bae0f67198)) -- `OnKeyPress` event not fired with numeric keys ([ee3e71f536](https://github.com/facebook/react-native/commit/ee3e71f536127295ba4ea377e618499409a2e9ba) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Exclude unused .so files for reduce android .apk and .aab ([6f126740fa](https://github.com/facebook/react-native/commit/6f126740fa560d7a831979b9f3747baacfb28dba) by [@enniel](https://github.com/enniel)) - -#### iOS specific - -- Fixed an edge case when scroll to item/index is called without animation, the offset position is not updated. This caused the measurement of the position to be wrong. ([55392f65a6](https://github.com/facebook/react-native/commit/55392f65a6addbdd8214b61d4ae286f26d63a94f) by [@ryancat](https://github.com/ryancat)) -- Fixed the issue when moving cursor in multi-line TextInput. ([22801870f0](https://github.com/facebook/react-native/commit/22801870f0613c2544ade1ebc5363e6e2f015c79) by [@xiankuncheng](https://github.com/xiankuncheng)) -- Fix NSInvalidArgumentException for invalid font family names. ([5683932862](https://github.com/facebook/react-native/commit/5683932862ab870e735342342c68e03fb5ca9e09) by [@yungsters](https://github.com/yungsters)) -- Fix Image `defaultSource` not showing on iOS ([900210cacc](https://github.com/facebook/react-native/commit/900210cacc4abca0079e3903781bc223c80c8ac7) by [@cristianoccazinsp](https://github.com/cristianoccazinsp)) -- Warn if Rosetta2 is being used (x86_64 on arm64) ([51bf557948](https://github.com/facebook/react-native/commit/51bf55794899284e1c465d346a3f6ebd8a485da2) by [@barbieri](https://github.com/barbieri)) -- Source map path for schemes containing whitespaces ([f3fe7a0fb5](https://github.com/facebook/react-native/commit/f3fe7a0fb5fc0325fbe062c6df4cbf8b58779189) by [@andersonvom](https://github.com/andersonvom)) -- Fix build error after running `pod install` with `--project-directory=ios` ([ef5ff3e055](https://github.com/facebook/react-native/commit/ef5ff3e055482771cbe866d4961ee2d0a9e00e45) by [@sonicdoe](https://github.com/sonicdoe)) -- Fixed inability to build apps when gflags is installed ([ab8dbdf663](https://github.com/facebook/react-native/commit/ab8dbdf66363f3d65f0dfbcc4ec7c71b1cd69b2a) by [@KDederichs](https://github.com/KDederichs)) - -### Security - -- Avoiding logging root view params outside of dev / debug mode builds ([e612d3a116](https://github.com/facebook/react-native/commit/e612d3a116f39ab354169643bab0d4bb9cfc1a85) by [@sterlingwes](https://github.com/sterlingwes)) - -## v0.66.5 - -🚨 **IMPORTANT:** This is an exceptional release on an unsupported version. We recommend you upgrade to one of [the supported versions, listed here](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported). - -### Fixed - -- Force dependencies resolution to minor series for 0.66 ([201824c89e](https://github.com/facebook/react-native/commit/201824c89ecebd749ba7e603415edbe6a5b9b73d) by [@cortinico](https://github.com/cortinico)) - -## v0.66.4 - -### Fixed - -#### iOS specific - -- Revert "Fix Deadlock in RCTi18nUtil (iOS)" ([70ddf46](https://github.com/facebook/react-native/commit/70ddf46c8afcd720e188b6d82568eac6ac8125e6) by [@Saadnajmi](https://github.com/Saadnajmi)) -- `apply_Xcode_12_5_M1_post_install_workaround` causing pods targetting iOS 12 and above to fail ([a4a3e67554](https://github.com/facebook/react-native/commit/a4a3e675542827bb281a7ceccc7b8f5533eae29f) by [@Yonom](https://github.com/Yonom)) - -## v0.66.3 - -### Changed - -- Rename deprecated `Keyboard.removeEventListener` to `Keyboard.removeListener`. ([8880c09076](https://github.com/facebook/react-native/commit/8880c09076e4727768ace26a74766cbe6f64021c) by [@yungsters](https://github.com/yungsters)) - -### Fixed - -- Revert changes in Jest preprocessor to fix tests in external projects ([142090a5f3fa7](https://github.com/facebook/react-native/commit/142090a5f3fa7c3ab2ed4c536792e3f26582bd3b) by [@rubennorte](https://github.com/rubennorte)) - -## v0.66.2 - -### Fixed - -- Add a function `getIgnorePatterns` in `LogBoxData.js` for tests or other usecases. ([a950634424](https://github.com/facebook/react-native/commit/a950634424cddf31c0adb6c9799adf1cc5f83bf0)) -- Reintroduce generated codegen files ([7382f556d3](https://github.com/facebook/react-native/commit/7382f556d327d51bd09456efda83edec7e05ecd2) by [@kelset](https://github.com/kelset)) - -#### iOS specific - -- Hide the logbox window explicitly. New behavior in iOS SDK appears to retain UIWindow while visible. ([72ea0e111f](https://github.com/facebook/react-native/commit/72ea0e111fccd99456abf3f974439432145585e3) by [@paddlefish](https://github.com/paddlefish)) - -## v0.66.1 - -### Fixed - -- For Android, general fixes to Appearance API and also fixes AppCompatDelegate.setDefaultNightMode(). For iOS, now works correctly when setting window.overrideUserInterfaceStyle ([25a2c608f7](https://github.com/facebook/react-native/commit/25a2c608f790f42cbc4bb0a90fc06cc7bbbc9b95) by [@mrbrentkelly](https://github.com/mrbrentkelly)) - -#### Android specific - -- Fix Android border positioning regression ([d1a33cd139](https://github.com/facebook/react-native/commit/d1a33cd139fab4565b1fc691f5751c4af99d5849) by [@oblador](https://github.com/oblador)) - -#### iOS specific - -- Fix for unable to find `find-node.sh` in `react-native-xcode.sh` script ([cc59a7cbde](https://github.com/facebook/react-native/commit/cc59a7cbde1c0fc6d6ef059321d23bf287f08218) by [@garethknowles](https://github.com/garethknowles)) - -## v0.66.0 - -### Highlights - -- Hermes 0.9.0 - - This Hermes release is primarily about closing gap between Hermes cut and this React Native release. Among ~400 commits, contains memory and size wins, bugfixes and other progress behind the scenes. See [issue for more details](https://github.com/facebook/hermes/issues/586). -- Allow taps on views outside the bounds of a parent with `overflow: visible` ([e35a963bfb](https://github.com/facebook/react-native/commit/e35a963bfb93bbbdd92f4dd74d14e2ad6df5e14a) by [@hsource](https://github.com/hsource)) -- Fixes for building on Apple Silicon and Xcode 13 ([ac4ddec542](https://github.com/facebook/react-native/commit/ac4ddec542febda744de218dae3a3d34edc7da84) thanks to [@mikehardy](https://github.com/mikehardy)) -- New bluetooth permissions for Android ([2bcc6fac38](https://github.com/facebook/react-native/commit/2bcc6fac3844f0752bc7067517c92a643679575e), [eeb8e58](https://github.com/facebook/react-native/commit/eeb8e5829e183f6b5cd5fd327cf6da03a7db0541) by [@iBotPeaches](https://github.com/iBotPeaches)) - -### Breaking - -- Remove Picker and PickerIOS components - [cddb97ad18](https://github.com/facebook/react-native/commit/cddb97ad18cfdb663dcf015af3c9426d5414e396), [77366cd869](https://github.com/facebook/react-native/commit/77366cd8696cb8ada3f84d7fb4d36a27f7007b06), [ad0ccac0d6](https://github.com/facebook/react-native/commit/ad0ccac0d6471fa5428bf137c3aa0646883e8446) -- Remove StatusBarIOS component ([7ce0f40f5c](https://github.com/facebook/react-native/commit/7ce0f40f5cd8c0928ce720d6d121bcc5963958a2) by [@ecreeth](https://github.com/ecreeth)) - -#### Android specific - -- Updated `autoCompleteType` prop of `TextInput` to `autoComplete` ([27fec9569e](https://github.com/facebook/react-native/commit/27fec9569e08a04e0dbdbd5de063a599ad0416fa) by [@jeswinsimon](https://github.com/jeswinsimon)) - -### Added - -- Add `global.queueMicrotask` ([be189cd819](https://github.com/facebook/react-native/commit/be189cd81905a735f08a8519c62a707658c7fb27) by [@Huxpro](https://github.com/Huxpro)) -- Added data field to `markerPoint` to allow callers to add additional arbitrary string data to logged points ([aa98978302](https://github.com/facebook/react-native/commit/aa9897830293955b7cc77fd818a50e8d736e715d)) -- Adds accessibility actions to Button ([44717152ca](https://github.com/facebook/react-native/commit/44717152cadb18c7aff74e9465fdb70efdb1bf81) by [@dennisurtubia](https://github.com/dennisurtubia)) -- Add accessibilityState prop to Slider component ([35dd86180b](https://github.com/facebook/react-native/commit/35dd86180ba730425b97592ef6e5c4d449caee06) by [@sladyn98](https://github.com/sladyn98)) -- Add support for "togglebutton" `accessibilityRole` ([da899c0cc4](https://github.com/facebook/react-native/commit/da899c0cc4372830e5ca053a096b74fff2a19cb8) by [@kacieb](https://github.com/kacieb)) - -#### Android specific - -- Add INFO, and MENU key event support ([bb33c1050b](https://github.com/facebook/react-native/commit/bb33c1050ba6098a68d70055e33186d9438c4374) by [@havlasme](https://github.com/havlasme)) -- Added all autofill types to TextEdit ([d9e0ea77f0](https://github.com/facebook/react-native/commit/d9e0ea77f0111fd8400c65d68e45d54e2f84287b) by [@safaiyeh](https://github.com/safaiyeh)) -- Add support to URI keyboard type in Android ([1465c8f387](https://github.com/facebook/react-native/commit/1465c8f3874cdee8c325ab4a4916fda0b3e43bdb)) -- Add `MEDIA_STOP`, `MEDIA_NEXT`, and `MEDIA_PREVIOUS` event support to Android TV ([3e2bb331fc](https://github.com/facebook/react-native/commit/3e2bb331fc0974bc870b2e7bd3171e585183ed1b) by [@havlasme](https://github.com/havlasme)) -- Allow configuring ndk build architectures ([d6ed1ff58b](https://github.com/facebook/react-native/commit/d6ed1ff58b2ca4d1c8b45416e56fa1da75633c07) by [@janicduplessis](https://github.com/janicduplessis)) -- Added support for accessibility role of "list" for flatlist and sectioned list ([25a16123a6](https://github.com/facebook/react-native/commit/25a16123a610ae377ced23ef81ed4c03ad7d06d9) by [@anaskhraza](https://github.com/anaskhraza)) -- Support for foreground ripple in Pressable ([0823f299e5](https://github.com/facebook/react-native/commit/0823f299e560efda5c0f344fcec86cf68801f4ab) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) -- Support for ScrollAway native nav bars added to `ReactScrollView` ([0ef5beee85](https://github.com/facebook/react-native/commit/0ef5beee855afa592cc647383ba6a3ceae9cc40a) by [@JoshuaGross](https://github.com/JoshuaGross)) - -#### iOS specific - -- Added new prop "selection" to `TextInputProps` ([8434177722](https://github.com/facebook/react-native/commit/8434177722f70a9325f9a6adf46b5315b1f4ffa4)) -- Support for onRequestClose for iOS Modal component. ([c29ec46b0e](https://github.com/facebook/react-native/commit/c29ec46b0eee99670ce7762898fe3a4810db968b) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) -- Allow `PlatformColor` to return user-defined named asset color ([36c0a7dec1](https://github.com/facebook/react-native/commit/36c0a7dec121bd3a4b92d02c03a24771d3c4cf84) by [@oblador](https://github.com/oblador)) -- Add support for the `UIAccessibilityTraitsTabBar` ([11f8d9c7cd](https://github.com/facebook/react-native/commit/11f8d9c7cd4bae0b1a5e880ea9b2da7447ad76c2) by [@jimmy623](https://github.com/jimmy623)) -- Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices. ([f1b1ba8963](https://github.com/facebook/react-native/commit/f1b1ba8963ff152d995c3cd132bc0755413bc44f) by [@swittk](https://github.com/swittk)) -- Introduce `RCTInitializing` to allow NativeModules to initialize themselves ([9b45df1fce](https://github.com/facebook/react-native/commit/9b45df1fced066f40034b0a58be6f4caafd5f785) by [@RSNara](https://github.com/RSNara)) -- Introduce `RCTCallableJSModules` API for NativeModules ([ece373d244](https://github.com/facebook/react-native/commit/ece373d24421d96e62dafa9a064b38acd6b71e46) by [@RSNara](https://github.com/RSNara)) -- Attach `RCTBundleManager` to NativeModules ([329f58ee46](https://github.com/facebook/react-native/commit/329f58ee461e7afade36d8c249d3f4930c485312) by [@RSNara](https://github.com/RSNara)) -- Introduce RCTBundleManager for bundleURL access ([4a1bafe591](https://github.com/facebook/react-native/commit/4a1bafe591917482d78be998d45552e2568e3e23) by [@RSNara](https://github.com/RSNara)) - -### Changed - -- Initialized LogBox earlier and centralized access in LogBox module ([8abe737068](https://github.com/facebook/react-native/commit/8abe737068a54a874571c8b5560b2118b1df31ad) by [@rubennorte](https://github.com/rubennorte)) -- ExceptionsManager will no longer report exceptions with `type === 'warn'`. ([883e0d5752](https://github.com/facebook/react-native/commit/883e0d5752b952c829c8d45504d3532f52bb272f) by [@yungsters](https://github.com/yungsters)) -- Disable TouchableOpacity when `accessibilityState.disabled` is set ([ea609defe8](https://github.com/facebook/react-native/commit/ea609defe8462a6beeac4da3aa7a43397ee9a77f) by [@chakrihacker](https://github.com/chakrihacker)) -- Upgrade Babel from 7.12.3 to 7.14.1 ([58a0f9b4e2](https://github.com/facebook/react-native/commit/58a0f9b4e202a921ab0820c79d6a3dd54204da46) by [@MichaReiser](https://github.com/MichaReiser)) -- Upgrade `react-devtools-core` from ~4.6.0 to ^4.13.0 ([9e020ef476](https://github.com/facebook/react-native/commit/9e020ef476e24bb5703fc421225f1a94ae14512b) by [@bvaughn](https://github.com/bvaughn)) -- Update Flipper to 0.99.0 ([41f45a77ad](https://github.com/facebook/react-native/commit/41f45a77ad09b46de328fb2a72775a052dac1e93) by [@swrobel](https://github.com/swrobel)) -- Bump CLI to ^6.0.0 ([c677e196a9](https://github.com/facebook/react-native/commit/c677e196a9c4d6cfdf84d97e4746922bb4ed4823) by [@thymikee](https://github.com/thymikee)) -- Upgrade ESLint TS parser and plugin ([3b751d396b](https://github.com/facebook/react-native/commit/3b751d396ba0acaa1b4c8e1115c79eb45dab403d) by [@wcandillon](https://github.com/wcandillon)) -- Upgrade folly to 2021.06.28.00 and boost to 1.76.0 ([b77948e33b](https://github.com/facebook/react-native/commit/b77948e33bc5e0df422fffca3b4c9253f611d298) by [@Kudo](https://github.com/Kudo)) - -#### Android specific - -- Add BLUETOOTH_ADVERTISE to `PermissionsAndroid` ([2bcc6fac38](https://github.com/facebook/react-native/commit/2bcc6fac3844f0752bc7067517c92a643679575e) by [@iBotPeaches](https://github.com/iBotPeaches)) -- Native ScrollView listeners list maintains weak references to listeners to avoid memory leaks ([b673e352fb](https://github.com/facebook/react-native/commit/b673e352fb0ea44b545edf5a7e8c1b422180838a) by [@dalves](https://github.com/dalves)) -- Rename the "Toggle Inspector" DevMenu item to "Hide/Show Element Inspector" ([e91fb05db7](https://github.com/facebook/react-native/commit/e91fb05db7f576e07114755b9db1eee91c672f25) by [@RSNara](https://github.com/RSNara)) -- Localize "search", "button", and "togglebutton" accessibility roles by using the platform roles ([399285f91c](https://github.com/facebook/react-native/commit/399285f91c2f675dea16fe61a86049ef7fecf35b) by [@kacieb](https://github.com/kacieb)) -- Refactor `AndroidTextInput.AndroidTextInput.color` prop to use SharedColor instead of int ([bc57056cc3](https://github.com/facebook/react-native/commit/bc57056cc3263431d54982426d890ba60b4cadb7) by [@mdvacca](https://github.com/mdvacca)) -- Upgraded `infer-annotation` to 0.18.0. ([b5c94e316c](https://github.com/facebook/react-native/commit/b5c94e316cc9b4ff090d8daa8970bf1becf77959) by [@yungsters](https://github.com/yungsters)) -- Bumped AGP to 4.2.2 ([ae494e7ce1](https://github.com/facebook/react-native/commit/ae494e7ce199cc5d524f791d45ddce51535cdadb) by [@cortinico](https://github.com/cortinico)) -- Upgrade folly to 2021.06.28.00 ([ebe939b18a](https://github.com/facebook/react-native/commit/ebe939b18aa859eb0f7f265222874c292ed771a4) by [@Kudo](https://github.com/Kudo)) -- Bump NDK to 21.4.7075529 ([aa43aab77c](https://github.com/facebook/react-native/commit/aa43aab77c8571632a2b0913c80fbf822dac01bc) by [@dulmandakh](https://github.com/dulmandakh)) - -#### iOS specific - -- ScrollView scrollIndicatorInsets to not automatically add safe area on iOS13+ ([bc1e602e0c](https://github.com/facebook/react-native/commit/bc1e602e0c7922da6bf238675b7bf8b4c3faa493) by [@justinwh](https://github.com/justinwh)) - -### Removed - -- `StyleSheet.create` will no longer do DEV-time validation. ([2e8c0bd7ea](https://github.com/facebook/react-native/commit/2e8c0bd7ea7db1aac183eb7f656772d3cffcb132) by [@yungsters](https://github.com/yungsters)) - -### Fixed - -- Fix `window` not existing in jest setup ([bc1c533833](https://github.com/facebook/react-native/commit/bc1c533833bfe25a22f1abd105b8bcb1babce3b5) by [@timomeh](https://github.com/timomeh)) -- Clamp negative values for `numberOfLines` in component ([3bc883c6c6](https://github.com/facebook/react-native/commit/3bc883c6c60632f6a41df3867368f16f684b3865) by [@ShikaSD](https://github.com/ShikaSD)) -- Add missing `jest/create-cache-key-function` dep root package.json ([9a43eac7a3](https://github.com/facebook/react-native/commit/9a43eac7a32a6ba3164a048960101022a92fcd5a) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix Switch ref forwarding ([1538fa4455](https://github.com/facebook/react-native/commit/1538fa4455fa7095879aceba7f74a519c1337a8b) by [@janicduplessis](https://github.com/janicduplessis)) -- Report fatal errors even if its `type` is "warn". ([e4a4c4d6d7](https://github.com/facebook/react-native/commit/e4a4c4d6d71ab1a747d768e4b518e64e100ddfde) by [@yungsters](https://github.com/yungsters)) -- Parse `accessibilityAction` props into object instead of string ([faaeb778df](https://github.com/facebook/react-native/commit/faaeb778dfe25df67fc00b599d023819c10406e8) by [@ShikaSD](https://github.com/ShikaSD)) -- Avoid downgrading `console.error` when passed warning-like objects. ([0dba0aff18](https://github.com/facebook/react-native/commit/0dba0aff185f4fd46e1146362235e68e52c59556) by [@yungsters](https://github.com/yungsters)) -- Fix natively driven animations not getting reset properly ([129180c77b](https://github.com/facebook/react-native/commit/129180c77b0b99a3acedbeb04ce6ec4667f74cac) by [@tienphaw](https://github.com/tienphaw)) -- Fix compilation errors on Windows. ([6d04a46f74](https://github.com/facebook/react-native/commit/6d04a46f7427b9e107608f8f620fe2a1a84ff42d)) -- Fixed bug parsing hermes call stacks when the file name is empty ([e539e7d0be](https://github.com/facebook/react-native/commit/e539e7d0bed4fef42f458f28d06100ae23f52cb7) by [@MartinSherburn](https://github.com/MartinSherburn)) -- Upgrade dependencies / version of eslint package ([463ec22bb9](https://github.com/facebook/react-native/commit/463ec22bb9f2938164fef6133dfd94d2e428e5b0) by [@mikehardy](https://github.com/mikehardy)) - -#### Android specific - -- Allow taps on views outside the bounds of a parent with `overflow: visible` ([e35a963bfb](https://github.com/facebook/react-native/commit/e35a963bfb93bbbdd92f4dd74d14e2ad6df5e14a) by [@hsource](https://github.com/hsource)) -- Fixed to use correct Android theme color for dark theme ([b3a715f6ea](https://github.com/facebook/react-native/commit/b3a715f6ea3d0faaf6d09e2a49267f2a5fb3fad2) by [@sidverma32](https://github.com/sidverma32)) -- Fixed dynamic behavior of `` on Android ([59021521e7](https://github.com/facebook/react-native/commit/59021521e7aba0f70b91b5c7778ccdd1b30eaae4)) -- Fix Dimensions not updating ([c18a492858](https://github.com/facebook/react-native/commit/c18a492858e94b31e632560ad17499012e688158) by [@jonnyandrew](https://github.com/jonnyandrew)) -- Fix dashed/dotted border-drawing when `borderRadius` is 0 ([3e5998e651](https://github.com/facebook/react-native/commit/3e5998e651eba840603dcb1a9c0be564fc3f868d) by [@IjzerenHein](https://github.com/IjzerenHein)) -- Fix selectionColor doesn't style Android TextInput selection handles ([5819538a08](https://github.com/facebook/react-native/commit/5819538a087f1f48d564e7b4e273fe43dfb026cc) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard ([f51773ecde](https://github.com/facebook/react-native/commit/f51773ecdedbac19d25eb20894e532edef2cb304) by [@levibuzolic](https://github.com/levibuzolic)) -- Avoid calling setHint with a null parameter causing cursor to jump to the right ([3560753559](https://github.com/facebook/react-native/commit/356075355908f4901b87ad6ce33c157f01c8e748) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Create slider accessibility delegate in createViewInstance ([91cac20289](https://github.com/facebook/react-native/commit/91cac2028900cd18d17e70f9050cc125ed1eb12e) by [@janicduplessis](https://github.com/janicduplessis)) -- Quickfix individual border style dotted or dashed rendering as solid ([cb0e1d603a](https://github.com/facebook/react-native/commit/cb0e1d603aa4439a4d4804ad2987e4cb1f9bbf90) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Make `mHybridData` thread safe ([7929551623](https://github.com/facebook/react-native/commit/7929551623d4e3fbd849500d795755d0c41fdbbd)) -- Exit early from layout in textview if text layout is null ([8dfc3bcda1](https://github.com/facebook/react-native/commit/8dfc3bcda1e77fc982bc98da20dc129c23d8cc77) by [@ShikaSD](https://github.com/ShikaSD)) -- Fix `NullPointerException` caused by race condition in `ReactInstanceManager.getViewManagerNames` method ([fb386fccdd](https://github.com/facebook/react-native/commit/fb386fccddfe381fd6af5656c13fac802bffd316) by [@mdvacca](https://github.com/mdvacca)) -- Pressable ripple subsequent press coordinates. ([961b00d8c0](https://github.com/facebook/react-native/commit/961b00d8c0117750ce147c0b27c59af93f64b65c) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) -- TouchableNativeFeedback ripple starts on previous touch location. ([d85d72d0d9](https://github.com/facebook/react-native/commit/d85d72d0d9143693f73cef24c8e5bbb4d539a620) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) -- Fix Crash in `ViewProps.isLayoutOnly` ([e6b9508f12](https://github.com/facebook/react-native/commit/e6b9508f12ffd732d773ddcf9c2f633b0eca4232) by [@javache](https://github.com/javache)) -- Fixed a crash when updating `snapToOffsets` to a null value ([ba387b91d3](https://github.com/facebook/react-native/commit/ba387b91d3c7c9c1acd4b08f07fcd45629f3edfb) by [@maxoumime](https://github.com/maxoumime)) -- Adding `setAccessible` to `ReactImageManager` to allow screenreader announce Image accessibilityState of "disabled" ([333b46c4b0](https://github.com/facebook/react-native/commit/333b46c4b0ddee286e6d1d4b971fe8554a5c14cb) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Fixed Android library builds with react.gradle file ([88f0676ae4](https://github.com/facebook/react-native/commit/88f0676ae49fd629331495101248c8e13423aed2) by [@Legion2](https://github.com/Legion2)) - -#### iOS specific - -- Fix deadlock on `RCTi18nUtil` ([fcead14b0e](https://github.com/facebook/react-native/commit/fcead14b0effe2176a5d08ad50ee71e48528ddbd) by [@Saadnajmi](https://github.com/Saadnajmi)) -- Avoid re-encoding images when uploading local files ([f78526ce3d](https://github.com/facebook/react-native/commit/f78526ce3d4004eb4bf8ca5178ca7e2c1c9abc1a) by [@arthuralee](https://github.com/arthuralee)) -- content is reset when emoji is entered at the max length ([f3b8d4976f](https://github.com/facebook/react-native/commit/f3b8d4976f8608c2cda1f071923f14b6d4538967)) -- Use `actionName` in accessibility event callback ([fed6ad5bad](https://github.com/facebook/react-native/commit/fed6ad5badb4196a1895370fc81c522572cb34b4) by [@ShikaSD](https://github.com/ShikaSD)) - -## v0.65.3 - -🚨 **IMPORTANT:** This is an exceptional release on an unsupported version. We recommend you upgrade to one of [the supported versions, listed here](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported). - -### Fixed - -- Force dependencies resolution to minor series for 0.65 ([9548eaea74](https://github.com/facebook/react-native/commit/9548eaea74c6ad242c015d1984503c4b7eb19b6f) by [@kelset](https://github.com/kelset)) - -## v0.65.2 - -### Fixed - -- For Android, general fixes to Appearance API and also fixes AppCompatDelegate.setDefaultNightMode(). For iOS, now works correctly when setting window.overrideUserInterfaceStyle ([25a2c608f7](https://github.com/facebook/react-native/commit/25a2c608f790f42cbc4bb0a90fc06cc7bbbc9b95) by [@mrbrentkelly](https://github.com/mrbrentkelly)) - -## v0.65.1 - -### Changed - -- Set `react-test-renderer` to `17.0.2` in the template ([d272880](https://github.com/facebook/react-native/commit/d27288044e94a248982f596e9885d55d066bc72e) by [@@rickhanlonii](https://github.com/@rickhanlonii)) - -### Fixed - -- Resolve `NODE_BINARY` after finding the right path to node ([d75683](https://github.com/facebook/react-native/commit/d75683ac943205d64dd4142cca713ab2356094b8) by [@santiagofm](https://github.com/santiagofm)) - -#### Android specific - -- `ColorProps` with value null should be defaultColor instead of transparent ([842bcb902e](https://github.com/facebook/react-native/commit/842bcb902ed27928255b60cb20524e9318d9bf70) by [@hank121314](https://github.com/hank121314)) -- Android Gradle Plugin 7 compatibility ([06e31c748f](https://github.com/facebook/react-native/commit/06e31c748fe87a866dbaf4d0c2019e76ec00e309) by [@dulmandakh](https://github.com/dulmandakh)) - -## v0.65.0 - -### Highlights - -- Hermes 0.8.1. Please see the highlighted changes from its [0.8.0](https://github.com/facebook/hermes/releases/tag/v0.8.0) and [0.8.1](https://github.com/facebook/hermes/releases/tag/v0.8.1) release notes. -- `react-native-codegen` version `0.0.7` is now needed as a `devDependency` in the `package.json`. - -### Breaking Changes - -#### iOS specific - -- Replace `flipper_post_install` with `react_native_post_install` hook. Will automatically detect if Flipper is enabled. ([42dde12aac](https://github.com/facebook/react-native/commit/42dde12aac81208c4e69da991f4e08b9e62d18f6) by [@grabbou](https://github.com/grabbou)) - -### Added - -- Add `onPressIn` & `onPressOut` props to Text ([1d924549ca](https://github.com/facebook/react-native/commit/1d924549cad75912191005c8f68dd73e15b07183) by [@adrienharnay](https://github.com/adrienharnay)) -- Stabilize `RootTagContext`. And temporarily export both `unstable_RootTagContext` and `RootTagContext` ([9d489354ae](https://github.com/facebook/react-native/commit/9d489354ae373614b20cd91f588eb25743686ee0) by [@nadiia](https://github.com/nadiia)) -- Implement `sendAccessibilityEvent` in the React(Fabric/non-Fabric) renderer ([99b7052248](https://github.com/facebook/react-native/commit/99b7052248202cee172e0b80e7ee3dfb41316746) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Re-added `localeIdentifier` to `I18nManager` constants ([6b91ae73cd](https://github.com/facebook/react-native/commit/6b91ae73cdf096e15a3235ae76276f9d7fb12f7b) by [@acoates-ms](https://github.com/acoates-ms)) -- Add PressabilityPerformanceEventEmitter ([c4c0065b00](https://github.com/facebook/react-native/commit/c4c0065b0009ced0049c5abc4dddd327ac638928) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Added `displayName` to some RN contexts to make them more easy to differentiate when debugging. ([68a476103a](https://github.com/facebook/react-native/commit/68a476103a95be77f4fc7c582e52cc94946de1b4) by [@bvaughn](https://github.com/bvaughn)) -- Add `displayName` to `TouchableHighlight` and `TouchableOpacity` ([c4e40b81c0](https://github.com/facebook/react-native/commit/c4e40b81c01d061c189a7d28a4f56a588c3d1aea) by [@brunohkbx](https://github.com/brunohkbx)) -- Added context to URL's error messages when the feature is not implemented ([452240bafa](https://github.com/facebook/react-native/commit/452240bafa970578144aedaea0223e17863d2d26) by [@Crash--](https://github.com/Crash--)) -- Add a `stickyHeaderHiddenOnScroll` option to keep the sticky header hidden during scrolling down, and only slide in when scrolling up ([ffba25c648](https://github.com/facebook/react-native/commit/ffba25c648152021dd3fb9e79afd8cade7008d05)) -- Added `debugName` parameter to `renderApplication` to use as the display name for the React root tree ([eeb36f4709](https://github.com/facebook/react-native/commit/eeb36f470929c2fdd8e1ed69898a5ba9144b8715) by [@rubennorte](https://github.com/rubennorte)) -- Adding support for `cancelOnBackground` for UserFlow ([0d4985900b](https://github.com/facebook/react-native/commit/0d4985900b52d5def22fce4371c2259ee65368ee) by [@dmitry-voronkevich](https://github.com/dmitry-voronkevich)) -- Introducing RuntimeScheduler module ([eb13baf2a6](https://github.com/facebook/react-native/commit/eb13baf2a687b53dde04b9a336f18629d94f4b79) by [@sammy-SC](https://github.com/sammy-SC)) -- Roll out TurboModule Promise Async Dispatch ([5c4f145e33](https://github.com/facebook/react-native/commit/5c4f145e33d92969f8a86284360a5a2f09308500) by [@RSNara](https://github.com/RSNara)) - -#### Android specific - -- Add `getRecommendedTimeoutMillis` to AccessibilityInfo ([d29a7e7a89](https://github.com/facebook/react-native/commit/d29a7e7a89f4e5e3489e9723979426bb1b6f0674) by [@grgr-dkrk](https://github.com/grgr-dkrk)) -- TalkBack now announces "unselected" when changing `accessibilityState.selected` to false. ([73bc96ecf9](https://github.com/facebook/react-native/commit/73bc96ecf9a16d420533c12e9e1812ffe21c10a2) by [@yungsters](https://github.com/yungsters)) -- Fbjni version bump to 0.0.3 ([24f9f75bf6](https://github.com/facebook/react-native/commit/24f9f75bf66b8f32a117ba9f9dea3c65b35b1e00) by [@IvanKobzarev](https://github.com/IvanKobzarev)) -- Add `onFocus` and `onBlur` for Pressable on Android. ([cab4da7288](https://github.com/facebook/react-native/commit/cab4da728814bf9d3c0cc7c9921e982bfc090730)) -- Introduce API to allow applications to register `TurboModuleManagerDelegates` with `ReactInstanceManager` ([eb7e89e286](https://github.com/facebook/react-native/commit/eb7e89e2864e941b4a21d55a7403a6028e9a26a2) by [@RSNara](https://github.com/RSNara)) -- Added convenience methods to simplify native Event classes and ease migrations ([72d0ddc16f](https://github.com/facebook/react-native/commit/72d0ddc16f2f631003c3486e0a59e50c145ec613) by [@JoshuaGross](https://github.com/JoshuaGross)) - -#### iOS specific - -- High contrast dynamic color options for dark and light mode. ([4b9d9dda27](https://github.com/facebook/react-native/commit/4b9d9dda270acd4e0314f40490c699ffd0f6e30e) by [@birkir](https://github.com/birkir)) -- Adds an ability to retrieve the notifications authorization status from JavaScript side. ([b86e52a9ec](https://github.com/facebook/react-native/commit/b86e52a9ec9ec828388eb4a717a3782a54c7b3d9)) -- Added reset method to `RCTFabricSurface` to help with reloads ([53858ceaa3](https://github.com/facebook/react-native/commit/53858ceaa3beab02726b1bd6e125e506477d445e) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Allow `RCTRootView` to be initialized with a frame ([00bc09c8f7](https://github.com/facebook/react-native/commit/00bc09c8f76879eb1f9a92a6a643191da9355de8) by [@appden](https://github.com/appden)) -- Allow for configuring the `NSURLSessionConfiguration` ([58444c74f5](https://github.com/facebook/react-native/commit/58444c74f5c18b74e88a6c1cd0f059fe434c1a21) by [@hakonk](https://github.com/hakonk)) -- Use react-native-codegen in iOS app template ([e99b8bbb40](https://github.com/facebook/react-native/commit/e99b8bbb404f8cd1f11b6c7998083be530d7b8a4) by [@hramos](https://github.com/hramos)) - -### Changed - -- Bump Flipper + Bump hermes (#31872 by [@Titozzz](https://github.com/Titozzz)) -- Show warning when native module without `addListener` or `removeListeners` is passed to `NativeEventEmitter` ([114be1d217](https://github.com/facebook/react-native/commit/114be1d2170bae2d29da749c07b45acf931e51e2) by [@rubennorte](https://github.com/rubennorte)) -- Disable `accessibilityState` when the `TouchableWithoutFeedback` is `disabled`. ([697164077c](https://github.com/facebook/react-native/commit/697164077c362cfa9a384b0f4e246d6bd9c470ba) by [@carloscuesta](https://github.com/carloscuesta)) -- Upgraded `react-devtools-core dependency` to 4.12.0 ([5a2693d78f](https://github.com/facebook/react-native/commit/5a2693d78f1a886f0aa5b7f86830d3ddb54a57e9) by [@bvaughn](https://github.com/bvaughn)) -- Set disabled `accessibilityState` when `TouchableHighlight` is disabled ([f69e096bb4](https://github.com/facebook/react-native/commit/f69e096bb4df67474351786f674b1bb1e42d3363) by [@Naturalclar](https://github.com/Naturalclar)) -- Add checks and logs to for better error handling ([ea1f9531f0](https://github.com/facebook/react-native/commit/ea1f9531f00b5cd834e03f58cdfa117a93634624)) -- CreateAnimatedComponent: removed deprecated lifecycles usage ([ba61267015](https://github.com/facebook/react-native/commit/ba61267015567bf180dd3272a295dc262b3e2c97) by [@nadiia](https://github.com/nadiia)) -- Hide caret in the `TextInput` during test runs. ([397bfa6ad7](https://github.com/facebook/react-native/commit/397bfa6ad7dff71f4b6d27ac17acc76fe8a6bbb5) by [@nadiia](https://github.com/nadiia)) -- Use `usePressability` hook in TextInput ([c4aa411ee3](https://github.com/facebook/react-native/commit/c4aa411ee374f2320343b900f1f8b24a47b633c9) by [@nadiia](https://github.com/nadiia)) -- `Keyboard` no longer inherits from `NativeEventEmitter`, so it no longer implements `removeAllListeners`, and `removeSubscription`. ([1049835b50](https://github.com/facebook/react-native/commit/1049835b504cece42ee43ac5b554687891da1349) by [@yungsters](https://github.com/yungsters)) -- `AppState` no longer inherits from `NativeEventEmitter`, so it no longer implements `addListener`, `removeAllListeners`, and `removeSubscription`. ([6f22989e92](https://github.com/facebook/react-native/commit/6f22989e920246a2cd611b93e170024d89903027) by [@yungsters](https://github.com/yungsters)) -- `DevSettings` no longer inherits from `NativeEventEmitter` ([70cd569e7e](https://github.com/facebook/react-native/commit/70cd569e7e4cceac81023eae4ea5089cff2f9b59) by [@yungsters](https://github.com/yungsters)) -- LogBox will not initially collapse stack frames if every frame would be collapsed. ([88a41f180c](https://github.com/facebook/react-native/commit/88a41f180c315bc55e05d77ddc3fc671ad8630e6) by [@yungsters](https://github.com/yungsters)) -- Update package name warning of deprecated modules ([34e1b0ef98](https://github.com/facebook/react-native/commit/34e1b0ef981559adc09cd9f994bef9584f1c82b7) by [@Naturalclar](https://github.com/Naturalclar)) -- Update react-native-codegen to 0.0.7 ([cd6c9f3273](https://github.com/facebook/react-native/commit/cd6c9f3273fbe41052c4ec8512d3b1129daf149b) by [@Naturalclar](https://github.com/Naturalclar)) -- Update template devDependencies ([652e3953f4](https://github.com/facebook/react-native/commit/652e3953f48938580e1bf8ea1ba70105997e59d2) by [@Bardiamist](https://github.com/Bardiamist)) -- Don't minify JS bundle by default when using hermes ([1a67dda668](https://github.com/facebook/react-native/commit/1a67dda668c71d961a4bb3b0cdf6aa22c0e5c138) by [@janicduplessis](https://github.com/janicduplessis)) -- Migrate warnings in index.js to point to new lean core repos ([4421a64ac1](https://github.com/facebook/react-native/commit/4421a64ac1ea9df3827fb99194c8576a0750beab) by [@Naturalclar](https://github.com/Naturalclar)) -- Update Flipper to 0.93.0 ([06c33e9abe](https://github.com/facebook/react-native/commit/06c33e9abe6ed51b1c8bba03982ebce2b6da3860) by [@mweststrate](https://github.com/mweststrate)) -- Update Flipper to 0.91.1, fixed iOS build support for i386, `use_flipper!()` will no longer need custom overrides to build with XCode 12.5 ([4246c75d0d](https://github.com/facebook/react-native/commit/4246c75d0d5b9dccbe0fd5ecec66b4cc0331f815) by [@mweststrate](https://github.com/mweststrate)) -- Find node on m1 via homebrew node managers ([4d40b53c12](https://github.com/facebook/react-native/commit/4d40b53c12c8ad52760c63cacde417ee876bdfb1) by [@danilobuerger](https://github.com/danilobuerger)) -- Clean up EventObjectPropertyType ([0e46080847](https://github.com/facebook/react-native/commit/0e46080847595fb7577b18042c932db958bc0959) by [@RSNara](https://github.com/RSNara)) -- `Appearance.addChangeListener` now returns an `EventSubscription`. ([305b4253c2](https://github.com/facebook/react-native/commit/305b4253c2a9ed4d71be33e02cb12b6d570e2fb1) by [@yungsters](https://github.com/yungsters)) -- `Dimensions.addEventListener` now returns an `EventSubscription`. ([c47a03563d](https://github.com/facebook/react-native/commit/c47a03563db72d1580bf87b7729bd22ce6ca63dd) by [@yungsters](https://github.com/yungsters)) -- Updated react-native-community/cli to v6 (hence updating metro to 0.66) ([0d32aef3aa](https://github.com/facebook/react-native/commit/0d32aef3aa9a75b00d99503b8e4f502c52380dea) by [@Titozzz](https://github.com/Titozzz)) -- Reflect Hermes release version from HermesBadge ([c54aeccf1a](https://github.com/facebook/react-native/commit/c54aeccf1a8e16240e400d783dda5ec07fcf3808) by [@Huxpro](https://github.com/Huxpro)) - -#### Android specific - -- Modified `NativeEventEmitter` to also use the passed native module to report subscriptions on Android ([f5502fbda9](https://github.com/facebook/react-native/commit/f5502fbda9fe271ff6e1d0da773a3a8ee206a453) by [@rubennorte](https://github.com/rubennorte)) -- RefreshControl.size prop changed its type to string, the valid values are: 'default' and 'large' ([dd60414578](https://github.com/facebook/react-native/commit/dd604145781ac07c8db8d9100043bd76f6d6e913), [65975dd28d](https://github.com/facebook/react-native/commit/65975dd28de0a7b8b8c4eef6479bf7eee5fcfb93) by [@mdvacca](https://github.com/mdvacca)) -- TouchableNativeFeedback: sync disabled prop with accessibilityState ([88f2356eed](https://github.com/facebook/react-native/commit/88f2356eedf71183d02cde0826c8a0c6910f83dd) by [@kyamashiro](https://github.com/kyamashiro)) -- Rename `hasActiveCatalystInstance` to `hasActiveReactInstance` ([dfa8eb0558](https://github.com/facebook/react-native/commit/dfa8eb0558338f18ea01f294a64d355f6deeff06)) -- Record latest error type in dev support ([423453e105](https://github.com/facebook/react-native/commit/423453e1050c9aedda2df050a5ee6d40e7c82031)) -- Passing accessibility state in button so it can announce disabled in talkback ([5889cbebe3](https://github.com/facebook/react-native/commit/5889cbebe392dd19c6ce0cfd5fa1f725ece1060a) by [@huzaifaaak](https://github.com/huzaifaaak)) -- Fixed issue that causes HorizontalScrollView to shift to the right when a TextInput is selected and keyboard pops up ([b9b23e1ab1](https://github.com/facebook/react-native/commit/b9b23e1ab138189d2a4c22b13ba6ad8f8957579e) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Fixed jumpy RTL horizontal ScrollViews. If you have Android-specific JS hacks for handling RTL in ScrollViews, you probably can/probably want to remove them, because they should be reliable now and require fewer hacks. ([fc032cd8d8](https://github.com/facebook/react-native/commit/fc032cd8d889d828edad3ea4b735205092cf0d40) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Add a new check to avoid calling this method ([2b708560fc](https://github.com/facebook/react-native/commit/2b708560fc002c26f0b09f09cfa451827a3425ac)) -- Clipping subviews has been temporarily disabled in HorizontalScrollView in RTL mode. Minor/negligible perf impact. ([da8ed6b625](https://github.com/facebook/react-native/commit/da8ed6b6252fd53a83f14ab6da7e9b467f12ffe1) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Change StatusBar style handling strategy ([7324b92dc4](https://github.com/facebook/react-native/commit/7324b92dc45679d3b38526378b7d3e78ad082641)) -- Clean listeners during destroy of `ReactContext` ([d79212120b](https://github.com/facebook/react-native/commit/d79212120b7168015d3d0225ef372ed851a230fa) by [@mdvacca](https://github.com/mdvacca)) -- Bump buildToolsVersion to 30.0.2, ([5d01110b53](https://github.com/facebook/react-native/commit/5d01110b5370f884907b6dbdc56773f03518a54d) by [@dulmandakh](https://github.com/dulmandakh)) -- Initial replacement of jcenter with mavenCentral. ([704dd2812f](https://github.com/facebook/react-native/commit/704dd2812f7b8c79971274cc9e4c717e56847ac0) by [@ShikaSD](https://github.com/ShikaSD)) -- Remove developer tool guard for android ([c7d28bca30](https://github.com/facebook/react-native/commit/c7d28bca308c1654c576df9a0328a3116ed65d54)) -- Bump Android compileSdkVersion and targetSdkVersion from 29 to 30 ([55c8833817](https://github.com/facebook/react-native/commit/55c8833817c3e9cf9882a712c8b9946a262df231), [c7efd5b369](https://github.com/facebook/react-native/commit/c7efd5b369aa7605a1017791440735ab72bc9fa8) by [@mdvacca](https://github.com/mdvacca)) -- Upgrade jsc-android to 250230.2.1 ([341f061ce3](https://github.com/facebook/react-native/commit/341f061ce3ae057f3a958654e0ec3a9c4c8211ad) by [@Kudo](https://github.com/Kudo)) -- Bump Gradle to 6.9, Android Gradle Plugin to 4.2.1 ([547b4c92e4](https://github.com/facebook/react-native/commit/547b4c92e4743f5b5816297f48a608ace9de6bb5) by [@dulmandakh](https://github.com/dulmandakh)) -- Bump gradle wrapper to 6.8.3 ([7258afeea3](https://github.com/facebook/react-native/commit/7258afeea38949dc408c0af79924f6f36f7ade84) by [@dulmandakh](https://github.com/dulmandakh)) -- Bumping OkHttp from 4.9.0 to 4.9.1. ([6caec9d91f](https://github.com/facebook/react-native/commit/6caec9d91fe71bcd80d670218d752c4f251bde81) by [@gedeagas](https://github.com/gedeagas)) -- Bumping OkHttp from v3 to v4. ([8207e97f91](https://github.com/facebook/react-native/commit/8207e97f9174a04e319431193c0f63d47a093c44) by [@arazabishov](https://github.com/arazabishov)) -- Update Okhttp to version 3.14.19 ([6bfd89d277](https://github.com/facebook/react-native/commit/6bfd89d27724f2aac602fa2acbf4753950f4152e) by [@LukasFPV](https://github.com/LukasFPV)) -- Bump Fresco to 2.5.0 ([8fa8934011](https://github.com/facebook/react-native/commit/8fa8934011e4d9f1f7a49c8519fcc97f30a5c74b) by [@dulmandakh](https://github.com/dulmandakh)) -- Bump Fresco to 2.3.0 ([280f524b49](https://github.com/facebook/react-native/commit/280f524b491e7a36bb9f9a26e354bb8e125375ed) by [@dulmandakh](https://github.com/dulmandakh)) - -#### iOS specific - -- Give RCTNetworking handler provider block RCTModuleRegistry ([4c5182c1cc](https://github.com/facebook/react-native/commit/4c5182c1cc8bafb15490adf602c87cb5bf289ffd) by [@RSNara](https://github.com/RSNara)) -- Give RCTImageURLLoader's loader/decoder provider blocks RCTModuleRegistry ([af6bcfa3ab](https://github.com/facebook/react-native/commit/af6bcfa3ab0ef6e1b0f669dda6cd7d6a5e8975ba) by [@RSNara](https://github.com/RSNara)) -- Make RCTTurboModule `getTurboModule`: required ([e0b8f5080f](https://github.com/facebook/react-native/commit/e0b8f5080f814ba2a75807ed6d7f2944aab98d7e) by [@RSNara](https://github.com/RSNara)) -- Update React.podspec to require cocoapods >= 1.10.1 ([b50b7e3a19](https://github.com/facebook/react-native/commit/b50b7e3a191dfa95aa122c259e0df8699cbaccae) by [@sunnylqm](https://github.com/sunnylqm)) -- Fix glog pod install with Xcode 12 ([8a5fd8ea95](https://github.com/facebook/react-native/commit/8a5fd8ea95678a0b4423db2cbcbefc1a33595813) by [@dulmandakh](https://github.com/dulmandakh)) -- Only show Dev Menu on shake if RN view is visible ([7186c4de4f](https://github.com/facebook/react-native/commit/7186c4de4fc76e87fa1386f2839f178dd220a02b) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- `progressViewOffset` prop of `RefreshControl` and `VirtualizedList` now works on iOS ([310a6bcf4b](https://github.com/facebook/react-native/commit/310a6bcf4ba7ca162d3ba1c03e0ab07ff41f9ead) by [@davidbiedenbach](https://github.com/davidbiedenbach)) -- Roll out TurboModule block copy ([5275895af5](https://github.com/facebook/react-native/commit/5275895af5136bc278c0c5eb07ae93e395c5b29b) by [@RSNara](https://github.com/RSNara)) -- Add instructions to template/ios/Podfile for enabling hermes ([a326a30e32](https://github.com/facebook/react-native/commit/a326a30e322f6cdff880734aafe965b299febb8d) by [@SConaway](https://github.com/SConaway)) - -### Deprecated - -- `EventEmitter#removeSubscription` is now deprecated. ([cb6cbd12f8](https://github.com/facebook/react-native/commit/cb6cbd12f80152b4ce742f37e2e6eefadf89d927) by [@yungsters](https://github.com/yungsters)) -- It is now deprecated to pass a constructor argument to `EventEmitter(...)`. ([14f7a2b707](https://github.com/facebook/react-native/commit/14f7a2b70754c92804d746959d1ff091bf49af69) by [@yungsters](https://github.com/yungsters)) -- Deprecate `AccessibilityInfo.removeEventListener`. ([003d63d6e5](https://github.com/facebook/react-native/commit/003d63d6e501411f870ff5dbef819ad2aca20974) by [@yungsters](https://github.com/yungsters)) -- Deprecate `Linking.removeEventListener`. Instead, call `remove()` on the subscription returned by `Linking.addEventListener`. ([6d1aca806c](https://github.com/facebook/react-native/commit/6d1aca806cee86ad76de771ed3a1cc62982ebcd7), [035718ba97](https://github.com/facebook/react-native/commit/035718ba97bb44c68f2a4ccdd95e537e3d28690c) by [@yungsters](https://github.com/yungsters)) -- Old Native method to create ScrollEvent has been deprecated and will be removed at some point in the (distant) future ([62f0dee235](https://github.com/facebook/react-native/commit/62f0dee2353b14ce1524dc62de5e1d2f1883a089) by [@JoshuaGross](https://github.com/JoshuaGross)) - -#### Android specific - -- Deprecate `NativeModule.onCatalystInstanceDestroy()` for `NativeModule.invalidate()` ([18c8417290](https://github.com/facebook/react-native/commit/18c8417290823e67e211bde241ae9dde27b72f17) by [@RSNara](https://github.com/RSNara)) -- Mark `hasActiveCatalystInstance()` as Deprecated ([1b50722a7e](https://github.com/facebook/react-native/commit/1b50722a7e84cd8acffd3f0f84d77057e1e0d955)) - -### Removed - -- Stabilize `RootTagContext` ([9b98edcd01](https://github.com/facebook/react-native/commit/9b98edcd0155a4a8a1f71d19e565c485910a6137) by [@nadiia](https://github.com/nadiia)) -- Removed `getNode()` from animated component refs. ([b914153286](https://github.com/facebook/react-native/commit/b914153286ea537d4a57ff934e63e07172c576a0) by [@yungsters](https://github.com/yungsters)) -- Remove legacy context API usage in AppContainer ([17be3a0032](https://github.com/facebook/react-native/commit/17be3a0032c181a100efc7af17b7366a3d636c52) by [@nadiia](https://github.com/nadiia)) -- Removed `AccessibilityInfo.fetch`, use `isScreenReaderEnabled` instead. ([d831134d51](https://github.com/facebook/react-native/commit/d831134d514c5db6be1ee35cc7e9994b777179c1) by [@yungsters](https://github.com/yungsters)) -- Remove unused VR-only props ([95f7c791c5](https://github.com/facebook/react-native/commit/95f7c791c56b527dadbe0b4ec7a1be5af12d7afe) by [@Simek](https://github.com/Simek)) -- Removed `RCTDeviceEventEmitter.sharedSubscribers`. ([3af0c84aa5](https://github.com/facebook/react-native/commit/3af0c84aa5d1633f058ea3e7aef0d125fe33e01d) by [@yungsters](https://github.com/yungsters)) -- Moved `ScrollResponder.Mixin` methods into ScrollView to Remove ScrollResponder.js ([099f67cf8a](https://github.com/facebook/react-native/commit/099f67cf8aa290592092cfa0cb4e938d0543b696) by [@kacieb](https://github.com/kacieb)) -- `NativeEventEmitter` no longer inherits from `EventEmitter`, so it no longer implements `removeListener` and `removeSubscription`. Instead, use the `remove()` method on the subscription object returned by `addListener`. ([d39643b9de](https://github.com/facebook/react-native/commit/d39643b9de11c6b44984166ede34a7f44de76fe5) by [@yungsters](https://github.com/yungsters)) -- `RCTDeviceEventEmitter` no longer throws for `StatusBar`, `Keyboard`, and `AppState` events. However, you are still recommended to use the more appropriate modules for listening to these events. ([c8c975f0d7](https://github.com/facebook/react-native/commit/c8c975f0d7b8a57e9e90373a2be4d630ed9dd65e) by [@yungsters](https://github.com/yungsters)) -- Removed second optional argument of `NativeEventEmitter` constructor ([f5f47879b8](https://github.com/facebook/react-native/commit/f5f47879b8320a9934914cb8ce7a72269840a83a) by [@yungsters](https://github.com/yungsters)) -- Removed warning on Android for `setTimeout` with delays greater than 1 minute. ([480dabd665](https://github.com/facebook/react-native/commit/480dabd66547a60522249eda203a3eb1934b02e5) by [@yungsters](https://github.com/yungsters)) -- Removed `Touchable.TOUCH_TARGET_DEBUG` property. ([ef765d423c](https://github.com/facebook/react-native/commit/ef765d423cb188957a9fb2fd92c62b0efe8a36a6) by [@yungsters](https://github.com/yungsters)) - -#### Android specific - -- Remove okhttp3 proguard rules ([b4c9f13fe7](https://github.com/facebook/react-native/commit/b4c9f13fe794283d76766c1baef87888d174cb1c) by [@doniwinata0309](https://github.com/doniwinata0309)) -- Remove filter pills ([5cf4ab8dd2](https://github.com/facebook/react-native/commit/5cf4ab8dd28b5a336d7af29d295ede51f0d19587) by [@suminkimm](https://github.com/suminkimm)) -- Remove `ReactFragmentActivity` class. ([2798e7172b](https://github.com/facebook/react-native/commit/2798e7172b01b9e2dbe2937d0163f98ab29230cf) by [@dulmandakh](https://github.com/dulmandakh)) -- Remove jcenter ([70da640946](https://github.com/facebook/react-native/commit/70da64094608f5f2e3c554ed719e9aad624e3459) by [@dulmandakh](https://github.com/dulmandakh)) - -#### iOS specific - -- Removed event methods except `addListener` from `Networking` ([a81b7d18fa](https://github.com/facebook/react-native/commit/a81b7d18fa65a727539c6c7ea17f787673d3c889) by [@yungsters](https://github.com/yungsters)) -- Delete deprecated "live reloading" setting ([b512beb0c4](https://github.com/facebook/react-native/commit/b512beb0c497158f9c861fcc16af960655b1feb5) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Remove iOS10/tvOS10 support ([f2c6279ca4](https://github.com/facebook/react-native/commit/f2c6279ca497b34d5a2bfbb6f2d33dc7a7bea02a), [a1d626739d](https://github.com/facebook/react-native/commit/a1d626739d95d6cbbb1be169b93952cdd1465486) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Remove iOS10/tvOS10 support from remaining podfiles ([f0faa7843c](https://github.com/facebook/react-native/commit/f0faa7843c5a0e9041edb6e77fd6631335ab2b12) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Delete RCTTurboModuleManagerDelegate `getTurboModule:initParams` ([c4c34a1237](https://github.com/facebook/react-native/commit/c4c34a1237ec584c667c62358dc577174bf11033) by [@RSNara](https://github.com/RSNara)) - -### Fixed - -- Don't disconnect DevTools WebSocket connection on Cmd+D ([60a18c138c](https://github.com/facebook/react-native/commit/60a18c138c51d3adcfeba7785315fc222cdfeb35) by [@bvaughn](https://github.com/bvaughn)) -- For native components that accept color arrays, invalid elements will now fallback to transparent with a console error. ([bb6cd56fae](https://github.com/facebook/react-native/commit/bb6cd56fae4118f44ae47fd6978710a22f9e1510) by [@yungsters](https://github.com/yungsters)) -- Fixes usage of std::thread in runtime executor ([75d9ba733f](https://github.com/facebook/react-native/commit/75d9ba733f4a041e4320098b52903f69747df02b) by [@asklar](https://github.com/asklar)) -- Fix sticky header not sticking on first render in ScrollView ([921c9ff165](https://github.com/facebook/react-native/commit/921c9ff165d47a73e9978df918b1761b95f9979d) by [@kacieb](https://github.com/kacieb)) -- Fix ScrollView `getInnerViewNode` and `getInnerViewRef` ref methods ([6e36d046a3](https://github.com/facebook/react-native/commit/6e36d046a313c7961cc2f91e0422f4bf29005eb6) by [@vshab](https://github.com/vshab)) -- Fix stalling UI due to a bug in KeyboardAvoidingView ([67309277fe](https://github.com/facebook/react-native/commit/67309277fe588c4dd64fe0c680d1d00d2f3fb2b6) by [@sammy-SC](https://github.com/sammy-SC)) -- Avoid eating clicks/taps into ScrollView when using physical keyboard ([6d2a527984](https://github.com/facebook/react-native/commit/6d2a5279841886a9a14f82057202bf8950c3f917) by [@NickGerleman](https://github.com/NickGerleman)) -- Fix nested FlatList not firing `onScrollDragEnd` and `onMomentum` methods ([46be292f67](https://github.com/facebook/react-native/commit/46be292f671c70aac4ecc178c96e3a2a6a3d16da) by [@kacieb](https://github.com/kacieb)) -- Fix race condition in Debug Inspector shutdown ([d021000b9e](https://github.com/facebook/react-native/commit/d021000b9e358a9379ca5d6208f24757c0c8ce97) by [@MartinSherburn](https://github.com/MartinSherburn)) -- Fixes layout of nodes with `YGDisplayNone` and `YGPositionTypeAbsolute` ([b15f8a30e7](https://github.com/facebook/react-native/commit/b15f8a30e75b54a8de5cc9456aaa07ebe8d8a176) by [@rozele](https://github.com/rozele)) -- Fix changes of View visibilities ([4076293aa1](https://github.com/facebook/react-native/commit/4076293aa1059005704576530d8fe948b85e6a6d) by [@mdvacca](https://github.com/mdvacca)) -- Fix: save connection url as class variable ([8facc865ab](https://github.com/facebook/react-native/commit/8facc865ab2ec032da34f6f755ee8870ee4741aa) by [@sirpy](https://github.com/sirpy)) -- Fix Hermes build on folly version 2021.04.26.00 ([8eceee744e](https://github.com/facebook/react-native/commit/8eceee744ed9fee1eb2402f6b13bb606f6046f62) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Fix disabled handling for Text ([33ff4445dc](https://github.com/facebook/react-native/commit/33ff4445dcf858cd5e6ba899163fd2a76774b641) by [@lunaleaps](https://github.com/lunaleaps)) -- Fix disabled prop not disabling onPress for voice assistant ([1c7d9c8046](https://github.com/facebook/react-native/commit/1c7d9c8046099eab8db4a460bedc0b2c07ed06df) by [@kacieb](https://github.com/kacieb)) -- Fix unsafe cast and detect overflow in MapBuffer. ([e69f1c9f50](https://github.com/facebook/react-native/commit/e69f1c9f50c64bfcaeb684d763f02b9ccadec960)) -- Fix(deps): bump metro to 0.66.2 + dedup ([e40f58272d](https://github.com/facebook/react-native/commit/e40f58272d51a40e7b5fa77c14767ddaf9ecc006) by [@Titozzz](https://github.com/Titozzz)) - -#### Android specific - -- Fixed crash when using style `borderRadius: any` with `backgroundColor: null` ([42b6e6682c](https://github.com/facebook/react-native/commit/42b6e6682ce0fa9ac6eb5c1bf8ef0c224d2d80c0)) -- Fix font weight numeric values ([3827ca6171](https://github.com/facebook/react-native/commit/3827ca61714b699c866e17d58b4697dde86e3d00) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Fix wrong ripple color on Switch component ([1b0683533a](https://github.com/facebook/react-native/commit/1b0683533a07aa8875b4d494d8c2a3d18ef69438) by [@rnike](https://github.com/rnike)) -- Fix Selected State does not announce when TextInput Component selected on Android ([7ee2acc6c8](https://github.com/facebook/react-native/commit/7ee2acc6c84c9ea6a51908495a6f14a26f346b29) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Fix layout bug in ReactTextView. ([dec1b6ba15](https://github.com/facebook/react-native/commit/dec1b6ba15df8f255d30b696a7c08ef543d1d19c)) -- Fix source build on Windows machines vol. 2 ([c37d49492b](https://github.com/facebook/react-native/commit/c37d49492b20c3815ca10133f971755f659b1b6a)) -- Make NativeModules immediately initializable ([2bf866e401](https://github.com/facebook/react-native/commit/2bf866e4018ea72c1f1c92c806db85378c801fb7) by [@RSNara](https://github.com/RSNara)) -- Restore `android_hyphenationFrequency` on `Text`. ([1433ed6333](https://github.com/facebook/react-native/commit/1433ed6333162189730d6f92cf80f3077ac69120) by [@yungsters](https://github.com/yungsters)) -- Display the `testID` as the `resource-id` for black-box testing frameworks ([381fb395ad](https://github.com/facebook/react-native/commit/381fb395ad9d2d48717a5d082aaedbecdd804554) by [@jdeff](https://github.com/jdeff)) -- Fix support for blobs larger than 64 KB ([f00e348ca7](https://github.com/facebook/react-native/commit/f00e348ca7f031c3577b1335a3163bc3e4eb4b41) by [@tomekzaw](https://github.com/tomekzaw)) -- Fix building React Android on Windows. ([5dc15222b2](https://github.com/facebook/react-native/commit/5dc15222b256e32517df553c5fe7f6f5b7d0d31f)) -- Fix race-condition on the initialization of ReactRootViews ([74a756846f](https://github.com/facebook/react-native/commit/74a756846fdab1ef7d183c4df3069a23fcd0d49e) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific - -- Animated images without loop no longer animate twice ([17aa1e320e](https://github.com/facebook/react-native/commit/17aa1e320e75393d46a54ec0fee8b068eeef142f) by [@comvenger-brandon](https://github.com/comvenger-brandon)) -- Allow PlatformColor to work with border colors ([c974cbff04](https://github.com/facebook/react-native/commit/c974cbff04a8d90ac0f856dbada3fc5a75c75b49) by [@danilobuerger](https://github.com/danilobuerger)) -- RCTSurfaceHostingView default background color is now consistent with RCTRootView ([f31497354b](https://github.com/facebook/react-native/commit/f31497354b72ad51b452a4b8bd3b70de16830025) by [@fkgozali](https://github.com/fkgozali)) -- Invalidate TurboModules with infra-generated method queues on their method queues ([497eb578ab](https://github.com/facebook/react-native/commit/497eb578ab32614744a4ef61d7a6bca0d4251885) by [@RSNara](https://github.com/RSNara)) -- Fix RefreshControl layout when removed from window ([e67811e7a6](https://github.com/facebook/react-native/commit/e67811e7a6df0937ed61d3367ab10fab95b31bfa) by [@janicduplessis](https://github.com/janicduplessis)) -- Tab Accessibility Role had incorrect localization string ([80a10953f9](https://github.com/facebook/react-native/commit/80a10953f9de8cc251e9b8c1e59a173af87febb9) by [@adkenyon](https://github.com/adkenyon)) -- Incorrect ScrollView offset on update ([a4526bcc3f](https://github.com/facebook/react-native/commit/a4526bcc3f89f5b9d3f86c814ade8f55c86e819e) by [@rnike](https://github.com/rnike)) -- Modal's `onDismiss` prop will now be called successfully. ([d85d5d2e19](https://github.com/facebook/react-native/commit/d85d5d2e1974b463318e4c86da29a5ccdd60a977) by [@kkoudev](https://github.com/kkoudev)) -- Fix DatePicker sizing issue ([84d55868e8](https://github.com/facebook/react-native/commit/84d55868e8b4e5a555d324c6162b8e38571524d8) by [@sammy-SC](https://github.com/sammy-SC)) -- First press not working after pull to refresh ([c4950610e4](https://github.com/facebook/react-native/commit/c4950610e40f2019c828bc99e29769cd4089c217) by [@rnike](https://github.com/rnike)) -- Fix Codegen silently failing when Yarn is not installed, or when Yarn v2 is active. ([07e4953514](https://github.com/facebook/react-native/commit/07e4953514636aaadc5915944cc64c12028516f2) by [@ivanmoskalev](https://github.com/ivanmoskalev)) -- Make codegen more reliable on iOS ([12fccdeea3](https://github.com/facebook/react-native/commit/12fccdeea33324b8ddaa3ac0e2dbf81a44ca1eb2) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix crash in RCTCoreModulesClassProvider during quit ([2f62c2892d](https://github.com/facebook/react-native/commit/2f62c2892d9979f80752350d1b949f2770511956) by [@appden](https://github.com/appden)) -- Fix an issue calling stopSurface in bridgeless mode before surface is started ([81096901a8](https://github.com/facebook/react-native/commit/81096901a8a6da75744cef7b663ccea2ff9c4c09)) -- Move hermes to a separate podspec ([0959ff36d1](https://github.com/facebook/react-native/commit/0959ff36d1f3264e117021eb1999d0bdb71377c3) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix cli bundle platform for Mac Catalyst in `react-native-xcode.sh` ([b496a531e0](https://github.com/facebook/react-native/commit/b496a531e0b4b5d828077b0e7dff43dd28fed5eb) by [@robertying](https://github.com/robertying)) -- Fix `prefetchImageWithMetadata` redbox([f27e305056](https://github.com/facebook/react-native/commit/f27e305056152ff9ad7aeb9018bf289d51719eb9) by [@p-sun](https://github.com/p-sun)) -- Roll out RCTNetworking extraneous NativeModule call removal ([0e0d2e84f5](https://github.com/facebook/react-native/commit/0e0d2e84f56ea233e72d980ff6bd9797df250553) by [@RSNara](https://github.com/RSNara)) -- Fix Hermes + no Flipper build on Xcode 12.5 ([b9243e00e3](https://github.com/facebook/react-native/commit/b9243e00e30be057a45af6ed1916af4328c458e4) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Fix(hermes): fixed hermes build on iOS ([59abb5f378](https://github.com/facebook/react-native/commit/59abb5f378e116288cdea2f619de0c128bb0b0eb) by [@Titozzz](https://github.com/Titozzz)) -- Fix builds on Xcode 12.5 ([36b58a824e](https://github.com/facebook/react-native/commit/36b58a824ea20daa22fe7c528a3bf0ff4e6a4cb5) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Fix running React Native project with Xcode 12 in Release on iPhone Simulator ([fdcacd7f76](https://github.com/facebook/react-native/commit/fdcacd7f76ea8ca6dafda32ac431c8adc7bdad00) by [@grabbou](https://github.com/grabbou)) - -## v0.64.4 - -🚨 **IMPORTANT:** This is an exceptional release on an unsupported version. We recommend you upgrade to one of [the supported versions, listed here](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported). - -### Fixed - -- Add an afterEvaluate to solve AGP 4.1.x configuration resolution ([667f1bd21a](https://github.com/facebook/react-native/commit/667f1bd21abfdda19e56f8bbf0520fddba3102ed) by [@cortinico](https://github.com/cortinico)) -- Force dependencies resolution to minor series for 0.64 ([a6a183ad81](https://github.com/facebook/react-native/commit/a6a183ad8106d67e3befce842138e82fb1e136fd) by [@kelset](https://github.com/kelset)) - -## v0.64.3 - -### Fixed - -- For Android, general fixes to Appearance API and also fixes AppCompatDelegate.setDefaultNightMode(). For iOS, now works correctly when setting window.overrideUserInterfaceStyle ([25a2c608f7](https://github.com/facebook/react-native/commit/25a2c608f790f42cbc4bb0a90fc06cc7bbbc9b95) by [@mrbrentkelly](https://github.com/mrbrentkelly)) - -## v0.64.2 - -### Changed - -- Find-node.sh supports Homebrew on M1 ([502b819049](https://github.com/facebook/react-native/commit/502b81904998b800f2d960bb4a8e244988c72958) by [@dulmandakh](https://github.com/dulmandakh)) -- Refactor UIManagerHelper.getUIManager to return null when there's no UIManager registered ([b0e8c1eac0](https://github.com/facebook/react-native/commit/b0e8c1eac0a9edda12ecfa264209a8b3222afe27) by [@mdvacca](https://github.com/mdvacca)) - -### Fixed - -- Fix ScrollViewStickyHeader to push up header above it ([d754bdefc6](https://github.com/facebook/react-native/commit/d754bdefc68ff757ac2b5a2ffa38d5aad234d484) by [@kacieb](https://github.com/kacieb)) - -#### Android specific - -- Font family is not apply when secureTextEntry is true ([cda77c77dd83cba07e6c2e56e938c3e4f7faf8fc](https://github.com/facebook/react-native/commit/cda77c77dd83cba07e6c2e56e938c3e4f7faf8fc) by [@hank121314](https://github.com/hank121314)) -- Dimension update events are now properly sent following orientation change ([a6a4d3365f17332e367c34357a07a73f97d6ec83](https://github.com/facebook/react-native/commit/a6a4d3365f17332e367c34357a07a73f97d6ec83) by [@ajpaulingalls](https://github.com/ajpaulingalls)) - -## v0.64.1 - -### Fixed - -#### iOS specific - -- Fixes to ensure Xcode 12.5 builds ([cf8a364767](https://github.com/facebook/react-native/commit/cf8a364767df830d7255339741350bb53ab1a68a), [1c4ac48a55](https://github.com/facebook/react-native/commit/1c4ac48a55cf0703f0c8a32cbb07474a2d126f3e) and [76f45d35e7](https://github.com/facebook/react-native/commit/76f45d35e710f84a1cc44c90bc128494bc4280ce) by [@kelset](https://github.com/kelset)) - -### Security - -- Update validateBaseUrl to use latest regex ([33ef82ce6d](https://github.com/facebook/react-native/commit/33ef82ce6dfd31e1f990d438c925a0e52723e16b) by [@FBNeal](https://github.com/FBNeal)) - -## v0.64.0 - -### Breaking - -- Enable `inlineRequires` by default in new projects' `metro.config.js`. Gives a performance benefit but slightly different JS execution order ([959365a902](https://github.com/facebook/react-native/commit/959365a90216ee14d0f8b5d2f4653a1ab4c10d7e) by [@GantMan](https://github.com/GantMan)) -- Minimum supported Node version changed to 12 ([4b92e2e53d](https://github.com/facebook/react-native/commit/4b92e2e53d9c79f5b5858b3eb0d1654da79a4a68) by [@safaiyeh](https://github.com/safaiyeh)) -- Remove deprecated `CameraRoll` API (deprecated in 0.61) ([824d3a9770](https://github.com/facebook/react-native/commit/824d3a977057b336d81237ec3cec3a49a9d5e34d) by [@seanyusa](https://github.com/seanyusa)) -- Remove deprecated `CheckBox` component (deprecated in 0.60) ([dff17effe5](https://github.com/facebook/react-native/commit/dff17effe54dc58dda19fcc81ebacbd8f46e9005) by [@poteto](https://github.com/poteto)) -- Removed `DEPRECATED_sendUpdatedChildFrames` prop from `ScrollView` component (deprecated in 0.47) ([345d0c1abb](https://github.com/facebook/react-native/commit/345d0c1abb1afe937a06982c4328caee57820832) by [@ZHUANGPP](https://github.com/ZHUANGPP)) -- On `Image`, `onLoad` event objects' `source.url` is now renamed to `source.uri`. ([74ab8f6e5a](https://github.com/facebook/react-native/commit/74ab8f6e5a61999f1132351ff52df43c91360a09) by [@yungsters](https://github.com/yungsters)) - -#### Android specific - -- Remove support of Android API levels 16 through 20. The new minSDK version will be 21+ moving forward. ([973198667d](https://github.com/facebook/react-native/commit/973198667d7bbbf3b5d8890fc0a53dc99d0bce18), [25a40cbc61](https://github.com/facebook/react-native/commit/25a40cbc61e6c718d8cdea6d67fd82c6309963b1), [f829722b54](https://github.com/facebook/react-native/commit/f829722b54b34f145c41a95edfa5b522c837f9fc), [b133427778](https://github.com/facebook/react-native/commit/b13342777856bc4024d8489de790e7f90cd6b33b), [9b34aa261c](https://github.com/facebook/react-native/commit/9b34aa261c272d96829c9a7d5b166594b3162f9d), and [79d0a7d711](https://github.com/facebook/react-native/commit/79d0a7d71119122d2a2b9954e6038bbee119b8fa) by [@mdvacca](https://github.com/mdvacca); [49f10fd2e5](https://github.com/facebook/react-native/commit/49f10fd2e526b64294777357ab2fef8880739f26) and [a17ff44adc](https://github.com/facebook/react-native/commit/a17ff44adcf003dd4e4ef2301e1f80b77913f712) by [@JoshuaGross](https://github.com/JoshuaGross); [dd4298a377](https://github.com/facebook/react-native/commit/dd4298a3770eee7f66846ef0cc4c41a628b7bf01) by [@safaiyeh](https://github.com/safaiyeh)) -- Fix ReadableArray null annotations. Possibly breaking change for Kotlin apps. ([d76556543f](https://github.com/facebook/react-native/commit/d76556543f96f4d739be3a708b8f6314bb32cc87) by [@dulmandakh](https://github.com/dulmandakh)) -- On `Image`, `onLoad` and `onError` event objects will no longer have an extra `uri` property. ([74ab8f6e5a](https://github.com/facebook/react-native/commit/74ab8f6e5a61999f1132351ff52df43c91360a09) by [@yungsters](https://github.com/yungsters)) -- Deletes the method PlayTouchSound method from UIManagerModule, this method was moved to the SoundManagerModule class. ([d0c4c5eaf9](https://github.com/facebook/react-native/commit/d0c4c5eaf90430c7004621d1596c5f2a55ad03e0) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific - -- Remove `calculateChildFrames` from `RCTScrollView` ([62aa84a325](https://github.com/facebook/react-native/commit/62aa84a3257bd3c513df3fcb4b4eaa350ecf77bb) by [@PeteTheHeat](https://github.com/PeteTheHeat)) - -### Deprecated - -#### Android specific - -- Deprecated method `UIManagerModule.getUIImplementation`. This method will not be part of the new architecture of React Native. ([fe79abb32c](https://github.com/facebook/react-native/commit/fe79abb32ca3425ff689b7641d9200461ea8166d) by [@mdvacca](https://github.com/mdvacca)) - -### Added - -- Adds the Hermes runtime bytecode version number to the JS bundle requestURL. This allows Metro with Bytecode to work with prebuilt binaries. ([34c405462f](https://github.com/facebook/react-native/commit/34c405462f890afbccdfeaa7804791f7e9bcaa83)) -- TextInput now supports `onPressIn` and `onPressOut`. ([b7b0e23202](https://github.com/facebook/react-native/commit/b7b0e232028723794af4c79fc6366c483ae2350b) by [@yungsters](https://github.com/yungsters)) -- Allow setting a custom performance logger in XMLHttpRequest ([57b10f759e](https://github.com/facebook/react-native/commit/57b10f759efed786b46cfe082367f929aa2925d3) by [@rubennorte](https://github.com/rubennorte)) -- Add mock for `DevSettings` to jest preset ([a50f736bb6](https://github.com/facebook/react-native/commit/a50f736bb6ade9ea9caae45e41ca4b92f6707b17) by [@MarcoScabbiolo](https://github.com/MarcoScabbiolo)) -- Added Inspector overlay support for Pressable ([8ac467c51b](https://github.com/facebook/react-native/commit/8ac467c51b94c82d81930b4802b2978c85539925) by [@yungsters](https://github.com/yungsters)) -- Introduce NativeModulePerfLogger ([0486640571](https://github.com/facebook/react-native/commit/0486640571c89a0ce067c0437655a6b375308bcd) by [@RSNara](https://github.com/RSNara)) -- Add default `titlePlaceholder` in template configuration. ([8ffa180d80](https://github.com/facebook/react-native/commit/8ffa180d80b9c9acb76a0631b5a709d2c0adcd86) by [@Esemesek](https://github.com/Esemesek)) -- Modified `renderApplication` to forward `initialProps` to `WrapperComponent` ([4f5a092bf6](https://github.com/facebook/react-native/commit/4f5a092bf68a0cd825328ce4a1e6bb41a8fad2e3) by [@rubennorte](https://github.com/rubennorte)) -- Add warning to `VirtualizedList` when incorrectly using nested Lists or custom scroll components ([7f2515ece8](https://github.com/facebook/react-native/commit/7f2515ece8833f7a8adba025ef544013f89ae26f) by [@kacieb](https://github.com/kacieb)) -- Add native module for loading split JS bundles in development ([fca3a39da5](https://github.com/facebook/react-native/commit/fca3a39da5f1c31514e8969738e7b2c2d22bc230) by [@makovkastar](https://github.com/makovkastar)) -- Added `listenerCount()` to `DeviceEventEmitter` and `NativeEventEmitter`. ([b11d6ecbb8](https://github.com/facebook/react-native/commit/b11d6ecbb8bb2f0d6f423be6775e587f4e9b1c4d) by [@yungsters](https://github.com/yungsters)) - -#### Android specific - -- Upgrade Hermes to version 0.7 and turn on ES6 Proxy support ([776a415d98](https://github.com/facebook/react-native/commit/776a415d98dffd04b11200812a32204aa1c5e157) and [bb003816a3](https://github.com/facebook/react-native/commit/bb003816a389b8655c53fa34444417c14516459c) by [@Huxpro](https://github.com/Huxpro), [a28dd38909](https://github.com/facebook/react-native/commit/a28dd3890974d699070f08ab43781324411e6f5c) by [@janicduplessis](https://github.com/janicduplessis)) -- Add support for `shadowColor` on API level >= 28 ([cfa4260598](https://github.com/facebook/react-native/commit/cfa42605989eee5a9de42bdb1259fb7f4d9451fb) by [@IjzerenHein](https://github.com/IjzerenHein)) -- Add `android_hyphenationFrequency` prop to Text component ([0fda91ffff](https://github.com/facebook/react-native/commit/0fda91ffffa4972ebe58e3d0b610692a1286eaa1) and [7d8aeb4955](https://github.com/facebook/react-native/commit/7d8aeb4955a4101ca7e8e486f935309c21ab76ff) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Add `accessibilityHint` to TouchableNativeFeedback ([72285d808d](https://github.com/facebook/react-native/commit/72285d808dfce748287a19e2620d58517a5f76e7) by [@CMDadabo](https://github.com/CMDadabo)) -- Adds support for the `onProgress` event on `Image` ([fa0e6f8051](https://github.com/facebook/react-native/commit/fa0e6f8051d2208af467b789a2a9306ec7ddad76) by [@yungsters](https://github.com/yungsters)) -- ScrollView now supports `contentOffset` ([ed29ba13f9](https://github.com/facebook/react-native/commit/ed29ba13f97f240c91fdf6c0ef3fb601046697b9) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Add an explicit NDK version to Android template ([18ffe12203](https://github.com/facebook/react-native/commit/18ffe12203d03b4e960d61d7bb50cd02bba94663) by [@safaiyeh](https://github.com/safaiyeh)) -- Exposed `getFlex` method as part of ReactShadowNode API ([6570f7887b](https://github.com/facebook/react-native/commit/6570f7887b8824705ae09b5653d631428e17bc5f) by [@mdvacca](https://github.com/mdvacca)) -- Add `\*.hprof` files to gitignore ([69ce9c21d4](https://github.com/facebook/react-native/commit/69ce9c21d433a23ffb9934062b46fa64277ee255) by [@enesozturk](https://github.com/enesozturk)) -- Move `DevSettingsActivity` from main to debug ([d8e6c45782](https://github.com/facebook/react-native/commit/d8e6c45782a5c9132bb7ec315fe0b9ba3999e830) by [@invalid-email-address](https://github.com/invalid-email-address)) - -#### iOS specific - -- `PlatformColor`: add missing `clearColor` ([b7167c23fc](https://github.com/facebook/react-native/commit/b7167c23fc052f8d9f8c27a7f4ad9c5cdf51281e) by [@Simek](https://github.com/Simek)) -- Update template to Xcode 12 ([6685aba462](https://github.com/facebook/react-native/commit/6685aba462699c696cb6ac95626b9592deb292fc) by [@janicduplessis](https://github.com/janicduplessis)) -- Add `importantForAccessibility` to `AccessibilityProps` ([fd660fd0c5](https://github.com/facebook/react-native/commit/fd660fd0c50a0acca730bd1ecd427e574bbe81c7) by [@ZHUANGPP](https://github.com/ZHUANGPP)) -- Allow hotkeys to be used without command key ([f2b9ec7981](https://github.com/facebook/react-native/commit/f2b9ec798172db76dfb55f390e1fcea90dd341da) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Add `disableButtonsIndices` option to `ActionSheetIOS` component ([a7c1c5aff2](https://github.com/facebook/react-native/commit/a7c1c5aff24671bba609caeb82092a8de3d3b232) by [@lukewalczak](https://github.com/lukewalczak)) -- Add `showSoftInputOnFocus` to `TextInput` ([d54113d8c4](https://github.com/facebook/react-native/commit/d54113d8c4bcd0e0c7a09acca60819724eb69926) by [@gurs1kh](https://github.com/gurs1kh)) -- Added hostname to loading banner. ([96999339b6](https://github.com/facebook/react-native/commit/96999339b6a7aeabd0cd706ef7736fd91d9ecf80) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Allow iOS `PlatformColor` strings to be ObjC or Swift UIColor selectors ([25793eab56](https://github.com/facebook/react-native/commit/25793eab56217a9961620761ea65ec2fcb97dcb0) by [@tom-un](https://github.com/tom-un)) -- Add Dark Mode support to loading banner ([94c45af136](https://github.com/facebook/react-native/commit/94c45af136f44245b5f2e56bded60c8ebd9b1235) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Allow image loaders to enable/disable image telemetry ([e37708dfb6](https://github.com/facebook/react-native/commit/e37708dfb605dd9ee9f4b2dac5d841d98b7d376c) by [@p-sun](https://github.com/p-sun)) -- Add `RCTDevSplitBundleLoader` native module ([ad879e50bc](https://github.com/facebook/react-native/commit/ad879e50bcd51caca76b1073720f2b63df485ff1) by [@cpojer](https://github.com/cpojer)) - -### Changed - -- Update flipper to 0.75.1 ([3399896ae7](https://github.com/facebook/react-native/commit/3399896ae756719b238e837001077a46508849be) by [@janicduplessis](https://github.com/janicduplessis)) -- Refined Flow type for `Text` component. ([a911efaecd](https://github.com/facebook/react-native/commit/a911efaecd005237816ddb480218eb5388460d16) by [@yungsters](https://github.com/yungsters)) -- Changed type definition of IPerformanceLogger from object to interface ([b90f4d978f](https://github.com/facebook/react-native/commit/b90f4d978fa27e37926d9f4a1d13c9168243798c) by [@rubennorte](https://github.com/rubennorte)) -- Removed `fbjs` dependency from `react-native`. ([54e19a6b7f](https://github.com/facebook/react-native/commit/54e19a6b7f217ffc0611e660f2a6b1a8ad14775b) by [@yungsters](https://github.com/yungsters)) -- Refined `ImageSource` Flow type for array-variant and headers. ([a0dc252dc8](https://github.com/facebook/react-native/commit/a0dc252dc89699f7bd0d733642b98762d0db423a) by [@yungsters](https://github.com/yungsters)) -- Some warnings changed to use `console.warn` without the "Warning:" prefix. ([982272932c](https://github.com/facebook/react-native/commit/982272932cee3be599076bd18b290bc812285533) by [@yungsters](https://github.com/yungsters)) -- Core/Differ: detect and optimize reparenting ([1e4d8d902d](https://github.com/facebook/react-native/commit/1e4d8d902daca8e524ba67fc3c1f4b77698c4d08) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Improve "not a registered callable module" error message ([e27d656ef3](https://github.com/facebook/react-native/commit/e27d656ef370958c864b052123ec05579ac9fc01) by [@vonovak](https://github.com/vonovak)) -- Use `VirtualizedList`'s `onEndReachedThreshold` default value when null is provided ([10b4b9505a](https://github.com/facebook/react-native/commit/10b4b9505a51f8bf3fbc12d296a087b784a9201a) by [@fatalsun](https://github.com/fatalsun)) -- Migrate large amount of modules to flow strict and strict-local ([4409642811](https://github.com/facebook/react-native/commit/4409642811c787052e0baeb92e2679a96002c1e3) by [@rubennorte](https://github.com/rubennorte)) -- Enable exact objects by default in the project template Flow config ([050a7dd019](https://github.com/facebook/react-native/commit/050a7dd019be435b848de0a86030599d83f8791d) by [@rubennorte](https://github.com/rubennorte)) -- Minor fix in Hermes Inspector cli tool help message ([6ffb983f83](https://github.com/facebook/react-native/commit/6ffb983f83afdee5d9290c683c5060d2a959818d)) -- Updated the React Hooks ESLint Plugin in the community ESLint config ([ac87e90fa5](https://github.com/facebook/react-native/commit/ac87e90fa517676440c1adf9575cb48f90de8069) by [@gaearon](https://github.com/gaearon)) -- Don't scroll to `initialScrollIndex` if `contentOffset` is provided to the same `VirtualizedList` ([3346ac7f96](https://github.com/facebook/react-native/commit/3346ac7f96d2fd3f77dca5acb283b28e02ad21fa) by [@markv](https://github.com/markv)) -- Migrated `VirtualizedList` legacy context implementation to `React.Context`. ([7bd694fc6f](https://github.com/facebook/react-native/commit/7bd694fc6f4bb027b6d7ee04034cad41a43e5695) by [@yungsters](https://github.com/yungsters)) -- Changed Flow type of `BackHandler` to be more specific. ([a903d1b86a](https://github.com/facebook/react-native/commit/a903d1b86ab56163abcdcb584f335949ba0c85fc) by [@Naturalclar](https://github.com/Naturalclar)) -- Updated transitive dependency `kind-of` to 6.0.3 to resolve vulnerability ([abde0154ba](https://github.com/facebook/react-native/commit/abde0154ba4247d2c9f1451b5de8b3cba1abd316) by [@TheSavior](https://github.com/TheSavior)) -- Upgrade eslint-config dependencies. ([93019dc190](https://github.com/facebook/react-native/commit/93019dc19072776053a88f9ab595e435b83fead0) by [@wcandillon](https://github.com/wcandillon)) -- Upgrade to Jest 25 ([f248ba1c8b](https://github.com/facebook/react-native/commit/f248ba1c8b15a12a0c590ce8211855cde31defe8) by [@cpojer](https://github.com/cpojer)) -- Use `React.Children.count` for counting children of `TextInput` ([92160f3144](https://github.com/facebook/react-native/commit/92160f3144dcfa510ff14b5f2eb231643f107af9) by [@vonovak](https://github.com/vonovak)) -- Annotate components in QPL logging using ImageAnalyticsTagContext ([60b7a3085c](https://github.com/facebook/react-native/commit/60b7a3085c0d83c126023b98e666ecda6f769454) by [@p-sun](https://github.com/p-sun)) -- Upgrade to React 17 ([24bca492c3](https://github.com/facebook/react-native/commit/24bca492c349ab90d40f9444df0f477145a4c311) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Made promise polyfill conditionalized on Hermes ([0a28b34dac](https://github.com/facebook/react-native/commit/0a28b34dacb91a7e74cd5feec59cf8f8fb0487c9) by [@Huxpro](https://github.com/Huxpro)) -- Flow: Remove type union in PickeriOS/PickerNativeComponent ([3113e47b9b](https://github.com/facebook/react-native/commit/3113e47b9bc92e3b0efb96db776f650848093dfc) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Flow: export ColorValue from StyleSheet instead of StyleSheetTypes ([0a67133124](https://github.com/facebook/react-native/commit/0a6713312467d3f5b5dc993e91db9e7b1aa4fc8c)) -- Forward URL parameters from main bundle to hot reloaded bundles ([b4785e5144](https://github.com/facebook/react-native/commit/b4785e514430dc3ba45ed6d136ec63574be88e26) by [@motiz88](https://github.com/motiz88)) -- Add package name / bundle ID to bundle URL in development ([9b5359133b](https://github.com/facebook/react-native/commit/9b5359133b46b16be200e37dba0b03d82b73b4a0) by [@motiz88](https://github.com/motiz88)) - -#### Android specific - -- Bump Gradle Wrapper to 6.7 ([8988a073b4](https://github.com/facebook/react-native/commit/8988a073b48df0f0cd4a7126edf1a421f4537d58), [5bc67b658e](https://github.com/facebook/react-native/commit/5bc67b658e581e0176deb7ed95b51a5c1cbe65c2), and [3a8559b86c](https://github.com/facebook/react-native/commit/3a8559b86c3c0b0ab6d6c6904c6efd97ab2c7b38) by [@friederbluemle](https://github.com/friederbluemle); [e559aee642](https://github.com/facebook/react-native/commit/e559aee64275126eaa135486e6bf09138be70f4d) and [e9fd93f53f](https://github.com/facebook/react-native/commit/e9fd93f53f8b14f921578cd401b3a6529e4e0c9f) by [@dulmandakh](https://github.com/dulmandakh)) -- Bump Android Gradle Plugin to 4.1.0 ([cf8368f204](https://github.com/facebook/react-native/commit/cf8368f2046ae1ff0f6b02bb6857eeeff8f57d7d) and [553fb8b28d](https://github.com/facebook/react-native/commit/553fb8b28d0ad332d75a944d244832be3390b6ba) by [@friederbluemle](https://github.com/friederbluemle), [dfa9db49e3](https://github.com/facebook/react-native/commit/dfa9db49e34c6f54c04148b877de938bf103a059) by [@dulmandakh](https://github.com/dulmandakh)) -- Bump Okio to 1.17.5 ([1e78e0655d](https://github.com/facebook/react-native/commit/1e78e0655d53ac947f523bcadf9c5339ab07bbb8) by [@dulmandakh](https://github.com/dulmandakh)) -- Make Android versionCodeOverride for new apps using the template human-readable ([e1bf515ae8](https://github.com/facebook/react-native/commit/e1bf515ae8e77fb24f76037d9f22e903799fb637) by [@gedeagas](https://github.com/gedeagas)) -- Bump SoLoader to 0.9.0 ([7465239230](https://github.com/facebook/react-native/commit/7465239230881f453d64364d51272f28614c8653) by [@dulmandakh](https://github.com/dulmandakh)) -- Update Okhttp to version 3.12.12 ([0f6fcb2c27](https://github.com/facebook/react-native/commit/0f6fcb2c2788dc7150f6c3673a8f4f9d8f929441) by [@halaei](https://github.com/halaei)) -- Update Android build tools to 29.0.3 ([e629e94b46](https://github.com/facebook/react-native/commit/e629e94b466ebbd5924b1d4493c026004dad707d) by [@friederbluemle](https://github.com/friederbluemle)) -- ViewCommands on Android now execute earlier, as a perf optimization. ([c6b9cc36da](https://github.com/facebook/react-native/commit/c6b9cc36da4f7d190d05122048aa4ada9c152b73) by [@JoshuaGross](https://github.com/JoshuaGross)) -- Effect of `blurRadius` now more closely matches other platforms. ([64860972be](https://github.com/facebook/react-native/commit/64860972be828fb601acbef11b4c2dbc672dee8a) by [@yungsters](https://github.com/yungsters)) -- Migrate Android tests to Robolectric v4 ([6a78b32878](https://github.com/facebook/react-native/commit/6a78b32878aea1b0dac98ff36378fb9392d4aeb1) by [@jselbo](https://github.com/jselbo), [d373a8d88c](https://github.com/facebook/react-native/commit/d373a8d88c30af910133d97ae973d256c4479929) and [18f7abae07](https://github.com/facebook/react-native/commit/18f7abae07b8ea60c7530a5d9f34541c50f5edd9) by [@fkgozali](https://github.com/fkgozali)) -- Get ripple drawables by id instead of by name ([c8ed2dbbb2](https://github.com/facebook/react-native/commit/c8ed2dbbb287deed05a8782fb8665c1edf45bbac) by [@vonovak](https://github.com/vonovak)) -- `TextInput`: Set `caretHidden` default value to `true` on Xiaomi devices to fix the crash ([b5b4a70410](https://github.com/facebook/react-native/commit/b5b4a7041027fd767850a564b5d80fa4a98ba2a2)) -- Update loading banner text and colors ([6afc984e81](https://github.com/facebook/react-native/commit/6afc984e8187ac91f780f125dad4421576131c83) by [@makovkastar](https://github.com/makovkastar)) -- Declare all attrs used in res targets ([05abbd245c](https://github.com/facebook/react-native/commit/05abbd245c2326b12d24698bb13007a7ce11e586) by [@IanChilds](https://github.com/IanChilds)) - -#### iOS specific - -- Upgraded JSI with a new HERMES_ENABLE_BITCODE flag ([311d4e9ef0](https://github.com/facebook/react-native/commit/311d4e9ef080aa429f840236cc23c013c0ae644c) by [@grabbou](https://github.com/grabbou)) -- Remove main queue execution of constantsToExport in NativeModules ([d7ac21cec5](https://github.com/facebook/react-native/commit/d7ac21cec5492e180fbf3817af7be64ab121cb75) by [@RSNara](https://github.com/RSNara)) -- Updated loading banner messages and color ([3729fe8de0](https://github.com/facebook/react-native/commit/3729fe8de0109c80014f6c20fae8b949b3628de2) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Speed up loading banner animations ([3fb37b4326](https://github.com/facebook/react-native/commit/3fb37b4326090def3aea43bd8189a0df648ccb34) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Shrink loading bar down to not cover safe area. ([f0dfd35108](https://github.com/facebook/react-native/commit/f0dfd35108dd3f092d46b65e77560c35477bf6ba) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Build macOS framework and add CocoaPods podspec ([ffa3d7f638](https://github.com/facebook/react-native/commit/ffa3d7f638c820dc208320193e6ba65667d751eb) by [@alloy](https://github.com/alloy)) -- Set `NSAllowsArbitraryLoads` to `false` by default in template ([7b61a968fd](https://github.com/facebook/react-native/commit/7b61a968fd774a6ca2196a731b6cec4282ab25cc) by [@wddwycc](https://github.com/wddwycc)) - -### Removed - -- `Text.viewConfig` is no longer exported. ([06ce643565](https://github.com/facebook/react-native/commit/06ce64356594a921cd9ae4f71c15dd56dd0e53a3) by [@yungsters](https://github.com/yungsters)) -- Removed `once()` and `removeCurrentListener()` from `DeviceEventEmitter` and `NativeEventEmitter`. ([87a2e29f59](https://github.com/facebook/react-native/commit/87a2e29f5928c2e09ac9a98c54732d5f697d8e61) by [@yungsters](https://github.com/yungsters)) -- Removed tvOS related files from the template ([df03228a61](https://github.com/facebook/react-native/commit/df03228a61881cdfa520fa6d8a9d9cfb6e77fdde) by [@Naturalclar](https://github.com/Naturalclar)) - -#### Android specific - -- Remove undocumented ColorAndroid function ([411c344794](https://github.com/facebook/react-native/commit/411c3447946c18743476e7d613358233464d6f58) by [@tom-un](https://github.com/tom-un)) - -### Fixed - -- Fix handling of very deeply nested data across the bridge ([a8c90e6af4](https://github.com/facebook/react-native/commit/a8c90e6af4a4e5ac115016a3e8977ecff90e99a0) by [@mhorowitz](https://github.com/mhorowitz)) -- Prevent TypeError in TaskQueue when cancelling a started but not resolved promise. ([14042fb76f](https://github.com/facebook/react-native/commit/14042fb76fee3573529d590ec6f8ad216aa0b820) by [@robwalkerco](https://github.com/robwalkerco)) -- Fix typo in `ActionSheetManager` invariant message ([9c353b5ab0](https://github.com/facebook/react-native/commit/9c353b5ab060be9392a7aaf437bba4ffc56d78ca) by [@sweatherall](https://github.com/sweatherall)) -- `TouchableHighlight` now correctly fires `onPress` when pressed for >500ms, when `onLongPress` is not supplied. ([bdf3c79110](https://github.com/facebook/react-native/commit/bdf3c7911007f547101d753903da11ea4ee095f9) by [@yungsters](https://github.com/yungsters)) -- `Pressability` now consistently fires `onPressIn` and `onPressOut`, even without an `onPress`. ([0c392bc405](https://github.com/facebook/react-native/commit/0c392bc4052784de7497bf7b5eaf207b02409877) by [@yungsters](https://github.com/yungsters)) -- Remove extraneous argument for `onResponderGrant` Flow type on `Text`. ([49015b0f5b](https://github.com/facebook/react-native/commit/49015b0f5bda83794b88b17dd3cbd834fa235b72) by [@yungsters](https://github.com/yungsters)) -- Prevent `ScrollView` From Stealing Responder Capture When Using Physical Keyboard ([93e7a7a70d](https://github.com/facebook/react-native/commit/93e7a7a70dc2f41fccd3c1e4cce80d92913c4243) by [@NickGerleman](https://github.com/NickGerleman)) -- Fix failure when debugging code in a browser; was caused by `performanceNow()` function. ([db474a47b7](https://github.com/facebook/react-native/commit/db474a47b70e4fa50f594f4dea8a2f531ca9fc07) by [@zerkella](https://github.com/zerkella)) -- Fix test renderer mocks to use the `displayName` more often. ([4b935ae95f](https://github.com/facebook/react-native/commit/4b935ae95f09e4a1eb1e5ac8089eb258222a0f8b) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Make sure `LogBox` is not included in production bundles ([d3b937f990](https://github.com/facebook/react-native/commit/d3b937f990012a31b8d917e220f4ed2f0a4fd2d3) by [@janicduplessis](https://github.com/janicduplessis)) -- Mark `force` as an optional property of the PressEvent object ([ad2f98df8f](https://github.com/facebook/react-native/commit/ad2f98df8f2ad8aff1dcdc11b187f35b372e3f0e) by [@Simek](https://github.com/Simek)) -- Fix invalid `event` objects from `onPressOut` in certain cases ([2c600b7c5a](https://github.com/facebook/react-native/commit/2c600b7c5a0e79bfc632b39b471e6ba774d7b0b3) by [@yungsters](https://github.com/yungsters)) -- When Hermes debugger is enabled continue to send log messages to the console ([77ef8f881f](https://github.com/facebook/react-native/commit/77ef8f881f2e4067894b412f308e2a80042c946f) by [@MartinSherburn](https://github.com/MartinSherburn)) -- Handle nullish `initialProps` correctly in `renderApplication` ([26c120c632](https://github.com/facebook/react-native/commit/26c120c6329d45e27318d82aaf5a50338bd6fa7d) by [@rubennorte](https://github.com/rubennorte)) -- Fix Flow type of Touchable{Opacity,Bounce,Highlight} being exported as `any` ([de7f69a58e](https://github.com/facebook/react-native/commit/de7f69a58ed4e18887f4b9d4d853293fb136afb7) by [@draperunner](https://github.com/draperunner)) -- Clarified the boundaries in error message of `scrollToIndex` ([78d2b3c813](https://github.com/facebook/react-native/commit/78d2b3c8138f54c2433958b0ad6b9f52ca59115a) by [@sasurau4](https://github.com/sasurau4)) -- Fix jsi cmake include dirs ([f5d00e5a29](https://github.com/facebook/react-native/commit/f5d00e5a2922d35a0b44935592da5700518c422b) by [@ryantrem](https://github.com/ryantrem)) -- Fix race condition in `KeyboardAvoidingView` ([b08fff6f86](https://github.com/facebook/react-native/commit/b08fff6f869e00c20c0dcdf7aca71284c2f276f0) by [@sammy-SC](https://github.com/sammy-SC)) -- Fix clone issue in YogaNodeJNIBase ([2707c17b07](https://github.com/facebook/react-native/commit/2707c17b0727f241d404f4a21090021c27c66f2c) by [@pasqualeanatriello](https://github.com/pasqualeanatriello)) -- Fix "Cannot read property 'getNativeScrollRef' of undefined" in createAnimatedComponent ([629e10e91b](https://github.com/facebook/react-native/commit/629e10e91b728c4251f1ed78a50df62820ce0dc4) by [@sammy-SC](https://github.com/sammy-SC)) - -#### Android specific - -- Fix App Bundle/Release build missing index.android.bundle with gradle plugin 4.1.0/gradle 6.5 ([53f55001af](https://github.com/facebook/react-native/commit/53f55001afbf07494de0df064a92dfdd42f37c98) by [@tomoima525](https://github.com/tomoima525)) -- Do not crash when `ScrollView` `snapToOffsets` array is empty ([d238da71aa](https://github.com/facebook/react-native/commit/d238da71aa8cdd7ce519de617a9a200406da794c) by [@makovkastar](https://github.com/makovkastar)) -- Fixed `TextInput` not being selectable in `removeClippedSubviews` FlatLists ([12a50c0a44](https://github.com/facebook/react-native/commit/12a50c0a442b78d9095398d955bec307cfcb0f69) by [@hsource](https://github.com/hsource)) -- Make nested `Text` components accessible as links ([b352e2da81](https://github.com/facebook/react-native/commit/b352e2da8137452f66717cf1cecb2e72abd727d7) by [@ejanzer](https://github.com/ejanzer)) -- Move selection to the end of the text input on accessibility click ([f0e80ae229](https://github.com/facebook/react-native/commit/f0e80ae2292ebf7ce32666900007845724844fb5) by [@ejanzer](https://github.com/ejanzer)) -- Fix secure text entry setting to always hide text ([f19372361f](https://github.com/facebook/react-native/commit/f19372361f22201a453ff38eb69c5fa052b57474) by [@smeenai](https://github.com/smeenai)) -- Make promise NativeModule methods dispatch to NativeModules thread ([9c35b5b8c4](https://github.com/facebook/react-native/commit/9c35b5b8c4710dfe6a4b689a5565aa78ae5b37d3) by [@RSNara](https://github.com/RSNara)) -- Fix `NoSuchMethodException` when calling `DisplayMetricsHolder.initDisplayMetrics` in Android API level <= 16 (though those Android versions are no longer supported) ([35128f45d1](https://github.com/facebook/react-native/commit/35128f45d1ba97010e437423d14fa5ea0faf5fa3) by [@mdvacca](https://github.com/mdvacca)) -- Fixed error message in `DebugCorePackage.getModule` ([a71f37b951](https://github.com/facebook/react-native/commit/a71f37b951ca49c180b037ea8955851654b09afa) by [@TheWirv](https://github.com/TheWirv)) -- ScrollView, HorizontalScrollView: do not ignore `null` `contentOffset` prop ([9e85b7ad88](https://github.com/facebook/react-native/commit/9e85b7ad889900cd57cd2f82286aa8e034b0a32b) by [@vonovak](https://github.com/vonovak)) -- Picker - fix usage of setNativeSelectedPosition in onSelect ([078e386024](https://github.com/facebook/react-native/commit/078e386024474edc9b464f6c0fd8a1429e922289)) -- Fix intermittent crash of ReactSlider on Android ([32888a8b4a](https://github.com/facebook/react-native/commit/32888a8b4a9d75b9d3f6cc4578ce6a6ccd932407) by [@mdvacca](https://github.com/mdvacca)) -- Use actual constructor when throwing GradleScriptException ([8ef0f1d90b](https://github.com/facebook/react-native/commit/8ef0f1d90bbb2fa98e48ce89281718e5ac79365a)) -- Fix `skewX` transform decomposition ([797367c089](https://github.com/facebook/react-native/commit/797367c0890a38ec51cfaf7bd90b9cc7db0e97c7) by [@wcandillon](https://github.com/wcandillon)) -- Allow passing partial contentOffset to ScrollView on Android ([0348953914](https://github.com/facebook/react-native/commit/03489539146556ec5ba6ba07ac338ce200f5b0f4) by [@janicduplessis](https://github.com/janicduplessis)) -- Check if NativeModules returned from CatalystInstanceImpl.getNativeModule are null before using them. ([9263eb5d38](https://github.com/facebook/react-native/commit/9263eb5d3864a42925b699343db2c09cc8934ed0) by [@RSNara](https://github.com/RSNara)) -- Fix calculating view position within the window in split-screen mode ([b020e7c440](https://github.com/facebook/react-native/commit/b020e7c440f58dabd4cc64b72869f3ae9680ef30) by [@jakubkinst](https://github.com/jakubkinst)) -- Text layout no longer ignores parent bounds ([025be8148a](https://github.com/facebook/react-native/commit/025be8148a9abc533a8ae108e49cfd3f4512c581) by [@yungsters](https://github.com/yungsters)) -- Fixed excessive space in Text view with word-wrapping ([dda7f82261](https://github.com/facebook/react-native/commit/dda7f82261cc5684564e2c67071c13e379985308) by [@yungsters](https://github.com/yungsters)) -- `Pressable`: ripple should be applied even when borderless == false ([44ec762e41](https://github.com/facebook/react-native/commit/44ec762e41029bf43530b1ff9b36ca3512c526e2) by [@vonovak](https://github.com/vonovak)) -- Fix `ReadableNativeMap.getNullableValue` to match signature and return null instead of throwing ([1015194ba1](https://github.com/facebook/react-native/commit/1015194ba1a81eab99000d589914100e4b9ea037) by [@dulmandakh](https://github.com/dulmandakh)) -- `Picker`: set color filter so that the arrow matches the text color ([bb8d0f5732](https://github.com/facebook/react-native/commit/bb8d0f57328a20c942991f2d19d86639a7791924) by [@ejanzer](https://github.com/ejanzer)) -- `Modal`: fix crash when updating props after the activity disappeared ([7abcaafd66](https://github.com/facebook/react-native/commit/7abcaafd6600535825aa8330af7290ba8acea245) by [@mdvacca](https://github.com/mdvacca)) -- Fix crash while measuring ReactSlider in Android API < 21 ([75e6f7961f](https://github.com/facebook/react-native/commit/75e6f7961fb3f6de6afbe79d49c42ad55fba1673) by [@mdvacca](https://github.com/mdvacca)) -- Fix measureLayout function for VirtualTexts ([5c48c94f8c](https://github.com/facebook/react-native/commit/5c48c94f8c0441bc78a007f0ea0c5b2763ff6875) by [@mdvacca](https://github.com/mdvacca)) -- Smoother scrolling in ScrollView, HorizontalScrollView ([10314fe621](https://github.com/facebook/react-native/commit/10314fe621e1649654e83df197adf657e0ca8363) by [@JoshuaGross](https://github.com/JoshuaGross)) - -#### iOS specific - -- Synchronize RCTImageLoader loaders initialization ([edb6fa7979](https://github.com/facebook/react-native/commit/edb6fa79791beb804e450ca4a562a248abf730e5) by [@p-sun](https://github.com/p-sun)) -- Make sure js bundle still exists at bundle-output path ([3a41f69f9c](https://github.com/facebook/react-native/commit/3a41f69f9ce1ab778112c0727a69a753fe36c77a) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix crash in WebSocket module ([748aa13747](https://github.com/facebook/react-native/commit/748aa137472d6080427f74bb686c795b925c7d43) by [@marksinkovics](https://github.com/marksinkovics)) -- Align multi-line `TextInput` `onSubmitEditing` behavior: don't call onSubmitEditing when blurOnSubmit=false ([521b16730d](https://github.com/facebook/react-native/commit/521b16730dd07d80261086c2f33eed2a766d404e) by [@tido64](https://github.com/tido64)) -- Fix passing react native path in Podfile template ([e599d6c5d3](https://github.com/facebook/react-native/commit/e599d6c5d338c1b4d1a0d988e0d9ff83c179fb54) by [@janicduplessis](https://github.com/janicduplessis)) -- Call [RCTEventEmitter stopObserving] on correct method queue ([23717e48af](https://github.com/facebook/react-native/commit/23717e48aff3d7fdaea30c9b8dcdd6cfbb7802d5) by [@appden](https://github.com/appden)) -- Persist Enable Fast Refresh across app launches ([845e9eaafb](https://github.com/facebook/react-native/commit/845e9eaafb08b4ca87a9987e840798e0ba011676) by [@stigi](https://github.com/stigi)) -- Fix xcodebuild warnings in React-Core ([cb719a16cc](https://github.com/facebook/react-native/commit/cb719a16cc496b0cdb09d8d971b5e95cc8863b77)) -- Fix that RCTModalHostView can't be dismissed while being presented ([8933724d7d](https://github.com/facebook/react-native/commit/8933724d7d0f9ec012b2708d8e737f02f03e4a6f) by [@Mi-ZAZ](https://github.com/Mi-ZAZ)) -- Fix "'RCTBlobPlugins.h' file not found" when building iOS ([aaeffdb49a](https://github.com/facebook/react-native/commit/aaeffdb49a8412a98bb52477933fd208d1dcc096) by [@tido64](https://github.com/tido64)) -- Improved text rendering on macOS Catalyst ([694e22de84](https://github.com/facebook/react-native/commit/694e22de847e5f789b7d5ffe472b63aabbd7a5b0) by [@andymatuschak](https://github.com/andymatuschak)) -- Fixed showing Alert while closing a Modal ([f319ff321c](https://github.com/facebook/react-native/commit/f319ff321c4b7c0929b99e3ebe7e1ce1fa50b34c) by [@devon94](https://github.com/devon94)) -- Fix `refreshControl` messes up navigationBar largeTitles ([1b0fb9bead](https://github.com/facebook/react-native/commit/1b0fb9bead4d158d14df5a994423d06716b5e377) by [@yogevbd](https://github.com/yogevbd)) -- When Sec-WebSocket-Protocol header is empty vaulue, IIS server will return error 502. ([fd85b84a86](https://github.com/facebook/react-native/commit/fd85b84a863cea9f33e5b39230b27af53c1307e7) by [@bill2004158](https://github.com/bill2004158)) -- Fix multiline `TextInput` crash when inserting/removing lots of text ([15dda0ab5a](https://github.com/facebook/react-native/commit/15dda0ab5a491dcc83539f9ef32c9896be41074a) by [@tido64](https://github.com/tido64)) -- Group accessible views using the view hierarchy ([e2fd9d4f22](https://github.com/facebook/react-native/commit/e2fd9d4f22cda85c995c38875fc3a2a20a198c4a) by [@p-sun](https://github.com/p-sun)) -- Fix Flow types for StatusBar showHideTransition ([e5a8f4270e](https://github.com/facebook/react-native/commit/e5a8f4270ea71749a5ce6bd7ae198f695edb4307) by [@Simek](https://github.com/Simek)) -- Better error message when missing entry file ([e73208e2ca](https://github.com/facebook/react-native/commit/e73208e2ca59a2cf6a8a9c5e4e5b33afb5131f09) by [@petrbela](https://github.com/petrbela)) -- Fix imports in `RCTUtilsUIOverride.h` ([b7e8f66795](https://github.com/facebook/react-native/commit/b7e8f667953c2bc65c25b00968051c063a684d01) by [@Fanghao](https://github.com/Fanghao)) -- Fix skewX/skewY/perspective/matrix transforms. ([4b956fe5a6](https://github.com/facebook/react-native/commit/4b956fe5a6b3a05b1c2883efc82a95c2524aeb56) by [@wcandillon](https://github.com/wcandillon)) -- Fix module lookup race condition on bridge invalidation. ([8ad810717e](https://github.com/facebook/react-native/commit/8ad810717ee1769aa5ff6c73e0c9bfa8c43a3bac) by [@fkgozali](https://github.com/fkgozali)) -- Fix duration calculation for `RCTUIImageViewAnimated` ([12f8b2598f](https://github.com/facebook/react-native/commit/12f8b2598fa46533ea59834a0225cc9e36b20111)) -- Cap loading banner percentage at 100% ([e27542bb13](https://github.com/facebook/react-native/commit/e27542bb13d1f8f422cd307c4d43148c8bd82bc0) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Delay loading banner message to prevent flashing messages ([2b771b0129](https://github.com/facebook/react-native/commit/2b771b0129f2ef921c7cdb9c952e004f931927c3) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Do not update loading banner message while hiding the banner ([131c497aa2](https://github.com/facebook/react-native/commit/131c497aa2c081f9dfd03e45b25fb7ae388b98bd) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Search en0 through en8 for the Metro Bundler's IP address when generating iOS debug builds ([b2b23a2017](https://github.com/facebook/react-native/commit/b2b23a20170d12f6d8bf2733b93d7f9ab9c6cb15)) -- Migrate `frameInterval` to `preferredFramesPerSecond`, fixing Xcode warnings ([335f3aabe2](https://github.com/facebook/react-native/commit/335f3aabe28ec8f9b96fd695edabf0d5ab0b402a) by [@safaiyeh](https://github.com/safaiyeh)) -- Animated image should animate at the same speed regardless of framerate ([b0d0e51a77](https://github.com/facebook/react-native/commit/b0d0e51a7724dcefe3ce1c2dfb334a731b2a385c) by [@p-sun](https://github.com/p-sun)) -- Fix logging lifecycle when image is scrolled out and immediately back in ([1f95c9b62e](https://github.com/facebook/react-native/commit/1f95c9b62e306fdaf0ef351b02fb79713941259c) by [@p-sun](https://github.com/p-sun)) -- Fix image instrumentation lifecycle on image cancel ([6cba4d2006](https://github.com/facebook/react-native/commit/6cba4d20068ef4ca9b9832e4c5cf71a7e361ddbe) by [@p-sun](https://github.com/p-sun)) -- Break retain cycle in RCTLegacyViewManagerInteropCoordinator ([8f90ce26a5](https://github.com/facebook/react-native/commit/8f90ce26a55f2b1aab42d7c44b0d527321fa8c21) by [@sammy-SC](https://github.com/sammy-SC)) -- Respect port information if available from RCTBundleURLProvider ([7d44959940](https://github.com/facebook/react-native/commit/7d44959940b7f7b03feefde0e9a15382f04dad6d) by [@jimmy623](https://github.com/jimmy623)) -- Remove port from JSLocation when returning packager host ([12543d557f](https://github.com/facebook/react-native/commit/12543d557f00545a719b4dfd76cc0d0adfa37a01) by [@jimmy623](https://github.com/jimmy623)) -- Remove requestToken being nil check from [RCTNetworkTask validateRequestToken] ([ffc90c7f92](https://github.com/facebook/react-native/commit/ffc90c7f92e63e1a53ed107833e3deed492ab435) by [@sammy-SC](https://github.com/sammy-SC)) -- Remove unnecessary packager running check when saved JSLocation is empty ([bbb7bef539](https://github.com/facebook/react-native/commit/bbb7bef539f418bdb452e40987d399c9369df5a2) by [@jimmy623](https://github.com/jimmy623)) -- Check whether packager is running in RCTBundleURLProvider for saved JSLocation ([3d882495d5](https://github.com/facebook/react-native/commit/3d882495d5e4415c2ebb8f4280e18e16025e0736) by [@jimmy623](https://github.com/jimmy623)) -- Fix crash inside RCTRedBox when trying to present same UIViewController twice ([46c77dc296](https://github.com/facebook/react-native/commit/46c77dc296dfab754356cd9346a01dae8d4869f4) by [@sammy-SC](https://github.com/sammy-SC)) -- Fix outdated CocoaPods version requirement in a React.podspec ([8a6ac1fef3](https://github.com/facebook/react-native/commit/8a6ac1fef369071405a3bf14a89924c66f28d192) by [@sunnylqm](https://github.com/sunnylqm)) - -## v0.63.5 - -🚨 **IMPORTANT:** This is an exceptional release on an unsupported version. We recommend you upgrade to one of [the supported versions, listed here](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported). - -### Fixed - -- Add an afterEvaluate to solve AGP 3.x configuration resolution ([473a36099c](https://github.com/facebook/react-native/commit/473a36099c80de08591e3cb51687f7d531145ee3) by [@cortinico](https://github.com/cortinico)) -- Force dependencies resolution to minor series for 0.63 ([28cc286cc4](https://github.com/facebook/react-native/commit/28cc286cc4d43b9fe5153d779ea3eecf4d72c51e) by [@cortinico](https://github.com/cortinico)) - -## v0.63.4 - -### Changed - -- [Maintenance] Bump detox to xcode 12 compatible version ([ccd4efac90](https://github.com/facebook/react-native/commit/ccd4efac90191e57b1dd6e7fff0da13e5764bcc4) by [@kelset](https://github.com/kelset)) - -#### Android specific - -- Bump SoLoader to 0.9.0 ([7465239230](https://github.com/facebook/react-native/commit/7465239230881f453d64364d51272f28614c8653) by [@dulmandakh](https://github.com/dulmandakh)) -- Update Okhttp to version 3.12.12 ([0f6fcb2c27](https://github.com/facebook/react-native/commit/0f6fcb2c2788dc7150f6c3673a8f4f9d8f929441) by [@halaei](https://github.com/halaei)) -- ScrollView now supports `contentOffset` ([ed29ba13f9](https://github.com/facebook/react-native/commit/ed29ba13f97f240c91fdf6c0ef3fb601046697b9) by [@JoshuaGross](https://github.com/JoshuaGross)) - -### Fixed - -#### Android specific - -- Fix ReadableNativeMap.getNullableValue to match signature ([1015194ba1](https://github.com/facebook/react-native/commit/1015194ba1a81eab99000d589914100e4b9ea037) by [@dulmandakh](https://github.com/dulmandakh)) -- Dimension update events are now properly sent following orientation change ([0e9296b95d](https://github.com/facebook/react-native/commit/0e9296b95da06789121f052e6cd6d7cac808464c) by [@ajpaulingalls](https://github.com/ajpaulingalls)) -- Font family is not apply when secureTextEntry is true. ([00d9deaf6b](https://github.com/facebook/react-native/commit/00d9deaf6ba26c605694d303bb0cb072fceae5a1) by [@hank121314](https://github.com/hank121314)) -- Fix App Bundle/Release build missing index.android.bundle with gradle plugin 4.1.0/gradle 6.5 ([53f55001af](https://github.com/facebook/react-native/commit/53f55001afbf07494de0df064a92dfdd42f37c98) by [@tomoima525](https://github.com/tomoima525)) -- ScrollView, HorizontalScrollView: do not ignore `null` `contentOffset` prop ([9e85b7ad88](https://github.com/facebook/react-native/commit/9e85b7ad889900cd57cd2f82286aa8e034b0a32b) by [@vonovak](https://github.com/vonovak)) -- SkewX transforms ([797367c089](https://github.com/facebook/react-native/commit/797367c0890a38ec51cfaf7bd90b9cc7db0e97c7) by [@wcandillon](https://github.com/wcandillon)) -- Allow passing partial contentOffset to ScrollView on Android ([0348953914](https://github.com/facebook/react-native/commit/03489539146556ec5ba6ba07ac338ce200f5b0f4) by [@janicduplessis](https://github.com/janicduplessis)) -- Set color filter so that the arrow matches the text color ([bb8d0f5732](https://github.com/facebook/react-native/commit/bb8d0f57328a20c942991f2d19d86639a7791924) by [@ejanzer](https://github.com/ejanzer)) - -#### iOS specific - -- A crash in WebSocket module ([748aa13747](https://github.com/facebook/react-native/commit/748aa137472d6080427f74bb686c795b925c7d43) by [@marksinkovics](https://github.com/marksinkovics)) -- Fixed showing Alert while closing a Modal ([f319ff321c](https://github.com/facebook/react-native/commit/f319ff321c4b7c0929b99e3ebe7e1ce1fa50b34c) by [@devon94](https://github.com/devon94)) -- Bug with skewX/skewY/perspective/matrix transforms. ([4b956fe5a6](https://github.com/facebook/react-native/commit/4b956fe5a6b3a05b1c2883efc82a95c2524aeb56) by [@wcandillon](https://github.com/wcandillon)) - -## v0.63.3 - -### Added - -#### iOS specific - -- Ability to set which configuration to enable flipper for when using use_flipper! ([dc2df75426](https://github.com/facebook/react-native/commit/dc2df754267df3909631d81c22b9fcab58dfa241) by [@nicoburns](https://github.com/nicoburns)) - -### Changed - -- Update Flipper to 0.54 ([d8b70b19b3](https://github.com/facebook/react-native/commit/d8b70b19b39ead4dd41895d666d116a43c56474e) by [@mweststrate](https://github.com/mweststrate)) -- Removed default 130ms delay from Pressability and Pressable. ([86ffb9c41e](https://github.com/facebook/react-native/commit/86ffb9c41e033f59599e01b7ad016706b5f62fc8) by [@yungsters](https://github.com/yungsters)) - -### Fixed - -#### Android specific - -- `KeyboardDidHide` wrong `screenY` coordinates with `windowTranslucentStatus=true` ([45954ac5dc](https://github.com/facebook/react-native/commit/45954ac5dccdfe05de7553a0f08c4f0e66e3d62e) by [@fabriziobertoglio1987](https://github.com/fabriziobertoglio1987)) -- Fix Xiaomi TextInput crash in native ([07a597ad18](https://github.com/facebook/react-native/commit/07a597ad185c8c31ac38bdd4d022b0b880d02859)) - -#### iOS specific - -- Prefetch images using a lower download priority ([058eeb43b4](https://github.com/facebook/react-native/commit/058eeb43b489f52183f081fb7232be683002a242) by [@p-sun](https://github.com/p-sun)) -- Fix `RCTImageLoader` not using decoders provided. ([663b5a878b](https://github.com/facebook/react-native/commit/663b5a878be9faafd13b41c222a1bc2ac7bb3a65) by [@sjchmiela](https://github.com/sjchmiela)) -- Support Swift based libraries using Xcode 12’s build system. ([6e08f84719](https://github.com/facebook/react-native/commit/6e08f84719c47985e80123c72686d7a1c89b72ed) by [@alloy](https://github.com/alloy)) -- Fix "main.jsbundle does not exist" issue ([83777cb4fb](https://github.com/facebook/react-native/commit/83777cb4fb5dda89c430b7eff9cd1f28d2577831)) -- Fixed headers in `Image.getSizeWithHeaders`. ([0bcc686c1c](https://github.com/facebook/react-native/commit/0bcc686c1cc90fd44de7a28e2f56ea20fe2f5123) by [@PaitoAnderson](https://github.com/PaitoAnderson)) - -### Security - -- Fix security issues with `@react-native-community/cli` by bumping version ([001eb7cbd6](https://github.com/facebook/react-native/commit/001eb7cbd66c7dc1a302ee2a638c1cfc164538f4) by [@alexbrazier](https://github.com/alexbrazier)) - -## v0.63.2 - -### Fixed - -- Restore Previous Behavior for StyleSheet Validation of Null/Undefined Styles ([e75557b48f](https://github.com/facebook/react-native/commit/e75557b48fbee1d136b8b7d1a78ea8f9b9467479) by [@NickGerleman](https://github.com/NickGerleman)) - -#### Android specific - -- Set LogBox windowTranslucentNavigation to false ([23036b38bc](https://github.com/facebook/react-native/commit/23036b38bc4443c8db4865e5c2b21aca7ab4f92f) by [@Ashoat](https://github.com/Ashoat)) -- Fix unable to run in debug mode on Android API < 21 ([7694b32a88](https://github.com/facebook/react-native/commit/7694b32a88078278457dd8721eb61da9c4ac0f5a) by [@Shywim](https://github.com/Shywim)) - -#### iOS specific - -- Fix image cannot show in iOS 14 ([123423c2a9](https://github.com/facebook/react-native/commit/123423c2a9258c9af25ca9bffe1f10c42a176bf3)) - -## v0.63.1 - -### Added - -- Added `minPressDuration` to `Pressable`. ([4aaf629982](https://github.com/facebook/react-native/commit/4aaf62998247bcfd8ebf369d73290096fde08012) by [@yungsters](https://github.com/yungsters)) -- Support for array buffers in the JavaScriptCore implementation of JSI ([9c32140068](https://github.com/facebook/react-native/commit/9c32140068463739b91874689f741ea9630d8c3b) by [@ryantrem](https://github.com/ryantrem)) - -#### Android specific - -- ProGuard rule for hermes ([449dc37720](https://github.com/facebook/react-native/commit/449dc37720b24d9d88661314424c9f982e70ec3a) by [@radko93](https://github.com/radko93)) - -### Fixed - -- LogBox.ignoreAllLogs() should ignore logs ([f28c7505fa](https://github.com/facebook/react-native/commit/f28c7505fa5b4a7ddf1e9311d38dfcd15e8953a2) by [@rickhanlonii](https://github.com/rickhanlonii)) - -#### Android specific - -- Fix font variant crash on Android < 4.4 ([f23feced42](https://github.com/facebook/react-native/commit/f23feced42abd1d18a12e413bf79a51bead61379) by [@Almouro](https://github.com/Almouro)) -- Fix border-drawing when changing border-radius back to 0` ([7757ad0576](https://github.com/facebook/react-native/commit/7757ad05762284c059807d7d75fd03559e86f2b2) by [@IjzerenHein](https://github.com/IjzerenHein)) -- Fix rounded border-drawing when border-radius is smaller than border-width` ([28dce3665d](https://github.com/facebook/react-native/commit/28dce3665d8a63e902c165c060400486fe6234f4) by [@IjzerenHein](https://github.com/IjzerenHein)) - -#### iOS specific - -- TextInput color has the same default (#000) on iOS whether in light or dark mode ([a2f8b9c36e](https://github.com/facebook/react-native/commit/a2f8b9c36e5eba6bc354a2f53bf8d3ca11297d00) by [@JonnyBurger](https://github.com/JonnyBurger)) -- Fixes TextInput shaking when typing Chinese ([9cdc19a936](https://github.com/facebook/react-native/commit/9cdc19a93669b37c0518bd32263e156ffc9193c7) by [@zhongwuzw](https://github.com/zhongwuzw)) - -## v0.63.0 - -### Breaking - -- The `target` field of events is now a native component, not a react tag ([3b813cade1](https://github.com/facebook/react-native/commit/3b813cade1f5d6f248a39f6bbd983f68c5794fe6) by [@TheSavior](https://github.com/TheSavior)) -- Modal: Remove support for `animated` prop (deprecated in 0.26) ([1e9db7bd6d](https://github.com/facebook/react-native/commit/1e9db7bd6df3055b9b81d23f15a54bb250621a41) by [@TheSavior](https://github.com/TheSavior)) -- Alert: Remove deprecated support for passing callback as fourth argument to `Alert.prompt` (deprecated in 0.59) ([a26d622d04](https://github.com/facebook/react-native/commit/a26d622d04451d6872eed2491e5d3f7d4689824d) by [@TheSavior](https://github.com/TheSavior)) -- Switch: Remove support for `thumbTintColor`, `tintColor`, `onTintColor` props (deprecated in 0.57) ([26912bd979](https://github.com/facebook/react-native/commit/26912bd9798aeb38931466b8ddcd3a48973b0528) by [@TheSavior](https://github.com/TheSavior)) -- Multiple deprecations and breaking changes to `TextInputState`. Use native component refs instead of react tags ([6286270e4c](https://github.com/facebook/react-native/commit/6286270e4cb10b40cfd7c8193e31d965f6815150) by [@TheSavior](https://github.com/TheSavior)) -- Bump supported Node engines to >= 10 ([f0c7178a3a](https://github.com/facebook/react-native/commit/f0c7178a3a24e7694b765946f0d884104c8cfa4c) by [@safaiyeh](https://github.com/safaiyeh)) - -### Deprecated - -- Add deprecation warnings for `Clipboard`, `SegmentedControlIOS`, `ProgressViewIOS`, `ProgressBarAndroid`. These modules have been moved to [react-native-community](https://github.com/react-native-community) libraries. ([f295d7f608](https://github.com/facebook/react-native/commit/f295d7f60843a45bb09fc366e497f512c2bc0046) by [@Naturalclar](https://github.com/Naturalclar)) -- Deprecated `console.disableYellowBox` in favor of `LogBox.ignoreAllLogs`. ([87f1e22434](https://github.com/facebook/react-native/commit/87f1e22434210ad22f526422bbda0413f59786ce) by [@rickhanlonii](https://github.com/rickhanlonii)) - -#### Android specific - -- We are deprecating the method `UIManagerModule.resolveRootTagFromReactTag`, this will not be supported in the next version of RN ([acbf9e18ea](https://github.com/facebook/react-native/commit/acbf9e18ea666b07c1224a324602a41d0a66985e) by [@mdvacca](https://github.com/mdvacca)) -- Add warning message for trying to use `ToolbarAndroid` which has been removed from the core since 0.61. ([6249d14a61](https://github.com/facebook/react-native/commit/6249d14a61723b22deb1336457b4295978471885) by [@Naturalclar](https://github.com/Naturalclar)) - -#### iOS specific - -- Deprecate iOS 9.x support ([58a6a40eac](https://github.com/facebook/react-native/commit/58a6a40eac9afb5c4de78a63418cc48ea97da1a4), [829a2237d2](https://github.com/facebook/react-native/commit/829a2237d270c03c80467eb6c2b5b18c87135a45), [674b591809](https://github.com/facebook/react-native/commit/674b591809cd1275b5f1c4d203c2f0ec52303396) by [@fkgozali](https://github.com/fkgozali), [d1265077d6](https://github.com/facebook/react-native/commit/d1265077d6638bb9219180628caf6ff83f8d6019) by [@sunnylqm](https://github.com/sunnylqm)) - -### Added - -- Implement `nativePerformanceNow` and `performance.now()` ([232517a574](https://github.com/facebook/react-native/commit/232517a5740f5b82cfe8779b3832e9a7a47a8d3d) by [@emilisb](https://github.com/emilisb)) -- Support `PerformanceLogger` stopTimespan updates ([08c338eebf](https://github.com/facebook/react-native/commit/08c338eebf67ef6c8c8fb7e3a91bbf89bbc2bb4c) by [@sahrens](https://github.com/sahrens)) -- Added `PlatformColor` implementations for iOS and Android ([f4de45800f](https://github.com/facebook/react-native/commit/f4de45800f25930a1c70f757d12269d859066d3d) by [@tom-un](https://github.com/tom-un)) -- Stamp React Native Version Into C++ Code ([427ba359e0](https://github.com/facebook/react-native/commit/427ba359e0c9411438286dd137bbca67f9829fde) by [@NickGerleman](https://github.com/NickGerleman)) -- New `` Component to make it easier to create touchable elements ([3212f7dfe8](https://github.com/facebook/react-native/commit/3212f7dfe82d187e27f1410c8c3cb1d9fb9f5094) by [@TheSavior](https://github.com/TheSavior), [bd3868643d](https://github.com/facebook/react-native/commit/bd3868643d29e93610e19312571a9736df2cbdf8) by [@vonovak](https://github.com/vonovak)) -- Export `LogBox` module ([799bf56f6f](https://github.com/facebook/react-native/commit/799bf56f6f6a46b6bd42ac5a824f44bd1412f3b6) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Export `LayoutAnimationConfig` flow type ([f0dafd34fe](https://github.com/facebook/react-native/commit/f0dafd34fedb0d63eb2499b978a52da9e6b71ea1) by [@sahrens](https://github.com/sahrens)) -- Added `react-native-community/eslint-plugin` as a dependency for `react-native-community/eslint-config` ([2c2e35c634](https://github.com/facebook/react-native/commit/2c2e35c634cd936bd7ea7a7fe444058268308224) by [@Naturalclar](https://github.com/Naturalclar)) -- `DEBUG_NETWORK_SEND_DELAY` can be used to simulate slow network. ([4aac019176](https://github.com/facebook/react-native/commit/4aac019176e3359068ac671ed4157a6e3ada481f) by [@sahrens](https://github.com/sahrens)) -- Support for `accessibilityLabel` prop to the `Picker` component ([0a525b6d9d](https://github.com/facebook/react-native/commit/0a525b6d9d2a88dddf24b85a2485b928fca23b16) by [@KevinGVargas](https://github.com/KevinGVargas)) -- Allow `zIndex` to `useNativeDriver` ([6a4e06faa8](https://github.com/facebook/react-native/commit/6a4e06faa8afbcb607fc2696c45c4f3257b6665d) by [@mackenziemance](https://github.com/mackenziemance)) - -#### Android specific - -- Support item background color in Dialog `Picker` ([22eb711c84](https://github.com/facebook/react-native/commit/22eb711c84587ac92da97e486fecaa79424fa925)) -- Add OverrideColorScheme interface and setOverrideColorScheme method to AppearanceModule([45d7df6cf7](https://github.com/facebook/react-native/commit/45d7df6cf7482b9790c97db613055ff5d3e59a87)) -- Allow setting custom ripple radius on `TouchableNativeFeedback` ([7f2a79f40b](https://github.com/facebook/react-native/commit/7f2a79f40b4a4c41344ca90cefe318af607675e0) by [@vonovak](https://github.com/vonovak)) -- Add `resizeMode` prop support on `TextInlineView` ([6871416328](https://github.com/facebook/react-native/commit/68714163280695c3148544b95b05a2c1464dbbba) by [@mdvacca](https://github.com/mdvacca)) -- Added an API for checking if there are busy timers to `TimingModule` ([22764e6cdc](https://github.com/facebook/react-native/commit/22764e6cdcf45ca5930676f6e95f9ab2f82bc78d) by [@ejanzer](https://github.com/ejanzer)) -- Make packager location customizable in dev mode ([3714f3648a](https://github.com/facebook/react-native/commit/3714f3648a8ac51f2bb7f2791e2381551d0209b4)) - -#### iOS specific - -- `UIScene` support for `RCTImageView` ([f332fac163](https://github.com/facebook/react-native/commit/f332fac16346d2f03d056575cc988a0b2bbb48c6) by [@tido64](https://github.com/tido64)) -- Status bar style is now correctly changed in multi-window iPadOS 13 apps if you use `RCTRootViewController` and set `UIViewControllerBasedStatusBarAppearance=YES` ([80e6d672f3](https://github.com/facebook/react-native/commit/80e6d672f32fdc860c73eabcc63763dcab3c6269) by [@radex](https://github.com/radex)) -- Added `userInterfaceStyle` for `ActionSheetIOS` and `Share` to override user interface style on IOS 13 ([0a9cc34dd8](https://github.com/facebook/react-native/commit/0a9cc34dd82a3a7dba576997ebd424b12876dbaa) by [@Arjan-Zuidema](https://github.com/Arjan-Zuidema)) -- Add localized accessibility strings to `ReactCore` pod ([aebf54aee4](https://github.com/facebook/react-native/commit/aebf54aee41cc892198b055a7a546743297412bd) by [@xuelgong](https://github.com/xuelgong)) -- Resolve and reject promise for `PushNotificationIOS.requestPermissions` ([edfdafc7a1](https://github.com/facebook/react-native/commit/edfdafc7a14e88a2660b95cb220c62f29b1b28c0) by [@p-sun](https://github.com/p-sun)) -- Use autolink script in template on iOS ([a35efb9400](https://github.com/facebook/react-native/commit/a35efb94006bfa3f541bf3fc3ab5262740f00525) by [@janicduplessis](https://github.com/janicduplessis)) -- Added `Flipper` to template app ([52cd9cd6fe](https://github.com/facebook/react-native/commit/52cd9cd6fec0866177aa02f7129a8b3d8b2bdbea) by [@safaiyeh](https://github.com/safaiyeh)) -- Add `textColor` and `backgroundColor` props to `SegmentedControl` for iOS >=13 ([e8f577e541](https://github.com/facebook/react-native/commit/e8f577e541815bfd8adebdf14f70c9e4205f8e4e) by [@Naturalclar](https://github.com/Naturalclar)) -- Adds `RCTOverrideAppearancePreference` to the iOS `Appearance` module ([fa65b156d4](https://github.com/facebook/react-native/commit/fa65b156d4109e6a3121484b601358b11cf0d541)) -- Changed iOS LaunchScreen from `xib` to `storyboard` ([33b3a1a145](https://github.com/facebook/react-native/commit/33b3a1a1453ca51690e59b758eeb61a4fa8f35bc) by [@jeswinsimon](https://github.com/jeswinsimon)) - -### Changed - -- Update `react-native-community/eslint-config` to 1.1.0, adding the new color rule ([780f06cd47](https://github.com/facebook/react-native/commit/780f06cd477f34da48646a949bd25dd3f883a9a2) by [@TheSavior](https://github.com/TheSavior)) -- Update community eslint plugin in the eslint config ([b2d10bc602](https://github.com/facebook/react-native/commit/b2d10bc60272fc2318835ff38655a9eb4a2bbed0) by [@Naturalclar](https://github.com/Naturalclar)) -- Upgrade `eslint-config` and `metro-preset` in project template ([ad86a18305](https://github.com/facebook/react-native/commit/ad86a183052e8b25d599eb395aef55412c02ff7b) by [@Naturalclar](https://github.com/Naturalclar)) -- Add ES Lint rules for `DynamicColorIOS()`and `ColorAndroid()` ([602070f44b](https://github.com/facebook/react-native/commit/602070f44b02220aeb036a7b3c26dad5c611b636) by [@tom-un](https://github.com/tom-un)) -- Make `ScrollView` use `forwardRef` ([d2f314af75](https://github.com/facebook/react-native/commit/d2f314af75b63443db23e131aaf93c2d064e4f44) by [@kacieb](https://github.com/kacieb)) -- Upgrade embedded React DevTools backend from v4.0.6 to v4.6.0 ([93ee5b2cc8](https://github.com/facebook/react-native/commit/93ee5b2cc8391bc5cb12ca7cf08ed0e44c74d29a) by [@bvaughn](https://github.com/bvaughn)) -- Updated the React Hooks ESLint Plugin ([6ce3f0a4f7](https://github.com/facebook/react-native/commit/6ce3f0a4f7495adb82e655d037dc4e5af462f955) by [@gaearon](https://github.com/gaearon)) -- Update to React 16.13.1 ([9637d6214a](https://github.com/facebook/react-native/commit/9637d6214a47e58d7fa8252a3de8c057e5cfb101) by [@gaearon](https://github.com/gaearon)) -- Relax `RefreshControl`'s `onRefresh` flow typing ([884c86ae02](https://github.com/facebook/react-native/commit/884c86ae02b0be7ea1e4b258dab39f4c5aee0b9d) by [@vonovak](https://github.com/vonovak)) -- Improved flowtype support for `Animated` ([bdafc55f50](https://github.com/facebook/react-native/commit/bdafc55f50c7d580ee2e643a02cb95d0196f721c) by [@javache](https://github.com/javache)) -- Upgrade `eslint-plugin-relay` to 1.6.0 ([0483404d82](https://github.com/facebook/react-native/commit/0483404d827416b7270e8a42b84e424035127892) by [@kassens](https://github.com/kassens)) -- Upgrade to latest dependencies in package.json template ([82e8239337](https://github.com/facebook/react-native/commit/82e82393377ddcedba01c401a5d79d5bbcdc4dc9) by [@codler](https://github.com/codler)) -- Make JSStringToSTLString 23x faster ([733532e5e9](https://github.com/facebook/react-native/commit/733532e5e95c85b8295b6c66009ca9efd2a77622) by [@radex](https://github.com/radex)) -- Changed property `disableIntervalMomentum` to work with both horizontal and vertical ScrollViews ([6237cfb325](https://github.com/facebook/react-native/commit/6237cfb325e39571ede0054a67d60f2c978d6d58) by [@Shaninnik](https://github.com/Shaninnik)) -- Upgraded to Flow v0.114.0 ([aa78457343](https://github.com/facebook/react-native/commit/aa7845734352eab2bd32f7d6e683d6674fd6680d) by [@mroch](https://github.com/mroch)) -- Updated CLI to the latest version ([ddc33007ad](https://github.com/facebook/react-native/commit/ddc33007ad0b4a0a24966b833e797227b9c56cca) by [@grabbou](https://github.com/grabbou)) -- Upgrade Prettier from 1.17 to 2.0.2. ([cf44650b3f](https://github.com/facebook/react-native/commit/cf44650b3f4f13df8208ceded60ec5c48bd6baf3) by [@bolinfest](https://github.com/bolinfest)) -- Only set dimensions if the window attributes change ([35c6bb9ac0](https://github.com/facebook/react-native/commit/35c6bb9ac0fc452428e85fee72affb4fc29f500c) by [@cpojer](https://github.com/cpojer)) -- Upgrade internal packages to support ESLint >= 6 ([89d04b5e4a](https://github.com/facebook/react-native/commit/89d04b5e4a3fd0b0f77b5a390c0aa62a3804e2bc) by [@Barbiero](https://github.com/Barbiero)) -- Make `JSCRuntime::createValue` faster ([24e0bad8be](https://github.com/facebook/react-native/commit/24e0bad8bea95ef7ddf72e2f00a93ffd47872d5b) by [@radex](https://github.com/radex)) -- Add perf markers in `XMLHttpRequest` ([71b8ececf9](https://github.com/facebook/react-native/commit/71b8ececf9b298fbf99aa27d0e363b533411e93d) by [@sahrens](https://github.com/sahrens)) -- Update SoLoader to 0.8.2 ([0a6f058b6b](https://github.com/facebook/react-native/commit/0a6f058b6bd0493f7eece972b1f73be3606ca8d5) by [@passy](https://github.com/passy)) -- `console.error` calls, and uncaught exceptions are now displayed in the Metro logs as well ([ffb82cb2f0](https://github.com/facebook/react-native/commit/ffb82cb2f052f276a94a004d5acea0ab44f8098c) by [@mweststrate](https://github.com/mweststrate)) -- Upgrade Flipper to 0.37.0 ([17f025bc26](https://github.com/facebook/react-native/commit/17f025bc26da13da795845a3f7daee65563420c0) by [@sunnylqm](https://github.com/sunnylqm)) - -#### Android specific - -- Upgraded to Hermes 0.5.0 ([4305a291a9](https://github.com/facebook/react-native/commit/4305a291a9408ca65847994bbec42f1fbc97071d) by [@willholen](https://github.com/willholen)) -- Internal storage now will be preferred for caching images from `ImageEditor`. ([79efa43428](https://github.com/facebook/react-native/commit/79efa4342852a3e9271a56e3a0fb7c15be664e9a) by [@kitttn](https://github.com/kitttn)) -- Update Gradle Wrapper to 6.2 ([d4d8887b50](https://github.com/facebook/react-native/commit/d4d8887b5018782eeb3f26efa85125e6bbff73e4) by [@friederbluemle](https://github.com/friederbluemle)) -- Upgrade Folly to v2020.01.13.00 ([6e2131b8fa](https://github.com/facebook/react-native/commit/6e2131b8fa85da8b3fb0391803e7fbecba890ffb) by [@Kudo](https://github.com/Kudo)) -- Only update dimensions in `ReactRootView` if they've changed ([cc3e27d484](https://github.com/facebook/react-native/commit/cc3e27d484d3a412f632454b7f1c637b2c271af2) by [@ejanzer](https://github.com/ejanzer)) -- `ReactEditText` extends `AppCompatEditText` ([aaa2765a92](https://github.com/facebook/react-native/commit/aaa2765a920de8234f0def4cae05ca5d6c8c8ac8) by [@dulmandakh](https://github.com/dulmandakh)) -- Make `ReactApplicationContext` nullable as the constructor argument of `ReactContextBaseJavaModule` ([f8d5c5bfd7](https://github.com/facebook/react-native/commit/f8d5c5bfd79be0e20a205a1856bd9946143eeacf) by [@RSNara](https://github.com/RSNara)) -- Update Android Gradle plugin to 3.5.3 ([e1e081b00e](https://github.com/facebook/react-native/commit/e1e081b00e5efb32bce74211c850212eca8a9412) by [@SaeedZhiany](https://github.com/SaeedZhiany)) -- Don't emit dimensions update event on initial load ([383934a06e](https://github.com/facebook/react-native/commit/383934a06e22e8e1a5ee50d121722240259f95d0) by [@ejanzer](https://github.com/ejanzer)) -- Bump Android build-tools to 29.0.2, compileSdk to 29 ([edcbfb9821](https://github.com/facebook/react-native/commit/edcbfb98210d9aaa6bb1d7c64281ae9cfb41cac2) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific - -- Disambiguate autolinking-ios.rb script from CLI’s “autolinking” feature and bring RNTester & template in line. ([4118d79826](https://github.com/facebook/react-native/commit/4118d798265341061105f3a53550db83c66a71cb) by [@alloy](https://github.com/alloy)) -- Updated Flipper iOS integration to be included by default in the `Debug` configuration ([619d5d60df](https://github.com/facebook/react-native/commit/619d5d60dfa94966e7104febec08166c1b5eca49) by [@alloy](https://github.com/alloy)) -- Use Apple unified logging API (os_log) ([f501ed682a](https://github.com/facebook/react-native/commit/f501ed682ae68136d966aee2b0d3cc0f1e8b90cd) by [@LeoNatan](https://github.com/LeoNatan)) -- Upgrade Folly to v2020.01.13.00 ([a27e31c059](https://github.com/facebook/react-native/commit/a27e31c059971b1d554ad6c7c81706f08eafac87) by [@Kudo](https://github.com/Kudo)) -- Remove the `xcshareddata` from .gitignore ([7980615d37](https://github.com/facebook/react-native/commit/7980615d371a7bf607a3787bca91cfde229c41dc) by [@pvinis](https://github.com/pvinis)) -- Add `complete_nullability = True` to compatible libraries ([796a4ea7e3](https://github.com/facebook/react-native/commit/796a4ea7e31ae05b76e59e02ab05f9c955f7c149)) -- Remove the Flipper pod post install step ([44beb2a685](https://github.com/facebook/react-native/commit/44beb2a685b7ceb0311bde7d0d33cb70bb891d30) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) -- Enable Flipper with CocoaPods `:configuration` ([7bb1c4e1b8](https://github.com/facebook/react-native/commit/7bb1c4e1b8715a5c9cb6f9e4e77a6df783481d3d) by [@alloy](https://github.com/alloy)) - -### Removed - -- Remove unused`ImageProp` ([fbd09b1797](https://github.com/facebook/react-native/commit/fbd09b179759cd90f2be5c24caa11bdb483ad8cd) by [@Naturalclar](https://github.com/Naturalclar)) -- Remove leftover `Incremental` component ([e99800267b](https://github.com/facebook/react-native/commit/e99800267b78aa581aff956d47b8be91858628b9) by [@venits](https://github.com/venits)) -- Remove "Debug with Nuclide" option ([011eb4cea5](https://github.com/facebook/react-native/commit/011eb4cea5d482cef54d7659e7436a04e539ff19) by [@rickhanlonii](https://github.com/rickhanlonii)) - -#### Android specific - -- Remove unused Feature Flag: `lazilyLoadViewManagers` ([3963f34980](https://github.com/facebook/react-native/commit/3963f34980f501ef89a945a1d0e76716af84527d) by [@JoshuaGross](https://github.com/JoshuaGross)) -- `PickFirst` options for RNTester and template ([4bb0b4f205](https://github.com/facebook/react-native/commit/4bb0b4f205b1bc9a91150fe1f609f7d7313eb806) by [@passy](https://github.com/passy)) -- Remove Kotlin version from the default template ([ced959bb3d](https://github.com/facebook/react-native/commit/ced959bb3d6abdab30c5e64af9bff6059b111cdd) by [@grabbou](https://github.com/grabbou)) - -#### iOS specific - -- Remove core `RCTConvert` CoreLocation Libraries ([bcf2a716fb](https://github.com/facebook/react-native/commit/bcf2a716fb8b8954d6f7b801a1699eeea9418e73) by [@maschad](https://github.com/maschad)) -- Remove copyright notices from iOS application template ([9c3fa57337](https://github.com/facebook/react-native/commit/9c3fa573379bb4824bbe02b5b5aa1ae3502772d8) by [@alloy](https://github.com/alloy)) -- Remove three properties: `textColor`, `font` and `textAlignment` from `RCTBackedTextInputViewProtocol`, unifying the usage into `defaultTextAttributes`. ([aff6bad27c](https://github.com/facebook/react-native/commit/aff6bad27c6c2232ba8bde17823d0a0db4ac589b) by [@jimmy623](https://github.com/jimmy623)) - -### Fixed - -- Add support to render `` with no fixed size nested within a `` ([dbb7eacb42](https://github.com/facebook/react-native/commit/dbb7eacb429adb4160e740017c212bfd6df0f03a) by [@mdvacca](https://github.com/mdvacca)) -- Fixes bug where `` would crash. ([66601e755f](https://github.com/facebook/react-native/commit/66601e755fcad10698e61d20878d52194ad0e90c) by [@TheSavior](https://github.com/TheSavior)) -- Use new `setTextCursorDrawable` API for Android 10 ([e7a14b803f](https://github.com/facebook/react-native/commit/e7a14b803fdc8840bbcde51d4bfa9cf9a85a8472) by [@sturmen](https://github.com/sturmen)) -- Fix `Animated.Value` initialized with undefined in `ScrollView` ([cf02bd9b76](https://github.com/facebook/react-native/commit/cf02bd9b765e29ed8aa2bbf62661e89c84bb80e5) by [@janicduplessis](https://github.com/janicduplessis)) -- Do not explicitly include `.js` in Library imports ([161b910494](https://github.com/facebook/react-native/commit/161b9104941663dcc0b08a73789c0ff3410fc661) by [@NickGerleman](https://github.com/NickGerleman)) -- Fixed `Pressability` to properly fire `onLongPress`. ([5ca1d8f260](https://github.com/facebook/react-native/commit/5ca1d8f260bfb64111a6ba39f76a0a935829c0f2) by [@yungsters](https://github.com/yungsters)) -- Fixed typo from `inly` to `only` inside `Modal.js` library code. ([686d8a57f8](https://github.com/facebook/react-native/commit/686d8a57f889fe74dc1c66566c80f0ed6d677729) by [@Darking360](https://github.com/Darking360)) -- Fix viewability calculations for nested `VirtualizedLists` inside of a parent list's `FooterComponent` ([074a2fab74](https://github.com/facebook/react-native/commit/074a2fab74754c28cba0ccc51552a246a3046501) by [@logandaniels](https://github.com/logandaniels)) -- Fix android `TextInput` transitions ([0a17a4fe56](https://github.com/facebook/react-native/commit/0a17a4fe56ff2cabc3c7d1cc5b34bd3fdd032e59)) -- Remove JS autoFocus implementation ([0569d4c431](https://github.com/facebook/react-native/commit/0569d4c4315d61d2d8f4ab628a54eb1e1db45dc2) by [@janicduplessis](https://github.com/janicduplessis)) -- Check null values in `shouldAnimate` ([3498b3b96b](https://github.com/facebook/react-native/commit/3498b3b96b2e27c7c7f6407b3673b44540871a31) by [@axe-fb](https://github.com/axe-fb)) -- Fix `AccessibilityInfo.isScreenReaderEnabled` mock in Jest setup ([ec3327b61a](https://github.com/facebook/react-native/commit/ec3327b61ab1be3fd1565c8a35fe56747bd9069f) by [@rubennorte](https://github.com/rubennorte)) -- Fix crash when passing invalid UTF-16 data from JSC into native code ([011cf3f884](https://github.com/facebook/react-native/commit/011cf3f88428ca83552d0b51c7c3a0c47b9728e5) by [@motiz88](https://github.com/motiz88)) -- Make `YGValue.h` compile with Clang on Windows ([014bc95135](https://github.com/facebook/react-native/commit/014bc95135a38d65b991509492c0979cfd153e71) by [@christophpurrer](https://github.com/christophpurrer)) -- Fix documentation comments for HermesJS's `Function::callWithThis` method to accurately reflect how `this` is handled. ([399bda5284](https://github.com/facebook/react-native/commit/399bda52840161bf7d30c09eca061b4378b8f6e4) by [@Kronopath](https://github.com/Kronopath)) -- Fix resolving assets outside of the project root ([7deeec7396](https://github.com/facebook/react-native/commit/7deeec73966d84140492c2a767819977318c4d2d) by [@janicduplessis](https://github.com/janicduplessis)) -- Transform empty responses into empty `Blob`s ([9a8c06b502](https://github.com/facebook/react-native/commit/9a8c06b502c774f7a0bff1bdc064fbfe16ca75be) by [@RSNara](https://github.com/RSNara)) -- Fix validation of event mappings for `AnimatedEvent` ([19362f6116](https://github.com/facebook/react-native/commit/19362f6116bad441c5e23f2bab420af78664b3d3) by [@javache](https://github.com/javache)) -- Fix `NativeJSCHeapCapture` ([7e3a43c23d](https://github.com/facebook/react-native/commit/7e3a43c23d028a4481bc455dd28c391a81ff1a94) by [@RSNara](https://github.com/RSNara)) -- Add `AnimationInterpolation` as possible type for toValue ([26e8870fbf](https://github.com/facebook/react-native/commit/26e8870fbf310f0fb438a86cb2fe260f0bc419b9) by [@nabati](https://github.com/nabati)) -- Fix return type of `StyleSheet.create` ([4e71a30969](https://github.com/facebook/react-native/commit/4e71a30969d74073309d0350be55cadb84ae43ff) by [@jbrown215](https://github.com/jbrown215)) -- Adjust HelloWorld-tvOSTests/Info.plist `CFBundleIdentifier` to use `PRODUCT_BUNDLE_IDENTIFIER` ([98ebc1ea25](https://github.com/facebook/react-native/commit/98ebc1ea25102049ec53288a458ff16ed5b4ada0) by [@MoOx](https://github.com/MoOx)) -- Fix bug where if `Error` global is not callable when building an error, jsi will throw a JS exception back to JS code. #158 ([a195447539](https://github.com/facebook/react-native/commit/a1954475394dc03704a2e093e6fc4b48188640fa) by [@mhorowitz](https://github.com/mhorowitz)) -- Fix stylesheet validation for functions with custom prototype methods. ([f464dad5d4](https://github.com/facebook/react-native/commit/f464dad5d4f0fbf1cb23e21d22907ffddeaf97e4)) -- Fix sporadic issue with `onEndReached` called on load when not needed ([8ddf231306](https://github.com/facebook/react-native/commit/8ddf231306e3bd85be718940d04f11d23b570a62) by [@sahrens](https://github.com/sahrens)) -- Correct argument types of `NativeJSDevSupport.onSuccess` ([b42371da5a](https://github.com/facebook/react-native/commit/b42371da5a41916522b569a66c0a126333cf9cac) by [@RSNara](https://github.com/RSNara)) -- Add `URLSearchParams` and `Headers` to eslint globals ([7a13a1a88f](https://github.com/facebook/react-native/commit/7a13a1a88fdf26dca817b76399f1c86a8a05eccb) by [@sonnyp](https://github.com/sonnyp)) -- Export exception classes with default visibility ([84adc85523](https://github.com/facebook/react-native/commit/84adc85523770ebfee749a020920e0b216cf69f8) by [@appden](https://github.com/appden)) -- Add `URL` to eslint globals. ([ff9def41ff](https://github.com/facebook/react-native/commit/ff9def41ff3e7760d076bf1b899583d4b36cba0d) by [@sonnyp](https://github.com/sonnyp)) -- Plumb through memory allocation profiler feature to Chrome Inspector ([ed3054927c](https://github.com/facebook/react-native/commit/ed3054927c30c8823f78026b9c4cb42fbe4f8b00) by [@jbower-fb](https://github.com/jbower-fb)) -- Better monorepo support when building release apk ([a8e85026cf](https://github.com/facebook/react-native/commit/a8e85026cfa60056b1bcbcd39cde789e4d65f9cb) by [@grabbou](https://github.com/grabbou)) -- `LogBox` - Fix dependency cycle ([6ba2aeefa8](https://github.com/facebook/react-native/commit/6ba2aeefa8dfe031bf1dc46dbea29235aec31d61) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Always update background color and bar style on Android status bar ([9457efa84c](https://github.com/facebook/react-native/commit/9457efa84c872f029027cdcfc3bae4f403715e48)) -- Disable accessibility state changes of the focused view for Android API < 21 ([f2d58483c2](https://github.com/facebook/react-native/commit/f2d58483c2aec689d7065eb68766a5aec7c96e97) by [@mdvacca](https://github.com/mdvacca)) - -#### Android specific - -- Gradle release config ([0d1fb458ab](https://github.com/facebook/react-native/commit/0d1fb458ab8027dcfac5f2fa11e8c16d6853c59c) by [@vdmtrv](https://github.com/vdmtrv)) -- Change how `TextInput` responds to `requestFocus` to fix a11y focus issue ([d4a498aba2](https://github.com/facebook/react-native/commit/d4a498aba2d2843e7a741a31b0c91c6a79a7386c) by [@ejanzer](https://github.com/ejanzer)) -- Fixed style in `TextInputTestCase` ([8c493804f3](https://github.com/facebook/react-native/commit/8c493804f3f7b3ae3761679a978971ab9d71baa0) by [@ejanzer](https://github.com/ejanzer)) -- Fix template instacrash from missing androidx dependency ([a1b14deb3e](https://github.com/facebook/react-native/commit/a1b14deb3e32df797aae99a75743a4d283e5337b) by [@alloy](https://github.com/alloy)) -- Implement native `TextInput` `autoFocus` on Android ([055a41b081](https://github.com/facebook/react-native/commit/055a41b081c5bc9535b071d9b4b7488b92e71803) by [@janicduplessis](https://github.com/janicduplessis)) -- Support for case insensitive `Origin` headers for `Websockets` ([aeaf286c77](https://github.com/facebook/react-native/commit/aeaf286c77b50a95c4961de0d2355caad8ffa396) by [@brunobar79](https://github.com/brunobar79)) -- RNTester Buck Build ([a3cb377645](https://github.com/facebook/react-native/commit/a3cb377645f2ccb7632ded73c230a41025d38f6f) by [@passy](https://github.com/passy)) -- Fix bug in updating dimensions in JS ([bef845ffd5](https://github.com/facebook/react-native/commit/bef845ffd521aa83d779de584ec370f9f88f27f3) by [@ejanzer](https://github.com/ejanzer)) -- Applied missing changes from bumping Gradle wrapper to 6.0.1 ([aa0ef15335](https://github.com/facebook/react-native/commit/aa0ef15335fe27c0c193e3e968789886d82e82ed) by [@SaeedZhiany](https://github.com/SaeedZhiany)) -- Unregister `JSDevSupport` from `DebugCorePackage` ([c20963e11c](https://github.com/facebook/react-native/commit/c20963e11cc1c10f20a2a0a3c209f5b403c9e899) by [@RSNara](https://github.com/RSNara)) -- Make sure `ServerHost` is optional in `NativePlatformConstants.js` ([048f88a33a](https://github.com/facebook/react-native/commit/048f88a33a53ebd4e45865b319c42291f1d6c7f2) by [@RSNara](https://github.com/RSNara)) -- Removed code that would cause accessibility header role to be spoken twice ([7428271995](https://github.com/facebook/react-native/commit/7428271995adf21b2b31b188ed83b785ce1e9189) by [@KevinGVargas](https://github.com/KevinGVargas)) -- Fail silently in `AppStateModule.sendEvent` if `CatalystInstance` is not available ([c4806fada6](https://github.com/facebook/react-native/commit/c4806fada6532894e2242cf31f7145d2992e3a2b) by [@JoshuaGross](https://github.com/JoshuaGross)) -- RN `Picker` - fix types in `AndroidDialogPickerManagerInterface` ([56b0f5cb6b](https://github.com/facebook/react-native/commit/56b0f5cb6ba48ecefc2890152ebe88e3df61a0ea)) -- Fix Hermes debugger being disabled by default ([b8621f5d30](https://github.com/facebook/react-native/commit/b8621f5d303442ab78dc5d745cfc86a941d4737c) by [@willholen](https://github.com/willholen)) - -#### iOS specific - -- Fixed connection of metro reload command to iOS device ([f9df93385e](https://github.com/facebook/react-native/commit/f9df93385eee0e1cd1144a65e05410dfb48b119c) by [@reyalpsirc](https://github.com/reyalpsirc)) -- Remove `RCTDevLoadingView` jank ([faff19a7c6](https://github.com/facebook/react-native/commit/faff19a7c651c740d8d649b86727b63b63562b20) by [@RSNara](https://github.com/RSNara)) -- Fix crash when passing null value in object parameter of bridged method ([15434c7c43](https://github.com/facebook/react-native/commit/15434c7c435928a40b9cd66fe9f5d1bcdea8d954)) -- Get ready for Clang 10 ([8721ee0a6b](https://github.com/facebook/react-native/commit/8721ee0a6b10e5bc8a5a95809aaa7b25dd5a6043) by [@maxovtsin](https://github.com/maxovtsin)) -- Fix `RCTBlobManager` cleanup crash ([91c5ff4a12](https://github.com/facebook/react-native/commit/91c5ff4a12982ccead56c9c038761e9316d01409) by [@RSNara](https://github.com/RSNara)) -- Make Lambda function called in `NativeModule` mutable ([5290047d09](https://github.com/facebook/react-native/commit/5290047d09c0a41c85a1d47a638877c226d9c191) by [@maschad](https://github.com/maschad)) -- Fix crash in `RCTCxxBridge.executeApplicationScript` ([0c2db3256f](https://github.com/facebook/react-native/commit/0c2db3256f6cbb3ec564e0f183a52a439ed33f52) by [@ahimberg](https://github.com/ahimberg)) -- Fix `RCTDevLoadingView` `RedBox` on reload ([fe5ac2c3f9](https://github.com/facebook/react-native/commit/fe5ac2c3f9e47cfb7c5820a755a5d74d47624953) by [@RSNara](https://github.com/RSNara)) -- Fix `Image` component crashing when `uri` is `null` ([06b8b15b0a](https://github.com/facebook/react-native/commit/06b8b15b0af84b6f8b44d200dc25f29eac51181c) by [@mlazari](https://github.com/mlazari)) -- Fix `RCTDevLoadingView` not showing up with `UIScene` ([74b667dbc2](https://github.com/facebook/react-native/commit/74b667dbc2a48183dec0b9c3b5401bc3f9e54e7b) by [@tido64](https://github.com/tido64)) -- Prevent interactive dismissal for non-fullscreen modals ([1e7ed81d16](https://github.com/facebook/react-native/commit/1e7ed81d16dda4188352e0ccdc0f0bd3ad4741f3)) -- Resolve localization warnings in template ([0e4bcaa296](https://github.com/facebook/react-native/commit/0e4bcaa2960a2b1aa42dbe716fc6a35652aa7207) by [@safaiyeh](https://github.com/safaiyeh)) -- Implement `requiresMainQueueSetup` in `RCTDevSettings.mm` ([adf87dd7ed](https://github.com/facebook/react-native/commit/adf87dd7eddcf65a3300e6ac9092838d9c8a3279) by [@logandaniels](https://github.com/logandaniels)) -- Resolve `React-RCTText` Xcode warning ([04fed6508b](https://github.com/facebook/react-native/commit/04fed6508b74b23c954183af3f6121fb344d2138) by [@safaiyeh](https://github.com/safaiyeh)) -- Resolve Xcode warnings from `React-cxxreact`. ([dc6c57ce0d](https://github.com/facebook/react-native/commit/dc6c57ce0d4f5424bfb047c51fee18eac381a98b) by [@safaiyeh](https://github.com/safaiyeh)) -- `RCTReconnectingWebSocket` is reconnecting infinitely when stopped before getting connected ([0d4b0e9417](https://github.com/facebook/react-native/commit/0d4b0e941725657d8e63940428888aaceff505ad)) -- Fix prop name of `passwordRules` in `TextInput` ([3f5c42f357](https://github.com/facebook/react-native/commit/3f5c42f357d58268d0a0fd1bfc639f41feab937c) by [@Naturalclar](https://github.com/Naturalclar)) -- Remove need for Swift file in the user’s project in order to use Flipper ([8f93dedc6a](https://github.com/facebook/react-native/commit/8f93dedc6a5653edd2220c65ccb4ff8736ee060c) by [@alloy](https://github.com/alloy)) -- Clear all held `jsi::Functions` when `jsi::Runtime` is deleted ([9ae95582e7](https://github.com/facebook/react-native/commit/9ae95582e792a3dca4487bdce9080c6d874c7dd7) by [@RSNara](https://github.com/RSNara)) -- Make framework builds work again by making `RCTImageLoader` C++ requirement opt-in ([25571ec452](https://github.com/facebook/react-native/commit/25571ec4522931193b41723d3f80b3bced1fca3b) by [@alloy](https://github.com/alloy)) -- Enable dev keyboard shortcuts on Mac Catalyst ([56dfc86d64](https://github.com/facebook/react-native/commit/56dfc86d64a2a1f2ad05239b6d11aacac73cbac9) by [@charpeni](https://github.com/charpeni)) -- Fix `RCTTextView` layout issue that happens on some font with `leading` attribute not equal to zero, which causes wrong base-alignment layout ([5d08aab526](https://github.com/facebook/react-native/commit/5d08aab526b2702b46ff75ea7e943a33aa6df288)) -- Fix LAN instead of Wi-Fi device bundle configuration ([d1e6f8d3c4](https://github.com/facebook/react-native/commit/d1e6f8d3c4de1fbb4bddd5205cd3b35c572b495b) by [@Oleg-E-Bakharev](https://github.com/Oleg-E-Bakharev)) -- Add autorelease pool for each run loop for JS Thread ([948cbfdacc](https://github.com/facebook/react-native/commit/948cbfdacc42f8d2640e69f61df55f6adb823fcf) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fixed bug in implementation of ``'s `selectOnFocus` prop ([e020576b34](https://github.com/facebook/react-native/commit/e020576b34fb6ca6d3f9fe38916844b78a45c0e3) by [@shergin](https://github.com/shergin)) -- `RCTRedBox` doesn't appear in apps implementing `UISceneDelegate` ([d0a32c2011](https://github.com/facebook/react-native/commit/d0a32c2011ca00991be45ac3fa320f4fc663b2e8) by [@tido64](https://github.com/tido64)) -- Fixes the `InputAccessoryView.backgroundColor` prop’s typing to use `ColorValue`. ([a43fd60e18](https://github.com/facebook/react-native/commit/a43fd60e18aff9ee6bcaf8ec576adb8678d5bcf4) by [@alloy](https://github.com/alloy)) -- Fix `Animated` image crash when `CADisplayLink` target in `RCTWeakProxy` is `nil` ([e5a6655e71](https://github.com/facebook/react-native/commit/e5a6655e71d41a58ce0e51d37aa9fb8792e37dd5) by [@p-sun](https://github.com/p-sun)) - -## v0.62.3 - -### Security - -- Update validateBaseUrl to use latest regex ([33ef82ce6d](https://github.com/facebook/react-native/commit/33ef82ce6dfd31e1f990d438c925a0e52723e16b) by [@FBNeal](https://github.com/FBNeal)) - -### Fixed - -#### iOS specific - -- Change autolink to match requirements for FlipperFolly working with Xcode 12.5 ([c6f4611dcb](https://github.com/facebook/react-native/commit/c6f4611dcbfbb64d5b54e242570e2a1acffcabef) by [@kelset](https://github.com/kelset)) -- Change podfile to rely on the autolink-ios rb file ([c4ea556d64](https://github.com/facebook/react-native/commit/c4ea556d64c7fc146d1412548788c48bbcc0f6bb) by [@kelset](https://github.com/kelset)) -- Update detox to work on Xcode 12 ([158b558e50](https://github.com/facebook/react-native/commit/158b558e500576f434dec09417bb02cc0bc53f7a) by [@kelset](https://github.com/kelset)) - -## v0.62.2 - -### Fixed - -- Fix Appearance module when using Chrome Debugger ([f7b90336be](https://github.com/facebook/react-native/commit/f7b90336be25b78935549aa140131d4d6d133f7b) by [@TheSavior](https://github.com/TheSavior)) -- Fix mock for TextInput ([5a3c6faee9](https://github.com/facebook/react-native/commit/5a3c6faee9c44a2d99b13d113c91dbf98990f8af) by [@SergioEstevao](https://github.com/SergioEstevao)) -- Flow errors from YellowBox and BubblingEventHandler ([a049130f34](https://github.com/facebook/react-native/commit/a049130f34be951c9c67d2a472c7eb7f3d08f070) by [@thymikee](https://github.com/thymikee)) - -#### iOS specific - -- Make Vibration library compatible with TurboModules. ([3904228704](https://github.com/facebook/react-native/commit/390422870466beba571dda04f669380e14055056) by [@brunobar79](https://github.com/brunobar79)) -- Exclude Flipper from iOS Release builds ([e5497ca8f6](https://github.com/facebook/react-native/commit/e5497ca8f6e3b240948fdbeef0ac2a710f25bb56) by [@javiercr](https://github.com/javiercr)) -- Fix crash when enabling Performance Monitor on iOS 13.4 ([e2c417f7cf](https://github.com/facebook/react-native/commit/e2c417f7cf5ae7efa5ea1f9644a51c4c706a983f) by [@IjzerenHein](https://github.com/IjzerenHein)) - -## v0.62.1 - -### Fixed - -- Bump CLI to 4.5.1 to improve DX ([eac56b9749](https://github.com/facebook/react-native/commit/eac56b9749ed624275d4190b5e48b775583acb3f) by [@alloy](https://github.com/alloy)) -- Fix a YellowBox regression in v0.62.0 where the Flipper network inspector causes YellowBox to crash the app due to using base64 images. ([227aa96bb2](https://github.com/facebook/react-native/commit/227aa96bb23b6ff20eebbd8a9335fd172ed6005b) by [@rickhanlonii](https://github.com/rickhanlonii)) - -#### Android specific - -- Add new DoNotStrip class to proguard config ([cfcf5eba43](https://github.com/facebook/react-native/commit/cfcf5eba4317f80ef8902463b7c0b2e1e7b534a7) by [@janicduplessis](https://github.com/janicduplessis)) - -#### iOS specific - -- Fix Performance Monitor in dark appearance ([576ddfb3a8](https://github.com/facebook/react-native/commit/576ddfb3a84a5461679959f0d3f229a000dcea8d) by [@gorhom](https://github.com/gorhom)) -- Inverted ScrollViews scroll to their bottom when the status bar is pressed ([7a4753d76a](https://github.com/facebook/react-native/commit/7a4753d76aab1c52a09f26ec6f7fd43a68da8a97) by [@emilioicai](https://github.com/emilioicai)) -- Revert [previous incomplete fix](https://github.com/facebook/react-native/commit/bd2b7d6c0366b5f19de56b71cb706a0af4b0be43) for [an issue](https://github.com/facebook/react-native/issues/26473) with `Modal`’s `onDismiss` prop. ([27a3248a3b](https://github.com/facebook/react-native/commit/27a3248a3b37410b5ee6dda421ae00fa485b525c) by [@grabbou](https://github.com/grabbou)) -- Fix double call to onEndReached in VirtualizedList ([d3658bc2b6](https://github.com/facebook/react-native/commit/d3658bc2b6437e858d3b3f5688277dedbca779b8) by [@MartinSherburn](https://github.com/MartinSherburn)) - -### Changed - -- Update warning message of deprecated imports ([405200e9a9](https://github.com/facebook/react-native/commit/405200e9a930cded47954f374f2a779ec769cd4c) by [@Naturalclar](https://github.com/Naturalclar)) - -## v0.62.0 - -This major release includes Flipper support by default, improved dark mode support, moving Apple TV to [react-native-tvos](https://github.com/react-native-community/react-native-tvos), and more. See the [blog post](https://reactnative.dev/blog/2020/03/26/version-0.62) for all of the highlights. - -This release comes in the midst of a global pandemic. We’re releasing this version today to respect the work of hundreds of contributors who made this release possible and to prevent the release from falling too far behind master. Please be mindful of the reduced capacity of contributors to help with issues and prepare to delay upgrading if necessary. - -If you're upgrading, manual intervention may be required for your app. Please see the [upgrade-helper](https://react-native-community.github.io/upgrade-helper/) for a detailed breakdown of the changes required and see [this issue](https://github.com/react-native-community/releases/issues/179) for known issues. - -One known issue with workaround is regarding Android builds and [APK size increases](https://github.com/facebook/react-native/issues/28330). - -### Breaking - -- React DevTools v4 integration ([92a3c9da0a](https://github.com/facebook/react-native/commit/92a3c9da0a38870a8bad7c91bdc3ddb494f6e5f2) by [@bvaughn](https://github.com/bvaughn)) -- Remove `TextInput`'s `onTextInput` prop ([3f7e0a2c96](https://github.com/facebook/react-native/commit/3f7e0a2c9601fc186f25bfd794cd0008ac3983ab) by [@shergin](https://github.com/shergin)) -- Remove `TextInput`'s `inputView` prop ([1804e7cbea](https://github.com/facebook/react-native/commit/1804e7cbea707a35046118090966a54031edfae8) by [@TheSavior](https://github.com/TheSavior)) -- Animated: Remove `defaultProps` Parameter ([a70987cee2](https://github.com/facebook/react-native/commit/a70987cee24bcd027b9c4a5aa85dfd6a1aab74b3) by [@yungsters](https://github.com/yungsters)) -- Remove `TextInput`'s `selectionState` prop ([2becdfd404](https://github.com/facebook/react-native/commit/2becdfd4041f7f28138ba3a61c03e17c06dc2e50) by [@yungsters](https://github.com/yungsters)) -- Remove support for `framesToPop` ([8bc02fdd52](https://github.com/facebook/react-native/commit/8bc02fdd52124d0a24d96e4a61d7688328ef1660) [cf4d45ec2b](https://github.com/facebook/react-native/commit/cf4d45ec2bcd301be7793d5840de21ec7d02275b) [a483f802fd](https://github.com/facebook/react-native/commit/a483f802fddfd927f2baa0d95e2b4094d452cddd) by [@motiz88](https://github.com/motiz88)) -- Remove `TimePickerAndroid` ([dbf070c51e](https://github.com/facebook/react-native/commit/dbf070c51ecd14127a8317faa75cb661697b5a6b) by [@cpojer](https://github.com/cpojer)) -- Remove `scrollWithoutAnimationTo` from ScrollView ([c7e89909da](https://github.com/facebook/react-native/commit/c7e89909da70ac5290f9971080eb897567db3e43) by [@TheSavior](https://github.com/TheSavior)) -- Bump CLI to ^4.2.x ([be5088401f](https://github.com/facebook/react-native/commit/be5088401fd8e19d57adda42d275cab437448064) by [@alloy](https://github.com/alloy)) - for details on what v4 of the CLI improves on (like monorepo support), please refer to the [dedicated blog post](https://callstack.com/blog/react-native-cli-3-1-0-and-4-0-0-whats-new/) and the [release notes](https://github.com/react-native-community/cli/releases) -- Remove `accessibilityStates` property ([7b35f427fd](https://github.com/facebook/react-native/commit/7b35f427fd66cb0f36921b992095fe5b3c14d8b9) by [@marcmulcahy](https://github.com/marcmulcahy)) -- Upgraded to Hermes 0.4.0. If you're using ProGuard you will need to add the following rule to `proguard-rules.pro`: `-keep class com.facebook.jni.** { *; }` ([ab3c184555](https://github.com/facebook/react-native/commit/ab3c184555e382b8693cbfcdfe01ba89583ee726) by [@willholen](https://github.com/willholen)) - -#### Android specific - -- Fix setting keyboardType from breaking autoCapitalize ([233fdfc014](https://github.com/facebook/react-native/commit/233fdfc014bb4b919c7624c90e5dac614479076f) by [@safaiyeh](https://github.com/safaiyeh)) -- Limit size of video uploaded from camera roll in android (< 100 MB) ([d21f695edf](https://github.com/facebook/react-native/commit/d21f695edf367166a03af4c6e9376cd498b38665)) -- Remove "Reload on JS change" from RN Android ([478df155e7](https://github.com/facebook/react-native/commit/478df155e70a4ce30219adcac6f0801c4e4d10ec) by [@cpojer](https://github.com/cpojer)) - -### Added - -- Add support for Flipper by default ([multiple commits](https://github.com/facebook/react-native/pulls?q=is%3Apr+Flipper+is%3Aclosed)) -- Add `getNativeScrollRef` method to FlatList component ([bde1d63c85](https://github.com/facebook/react-native/commit/bde1d63c853630609b22c87121c125775dd1f5cb) by [@kacieb](https://github.com/kacieb)) -- Add missing accessibility props on Touchables ([8c0c860e38](https://github.com/facebook/react-native/commit/8c0c860e38f57e18296f689e47dfb4a54088c260) by [@xuelgong](https://github.com/xuelgong)) -- Added missing `console` polyfills in release builds. ([b7ab922bb3](https://github.com/facebook/react-native/commit/b7ab922bb3fd4f9f103e583bed9e9295a9521578) by [@yungsters](https://github.com/yungsters)) -- Platform.select now supports native as an option. ([a6fc0898de](https://github.com/facebook/react-native/commit/a6fc0898de990959d201b9665501deda215e41a4) by [@koke](https://github.com/koke)) -- Export the DevSettings module, add `addMenuItem` method ([cc068b0551](https://github.com/facebook/react-native/commit/cc068b055185e6fb7341bf945f69a74ed3ef4814) by [@janicduplessis](https://github.com/janicduplessis)) -- Expose RCTNetworking as a public 'Networking' API ([42ee5ec934](https://github.com/facebook/react-native/commit/42ee5ec93425c95dee6125a6ff6864ec647636aa) by [@adamchel](https://github.com/adamchel)) -- Add `useColorScheme` hook ([51681e80ab](https://github.com/facebook/react-native/commit/51681e80ab0d1efdaba684b626994b694d53d2a5) by [@hramos](https://github.com/hramos)) -- Add `unstable_enableLogBox` ([dd8e5f468a](https://github.com/facebook/react-native/commit/dd8e5f468a29e299647ffbd0887f53afd24936e3) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Expose Hermes Sampling Profiler ([15ecb60d6d](https://github.com/facebook/react-native/commit/15ecb60d6deb96fcb7b0ef70faccd10594ededa3) by [@axe-fb](https://github.com/axe-fb)) -- Add `error-subclass-name` lint rule ([6611c4b8f4](https://github.com/facebook/react-native/commit/6611c4b8f42520add983cc48fe4e14f7a02cc7cf) by [@motiz88](https://github.com/motiz88)) -- Add `HostComponent` to the public API of React Native ([a446a38aaa](https://github.com/facebook/react-native/commit/a446a38aaab5bea2e279f1958cfd90090bfd7e09) by [@TheSavior](https://github.com/TheSavior)) -- Add `RCTExceptionsManager.reportException` ([9a57145f52](https://github.com/facebook/react-native/commit/9a57145f52a03678da02d5d00cbe11eed3f5a0fc) by [@motiz88](https://github.com/motiz88)) -- Add `accessibilityValue` property ([7df3eea1a7](https://github.com/facebook/react-native/commit/7df3eea1a79f12c2dfff1976d0cef605a83232ec) by [@marcmulcahy](https://github.com/marcmulcahy)) -- Add `Appearance` module to expose the user's current Night theme preference ([17862a78db](https://github.com/facebook/react-native/commit/17862a78db59d60fe316961f9111efc330ba2abd) [63fa3f21c5](https://github.com/facebook/react-native/commit/63fa3f21c5ab308def450bffb22054241a8842ef) by [@hramos](https://github.com/hramos)) -- Add `onSlidingComplete` callbacks when sliders adjusted via a11y. ([c7aa6dc827](https://github.com/facebook/react-native/commit/c7aa6dc8270c0eabc913fe6c617c8131e3f4b3c5) by [@marcmulcahy](https://github.com/marcmulcahy)) - -#### Android specific - -- Implement `adjustsFontSizeToFit` on Android ([2c1913f0b3](https://github.com/facebook/react-native/commit/2c1913f0b3d12147654501f7ee43af1d313655d8) by [@janicduplessis](https://github.com/janicduplessis)) -- Allow overriding `EditText` construction in `ReactTextInputShadowNode` ([a5b5d1a805](https://github.com/facebook/react-native/commit/a5b5d1a805a9c54d325763b432be1cf2c8811dc9) by [@mchowning](https://github.com/mchowning)) -- Add Android support for `fontVariant` prop ([c2c4b43dfe](https://github.com/facebook/react-native/commit/c2c4b43dfe098342a6958a20f6a1d841f7526e48) by [@mcuelenaere](https://github.com/mcuelenaere)) -- Custom entry file on android using `ENTRY_FILE` environment variable ([a0d8740878](https://github.com/facebook/react-native/commit/a0d87408782fcf191988612198493d9130736c72)) -- Added `statusBarTranslucent` prop to Modal component ([c35a419e5d](https://github.com/facebook/react-native/commit/c35a419e5d2eca4fe9cd0939df085088fa88423b) by [@pfulop](https://github.com/pfulop)) -- Add `fadingEdgeLength` prop to FlatList and ScrollView ([51aacd5241](https://github.com/facebook/react-native/commit/51aacd5241c4b4c0b9b1e1b8f9dabac45e5b5291)) -- Support `removeClippedSubviews` for horizontal ScrollViews ([42152a3fa3](https://github.com/facebook/react-native/commit/42152a3fa3f949f5112461753eb44a436355dfb1)) -- Introducing `ReactCallerContextFactory` interface ([9713b63d9a](https://github.com/facebook/react-native/commit/9713b63d9ac1e1ae85accd86b78b351ac6295d01) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific - -- Added web socket support for macOS ([f21fa4ecb7](https://github.com/facebook/react-native/commit/f21fa4ecb73551bdc4c3d70db9fc13e93b19b3a6) by [@andymatuschak](https://github.com/andymatuschak)) -- Added Warning message Linking API with Phones in iOS Simulator ([e1d89fbd9d](https://github.com/facebook/react-native/commit/e1d89fbd9df91679ec36e955a3d0f699c2d5e777) by [@espipj](https://github.com/espipj)) -- Added missing deps for React-CoreModules ([15b2353382](https://github.com/facebook/react-native/commit/15b2353382c46dc5f0130ff44b9deb6a2361e3e5) by [@fkgozali](https://github.com/fkgozali)) -- Expose the `isPackagerRunning` methods on RCTBundleURLProvider ([fe9cba74fa](https://github.com/facebook/react-native/commit/fe9cba74fa6241b4c38a3df9481d3634ebd51bf9) by [@afoxman](https://github.com/afoxman)) -- Add `autoFocus` to TextInput ([6adba409e6](https://github.com/facebook/react-native/commit/6adba409e6256fd2dcc27a4272edcedae89927af) by [@janicduplessis](https://github.com/janicduplessis)) - -### Changed - -- Upgrade metro version to 0.56.3 ([4b487ba500](https://github.com/facebook/react-native/commit/4b487ba50025becb6a83c805b99d45651db6b8c1) by [@EssamEmad](https://github.com/EssamEmad)) -- Upgrade `eslint-plugin-relay` to 1.3.12 ([f0bcfbe9be](https://github.com/facebook/react-native/commit/f0bcfbe9be0eb6a06d096a682717a23e43c39d52) by [@jstejada](https://github.com/jstejada)) -- Upgrade to Flow v0.108.0 ([d34bc5fa64](https://github.com/facebook/react-native/commit/d34bc5fa64a54dfc2e780461ee2997a4b17f8c65) by [@mvitousek](https://github.com/mvitousek)) -- Upgrade metro babel preset ([cef001713f](https://github.com/facebook/react-native/commit/cef001713fc6384353bbcb4d45645ceee44ed1a9) by [@alloy](https://github.com/alloy)) -- TextInput now properly sends native the end selection location on change ([dff490d140](https://github.com/facebook/react-native/commit/dff490d140010913d3209a2f3e987914b9c4eee4) by [@TheSavior](https://github.com/TheSavior)) -- TextInput now uses `forwardRef` allowing it to be used directly by new APIs requiring a host component. ([bbc5c35a61](https://github.com/facebook/react-native/commit/bbc5c35a61cd3af47ccb2dc62430e4b6a4d4e08f) by [@TheSavior](https://github.com/TheSavior)) -- TextInput no longer does an extra round trip to native on focus/blur ([e9b4928311](https://github.com/facebook/react-native/commit/e9b4928311513d3cbbd9d875827694eab6cfa932) by [@TheSavior](https://github.com/TheSavior)) -- Render collapsed JavaScript frames in RedBox ([468d1a2d2e](https://github.com/facebook/react-native/commit/468d1a2d2e6c72d7c6d435ecaad8499997584de6) by [@motiz88](https://github.com/motiz88)) -- Enable `no-useless-escape` lint rule ([90977b0e00](https://github.com/facebook/react-native/commit/90977b0e00acc6b3263502017c27094392e89478) by [@motiz88](https://github.com/motiz88)) -- Update `DevSettings.reload` to accept a reason ([549cac63cb](https://github.com/facebook/react-native/commit/549cac63cb252037f73453c5d4e7ae5f15586607) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Move `react-native-implementation.js` to `index.js` ([e54ecf907e](https://github.com/facebook/react-native/commit/e54ecf907e9f0660d05dc807ec0e67127143ebed) by [@cpojer](https://github.com/cpojer)) -- Delete Long Press Error in Touchable ([9a3d722ccb](https://github.com/facebook/react-native/commit/9a3d722ccb523f227ffd7770a809996e6cfe75d9) by [@yungsters](https://github.com/yungsters)) -- Add Intl to eslint globals. ([f6a62f9ae2](https://github.com/facebook/react-native/commit/f6a62f9ae2278c0f3a1e5c1a6ec3b7cca3421a41)) -- Add WebSocket to eslint globals ([af8ea06bb4](https://github.com/facebook/react-native/commit/af8ea06bb44e84ce51d4ca4e76f0d66bf34323bd) by [@dr2009](https://github.com/dr2009)) -- Change default `accessibilityRole` of Switch component from `button` to `switch` ([36672c3851](https://github.com/facebook/react-native/commit/36672c3851a044a1ab0edcfaa2790c02f7909695) by [@alvinmatias69](https://github.com/alvinmatias69)) - -#### Android specific - -- Bump gradle-download-task to 4.0.2 ([088be260b6](https://github.com/facebook/react-native/commit/088be260b6727ba82167fe58cb1ee4410a6920b2) by [@dulmandakh](https://github.com/dulmandakh)) -- Bump Gradle to 6.0.1 ([701e66bde4](https://github.com/facebook/react-native/commit/701e66bde4ea0e404626c7805e2bcdfa0c129c05) by [@dulmandakh](https://github.com/dulmandakh)) -- Bump Gradle wrapper 5.6.4 ([928f4434b9](https://github.com/facebook/react-native/commit/928f4434b9829c90098b1626b03938d932a9c1f6) by [@friederbluemle](https://github.com/friederbluemle)) -- Bump Soloader to 0.8.0 ([614039834b](https://github.com/facebook/react-native/commit/614039834bf255de096f8b1d168832f81b0cf3fa)) -- Update Android Gradle plugin to 3.5.2 ([b41b5ce8ae](https://github.com/facebook/react-native/commit/b41b5ce8ae2902169ae58860da2c70a9233bea53) by [@friederbluemle](https://github.com/friederbluemle)) -- Improve exception message when JSC loading fails ([65d3167a80](https://github.com/facebook/react-native/commit/65d3167a802b2ca04d4f05ff972c2d51765f1e0d) by [@mhorowitz](https://github.com/mhorowitz)) -- Expose `addCookies` method ([cc845ccfb4](https://github.com/facebook/react-native/commit/cc845ccfb4c0f841b876bca55c5f70efd72be538) by [@safaiyeh](https://github.com/safaiyeh)) -- Migrated from libfb to libfbjni for JNI calls ([9ad5e72b77](https://github.com/facebook/react-native/commit/9ad5e72b77013083f925108870ea6b17f4711a1d) by [@passy](https://github.com/passy)) -- Formatted cpp/h code with clang-format ([d5ba113bb2](https://github.com/facebook/react-native/commit/d5ba113bb2cd839ea38768785e527fbbc9636e41) by [@passy](https://github.com/passy)) -- Switch MainActivity launchMode to singleTask ([7a42596438](https://github.com/facebook/react-native/commit/7a42596438018129d52ff04899ab4ddabd27cdcb) by [@dulmandakh](https://github.com/dulmandakh)) -- Changing method signatures for ImageLoaderModule to accept double for requestId ([641e9657dd](https://github.com/facebook/react-native/commit/641e9657ddab5d1b2676e98d86fd369372281d2c) by [@ejanzer](https://github.com/ejanzer)) -- Use Node's module resolution algorithm to find JSC & Hermes ([fc25f288fe](https://github.com/facebook/react-native/commit/fc25f288fe553cb7e8f04b8ce4b56297b7fa40d5) by [@ide](https://github.com/ide)) -- Add `ACCESS_BACKGROUND_LOCATION` to PermissionsAndroid ([8c099b5f53](https://github.com/facebook/react-native/commit/8c099b5f53405fe0806113ca7ccf0bbe1af92a21) by [@dulmandakh](https://github.com/dulmandakh)) - -#### iOS specific - -- Add `xcscheme` files for iOS template back in. ([a715decd2d](https://github.com/facebook/react-native/commit/a715decd2d3bcdab9537f3246c8398ad9869e94e) by [@pvinis](https://github.com/pvinis)) - -### Deprecated - -- Add deprecation warning to `AccessibilityInfo.fetch` ([523ab83338](https://github.com/facebook/react-native/commit/523ab8333800afbfb169c6fd70ab6611fe07cc2a) by [@TheSavior](https://github.com/TheSavior)) -- Make setting `useNativeDriver` required. Add runtime warning if not specified ([5876052615](https://github.com/facebook/react-native/commit/5876052615f4858ed5fc32fa3da9b64695974238) by [@TheSavior](https://github.com/TheSavior)) -- Refs on an Animated component are now the internal component. The `getNode` call has been deprecated. ([66e72bb4e0](https://github.com/facebook/react-native/commit/66e72bb4e00aafbcb9f450ed5db261d98f99f82a) by [@yungsters](https://github.com/yungsters)) - -#### iOS specific - -- Deprecate `[bridge reload]`, prefer `RCTReloadCommand` ([ffe2306164](https://github.com/facebook/react-native/commit/ffe2306164ed7edfe5ab9d75b5122791037a852a) by [@PeteTheHeat](https://github.com/PeteTheHeat)) - -#### Android specific - -- Deprecate `CallerContext` from `ReactImageManager` ([8accd77c45](https://github.com/facebook/react-native/commit/8accd77c45a4b051bf02904c3485d6a0dcd27631) by [@mdvacca](https://github.com/mdvacca)) - -### Removed - -- Removing experimental `IncrementalPresenter` component ([0ef0d3167e](https://github.com/facebook/react-native/commit/0ef0d3167e291f31ce01ceb729df77cc679d2330) by [@TheSavior](https://github.com/TheSavior)) -- TouchableWithoutFeedback no longer exports Props. Use React.ElementConfig, instead. ([7bcae81299](https://github.com/facebook/react-native/commit/7bcae812997f669de5803cc781dcf3ea65baf0e9) by [@yungsters](https://github.com/yungsters)) -- Remove `Sample` and `CrashyCrash` Modules ([8ec7e0966c](https://github.com/facebook/react-native/commit/8ec7e0966cf83ed29a39aab47c686bc60a124983) by [@RSNara](https://github.com/RSNara)) -- Remove `propTypes` from Animated components. ([86d90c03eb](https://github.com/facebook/react-native/commit/86d90c03ebe39ebc4b2c6dcc0747b4f3a34f5f2f) by [@yungsters](https://github.com/yungsters)) -- Remove `propTypes` from TouchableHighlight. ([7c01172bef](https://github.com/facebook/react-native/commit/7c01172befd07f1d082b18993b87fc880e4b718f) by [@yungsters](https://github.com/yungsters)) -- Remove `propTypes` from TouchableNativeFeedback. ([2185dd298a](https://github.com/facebook/react-native/commit/2185dd298a788c2b713ea17878fd36e06205b4da) by [@yungsters](https://github.com/yungsters)) -- Remove `propTypes` from TouchableOpacity. ([88ae24f719](https://github.com/facebook/react-native/commit/88ae24f719d365b004696aff6461535188ca9f41) by [@yungsters](https://github.com/yungsters)) -- Remove `propTypes` from TouchableWithoutFeedback. ([ebf7d75816](https://github.com/facebook/react-native/commit/ebf7d758164873169937321a4dccc3782359a0d3) by [@yungsters](https://github.com/yungsters)) -- Remove `__skipSetNativeProps_FOR_TESTS_ONLY` from Animated components. ([dcd63078bd](https://github.com/facebook/react-native/commit/dcd63078bdab864830168005b940f638f1e08b23) by [@yungsters](https://github.com/yungsters)) -- Remove Apple TV Props ([548aad4ff1](https://github.com/facebook/react-native/commit/548aad4ff1dfef0d71bdd39aa83ad71e522a2546) by [@yungsters](https://github.com/yungsters)) - -#### Android specific - -- Remove `NativeRunnableDeprecated` ([973253af8a](https://github.com/facebook/react-native/commit/973253af8a47d9ebd137f554054e7a95f8ef2e45) by [@passy](https://github.com/passy)) -- Remove `com.facebook.react.modules.debug.NativeSourceCodeSpec` ([4d9e5f8481](https://github.com/facebook/react-native/commit/4d9e5f8481531000380cf4d3d485fcde1321a37b) by [@RSNara](https://github.com/RSNara)) - -### Fixed - -- Fix `require` cycle warning in ScrollResponder. ([674ac69cee](https://github.com/facebook/react-native/commit/674ac69cee7c1ce6096bee258880e79966322ee0) by [@Naturalclar](https://github.com/Naturalclar)) -- Restore behavior for `underlayColor={null}` in `TouchableHighlight`. ([37d8440a8e](https://github.com/facebook/react-native/commit/37d8440a8e35a53b81914e429502db527790b3cd) by [@yungsters](https://github.com/yungsters)) -- Fix stack traces showing the wrong function name in some cases ([60b4ba16c0](https://github.com/facebook/react-native/commit/60b4ba16c008c23959ebd27ea7215f83878d1343) by [@motiz88](https://github.com/motiz88)) -- Fix `requestAnimationFrame` when focusing input on mount ([5798cf2aa9](https://github.com/facebook/react-native/commit/5798cf2aa9b86bbcb40016aae14eca88fca19fde) by [@janicduplessis](https://github.com/janicduplessis)) -- Reduce overhead of setting up timers in DEV ([75a154b449](https://github.com/facebook/react-native/commit/75a154b4499e44b4ab31ccf28f9eb1dbf21578ac) by [@motiz88](https://github.com/motiz88)) -- Fixed an issue where margin and padding were resolved incorrectly. ([1d683faf1d](https://github.com/facebook/react-native/commit/1d683faf1dc89e4950e7e1f5c5a67f9a7ca1ee24) by [@SidharthGuglani](https://github.com/SidharthGuglani)) -- Fix using width for calculating margin top percent ([0599af2282](https://github.com/facebook/react-native/commit/0599af2282ffbf636604bce1cb4c049201fed393) by [@SidharthGuglani](https://github.com/SidharthGuglani)) -- Don't restore default values in NativeAnimated when components unmount ([686ab49107](https://github.com/facebook/react-native/commit/686ab49107df8ed20d4e810f1366715cd70b4a31) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix eslint-config peer dependency warnings ([1353da5a53](https://github.com/facebook/react-native/commit/1353da5a538d4a6f76fc9530711394cf981034a0) by [@friederbluemle](https://github.com/friederbluemle)) -- Remove style rules from eslint config for prettier options ([e4b62bb139](https://github.com/facebook/react-native/commit/e4b62bb139c258b65a9ebf2a8ee692ea52c3afab) by [@iRoachie](https://github.com/iRoachie)) -- Fix separators displays in wrong places with the inverted list ([dfb4f4af68](https://github.com/facebook/react-native/commit/dfb4f4af68726d2e05f63689a9c74c9bb9a0611b) by [@dy93](https://github.com/dy93)) -- Fix issue where we attempt to connect to React devtools every 2 seconds ([e7f6210d5d](https://github.com/facebook/react-native/commit/e7f6210d5d417c5b6d4ba7f5cf96b40dbf70b9cd) by [@ejanzer](https://github.com/ejanzer)) -- Fix so that early logs don't get dropped by Metro ([4ed05ca241](https://github.com/facebook/react-native/commit/4ed05ca241b791ad629fd154429a4a53c7731556) by [@gaearon](https://github.com/gaearon)) -- Fix to announce accessibility state changes happening in the background ([baa66f63d8](https://github.com/facebook/react-native/commit/baa66f63d8af2b772dea8ff8eda50eba264c3faf) by [@xuelgong](https://github.com/xuelgong)) -- Fix `JSBigString` not compiling on Windows due to Unix-specific headers ([80857f295c](https://github.com/facebook/react-native/commit/80857f295c17e5f8966b3d1c1207d3c4570a1b26) by [@empyrical](https://github.com/empyrical)) -- Fix exception in `scrollResponderScrollNativeHandleToKeyboard` when ref is null ([da8ae011bb](https://github.com/facebook/react-native/commit/da8ae011bbabc8acb7ef7f6903f68dd60aaa1f9d) by [@TheSavior](https://github.com/TheSavior)) -- Fix excessive toggles on the Switch component ([b782934f3f](https://github.com/facebook/react-native/commit/b782934f3f2a80ae7e3872cc7d7a610aa6680ec4) by [@rurikoaraki](https://github.com/rurikoaraki)) -- Fix bare hosts in `URL`. Add missing / between url ([20ab946f34](https://github.com/facebook/react-native/commit/20ab946f34b1d9727ff08c733b2006e84fd79349) by [@jeswinsimon](https://github.com/jeswinsimon)) -- Fix the non-standard usage of `ATOMIC_VAR_INIT` macro from code with systrace enabled ([75a7a52db4](https://github.com/facebook/react-native/commit/75a7a52db496bd3892a367372eea25bf50840fc3)) -- Fix `useWindowDimensions` hook firing continuously after dimensions change ([3b3c95b017](https://github.com/facebook/react-native/commit/3b3c95b0170e60983eb6e89b910d100d08eee141) by [@dulmandakh](https://github.com/dulmandakh)) -- Fix throttling in ScrollView ([4159e20146](https://github.com/facebook/react-native/commit/4159e201462c346c456de1fa869d88a9cce7b6d4) by [@sammy-SC](https://github.com/sammy-SC)) -- Fix `TimingAnimation` rounding error issue ([77b6e26538](https://github.com/facebook/react-native/commit/77b6e2653835af61b186903eae45d67f35351ade) by [@MartinSherburn](https://github.com/MartinSherburn)) -- Fix recycling of Switch ([a261e6dfb2](https://github.com/facebook/react-native/commit/a261e6dfb2680a955943db53c4b0a7bb887bfe22) by [@sammy-SC](https://github.com/sammy-SC)) - -#### Android specific - -- Fix to reset sMatrixDecompositionContext before applying transformations ([bf01dfbc97](https://github.com/facebook/react-native/commit/bf01dfbc97ea8be9d88214ab31809f2f42d6c064) by [@makovkastar](https://github.com/makovkastar)) -- Fix animations in OSS debug builds by modifying `Platform.isTesting()` behavior ([1fbc6a7c17](https://github.com/facebook/react-native/commit/1fbc6a7c178d13421b0b84d6ea01f9174105325f) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Fix Modal not disappearing when reloading ([5ddf00ee1a](https://github.com/facebook/react-native/commit/5ddf00ee1acbf66c7204227c398a58c13e4545cf) by [@sunnylqm](https://github.com/sunnylqm)) -- Fix to support nullable returns NativeModule methods returning Boxed Primitives ([f57b0caaa4](https://github.com/facebook/react-native/commit/f57b0caaa4452c64006c159cd28a1a562b332c21) by [@RSNara](https://github.com/RSNara)) -- Fix crash in TextInput ([6ebd3b046e](https://github.com/facebook/react-native/commit/6ebd3b046e5b71130281f1a7dbe7220eff95d74a) by [@MarcoPolo](https://github.com/MarcoPolo)) -- Fix View.getGlobalVisibleRect() to clip result rect properly when overflow is 'hidden' ([df9abf7983](https://github.com/facebook/react-native/commit/df9abf798351c43253c449fe2c83c2cca0479d80) by [@davidbiedenbach](https://github.com/davidbiedenbach)) -- Fix throwing "Unknown array type" exception ([4b9350061f](https://github.com/facebook/react-native/commit/4b9350061fa3d186fdd3a973e1b46f60a7ac03b9) by [@petterh](https://github.com/petterh)) -- Fix issue with refresh control not working properly on an inverted ScrollView ([0a282c42b4](https://github.com/facebook/react-native/commit/0a282c42b4d1c2316513cd5588a0a92b54db2991) by [@migbot](https://github.com/migbot)) -- Fix to listen to NFC actions for linking url events ([8d8c3d4e1e](https://github.com/facebook/react-native/commit/8d8c3d4e1eb88366074e87385c4d96a46dfdd544) by [@cimitan](https://github.com/cimitan)) -- Fix onPress prop for Touchable Components being called twice on AndroidTV. ([21890e964d](https://github.com/facebook/react-native/commit/21890e964df7674fcf13cefc8cb939441f6eddef) by [@dbarr33](https://github.com/dbarr33)) -- Fix `includeFontPadding` for `TextInput` placeholder ([211ea485cd](https://github.com/facebook/react-native/commit/211ea485cd993ca25d6640be41e54f327ca1629c) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix medium font weights for TextInput on Android ([8b9f790069](https://github.com/facebook/react-native/commit/8b9f7900697b2e4bb72b37ed2e6c3d113185d327) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix close button issue in KeyboardAvoidingView ([f1c6029e48](https://github.com/facebook/react-native/commit/f1c6029e4868084e5a10d81c15ee3cc5e301599a) by [@saxenanickk](https://github.com/saxenanickk)) -- Fix activity recreation on theme change ([83a16b16c9](https://github.com/facebook/react-native/commit/83a16b16c9afa0fe0328ab818470d4fce098876b) by [@Esemesek](https://github.com/Esemesek)) -- Fix ForwardingCookieHandler missing WebView exceptions. ([314eba98b2](https://github.com/facebook/react-native/commit/314eba98b2f2755cb26ed7a268d3fe83a7626efa) by [@siddhantsoni](https://github.com/siddhantsoni)) -- Fix ReactInstanceManagerBuilder.build crashing if SoLoader has not been explicitly initialized ([60e00d9d96](https://github.com/facebook/react-native/commit/60e00d9d96d7b186c1d4c1542caddc1b74eeb3da) by [@petterh](https://github.com/petterh)) -- Fix default accessibility hint not being read. ([f8dff0bcb3](https://github.com/facebook/react-native/commit/f8dff0bcb3147b7a1aa8ac7159952d848e198e29)) -- Fix JS bundle loading progress bar ([7b9d6d19e2](https://github.com/facebook/react-native/commit/7b9d6d19e2c0854aa53587ef68ce715fb7803e2a) by [@makovkastar](https://github.com/makovkastar)) -- Fix Android Q related NaN error - don't try to do math with NaN values ([db5994980d](https://github.com/facebook/react-native/commit/db5994980df136c5cce6cd90348b4bf18180562f)) -- Fix throwing exceptions when the host activity is not FragmentActivity ([7cfabf42b8](https://github.com/facebook/react-native/commit/7cfabf42b816de758d8e52896bbab0c50e3a802a) by [@mganandraj](https://github.com/mganandraj)) -- Fix crash when using `TextInput.FontVariant` prop in Android API level < 26 ([e885ddedb9](https://github.com/facebook/react-native/commit/e885ddedb9b0a025cb8031414dcc4bd22744a0eb) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific - -- Fix support for `onRequestClose` in Modal on iOS 13+ ([8e5fac89bb](https://github.com/facebook/react-native/commit/8e5fac89bbdcc3028bb5d81a358969a235abf991) by [@koke](https://github.com/koke)) -- Fix `Dimensions` module to update on initial split screen ([7a72c35a20](https://github.com/facebook/react-native/commit/7a72c35a20a18c19bf6ab883cb2c53a85bd4c5c0) by [@sahrens](https://github.com/sahrens)) -- Fix spinner visibility on `beginRefreshingProgrammatically` ([e341489521](https://github.com/facebook/react-native/commit/e341489521ad495e68e8aba01ff4dd25a5e4ff3e) by [@nnabinh](https://github.com/nnabinh)) -- Reconnect to debugger websocket after Metro is restarted. ([13992f90e4](https://github.com/facebook/react-native/commit/13992f90e48fc11e0b7217ee6d9413f97c32268a) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Fix Slider not disabling properly if the disabled prop is set. ([fa9ff07017](https://github.com/facebook/react-native/commit/fa9ff07017edbc76595fe2f2d964ee13c5f4088a)) -- Fix apps crashing on iOS 13.x when running timer in the background ([e1d03b4cc0](https://github.com/facebook/react-native/commit/e1d03b4cc00c361e10687eb4a9f902563cd1cbe1) by [@radko93](https://github.com/radko93)) -- Fix TextInput blur when tabbing in iOS simulator. ([a7437710d2](https://github.com/facebook/react-native/commit/a7437710d25adfc9150fc079e4525ed59d5404e2) by [@fat](https://github.com/fat)) -- Fix promised returned by `Share.share(content, options)` not resolving if share dialog dismissed ([7468a6c903](https://github.com/facebook/react-native/commit/7468a6c9033ffe8cc2315a3de3a759b8745fe43d) by [@v-fernandez](https://github.com/v-fernandez)) -- Fix maximum searching depth while measuring layout by removing it. ([2f8328dbb0](https://github.com/facebook/react-native/commit/2f8328dbb0d9813c904c0b888b2b7500cf4a4bce) by [@draws](https://github.com/dratwas)) -- Fix SafeAreaInsets call to not crash on older versions of iOS ([03acf57b76](https://github.com/facebook/react-native/commit/03acf57b767553acbee4ff589055fbd239ffffbb) by [@mmmulani](https://github.com/mmmulani)) -- Fix to retain `cropData` struct arg in ImageEditingManager.cropImage call ([002d3c179d](https://github.com/facebook/react-native/commit/002d3c179dd2515f0a4d894d9b7f70c4e538f728) by [@RSNara](https://github.com/RSNara))) -- Fix bug rendering nested text on iOS13 ([06599b3e59](https://github.com/facebook/react-native/commit/06599b3e594355a1d5062ede049ff3e333285516) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Fix longstanding bug where RCTNullIfNil() can return nil ([79b573511b](https://github.com/facebook/react-native/commit/79b573511bd55e6c82c0044e1930549ccfa8a923) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Fix crash in RCTScrollViewComponentView ([e7ef9921d3](https://github.com/facebook/react-native/commit/e7ef9921d3f91b02cfec4bbfd88b4968434e201c) by [@shergin](https://github.com/shergin)) -- Fix how the amount of free memory is calculated to mimic the logic Apple uses. ([b53d3d80f9](https://github.com/facebook/react-native/commit/b53d3d80f991937915a87ba8515f403551de139e)) -- Fix animated gifs incorrectly looping ([6f2e6f170e](https://github.com/facebook/react-native/commit/6f2e6f170e3ee785d1ba844971447ea24f91185e) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix `tintColor` in SegmentedControlIOS component ([be89e4d928](https://github.com/facebook/react-native/commit/be89e4d928a504de304f5afb19bd3cc15ae3eb7d) by [@sammy-SC](https://github.com/sammy-SC)) - -## v0.61.5 - -This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/151) to improve the quality of the 0.61 release. Thanks to everyone who contributed! - -### Fixes - -#### Android specific - -- Fix bundling assets in monorepo ([a3b0804867](https://github.com/facebook/react-native/commit/a3b08048674e324dbe1f0ca816f35607e9e06a2f) by [@Esemesek](https://github.com/Esemesek)) -- Fix multiple `set-cookie` not aggregated correctly in response headers ([1df8bd4932](https://github.com/facebook/react-native/commit/1df8bd4932f42958c01dccf44cee92b75a6988ed) by **Vincent Cheung**) - -## v0.61.4 - -This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/150) to improve the quality of the 0.61 release. Thanks to everyone who contributed! - -### Fixed - -- Fix build with Hermes on Windows ([81a6b6ed3c](https://github.com/facebook/react-native/commit/81a6b6ed3c54498f6f2148c106846352405949bf) by [@B27](https://github.com/B27)) -- Fix Chrome debugger showing console.logs at incorrect locations ([42ac240bce](https://github.com/facebook/react-native/commit/42ac240bceb104474494c6007df0089baec00f7a) by [@rickhanlonii](https://github.com/rickhanlonii)) - -#### iOS specific - -- Fix bug in iOS 13 when application would be terminated immediately when in background ([d7c9173b07](https://github.com/facebook/react-native/commit/d7c9173b07171164bcadf73855454e90e07b31be) by [@radko93](https://github.com/radko93)) - -## v0.61.3 - -This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/148) to improve the quality of the 0.61 release. Thanks to everyone who contributed! - -### Fixed - -- Fix bug where ScrollView contentInset top set to undefined wouldn't default to 0 ([d576a5bcc0](https://github.com/facebook/react-native/commit/d576a5bcc0e03dd9c4ccd982f723d6e376e5b680) by [TheSavior](https://github.com/TheSavior)) -- Fix TimingAnimation rounding error issue ([bfd01552af](https://github.com/facebook/react-native/commit/bfd01552af6c074a425da2e7cc1a5908faba2644) by [MartinSherburn](https://github.com/MartinSherburn)) - -#### iOS specific - -- Fix selecting videos from library in iOS 13 ([63769518e0](https://github.com/facebook/react-native/commit/63769518e0c7db60eb39bb5f47fe24f4bc664862) by [fatalsun](https://github.com/fatalsun)) -- Fix bug in iOS13 nested text rendering ([7cf43afa8d](https://github.com/facebook/react-native/commit/7cf43afa8d6a03ccb4cfdc09f81891eabe8b8b70) by [PeteTheHeat](https://github.com/PeteTheHeat)) - -#### Android specific - -- Release underlying resources when JS instance is GC'ed on Android try ([9b2374b542](https://github.com/facebook/react-native/commit/9b2374b542f87b7baefcfb4a3eb4f57029069b57) by [janicduplessis](https://github.com/janicduplessis)) - -## v0.61.2 - -This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/146) to improve the quality of the 0.61 release. Thanks to everyone who contributed! - -### Fixed - -#### Android specific - -- Fix elevation issues on Android ([8fd9ab2f54](https://github.com/facebook/react-native/pull/26682) by [@grabbou](https://github.com/grabbou)) - -### Added - -- Use `warnOnce` for excessive number of callbacks error ([0cafa0f5d1](https://github.com/facebook/react-native/commit/0cafa0f5d1e7fa5369b765f4b97f38bf1608230a) by [@janicduplessis](https://github.com/anicduplessis)) -- Include transform in OUTER_PROPS ([b94438](https://github.com/facebook/react-native/commit/b94438) by [@migbot](https://github.com/migbot)) - -#### iOS specific - -- Better iOS13 support in `StatusBar` API ([796b3a1f88](https://github.com/facebook/react-native/commit/796b3a1f8823c87c9a066ea9c51244710dc0b9b5) by [@gaodeng](https://github.com/gaodeng)) - -#### Android specific - -- Improve error message in NativeModuleRegistryBuilder ([113c4e229c](https://github.com/facebook/react-native/commit/113c4e229c374232c46a89afd74df7117a3447c1) by [@vonovak](https://github.com/vonovak)) - -## v0.61.1 - -This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/144) to improve the quality of the 0.60 release. Thanks to everyone who contributed! - -### Fixed - -#### iOS specific - -- Fix ShareSheet crash on iOS 13 ([a4fbb8e75b](https://github.com/facebook/react-native/commit/a4fbb8e75bd9f521037926a68a8b75eaca2eca74) by [@tomtargosz](https://github.com/tomtargosz)) - -#### Android specific - -- Allow again for injecting custom root view via ReactActivityDelegate ([9f0dede1c9](https://github.com/facebook/react-native/commit/9f0dede1c913612e1241432f4cbccdc74d23a1e4) by [@kmagiera](https://github.com/kmagiera)) - -## v0.61.0 - -This is a major release that includes the new reloading experience Fast Refresh. It also removes the React `.xcodeproj`, fixes `use_frameworks!` for CocoaPods support, adds a `useWindowDimensions` hook, and upgrades to React 16.9. - -### Added - -- Add Fast Refresh by default ([17f8e5810f](https://github.com/facebook/react-native/commit/17f8e5810f3260ce1b24c61665883bab8847aabe) by [@gaearon](https://github.com/gaearon)) -- Add `useWindowDimensions` hook to replace most `Dimensions` usage ([103ec2f770](https://github.com/facebook/react-native/commit/103ec2f770dbb785ef4bc26f8662c74edded796a) by [@sahrens](https://github.com/sahrens)) - -#### Android specific - -- Add exception in .gitignore for `debug.keystore` to the android template. ([d55025694b](https://github.com/facebook/react-native/commit/d55025694be8b4ee5d09c8fdc910d42a5f144883) by [@bondehagen](https://github.com/bondehagen)) -- Add jitpack repository to template ([1a92cf9b2a](https://github.com/facebook/react-native/commit/1a92cf9b2afa718a81299b4be5ab6bdff16f4863) by [@iyegoroff](https://github.com/iyegoroff)) - -#### iOS specific - -- Add RCTWeakProxy to properly deallocate RCTUIImageViewAnimated ([947e71a922](https://github.com/facebook/react-native/commit/947e71a922c0db5d3d3780d249d1a8d183534c22) by [@mmmulani](https://github.com/mmmulani)) - -### Changed - -- Use prettyFormat for Metro logging ([abd7faf354](https://github.com/facebook/react-native/commit/abd7faf3547e165abfc52383d3709b9d4d2e9006) by [@cpojer](https://github.com/cpojer)) -- Tweak messages and fix the warning condition ([2a3ac0429b](https://github.com/facebook/react-native/commit/2a3ac0429b0e4c443d185807a39b41fc5a2ab1d2) by [@gaearon](https://github.com/gaearon)) -- Allow jest globals in **mocks** directories ([e78c01375a](https://github.com/facebook/react-native/commit/e78c01375aef88e0bb4029479acac9e85ecaf080) by [@artdent](https://github.com/artdent)) -- Make Animation EndCallback type allow any return value ([306c8d64d9](https://github.com/facebook/react-native/commit/306c8d64d91f87b248f627333de7f24355248088) by [@draperunner](https://github.com/draperunner)) -- create two layout pass reason flexLayout and flexMeasure instead of flex ([6ce985463b](https://github.com/facebook/react-native/commit/6ce985463b2724451baed8b0486b298f969e36e7) by [@SidharthGuglani](https://github.com/SidharthGuglani)) -- Use shorthand for Fragment in App.js ([7cac6a4b6c](https://github.com/facebook/react-native/commit/7cac6a4b6cfa8c1b54db62f2b1510f7c52f4574d) by [@ferdicus](https://github.com/ferdicus)) -- Use eslint-plugin-prettier recommended config ([d2b92fffb1](https://github.com/facebook/react-native/commit/d2b92fffb1d14dd0ec628e9dcdfd76e39f2067ff) by [@Justkant](https://github.com/Justkant)) -- Support string command arguments ([0314305e12](https://github.com/facebook/react-native/commit/0314305e1202e48c74091e15da8574f1b92ce441) by [@TheSavior](https://github.com/TheSavior)) -- chore: Link to CLA wiki and CLA form. ([e2d55d5c5e](https://github.com/facebook/react-native/commit/e2d55d5c5ef40ccae3220dc0e1fca7cf3592c676) by [@JustinTRoss](https://github.com/JustinTRoss)) -- CLI is now ^3.0.0-alpha.1 ([5edd1c674c](https://github.com/facebook/react-native/commit/5edd1c674c911a6c59aaad8ed36ce12fa98787ff) by [@thymikee](https://github.com/thymikee)) -- Flow is now v0.104.0 ([59db059dbd](https://github.com/facebook/react-native/commit/59db059dbddb8101212f3739eecf0db494cfab41) by [@mroch](https://github.com/mroch)) -- React is now at 16.9 ([40e8a5f685](https://github.com/facebook/react-native/commit/40e8a5f685376300aa5365de4557cd395996b9a2), [0ccedf3964](https://github.com/facebook/react-native/commit/0ccedf3964b1ebff43e4631d1e60b3e733096e56) by [@TheSavior](https://github.com/TheSavior)) -- Use Metro for auto-collapsing internal stack frames ([77125a1ac3](https://github.com/facebook/react-native/commit/77125a1ac364a6b7e2382fdc86cc19a3e2eba089) by [@motiz88](https://github.com/motiz88)) -- Move React error message formatting into ExceptionsManager ([2dadb9e2b0](https://github.com/facebook/react-native/commit/2dadb9e2b0ba26223ed83a30af620ce3e62e245f) by [@motiz88](https://github.com/motiz88)) -- Improve VirtualizedList error message ([bef87b648c](https://github.com/facebook/react-native/commit/bef87b648c4bed228f1c5889abe0181a271edf76) by [@vonovak](https://github.com/vonovak)) - -#### Android specific - -- Bump Hermes to v0.2.1 ([811401bcac](https://github.com/facebook/react-native/commit/811401bcac02f3e6e154c7e0f76f9f82eeaa6959) by [@sunnylqm](https://github.com/sunnylqm)) -- Use centralized package for DoNotStrip annotation ([35fc0add2d](https://github.com/facebook/react-native/commit/35fc0add2d3a278bf90257284fe23e03898008de) by [@passy](https://github.com/passy)) - -#### iOS specific - -- Do not override ActivityIndicator color when setting its size ([14b0ed4c5d](https://github.com/facebook/react-native/commit/14b0ed4c5d872cd992f6e1ca072a2c44c8ece25f) by [@cabelitos](https://github.com/cabelitos)) -- fix display problems when image fails to load ([71d7d6883c](https://github.com/facebook/react-native/commit/71d7d6883cb9a3d18666f04a444de7b4a611b304)) -- Renamed yoga podspec to Yoga ([82a8080f07](https://github.com/facebook/react-native/commit/82a8080f0704e83079d0429e4e367f5131052e64) by [@axe-fb](https://github.com/axe-fb)) -- Update loading pre-bundled message ([eb92f8181f](https://github.com/facebook/react-native/commit/eb92f8181f3119bbc69ff7cb5aff2e03d993b8b3) by [@rickhanlonii](https://github.com/rickhanlonii)) - -### Deprecated - -- Deprecate method UIManagerModule.playTouchSound() ([e3ec8dbe15](https://github.com/facebook/react-native/commit/e3ec8dbe15a07e86530e1fd801c27ad8c1023b5c) by [@mdvacca](https://github.com/mdvacca)) -- Deprecate UIManager.measureLayoutRelativeToParent ([e42009b784](https://github.com/facebook/react-native/commit/e42009b7849f1cfd6d6d34e28c564ec5e39680bb) by [@mdvacca](https://github.com/mdvacca)) - -#### Android specific - -- DrawerLayoutAndroid drawerPosition now expects a string, number is deprecated ([305b0a2814](https://github.com/facebook/react-native/commit/305b0a28142414d559d2d08795a5963716dc4b0f) by [@TheSavior](https://github.com/TheSavior)) - -### Removed - -#### Android specific - -- Remove supportLibVersion variable in build.gradle ([fee7f0617e](https://github.com/facebook/react-native/commit/fee7f0617ee6e4f10edf6b8e36da6c5fb00d22ac) by [@ferdicus](https://github.com/ferdicus)) - -#### iOS Specific - -- Remove 's.static_framework = true' requirement for podspec ([ca9e108110](https://github.com/facebook/react-native/commit/ca9e108110e4a3cc39044805f879d9a9cb637c41) by [@jtreanor](https://github.com/jtreanor)) - -### Fixed - -- Add ErrorUtils to eslint globals ([76af5f9163](https://github.com/facebook/react-native/commit/76af5f916303d7906ea522076c965292145a1370) by [@rodineijf](https://github.com/rodineijf)) -- URL: Do not prepend baseUrl if the URL is not a relative URL ([e104204ae0](https://github.com/facebook/react-native/commit/e104204ae083d31e0b9967373ce79f2f1ca8fbb6) by [@jeswinsimon](https://github.com/jeswinsimon)) -- Memory Leak due to JSStringRelease not called ([b8d6ef3726](https://github.com/facebook/react-native/commit/b8d6ef372663fe6d467144abfc5d2c9352dc28d6) by [@sachinservicemax](https://github.com/sachinservicemax)) -- Fixed rotateZ native animation ([f4f08d3c54](https://github.com/facebook/react-native/commit/f4f08d3c549f2af7cd04ef78fe800d3bc12af1f0) by [@Titozzz](https://github.com/Titozzz)) -- Fix indentation in Gradle files ([9b0adb5ad1](https://github.com/facebook/react-native/commit/9b0adb5ad132b8ff37e707a4943411d92b4e58dc) by [@sonicdoe](https://github.com/sonicdoe)) -- Fix handling of failed image downloads ([71d7d6883c](https://github.com/facebook/react-native/commit/71d7d6883cb9a3d18666f04a444de7b4a611b304) by [@sammy-SC](https://github.com/sammy-SC)) -- Fix SectionList scrollToLocation and prevent regressions ([8a82503b54](https://github.com/facebook/react-native/commit/8a82503b54e3c63230a07de99ec082b2dcb54bc7) by [@vonovak](https://github.com/vonovak)) -- [General][internal] Fix incorrect `module.name_mapper` in template .flowconfig ([e6b2cf0418](https://github.com/facebook/react-native/commit/e6b2cf04188fc9647bae4bef4cca5d4dde22a657) by [@MoOx](https://github.com/MoOx)) -- Fall back to `JSON.stringify` in `console.log` if Symbol is unavailable ([179889704b](https://github.com/facebook/react-native/commit/179889704b6f9d56cb990d5b9bba6ee5ea2cd13f) by [@cpojer](https://github.com/cpojer)) -- Pop frames correctly in console.error handler ([3eaf245540](https://github.com/facebook/react-native/commit/3eaf2455402b5ad73c8a059311f0cb213df9dd28) by [@motiz88](https://github.com/motiz88)) -- Add documentation to TextInput's Flow types ([d00f0882fb](https://github.com/facebook/react-native/commit/d00f0882fbdd532f8698d2569bd771ca5843d0f5) by [@empyrical](https://github.com/empyrical)) - -#### Android specific - -- Add missing Hermes include ([1db96a3c46](https://github.com/facebook/react-native/commit/1db96a3c469b872e851553207e5420d54afc731a) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix UIManager.measure to consider scale and rotation transforms ([28d50189f3](https://github.com/facebook/react-native/commit/28d50189f3350e7550bf03ea5bd1363839ee2911) by [@floriancargoet](https://github.com/floriancargoet)) - -#### iOS specific - -- Fixed iOS packager connection ([4ab9da134c](https://github.com/facebook/react-native/commit/4ab9da134c988db832b1a2daa90ce38bf8c419eb) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fixed compatibility with CocoaPods frameworks. ([8131b7bb7b](https://github.com/facebook/react-native/commit/8131b7bb7b4794e0e7003a6e3d34e1ebe4b8b9bc) by [@jtreanor](https://github.com/jtreanor)) -- Don't call sharedApplication in App Extension ([c5ea18f738](https://github.com/facebook/react-native/commit/c5ea18f7389fe821e7a9882e4b1b30b0a1b266f4) by [@zhongwuzw](https://github.com/zhongwuzw)) - -## v0.60.6 - -This is a small patch release with a commit to fix the build break in MSVC to help the users of react-native-windows. ([9833ee7bc1](https://github.com/facebook/react-native/commit/9833ee7bc19982acd6ccaf6ac222bc24a97667a8) by [@acoates-ms](https://github.com/acoates-ms)) - -## v0.60.5 - -This is a patch release that consist of a few commits requested in the [dedicated conversation](https://github.com/react-native-community/releases/issues/130) to improve the quality of the 0.60 release. Thanks to everyone who contributed! - -### Added - -- Added a default Prettier config for new projects ([7254bab0b3](https://github.com/facebook/react-native/commit/7254bab0b3fa129cd238783ab993fbae1102d60a) by [@jpdriver](https://github.com/jpdriver)) - -#### Android specific - -- Add showSoftInputOnFocus to TextInput ([d88e4701fc](https://github.com/facebook/react-native/commit/d88e4701fc46b028861ddcfa3e6ffb141b3ede3d)) - -### Changed - -- Bump CLI to ^2.6.0 ([fafe5ee072](https://github.com/facebook/react-native/commit/fafe5ee0726061e3590b91d3b5cff04e33781f87) by [@thymikee](https://github.com/thymikee)) - -### Fixed - -- Ensure right version of Metro bundler is used ([1bb197afb1](https://github.com/facebook/react-native/commit/1bb197afb191eab134354386700053914f1ac181) by [@kelset](https://github.com/kelset)) - -#### Android specific - -- Fix `ClassNotFound` exception in Android during Release builds ([ffdf3f22c6](https://github.com/facebook/react-native/commit/ffdf3f22c68583fe77517f78dd97bd2e97ff1b9e) by [@thecodrr](https://github.com/thecodrr)) -- Remove unnecessary flag when running JS server ([a162554f5d](https://github.com/facebook/react-native/commit/a162554f5dc36fa0647b5bf52119a62bd20046e3) by [@thecodrr](https://github.com/thecodrr)) -- Correctly set the border radius on android ([b432b8f13b](https://github.com/facebook/react-native/commit/b432b8f13b4871dcafd690e57d37298662712b50) by [@cabelitos](https://github.com/cabelitos)) -- Fix addition of comma at the end of accessibility labels on Android. ([812abfdbba](https://github.com/facebook/react-native/commit/812abfdbba7c27978a5c2b7041fc4a900f3203ae) by [@marcmulcahy](https://github.com/marcmulcahy)) - -#### iOS specific - -- Don't call sharedApplication in App Extension ([c5ea18f738](https://github.com/facebook/react-native/commit/c5ea18f7389fe821e7a9882e4b1b30b0a1b266f4) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Delete fishhook ([46bdb4161c](https://github.com/facebook/react-native/commit/46bdb4161c84b33f1d0612e9c7cdd824462a31fd) by [@mmmulani](https://github.com/mmmulani)) - -You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/130). - -## v0.60.4 - -This is a patch release that contains two more Hermes related fixes, thanks to the contributors for helping improving the support! - -### Fixed - -#### Android specific - -- Generate correct source map if hermes not enabled ([b1f81be4bc](https://github.com/facebook/react-native/commit/b1f81be4bc21eb9baa39dd7ef97709d9927ad407) by [@HazAT](https://github.com/HazAT)) -- Generate source maps outside of assets/ ([60e75dc1ab](https://github.com/facebook/react-native/commit/60e75dc1ab73b2893ec2e25c0320f32b3cf12b80) by [@motiz88](https://github.com/motiz88)) - -You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/130). - -## v0.60.3 - -This is a patch release that fixes the binary path to Hermes package, thanks to [@zoontek](https://github.com/zoontek)) for creating the PR! - -You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/130). - -## v0.60.2 - -This is a patch release that fixes the path to Hermes package. - -You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/130). - -## v0.60.1 - -This is a patch release that includes the Hermes JavaScript Engine announced at Chain React Conf 2019. - -Check out the documentation to opt-in and give [Hermes a try](https://reactnative.dev/docs/hermes). - -You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/130). - -## v0.60.0 - -This feature release of React Native includes many milestone changes for the platform. Please refer to the [blog post](https://reactnative.dev/blog/2019/07/03/version-60) for selected details. For upgrading users, some of the progress comes with breaking changes; manual intervention may be required for your app. We're also aware that existing CocoaPods integrations using `use_frameworks` are not out-of-the-box compatible with this version, but please consider [various workarounds](https://github.com/facebook/react-native/issues/25349) while we prepare a long-term solution for a future release. If you're interested in helping evaluate our next release (0.61), subscribe to the dedicated issue [here](https://github.com/react-native-community/react-native-releases/issues/130). - -Have you ever considered contributing to React Native itself? Be sure to check out [Contributing to React Native](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md). - -### Added - -- CLI autolinking support ([5954880875](https://github.com/facebook/react-native/commit/5954880875d8dfb9b7868aa316647f8fe2b3d8c3), [da7d3dfc7d](https://github.com/facebook/react-native/commit/da7d3dfc7d3bd83e7522175a720b30fee4c9b3d3) by [@zhongwuzw](https://github.com/zhongwuzw) and [@hramos](https://github.com/hramos)) -- New Intro screen ([6b393b27e1](https://github.com/facebook/react-native/commit/6b393b27e18e663d39b66fd121ee302bce29d77d), [233fddbe01](https://github.com/facebook/react-native/commit/233fddbe012098dce3719ba066d3dc653e05e6c9), [fe88e9e48c](https://github.com/facebook/react-native/commit/fe88e9e48ce99cb8b9da913051cc36575310018b), [aa926e349b](https://github.com/facebook/react-native/commit/aa926e349b1656b02b8c1a2048cc56b25f9567c1), [a9e8a71e53](https://github.com/facebook/react-native/commit/a9e8a71e531510baf126780cecdcbc64c934f4dd), [ad4a5d9a3e](https://github.com/facebook/react-native/commit/ad4a5d9a3eac9794038e93158d45e7f1ceb9e495), and [0245fd713e](https://github.com/facebook/react-native/commit/0245fd713ea9ff6fe334980f537e2254a9e3126c) by [@cpojer](https://github.com/cpojer), [@eliperkins](https://github.com/eliperkins), [@lucasbento](https://github.com/lucasbento), [@orta](https://github.com/orta), [@adamshurson](https://github.com/adamshurson), [@karanpratapsingh](https://github.com/karanpratapsingh) and [@glauberfc](https://github.com/glauberfc)) -- Add enhanced accessibility actions support ([7fb02bd908](https://github.com/facebook/react-native/commit/7fb02bd90884f0a717e8151d4d30767fe38392c1) by [@xuelgong](https://github.com/xuelgong)) -- Add additional accessibility roles and states ([1aeac1c625](https://github.com/facebook/react-native/commit/1aeac1c62528004d994200664368dc85fba1795d)) -- Add `isReduceMotionEnabled()` plus `reduceMotionChanged` to `AccessibilityInfo` ([0090ab32c2](https://github.com/facebook/react-native/commit/0090ab32c2aeffed76ff58931930fe40a45e6ebc) by [@estevaolucas](https://github.com/estevaolucas)]) -- Add support for cancelling fetch requests with `AbortController` ([h5e36b0c](https://github.com/facebook/react-native/commit/5e36b0c6eb2494cefd11907673aa018831526750) by [@janicduplessis](https://github.com/janicduplessis)) - -#### Android specific - -- Enable views to be nested within **Text**; this brings feature parity to Android, but be aware that it [has some limitations](https://github.com/facebook/react-native/commit/a2a03bc68ba062a96a6971d3791d291f49794dfd) ([5c399a9f74](https://github.com/facebook/react-native/commit/5c399a9f74f22c58c11f75abde32ac7dc269ccc0) by [@rigdern](https://github.com/rigdern)) -- Add a `touchSoundDisabled` prop to **Button**, **Touchable**, and **TouchableWithoutFeedback** ([45e77c8324](https://github.com/facebook/react-native/commit/45e77c8324f7dc2d53109e45a4e0b18cbab6a877) by [@yurykorzun](https://github.com/yurykorzun)) - -#### iOS specific - -- Add `announceForAccessibility` and `announcementFinished` APIs for making screen reader announcements ([cfe003238a](https://github.com/facebook/react-native/commit/cfe003238ab8c5686d185f6ce9e0776eeb4bb729) by [@rigdern](https://github.com/rigdern)) -- Ability to force network requests to use WiFi using the `allowsCellularAccess` property. This can ensure that network requests are sent over WiFi if communicating with a local hardware device and is accomplished by setting a flag. Default behavior of allowing network connections over cellular networks when available is unchanged. ([01c70f2fb9](https://github.com/facebook/react-native/commit/01c70f2fb9e8ac78a4d0cbd016d4de47316fe4d1) and [916186a7e6](https://github.com/facebook/react-native/commit/916186a7e6c43b1a1c68652ab82862bcd8fb1e01) by [@bondparkerbond](https://github.com/bondparkerbond)and [@zhongwuzw](https://github.com/zhongwuzw)) -- `$RN_CACHE_DIR` can now be used to manually specify the iOS build cache directory ([845eee403e](https://github.com/facebook/react-native/commit/845eee403e1cd3cb36935ef142f411f2b5075346) by [@hramos](https://github.com/hramos)) - -### Changed - -- _BREAKING_ Migrated to AndroidX; please see [this thread](https://github.com/react-native-community/discussions-and-proposals/issues/129#issuecomment-503829184) for more details on this change -- Cleanup **RedBox** message and stack output; it's now far easier to understand ([49d26eb0c4](https://github.com/facebook/react-native/commit/49d26eb0c4aeb611c6cb37a568708afa67b48c18) by [@thymikee](https://github.com/thymikee)) -- Add default `scrollEventThrottle` value to **Animated.FlatList** and **Animated.SectionList**; this now behaves consistently with **Animated.ScrollView** ([933e65e245](https://github.com/facebook/react-native/commit/933e65e245b30f7dc5a26aa51881153fb7c3628e) by [@janicduplessis](https://github.com/janicduplessis)) -- Remove invariant on nested sibling **VirtualizedLists** without unique listKey props; they now trigger a **RedBox** ([af5633bcba](https://github.com/facebook/react-native/commit/af5633bcba224f71f035ba4214a93b69723c9b93)) -- **FlatList** and **VirtualizedList**'s default `keyExtractor` now checks `item.id` and `item.key` ([de0d7cfb79](https://github.com/facebook/react-native/commit/de0d7cfb79c7f4011d4b6748b1afc656d33fd5ac) by [@sahrens](https://github.com/sahrens)) -- **SectionList**'s `scrollToLocation` on iOS now counts `itemIndex` like Android; both platforms are now consistent, and the `itemIndex` value 0 now represents scrolling to the first heading ([248a108abf](https://github.com/facebook/react-native/commit/248a108abf206b7ae32208537f0b73a8192a4829) by [@vonovak](https://github.com/vonovak)) -- Slightly speedup core initialization by moving native version check to DEV only ([5bb2277245](https://github.com/facebook/react-native/commit/5bb22772452e49dbcfbf183f6ebeee4576e67947) by [@mmmulani](https://github.com/mmmulani)) -- `react` is now at v16.8.6 ([53cec2dc1f](https://github.com/facebook/react-native/commit/53cec2dc1f1f5d143d0bb9752629b72350ebd112), [ee681b72ce](https://github.com/facebook/react-native/commit/ee681b72ce89539e5764ed59e5dfea4fab04d48c), and [6001acb319](https://github.com/facebook/react-native/commit/6001acb319958242f8d8e2dd40cb91a55b5eab2e) by [@kelset](https://github.com/kelset), [@mdvacca](https://github.com/mdvacca), [@gaearon](https://github.com/gaearon)) -- `react-native-community/cli` is now at v2.0.0 (by [@thymikee](https://github.com/thymikee)) -- `flow` is now at v0.98 ([0e1dfd4369](https://github.com/facebook/react-native/commit/0e1dfd436917a78a09da7b57a0b50397e6a0b6e1) by [@nmote](https://github.com/nmote)) -- `prettier` is now at v1.17.0 ([ff9f8f347d](https://github.com/facebook/react-native/commit/ff9f8f347d71630664dc3da1e8be0425799c0ce0)) -- `metro` packages are now at v0.54.1 ([7ff3874ec0](https://github.com/facebook/react-native/commit/7ff3874ec060bce568537a2238aea2c888e6e13f), [343f0a1d50](https://github.com/facebook/react-native/commit/343f0a1d50662aa37ef0b26d5436b2a0b40fbabb) by [@motiz88](https://github.com/motiz88)) -- Replace patched fetch polyfill with `whatwg-fetch@3.0` ([bccc92dfdd](https://github.com/facebook/react-native/commit/bccc92dfdd2d85933f2a9cb5c8d1773affb7acba) by [@janicduplessis](https://github.com/janicduplessis)) - -#### Android specific - -- Use class canonical name for `PARTIAL_WAKE_LOCK` tag ([88dbb4558c](https://github.com/facebook/react-native/commit/88dbb4558cd10f129f2c31e3b0b872924aba5416) by [@timwangdev](https://github.com/timwangdev)) - -#### iOS specific - -- _BREAKING_: Split React.podspec into separate podspecs for each Xcode project; your libraries will need to update for this change as well to avoid CocoaPods build errors ([2321b3fd7f](https://github.com/facebook/react-native/commit/2321b3fd7f666ce30f5dad4cd2673ddf22972056) by [@fson](https://github.com/fson)) -- Improve handling of native module exceptions; they are now propagated to crash reporting tools with the context and callstack ([629708beda](https://github.com/facebook/react-native/commit/629708bedae65a30e39d234da6b04d6fa101a779) by [@pvinis](https://github.com/pvinis)) -- Switch **Slider** `onSlidingComplete` event to a non-bubbling event on iOS to match Android ([7927437a6d](https://github.com/facebook/react-native/commit/7927437a6d5d63de2424d43d58085291c1067091) by [@rickhanlonii](https://github.com/rickhanlonii)) - -### Deprecated - -- **StatusBar** is no longer deprecated; thank you for the feedback ([a203ebe206](https://github.com/facebook/react-native/commit/a203ebe2062b3c12f85783f46030971f3aa5db1d) by [@cpojer](https://github.com/cpojer)) - -### Removed - -- **NetInfo** has been removed; its replacement is now available via the [react-native-community/netinfo](https://github.com/react-native-community/react-native-netinfo) package ([5a30c2a205](https://github.com/facebook/react-native/commit/5a30c2a2052ba76e88dbf71b5b5c92966591bf26) by [@cpojer](https://github.com/cpojer)) -- **WebView** has been removed; its replacement is now available via the [react-native-community/webview](https://github.com/react-native-community/react-native-webview) package ([](https://github.com/facebook/react-native/commit/6ca438a7f4bd7e6b317f0461aebbd5a7186151ed), [1ca9a95537](https://github.com/facebook/react-native/commit/1ca9a9553763a89c977f756b45486f8b9cedab80), and [954f715b25](https://github.com/facebook/react-native/commit/954f715b25d3c47c35b5a23ae23770a93bc58cee) by [@cpojer](https://github.com/cpojer) and [@thorbenprimke](https://github.com/thorbenprimke)) -- **Geolocation** has been removed; its replacement is now available via the [react-native-community/geolocation](https://github.com/react-native-community/react-native-geolocation) package ([17dbf98884](https://github.com/facebook/react-native/commit/17dbf988845bb7815dbb6182218c8c28d027fb91) and [9834c580af](https://github.com/facebook/react-native/commit/9834c580af654366bf0d38b78cd2694b0a0c477f) by [@cpojer](https://github.com/cpojer) and [@mmmulani](https://github.com/mmmulani)) - -### Fixed - -- Fix `Animated.Value` value after animation if component was re-mounted ([b3f7d53b87](https://github.com/facebook/react-native/commit/b3f7d53b87413abdf302c521114e4d77aa92e07f) by [@michalchudziak](https://github.com/michalchudziak)) -- Consistent reporting native module name on crash on native side ([fdd8fadea8](https://github.com/facebook/react-native/commit/fdd8fadea84f475714a16b6f0ec433f898d09558) and [b79d7db9db](https://github.com/facebook/react-native/commit/b79d7db9dbf588085b29274e507d34438e2e2595) by [@DimitryDushkin](https://github.com/DimitryDushkin)) -- Handle null filenames in symbolicated stack trace gracefully in **ExceptionsManager** ([2e8d39bed7](https://github.com/facebook/react-native/commit/2e8d39bed70e2e5eeddeb2dc98155bf70f9abebd) by [@motiz88](https://github.com/motiz88)) -- Fix HasteImpl platform name regex ([28e0de070d](https://github.com/facebook/react-native/commit/28e0de070d2dae9a486ab5915b6fd76723bd84ef) by [@CaptainNic](https://github.com/CaptainNic)) -- Fix a JS memory leak in Blob handling; this resolves multiple leaks around `fetch` ([05baf62721](https://github.com/facebook/react-native/commit/05baf6272143667694585a14fb59657fdc93c3b1) and [9ef5107d04](https://github.com/facebook/react-native/commit/9ef5107d04da374fc566d8b296572ddd992419f0) by [@janicduplessis](https://github.com/janicduplessis)) -- **SectionList**'s `scrollToLocation` now scrolls to the top of the sticky header as expected ([d376a444e3](https://github.com/facebook/react-native/commit/d376a444e318beabd8ebe9ccb41ffc300e12ea76) by [@danilobuerger](https://github.com/danilobuerger)) - -#### Android specific - -- Fix duplicate resource error in Android build ([962437fafd](https://github.com/facebook/react-native/commit/962437fafd02c936754d1e992479056577cafd05) and [eb534bca58](https://github.com/facebook/react-native/commit/eb534bca58a89ae306010626a8bdae92c23b8784) by [@mikehardy](https://github.com/mikehardy) and [@Dbroqua](https://github.com/Dbroqua)) -- Reorder operations of native view hierarchy ([5f027ec64d](https://github.com/facebook/react-native/commit/5f027ec64d6764fbbb9813fabb373194dec79db7) by [@lunaleaps](https://github.com/lunaleaps)) -- Fix performance regression from new custom fonts implementation ([fd6386a07e](https://github.com/facebook/react-native/commit/fd6386a07eb75a8ec16b1384a3e5827dea520b64) by [@dulmandakh](https://github.com/dulmandakh)) -- Fix internal test case around disabled state of buttons ([70e2ab2ec9](https://github.com/facebook/react-native/commit/70e2ab2ec9a1df60b39987946af18cac8621b3b0)) -- Fix extra call of **PickerAndroid**'s `onValueChange` on initialization; now it is only called when `selectedValue` changes ([82148da667](https://github.com/facebook/react-native/commit/82148da6672e613f34ffb48133cdefc235418dea) by [@a-c-sreedhar-reddy](https://github.com/a-c-sreedhar-reddy)) -- Fix **PickerAndroid** will reset selected value during items update ([310cc38a5a](https://github.com/facebook/react-native/commit/310cc38a5acb79ba0f1cda22913bd1d0cb296034) by [@Kudo](https://github.com/Kudo)) -- Fix unexpected PARTIAL_WAKE_LOCK when no headless tasks registered. ([bdb1d4377e](https://github.com/facebook/react-native/commit/bdb1d4377e47c6cd49ff619134d4860519a3cb0c) by [@timwangdev](https://github.com/timwangdev)) -- Fix calling **TextInput**'s `onKeyPress` method when the user types an emoji ([a5c57b4ed4](https://github.com/facebook/react-native/commit/a5c57b4ed4965ac4bb231399fd145da8095cece3)) -- Fix value of **TextInput**'s `onSelectionChange` start and end arguments by normalizing them ([2ad3bb2e2d](https://github.com/facebook/react-native/commit/2ad3bb2e2d62ffb780bab020f645626a16dd3b4a) by [@uqmessias](https://github.com/uqmessias)) -- In `Linking.getInitialURL` method, use the `InteractionManager` to wait for the current activity to finish initializing ([c802d0b757](https://github.com/facebook/react-native/commit/c802d0b757912358d703d4d8a114073377a905b9) by [@mu29](https://github.com/mu29)) -- Disable delta bundles on the first app run ([e4aff423ac](https://github.com/facebook/react-native/commit/e4aff423ac0421f4af7b9a111e5ad954f489da19) by [@wojteg1337](https://github.com/wojteg1337)) -- In **DatePickerAndroid**, work around Android Nougat bug displaying the wrong the spinner mode ([bb060d6cf8](https://github.com/facebook/react-native/commit/bb060d6cf89500778bba27d1da5925e2623c7a99) by [@luancurti](https://github.com/luancurti)) -- Fix crash in Animated Interpolation when inputMin === inputMax ([7abfd23b90](https://github.com/facebook/react-native/commit/7abfd23b90db08b426c3c91b0cb6d01d161a9b9e) by [@olegbl](https://github.com/olegbl)) -- Fix symbolication for **RedBox** and **YellowBox** when using delta bundling ([a05e9f8e09](https://github.com/facebook/react-native/commit/a05e9f8e094b25cc86ee297477cccafc3be5ef52) by [@motiz88](https://github.com/motiz88)) -- Fix **CameraRoll** crash on mime type guessing ([ebeb893b50](https://github.com/facebook/react-native/commit/ebeb893b50b4aa1ad77bdb203e4f8faed75db43a) by [@Sroka](https://github.com/Sroka)) - -#### iOS specific - -- Call designated initializer for SurfaceHostingProxyRootView ([3c125e867f](https://github.com/facebook/react-native/commit/3c125e867f52efd7f18b2bd8c9a21b246afcd788) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix **RedBox** JS symbolication when adding JS engine tag to the message ([920632cadb](https://github.com/facebook/react-native/commit/920632cadb108ceeacad93e9316e706608df2942) by [@motiz88](https://github.com/motiz88)) -- Fix **TextInput**'s `onSelectionChange` behavior in single line text inputs ([0c11d8d9b4](https://github.com/facebook/react-native/commit/0c11d8d9b4edf7830255f5b016d0ba7ef72ae827) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix accessibility problem with **TextInput** Clear Button ([4e37d37cbf](https://github.com/facebook/react-native/commit/4e37d37cbff27e61659440094a662e00eafd8fc4) by [@shergin](https://github.com/shergin)) -- Fix `renderingMode` not applied to GIF **Image**s ([75380aa329](https://github.com/facebook/react-native/commit/75380aa3296210777dc0be70a722701767276117) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix **ScrollView** `centerContent` not work in some cases ([2cdf9694b5](https://github.com/facebook/react-native/commit/2cdf9694b56e76477dde572eb3dc38be31361eab) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix crash on performance logger ([5d3d3987d8](https://github.com/facebook/react-native/commit/5d3d3987d8a81b84d43dc88808d7f50c7bf11d19) by [@zhigang1992](https://github.com/zhigang1992)) -- Do not run packager in Release mode ([4ea6204111](https://github.com/facebook/react-native/commit/4ea62041118fb031d7540726df2d29185c6b130d) by [@lucasbento](https://github.com/lucasbento)) -- Fix `code` and `reason` arguments being ignored when calling `WebSocket.close` ([0ac2171c54](https://github.com/facebook/react-native/commit/0ac2171c549b389228c4a37ae645eb0d9813b82d) by [@jeanregisser](https://github.com/jeanregisser)) -- Fix return value of `Linking.openURL()` ([4a5d0bdbd7](https://github.com/facebook/react-native/commit/4a5d0bdbd75c433d2f51f160657a0ad91e440272) by [@thib92](https://github.com/thib92)) -- When an accessibilityLabel can't be discerned, return `nil` instead of `@""` ([d4ff5ed258](https://github.com/facebook/react-native/commit/d4ff5ed258b75fe77c5d801af7b097b04fcd3690) by [@sammy-SC](https://github.com/sammy-SC)) -- Fix Xcode build when the project's path contains whitespace ([f0770b6b37](https://github.com/facebook/react-native/commit/f0770b6b370f483fdd729bdba04069cc783353dc)) -- Move accessibility props to UIView+React ([9261035c2b](https://github.com/facebook/react-native/commit/9261035c2bf2fe9522806fb1c535a1835e7acfa2) by [@janicduplessis](https://github.com/janicduplessis)) - -## v0.59.10 - -This is likely the last patch release for version 59 of React Native for the foreseeable future: it contains an important Android side update for the JavaScript Core, to prevent a great number of crashes mostly related to Samsung devices - thanks to [@Kudo](https://github.com/Kudo) for his work on fixing this via [557989a86f](https://github.com/facebook/react-native/commit/557989a86f8730113393ed229927d607a478e524)! - -Thanks everyone who participated in the [discussion](https://github.com/react-native-community/releases/issues/127). - -## v0.59.9 - -This is a patch fix release addressing a couple ScrollView regressions, and "future-proof" RN 59 from crashes caused by upgrading Gradle (now can support up to 5.4.1 & 3.4.0 for the plugin) and Xcode 11 Beta 1. You can upgrade to this version without upgrading your tooling. - -Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/124) for cherry-picking commits. You can participate to the conversation for the next patch release in the dedicated [issue](https://github.com/react-native-community/react-native-releases/issues/127). - -### Changed - -- If `isInteraction` is not specified in the config, it would always default to `true` which would block interactions like VirtualizedList updates. This is generally not what you want with useNativeDriver since the animation won't be interrupted by JS. If something does end up interfering with an animation and causes frame drops, `isInteraction` can be set manually. ([8f186b84ae](https://github.com/facebook/react-native/commit/8f186b84aeeb2613bf6ae08f20a8547d40179007) by [@sahrens](https://github.com/sahrens)) - -- Update detox to match master ([c6a5c09e2b](https://github.com/facebook/react-native/commit/c6a5c09e2b330891242af5c0b3ed7875f32c189e) by [@kelset](https://github.com/kelset)) - -#### Android specific - -- Bump Gradle to 5.4.1 & Android Gradle plugin to 3.4.0 ([b4017a9923](https://github.com/facebook/react-native/commit/b4017a9923b09fed4b693a8e4cfadd30ce34c88d), [d9f5a9dc16](https://github.com/facebook/react-native/commit/d9f5a9dc16f68cecc995bf8ba64fb726e397fadf), [30348f7899](https://github.com/facebook/react-native/commit/30348f789946dc99f5ccd02c85c8decbdb9ac29b), [6976a93126](https://github.com/facebook/react-native/commit/6976a931266126f249458a099bfaf509f9d81a05) by [@dulmandakh](https://github.com/dulmandakh)) - -### Fixed - -- Fixes wrong time unit of scroll event throttle ([1148c03f6f](https://github.com/facebook/react-native/commit/1148c03f6f51329710e23fba99a6916fff3ba42c) by [@zhongwuzw](https://github.com/zhongwuzw)) - -#### Android specific - -- Fix indexed RAM bundle ([d8fa1206c3](https://github.com/facebook/react-native/commit/d8fa1206c3fecd494b0f6abb63c66488e6ced5e0) by [@dratwas](https://github.com/dratwas)) - -#### iOS specific - -- Fix Xcode 11 Beta 1 builds ([46c7ada535](https://github.com/facebook/react-native/commit/46c7ada535f8d87f325ccbd96c24993dd522165d) by [@ericlewis](https://github.com/ericlewis)) - -## v0.59.8 - -This is a patch fix release addressing regressions, crashes, and a few developer-experience pain points (in particular, check the `KeyboardAvoidingView` change). Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/118) for cherry-picking commits. - -### Fixed - -- Fix regexp on `hasteImpl` ([bcd1e2](https://github.com/facebook/react-native/commit/28e0de070d2dae9a486ab5915b6fd76723bd84ef) by [@CaptainNic](https://github.com/CaptainNic)) -- Fix sparse array handling in `EventEmitter#listeners()` ([f68dc8](https://github.com/facebook/react-native/commit/f68dc8) by [@ide](https://github.com/ide)) -- Fix **VirtualizedList** to call `_updateViewableItems` immediately ([08141e](https://github.com/facebook/react-native/commit/efe6a0f0b56191907e8f13be2aee28fe1dcdf555) by [@sahrens](https://github.com/sahrens)) -- Fix prop overrides of **TouchableWithoutFeedback** ([0c4206](https://github.com/facebook/react-native/commit/68825f9ca5a6c8c70390e8499d9663c5be475639) by [@aleclarson](https://github.com/aleclarson)) -- Fix resolve relative size rendering error in inspector ([4884ab](https://github.com/facebook/react-native/commit/972ee2edbd4e1c4201da1606bf5a4c5add9f0083) by [@gandreadis](https://github.com/gandreadis)) -- Fix **VirtualizedSectionList** by making sure to check array bounds ([54f91d](https://github.com/facebook/react-native/commit/929908f28728c217ab4a16c8596e0957295f4d67) by [@vonovak](https://github.com/vonovak)) -- Update `_scrollAnimatedValue` offset of **ScrollView** ([e0d1b3](https://github.com/facebook/react-native/commit/58c956768af75047b2acdca429a28945a6a8b8c0) by [@miyabi](https://github.com/miyabi)) -- Fix infinite `setState` in **VirtualizedList** ([c40a93](https://github.com/facebook/react-native/commit/88787b5e7a7f6dd9c3b258b9dfb60b93ca5a5cea) by [@sahrens](https://github.com/sahrens)) - -#### iOS specific - -- Fix incorrect opacity behavior for **Text** component ([f71357](https://github.com/facebook/react-native/commit/d99e657e3909ff14cd623d1df7d3d13056fdd851) by [@shergin](https://github.com/shergin)) -- Fix **Text** shadow displays when `text Offset` is `{0,0}` ([17a81b](https://github.com/facebook/react-native/commit/9b63b50ad562c8567336898c7511a9a5198a4d6b) by [@Woodpav](https://github.com/Woodpav)) -- Add convert compatible of **NSString** for bridge message data ([c37e9c](https://github.com/facebook/react-native/commit/ffa3b0d4d601fe6788319a7cfd4185b8e4bf462f) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix nullability warnings in **RCTExceptionsManager** ([2b7d79](https://github.com/facebook/react-native/commit/31850df116fdd1595dddcd7b37a21568e679ffa7) by [@jtreanor](https://github.com/jtreanor)) -- Fix app to reconnect with metro after the bundler is closed and reopened ([c28676](https://github.com/facebook/react-native/commit/62bac80f90cf5a4ab216488b4ede441f0e3f86ba) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Fix throttle below 16ms on **ScrollView** ([39776a](https://github.com/facebook/react-native/commit/c87de765f6a9ebf656c188fa2115a1ba01b7939c) by [@sahrens](https://github.com/sahrens)) - -#### Android specific - -- Fix JS errors during bundle load were reported as `UnknownCppException` ([84e263](https://github.com/facebook/react-native/commit/6f6696fa63dc5f7029cb121c7e0ee98f8d271602)) -- Add logic to catch `MissingWebViewPackageException` ([379874](https://github.com/facebook/react-native/commit/954f715b25d3c47c35b5a23ae23770a93bc58cee) by [@thorbenprimke](https://github.com/thorbenprimke)) -- Revert "[improve RTL](https://github.com/facebook/react-native/commit/b3c74967ca6b20d7bda84c690ae3a99dfe255843)" ([f3801d](https://github.com/facebook/react-native/commit/8d3e16831a93079fc5a855a7b0f8b4be508c6942) by [@thorbenprimke](https://github.com/thorbenprimke)) - -### Added - -- Add listener for non-value animated node ([4a82dc](https://github.com/facebook/react-native/commit/68a5ceef312c7e3ac74d616b960c1cfde46a109d) by [@osdnk](https://github.com/osdnk)) -- Set **ScrollView** throttle by default ([74d740](https://github.com/facebook/react-native/commit/b8c8562ffb424831cc34a18aeb25e5fec0954dd0) by [@sahrens](https://github.com/sahrens)) - -### Changed - -- Make **KeyboardAvoidingView** with `behavior="height"` resize on keyboard close ([7140a7](https://github.com/facebook/react-native/commit/3711ea69375ea420800bac97914aa0d24fc9b1a6) by [@WaldoJeffers](https://github.com/WaldoJeffers)) -- Update network inspector to have smarter scroll stickiness ([57dc37](https://github.com/facebook/react-native/commit/c06473ab464e07edbb4715f58cd13674273bb29b) by [@AlanFoster](https://github.com/AlanFoster)) - -## v0.59.7 - -This patch release was unpublished. - -## v0.59.6 - -This patch release was unpublished. - -## v0.59.5 - -This is a patch fix release addressing regressions, crashes, and a few developer-experience pain points. Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/113) for cherry-picking commits. - -### Fixed - -- Remove wrapper around **ListEmptyComponent** ([54af5b](https://github.com/facebook/react-native/commit/46276444508581bac7b9f27edd56ec0c8ec450bc) by [@AntoineDoubovetzky](https://github.com/AntoineDoubovetzky)) - -#### Android specific - -- Enforced thread safety on UIImplementation methods that mutate the shadowNodeRegistry ([f5a318](https://github.com/facebook/react-native/commit/f5a31801a03b61df3d7bc2fc86df7bad272082e2) by [@SudoPlz](https://github.com/sunnylqm)) -- Fixed a `NoSuchKeyException` when parsing JS stack frames without line numbers ([d7bd6c](https://github.com/facebook/react-native/commit/c953e0b4319da0976ece877c09b648a55bc57d9f) by [@Salakar](https://github.com/Salakar)) -- Fixed `mostRecentEventCount` is not updated ([b8aac0](https://github.com/facebook/react-native/commit/60c0a60c508346f7639d32fde0376fabded9f3f0) by [@jainkuniya](https://github.com/jainkuniya)) - -#### iOS specific - -- Pass back correct dimensions for application window in Dimensions module ([72b4cc](https://github.com/facebook/react-native/commit/33b55ccccad56e0b97af294749d728b67b03e658) by [@rdonnelly](https://github.com/rdonnelly)) -- Fixed warning: "RCTImagePickerManager requires main queue setup" ([effb02](https://github.com/facebook/react-native/commit/6508b88cfdccdb2da6bfde05faac4647436ce4e7) by [@scarlac](https://github.com/scarlac)) - -## v0.59.4 - -This is a patch fix release addressing regressions, crashes, and a few developer-experience pain points. Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/100) for cherry-picking commits. - -### Changed - -- Make Jest transform @react-native-community packages by default ([7e23c7c565](https://github.com/facebook/react-native/commit/7e23c7c5654818fa076eeb627b709d39130f57f6) by [@thymikee](https://github.com/thymikee)) - -#### iOS specific - -- Add `scrollToOverflowEnabled` prop to **ScrollView** ([6f4239b37c](https://github.com/facebook/react-native/commit/6f4239b37c3059d6cb1fdaf2dcd3b6c962dde471) by [@mysport12](https://github.com/mysport12)) - -### Fixed - -- Fix **Touchable** long-press ([59e50237bf](https://github.com/facebook/react-native/commit/59e50237bff9521d2b78d7576abf4e23d844ac1b) by [@Kida007](https://github.com/Kida007)) - -#### Android specific - -- Fix a crash when setting `underlineColorAndroid` in **TextInput** ([556aa93ed7](https://github.com/facebook/react-native/commit/556aa93ed72d9dc0f18a1c6d7dec3d9c182fee85) by [@sunnylqm](https://github.com/sunnylqm)) - -#### iOS specific - -- Fix universal links not working in iOS 12 / Xcode 10 ([56679ed359](https://github.com/facebook/react-native/commit/56679ed359834c2177c8837d744cc7bf2ceb6b0a) by [@IljaDaderko](https://github.com/IljaDaderko)) -- Fix triangle views ([7a6fe0cda0](https://github.com/facebook/react-native/commit/7a6fe0cda0a1089c1c82fdd5f7f2db940f70feae) by [@zhongwuzw](https://github.com/zhongwuzw)) - -## v0.59.3 - -This is a patch fix release addressing regressions, crashes, and a few developer-experience pain points. Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/100) for cherry-picking commits. - -### Changed - -#### Android specific - -- Improve RTL support ([b3c74967ca](https://github.com/facebook/react-native/commit/b3c74967ca6b20d7bda84c690ae3a99dfe255843) by [@dulmandakh](https://github.com/dulmandakh)) - -### Fixed - -- Fix **VirtualizedList**, **SectionList** and **FlatList** behavior on rendering list headers with inverted prop and zero items ([c13f5d48cf](https://github.com/facebook/react-native/commit/c13f5d48cfe3e7c0f6c6d0b745b50a089d6993ef) by [@michalchudziak](https://github.com/michalchudziak)) -- Fix **VirtualizedList** debug mode crash ([02e8e531dd](https://github.com/facebook/react-native/commit/02e8e531ddfd86e9abf7ef47fbf30445afeb37cf)) -- Fix running Metro on Windows ([43d3313788](https://github.com/facebook/react-native/commit/43d3313788a5f0a36abdbfadc000b06b2188fc06) and [9db347fabc](https://github.com/facebook/react-native/commit/9db347fabca19c66f669faf4054c81cc3624be03) by [@aliazizi](https://github.com/aliazizi) and [@nazreinkaram](https://github.com/nazreinkaram)) - -#### Android specific - -- Fix IllegalStateException when invalid URL or headers are passed ([aad4dbbbfe](https://github.com/facebook/react-native/commit/aad4dbbbfe937d1924e5359556979ab067198a58) by [@dryganets](https://github.com/dryganets)) -- Fix IllegalStateException when tapping next on Android Keyboard ([b943db418f](https://github.com/facebook/react-native/commit/b943db418f4f0b9d0865642aaca3e1a2f1529663) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific - -- Show Perf Monitor after reloading JS ([15619c22e5](https://github.com/facebook/react-native/commit/15619c22e57f73dfbed7bbe5fd6d9b3d2a8c9225) by [@usrbowe](https://github.com/usrbowe)) -- Fix **TextInput**'s `maxLength` when inserting characters at begin ([17415938c7](https://github.com/facebook/react-native/commit/17415938c7180a95811db949122b8ad24a442866) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix runtime crash in Xcode 10.2 when using `RCT_EXTERN_MODULE` for swift classes ([ff66600224](https://github.com/facebook/react-native/commit/ff66600224e78fec5d0e902f8a035b78ed31a961)) - -## v0.59.2 - -This is a patch fix release addressing regressions, crashes, and a few developer-experience pain points. Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/100) for cherry-picking commits. - -### Fixed - -#### Android specific - -- Crash on pre-26 Android devices when setting **TextInput** content type ([d4aa1e7a52](https://github.com/facebook/react-native/commit/d4aa1e7a52b51fa5d7fc9ded132b7b50170f2190) by [@hramos](https://github.com/hramos)) -- Crash when scroll to index 0 in a **SectionList** ([8fa116cc0e](https://github.com/facebook/react-native/commit/8fa116cc0e1cadbb6cf0734cfde0e0b8060f6b59) by [@danilobuerger](https://github.com/danilobuerger)) -- **Switch**'s `trackColor` being reset when toggled ([7652e31d8c](https://github.com/facebook/react-native/commit/7652e31d8c233c1c831f6597c8a2f7ce3d9c0b6e) and [d6ee448e15](https://github.com/facebook/react-native/commit/d6ee448e15a25a7485482a4702aadb2e396445c7) by [@dulmandakh](https://github.com/dulmandakh) and [@ejanzer](https://github.com/ejanzer)) - -#### iOS specific - -- **ScrollView** offset out of content size ([9c1c5a7455](https://github.com/facebook/react-native/commit/9c1c5a7455d90ec837a9a6141c096de70b798e43) by [@zhongwuzw](https://github.com/zhongwuzw)) -- **RefreshControl** state's race condition ([95d399bc82](https://github.com/facebook/react-native/commit/95d399bc825c5471e08b83eff4b1b1b510e384a0) by [@rostislav-simonik](https://github.com/rostislav-simonik)) -- Start Metro packager from project root ([fe3aebf87b](https://github.com/facebook/react-native/commit/fe3aebf87b4123f8b16cdfcb9e2e774e6e0bf0b6) by [@MatthieuLemoine](https://github.com/MatthieuLemoine)) -- **TextInput**s that are single-line reverting to default text ([e38be82dfa](https://github.com/facebook/react-native/commit/e38be82dfa8b49385b990629318f027de26500cf) by [@PeteTheHeat](https://github.com/PeteTheHeat)) - -### Changed - -#### Android specific - -- Add TLS 1.3 support to all Android versions using Conscrypt; to use this, you must add `implementation('org.conscrypt:conscrypt-android:2.0.0')` to `build.gradle` ([75af15ede4](https://github.com/facebook/react-native/commit/75af15ede44135110e40de75a649d5b15430c590) by [@dulmandakh](https://github.com/dulmandakh)) -- Turn off Metro JS Deltas by default for Android ([845189c17d](https://github.com/facebook/react-native/commit/845189c17de621cc5aa373503220c1c12f649c3c) by [@PeteTheHeat](https://github.com/PeteTheHeat)) - -## v0.59.1 - -This is a small patch release that addresses two critical issues from the 0.59.0 release. - -### Fixed - -#### Android specific - -- Template build gradle error on x86_64 ([4b996da470](https://github.com/facebook/react-native/commit/4b996da470b43f97fd0426b54bda739d7717fb28) by [@grabbou](https://github.com/grabbou)) - -#### iOS specific - -- Build error warning of **Text** module ([d834197746](https://github.com/facebook/react-native/commit/d834197746371b203bd7d7aaabdc2bc581acc867) by [@zhongwuzw](https://github.com/zhongwuzw)) - -## v0.59.0 - -Welcome to release 0.59 of React Native! For highlights of this release, please view the dedicated [blog post](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059). Thanks to those who gave feedback during the [release candidate phase](https://github.com/react-native-community/react-native-releases/issues/79). If you're interested in helping evaluate our next release (0.60), subscribe to the dedicated issue [here](https://github.com/react-native-community/react-native-releases/issues/99). - -### Added - -- Add a Metro configuration to the template with inline require/import options; read more about it [in the blog post](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059) ([ae11993d0f](https://github.com/facebook/react-native/commit/ae11993d0f6c6de661867b5d032d844e91c83c6f) by [@cpojer](https://github.com/cpojer)) - -#### Android specific - -- **Text** and **TextInput** now has prop [maxFontSizeMultiplier](https://reactnative.dev/docs/text#maxfontsizemultiplier) ([4936d284df](https://github.com/facebook/react-native/commit/4936d284df36071047ce776d9e2486c0371f7b97) by [@rigdern](https://github.com/rigdern)) -- **TextInput** now has prop [autoComplete](https://reactnative.dev/docs/textinput#autocomplete) prop ([f15145639d](https://github.com/facebook/react-native/commit/f15145639dab1e8d7a1c79a127b7d45c91d025a8)) -- **CameraRoll**'s `getPhotos` now supports `assetType: "All"` to let users pick from video and photos simultaneously ([54534e79d7](https://github.com/facebook/react-native/commit/54534e79d724ff57572efc43f65100067f35d4c1) by [@kesha-antonov](https://github.com/kesha-antonov)) -- **Text** and **TextInput** now support `textAlign:justify` for android O+ (api level >=26) ([d2153fc58d](https://github.com/facebook/react-native/commit/d2153fc58d825006076a3fce12e0f7eb84479132) by [sunnylqm](https://github.com/sunnylqm)) - -#### iOS specific - -- **TextInput** now has prop `rejectResponderTermination` to enable TextInputs inside Swipeables to function properly ([11df0eae5f](https://github.com/facebook/react-native/commit/11df0eae5ff8f530bfaf56aaf2209ff48f3ed9ac) by [@cmcewen](https://github.com/cmcewen)) -- **ActionSheetIOS** has a new prop `destructiveButtonIndexes` for an `Array` of destructive indexes ([67e7f16944](https://github.com/facebook/react-native/commit/67e7f16944530aa0d1a4d375b0de5efd5c432865) by [@sdg9](https://github.com/sdg9)) -- Add `isEventFromThisApp` to `KeyboardEvent` notifications to disambiguate keyboard events when apps are running side-by-side ([05f35c296d](https://github.com/facebook/react-native/commit/05f35c296d91d946acf4edd94106fbdd0dd69a29) by [@nossbigg](https://github.com/nossbigg)) -- Allow changing the project path in `react-native-xcode.sh` using env var `PROJECT_ROOT` ([9ccde378b6](https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead) by [@janicduplessis](https://github.com/janicduplessis)) - -### Changed - -- `React` is now at `v16.8.3` ([ccefc700d0](https://github.com/facebook/react-native/commit/ccefc700d0120539eba73747d1d6b65effb0645d) and ([2af13b4477](https://github.com/facebook/react-native/commit/2af13b4477342d3498ab302ceb5297fcbc17e097) by [@cpojer](https://github.com/cpojer) and [@hramos](https://github.com/hramos)) -- `Flow` dependency is now at `v0.92.0` ([5ee738659b](https://github.com/facebook/react-native/commit/5ee738659b4ac7b0e73b9dba09a63091d4571ed9) by [@pakoito](https://github.com/pakoito)) -- `@react-native-community/cli` dependency is at `v1.2.1` ([a252aee2ea](https://github.com/facebook/react-native/commit/a252aee2eabd9eeffb279b9fcf1827093ef4039c) and [5e1504b0fc](https://github.com/facebook/react-native/commit/5e1504b0fca99cad3bfe2339ac0e7862b2315f9c) by [@grabbou](https://github.com/grabbou)) -- Enhance Flow types definitions for **ViewPropTypes** ([7ff9456f2e](https://github.com/facebook/react-native/commit/7ff9456f2e5fd72286f5be52598988707eaef69c) by [@danibonilha](https://github.com/danibonilha)) - -#### Android specific - -- Clarify error message to direct people to `react-native start` rather than `react-native bundle` ([46aaa02274](https://github.com/facebook/react-native/commit/46aaa02274a51ebe2aaa9fca2422dcebf9323475) by [@sunnylqm](https://github.com/sunnylqm)) -- **BREAKING** - removed `OkHttpClientProvider.replaceOkHttpClient` method; please use `OkHttpClientProvider.setOkHttpClientFactory` from 0.54+ ([7cbdd7b6ac](https://github.com/facebook/react-native/commit/7cbdd7b6ac7db2192f7d0193d22326041517a63e) by [@cdlewis](https://github.com/cdlewis)) -- **BREAKING** - remove `ViewHelper`, use `ViewCompat` instead; this may also require changing the `android:theme` to be from `Theme.AppCompat`; read more about it [in the blog post](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059) ([c493cfe708](https://github.com/facebook/react-native/commit/c493cfe7083a6b97b6ec9eb9cb59cf1fdec45458) by [@dulmandakh](https://github.com/dulmandakh)) -- Add nullable annotations to `ReadableMap`, `WritableMap`, `ReadableArray`, `Writable`, `ReactPackage`, and native module interfaces; this may impact Kotlin usage ([b640b6faf7](https://github.com/facebook/react-native/commit/b640b6faf77f7af955e64bd03ae630ce2fb09627), [c93cbdf1b2](https://github.com/facebook/react-native/commit/c93cbdf1b272cfd60124d9ddb4c52b58ca59d319), [7b33d6b0b9](https://github.com/facebook/react-native/commit/7b33d6b0b96578a548e9a7f973eb59ac9236697b), and [84f40da990](https://github.com/facebook/react-native/commit/84f40da990dfd21eb1c21e20f2be0f8b2c5a78e4) by [@dulmandakh](https://github.com/dulmandakh)) -- `Soloader` is now at `v0.6.0` ([07d1075f37](https://github.com/facebook/react-native/commit/07d1075f372bb864ddc62b9c8f613b03becfa568) by [@dulmandakh](https://github.com/dulmandakh)) -- Android Support Library is now at `v28.0.0` ([5bbed43854](https://github.com/facebook/react-native/commit/5bbed43854957a37c4b51f49f30669665a72e7f7) by [@dulmandakh](https://github.com/dulmandakh)) -- `targetSdkVersion` is now at `v28` ([57f444bd8a](https://github.com/facebook/react-native/commit/57f444bd8a175038c367fa1b7d93e2e8ba9de7ed) by [@dulmandakh](https://github.com/dulmandakh)) -- Android Plugin is now at `v3.3.1` ([da5b5d2fa1](https://github.com/facebook/react-native/commit/da5b5d2fa134aa09dda4a620be9fa4d3d419201f) by [@dulmandakh](https://github.com/dulmandakh)) -- Enable Java 8 support ([38eb2a70af](https://github.com/facebook/react-native/commit/38eb2a70afa87c49c1e62754f5ae3cd26e7f59c3) by [@dulmandakh](https://github.com/dulmandakh)) -- Suppress misleading missing permission warnings ([d53dbb0dfb](https://github.com/facebook/react-native/commit/d53dbb0dfb99bdee5cd7eeaaa6f4ae51dcca00c5) by [@dulmandakh](https://github.com/dulmandakh)) -- Add back `buildToolsVersion` to build.gradle ([cf52ab561d](https://github.com/facebook/react-native/commit/cf52ab561d9fa0e4d14de7a8f3324cbc2b25bf92) by [@dulmandakh](https://github.com/dulmandakh)) -- **TimePickerAndroid** has better Flow types definitions ([2ed1bb2e01](https://github.com/facebook/react-native/commit/2ed1bb2e01ab7360d9bf13e4f9e13cb9c9c9d32e) by [@yushimatenjin](https://github.com/yushimatenjin)) -- `ReactActivity`, `ReactSlider`, `ReactTextView`, and `ReactPicker` extends `AppCompatActivity`; updates to `TimePickerDialogModule` and `DatePickerDialogModule` as well ([dda2b82a0a](https://github.com/facebook/react-native/commit/dda2b82a0a49da52b43b50db5a2bda50a216c09b), [3b9604feda](https://github.com/facebook/react-native/commit/3b9604feda8f9e8fe3dd884912ec7d9be67d7f1d), [ba0c3ffd5b](https://github.com/facebook/react-native/commit/ba0c3ffd5b46963a8bb27b40eb396965535cd927), [833429dd63](https://github.com/facebook/react-native/commit/833429dd633b33fff71224a7ce663b60681a7f81), [adc1410572](https://github.com/facebook/react-native/commit/adc14105727f708c990b7a744a0ea270ff0fba13), [c6c5a173bc](https://github.com/facebook/react-native/commit/c6c5a173bce3d8c847931d26eddb295956285438), and [be361d0fc1](https://github.com/facebook/react-native/commit/be361d0fc1930b1679c4226e15c1a5b416b94105) by [@dulmandakh](https://github.com/dulmandakh)) -- Fix lint error/warnings that cause older Android crashes ([d2fc19f4aa](https://github.com/facebook/react-native/commit/d2fc19f4aa94888b7c3d3f4a5fb621bf96a1aff9) by [@dulmandakh](https://github.com/dulmandakh)) -- The error message on getting Android drawable folder suffix now gives more information ([a159a33c02](https://github.com/facebook/react-native/commit/a159a33c02e0c0d7aa245adfd540a066ec065362) by [@BrunoVillanova](https://github.com/BrunoVillanova)) -- `SYSTEM_ALERT_WINDOW` permissions available only in debug builds ([84a2fb0a4a](https://github.com/facebook/react-native/commit/84a2fb0a4a67cd9dc37cf4e5bab814f25181cfb7) by [@dulmandakh](https://github.com/dulmandakh)) -- Add talkback navigation support for links and header ([b9d3743cda](https://github.com/facebook/react-native/commit/b9d3743cda95d1f475dbec8f6d72935941519deb) by [@yangweigbh](https://github.com/yangweigbh)) -- **FlatList** has `removeClippedSubviews` default to `true` on Android ([1a499f43b2](https://github.com/facebook/react-native/commit/1a499f43b2d03cc27dd6c25c8f13a767862afba1) by [@fred2028](https://github.com/fred2028)) - -#### iOS specific - -- Moved iOS build cache directory from `~/.rncache` to `~/Library/Caches/com.facebook.ReactNativeBuild` ([1024dc251e](https://github.com/facebook/react-native/commit/1024dc251e1f4777052b7c41807ea314672bb13a) by [@sryze](https://github.com/sryze)) -- Keyboard API Event flow types have been improved ([7ee13cc84c](https://github.com/facebook/react-native/commit/7ee13cc84c342244d3aa9e485de0e759482287ea) by [@nossbigg](https://github.com/nossbigg)) -- Expose **AsyncLocalStorage** get/set methods to native code ([7b8235a95a](https://github.com/facebook/react-native/commit/7b8235a95ad9519e9735cc1555a8d3aa5bb7c0ee) by [@ejmartin504](https://github.com/ejmartin504)) -- Clear RCTBridge **launchOptions** when bridge is reloaded ([19d04a312b](https://github.com/facebook/react-native/commit/19d04a312bf4221cd26beff6d0da6dd296a28cd0) by [@venik](https://github.com/venik)) - -### Deprecated - -The following deprecations are part of our Lean Core initiative; read more about it [in the blog post](https://reactnative.dev/blog/2019/03/12/releasing-react-native-059). - -- Deprecated [MaskedViewIOS](https://reactnative.dev/docs/maskedviewios) as it has now been moved to [react-native-community/masked-view](https://github.com/react-native-community/react-native-masked-view) ([4ac65f5413](https://github.com/facebook/react-native/commit/4ac65f5413ee59f7546b88a2eae2c4ce6fa8826b) by [@FonDorn](https://github.com/FonDorn)) -- Deprecated [ViewPagerAndroid](https://reactnative.dev/docs/viewpagerandroid) as it has now been moved to [react-native-community/viewpager](https://github.com/react-native-community/react-native-viewpager) ([77300ca91c](https://github.com/facebook/react-native/commit/77300ca91c17d371f6ba04230b8c2e8f5cd99ab8) by [@ferrannp](https://github.com/ferrannp)) -- Deprecated [AsyncStorage](https://reactnative.dev/docs/asyncstorage) as it has now been moved to [react-native-community/asyncstorage](https://github.com/react-native-community/react-native-async-storage) ([ffe37487b2](https://github.com/facebook/react-native/commit/ffe37487b228b77a3697c32767e91f1dd68041d8) by [@Krizzu](https://github.com/Krizzu)) -- Deprecated [Slider](https://reactnative.dev/docs/slider) as it has now been moved to [react-native-community/slider](https://github.com/react-native-community/react-native-slider) ([bf888a7582](https://github.com/facebook/react-native/commit/bf888a7582763a593d8b36874d242653fc0a9575) by [@michalchudziak](https://github.com/michalchudziak)) -- Deprecated [NetInfo](https://reactnative.dev/docs/netinfo) as it has now been moved to [react-native-community/netinfo](https://github.com/react-native-community/react-native-netinfo) ([d9c0dfe353](https://github.com/facebook/react-native/commit/d9c0dfe353eceb91efcec774bab0f65b6792e4fa) by [@matt-oakes](https://github.com/matt-oakes)) -- Deprecated [ImageStore](https://reactnative.dev/docs/imagestore) and directed users to `expo-file-system` and `react-native-fs` ([62599fa8ff](https://github.com/facebook/react-native/commit/62599fa8ff7f308259fe178fa37b7bcf3c1a408c) by [@EvanBacon](https://github.com/EvanBacon)) - -#### iOS specific - -- Replace deprecated `stringByReplacingPercentEscapesUsingEncoding:` with `stringByAddingPercentEncodingWithAllowedCharacters:` ([61ca119650](https://github.com/facebook/react-native/commit/61ca11965046f75e7500e5152c5f2b60df2a2cd5) by [@pvinis](https://github.com/pvinis)) - -### Removed - -- `react-native-git-upgrade` is now officially dead; use `react-native upgrade` instead (which uses [rn-diff-purge](https://github.com/react-native-community/rn-diff-purge) under the covers) ([a6bdacb257](https://github.com/facebook/react-native/commit/a6bdacb2575dcc3be2acec95d8a6db6e2db909c4) by [@cpojer](https://github.com/cpojer)) - -#### iOS specific - -- Remove the previously deprecated **TabBarIOS** ([02697291ff](https://github.com/facebook/react-native/commit/02697291ff41ddfac5b85d886e9cafa0261c8b98) by [@axe-fb](https://github.com/axe-fb)) -- **AlertIOS** is now replaced with **Alert** ([e2bd7db732](https://github.com/facebook/react-native/commit/e2bd7db732602b2c477fe040f2946bd8293df297) by [@wellmonge](https://github.com/wellmonge)) - -### Fixed - -- **KeyboardAvoidingView** now shows the correct height after the keyboard is toggled ([745484c892](https://github.com/facebook/react-native/commit/745484c892e40cfe15ded128f5a589edb28d8f6b) by [@shauns](https://github.com/shauns)) -- Adds fixes for react-native-windows UWP ([dfcbf9729f](https://github.com/facebook/react-native/commit/dfcbf9729fab64c4bd8c00e1d092ec4e9bae717f) by [@rozele](https://github.com/rozele)) -- The `Map` and `Set` polyfills no longer reject non-extensible object keys; also fix hash collision scenario ([90850cace9](https://github.com/facebook/react-native/commit/90850cace9991ed0a02605586ea5c32ce099de65) by [@benjamn](https://github.com/benjamn)) -- Corrected StyleSheet's transformation perspective to match iOS's behavior, regardless of screen density ([4c10f9321c](https://github.com/facebook/react-native/commit/4c10f9321c9d01dbcac4808e7e6674cba12f3aa5) by [@syaau](https://github.com/syaau)) -- Fix `yarn test` in new projects ([5218932b13](https://github.com/facebook/react-native/commit/5218932b13ad0649ff2a57aaf1ec682fe278c47d) by [@Esemesek](https://github.com/Esemesek)) -- Fix issue with `getInspectorDataForViewTag` that caused red screen when toggling inspector ([46f3285a3f](https://github.com/facebook/react-native/commit/46f3285a3f240f9325a548e677a1927402d76bd7) by [@TranLuongTuanAnh](https://github.com/TranLuongTuanAnh)) -- Fix `displayName` for `Image`; this will make tests no longer mistake it as `Component` ([4989123f8c](https://github.com/facebook/react-native/commit/4989123f8cab37c95b020e23b9a925746a3f3677) by [@linnett](https://github.com/linnett)) -- Fix regression of **VirtualizedList** jumpy header ([e4fd9babe0](https://github.com/facebook/react-native/commit/e4fd9babe03d82fcf39ba6a46376f746a8a3e960) by [@danilobuerger](https://github.com/danilobuerger)) -- Set `wait_for_recheck=true` to work around crash in Flow ([ffc9908bef](https://github.com/facebook/react-native/commit/ffc9908bef535ba1392c370ca4e9e4e528c3c4c5) by [@gabelevi](https://github.com/gabelevi)) -- Fix flow typing of **Text** ([10c8352141](https://github.com/facebook/react-native/commit/10c835214160cc5a5726c8dd9f0d42a0275d198b) by [@sahrens](https://github.com/sahrens)) -- Fix `jest` and `jest-junit` to be only development dependencies ([c7b57f1986](https://github.com/facebook/react-native/commit/c7b57f19869f31474c8ee17f7a1ac1551bab1b6e) by [@vovkasm](https://github.com/vovkasm)) -- Fix layout issue with **SwipeableQuickActionButton** ([ad52f52624](https://github.com/facebook/react-native/commit/ad52f526247af6eebadd2ea436b86ff7eb874f27) by [@varungupta85](https://github.com/varungupta85)) - -#### Android specific - -- Fix textTransform when used with other text styles on Android (#22670) ([3a33e75183](https://github.com/facebook/react-native/commit/3a33e75183bf196d61b46e662b4c3f84a5f570bd) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix warnings related to updating to gradle 4.10.1 or higher ([5be50d4820](https://github.com/facebook/react-native/commit/5be50d482082917351b46ee2e339e56e7e34e111) by [@misaku](https://github.com/misaku)) -- Fix issue with use of Android API 28 by adding security config for metro access ([5747094532](https://github.com/facebook/react-native/commit/5747094532bace3fe6b1ebdf55235e53189baa71), [19492b730b](https://github.com/facebook/react-native/commit/19492b730b6779486f83d5ddbaeeb870cb3d5e9c), [3b0b7ce8c3](https://github.com/facebook/react-native/commit/3b0b7ce8c3c3679610c14ca72beb1a9dcf84d930), and [84572c4051](https://github.com/facebook/react-native/commit/84572c4051f11f68ddf0928d2c3df5850ae15491) by [@Salakar](https://github.com/Salakar) and [@dulmandakh](https://github.com/dulmandakh)) -- Fix Inverted Horizontal **ScrollView** ([32cb9ec49c](https://github.com/facebook/react-native/commit/32cb9ec49c801fcebe61486149134ab542d9364b) by [@dmainas](https://github.com/dmainas)) -- Fix crash on **CheckBox** on older Android versions ([58437cd10a](https://github.com/facebook/react-native/commit/58437cd10a667bbcbc16781df855fd7c3d73bf49) by [@vonovak](https://github.com/vonovak)) -- Fix undefined error description in **Image** `onError` callback ([7795a672d3](https://github.com/facebook/react-native/commit/7795a672d3a24a5b50df6ad6d30555d856b557cc) by [@Jyrno42](https://github.com/Jyrno42)) -- Fix Android crash on animating with `useNativeDriver` ([e405e84fc3](https://github.com/facebook/react-native/commit/e405e84fc35923888442df748757787698040010) by [@scisci](https://github.com/scisci)) -- Fix dev settings menu not appearing for certain codebases due to namespace conflicts ([9968d0c203](https://github.com/facebook/react-native/commit/9968d0c2030c1065979db34cc9a244bd52b7b2a5) by [@khaled-cliqz](https://github.com/khaled-cliqz)) -- Fix exception occurring while fading a **TextView** ([f83281e2ce](https://github.com/facebook/react-native/commit/f83281e2ce2aece44b1207844d8a5149d5d2e78d) by [@mdvacca](https://github.com/mdvacca)) -- Fix **StatusBar** overwriting previously set `SystemUiVisibility` flags ([8afa0378cd](https://github.com/facebook/react-native/commit/8afa0378cd09b8fa6c30d759539fc9a680e8cae2) by [@rogerkerse](https://github.com/rogerkerse)) -- Prevent `fetch()` POST requests from appending `charset=utf-8` to `Content-Type` header ([4a807761a4](https://github.com/facebook/react-native/commit/4a807761a4aca9e551ff2cee8ca18a2450fb11ca) and [0d5aebbd9a](https://github.com/facebook/react-native/commit/0d5aebbd9ac92a90ec7ab1426ed92dd22ae8c736) by [@nhunzaker](https://github.com/nhunzaker)) -- Fix issue with **Location** that led to exceptions in two cases ([f32dc63546](https://github.com/facebook/react-native/commit/f32dc635467a2e93371f0cf2e40b07a712349288) by [@mikelambert](https://github.com/mikelambert)) - -#### iOS specific - -- Fix **TextInput** mistakenly capitalizing I's after emojiis ([f307ac7c5e](https://github.com/facebook/react-native/commit/f307ac7c5e3adb9b4c0f8b2e4b8cdc2f980c7733) by [@dchersey](https://github.com/dchersey)) -- Fix **TextView**'s `setAttributedText` for CJK languages on single-line text fields ([e38be82dfa](https://github.com/facebook/react-native/commit/e38be82dfa8b49385b990629318f027de26500cf) by [@mandrigin](https://github.com/mandrigin)) -- Fix RCTImageLoader multi thread crash ([5ed31ce524](https://github.com/facebook/react-native/commit/5ed31ce5240a7392afdc522120edef182e0014ed)) -- Fix removing keys of large values from **AsyncStorage** ([27b4d21564](https://github.com/facebook/react-native/commit/27b4d215641f9397ef415cbb2acfc1275e6110ac) by [@esprehn](https://github.com/esprehn)) -- Fix overscroll behavior on virtualized lists; behavior is now consistent ([4d5f85ed42](https://github.com/facebook/react-native/commit/4d5f85ed426cfb43dc5e63f915e416a47d76b965)) -- Fix **Alert** to not block input focus and blur ([e4364faa3c](https://github.com/facebook/react-native/commit/e4364faa3cab150b82272819fc92086fb4da297e) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix broken JSIexecutor search path ([2aa2401766](https://github.com/facebook/react-native/commit/2aa24017667721ba17a859ca4e13d43e52d86bc5) by [@amccarri](https://github.com/amccarri)) -- Fix potential linker issues when using Xcode project ([9f72e6a5d0](https://github.com/facebook/react-native/commit/9f72e6a5d02d84fe8ed545e0c0904199b9cb3c7a) by [@tyrone-sudeium](https://github.com/tyrone-sudeium)) -- Fix crash when `scrollEnabled` used in singleline textinput ([9ff43abe65](https://github.com/facebook/react-native/commit/9ff43abe653ac5af0e591b369228f0809caad204) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix crash in gif image usage ([d0cd3cae13](https://github.com/facebook/react-native/commit/d0cd3cae13a1b1fff8a2e378b5228d3cdccd695f) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix **geolocation** to not constantly reset accuracy to default of 100 meters ([bbcb97a29a](https://github.com/facebook/react-native/commit/bbcb97a29adc2a3a05728b47d28e28fa78d84df2) by [@omnikron](https://github.com/omnikron)) -- Fix iOS build issue related to missing `DoubleConversion` and `glog` to `cxxreact`, `jsi` and `jsiexecutor` subspecs in `React.podspec` file ([00392ac46b](https://github.com/facebook/react-native/commit/00392ac46b6319dcff2b6df2e5f7bb4ee094612f) by [@alexruperez](https://github.com/alexruperez)) -- Fix "'folly/folly-config.h' file not found" build error when using React via CocoaPods ([5560a47c1d](https://github.com/facebook/react-native/commit/5560a47c1dbc7daab1e4f4aac0667080fdea836a) by [@Salakar](https://github.com/Salakar)) -- Fix image cache to follow [MDN strategy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Freshness) ([fb8ba3fe95](https://github.com/facebook/react-native/commit/fb8ba3fe959fd2a0c4ef0025fd84f6deffd9d03b) and [fb8ba3fe95](https://github.com/facebook/react-native/commit/fb8ba3fe959fd2a0c4ef0025fd84f6deffd9d03b) by [@zhongwuzw](https://github.com/zhongwuzw)) -- Fix crash due to IllegalArgumentException when creating CookieManage ([cda8171af3](https://github.com/facebook/react-native/commit/cda8171af30815edfa331e07d1bbf605f0926303) by [@mdvacca](https://github.com/mdvacca)) -- Fix cursor placement after toggling `secureTextEntry` cursor spacing ([8ce3c1b43e](https://github.com/facebook/react-native/commit/8ce3c1b43edd47191c8e5ee8432c58f6e93dfca7) by [@ericlewis](https://github.com/facebook/react-native/commits?author=ericlewis)) - -## v0.58.6 - -This release is fairly small, as we approach stable status for [0.59](https://github.com/react-native-community/react-native-releases/issues/79). - -Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/95) for cherry-picking commits - you can participate in the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/97). - -### Fixed - -#### Android specific - -- Fix Inverted Horizontal ScrollView on Android (#23233) ([32cb9ec49c](https://github.com/facebook/react-native/commit/32cb9ec49c801fcebe61486149134ab542d9364b) by [@dmainas](https://github.com/dmainas)) - -#### iOS specific - -- Map TextInput textContentType strings to Objective-C constants (#22611) ([a89fe4165c](https://github.com/facebook/react-native/commit/a89fe4165c2a331a9d88636d89a5a48151ab8660) by [@levibuzolic](https://github.com/levibuzolic)) -- Don't reconnect inspector if connection refused (#22625) ([d9489c4e9c](https://github.com/facebook/react-native/commit/d9489c4e9c646b79025f07635b840e9974be8cd5) by [@msand](https://github.com/msand)) - -## v0.58.5 - -This release resolves a few bugs and includes a few improvements, listed below. - -Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/86) for cherry-picking commits - you can participate in the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/95). - -### Removed - -- Remove fallback cache ([9d60c20cb3](https://github.com/facebook/react-native/commit/9d60c20cb35074e92a90b803d3d6f420f6671635) by [@grabbou](https://github.com/grabbou)) - -### Fixed - -- Fixes capitalized I's when emojis are present after the text being edited. (#21951) ([f307ac7c5e](https://github.com/facebook/react-native/commit/f307ac7c5e3adb9b4c0f8b2e4b8cdc2f980c7733) by [@dchersey](https://github.com/dchersey)) -- Fix broken jsiexecutor search path. (#23274) ([2aa2401766](https://github.com/facebook/react-native/commit/2aa24017667721ba17a859ca4e13d43e52d86bc5) by [@amccarri](https://github.com/amccarri)) -- Fix duplicate symbols linker error in xcodeproj (#23284) ([9f72e6a5d0](https://github.com/facebook/react-native/commit/9f72e6a5d02d84fe8ed545e0c0904199b9cb3c7a) by [@tyrone-sudeium](https://github.com/tyrone-sudeium)) -- apply Network Security Config file (fixes #22375) (part 2 of #23105) (#23135) ([84572c4051](https://github.com/facebook/react-native/commit/84572c4051f11f68ddf0928d2c3df5850ae15491) by [@Salakar](https://github.com/Salakar)) -- Fix crash for web socket in some race conditions (#22439) ([dd209bb789](https://github.com/facebook/react-native/commit/dd209bb7891ed5f05b96a9922c7b0e39bf3ac9e9) by [@zhongwuzw](https://github.com/zhongwuzw)) - -#### iOS specific - -- Don't attempt to load RCTDevLoadingView lazily ([a9dd828c68](https://github.com/facebook/react-native/commit/a9dd828c68338dbf0e55ffa1838bf8ff574f317d) by [@fkgozali](https://github.com/fkgozali)) - -### Security - -#### Android specific - -- improve Android Network Security config (#23429) ([5747094532](https://github.com/facebook/react-native/commit/5747094532bace3fe6b1ebdf55235e53189baa71) by [@dulmandakh](https://github.com/dulmandakh)) - -## v0.58.4 - -This release resolves a few bugs and includes a few improvements, listed below. - -Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/81) for cherry-picking commits - you can participate in the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/86). - -### Added - -#### Android specific - -- Add error description to Image onError callback ([7795a672d3](https://github.com/facebook/react-native/commit/7795a672d3a24a5b50df6ad6d30555d856b557cc) by [@Jyrno42](https://github.com/Jyrno42)) - -### Changed - -#### Android specific - -- bump soloader to `0.6.0` ([07d1075f37](https://github.com/facebook/react-native/commit/07d1075f372bb864ddc62b9c8f613b03becfa568) by [@dulmandakh](https://github.com/dulmandakh)) - -### Removed - -- Remove jest and jest-junit from runtime dependencies (#23276) ([c7b57f1986](https://github.com/facebook/react-native/commit/c7b57f19869f31474c8ee17f7a1ac1551bab1b6e) by [@vovkasm](https://github.com/vovkasm)) - -### Fixed - -#### Android specific - -- Fixes Android crash on animated style with string rotation ([e405e84fc3](https://github.com/facebook/react-native/commit/e405e84fc35923888442df748757787698040010) by [@scisci](https://github.com/scisci)) - -#### iOS specific - -- fix incorrect type which makes animated gifs not loop forever on device (#22987) ([728a35fcf2](https://github.com/facebook/react-native/commit/728a35fcf2a2b0d695a4d7083b266eda486b1392) by [@chrisnojima](https://github.com/chrisnojima)) -- Fixes for running the simulator ([9a8c9596eb](https://github.com/facebook/react-native/commit/9a8c9596ebe41e27d37ba18d6bf09f1c931c1ff2) by [@osunnarvik](https://github.com/osunnarvik)), ([98bcfe00fb](https://github.com/facebook/react-native/commit/98bcfe00fbca066d6914a2680c3647b678caccc5) by [@cpojer](https://github.com/cpojer)) and ([8bddcb6cb0](https://github.com/facebook/react-native/commit/8bddcb6cb0914373a0aeb927f12a6d48ffc5bb84) by [@cpojer](https://github.com/cpojer)) - -## v0.58.3 - -This release resolves a regression in **StatusBar** using [these fixes](https://github.com/facebook/react-native/compare/v0.58.2...v0.58.3). - -Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/81) for cherry-picking commits - you can participate in the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/81). - -## v0.58.2 - -This release fixes an issue caused by a wrongly reverted merge commit, that caused a short timeframe of commits to not actually be in the original 0.58.0. Those commits have been added to the 0.58 changelog below, as many are intertwined with the original work. - -Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/81) for cherry-picking commits - you can participate in the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/81). - -## v0.58.1 - -There were some regressions with developer tools that prevented `react-native run-ios` from working properly in 0.58.0; this patch fix addresses that. - -Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/81) for cherry-picking commits - you can participate to the decision process for the next patch release [here](https://github.com/react-native-community/react-native-releases/issues/81). - -## v0.58.0 - -Welcome to first stable release of React Native of 2019! -There are a number of significant changes in this version, and we'd like to especially draw your attention to them: - -- [Modernizing](https://github.com/facebook/react-native/issues/21581) and [strengthening flow types](https://github.com/facebook/react-native/issues/22100) for core components -- Breaking changes to `ScrollView`, `CameraRollView`, and `SwipeableRow` that make it no longer bound to the component instance in certain methods -- Support for mutual TLS in WebKit -- Asset serving from directories besides `/assets` -- Numerous crash fixes and resolutions for unexpected behavior - -Aside from those: - -- if you are an iOS developer, you'll need to manually link `JavaScriptCore.framework` when upgrading; this can be done via Xcode, and following the steps shown [here](https://camo.githubusercontent.com/c09cd42747364b498efa7c82fcb73978ba076eae/687474703a2f2f646f63732e6f6e656d6f62696c6573646b2e616f6c2e636f6d2f696f732d61642d73646b2f616464696e672d6672616d65776f726b732e706e67). - -- Android developers, please note that Android's target SDK 27 is supported. Work is still underway to land target SDK 28 support, and it will come soon. - -Thanks to those who gave feedback during the [release candidate phase](https://github.com/react-native-community/react-native-releases/issues/41). If you're interested in helping evaluate our next release (0.59), subscribe to the dedicated issue [here](https://github.com/react-native-community/react-native-releases/issues/79). - -### Added - -- Add support for `publicPath` to enable serving static assets from different locations ([0b314960aa](https://github.com/facebook/react-native/commit/0b314960aa34c71fc731bac9c1f2b48f3223c5cb) by [@gdborton](https://github.com/gdborton)) -- Add **TouchableBounce** now has a simple `bounce()` function that can be used to trigger a bounce without callbacks ([7fe3f90156](https://github.com/facebook/react-native/commit/7fe3f90156e879fe53665efb5a90ba3a711475fa)) - -#### Android specific - -- Bundler server host can now be set using Android System Properties, making for easier debugging across multiple apps or app installs `adb shell setprop metro.host` ([e02a154787](https://github.com/facebook/react-native/commit/e02a154787274be1da3632cb1412554cbd53928b) by [@stepanhruda](https://github.com/stepanhruda)) -- Native Modules can now reject a promise with an additional `WritableMap` arg for extra properties (`userInfo`). See the interface defined in [`Promise.java`](https://github.com/facebook/react-native/blob/60b3942/ReactAndroid/src/main/java/com/facebook/react/bridge/Promise.java) for available methods. This is accessible in JavaScript as `Error.userInfo`. This is to match iOS's existing `Error.userInfo` behavior. See PR for examples. (#20940 by @Salakar) -- Native Modules now expose a `nativeStackAndroid` property to promises rejected with an Exception/Throwable - making native error stacks available inside Javascript: `Error.nativeStackAndroid`. This is to match iOS's existing `Error.nativeStackIOS` support. See PR for examples. (#20940 by @Salakar) - -#### iOS specific - -- Add `moduleForName: lazilyLoadIfNecessary` to **RCTBridge.h** to lookup modules by name and force load them, plus various improvements to LazyLoading ([d7a0c44590](https://github.com/facebook/react-native/commit/d7a0c44590bcf3fb9d055aeae3391d5bcd7e21be), [6534718a18](https://github.com/facebook/react-native/commit/6534718a1898aa472e255d2aa9a0a6cae305619a), [d7865ebde8](https://github.com/facebook/react-native/commit/d7865ebde879983b355d6f6e64232e4bd264081d), [04ea9762e2](https://github.com/facebook/react-native/commit/04ea9762e2013dcebf9f8a51d8974fa799e41cd5), [1f394fa673](https://github.com/facebook/react-native/commit/1f394fa673a876753fdc9ac2cb86a4d4a58cd8cd), [80f92adf1f](https://github.com/facebook/react-native/commit/80f92adf1f35e74ee6db0b2f445cc851463059cf), and [81b74ec1ed](https://github.com/facebook/react-native/commit/81b74ec1ed3792c0b406c30b0a1c01219a2d6243) by [@dshahidehpour](https://github.com/dshahidehpour), [@fkgozali](https://github.com/fkgozali), and [@mmmulani](https://github.com/mmmulani)) -- Add ability for **WebView** to `setClientAuthenticationCredential` when `useWebKit={true}` for mutual TLS authentication ([8911353c47](https://github.com/facebook/react-native/commit/8911353c47af018f78c1cff59dfab05b975e39ed) and [8911353c47](https://github.com/facebook/react-native/commit/8911353c47af018f78c1cff59dfab05b975e39ed) by [@mjhu](https://github.com/mjhu)) - -### Changed - -- Major improvements to Flow types for Core Components ([499c195eba](https://github.com/facebook/react-native/commit/499c195ebab0f276e3a58baf1e6172c1ba046a9e), [fbc5a4f5e6](https://github.com/facebook/react-native/commit/fbc5a4f5e65e024c10ad43d84f2b2353c9e92461), [f9050e0908](https://github.com/facebook/react-native/commit/f9050e09084cf3700bfc1954f97adf0f60cd8d88), [6476151717](https://github.com/facebook/react-native/commit/6476151717f44d3a90679f0f5293bed62a4f420e), [c03fc4087f](https://github.com/facebook/react-native/commit/c03fc4087ff9ac3ccbd1ab2261a1af329b354d99), [69213eea95](https://github.com/facebook/react-native/commit/69213eea9512c81ed998d240a6f5a3be05346b48), [136dfc8312](https://github.com/facebook/react-native/commit/136dfc831230e5418db02d1202e60d23a95c17b6), [3c0211b61a](https://github.com/facebook/react-native/commit/3c0211b61a1e723c3aaeba42c61b60bc724a3729), [c127000a7d](https://github.com/facebook/react-native/commit/c127000a7d2bb54599c9d80503528c3e8d75fddc), [636e146c4a](https://github.com/facebook/react-native/commit/636e146c4a27990547c81c2d36411d36b2c8e788), [c3dea894bd](https://github.com/facebook/react-native/commit/c3dea894bdb07d0b7ec18ab0388626d0340e6b69), [35a65cd704](https://github.com/facebook/react-native/commit/35a65cd704f2da67cd759c4d91251f8d4964b251), [79274979b7](https://github.com/facebook/react-native/commit/79274979b775e89d5f54a557a34062f873134199), [45c51835d6](https://github.com/facebook/react-native/commit/45c51835d69e111b67b4fcf1af39a13f7df1ee48), [a97d104b44](https://github.com/facebook/react-native/commit/a97d104b44daa068fa3848cc6c3225356f9dc318), [fb4825a2c6](https://github.com/facebook/react-native/commit/fb4825a2c65fba3aa905f7defb7d0c125fff644d), [84c5416617](https://github.com/facebook/react-native/commit/84c541661729dd20ab260c7468e48abbbe82affb), [3649a503cf](https://github.com/facebook/react-native/commit/3649a503cf52feac0386b4a10aab5ef6c4ec5ca0) by [@mottox2](https://github.com/mottox2), [@saitoxu](https://github.com/saitoxu), [@RSNara](https://github.com/RSNara), [@watanabeyu](https://github.com/watanabeyu), [@Tnarita0000](https://github.com/Tnarita0000), [@exced](https://github.com/exced), [@nd-02110114](https://github.com/nd-02110114), [@flowkraD](https://github.com/flowkraD)) -- Many public components were converted to ES6 classes ([ScrollView](https://github.com/facebook/react-native/commit/010e3302b8101287f231254086f3a8788a5a2c3e) by [@thymikee](https://github.com/thymikee), [CameraRollView](https://github.com/facebook/react-native/pull/21619), [SwipeableRow](https://github.com/facebook/react-native/pull/21876/files) and [ProgressBarAndroid](https://github.com/facebook/react-native/pull/21874) by [@exceed](https://github.com/exceed), [ProgressViewIOS](https://github.com/facebook/react-native/pull/21588) by [@empyrical](https://github.com/empyrical), [SegmentedControlIOS](https://github.com/facebook/react-native/pull/21888/files), [ToolbarAndroid](https://github.com/facebook/react-native/pull/21893/files) by [@nd-02110114](https://github.com/nd-02110114) -- Flow dependency is now at `v0.85.0` ([adc8a33fcf](https://github.com/facebook/react-native/commit/adc8a33fcfeb8fc163f48ae4a4bc5aaac98bcb0d) by [@samwgoldman](https://github.com/samwgoldman)) -- metro dependency is now at `v0.49.1` ([f867db366a](https://github.com/facebook/react-native/commit/f867db366aa4f0ead5a20c0d3154ca58be43fc20), [88882951e1](https://github.com/facebook/react-native/commit/88882951e1607b0af6f1772ef13135e037f9c4e3), [31bb551e75](https://github.com/facebook/react-native/commit/31bb551e75bda155b4821381e5497dc423326e3c), [de60e8643a](https://github.com/facebook/react-native/commit/de60e8643ac4e13a7f92175351268dd3c3e768db), and [de60e8643a](https://github.com/facebook/react-native/commit/de60e8643ac4e13a7f92175351268dd3c3e768db) by [@alexkirsz](https://github.com/alexkirsz) and [@rafeca](https://github.com/rafeca)) -- jest dependency is now at `v24.0.0-alpha.6` ([1b4fd64325](https://github.com/facebook/react-native/commit/1b4fd643256817d29163b37101da612867a225a1), [66aba09251](https://github.com/facebook/react-native/commit/66aba092514abd2b278a4fb66c30abffbdd5d5ff), and [06c13b3e06](https://github.com/facebook/react-native/commit/06c13b3e066636b414f5dc19c919dcb138763c71) by [@rafeca](https://github.com/rafeca) and [@rubennorte](https://github.com/rubennorte)) -- fbjs-scripts dependency is now at `v1.0.0` (#21880) ([cdbf719307](https://github.com/facebook/react-native/commit/cdbf719307f41e94a62307ec22463bb562d1c8de) by [@jmheik](https://github.com/jmheik)) -- folly dependency is now at `v2018.10.22.00` ([a316dc6ec3](https://github.com/facebook/react-native/commit/a316dc6ec34655981c0f226186f4fb668e4a01e2), [287934dba9](https://github.com/facebook/react-native/commit/287934dba943cd954164bde8b06f9ba85940b45f), and [a70625abd7](https://github.com/facebook/react-native/commit/a70625abd7bf4fba3dafb8a969a73854b7ddcd42) by [@Kudo](https://github.com/Kudo) and [@radko93](https://github.com/radko93)) -- React is set to `16.6.3` now via sync for revisions 4773fdf...6bf5e85 ([0cb59b5c23](https://github.com/facebook/react-native/commit/0cb59b5c23b76771a30f59cdcedaa3c95c4dd280) and [073ad6a036](https://github.com/facebook/react-native/commit/073ad6a0367c3156e03680c0ab0648feed2bf89c) by [@yungsters](https://github.com/yungsters)) -- Clearer error messages when hot reloading ([c787866d64](https://github.com/facebook/react-native/commit/c787866d644be4c8d30bb17c237a50fdd6e1a82d) by [@alexkirsz](https://github.com/alexkirsz)) -- Allow CxxModules to implement functions which take two callbacks ([8826d8b233](https://github.com/facebook/react-native/commit/8826d8b233c1e3325a575d5012b713c4786e6062) by [@acoates-ms](https://github.com/acoates-ms)) - -#### Breaking Changes 💥 - -- Public methods of components converted to ES6 classes are no longer bound to their component instance. For `ScrollView`, the affected methods are `setNativeProps`, `getScrollResponder`, `getScrollableNode`, `getInnerViewNode`, `scrollTo`, `scrollToEnd`, `scrollWithoutAnimationTo`, and `flashScrollIndicators`. For `CameraRollView`, the affected methods are: `rendererChanged`. For `SwipeableRow`, the affected methods are: `close`. Therefore, it is no longer safe to pass these method by reference as callbacks to functions. Auto-binding methods to component instances was a behaviour of `createReactClass` that we decided to not preserve when switching over to ES6 classes. (you can refer to [this example](https://github.com/react-native-community/react-native-releases/issues/81#issuecomment-459252692)) -- Native Modules in Android now require `@ReactModule` annotations to access `.getNativeModule` method on the `ReactContext`. This is how your updated Native Module should look like: - - ```diff - // CustomModule.java - - // ... - + import com.facebook.react.module.annotations.ReactModule; - - + @ReactModule(name="CustomBridge") - public class CustomModule extends ReactContextBaseJavaModule { - // ... - - @Override - public String getName() { - return "CustomBridge"; - } - - // ... - } - ``` - -#### Android specific - -- Optimize `PlatformConstants.ServerHost`, `PlatformConstants.isTesting`, and `PlatformConstants.androidID` for performance ([2bf0d54f15](https://github.com/facebook/react-native/commit/2bf0d54f155c28244fa60230871b3eed60a20c6d), [339d9d3afb](https://github.com/facebook/react-native/commit/339d9d3afba45bb28073db59e365caea37258891), and [9f9390ddfc](https://github.com/facebook/react-native/commit/9f9390ddfccab706ff2d346fdbd408c1cfc1c312) by [@stepanhruda](https://github.com/stepanhruda), [@fkgozali](https://github.com/fkgozali), and [@axe-fb](https://github.com/axe-fb)) - -#### iOS specific - -- Suppress yellow box about missing export for native modules ([5431607c6d](https://github.com/facebook/react-native/commit/5431607c6d4983e0adccf0192dd4dc4f5dc85443) by [@fkgozali](https://github.com/fkgozali)) - -### Removed - -- Remove `UIManager.measureViewsInRect()` ([d6236796b2](https://github.com/facebook/react-native/commit/d6236796b285e6ad19c53c5308a0ad9c10792a05) by [@shergin](https://github.com/shergin)) - -### Fixed - -- Fix potential UI thread stalling scenario from Yoga JNI bindings ([2a8f6c3028](https://github.com/facebook/react-native/commit/2a8f6c3028feec7fc9a01cbdfad45955c4771bf8) by [@davidaurelio](https://github.com/davidaurelio)) -- Fix crash happening due to race condition around bridge cxx module registry ([188cbb04ad](https://github.com/facebook/react-native/commit/188cbb04ad264aea32ae235b85b61e626b767b83), [188cbb04ad](https://github.com/facebook/react-native/commit/188cbb04ad264aea32ae235b85b61e626b767b83), and [188cbb04ad](https://github.com/facebook/react-native/commit/188cbb04ad264aea32ae235b85b61e626b767b83) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Fix **View** and **Text**'s displayName; show the specific name rather than generic "Component" ([7a914fcef4](https://github.com/facebook/react-native/commit/7a914fcef4ae035221e1f984c104ba20430d6fad) by [@rajivshah3](https://github.com/rajivshah3)) -- Fix `react-native init --help` so that it doesn't return `undefined` ([58732a88b6](https://github.com/facebook/react-native/commit/58732a88b629b40b2d223a76fac46ecee5ae7295) by [@ignacioola](https://github.com/ignacioola)) -- Fix `react-native --sourceExts` ([ce860803a4](https://github.com/facebook/react-native/commit/ce860803a4341c4121a0bb504dc669349ac0db35) by [@elyalvarado](https://github.com/elyalvarado)) -- Fix accidental showing of **Modal** when `visible` prop is undefined or null ([cc13a7367b](https://github.com/facebook/react-native/commit/cc13a7367b08bd766749ddbfaacc25ade1f33a8f) by [@MateusAndrade](https://github.com/MateusAndrade)) -- Fix crash during **VirtualizedList** pagination ([5803772017](https://github.com/facebook/react-native/commit/580377201793314ca643250c1bd7cf1c47d49920)) -- Fix scenario where removing a module with remote debugging and Delta bundles may cause incorrect stack traces ([bea57d871f](https://github.com/facebook/react-native/commit/bea57d871f6b5bed76d1625b3e3f483695bd13e9) by [@alexkirsz](https://github.com/alexkirsz)) -- Fix regression in **StyleSheet** `setStyleAttributePreprocessor` ([04085337bc](https://github.com/facebook/react-native/commit/04085337bc47392922c7911b95b8fdaea98800e8) by [@brentvatne](https://github.com/brentvatne)) -- Fix React Native AsyncMode and DevTools ([aacb06c594](https://github.com/facebook/react-native/commit/aacb06c594dcd4581918035f713a69cf73bf125b) by [@bvaughn](https://github.com/bvaughn)) - -#### Android specific - -- Fix crash when removing root nodes ([b649fa96a0](https://github.com/facebook/react-native/commit/b649fa96a088a9e8ccbf3f979ebfa4a5e28a066f) by [@ayc1](https://github.com/ayc1)) -- Fix various **ReactInstanceManager** deadlocks and race conditions ([df7e8c64ff](https://github.com/facebook/react-native/commit/df7e8c64ff8f5ff739fba2ba5ed6b0610567235e), [df7e8c64ff](https://github.com/facebook/react-native/commit/df7e8c64ff8f5ff739fba2ba5ed6b0610567235e), and [be282b5287](https://github.com/facebook/react-native/commit/be282b5287f7eecf8a3fd14b06ab36454dbba5fe) by [@ayc1](https://github.com/ayc1)) -- Fix IllegalArgumentException when dismissing ReactModalHostView and DialogManager ([e57ad4ee37](https://github.com/facebook/react-native/commit/e57ad4ee37b02cd4c9e10a97d7a1d2b799204d7d) and [38e01a20c3](https://github.com/facebook/react-native/commit/38e01a20c343e60d5f8cd92fb26454e9940565df) by [@mdvacca](https://github.com/mdvacca)) -- Fix incorrect merged asset path with flavor for Android Gradle Plugin 3.2 ([e90319e9fa](https://github.com/facebook/react-native/commit/e90319e9fa18661144ad29faf36efba3750edb32) by [@yatatsu](https://github.com/yatatsu)) -- Fix HTTP connection ontimeout callback ([a508134724](https://github.com/facebook/react-native/commit/a50813472450f51d2ef24b40be99a22beefec33c)) -- Fix websocket properly closing when remote server initiates close ([2e465bca15](https://github.com/facebook/react-native/commit/2e465bca158ae9cfa89448e2a3bb8cc009397ac8) by [@syaau](https://github.com/syaau)) -- Fix compatibility issue for Android 16 device ([5939d078a0](https://github.com/facebook/react-native/commit/5939d078a01edc9f83fce102317540ffbcac17c1), [f22473e9e9](https://github.com/facebook/react-native/commit/f22473e9e9f73605cd27c5e38298bd793478c84d), and [f22473e9e9](https://github.com/facebook/react-native/commit/f22473e9e9f73605cd27c5e38298bd793478c84d) by [@gengjiawen](https://github.com/gengjiawen)) -- Fix issue where `Image.resizeMode` isn't respected while source is loading, resulting in unexpected padding ([673ef39561](https://github.com/facebook/react-native/commit/673ef39561ce6640e447fa40299c263961e4f178) by [@dulmandakh](https://github.com/dulmandakh)) -- Fix Android 28's inverted **ScrollView** so that momentum is in the proper direction ([b971c5beb8](https://github.com/facebook/react-native/commit/b971c5beb8c7f90543ea037194790142f4f57c80) by [@mandrigin](https://github.com/mandrigin)) -- Fix HTTP connection timeout callback to be appropriately called ([a508134724](https://github.com/facebook/react-native/commit/a50813472450f51d2ef24b40be99a22beefec33c)) -- Fix compatibility issue with Android 16 device ([5939d078a0](https://github.com/facebook/react-native/commit/5939d078a01edc9f83fce102317540ffbcac17c1) by [@gengjiawen](https://github.com/gengjiawen)) -- Fix crash when releasing RN views and removing root nodes([83405ff316](https://github.com/facebook/react-native/commit/83405ff3167eaba6fa59ca52c54943221a05ee09) and [b649fa96a0](https://github.com/facebook/react-native/commit/b649fa96a088a9e8ccbf3f979ebfa4a5e28a066f) by [@ayc1](https://github.com/ayc1)) -- Close websocket properly when remote server initiates close ([2e465bca15](https://github.com/facebook/react-native/commit/2e465bca158ae9cfa89448e2a3bb8cc009397ac8) by [@syaau](https://github.com/syaau)) -- Workaround a wrong fling direction for inverted ScrollViews on Android P ([b971c5beb8](https://github.com/facebook/react-native/commit/b971c5beb8c7f90543ea037194790142f4f57c80) by [@mandrigin](https://github.com/mandrigin)) -- Fix **Image** to respect `resizeMode` for `defaultSource` images rather than showing padding while loading ([673ef39561](https://github.com/facebook/react-native/commit/673ef39561ce6640e447fa40299c263961e4f178) by [@dulmandakh](https://github.com/dulmandakh)) - -#### iOS specific - -- Fix case where content of inline views didn't get relaid out ([798517a267](https://github.com/facebook/react-native/commit/798517a267841675956cb52a1c0ae493a913962a) by [@rigdern](https://github.com/rigdern)) -- Fix issue with **ImagePickerIOS**'s inconsistent image when using the front-facing camera ([4aeea4d2dc](https://github.com/facebook/react-native/commit/4aeea4d2dc14cf02dc3766043e2938bf367c6170)) -- Fix race condition and crash around shutdown of the JSC for iOS 11 and earlier ([bf2500e38e](https://github.com/facebook/react-native/commit/bf2500e38ec06d2de501c5a3737e396fe43d1fae) by [@mhorowitz](https://github.com/mhorowitz)) -- Fix crash in **NetInfo**'s \_firstTimeReachability ([eebc8e230a](https://github.com/facebook/react-native/commit/eebc8e230a9f72c3dde34a5cfd59bbffba55e53d) by [@mmmulani](https://github.com/mmmulani)) -- Fix case where inline view is visible even though it should have been truncated ([70826dbafc](https://github.com/facebook/react-native/commit/70826dbafcb00c08e0038c5066e33848141be77b) by [@rigdern](https://github.com/rigdern)) -- Fix crash with **ScrollView** related to content offsets ([585f7b916d](https://github.com/facebook/react-native/commit/585f7b916d63b7b4d22a7347334765ffcd7945e9) by [@shergin](https://github.com/shergin)) -- Fix an issue where **CameraRoll** wasn't showing the front-facing camera consistently during capture and preview ([4aeea4d2dc](https://github.com/facebook/react-native/commit/4aeea4d2dc14cf02dc3766043e2938bf367c6170)) -- Fix case where inline view is visible even though it should have been truncated ([70826dbafc](https://github.com/facebook/react-native/commit/70826dbafcb00c08e0038c5066e33848141be77b) by [@rigdern](https://github.com/rigdern)) - -### Known issues - -It is possible that you'll face an AAPT error regarding missing resources, [here](https://github.com/infinitered/ignite-andross/issues/244) is an example of this error, in this case, you should try to update the build tools versions to `buildToolsVersion = "28.0.2"` in your android/build.gradle file. If you maintain a react-native library which uses native code you should avoid using hardcoded versions of the build tools and use the packaged version numbers, here is an example you can [follow](https://github.com/react-native-community/react-native-linear-gradient/blob/master/android/build.gradle) - -## v0.57.8 - -**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.3"`. - -Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/71) for cherry-picking commits - you can participate to the decision process for the next release [here](https://github.com/react-native-community/react-native-releases/issues/75). - -### Added - -- Fix: Add displayName to ActivityIndicator (#22417) ([53da585832](https://github.com/facebook/react-native/commit/53da5858326bbddd2df112f86b2c1e935adc3882)) - -### Changed - -- Switch: Improve Accessibility ([0c8db08f51](https://github.com/facebook/react-native/commit/0c8db08f519fdf5162dff1d9a18b58885c4c7d2f) by [@yungsters](https://github.com/yungsters)) -- React sync for revisions 3ff2c7c...6bf5e85 ([073ad6a036](https://github.com/facebook/react-native/commit/073ad6a0367c3156e03680c0ab0648feed2bf89c) by [@yungsters](https://github.com/yungsters)) - -#### iOS specific - -- Extend reason message for `RCTFatalException` (#22532) ([2831d9ef61](https://github.com/facebook/react-native/commit/2831d9ef614280d08699f3134eeaeda84c30234e) by [@zackzachariah](https://github.com/zackzachariah)) - -### Removed - -- Remove trailing slash from origin header if no port is specified (#22290) ([cbe7d41f3f](https://github.com/facebook/react-native/commit/cbe7d41f3f509aaa8b8b0819b0d8ad4996fd7296)) - -### Fixed - -- Fix text alpha bug ([fd78eee11b](https://github.com/facebook/react-native/commit/fd78eee11b71799aa7fa57bbd70d59c6c642c3b3) by [@necolas](https://github.com/necolas)) -- fix possible NPE in StatusBarModule ([0f3be77b7d](https://github.com/facebook/react-native/commit/0f3be77b7d4177c8f94d775bf8ef2a2b68f1e828) by [@mdvacca](https://github.com/mdvacca)) -- Fixes animated gifs incorrectly looping/not stopping on last frame (#21999) ([de759b949e](https://github.com/facebook/react-native/commit/de759b949e4aa4904fd60a2fcbb874a3c857b50c) by [@staufman](https://github.com/staufman)) -- Fix ListEmptyComponent is rendered upside down when using inverted flag. (#21496) ([198eb02697](https://github.com/facebook/react-native/commit/198eb0269781803cc16254916b0477916afbcb0e) by [@hyochans](https://github.com/hyochans)) -- Fix bug in comparison logic of object property (#22348) ([c3b3eb7f73](https://github.com/facebook/react-native/commit/c3b3eb7f73b0fb4035d4b2478bf9827caf746372) by [@vreality64](https://github.com/vreality64)) -- Fix dispatch of OnLayout event for first render ([844e11967d](https://github.com/facebook/react-native/commit/844e11967d9292bd5cfe423d0fd57e34388f2337) by [@mdvacca](https://github.com/mdvacca)) -- KeyboardAvoidingView: Duration cannot be less then 10ms (#21858) ([87b6533937](https://github.com/facebook/react-native/commit/87b65339379362f9db77ae3f5c9fa8934da34b25)) -- default hitSlop values to 0 (#22281) ([f6d3a61677](https://github.com/facebook/react-native/commit/f6d3a6167730cc9253b796b859d8f1f33f821687) by [@Taylor123](https://github.com/Taylor123)) - -#### iOS specific - -- Fixed for supporting mediaPlaybackRequiresUserAction under iOS 10. (#22208) ([c45d290b07](https://github.com/facebook/react-native/commit/c45d290b079f95466ad4054acf7b93c66cabc429) by [@ifsnow](https://github.com/ifsnow)) -- Use main.jsbundle in iOS template for production build (#22531) ([a2ef5b85d8](https://github.com/facebook/react-native/commit/a2ef5b85d8c46cefd5873bf5fc6dddabf1d51d13) by [@radeno](https://github.com/radeno)) -- Use relative path for SCRIPTDIR (#22598) ([0314fca63a](https://github.com/facebook/react-native/commit/0314fca63a035c95864e5b198e1fbd9a5ee1d2a7) by [@sunnylqm](https://github.com/sunnylqm)) -- Fix UIScrollView crash ([585f7b916d](https://github.com/facebook/react-native/commit/585f7b916d63b7b4d22a7347334765ffcd7945e9) by [@shergin](https://github.com/shergin)) -- Avoid using `-[UITextView setAttributedString:]` while user is typing (#19809) ([f77aa4eb45](https://github.com/facebook/react-native/commit/f77aa4eb459b9dcb7f0b558ad3f04e0c507955e9)) - -### Security - -- Bump ws package to 1.1.5 due to vulnerability issues (#21769) ([96ce6f9538](https://github.com/facebook/react-native/commit/96ce6f9538ed3559ffea6040a47b1d6a30546ab9) by [@prog1dev](https://github.com/prog1dev)) - -## v0.57.7 - -**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.1"`. - -This patch release fixes version 0.57.6 about losing focus in `TextInput` because of [ada7089066](https://github.com/facebook/react-native/commit/ada70890663503b65b42bb5f6f98d3df412ecdc4). - -Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/64) for cherry-picking commits. - -## v0.57.6 - -**INFO NOTE**: It's highly recommended that you skip this version and upgrade to 0.57.7. - -**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.1"`. -This patch release fixes a number of crashes, resolves build issues (both for iOS and Android). Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/64) for cherry-picking commits. - -### Added - -#### iOS specific - -- Add iOS 12 textContentType options (#21079) ([644fc57fad](https://github.com/facebook/react-native/commit/644fc57fad4b163e96c3b3d6ec441c7b566d2d43) by [@ultramiraculous](https://github.com/ultramiraculous)) - -### Removed - -- Remove useless additional blur call (#22156) ([ada7089066](https://github.com/facebook/react-native/commit/ada70890663503b65b42bb5f6f98d3df412ecdc4)) - -### Fixed - -- Improving Modal `visible` prop check to handle undefined and null (#22072) ([cc13a7367b](https://github.com/facebook/react-native/commit/cc13a7367b08bd766749ddbfaacc25ade1f33a8f) by [@MateusAndrade](https://github.com/MateusAndrade)) -- Fix crash in nativeInjectHMRUpdate (#22412) ([0b4fd621e3](https://github.com/facebook/react-native/commit/0b4fd621e3ab511510d6852af67183a3581d1aad) by [@vovkasm](https://github.com/vovkasm)) -- Fix IllegalArgumentException when dismissing ReactModalHostView ([e57ad4ee37](https://github.com/facebook/react-native/commit/e57ad4ee37b02cd4c9e10a97d7a1d2b799204d7d) by [@mdvacca](https://github.com/mdvacca)) -- Fix regression in StyleSheet.setStyleAttributePreprocessor (#22262) ([04085337bc](https://github.com/facebook/react-native/commit/04085337bc47392922c7911b95b8fdaea98800e8) by [@brentvatne](https://github.com/brentvatne)) -- Fix React Native AsyncMode and DevTools ([f41383fb6d](https://github.com/facebook/react-native/commit/f41383fb6d6d0858e1b09dda79a74632d7932d07) by [@bvaughn](https://github.com/bvaughn)) -- CxxReact: Silence 'unused lambda capture' warnings in open-source (#22240) ([0c0540965a](https://github.com/facebook/react-native/commit/0c0540965ad9e3cdd9af16f606e141eca8ab2193) by [@empyrical](https://github.com/empyrical)) - -#### Android specific - -- Fixed HTTP connection timeout on Android (#22164) ([a508134724](https://github.com/facebook/react-native/commit/a50813472450f51d2ef24b40be99a22beefec33c)) -- resizeMode applies to Image.defaultSource (#22216) ([673ef39561](https://github.com/facebook/react-native/commit/673ef39561ce6640e447fa40299c263961e4f178) by [@dulmandakh](https://github.com/dulmandakh)) -- Android: Close websocket properly when remote server initiates close (#22248) ([2e465bca15](https://github.com/facebook/react-native/commit/2e465bca158ae9cfa89448e2a3bb8cc009397ac8) by [@syaau](https://github.com/syaau)) -- Workaround a wrong fling direction for inverted ScrollViews on Android P (#21117) ([b971c5beb8](https://github.com/facebook/react-native/commit/b971c5beb8c7f90543ea037194790142f4f57c80) by [@mandrigin](https://github.com/mandrigin)) -- Fix crash when releasing RN views ([83405ff316](https://github.com/facebook/react-native/commit/83405ff3167eaba6fa59ca52c54943221a05ee09) by [@ayc1](https://github.com/ayc1)) - -#### iOS specific - -- iOS: Support inline view truncation (#21456) ([70826dbafc](https://github.com/facebook/react-native/commit/70826dbafcb00c08e0038c5066e33848141be77b) by [@rigdern](https://github.com/rigdern)) -- NetInfo: try to solve crash with releasing \_firstTimeReachability ([eebc8e230a](https://github.com/facebook/react-native/commit/eebc8e230a9f72c3dde34a5cfd59bbffba55e53d) by [@mmmulani](https://github.com/mmmulani)) -- Generate ip.txt before SKIP_BUNDLING check (#20554) ([9c1ea45d38](https://github.com/facebook/react-native/commit/9c1ea45d38a6ec731894443debe8879fa3876ab7) by [@keatongreve](https://github.com/keatongreve)) -- Revert [Performance improvement for loading cached images on iOS ] ([7eeb305933](https://github.com/facebook/react-native/commit/7eeb305933fca695c5a15d675bb10569c3385109) by [@kelset](https://github.com/kelset)) -- Fix inability to remove 'Disabled' state from AccessibilityStates ([5eaa2d29c0](https://github.com/facebook/react-native/commit/5eaa2d29c0c4c633a40f7241408737c754edea84)) - -## v0.57.5 - -**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.1"`. - -This patch release fixes a number of crashes, resolves build issues (both for iOS and Android), and brings React to v16.6.1. Thanks everyone who contributed code or participated in the [discussion](https://github.com/react-native-community/react-native-releases/issues/54) for cherry-picking commits. - -### Changed - -- React is now at v16.6.1 ([8325e09e5c](https://github.com/facebook/react-native/commit/8325e09e5cd8538fded1b5a1b4fff1854e17eb22) and [76c99f20e3](https://github.com/facebook/react-native/commit/76c99f20e39ef1b5fa93487bc8c82e7c6aede5dd) by [@yungsters](https://github.com/yungsters)) - -#### iOS specific - -- Performance improvement for loading cached images ([54f7eb3424](https://github.com/facebook/react-native/commit/54f7eb34243715a1d4bc821ccbadeec12486d22c) and [3a98318c91](https://github.com/facebook/react-native/commit/3a98318c91283a1bba35c0bca93b975d4a550330) by [@esamelson](https://github.com/esamelson) and others) - -### Fixed - -- Fix crash in **VirtualizedList** during pagination ([5803772017](https://github.com/facebook/react-native/commit/580377201793314ca643250c1bd7cf1c47d49920)) -- Fix polyfilling of **regeneratorRuntime** to avoid setting it to undefined in some situations ([2a7e02edf6](https://github.com/facebook/react-native/commit/2a7e02edf64c20410b2f95f35e313279545b40db) by [@rafeca](https://github.com/rafeca)) -- Fix **View**, **Text**, and **ActivityIndicator**'s `displayName` ([7a914fcef4](https://github.com/facebook/react-native/commit/7a914fcef4ae035221e1f984c104ba20430d6fad) and [53da585832](https://github.com/facebook/react-native/commit/53da5858326bbddd2df112f86b2c1e935adc3882) by [@rajivshah3](https://github.com/rajivshah3) and others) -- Fix crash that happens when a component throws an exception that contains a null message ([6debfdf6d6](https://github.com/facebook/react-native/commit/6debfdf6d6172cec2d87fd1e780c3b347d41dc1d) by [@mdvacca](https://github.com/mdvacca)) - -#### Android specific - -- Fix incorrect merged asset path with flavor for Android Gradle Plugin 3.2 ([e90319e9fa](https://github.com/facebook/react-native/commit/e90319e9fa18661144ad29faf36efba3750edb32) by [@yatatsu](https://github.com/yatatsu)) -- Fix crash in **ReadableNativeArray.getType** when size of ReadableNativeArray's length > 512 ([09c78fe968](https://github.com/facebook/react-native/commit/09c78fe968e1bb71108c4058e76ebf70178e5a8b) by [@dryganets](https://github.com/dryganets)) - -#### iOS specific - -- Fix crash in rapid use of **NetInfo.getCurrentConnectivity** ([67afaefa78](https://github.com/facebook/react-native/commit/67afaefa78c314b38249a7e2758e0af38c18f34a) by [@mmmulani](https://github.com/mmmulani)) -- Fix Xcode 10 errors relating to third-party ([277c19c93e](https://github.com/facebook/react-native/commit/277c19c93eacf3e3ce63f71236fd399214d6e6d0) by [@mmccartney](https://github.com/mmccartney)) -- Fix build errors when path to `$NODE_BINARY` contains spaces ([7d4e94edcc](https://github.com/facebook/react-native/commit/7d4e94edccfc2f642fcbd1d6aa00756f02e3a525) by [@sundbry](https://github.com/sundbry)) -- Fix case where content of inline views didn't get relaid out ([798517a267](https://github.com/facebook/react-native/commit/798517a267841675956cb52a1c0ae493a913962a) by [@rigdern](https://github.com/rigdern)) -- Fix **InputAccessoryView**'s safe area when not attached to a **TextInput** ([2191eecf54](https://github.com/facebook/react-native/commit/2191eecf54b5c4bf278dfaf23fec46d44ac9a1f0) by [@janicduplessis](https://github.com/janicduplessis)) - -## v0.57.4 - -**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.0-alpha.8af6728"` (next version, 0.57.5, will update to `16.6.0`, and it will come soon). Also, please check the _Known issues_ section below, especially if you are using Xcode 10. - -Thanks to everyone that contributed to the [discussion](https://github.com/react-native-community/react-native-releases/issues/48) for cherry-picking the commits that landed in this release, and the developers who submitted those commits! - -### Added: new features - -#### Android specific additions - -- Android textTransform style support ([22cf5dc566](https://github.com/facebook/react-native/commit/22cf5dc5660f19b16de3592ccae4c42cc16ace69) by Stephen Cook) - -### Changes: existing functionality that is now different - -- Add deprecation notice to SwipeableListView ([99471f87b9](https://github.com/facebook/react-native/commit/99471f87b944b26bbdaa0fb0881db91c1118b741) by [@TheSavior](https://github.com/TheSavior)) - -#### Android specific changes - -- Consolidate native dependencies versions ([ba608a2db7](https://github.com/facebook/react-native/commit/ba608a2db786a8e983a6e30b31662fac254286c0) by [@dulmandakh](https://github.com/dulmandakh)) -- bump okhttp3 to 3.11 ([10fc548809](https://github.com/facebook/react-native/commit/10fc548809cc08db209ae6696b723341925137d1) by [@dulmandakh](https://github.com/dulmandakh)) -- Android: Send `` metrics in onTextLayout events ([737f93705c](https://github.com/facebook/react-native/commit/737f93705ca8b5d3fdd207f870cf27adcf1e885b) by [@mmmulani](https://github.com/mmmulani)) -- Use TextLegend example in Android as well ([335927db44](https://github.com/facebook/react-native/commit/335927db44fe47e20db4503a1ab5fcf8d62144a8) by [@mmmulani](https://github.com/mmmulani)) - -#### iOS specific changes - -- Bump xcode@1.0.0 ([b9514995a2](https://github.com/facebook/react-native/commit/b9514995a26b4c3f6d555257740457dd4d6cfeae) by [@peat-psuwit](https://github.com/peat-psuwit)) -- Text: send metrics after rendering (iOS) ([737f93705c](https://github.com/facebook/react-native/commit/737f93705ca8b5d3fdd207f870cf27adcf1e885b) by [@mmmulani](https://github.com/mmmulani)) -- Allow specifying iOS version for run-ios with simulator option ([0fab27cbac](https://github.com/facebook/react-native/commit/0fab27cbaca57b90119ab36104af4d0b3052ae30) by [@elyalvarado](https://github.com/elyalvarado)) -- Relax the requirement that lazy module cannot be initialized on the main thread ([dbc864c9cd](https://github.com/facebook/react-native/commit/dbc864c9cd95f9df268d85a642742e84e2360db4) by [@spredolac](https://github.com/spredolac)) - -### Fixed: bugs that have been resolved - -- Fix crashes on invalid regex ([298f14da12](https://github.com/facebook/react-native/commit/298f14da1210460b3e25c6002e8d1aa5f7b4e0ef) by [@RSNara](https://github.com/RSNara)) -- Fix pull to refresh refresh component clipping on Android ([8a3a0ad2d0](https://github.com/facebook/react-native/commit/8a3a0ad2d0f894a3d8c1e403a9336dab17c2dde8) by Andy Huang) -- ListView requestAnimationFrame leak ([70b5eb3aa2](https://github.com/facebook/react-native/commit/70b5eb3aa27822fa11571c3d8d3628ecf03268ab) by [@exced](https://github.com/exced)) - -#### Android specific fixes - -- reverted [Update bad method](https://github.com/facebook/react-native/commit/1592a8d42411d1f91c8ceb738c0533c1cee73f71) -- Fix accessibility role crash ([1f96ff62cf](https://github.com/facebook/react-native/commit/1f96ff62cf786f93c91e6625bf2b819077902251) by Haseeb Saeed) -- Fix accessibilityRole value lookup ([1f96ff62cf](https://github.com/facebook/react-native/commit/1f96ff62cf786f93c91e6625bf2b819077902251) by [@ayc1](https://github.com/ayc1)) -- Fix DynamicFromMap object pool synchronization ([b0d68c0bb9](https://github.com/facebook/react-native/commit/b0d68c0bb971a44dfdf7722682933f1e96e1cd45) by [@haitaoli](https://github.com/haitaoli)) -- Back out "[react-native][pr] Rounded corner rendering fixed on Android N." ([bb407fa1ec](https://github.com/facebook/react-native/commit/bb407fa1ec0bd0367373961fdc0e840150840068) by Jonathan Lee) -- Fix onTextLayout metrics on Android when using alignText ([1c240ae898](https://github.com/facebook/react-native/commit/1c240ae898e26534b8d9a09a334dec02e96faa05) by [@mmmulani](https://github.com/mmmulani)) -- Cleaning up imports in ViewGroupManager ([082a869dae](https://github.com/facebook/react-native/commit/082a869daef3cf602a088d0418c185279052b8c3) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific fixes - -- Fix issue when inserting text at 0 when maxLength is set ([17415938c7](https://github.com/facebook/react-native/commit/17415938c7180a95811db949122b8ad24a442866) by [@ejanzer](https://github.com/ejanzer)) - -### Known issues - -There are a few issues that don't have a finalized solution (as it happens for 0.x projects). In particular: - -- when using Xcode 10 and `react-native init`, your build may fail due to third-party build steps ([#20774](https://github.com/facebook/react-native/issues/20774)). There is a [commit](https://github.com/facebook/react-native/commit/b44c5ae92eb08125d466cf151cb804dabfbbc690) we are planning to cherry pick in a future release that should help - in the meantime, you should be able to run these commands from the project folder to fix the issue (you should need to do it only once per project): - - ```bash - cd node_modules/react-native - scripts/ios-install-third-party.sh - cd third-party/glog-0.3.5/ - ../../scripts/ios-configure-glog.sh - ``` - -- React `16.6.0` works for the most part, aside from the Context API (check [this issue](https://github.com/facebook/react-native/issues/21975)) - and if you are eager to test the new React Hooks you will have to be patient, as they are not production ready and `16.7.alpha` is **not** yet [supported](https://github.com/facebook/react-native/issues/21967) by React Native. - -## v0.57.3 - -**NOTE WELL**: when you upgrade to this version you **NEED** to upgrade `react` and `react-test-renderer` to version `"16.6.0-alpha.8af6728"`. Also, please check the _Known issues_ section below, especially if you are using Xcode 10. - -Thanks to everyone that contributed to the [discussion](https://github.com/react-native-community/react-native-releases/issues/46) for cherry-picking the commits that landed in this release, and the developers who submitted those commits! - -### Added: new features - -- Expose enableBabelRuntime config param externally ([89a358f347](https://github.com/facebook/react-native/commit/89a358f34786198c8a9a2d379588efd57b6a0eec) by [@rafeca](https://github.com/rafeca)) - -#### Android specific additions - -- Add test for InterpolatorType ([b7526b2095](https://github.com/facebook/react-native/commit/b7526b2095e4a5c8641e8264786d1622d6390029) by [@ejanzer](https://github.com/ejanzer)) - -### Changes: existing functionality that is now different - -- React sync for revisions ade5e69...d836010 ([fa6035bda6](https://github.com/facebook/react-native/commit/7142e9b1c5f95e82ceb04798b166318385004147) by [@yungsters](https://github.com/yungsters)) -- React: Bump Canary Version ([8258b6a280](https://github.com/facebook/react-native/commit/8258b6a2801121bebb25272bfcc5d3da1fb5ae39) by [@yungsters](https://github.com/yungsters)) -- FBJS: Upgrade to ^1.0.0 ([ee034596fe](https://github.com/facebook/react-native/commit/ee034596fecfb47ff9e6e1fc30cefb0e970e7d80) by [@yungsters](https://github.com/yungsters)) -- Bump metro@0.48.1 ([bf47589b8b](https://github.com/facebook/react-native/commit/bf47589b8be145750e954d09684370463a616779) by [@rafeca](https://github.com/rafeca)) -- Update to Detox 9 ([15c05988e9](https://github.com/facebook/react-native/commit/15c05988e980118151bdf41ed82ebb8c8e30a0f3) by [@kelset](https://github.com/kelset)) -- Add Deprecation Warning to ListView ([e90f5fa263](https://github.com/facebook/react-native/commit/e90f5fa2630f8a89e15fa57c70ada83e75a20642) by [@TheSavior](https://github.com/TheSavior)) -- Deprecate legacyImplementation of FlatList ([3aa8f09b44](https://github.com/facebook/react-native/commit/3aa8f09b4437eab8b91429b7325f8a6173ffa49a) by [@TheSavior](https://github.com/TheSavior)) - -#### Android specific changes - -- bump Android NDK to r17c ([436cf154bb](https://github.com/facebook/react-native/commit/436cf154bb9cf4fc0bcafd7115d33544ce36b759) by [@dulmandakh](https://github.com/dulmandakh)) -- Resolve protocol http, https when not in lowercase ([d00bdb9bb8](https://github.com/facebook/react-native/commit/d00bdb9bb8b9b11bce900689c7e28cebd2eb0807) by [@hyunjongL](https://github.com/hyunjongL)) -- Normalize scheme for URL on Android ([4b6f02ea75](https://github.com/facebook/react-native/commit/4b6f02ea758a9ab5853a29ebfc054eaa98e6dc53) by [@radeno](https://github.com/radeno)) - -#### iOS specific changes - -- Bump up the buffer size and show a warning if the trace might be truncated ([1fc8a46570](https://github.com/facebook/react-native/commit/1fc8a46570561a32657ffccb0f5a12c6f4d6a3dd) by [@alexeylang](https://github.com/alexeylang)) - -### Fixed: bugs that have been resolved - -- Fix deprecation warning message in Switch ([997f382adc](https://github.com/facebook/react-native/commit/997f382adcc7f82fccd97ac671d13e86aef7171e) by [@radko93](https://github.com/radko93)) - -#### Android specific fixes - -- Fix default accessibility delegate ([fa6035bda6](https://github.com/facebook/react-native/commit/fa6035bda6c606868977179534cb941f26fbdb92) by [@ayc1](https://github.com/ayc1)) -- Fix accessibility role/label ([fa6035bda6](https://github.com/facebook/react-native/commit/fa6035bda6c606868977179534cb941f26fbdb92) by [@ayc1](https://github.com/ayc1)) -- When converting arguments JS->Java, handle integers correctly ([bb9b9a8b9d](https://github.com/facebook/react-native/commit/bb9b9a8b9d5868c7ab5034117b785943496f6405) by [@mhorowitz](https://github.com/mhorowitz)) -- Fix CameraRoll.getPhotos() crash on Android if device has a problematic video asset ([4768bea0cf](https://github.com/facebook/react-native/commit/4768bea0cf288cf9c8097fc498b896610728c645) by [@naxel](https://github.com/naxel)) -- Android ScrollView fix for snapToInterval not snapping to end ([6eeff75849](https://github.com/facebook/react-native/commit/6eeff75849c9b8bf91592c1b7906b4dab8fba518) by [@olegbl](https://github.com/olegbl)) -- Fix for InterpolatorType crash ([01a1004808](https://github.com/facebook/react-native/commit/01a1004808928e29a6d6c698b3b18312fed17a02) by [@ejanzer](https://github.com/ejanzer)) -- Update bad method ([1592a8d424](https://github.com/facebook/react-native/commit/1592a8d42411d1f91c8ceb738c0533c1cee73f71) by [@grabbou](https://github.com/grabbou)) - -#### iOS specific fixes - -- Dealloc first time RCTNetInfo reachability callback ([e7e63fd409](https://github.com/facebook/react-native/commit/e7e63fd4092a81beec482fc48d05f1a048801037) by [@mmmulani](https://github.com/mmmulani)) -- iOS: fix the baseline issue when displaying a mixture of different-language characters ([c1561ab441](https://github.com/facebook/react-native/commit/c1561ab4411854bef96b5d268d38002a013d6d3e) by [@BingBingL](https://github.com/BingBingL)) -- Fix artifacting on RN-drawn borders with asymmetric radii ([9e6522374b](https://github.com/facebook/react-native/commit/9e6522374bc605bb1a92ff02842878ace35e9f3d) by [@jamesreggio](https://github.com/jamesreggio)) -- check isAvailable key on simulator object ([1031872784](https://github.com/facebook/react-native/commit/1031872784e9373082797e5bf5c815816af2105b) by [@antonychan](https://github.com/antonychan)) -- ios-simulator: change default iphone version ([6d09df5b72](https://github.com/facebook/react-native/commit/6d09df5b726ac951417b87a49bc345ebc9142951) by Vitor Capretz) - -### Known issues - -There are a few issues that don't have a finalized solution. In particular, when using Xcode 10 and `react-native init`, your build may fail due to third-party build steps ([#20774](https://github.com/facebook/react-native/issues/20774)). There is an open pull request which we are testing and hope to land soon ([#21458](https://github.com/facebook/react-native/pull/21458)). In the meantime, you can find a workaround here: [https://github.com/facebook/react-native/issues/20774](https://github.com/facebook/react-native/issues/20774). - -## v0.57.2 - -Thanks to everyone that contributed to the [discussion](https://github.com/react-native-community/react-native-releases/issues/45) for cherry-picking the commits that landed in this release, and the developers who submitted those commits! - -### Added: new features - -#### Android specific additions - -- Android subpixel text ([65e4e674fc](https://github.com/facebook/react-native/commit/65e4e674fca7127fd7800ae011cab449561f475b) by [@kevinresol](https://github.com/kevinresol)) - -### Changes: existing functionality that is now different - -- ReactScrollView should account for `overflow: scroll` ([201f2f189f](https://github.com/facebook/react-native/commit/201f2f189f2c41092397e5457eda83b0764ee4cd) by [@mcolotto](https://github.com/mcolotto)) -- bump metro 0.47.0 ([4750f52b34](https://github.com/facebook/react-native/commit/4750f52b34f524cae8ca08fcacec063c0725e4de) by [@rafeca](https://github.com/rafeca)) -- Use babel runtime instead of relying on global babelHelpers and regenerator ([36033bd0ed](https://github.com/facebook/react-native/commit/36033bd0edecd20fe2ae5edd56408bcc134378e7) by [@janicduplessis](https://github.com/janicduplessis)) -- React: Upgrade to react-devtools@^3.4.0 ([25119f95c8](https://github.com/facebook/react-native/commit/25119f95c81039761dd505c216c1e499003c6294) by [@yungsters](https://github.com/yungsters)) -- Change new Date() to Date.now() to save on date allocations ([bbb2d9a5b3](https://github.com/facebook/react-native/commit/bbb2d9a5b358bc0c150fe6ff74c45594c987e949) by [@dulinriley](https://github.com/dulinriley)) -- Make config object read-only ([2c1057062e](https://github.com/facebook/react-native/commit/2c1057062e81f8b43d3f942a35371fb3db841bed) by [@rafeca](https://github.com/rafeca)) -- Cleanup the transformer flow types ([28dedfb6d6](https://github.com/facebook/react-native/commit/28dedfb6d61e64a50d78aa06ee4f744665a54c2a) by [@rafeca](https://github.com/rafeca)) -- bump metro 0.47.1 ([12ab08a5aa](https://github.com/facebook/react-native/commit/12ab08a5aab3e14c9b2fb35454b16708b8ce093d) by [@rafeca](https://github.com/rafeca)) - -#### Android specific changes - -- Android ScrollView support for `overflow: visible` ([4af4da9089](https://github.com/facebook/react-native/commit/4af4da9089e20aa84bc5660bfb37763556442a4e) by [@olegbl](https://github.com/olegbl)) -- Expose a getter for overflow setting in ReactViewGroup ([02ad56f541](https://github.com/facebook/react-native/commit/02ad56f5419675572d684c3cc8a28644f29afffa) by [@kmagiera](https://github.com/kmagiera)) -- Add workaround for Android Gradle Plugin 3.2 change to asset dir ([ff084a4e80](https://github.com/facebook/react-native/commit/ff084a4e8071adb4ff6198b32aa8a7e8e29cca1c) by [@edilaic](https://github.com/edilaic)) - -### Fixed: bugs that have been resolved - -- Fix HEAD request failing with `Invalid response for blob` ([7e9c3f77cc](https://github.com/facebook/react-native/commit/7e9c3f77cce881dbb47af266993da5a2b6e98b5b) by [@anthonyhumphreys](https://github.com/anthonyhumphreys)) -- Check if child view != null before dropping ([af181fb192](https://github.com/facebook/react-native/commit/af181fb192c83e1dd0575c24e38d8814bbf187d6) by [@chrusart](https://github.com/chrusart)) - -#### Android specific fixes - -- Fix event handlers for DPad arrows on Android TV ([4d71b1525d](https://github.com/facebook/react-native/commit/4d71b1525d357a61a1740d6de5c1b97b6527f986) by [@krzysztofciombor](https://github.com/krzysztofciombor)) -- Rounded corner rendering fixed on Android N ([748cf82c97](https://github.com/facebook/react-native/commit/748cf82c974d6cf5d5df64b6e6013211c870530c) by [@dryganets](https://github.com/dryganets)) -- Android: fix cookies lost on Android 5.0 and above ([ea53727e16](https://github.com/facebook/react-native/commit/ea53727e16223d412fcbba49df79cc68b39f5d93) by chenwenyu) -- allow zero offset when shadow radius is nonzero ([97f0e43710](https://github.com/facebook/react-native/commit/97f0e43710a990c30e14d66bf67c7d612377d3f2) by Timothy Kukulski) -- Android ScrollView fix for pagingEnabled ([e0170a9445](https://github.com/facebook/react-native/commit/e0170a944501bb487e899b92363bf5aa64b29299) by [@olegbl](https://github.com/olegbl)) - -### Removed: features that have been removed; these are breaking - -- Remove global babelHelpers and regenerator ([458d56c0a1](https://github.com/facebook/react-native/commit/458d56c0a1ac73c088660830a8bf2db65de7d9a2) by [@janicduplessis](https://github.com/janicduplessis)) -- Remove overflow hidden killswitch ([59aada873e](https://github.com/facebook/react-native/commit/59aada873e13bf0b1f5e3a10cfe9a5a45c28f9fb) by [@ayc1](https://github.com/ayc1)) -- Remove absolute path parameter from transformers ([2e0d5c87e9](https://github.com/facebook/react-native/commit/2e0d5c87e93bb970ef1c8864ca44b47b36d6ae2e) by [@rafeca](https://github.com/rafeca)) - -## v0.57.1 - -We are trying, for 0.57, to approach it as a version with a longer "support", while waiting for some features to land that will allow for [0.58 to be cut](https://github.com/react-native-community/react-native-releases/issues/41). - -Thanks to everyone that contributed to the [discussion](https://github.com/react-native-community/react-native-releases/issues/34) for cherry-picking the commits that landed in this release, and the developers who submitted those commits! - -### Added: new features - -- Expose AllowFileAccess property in WebView ([0c576ef84a](https://github.com/facebook/react-native/commit/0c576ef84a1c7f79b228f205cc687ab1b945bda1) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific additions - -- Expose scrollEnabled as iOS prop for TextInput ([b9c28c236b](https://github.com/facebook/react-native/commit/b9c28c236bc971a5fbc51a3bda09c3980d547b96) by Chun Chen) - -### Changes: existing functionality that is now different - -- Give RNPM the ability to look for plugins in `@Scoped` modules ([4b106be477](https://github.com/facebook/react-native/commit/4b106be47765dd391f7a4cc6cf0e705ae977b90a) by [empyrical](https://github.com/empyrical)) -- Upgrade babel-eslint to 9.0.0 ([44dc283bcd](https://github.com/facebook/react-native/commit/44dc283bcd0a75826d9be86cdc727e32d5697ef2) by [@rafeca](https://github.com/rafeca)) -- bump metro 0.45.6 ([7bac0565e8](https://github.com/facebook/react-native/commit/7bac0565e82981d4a6e2b500d376ba9fa8aba721) by [@rafeca](https://github.com/rafeca)) - -#### iOS specific changes - -- Making RCTIsIPhoneX() return true for the R and Max models ([5e7c3ca005](https://github.com/facebook/react-native/commit/5e7c3ca0057f6084d692e30ae4db863fb20968ff) by [@shergin](https://github.com/shergin)) -- Way to register RCT_MODULE in Plugin2.0 instead of +load ([5c160e5ded](https://github.com/facebook/react-native/commit/5c160e5dedae713c686d88d4b9d4308b596e68a7) by Jeff Thomas) -- Update RCTLinkingManager.h to explicitly state the 'nullability' of parameters ([2271d1f912](https://github.com/facebook/react-native/commit/2271d1f912435eba7da2414ea4665ba8e56c7ad7) by Warren Knox) - -### Fixed: bugs that have been resolved - -- Pass the maxWorkers config param correctly to Metro ([7a69f1aa27](https://github.com/facebook/react-native/commit/7a69f1aa272a9b71755033a80f6f4aa5e9dcbaf6) by [@rafeca](https://github.com/rafeca)) -- Fix ignored --projectRoot/watchFolders arguments (([9fca769e76](https://github.com/facebook/react-native/commit/9fca769e7666df696299b422c140d6509e726ec6) by [@oblador](https://github.com/oblador)) -- Debug only code were leaking into release builds on iOS. (([d1ff0b0cc5](https://github.com/facebook/react-native/commit/d1ff0b0cc51c31cae89689b2ad2f4b35f29531d8) by [@dryganets](https://github.com/dryganets)) - -#### iOS specific fixes - -- Fix RCTNetInfo first time connection status ([e7e63fd409](https://github.com/facebook/react-native/commit/e7e63fd4092a81beec482fc48d05f1a048801037) by [@karanjthakkar](https://github.com/karanjthakkar)) - -### Removed: features that have been removed; these are breaking - -#### iOS specific removals - -- Removing development team from Xcode project ([8103c431c8](https://github.com/facebook/react-native/commit/8103c431c897c02d47cfad1e71bb2e6ddaabbdc0) by [@hramos](https://github.com/hramos)) - -## v0.57.0 - -Welcome to the 0.57 release of React Native! This release addresses a number of issues and has some exciting improvements. We again skipped a monthly release, focused on quality by extending the release candidate phase, and let some upstream packages reach stable for inclusion. - -This release includes [599 commits by 73 different contributors](https://github.com/facebook/react-native/compare/0.56-stable...0.57-stable)! In response to feedback, we've prepared a changelog that contains only user-impacting changes. Please share your input and let us know how we can make this even more useful, and as always [let us know](https://github.com/react-native-community/react-native-releases/issues/34) if you have any feedback on this process. - -### Highlights - -#### New features - -- Accessibility APIs now support accessibility hints, inverted colors, and easier usage of defining the element's role and states; read more at [@ziqichen6's excellent blog post](https://reactnative.dev/blog/2018/08/13/react-native-accessibility-updates) -- On iOS, `WKWebView` can now be used within the `WebView` component; read more at [@rsnara's awesome blog post](https://reactnative.dev/blog/2018/08/27/wkwebview) -- Better support for out-of-tree platforms. For details, please refer to [the discussion](https://github.com/react-native-community/discussions-and-proposals/issues/21) that the community used to get this up and running (there will be a new page in the docs dedicated to it too) - huge props to @empyrical for working on this! - -#### Tooling updates - -- Android tooling has been updated to match newer configuration requirements (SDK 27, gradle 4.4, and support library 27); building with Android plugin 3.2 doesn't work due to the gradle scripts, so **please** stay on Android Studio 3.1 for now -- Support Babel 7 stable landed! Be sure to read [here](https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/) about using TypeScript and check out the [Babel 7 migration guide](https://babeljs.io/docs/en/next/v7-migration) for help migrating. -- Metro has been upgraded (with Babel 7 and better transformer support), and in the next major release we plan on having two new features (ram bundles and inline requires) optional for you all to use - you can read how it will happen [here](https://github.com/react-native-community/discussions-and-proposals/blob/master/core-meetings/2018-09-metro-meeting.md); moreover, if you have a custom packager config, we recommend you read also the "updating to this version" section. -- Flow, React, and related packages have also been updated; this includes [working support](https://github.com/facebook/react-native/commit/5491c3f942430982ce9cb6140ed1733879ed3d1d) for the [React Profiler](https://react.dev/blog/2018/09/10/introducing-the-react-profiler.html). - -#### The Slimmening is happening - -As mentioned a few times in the past, the core team is reviewing the repository to trim it to the base React Native features in order to make the whole ecosystem more maintainable (by using a _divide-et-impera_ approach, the community will move faster and enable pull requests to be reviewed and merged quicker). This change requires extracting some components into their own separate repos and removing old, unused code ([details here](https://github.com/react-native-community/discussions-and-proposals/issues/6)). - -0.57 is **not** directly affected by any changes, but we want you to know that: - -- `WebView` will be moved to its own repo at [react-native-community/react-native-webview](https://github.com/react-native-community/react-native-webview). There is already a base implementation there. Help us out by giving that a try, and expect that `WebView` will be deprecated soon -- `NavigatorIOS` will be **fully** removed from the main codebase starting 0.58.0 (via [this commit](https://github.com/facebook/react-native/commit/0df92afc1caf96100013935d50bdde359b688658)); it is now deprecated - -### Updating to this version - -1. Upgrade the version of React Native in the `package.json` from `0.56.0` to `0.57.0`, and the React version to `16.5` -2. Change the babel-preset dependency from `"babel-preset-react-native": "^5",` to `"metro-react-native-babel-preset": "^0.45.0",`, then change the `.babelrc` configuration to: - - ```JSON - { - "presets": ["module:metro-react-native-babel-preset"] - } - ``` - -3. Ensure that you have all the babel dependencies to version `^7.0.0` (you may also need to add `"babel-core": "7.0.0-bridge.0"` as a yarn resolution to ensure retro-compatibility). The Babel team has released a tool, [babel-upgrade](https://github.com/babel/babel-upgrade), that should help you in this migration. -4. Upgrading android gradle version to 4.4 - 1. In your project's `android/gradle/wrapper/gradle-wrapper.properties` file, change the `distributionUrl` to `https\://services.gradle.org/distributions/gradle-4.4-all.zip` - 2. In `android/build.gradle` file add `google()` right above `jcenter()` in both `buildscript` and `allprojects` repositories. Then change Android build tools to version 3.1.4 `classpath 'com.android.tools.build:gradle:3.1.4'` - 3. In `android/app/build.gradle` file update all your `compile` statements to be `implementation`, e.g. `implementation 'com.facebook.fresco:animated-gif:1.10.0'` - 4. Do note that when running your app from within Android Studio, you may encounter `Missing Byte Code` errors. This is due to [a known issue](https://issuetracker.google.com/issues/72811718) with version 3.1.x of the android tools plugin. You'll need to disable Instant Run to get past this error. -5. If you have a custom packager configuration via `rn-cli.config.js`, you probably need to update it to work with the updated Metro configuration structure (for full detail refer to Metro's [documentation](https://facebook.github.io/metro/docs/en/configuration)); here are some commonly encountered changes to `rn-cli.config.js`: - - ```diff - -const blacklist = require('metro/src/blacklist') - +const blacklist = require('metro-config/src/defaults/blacklist') - - // ... - - module.exports = { - + watchFolders: alternateRoots, - + resolver: { - + blacklistRE: blacklist - + }, - + transformer: { - + babelTransformerPath: require.resolve('./scripts/transformer.js'), - + }, - - getProjectRoots() { - - return [ - - path.resolve(__dirname), - - ].concat(alternateRoots) - - }, - - getBlacklistRE() { - - return blacklist; - - }, - - transformModulePath: require.resolve('./scripts/transformer.js'), - } - ``` - -6. Run `yarn` to ensure that all the new dependencies have been installed - -### Added: new features - -- Add .nvmrc and ensure node version required is compatible with ESLint 5 ([30b9d81087](https://github.com/facebook/react-native/commit/30b9d81087cb86f5fb272d00bfee63a0632009f5) by [@slorber](https://github.com/slorber)) -- Major improvements to accessibility features ([48b3d1322b](https://github.com/facebook/react-native/commit/48b3d1322b884f62eb5aeb36136bcd76c502e42d), [b5b704dc19](https://github.com/facebook/react-native/commit/b5b704dc19b80a1909d66adcd617220a98c7aace), [c36e8b3307](https://github.com/facebook/react-native/commit/c36e8b3307295690cddf74e3a41ca0ac11ac4c6b), [40f6998b67](https://github.com/facebook/react-native/commit/40f6998b6766e8aa3c038a1416e5c62cbafca109), [c1d0ccde0f](https://github.com/facebook/react-native/commit/c1d0ccde0f6f8615fce077ef7ee0867a14ca0fb7), [5eaa2d29c0](https://github.com/facebook/react-native/commit/5eaa2d29c0c4c633a40f7241408737c754edea84), [10b603fdd3](https://github.com/facebook/react-native/commit/10b603fdd34919f72304720c25d1420668a6213a), [d9eeae91a0](https://github.com/facebook/react-native/commit/d9eeae91a08123c3a458704869acd6f637fc4c53), [3cfa7ae698](https://github.com/facebook/react-native/commit/3cfa7ae69847cc3b687930346016b248f2427864), [5acb7211bb](https://github.com/facebook/react-native/commit/5acb7211bb211e0ef48334630ddccbb3f0ffa2da), [5741f77156](https://github.com/facebook/react-native/commit/5741f771562962110e105114a2c65def4baa805b), [d0b86ecb4f](https://github.com/facebook/react-native/commit/d0b86ecb4f33d6b10a99062f050a4d659db4ddfc), [e739143809](https://github.com/facebook/react-native/commit/e7391438093cd5dd5033204cdce62e66509e66e1), [c27b495a89](https://github.com/facebook/react-native/commit/c27b495a89e71ff13959eb4c34605a527514fa1e), [5aa040dfb7](https://github.com/facebook/react-native/commit/5aa040dfb780c09a6efa5d3072232dea775d432f), [03036f79f7](https://github.com/facebook/react-native/commit/03036f79f7b062ae11015b33cca3dd7e4e67dda6), [3bedc78a35](https://github.com/facebook/react-native/commit/3bedc78a35b9efc259299744f4134ac0e880d1ea), [ca01290d8e](https://github.com/facebook/react-native/commit/ca01290d8e8fe73494f317ed9f81d339e65fdea0), [121e2e5ca6](https://github.com/facebook/react-native/commit/121e2e5ca6cdb17051c6d8072072f7f480ac2015), [1bc52267f5](https://github.com/facebook/react-native/commit/1bc52267f504eb02c8744c380fa2de878b0ab79f), [48b3d1322b](https://github.com/facebook/react-native/commit/48b3d1322b884f62eb5aeb36136bcd76c502e42d), [ef3d8b23c3](https://github.com/facebook/react-native/commit/ef3d8b23c35246d4e088d532c41723e06b688f1b), [ef3d8b23c3](https://github.com/facebook/react-native/commit/ef3d8b23c35246d4e088d532c41723e06b688f1b), [50e400128e](https://github.com/facebook/react-native/commit/50e400128eba554af5de4ca267430524e3eff107), and [f39d0923c7](https://github.com/facebook/react-native/commit/f39d0923c78686118a5d268c0e659d2608d28df0) by [@ziqichen6](https://github.com/ziqichen6)) -- Add `YogaNodeProperties` implementation based on `ByteBuffer` ([0c97e75dfe](https://github.com/facebook/react-native/commit/0c97e75dfeec831abb6cb39889309d8299cdce9f) and [23657ccf5b](https://github.com/facebook/react-native/commit/23657ccf5bcab6c511903660b3c617c3b8248f20) by [@davidaurelio](https://github.com/davidaurelio)) -- Add `FlatList` and `SectionList` to Animated exports ([daa7c78055](https://github.com/facebook/react-native/commit/daa7c78055857cd2d9ea650de0c4b0f72d3f2acf) by [@yunyu](https://github.com/yunyu)) -- Adding new styling props to `FlatList`/`VirtualizedList` for `ListHeaderComponent` and `ListFooterComponent` ([a2675ced4e](https://github.com/facebook/react-native/commit/a2675ced4efe0df7745bf38908efa41d4d7a9841)) -- Added more info to Module Registry systraces ([c7fdd2701f](https://github.com/facebook/react-native/commit/c7fdd2701f7edc1a771a04c890da4d742dca6ffb) by [@axe-fb](https://github.com/axe-fb)) -- Added support for out-of-tree platform plugins via a new `haste` field in `package.json`; read more in the [docs entry](https://reactnative.dev/docs/out-of-tree-platforms) ([03476a225e](https://github.com/facebook/react-native/commit/03476a225e012a0285650780430d64fc79674f0f) by [@empyrical](https://github.com/empyrical)) -- Added `snapToOffsets` to `ScrollView` and made a number of fixes to `snapToInterval` as well ([fd744dd56c](https://github.com/facebook/react-native/commit/fd744dd56ca183933a67e8398e1d20da14a31aab) by [@olegbl](https://github.com/olegbl)) - -#### Android specific additions - -- Allow registering custom packager command handlers ([b3ef1c3a56](https://github.com/facebook/react-native/commit/b3ef1c3a5645793ef42d25bb16ef023a743a1f9f) by [@fkgozali](https://github.com/fkgozali)) -- Implement `AccessibilityInfo.setAccessibilityFocus` for Android ([be715ec705](https://github.com/facebook/react-native/commit/be715ec7053a77fa6c9087990a493d17c1155de2) by [@draperunner](https://github.com/draperunner)) -- Add Support for `overflow` style property ([b81c8b51fc](https://github.com/facebook/react-native/commit/b81c8b51fc6fe3c2dece72e3fe500e175613c5d4) and [bbdc12eda7](https://github.com/facebook/react-native/commit/bbdc12eda7dec135799b7f4c41fe678180970dd2)by [@yungsters](https://github.com/yungsters)) - -#### iOS specific additions - -- `WebView` can now use `WKWebView` internally if you pass `useWebKit={true}` ([7062e5bdb5](https://github.com/facebook/react-native/commit/7062e5bdb5582bb21d1ef890965f08cc20d292b7), [1442c265da](https://github.com/facebook/react-native/commit/1442c265da36601114ce184cd5bc322f45dc1b44), [3703927e7e](https://github.com/facebook/react-native/commit/3703927e7e12ffc8922644ea251cd6f7a384570c), [7a6dd9807c](https://github.com/facebook/react-native/commit/7a6dd9807cda45c2d60641864f2d6c8d401e8ae3), [e5f95aba9b](https://github.com/facebook/react-native/commit/e5f95aba9b23376de498456282ad17113ef44cd9), [1741fe9571](https://github.com/facebook/react-native/commit/1741fe95710556f30dc2442aaaae23e31dad4cc0), [90e85a4adc](https://github.com/facebook/react-native/commit/90e85a4adc749666f81034119f281ac54840e7df), [0022354525](https://github.com/facebook/react-native/commit/0022354525eae0a368704da65c9d0f85f33ba5fb), [03b57d9db6](https://github.com/facebook/react-native/commit/03b57d9db6509fa3e715f23c8270caf6ca091acd), [1584108805](https://github.com/facebook/react-native/commit/1584108805ca6c8eff7a77e15c8553028665b53f), [a997c0ac16](https://github.com/facebook/react-native/commit/a997c0ac16d8863333d057269a8b5e28994b84eb), [4ca949b46e](https://github.com/facebook/react-native/commit/4ca949b46ec8fd72b5305daa06fac3ef58a8fa5f), [721763020a](https://github.com/facebook/react-native/commit/721763020a4a7b4b3cad1a9c074ec2e51a8d840b), [1af17f1648](https://github.com/facebook/react-native/commit/1af17f164828b6d6fa0450af46baf945745363e7), [215fa14efc](https://github.com/facebook/react-native/commit/215fa14efc2a817c7e038075163491c8d21526fd), [bacfd92976](https://github.com/facebook/react-native/commit/bacfd9297657569006bab2b1f024ad1f289b1b27), [95801f1eda](https://github.com/facebook/react-native/commit/95801f1eda2d723d9b87760d88fa9f1a1bb33ab1), [b18fddadfe](https://github.com/facebook/react-native/commit/b18fddadfeae5512690a0a059a4fa80c864f43a3), [28b058c341](https://github.com/facebook/react-native/commit/28b058c341690bd35e1d59885762ec29614a3d45), and [78fcf7c559](https://github.com/facebook/react-native/commit/78fcf7c5598ce7f5d0d62110eb34fe5a4b962e71) by [@rsnara](https://github.com/rsnara)) -- Add `accessibilityHint` for iOS ([253b29dbd8](https://github.com/facebook/react-native/commit/253b29dbd8ddb11824866e423c00a4a68bb856f3) by [@draperunner](https://github.com/draperunner)) - -### Changes: existing functionality that is now different - -- _[BREAKING]_ In the CLI, `unbundle` is now `ram-bundle` ([ebf5aeab28](https://github.com/facebook/react-native/commit/ebf5aeab280f2ebc439ec39d25c48fdf1980cf73) by [@jeanlauliac](https://github.com/jeanlauliac)) -- Bump minimum Node version to 8.3 (#20236) ([e64e13fce3](https://github.com/facebook/react-native/commit/e64e13fce394332ce609f0def35fa573f30138e9) by [@hramos](https://github.com/hramos)) -- Updated React ([70913a4623](https://github.com/facebook/react-native/commit/70913a4623c53db8a0db578eec30cad8671f8319), [b7bb25fe4c](https://github.com/facebook/react-native/commit/b7bb25fe4c1bfbedb5b8c75725721cf901dc54b0), and [672528ffde](https://github.com/facebook/react-native/commit/672528ffde3b467ccdfd6b1ce0352f150b20c922) by [@acdlite](https://github.com/acdlite), [@hramos](https://github.com/hramos), and [@yungsters](https://github.com/yungsters)) -- Upgrade Flow to v0.76.0 ([eac34e3021](https://github.com/facebook/react-native/commit/eac34e30215d88b5fe9056f9678275b894032636) by [@gabelevi](https://github.com/gabelevi)) -- Upgrade jest to 23.4.1 ([51cf9eb3e8](https://github.com/facebook/react-native/commit/51cf9eb3e823a13304570b352b81734f069c18c3) by [@rafeca](https://github.com/rafeca)) -- Upgrade babel-eslint to v9.0.0-beta.2 with better support for Flow ([abf1188de2](https://github.com/facebook/react-native/commit/abf1188de225e4b7d36ecbad316af92ca29c85c2) by [@rubennorte](https://github.com/rubennorte)) -- Upgrade ESLint to 5.1.0 ([0f2f0cad41](https://github.com/facebook/react-native/commit/0f2f0cad41f632d1dbb0c676d5edea5db62eb01c) by [@rubennorte](https://github.com/rubennorte)) -- Upgrade Babel to v7.0.0 ([b9d1c832b0](https://github.com/facebook/react-native/commit/b9d1c832b0bb7161bcec48d655e878af609b8350), [724c7498b6](https://github.com/facebook/react-native/commit/724c7498b6f10f6fd03eb217160508001fb1c5b3) by Peter van der Zee, and [bf8e1b4ffa](https://github.com/facebook/react-native/commit/bf8e1b4ffab4958587efdf3ce97e4ebdd887a20c) by [@rubennorte](https://github.com/rubennorte) and [@rafeca](https://github.com/rafeca)) -- Metro is now at v0.45.0 ([169d6839bb](https://github.com/facebook/react-native/commit/169d6839bb32d0149036ab1641d13318c0eb6f9d), [bda84a32d0](https://github.com/facebook/react-native/commit/bda84a32d08d6de3849d6afac4cbbf309837b676), [877212e18c](https://github.com/facebook/react-native/commit/877212e18c86905feda9faa1b2508c0c39396227), [169812f9ce](https://github.com/facebook/react-native/commit/169812f9ce60317dd7320384007879be16278678), [cfeb60c19b](https://github.com/facebook/react-native/commit/cfeb60c19bd23e683f1809f6535439c81e8ed166) by [@CompuIves](https://github.com/CompuIves) and [@rafeca](https://github.com/rafeca)) -- Hide pre-bundled notification when not on dev mode ([edf71005b5](https://github.com/facebook/react-native/commit/edf71005b5a4d7cfb09eae14f5765d30b9c5704e) by [@yancouto](https://github.com/yancouto)) -- Refined `StyleSheet.compose` Flow Type ([50a481d23a](https://github.com/facebook/react-native/commit/50a481d23ae72a434849d2c85007e411b0c2bb1f) by [@yungsters](https://github.com/yungsters)) -- Catch JS bundle load failure and prevent calls to JS after that ([201ba8c69d](https://github.com/facebook/react-native/commit/201ba8c69d2defc284a04acadcd13df001028ada) by [@fkgozali](https://github.com/fkgozali)) -- Use new Metro configuration in react-native cli ([a32620dc3b](https://github.com/facebook/react-native/commit/a32620dc3b7a0ebd53feeaf7794051705d80f49e) and [aaf797ad67](https://github.com/facebook/react-native/commit/aaf797ad67b965f64450b199c554c65ad8dad351) by [@CompuIves](https://github.com/CompuIves)) -- Whitelist `react-native-dom` in haste/cli config defaults ([c4bcca6685](https://github.com/facebook/react-native/commit/c4bcca66853cd231486de61f11cbcec42427b7b2) by [@vincentriemer](https://github.com/vincentriemer)) -- In the CLI, don't override `metro.config.js` settings ([c5297c75cb](https://github.com/facebook/react-native/commit/c5297c75cb6da58a241c8f91b0d2fefbc5835a46) by [@rozele](https://github.com/rozele)) - -#### Breaking Changes - -- Public methods of Image (`blur`, `focus`, `measure`, `measureInWindow`, `measureLayout`, `setNativeProps`) are no longer bound to the image component instance. Therefore, it is unsafe to pass these methods by reference (i.e: as callbacks) to functions. So, things like `setTimeout(this._imgRef.focus, 1000)` will no longer work. Please instead do: `setTimout(() => this._imgRef.focus(), 1000)`. - -#### Android specific changes - -- `Image` source without a uri now returns null ([28c7ccf785](https://github.com/facebook/react-native/commit/28c7ccf785132458fce32c234ce777a6fe475c93) by [@himabindugadupudi](https://github.com/himabindugadupudi)) -- `targetSdkVersion` is 26 ([bfb68c09ee](https://github.com/facebook/react-native/commit/bfb68c09ee88c6e1d91d3b54c01746f9a98c7c6c) by [@dulmandakh](https://github.com/dulmandakh)) -- Upgrade NDK to r17b ([6117a6c720](https://github.com/facebook/react-native/commit/6117a6c7205c969f93d39ba02e0583881572d5fa) by [@dulmandakh](https://github.com/dulmandakh)) -- Upgrade NDK toolchain to 4.9 ([ccdd450b12](https://github.com/facebook/react-native/commit/ccdd450b1284b73bee80a9709c864816cbfc1108) by [@dulmandakh](https://github.com/dulmandakh)) -- Upgrade Android Support Library to version 27.1.1 and set compileSdkVersion to 27; buildToolsVersion comes along for the ride, too ([874cca1ac2](https://github.com/facebook/react-native/commit/874cca1ac258ec224bade999722d7a34c307def0) and [044b399e65](https://github.com/facebook/react-native/commit/044b399e6590d84065a9b186750f77bc9d851aac) by [@dulmandakh](https://github.com/dulmandakh)) -- Upgrade Android gradle plugin to 3.1.4, Gradle wrapper to 4.4 ([6e356895e7](https://github.com/facebook/react-native/commit/6e356895e79fb92640295a14483af1a430732247) and [33d20da41b](https://github.com/facebook/react-native/commit/33d20da41b814a2fb9ba02cbab8b61a819cad95b) by [@gengjiawen](https://github.com/gengjiawen) and [@dulmandakh](https://github.com/dulmandakh)) -- Upgrade to soloader 0.5.1 ([b6f2aad9c0](https://github.com/facebook/react-native/commit/b6f2aad9c0119d11e52978ff3fa9c6f269f04a14) by [@gengjiawen](https://github.com/gengjiawen)) -- Upgrade mockito to 2.19.1 ([3ea803a814](https://github.com/facebook/react-native/commit/3ea803a814f43edb3ec256dd85d778c652ca99d1) by [@dulmandakh](https://github.com/dulmandakh)) -- Upgrade glog to 0.3.5 ([b5fca80605](https://github.com/facebook/react-native/commit/b5fca806059e628edb504cb1bacf62e89ee6f102) by [@dulmandakh](https://github.com/dulmandakh)) - -### Fixed: bugs that have been resolved - -- Fixed builds on Windows machines ([3ac86c366c](https://github.com/facebook/react-native/commit/3ac86c366c91f8d62f0128057019b94a783b4249) by [@rafeca](https://github.com/rafeca)) -- Fixed building tvOS ([1f1ddd0261](https://github.com/facebook/react-native/commit/1f1ddd0261762bdeff3e747250400b208b18839b)) -- Fixed `TextInputState`'s `currentlyFocusedField()` ([b4b594cec1](https://github.com/facebook/react-native/commit/b4b594cec1d91c38faac11a90a787ae692e35296) by [@janicduplessis](https://github.com/janicduplessis)) -- `` fix for jumpy content when `initialScrollIndex` specified ([e0c73633cf](https://github.com/facebook/react-native/commit/e0c73633cfc0a62df9d39991b0df65fa5875609a) by [@rbrosboel](https://github.com/rbrosboel)) -- Fix local-cli assetRegistryPath and middlewares ([f05943de0a](https://github.com/facebook/react-native/commit/f05943de0abfc16da41163c6b91a04ecc8de8e67) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix issue with when all are `flexGrow` and `flexShrink` set to 0 except for one ([90a408ea6f](https://github.com/facebook/react-native/commit/90a408ea6ff7833e33b4058f490073e04460d00b) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) -- Fix react-native CLI's debugger UI path and metro host/port arg usage ([5067540487](https://github.com/facebook/react-native/commit/50675404873c1ffac0deedc51fe745168051148b) by [@Kureev](https://github.com/Kureev)) -- Hotfix to include `react-native-windows` in hasteImpl accepted paths ([54942746d4](https://github.com/facebook/react-native/commit/54942746d4037e1153e14fcfc95e4edc772d296a) by [@rubennorte](https://github.com/rubennorte)) -- Fix some classes of incorrect Flow errors for `Animated` ([db2159d0b3](https://github.com/facebook/react-native/commit/db2159d0b3fd57556383eff68d32d32246dd9081) by [@yunyu](https://github.com/yunyu)) -- Fixed a typo in DockerTests.md ([c1831d50cf](https://github.com/facebook/react-native/commit/c1831d50cfd35b7a7393e50bc71d8389b36021ce) by [@kant](https://github.com/kant)) -- Fix invalid use of destructuring in jest preprocessor ([9d5bd50737](https://github.com/facebook/react-native/commit/9d5bd507372c7b63e59a94383c3e3091d96409de) by [@umairda](https://github.com/umairda)) -- Fixed a CLI crash when using old versions of node ([e61176d650](https://github.com/facebook/react-native/commit/e61176d650e2b5fe51dd6cd4c429ff47a1a9b1dc) by [@keksipurkki](https://github.com/keksipurkki)) - -#### Android specific fixes - -- Fix issue with AsyncStorage not behaving properly on Android 7+ ([1b09bd7fba](https://github.com/facebook/react-native/commit/1b09bd7fba92431d63d2cecb83565491e91db396)) -- Fixed extreme `` slowness ([5017b86b52](https://github.com/facebook/react-native/commit/5017b86b525e3ef6023f0f8a88e6fd1cf98024e0) by [@gnprice](https://github.com/gnprice)) -- Fixed `` placeholder not being completely visible ([84022321c4](https://github.com/facebook/react-native/commit/84022321c437e597660ecd8a773e51bdf8855f4e) and [86f24ccf71](https://github.com/facebook/react-native/commit/86f24ccf71f4c41904838c8c7e13268c300fd745) by [@jainkuniya](https://github.com/jainkuniya)) -- Fix Horizontal ``'s scroll position during layout changes with RTL content ([de573277bf](https://github.com/facebook/react-native/commit/de573277bf64703aefdeb52db2c2524b2c241bab)) -- Fix Horizontal `` overflow issue ([d5465a9a0a](https://github.com/facebook/react-native/commit/d5465a9a0a840f7e759bb8fb6679b01017eb3d05)) -- Fixing crash on SDK 15 on ReactTextInputLocalData ([1bb2bead8b](https://github.com/facebook/react-native/commit/1bb2bead8bef850037c8b72209cd72a442572821)) -- Fix Drawing Rect for ReactScrollView ([6a16bec882](https://github.com/facebook/react-native/commit/6a16bec882cba809bdf9027367b76f6543b6617d) by [@yungsters](https://github.com/yungsters)) -- Fixed NoSuchKeyException Thrown From ReadableNativeMap bysafely unwrapping ReadableMap by defaulting to 0 if key not present ([1a6666a116](https://github.com/facebook/react-native/commit/1a6666a116fd8b9e8637956de2b41a1c315dd470) by [@Bhavik-P](https://github.com/Bhavik-P)) -- Fixed runAndroid to enable the use of a package on port <> 8081 for Windows ([3cd0737fe2](https://github.com/facebook/react-native/commit/3cd0737fe2dce9df29822854bfbfaf2f22346c69) by [@ihenshaw](https://github.com/ihenshaw)) -- Don't crash on upload retry when trying to fetch on a varying quality network ([79fe925f1d](https://github.com/facebook/react-native/commit/79fe925f1daa053d5a5d92a228e5c7beff565ab4) by [@dryganets](https://github.com/dryganets)) - -#### iOS specific fixes - -- Fix `TextInput.clear()` and `TextInput.setNativeProps({text: ''})` to work ([2307ea60d0](https://github.com/facebook/react-native/commit/2307ea60d03edd234511bfe32474c453f30c1693) by [@magicien](https://github.com/magicien)) -- Correct fishhook import in RCTReconnectingWebSocket ([75a0273de2](https://github.com/facebook/react-native/commit/75a0273de21948b0b959263100f09111f738ec35)) -- Change in RCTImagePickerManager to handle crashes if height/width is nil ([82af7c989b](https://github.com/facebook/react-native/commit/82af7c989be42a516f438f162d21f699be297e79) by [@abhi06276](https://github.com/abhi06276)) -- Fix controlled `` on iOS when inputting in Chinese/Japanese ([892212bad2](https://github.com/facebook/react-native/commit/892212bad2daadd373f4be241e4cd9889b0a1005) by [@mmmulani](https://github.com/mmmulani)) -- Fixed `` bug encountered with brownfield apps ([fab5fffbb3](https://github.com/facebook/react-native/commit/fab5fffbb3eb8668c9202dec5e770330d49880b0) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- Fixed missing selection indicator lines on `` ([e592d6f8c7](https://github.com/facebook/react-native/commit/e592d6f8c7b0409ab6f0a2dbf6ebe3cea28c3e79) by [@VSchlattinger](https://github.com/VSchlattinger)) -- Fix crash in RCTImagePicker on iOS ([934c50fbe0](https://github.com/facebook/react-native/commit/934c50fbe07e49391ba27c3469f99bec65e48d39) by [@mmmulani](https://github.com/mmmulani)) -- Fix `undefined_arch` error received when building in Xcode 10 beta ([e131fffb37](https://github.com/facebook/react-native/commit/e131fffb37a545363daf11735a0243165b57f63f) by [@futuun](https://github.com/futuun)) -- Add support for connecting to the Packager when running the iOS app on device when using custom Debug configuration ([079bf3f206](https://github.com/facebook/react-native/commit/079bf3f2067cb268b60e75cd9e1bc51a9c85359c)) -- Fixed RCTAnimation import for integrating with cocoapods ([eef8d47a37](https://github.com/facebook/react-native/commit/eef8d47a37211bf7d4978db75df1fedd9cacbde8) by [@LukeDurrant](https://github.com/LukeDurrant)) - -### Removed: features that have been removed; these are breaking - -- _[BREAKING]_ Removed `ScrollView.propTypes`; use flow or typescript for verifying correct prop usage instead ([5b6ff01764](https://github.com/facebook/react-native/commit/5b6ff01764502c88848867c7e04cab969da384a2) by [@sahrens](https://github.com/sahrens)) - -#### Android specific removals - -- `ReactInstancePackage` is now deprecated; use `@link ReactPackage` or `@link LazyReactPackage` ([b938cd524a](https://github.com/facebook/react-native/commit/b938cd524a20c239a5d67e4a1150cd19e00e45ba) by [@axe-fb](https://github.com/axe-fb)) - -## v0.56.0 - -Welcome to the June 2018 release of React Native! -Over 60 contributors made [821 commits](https://github.com/facebook/react-native/compare/0.55-stable...0.56-stable) since March - and we are extremely grateful to every single one of you. - -As you'll see in a second, this new version has some important **breaking changes** that required a lot of extra efforts to bring to a stable 0.56. This was the main reason behind skipping April and May from the monthly release cycle, but looking forward we are planning on going back to do a rollout every month. - -### Highlights - -#### React Native now uses **Babel 7** - -When upgrading to 0.56, make sure to bump your `babel-preset-react-native` `package.json` dependency to `5.0.2` or newer (but still as _fixed_ value). - -React Native library authors will need to update their libraries to make use of the updated Babel preset as Babel 7 is **not** backwards compatible. - -If you have issues upgrading to Babel 7, please double check the [related documentation](https://new.babeljs.io/docs/en/next/v7-migration.html#versioning-dependencies-blog-2017-12-27-nearing-the-70-releasehtml-peer-dependencies-integrations), in particular the sections related to _Package Renames_ and _Scoped Packages_. - -The [`babel-bridge`](https://github.com/babel/babel-bridge) library may be used if you need to use libraries that have not yet upgraded to Babel 7. You may also enforce the Babel 7 dependency via tools like [yarn resolutions](https://yarnpkg.com/lang/en/docs/selective-version-resolutions/). Overall, you need to ensure all the `@babel/*` deps are fixed at version `7.0.0-beta.47`. - -#### **Node 8** is now the minimum required version - -Trailing commas are now allowed. - -#### **iOS 9** is now the minimum required version - -Any device that can run iOS 8, can upgrade to iOS 9. Developers who support iOS 8 in their apps may continue doing so as this is a Xcode-level setting (`IPHONEOS_DEPLOYMENT_TARGET`). - -#### **Xcode 9** is now the minimum required version - -We recommend using Xcode 9.4 as that is what we use to run our tests. - -#### **Android** projects are now compiled using the _Android 26 SDK_ - -The target API level is left unchanged in this release. - -Starting August 2018, new apps submitted to the Play Store will need to target API 26 as a minimum. You can now opt your project in to use API 26 (or newer) as the target. Please let us know about any issues, as we'd like to finalize support for Android API 26 by the time `0.57.0` is released. - -#### `WebView` will only load http(s) URLs by default - -Geolocation is disabled by default. - -#### Consistently Throw for `` - -Removes a pitfall that people may run into when releasing an app for Android if the bulk of the testing has been performed on iOS only. Nesting a `` within a `` component (e.g. ``) is unsupported on Android, but using this pattern on iOS has not thrown errors in the past. With this release, nesting a `` inside a `` will now throw an error on iOS in order to reduce the parity gap between the platforms. - -#### Flow improvements, migrating away from PropTypes - -Added Flow types for several components. - -We're migrating away from PropTypes and runtime checks and instead relying on **Flow**. You'll notice many improvements related to Flow in this release. - -- Fix project settings warnings on newer Xcode versions, remove unnecessary console logging. -- Modernized `YellowBox`. - Sort warnings by recency, group warnings by format string, present stack traces, show status of loading source maps, support inspecting each occurrence of a warning, and bug fixes. -- Prettier files! -- Lots of bug fixes. - -#### State of React Native - -Heads-up: the Facebook internal team is [currently working on a rewrite of some core architecture pieces](https://reactnative.dev/blog/2018/06/14/state-of-react-native-2018). This is a **work in progress** and we do not expect it to be ready for use in open source quite yet, but we felt the need to let you know what those commits mentioning Fabric are about. - ---- - -### Added: new features - -- Update `babelHelpers` with Babel 7 support ([fbd1beaf66](https://github.com/facebook/react-native/commit/fbd1beaf666be9c09a380784f8c0cd34ba083a6b)) -- `FlatList` is now Strict Mode compliant ([a90d0e3614](https://github.com/facebook/react-native/commit/a90d0e3614c467c33cf85bcbe65be71903d5aecc)) -- Enable `?.` optional chaining operator plugins ([aa6f394c42](https://github.com/facebook/react-native/commit/aa6f394c4236e5a4998c3be8ed61ec1bab950775)) -- Support `flexWrap: 'wrap-reverse'` ([d69e55060f](https://github.com/facebook/react-native/commit/d69e55060fd76d91eccc45905d250a9fce4b2c49)) -- Add prop type `accessibilityTraits` to `Text` ([654435d1ed](https://github.com/facebook/react-native/commit/654435d1ed9e584e65fff601e1fa50591e042664)) -- Add devDependencies support for templates ([c4ab03a18e](https://github.com/facebook/react-native/commit/c4ab03a18e75e6ed55444b5d86f3ceee435b9a78)) -- Add support for springDamping in `SpringInterpolator` ([1dde989919](https://github.com/facebook/react-native/commit/1dde989919d2c272ca7fcaa5c4b2d9ee02c490a0)) - -#### Android specific additions - -- Add support for build.gradle with CRLF for use with `react-native link` ([843cfc3b20](https://github.com/facebook/react-native/commit/843cfc3b202433aad9a236b1b623da7c45e1ac15)) -- add decimal pad to android ([75e49a0637](https://github.com/facebook/react-native/commit/75e49a0637eaa3bd3bb7e445648f084a42d9c8af)) -- Add a way to dismiss PopupMenu elements ([353c070be9](https://github.com/facebook/react-native/commit/353c070be9e9a5528d2098db4df3f0dc02d758a9)) -- Implement `Image.defaultSource` ([b0fa3228a7](https://github.com/facebook/react-native/commit/b0fa3228a77d89d6736da6fcae5dd32f74f3052c)) -- Support Image resizeMode=repeat ([0459e4ffaa](https://github.com/facebook/react-native/commit/0459e4ffaadb161598ce1a5b14c08d49a9257c9c)) -- Yoga: Add back deprecated `getParent` methods for non-breaking API change ([c3c5c3cbce](https://github.com/facebook/react-native/commit/c3c5c3cbce24a31f73ae6339e377ee76ca6401ad)) - -#### iOS specific additions - -- Run tests using Xcode 9.4 and iOS 11.4 ([c55bcd6ea7](https://github.com/facebook/react-native/commit/c55bcd6ea729cdf57fc14a5478b7c2e3f6b2a94d)) -- Add support for Homebrew-installed Node ([0964135a17](https://github.com/facebook/react-native/commit/0964135a178b459e06b44a49a4ecb0dd6c5bec9b)) -- Add textTransform style support ([8621d4b797](https://github.com/facebook/react-native/commit/8621d4b79731e13a0c6e397abd93c193c6219000)) -- Add docs for Swift usage to `RCTBridgeModule.h` ([ca898f4367](https://github.com/facebook/react-native/commit/ca898f4367083e0943603521a41c48dec403e6c9)) - ---- - -### Changes: existing functionality that is now different - -- Upgrade React Native to Babel 7 ([f8d6b97140](https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c)) -- New projects created using `react-native init` will use Babel 7 ([e315ec9891](https://github.com/facebook/react-native/commit/e315ec9891eb0bcb51afb0e797dbd49aa8f9ac71)) -- Restrict `WebView` to only http(s) URLs: ([634e7e11e3](https://github.com/facebook/react-native/commit/634e7e11e3ad39e0b13bf20cc7722c0cfd3c3e28), [23f8f7aecb](https://github.com/facebook/react-native/commit/23f8f7aecb1f21f4f5e44fb9e4a7456ea97935c9)) -- Node 8 is now the minimum required version ([c1e6f27823](https://github.com/facebook/react-native/commit/c1e6f278237e84c8ed26d3d2eb45035f250e2d40)) -- Upgrade React to v16.4.1, sync React Renderer to revision ae14317 ([c749d951ad](https://github.com/facebook/react-native/commit/c749d951ada829c6f6fb76f35e68142e61054433)) -- Update new project template's Flow config to fix `Cannot resolve module X` isse due to removal of `@providesModule` ([843a433e87](https://github.com/facebook/react-native/commit/843a433e87b0ccaa64ab70d07e22bffbabad8045)) -- Upgrade Flow to v0.75 ([3bed272a62](https://github.com/facebook/react-native/commit/3bed272a620ac806a6142327013265ea8138641a), [bc2f12c68c](https://github.com/facebook/react-native/commit/bc2f12c68cf8cfdf8c060354e84392fd9a3645d8), [6264b6932a](https://github.com/facebook/react-native/commit/6264b6932a08e1cefd83c4536ff7839d91938730)) -- Upgrade Flow definitions ([f8b4850425](https://github.com/facebook/react-native/commit/f8b4850425f115c8a23dead7ec0716b61663aed6)) -- Upgrade Prettier to v1.13.6 ([29fb2a8e90](https://github.com/facebook/react-native/commit/29fb2a8e90fa3811f9485d4b89d9dbcfffea93a6), [bc2f12c68c](https://github.com/facebook/react-native/commit/bc2f12c68cf8cfdf8c060354e84392fd9a3645d8)) -- Upgrade Jest to v23.2.0 ([536c937269](https://github.com/facebook/react-native/commit/536c9372692712b12317e657fc3e4263ecc70164), [bc2f12c68c](https://github.com/facebook/react-native/commit/bc2f12c68cf8cfdf8c060354e84392fd9a3645d8)) -- Upgrade Metro to v0.38 ([d081f83a04](https://github.com/facebook/react-native/commit/d081f83a0487ffbc7d19f8edc7532611b359dfc6)) -- Modernized `YellowBox` ([d0219a0301](https://github.com/facebook/react-native/commit/d0219a0301e59e8b0ef75dbd786318d4b4619f4c)) -- Disallow requiring from invariant/warning ([521fb6d041](https://github.com/facebook/react-native/commit/521fb6d041167ec8a8d0e98ac606db1f27f0c5c8)) -- Remove native prop type validation ([8dc3ba0444](https://github.com/facebook/react-native/commit/8dc3ba0444c94d9bbb66295b5af885bff9b9cd34)) -- Add `$FlowFixMe` to invalid prop accesses where Flow wasn't complaining before ([f19ee28e7d](https://github.com/facebook/react-native/commit/f19ee28e7d896aaacf26c6f850230019bdef0d3d)) -- Create Flow props for `Image` ([8bac869f5d](https://github.com/facebook/react-native/commit/8bac869f5d1f2ef42e707d0ec817afc6ac98b3b2)) -- Flow type for `SegmentedControlIOS` ([113f009698](https://github.com/facebook/react-native/commit/113f009698dbd8f1b4c1048d77ff1eb373021083)) -- Flow type for `ProgressViewIOS` ([c87701ba05](https://github.com/facebook/react-native/commit/c87701ba05a8524756e87c089eb92c8f3c81823e)) -- Flow type for `PickerIOS` ([1c66cdc7e8](https://github.com/facebook/react-native/commit/1c66cdc7e8ce8190dfbef76629601497446b2b0a)) -- Flow type for `Switch` ([06052a2330](https://github.com/facebook/react-native/commit/06052a2330fc9c1dd0d56c6bbe5a17703f80c6b9)) -- Flow type for `Slider` ([cbe045a95f](https://github.com/facebook/react-native/commit/cbe045a95f1ca53d99ae521742a93299a53d6136)) -- Flow type for `RefreshControl` ([891dfc3da4](https://github.com/facebook/react-native/commit/891dfc3da4b5825097aedf73ff04e8982c00aeff)) -- Flow type for `ListView` ([4b1ecb6204](https://github.com/facebook/react-native/commit/4b1ecb62045fbb78764d1f51030f2253be705c5c)) -- Flow type for `TextInput` ([c8bcda8150](https://github.com/facebook/react-native/commit/c8bcda8150278fde07331ca6958976b2b3395688)) -- Flow type for `TouchableBounce` ([8454a36b0b](https://github.com/facebook/react-native/commit/8454a36b0bc54cb1e267bc264657cc693607da71)) -- Flow type for `TouchableOpacity` ([44743c07ad](https://github.com/facebook/react-native/commit/44743c07ad672e39668f92a801578906ec92996a)) -- Flow type for `TouchableHighlight` ([f0c18dc820](https://github.com/facebook/react-native/commit/f0c18dc820537892dcc33d5aebbf4f52cf299b95)) -- Flow type for `TouchableWithoutFeedback` ([0b79d1faa2](https://github.com/facebook/react-native/commit/0b79d1faa21eb3c29aeeba08ee0fb2ed62e6cc54)) -- Flow type for `ScrollView` ([b127662279](https://github.com/facebook/react-native/commit/b1276622791d5dbe4199bb075f473908c3e62b31)) -- Flow type for `DatePickerIOS` ([97e572ea6d](https://github.com/facebook/react-native/commit/97e572ea6d7b1fd829ca20f5d5c8ff970d88e68b)) -- Flow type for `KeyboardAvoidingView` ([188b118b60](https://github.com/facebook/react-native/commit/188b118b6075be1614c553596b85d430767f2dbc)) -- Flow type for `ActivityIndicator` ([0b71d1ddb0](https://github.com/facebook/react-native/commit/0b71d1ddb03c036ed118574c105b0af505da19fc)) -- Remove `$FlowFixMe` in `TouchableBounce` ([ffda017850](https://github.com/facebook/react-native/commit/ffda0178509ed92396f15db37a41d3d668ade4e6)) -- Remove `$FlowFixMe` in `ScrollView` ([af6e2eb02d](https://github.com/facebook/react-native/commit/af6e2eb02d3651f869b5436e68e61ef3ab3405a0)) -- Remove `$FlowFixMe` in `ListView` ([af6e2eb02d](https://github.com/facebook/react-native/commit/af6e2eb02d3651f869b5436e68e61ef3ab3405a0)) -- Remove `$FlowFixMe` in `Text` ([6042592cf4](https://github.com/facebook/react-native/commit/6042592cf46787f089e76b661376705380607207)) -- Remove `$FlowFixMe` in `RTLExample` ([206ef54aa4](https://github.com/facebook/react-native/commit/206ef54aa415e3e2bb0d48111104dfc372b97e0f)) -- Remove `$FlowFixMe` in `AppContainer` ([a956551af7](https://github.com/facebook/react-native/commit/a956551af73cf785ee4345e92e71fd5b17c5644e)) -- Remove `$FlowFixMe` in `Slider` ([1615f9d161](https://github.com/facebook/react-native/commit/1615f9d16149c7082ce0e1485aa04a6f2108f7ba)) -- `StyleSheet`: Support animated values for border dimensions ([3e3b10f404](https://github.com/facebook/react-native/commit/3e3b10f4044ada7b523d363afb614720468c217f)) -- Update `react-devtools-core` and `plist` to include security fixes reported by `npm audit` ([3a1d949906](https://github.com/facebook/react-native/commit/3a1d949906acb0c3b44d125d54d0c99305bbbb56)) -- Update `Switch` to ES6 Class ([970caa4552](https://github.com/facebook/react-native/commit/970caa4552d4ba87c1a954391535ff42b00832e7)) -- Update `Slider` to ES6 Class ([5259450c14](https://github.com/facebook/react-native/commit/5259450c143f71c65e157d6b7d3f0e1655eb7aa1)) -- Update `ActivityIndicator` to ES6 Class ([edd7acbb1e](https://github.com/facebook/react-native/commit/edd7acbb1e6fe185600a19cc1cbb38feb16c85ad)) -- Update `RefreshControl` to ES6 Class ([a35a238317](https://github.com/facebook/react-native/commit/a35a23831789030e17f766f72d307ae315be107d)) -- Update `KeyboardAvoidingView` to ES6 Class ([c017dcb0f2](https://github.com/facebook/react-native/commit/c017dcb0f2903b49b2f21cc150226aeb7f5026ee)) -- Update `DatePickerIOS` to ES6 Class ([f8c8231706](https://github.com/facebook/react-native/commit/f8c8231706492b588331354d45b833aa21434e13)) -- Update `Text` to ES6 Class ([ab92c00245](https://github.com/facebook/react-native/commit/ab92c00245c0ce717819ddb0ab8b9204d4c13c34)) -- Replace `context.isInAParentText` w/ `React.createContext` ([e1339bc183](https://github.com/facebook/react-native/commit/e1339bc18303ca5394cd0c9dc97cededb2261581)) -- Cleanup `Text` implementation ([06c05e744d](https://github.com/facebook/react-native/commit/06c05e744d8af9582bde348210f254d76dae48b9)) -- Switch `Text` to `React.forwardRef` ([e708010d18](https://github.com/facebook/react-native/commit/e708010d18f938e2d6b6424cfc9485d8e5dd2800)) -- Switch `View` to `React.forwardRef` ([3e534b9aab](https://github.com/facebook/react-native/commit/3e534b9aab5156adac67762877b2457408fe8934)) -- Update uses of `genMockFunction` and `genMockFn` to `fn` in tests ([390ded871c](https://github.com/facebook/react-native/commit/390ded871cb905d149e9c1f4a082e67a7ec7addb)) -- Make `ViewProps` exact ([65c336f38f](https://github.com/facebook/react-native/commit/65c336f38f4afd43c8b5f81745abf38bd9b8ddbf)) -- Spread `TVViewProps` into `ViewProps` instead of intersection ([bc658d3c44](https://github.com/facebook/react-native/commit/bc658d3c4405676643d952a126295dbc7fc26217)) -- Allow trailing commas ([1e2de71290](https://github.com/facebook/react-native/commit/1e2de712907e5fe0d17648f0ff5c81d4384ca85b)) -- Use `let`/`const` ([8f5ebe5952](https://github.com/facebook/react-native/commit/8f5ebe5952d0675b463137103a82f3fb0c26ae0d)) -- Refactor `MockNativeMethods` in Jest ([5d4c542c58](https://github.com/facebook/react-native/commit/5d4c542c58d84bbe05f76bf01d9efdd9d438572c)) -- Use app name from `app.json` after ejecting ([57774a4a98](https://github.com/facebook/react-native/commit/57774a4a981e2f12cfe9b029447e34f203221b18)) -- Suggest `git apply --reject` for failed upgrades ([4fbd244b9a](https://github.com/facebook/react-native/commit/4fbd244b9a6b62e0efe1b4b5a7ec3de468f020f6)) -- Moved `TouchHistoryMath` from React to React Native ([06085d3836](https://github.com/facebook/react-native/commit/06085d38366373f3135074dc14e2c9871ca4fe29)) -- Refactor `RCTInputAccessoryView` ([c136c54ff0](https://github.com/facebook/react-native/commit/c136c54ff0211e2bf149fab600cd6e295f9d19dd)) -- Don't wrap `ListEmptyComponent` in an extra view ([db061ea8c7](https://github.com/facebook/react-native/commit/db061ea8c7b78d7e9df4a450c9e7a24d9b2382b4)) -- Move `Text` PropTypes to its own file ([cd8128b2ec](https://github.com/facebook/react-native/commit/cd8128b2eccf6898cdf798a1e1be1f7a5762a0d4)) -- Mock `ReactNative.NativeComponent` native methods in Jest ([3e9a371ace](https://github.com/facebook/react-native/commit/3e9a371ace5f25b2eb7a0d30177251f8a0c10ed9)) -- Tightening types for `View` and `VirtualizedList` ([5035af80ec](https://github.com/facebook/react-native/commit/5035af80ecddb44e2a8444780f25f336b760bf32)) -- Make values optional in `ViewPropTypes` ([f1316cab6c](https://github.com/facebook/react-native/commit/f1316cab6c351852ef1da9939d4c8f0244fb8a6f)) -- propTypes are optional for native components ([dbdf43b428](https://github.com/facebook/react-native/commit/dbdf43b428da19a9eba012753904bcf33339ea9a)) -- Rename `Style` to `DangerouslyImpreciseStyle` ([4895c645ea](https://github.com/facebook/react-native/commit/4895c645ea17ff939811f3d5ec6218cd4e31c5fb)) -- _[BREAKING]_ `requireNativeComponent`'s signature has been simplified to only take extraOptions ([820673e707](https://github.com/facebook/react-native/commit/820673e7076b5906ba50e09e40fb9a32cf500c1b), [b549e364e0](https://github.com/facebook/react-native/commit/b549e364e0025e0e1b4005f04a9de2d767006da1), [28d37781c6](https://github.com/facebook/react-native/commit/28d37781c6589574de1113bd12077f6d54053ffb), [1c90a2b47b](https://github.com/facebook/react-native/commit/1c90a2b47b420a4b6aa16a55a344cc08f0eacbe3), and [1ab7d49c2d](https://github.com/facebook/react-native/commit/1ab7d49c2df5673dd214eb8a9b7fd3defb0ff857) by [@yungsters](https://github.com/yungsters)) - -#### Breaking Changes - -- Public methods of Text (`blur`, `focus`, `measure`, `measureInWindow`, `measureLayout`, `setNativeProps`) are no longer bound to the text component instance. It is therefore unsafe to pass these methods by reference (i.e: as callbacks) to functions. So, things like `setTimeout(this._txtRef.focus, 1000)` will no longer work. Please instead do: `setTimeout(() => this._txtRef.focus(), 1000)`. - -### iOS specific changes - -- _[BREAKING]_ WebViews now can only use https; do not use it for `file://` ([634e7e11e3](https://github.com/facebook/react-native/commit/634e7e11e3ad39e0b13bf20cc7722c0cfd3c3e28) by [@mmmulani](https://github.com/mmmulani)) -- iOS 9 is now the minimum required version ([f50df4f5ec](https://github.com/facebook/react-native/commit/f50df4f5eca4b4324ff18a49dcf8be3694482b51)) -- Update podspecs to target iOS 9 ([092103e752](https://github.com/facebook/react-native/commit/092103e7525e58e04346e0a1a16a67ca4f31c2e9)) -- Xcode 9.4 is now used to run tests ([c55bcd6ea7](https://github.com/facebook/react-native/commit/c55bcd6ea729cdf57fc14a5478b7c2e3f6b2a94d)) -- Prevent console logging on iOS 11.3+ within WebSocket ([8125be942b](https://github.com/facebook/react-native/commit/8125be942bd5fd8fe851bad04ae6b9bcb0af4727)) -- Expose `RCTFont` size overrides ([6611fefef7](https://github.com/facebook/react-native/commit/6611fefef7559c4cd3d1824235d263bff210d5e2)) - -### Android specific changes - -- Projects are now compiled using Android SDK 26 ([065c5b6590](https://github.com/facebook/react-native/commit/065c5b6590de18281a8c592a04240751c655c03c)) -- Use Google Maven repo in new Android projects ([6d56a234e3](https://github.com/facebook/react-native/commit/6d56a234e3cf5984335ff2713236260fac977f5f)) -- Upgrade Buck to v2018.03.26.01 ([1324e7b558](https://github.com/facebook/react-native/commit/1324e7b5580db815471172cf6dd140124bd2f11a)) -- Upgrade gradle-plugin to 2.3.3, gradle to 3.5.1, gradle-download-task to 3.4.3 ([699e5eebe8](https://github.com/facebook/react-native/commit/699e5eebe807d1ced660d2d2f39b5679d26925da)) -- Bump NDK APP_PLATFORM to android-16 ([b5dc45420a](https://github.com/facebook/react-native/commit/b5dc45420a0d3aa54d2d2075d7f14ff1835df78a)) -- Bump glog to 0.3.5 (added libc++ support) ([b5fca80605](https://github.com/facebook/react-native/commit/b5fca806059e628edb504cb1bacf62e89ee6f102)) -- `ReactFragmentActivity` deprecated as it's not necessary when targeting API level 14 and above ([77a02c0d83](https://github.com/facebook/react-native/commit/77a02c0d83dbfcd9a5397cf63e1ab2e6c94cfdde)) -- Touchables now play a sound on press ([722f88ca90](https://github.com/facebook/react-native/commit/722f88ca9058c5d902c416b826a7a7ab347326b8)) -- Default `underlineColorAndroid` to transparent ([a3a98eb1c7](https://github.com/facebook/react-native/commit/a3a98eb1c7fa0054a236d45421393874ce8ce558)) -- Disable `WebView` geolocation by default ([23d61b35fb](https://github.com/facebook/react-native/commit/23d61b35fb6fdbfb84f77b6d99ff155a0ff868e6)) -- Ensure cookies with illegal characters are not sent to okhttp ([04028bf216](https://github.com/facebook/react-native/commit/04028bf2169b01f79bd86ecd6b0d8aa5f99599f1)) -- Update app icons to match recent Android releases ([94393f8652](https://github.com/facebook/react-native/commit/94393f8652c414806fc861c214ad36e9ac1b6114)) -- Better error messages for `ReadableNativeMap` ([30d06b4286](https://github.com/facebook/react-native/commit/30d06b42862fc5e8704e109db652d62f86f8eabc)) -- Update Fresco to v1.9.0, okhttp3 to v3.10.0 ([6b07602915](https://github.com/facebook/react-native/commit/6b07602915157f54c39adbf0f9746ac056ad2d13)) -- Add tint color to inline icons ([e8e2a6e410](https://github.com/facebook/react-native/commit/e8e2a6e4102c1ba0ee3d068769e47fa61c160524)) -- Fix antialiasing rounded background ([e4f88c66e3](https://github.com/facebook/react-native/commit/e4f88c66e300505d3c86329dacd84d84e8109837)) -- `react-native link` will now replace '/' by '\_' when linking projects. If you previously linked scoped packages, they will get linked again. ([dbd47592a1](https://github.com/facebook/react-native/commit/dbd47592a18ed09ee6e94c79bed16d63be625af6)) -- New project template now uses project-wide properties ([0a3055d98a](https://github.com/facebook/react-native/commit/0a3055d98a36e49746144e883edc7e20afec4fcb)) - ---- - -### Fixed: bugs that have been resolved - -- `VirtualizedList` now accounts for `ListHeaderComponent` length when calculating offset ([604bcfa4a8](https://github.com/facebook/react-native/commit/604bcfa4a83396c402ba8beaa13f40d05d6e9f5c)) -- Prevent showing a hidden status bar when opening modals ([076b1cea35](https://github.com/facebook/react-native/commit/076b1cea3563cae30e11d63cc100ceaed9082692)) -- Fix crash when reloading while Perf Monitor is enabled ([4fcd9970bd](https://github.com/facebook/react-native/commit/4fcd9970bd2dfb24890bc87e9c82e16dab71ec09)) -- Fixed concurrency issue in remote debugger ([578b0b2a51](https://github.com/facebook/react-native/commit/578b0b2a51fc0c2aba5d27cdd5335396d5351463)) -- Fix `Modal` + `FlatList` scrolling ([45b0907f61](https://github.com/facebook/react-native/commit/45b0907f619f455825f459838615a5a7cc59a204)) -- Fix bug in `RCTNetworking` where not all tasks/handlers were being cleared during invalidation ([b805172034](https://github.com/facebook/react-native/commit/b8051720344f3716e964eaf7cfdd2a91dc703602)) -- Fix keyboard handling with `keyboardShouldPersistTaps: never` ([ffe6c110f7](https://github.com/facebook/react-native/commit/ffe6c110f7ce33460fe0399ccbda16a6adbe90ca)) -- Fix Responder Logic in `Text` ([e2ce22b823](https://github.com/facebook/react-native/commit/e2ce22b823661a7dcf6b70a825921a2910383bd1)) -- Fix `VirtualizedSectionList` lint warnings ([26a1eba1ce](https://github.com/facebook/react-native/commit/26a1eba1cef853b0dab7aad5731699c06d36b781)) -- Fix `VirtualizedSectionList:ItemWithSeparators` ([488a4c7e1c](https://github.com/facebook/react-native/commit/488a4c7e1c86ac5900ff9194106511fbf5a8e3cb)) -- Fix `TextInput`'s initial layout measurements ([c6b4f9f2ce](https://github.com/facebook/react-native/commit/c6b4f9f2ce59bc757d9e211f46294faa03df55c6)) -- Fix `requireNativeComponent` check ([1c90a2b47b](https://github.com/facebook/react-native/commit/1c90a2b47b420a4b6aa16a55a344cc08f0eacbe3)) -- Fix `TextInput` autocapitalization bug ([ff70ecf868](https://github.com/facebook/react-native/commit/ff70ecf868cf12fc66b45dc1496391d0a1e9011f)) -- Add missing events to `ViewPropTypes` ([41a940392c](https://github.com/facebook/react-native/commit/41a940392cea497bc5eb627b24083d0211d1eb89)) -- Add missing Jest mock in `StatusBarManager` ([4a2c560768](https://github.com/facebook/react-native/commit/4a2c560768abb2d8407900fdb2fbe4971ae00a1c)) -- Add Flow declaration for Metro module ([1853e15190](https://github.com/facebook/react-native/commit/1853e1519030caaeeb7f31017d98823aa5696daf)) -- Fix type for `ReactNative.NativeComponent` (1/2) ([de11ba2a5e](https://github.com/facebook/react-native/commit/de11ba2a5ee90929dbc67d914de59bdd2ebc29ca)) -- Fix type for `ReactNative.NativeComponent` (2/2) ([752863629d](https://github.com/facebook/react-native/commit/752863629d63bca6d96a101bfeccc4e7ad3e953e)) -- Move Image PropTypes to new file ([67656991b3](https://github.com/facebook/react-native/commit/67656991b32075e8b4a99c6409b0a131206c6941)) -- Tests: Fix JUnit report location when running Jest ([85fc98d437](https://github.com/facebook/react-native/commit/85fc98d437c08cdec883a73161e120478737ba72)) -- Tests: Fix ReactImagePropertyTest SoLoader failures (#19607) ([a52d84d7e1](https://github.com/facebook/react-native/commit/a52d84d7e1cdb287f2877c4d85f2e9866c248d43)) -- Tests: Fix jest snapshot testing on Windows ([216bce3163](https://github.com/facebook/react-native/commit/216bce31632480ce70cc03b1b2a57ec12440afd7)) -- Fixes "Cannot resolve module" errors in new `react-native init` projects ([843a433e87](https://github.com/facebook/react-native/commit/843a433e87b0ccaa64ab70d07e22bffbabad8045)) -- Haste hotfix for `react-native-windows` ([54942746d4](https://github.com/facebook/react-native/commit/54942746d4037e1153e14fcfc95e4edc772d296a)) - -#### iOS specific fixes - -- Fix undefined_arch error in Xcode 10 beta - e131fff -- Make `react-native run-ios` command play nicely with multiple Xcode versions ([a130239257](https://github.com/facebook/react-native/commit/a1302392577789faab79dad0cb39b147464e0e42)) -- Correct fishhook import ([75a0273de2](https://github.com/facebook/react-native/commit/75a0273de21948b0b959263100f09111f738ec35)) -- Fix bug where a Backspace event was emitted when entering characters after clearing a text in `TextInput` by an empty string ([1ffb2b63be](https://github.com/facebook/react-native/commit/1ffb2b63be4c4af331fece0b4286e5c92b1e575d)) -- Expose `InputAccessoryView` so it can be imported ([80fc415cf1](https://github.com/facebook/react-native/commit/80fc415cf179ffe26d020bc8d6e4451352da94fd)) -- Fix `InputAccessoryView` safe area conformance ([490f22ae72](https://github.com/facebook/react-native/commit/490f22ae72ba43fa9364ce0f6c238744c07ac830)) -- Fix use of C++ syntax in header file ([bfcfe7961d](https://github.com/facebook/react-native/commit/bfcfe7961db0970e2575eafe2f3c9c668bd8940d)) -- Fix install step when running `run-ios` ([0934c1778f](https://github.com/facebook/react-native/commit/0934c1778f0e3c0b691e1a3ca2df1d486eb905dd)) -- Fix `run-ios` not turning on Simulator ([9736ddc061](https://github.com/facebook/react-native/commit/9736ddc061e9c4291df8a3185c7f9d6f73e435c7)) -- Use correct library reference for Fishhook. This fixes the build for the new Xcode build system, on both Xcode 9 and Xcode 10 ([a8b74576da](https://github.com/facebook/react-native/commit/a8b74576da6f1a42fde4e39f97e88c8f45a3a51d)) -- Add missing `onChange` event definition to `DatePickerIOS` ([3b53091869](https://github.com/facebook/react-native/commit/3b53091869b673ea33a4af34242e2227ca944768)) -- Fix crash during Archive phase on Xcode 9.3 ([344c205070](https://github.com/facebook/react-native/commit/344c205070d5ad670c97984dd86ec9ac13c73f81)) -- `RNTesterPods`: Add missing folly include ([128c9343c4](https://github.com/facebook/react-native/commit/128c9343c464f3e7898d6e245f135f8bdf6caa6a)) -- `RNTesterPods`: folly::Optional's `has_value()` to `hasValue()` until folly is upgraded ([128c9343c4](https://github.com/facebook/react-native/commit/128c9343c464f3e7898d6e245f135f8bdf6caa6a)) -- `RNTesterPods`: Fix import for `RCTTestAttributes.h` ([128c9343c4](https://github.com/facebook/react-native/commit/128c9343c464f3e7898d6e245f135f8bdf6caa6a)) -- `RNTesterPods`: Fix `conversions.h` to use namespaced includes ([128c9343c4](https://github.com/facebook/react-native/commit/128c9343c464f3e7898d6e245f135f8bdf6caa6a)) -- Fix or mark enum conversions surfaced by `-Wenum-conversion` ([b8f30db0ae](https://github.com/facebook/react-native/commit/b8f30db0ae21d5f96547702abbf50aefa93b1094)) -- Fix CocoaPods integration without DevSupport subspec ([c09d509c2b](https://github.com/facebook/react-native/commit/c09d509c2b8a5a02701829e1f0ace8081ce64277)) -- Update Yoga to handle being in a Xcode framework project ([cf036dbc7a](https://github.com/facebook/react-native/commit/cf036dbc7af16a8453c115372694dc51e8086fcf)) -- Fix Blob memory leak ([122b3791ed](https://github.com/facebook/react-native/commit/122b3791ede095345f44666691aa9ce5aa7f725a)) -- Avoid double reload event when reloading JS ([7b9b1559a7](https://github.com/facebook/react-native/commit/7b9b1559a7f6719c3c9ad8e894fcdd99ed109afe)) -- Suppress spurious warning about RCTCxxModule ([569061dd83](https://github.com/facebook/react-native/commit/569061dd8384a86cd27719b8b068360d8379f4c3)) - -#### Android specific fixes - -- Fix extreme `TextInput` slowness on Android ([5017b86b52](https://github.com/facebook/react-native/commit/5017b86b525e3ef6023f0f8a88e6fd1cf98024e0)) -- Correct draw path dimensions while doing even border, fixes blurred borders ([c5ca26a0e5](https://github.com/facebook/react-native/commit/c5ca26a0e5c0660196300ee34d6007c63879611f)) -- Don't pass additional arguments to `requireNativeComponent` in `.android.js` files ([a51e8b19cc](https://github.com/facebook/react-native/commit/a51e8b19cc4dc36dee42ac95278b883c06b2e40f)) -- Prevent `RefreshControl` from getting stuck when a parent is scrolled horizontally ([33ffa79a51](https://github.com/facebook/react-native/commit/33ffa79a51d4db9ba69148861f2da304646175cd)) -- Prevent crash due to unsupported ellipsize mode ([85e33aaf90](https://github.com/facebook/react-native/commit/85e33aaf908996e99220bff4a2bdbbdf7c0d12b0)) -- Fix okhttp3 response handling in `DevServerHelper` ([56d48bd9ec](https://github.com/facebook/react-native/commit/56d48bd9ecd2d0f08625259121312531064a09f2)) -- Fix `ReactInstanceManager` unmountApplication to support `ReactRootView` recycling ([4a9b2a7302](https://github.com/facebook/react-native/commit/4a9b2a73021fb547febe1fa193c3effb7ff8da4e)) -- Fix `NullPointerException` when emitting event using `UIManagerModule` ([291c01f4ff](https://github.com/facebook/react-native/commit/291c01f4ffe614760852e36b05d78b42cb4271df)) -- Fix link to Android build guide ([57e7556b8d](https://github.com/facebook/react-native/commit/57e7556b8db61e5fcc3ccea56c1b163b82a091a6)) -- Fix Android open source test failures ([3e0ebc7663](https://github.com/facebook/react-native/commit/3e0ebc76632238f21c60caa92c7a2b5ee8102b71)) -- Fix view indices with LayoutAnimation ([05b75b9ebf](https://github.com/facebook/react-native/commit/05b75b9ebfa3ce6d67b2a3aee446ff0cd515311b)) -- Fix originalNode memory leak ([8102e35271](https://github.com/facebook/react-native/commit/8102e35271ab68e0525a9c60d86a855bbeef9c1a)) -- Fix `ScrollView` with a `TextInput` ([2f1421dec7](https://github.com/facebook/react-native/commit/2f1421dec7cd3a35779caceac108e872033c7d72)) -- Disable onKeyPRess logic when handler not defined ([41975f75d9](https://github.com/facebook/react-native/commit/41975f75d96ef4b606b4618461bf24d5db063b77)) -- fix permission requests on pre-M android ([4e1abdd74d](https://github.com/facebook/react-native/commit/4e1abdd74dc4127a86d62e7750d01d39bb781c08)) - ---- - -### Removed: features that have been removed; these are breaking - -- Deprecate `focusTextInput` and `blurTextInput` ([ce3b7b8204](https://github.com/facebook/react-native/commit/ce3b7b8204dad0fd62a76a0ce66472eca4b25bc8)) -- _[BREAKING]_ `ImageResizeMode` on `Image` is no longer exposed; check your usage of `resizeMode`; the same resize modes exist, but pass them as strings instead ([870775ee73](https://github.com/facebook/react-native/commit/870775ee738e9405c6545500f9a637df9b513a02) by [@TheSavior](https://github.com/TheSavior)) - -#### Android specific removals - -- Remove native extensions ([7c5845a5a2](https://github.com/facebook/react-native/commit/7c5845a5a26592598c9380df078766a680a23f06)) -- Remove Fresco ProGuard rules ([07df36557c](https://github.com/facebook/react-native/commit/07df36557c8cbbaee5e870460162aa725a606ff4)) - -#### iOS specific removals - -- Disallow nesting of `` within `` (e.g. ``) ([6a1b41643a](https://github.com/facebook/react-native/commit/6a1b41643a5f5035c61a96263220d11d3462e8f2) -- Removed deprecated `UIActionSheetDelegate` methods ([5863b564f8](https://github.com/facebook/react-native/commit/5863b564f84b9fe97b256f8cde0f7f2e1db9b641)) - ---- - -### Known issues - -During the RC testing of this version, a few issues that have been opened don't have yet a finalized solution ( [19827](https://github.com/facebook/react-native/issues/19827), [19763](https://github.com/facebook/react-native/issues/19763), [19859](https://github.com/facebook/react-native/issues/19859), [19955](https://github.com/facebook/react-native/issues/19955) ). We are aware of them and we hope that by releasing 0.56.0 the surface of developers interacting to find solutions to them will allow for faster resolution and an even better 0.56.1 release. So please check the already opened issues before submitting new ones. - -If you are using Windows to develop React Native apps, we suggest you keep an eye on [this issue in particular](https://github.com/facebook/react-native/issues/19953) since there have been many reports of issues related to Win 10 and RN 0.56. - -## v0.55.0 - -Welcome to the March 2018 release of React Native ! Over 81 contributors made 247 commits since February. Thanks for another exciting release. - -Here are a few highlights: - -- React Native is now using the MIT license -- Android TV device support - -[![RNAndroidTVDemo](http://img.youtube.com/vi/EzIQErHhY20/0.jpg)](http://www.youtube.com/watch?v=EzIQErHhY20) - -- Animated tracking with native driver - check out the [silky smooth framerate](https://t.co/dE1KST1i3g) -- Lots of Flow improvements -- Bugfixes - -### Added: new features - -- Added support for animated tracking to native driver. Now you can use `useNativeDriver` flag with animations that track other `Animated.Values` ([b48f7e5605](https://github.com/facebook/react-native/commit/b48f7e560545d53db7c906ced51a91c4cce6ee94) by [@kmagiera](https://github.com/kmagiera)) -- There's a new UTFSequence module in the library for common Unicode sequences (Emoji!) ([54870e0c6c](https://github.com/facebook/react-native/commit/54870e0c6ca8611fed775e5ba12a0d6d9b1cdbd7) and [4761d5a83e](https://github.com/facebook/react-native/commit/4761d5a83e707e0ed651f02a9e02fc5d66b1869a) by [@sahrens](https://github.com/sahrens)) -- Added `contextMenuHidden` property for **TextInput** ([2dd2529b3a](https://github.com/facebook/react-native/commit/2dd2529b3ab3ace39136a6e24c09f80ae421a17e) by [@amhinson](https://github.com/amhinson)) -- Add `testOnly_pressed` to **TouchableHighlight** for snapshot tests ([3756d41de1](https://github.com/facebook/react-native/commit/3756d41de1feb167482f01b26f9a5f2563ef8bff) by [@sahrens](https://github.com/sahrens)) - -#### Android specific additions - -- Added support for Android TV devices ([b7bb2e5745](https://github.com/facebook/react-native/commit/b7bb2e5745f2bdbfeeccef8d97d469730942e01c) by [@krzysztofciombor](https://github.com/krzysztofciombor)) -- Implemented style `letterSpacing` for **Text** and **TextInput** ([5898817fc1](https://github.com/facebook/react-native/commit/5898817fc1a66bd317d65ce96520159df2f96045) by [@motiz88](https://github.com/motiz88)) -- Bundle download progress is now shown [d06e143420](https://github.com/facebook/react-native/commit/d06e143420462344ea6fc21c0446db972f747404) by [@janicduplessis](https://github.com/janicduplessis)) -- **AndroidInfoModule** now also returns Android ID ([216c8ec04b](https://github.com/facebook/react-native/commit/216c8ec04b22704f722ecaac4718157af4434a0c) by [@L33tcodex0r](https://github.com/L33tcodex0r)) - -#### iOS specific additions - -- Introducing **InputAccessoryView**, "a component which enables customization of the keyboard input accessory view" ([38197c8230](https://github.com/facebook/react-native/commit/38197c8230657d567170cdaf8ff4bbb4aee732b8), [84ef7bc372](https://github.com/facebook/react-native/commit/84ef7bc372ad870127b3e1fb8c13399fe09ecd4d), and [6d9fe455dc](https://github.com/facebook/react-native/commit/6d9fe455dc815cdce86c00f81c71c9ca0c724964) by [@PeteTheHeat](https://github.com/PeteTheHeat)) -- `base-line` metric exposure for **Text** and **TextInput** ([51b3529f6c](https://github.com/facebook/react-native/commit/51b3529f6c2ca354800c0cf6ecb8eb3115eaa36e), [0dbe18375e](https://github.com/facebook/react-native/commit/0dbe18375ebb712be8bebd3b6592170f90f8b7bc), and [7630a614e4](https://github.com/facebook/react-native/commit/7630a614e4bd56c1a3ac728e1dfafd114340f2b7) by [@shergin](https://github.com/shergin)) -- **DatePickerIOS** now has `initialDate` prop ([446ce49e9b](https://github.com/facebook/react-native/commit/446ce49e9b097d2a5e95b0f17aa23756733c27ec)) -- Expose version via `RCTVersion.h`'s `RCTGetReactNativeVersion()` ([30469ed001](https://github.com/facebook/react-native/commit/30469ed00170a74743d2ba5aadce61aae742715c) by [@LeoNatan](https://github.com/LeoNatan)) -- Allow running multiple simulators simultaneously with `react-native run-ios --simulator ...` ([2ad34075f1](https://github.com/facebook/react-native/commit/2ad34075f1d048bebb08ef30799ac0d081073150) by [@koenpunt](https://github.com/koenpunt)) -- Introduced **RCTSurfaceHostingProxyRootView** for migration to **RCTSurfaceHostingView** ([34b8876ac6](https://github.com/facebook/react-native/commit/34b8876ac6510398e03a03c94f4ffb9aaa7519d3) by [@fkgozali](https://github.com/fkgozali)) -- New UIManager API allowing intercept/delay mounting process ([402ae2f01f](https://github.com/facebook/react-native/commit/402ae2f01fd91051be5b717b0578e18b863854af) and [b90c1cf6c3](https://github.com/facebook/react-native/commit/b90c1cf6c30454859579278be18ac650c66f516b) by [@shergin](https://github.com/shergin)) - -### Changes: existing functionality that is now different - -- React Native has now adopted the MIT license ([1490ab12ef](https://github.com/facebook/react-native/commit/1490ab12ef156bf3201882eeabfcac18a1210352) and [26684cf3ad](https://github.com/facebook/react-native/commit/26684cf3adf4094eb6c405d345a75bf8c7c0bf88) by [@sophiebits](https://github.com/sophiebits)) -- The HelloWorld template now exclude `*.jsbundle` files from Git ([21231084db](https://github.com/facebook/react-native/commit/21231084dbccc8abe7823d4444a7e772c08e3e72) by [@aneophyte](https://github.com/aneophyte)) -- `react-native-git-upgrade` now shows files merged with conflicts in red ([e53a8f7097](https://github.com/facebook/react-native/commit/e53a8f7097965f38d87eade1407661bc63adc68e) by [@alvinthen](https://github.com/alvinthen)) -- `ResolvedAssetSource` type to have all read-only members ([4d0ee37293](https://github.com/facebook/react-native/commit/4d0ee37293b5e21fc3c7a8c6edd72c9ff899df7d) by [@sahrens](https://github.com/sahrens)) -- Flow types improvements ([b6c7e551a9](https://github.com/facebook/react-native/commit/b6c7e551a91c406884cbbe8ee37c0038a1b7f0be), [b98bf1e097](https://github.com/facebook/react-native/commit/b98bf1e09739860d82e37225f1635bba3bc817b3), [80c18395e2](https://github.com/facebook/react-native/commit/80c18395e24760cd12b69592a10037f071255437), [70a3ececc3](https://github.com/facebook/react-native/commit/70a3ececc368a8d0fe4b57b13ac956ad99a637c7), [f7343576fc](https://github.com/facebook/react-native/commit/f7343576fc2ca941b03145d9e97208bcbc8c345b), [a817c64043](https://github.com/facebook/react-native/commit/a817c6404338b7b15aaeac5693ae3635a0a3dde0), [3fd82d3c89](https://github.com/facebook/react-native/commit/3fd82d3c89f2d7e5103b024b54250f2ded970d88), [cd8128b2ec](https://github.com/facebook/react-native/commit/cd8128b2eccf6898cdf798a1e1be1f7a5762a0d4), [5035af80ec](https://github.com/facebook/react-native/commit/5035af80ecddb44e2a8444780f25f336b760bf32), [26734a8473](https://github.com/facebook/react-native/commit/26734a8473ac2f5715f2b7a016f0cc8a15c6f073), [321ba067a8](https://github.com/facebook/react-native/commit/321ba067a8323c80262e51c94a931199d5ff5cd7), [b6b80f6a70](https://github.com/facebook/react-native/commit/b6b80f6a70c6d790c52b58453fefc2cea6cd06fe), [f1316cab6c](https://github.com/facebook/react-native/commit/f1316cab6c351852ef1da9939d4c8f0244fb8a6f), [2520c645f8](https://github.com/facebook/react-native/commit/2520c645f863c299e8dccb844bac3dc6a9d553e0), [214da52fe7](https://github.com/facebook/react-native/commit/214da52fe76c1688d0c1a402b3e6c4d0fc19d882), [dbdf43b428](https://github.com/facebook/react-native/commit/dbdf43b428da19a9eba012753904bcf33339ea9a), [49396aa78d](https://github.com/facebook/react-native/commit/49396aa78d218625c1933fa864acd70853faa9f9), [4895c645ea](https://github.com/facebook/react-native/commit/4895c645ea17ff939811f3d5ec6218cd4e31c5fb), [a3c07c95ef](https://github.com/facebook/react-native/commit/a3c07c95effd891c2bd5f3257efe5b24d85862be), [49ffc9fada](https://github.com/facebook/react-native/commit/49ffc9fada4266c3ba9751c5e8e4c475174c7e6c), and [c129457d3a](https://github.com/facebook/react-native/commit/c129457d3a6622d7c28e8b27829ffc2b0a03c5eb) by [@TheSavior](https://github.com/TheSavior), [@yungsters](https://github.com/yungsters), and [@alex288ms](https://github.com/alex288ms)) -- Better enable cross-platform support of WebSocket.js ([b9be28915c](https://github.com/facebook/react-native/commit/b9be28915cf323eb36f1d7c77821cdf994954074) by [@rozele](https://github.com/rozele)) -- Better error handling in the CLI around making directories ([d2817f48a1](https://github.com/facebook/react-native/commit/d2817f48a1146b469d544ee78015251551d358c3) by [@BridgeAR](https://github.com/BridgeAR)) -- Verify that the component passed to createAnimatedComponent is not functional ([10b642a7af](https://github.com/facebook/react-native/commit/10b642a7af097bd508dab7b5d4723ccb4339d35f) by [@janicduplessis](https://github.com/janicduplessis)) -- Don't truncate in the middle of an emoji ([9c8c597000](https://github.com/facebook/react-native/commit/9c8c5970002d048e8b18088f7c63b39431def50b) by [@Vince0613](https://github.com/Vince0613)) -- Loosen Platform check to allow better code sharing for out-of-tree platforms ([84affbd6a3](https://github.com/facebook/react-native/commit/84affbd6a371dd865a3550b1fde1ebabee921341)) -- In CLI, fix issue with `isInstalled` check for Android and references to unregister ([ec884890b1](https://github.com/facebook/react-native/commit/ec884890b1f40da42e84202e082b4cef2506bbfc) by [@rozele](https://github.com/rozele)) - -#### iOS specific changes - -- tvOS `onPress` magnification animation now works via the `tvParallaxProperties` prop object taking `pressMagnification`, `pressDuration`, and `pressDelay` ([6c353fd7e9](https://github.com/facebook/react-native/commit/6c353fd7e9fd324717951ad62754d817537d7339) by [@JulienKode](https://github.com/JulienKode)) - -### Fixed: bugs that have been resolved - -- In **TouchableOpacity**, trigger animation on `opacity` upon change in `disabled` prop ([9366ce416f](https://github.com/facebook/react-native/commit/9366ce416fbf015e4795987d39a65199b1b335c2) by [@maxkomarychev](https://github.com/maxkomarychev)) -- Fixed an issue encountered when using `react-native-vector-icons` ([a759a44358](https://github.com/facebook/react-native/commit/a759a44358711180b37cf4ad25f28af47e3de298) and [54dc11a5fb](https://github.com/facebook/react-native/commit/54dc11a5fbafaccc9c0a781f1151225909717597) by [@jeanlauliac](https://github.com/jeanlauliac) and [@t4deu](https://github.com/t4deu))) -- Add missing mock for Jest for `removeEventListener` method ([59c7b2cfac](https://github.com/facebook/react-native/commit/59c7b2cfac534a79ff2461af5fd2034b280812a3) by [@MoOx](https://github.com/MoOx)) -- Fix main size calculation from the aspect ratio ([f751c3460e](https://github.com/facebook/react-native/commit/f751c3460e5dc48c1f1a2d72a56173285899de21)) -- Fix crash in Subscribable due to uglify-es ([b57a78c3de](https://github.com/facebook/react-native/commit/b57a78c3def50eda11e57542be0e5233a62d173b) by [@iMagdy](https://github.com/iMagdy)) -- Update `node-notifier` dependency to fix memory leak ([860fcd458a](https://github.com/facebook/react-native/commit/860fcd458a1873ebcf977be01670be5912ae7104) by [@rickhanlonii](https://github.com/rickhanlonii)) -- Fix issues with pollParams and link ([ca8ce83cc3](https://github.com/facebook/react-native/commit/ca8ce83cc3c38751604afce5a3e2f0473d9cba91) by [@grabbou](https://github.com/grabbou)) - -#### iOS specific fixes - -- DevLoadingView now supports the iPhone X screen shape ([47b36d3ff0](https://github.com/facebook/react-native/commit/47b36d3ff0dbb99fd3fc98f6e981a38084dd4d2c) by [@mrtnrst](https://github.com/mrtnrst)) -- Added bounds check to prevent ScrollView from scrolling to an offset which is out of bounds of the ScrollView ([16c9e5b715](https://github.com/facebook/react-native/commit/16c9e5b71500135a631480035af6cd2de3dafdc9) by [@siddhantsoni](https://github.com/siddhantsoni)) -- **NetInfo** `isConnected` works again ([dbafc29e60](https://github.com/facebook/react-native/commit/dbafc29e60aba1d5b24c2b0d321834c40e0b9bca) by [@alburdette619](https://github.com/alburdette619)) -- In **AlertIOS**, fix duplicate var name declaration ([6893a26bfb](https://github.com/facebook/react-native/commit/6893a26bfb06a2d8ad9d23a572f4d9143305d905)) -- Permit `react-native run-ios --device [id]` by passing port when running on device ([f8fee0a631](https://github.com/facebook/react-native/commit/f8fee0a631d77313d7cb5e65a3dd04a5a8ba3d03) by [@jozan](https://github.com/jozan)) -- Fixed issue with `run-ios` where `Entry, ":CFBundleIdentifier", Does Not Exist` was being received ([5447ca6707](https://github.com/facebook/react-native/commit/5447ca67076a110e2b0df03b014f53d1df4646ab) by [@blackneck](https://github.com/blackneck)) -- Fixed problem in Text measurement on iOS ([a534672e13](https://github.com/facebook/react-native/commit/a534672e132136e7bbd17c94a7f4e67149bcc67a) by [@shergin](https://github.com/shergin)) -- Fix crash when reloading in tvOS ([3a3d884df2](https://github.com/facebook/react-native/commit/3a3d884df253dbc1c02ffef33e99c4a91ea8751b) by [@dlowder-salesforce](https://github.com/dlowder-salesforce)) -- Fixed a bug with positioning of nested views inside **Text** ([7d20de412b](https://github.com/facebook/react-native/commit/7d20de412b37a35951e615d98509573dc1a24bcb) by [@shergin](https://github.com/shergin)) -- Fix blob response parsing for empty body ([f5207ba9c7](https://github.com/facebook/react-native/commit/f5207ba9c764f33ef83fa897f6014d67193be0e2) by [@janicduplessis](https://github.com/janicduplessis)) -- Fix tvOS react-native init release build ([3002c4eb98](https://github.com/facebook/react-native/commit/3002c4eb981d439f0ea304556d8dbd4ffd62a80b) by [@dlowder-salesforce](https://github.com/dlowder-salesforce) -- Fix RedBox from bridge reload due is not re-registering its root view ([2e51fa5f5d](https://github.com/facebook/react-native/commit/2e51fa5f5d4f229329ae457ab1a77ba5bcea0448) by [@fkgozali](https://github.com/fkgozali)) - -#### Android specific fixes - -- Fix: incorrect line-height calculation ([74e54cbcc4](https://github.com/facebook/react-native/commit/74e54cbcc408a8bbdd70f47cc8728d30cdc0d299) by [@strindhaug](https://github.com/strindhaug)) -- Fix crashes with TextInput introduced in 0.53 ([b60a727adb](https://github.com/facebook/react-native/commit/b60a727adbcfa785e3d1b13bf069b766216e60f8) by [@joshyhargreaves](https://github.com/joshyhargreaves)) -- Update ReactAndroid build script to support gradle 2.3.0 ([d8bb990abc](https://github.com/facebook/react-native/commit/d8bb990abc226e778e2f32c2de3c6661c0aa64e5)) -- Allow "unexpected URL" exception to be caught on Android when using fetch ([da84eba318](https://github.com/facebook/react-native/commit/da84eba318ae69fea28f40418178bdeb35c4a99b) by [@jcurtis](https://github.com/jcurtis)) -- Fix `onLayout` prop for **TextInput** ([8a073c1d8b](https://github.com/facebook/react-native/commit/8a073c1d8b89305a9a2561a7c33740919730f408) by [@rozele](https://github.com/rozele)) -- Fix ViewPager when using native navigation ([a1295e1707](https://github.com/facebook/react-native/commit/a1295e1707a856b9cd5c3129320d386aa9166310) by [@ruiaraujo](https://github.com/ruiaraujo)) -- Fix localization crash in **DevSettingsActivity** ([427e464bb9](https://github.com/facebook/react-native/commit/427e464bb95e4e0ecc7455e71b5d477014618200) by [@ayc1](https://github.com/ayc1)) -- Fix pinch crash in touch-responsive views ([67c3ad4e6a](https://github.com/facebook/react-native/commit/67c3ad4e6a1847cbac43115b01f72cc5c8932a61) by [@tobycox](https://github.com/tobycox)) -- Fix IllegalStateException thrown in looped timing native animation ([ef9d1fba23](https://github.com/facebook/react-native/commit/ef9d1fba237c08a158c8f32e823f229921e7c052) by [@kmagiera](https://github.com/kmagiera)) -- Workaround android-only js module resolution issue ([c20e0f94fe](https://github.com/facebook/react-native/commit/c20e0f94feb42a71633212114b42c62494fd4ff0) by [@fkgozali](https://github.com/fkgozali)) -- Fix ReadableNativeMap.toHashMap() for nested maps and arrays ([15fa2250fd](https://github.com/facebook/react-native/commit/15fa2250fdd0865ce1d0c6ac13b817e7b2c7757a) by [@esamelson](https://github.com/esamelson)) -- Fix Android Sanity Buck version check ([e0573225d5](https://github.com/facebook/react-native/commit/e0573225d5fe28e5ad61690eda3060289bdbf3a4) by [@hramos](https://github.com/hramos)) -- Fixes the connection to Firestore by following whatwg.org's XMLHttpRequest send() method ([d52569c4a1](https://github.com/facebook/react-native/commit/d52569c4a1b6bd19792e4bda23e3a8c3ac4ad8df) by [@samsafay](https://github.com/samsafay)) -- `invertStickyHeaders` can now be set from **SectionList** or **FlatList** ([dd479a9377](https://github.com/facebook/react-native/commit/dd479a93772c3a52561fc32ee84b25ce822a30fa) by [@dannycochran](https://github.com/dannycochran)) - -### Removed: features that have been removed; these are breaking - -- Removed various types ([b58e377961](https://github.com/facebook/react-native/commit/b58e377961ddd278bfa36df0e15953f976875de6), [ee26d9bcb0](https://github.com/facebook/react-native/commit/ee26d9bcb0719246efa51af404aa7805404675cc), [d89517d60a](https://github.com/facebook/react-native/commit/d89517d60a8a6cabc9013b603fa3f63a1face6a2), [852084ad45](https://github.com/facebook/react-native/commit/852084ad454565bb856e85f09e098f1a4a0771a6) by [@TheSavior](https://github.com/TheSavior)) -- Deleted `Systrace.swizzleJSON()` ([3e141cb6c9](https://github.com/facebook/react-native/commit/3e141cb6c957143e998bf2926b8fe1aabccbce2d) by [@yungsters](https://github.com/yungsters)) - -#### Android specific removals - -- `ReactInstanceManager#registerAdditionalPackages` has been removed; Create UIManager interface and extract common classes in uimanager/common ([6b45fb2cb1](https://github.com/facebook/react-native/commit/6b45fb2cb1ca44fa7375bc7696bf90a68a85df3c) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific removals - -- Remove callFunctionSync experimental APIs ([19a4a7d3cb](https://github.com/facebook/react-native/commit/19a4a7d3cb6d00780ccbbbd7b0062896f64ab24d) by [@danzimm](https://github.com/danzimm)) - -## v0.54.0 - -Welcome to the February 2018 release of React Native! This release includes work done by the React Native team and the community in January, and there are some big changes here after the holidays. Thanks for 270 commits from 87 contributors, you all are great! Here are a few highlights from the release: - -- Long awaited **Blob** changes: upload, download, fetch locally, and more -- Sticky headers now work on inverted Lists -- Update to the newest React, which deprecated some lifecycle methods and added new ones – expect Yellowbox until React Native is updated -- `Space-evenly` is now there (sorry for the confusion with 0.52's release notes) -- A lot of under-the-covers work on Yoga, iOS's **Text** and **TextInput**, and a ton of other areas -- Multiple crash fixes - -The changelog is arranged by the customary added, removed, changed, and fixed plus internal; the changes are also organized by platform. - -### Added - -- ✨ **Blob**s now can be: made from Strings, loaded by File using a FileReader API, uploaded and downloaded via `XMLHttpRequest#fetch`, and fetched on files to a local blob consistently ([be56a3efee](https://github.com/facebook/react-native/commit/be56a3efeefefa6dca816ca5149a3dabfa5164e2) and [854c2330eb](https://github.com/facebook/react-native/commit/854c2330ebe748eb0508bb788685232b6cff0022) by [@satya164](https://github.com/satya164) and [@fkgozali](https://github.com/fkgozali)) -- Dynamic node_module dependencies are now supported ([b5e19adc02](https://github.com/facebook/react-native/commit/b5e19adc02a3293cd3fdbe54cc45adc78f94d325) by [@jeanlauliac](https://github.com/jeanlauliac)) -- Support sticky headers for inverted Lists with `invertStickyHeaders` ([ecaca80d42](https://github.com/facebook/react-native/commit/ecaca80d42b686e4cf91aa4bb0c8fce69eba18bb) by [@janicduplessis](https://github.com/janicduplessis)) -- `space-evenly` is now supported (sorry for the confusion with 0.52 notes) ([b1cdb7d553](https://github.com/facebook/react-native/commit/b1cdb7d553146160f99319f9dbe4083b18db60e4) by [@gedeagas](https://github.com/gedeagas)) -- Platform plugins can participate in RNConfig, `link`, and `unlink` – keep an eye on [react-native-window's use of it](https://github.com/Microsoft/react-native-windows/pull/1601)! ([a40bfa730e](https://github.com/facebook/react-native/commit/a40bfa730e05c68da49e6f217ae0f161dcc7ba98) by [@rozele](https://github.com/rozele)) -- Add `minify` flag to react-native bundle command ([3f969cb1db](https://github.com/facebook/react-native/commit/3f969cb1db3a39dd8a4fd622abbb7e4270a84216) by [@tomduncalf](https://github.com/tomduncalf)) - -#### VR Specific Additions - -- Added **ScrollView** support ([6fa039dab0](https://github.com/facebook/react-native/commit/6fa039dab0b9f738a3cb464aeca378c6210a5747) by [@MartinSherburn](https://github.com/MartinSherburn)) - -#### Android Specific Additions - -- Bundle download progress is now shown like iOS ([d06e143420](https://github.com/facebook/react-native/commit/d06e143420462344ea6fc21c0446db972f747404) by [@janicduplessis](https://github.com/janicduplessis)) -- Add back ability to customise OkHttp client ([22efd95be1](https://github.com/facebook/react-native/commit/22efd95be1f0b236eeaaa8a8e6d01e89771c9543) by [@cdlewis](https://github.com/cdlewis)) - -#### iOS specific additions - -- **ScrollView** now supports smooth bi-directional content loading and takes new prop `maintainVisibleContentPosition` ([cae7179c94](https://github.com/facebook/react-native/commit/cae7179c9459f12b1cb5e1a1d998a9dc45f927dc) and [65184ec6b0](https://github.com/facebook/react-native/commit/65184ec6b0ef2d136c0db239d65e0624efac8a2d) by [@sahrens](https://github.com/sahrens)) -- Allow substituting a default font handler ([a9c684a0ff](https://github.com/facebook/react-native/commit/a9c684a0ff45852087310d5218062acfdab673f7) by [@mmmulani](https://github.com/mmmulani)) -- Add `accessibilityElementsHidden` prop ([31288161e1](https://github.com/facebook/react-native/commit/31288161e188723456fdb336c494f3c8a3f5b0a8) by [@aputinski](https://github.com/aputinski)) -- Add EXTRA_PACKAGER_ARGS extensibility point on `scripts/react-native-xcode.sh` (PR rev [0d4ff1b7ea](https://github.com/facebook/react-native/commit/0d4ff1b7ea768cceca0405c665e322c0d6b5ba20) by [@brunolemos](https://github.com/brunolemos) with landing assists [b8c86b8dec](https://github.com/facebook/react-native/commit/b8c86b8deced01027b609959576ffcf5d2d0f520) and [0d4ff1b7ea](https://github.com/facebook/react-native/commit/0d4ff1b7ea768cceca0405c665e322c0d6b5ba20)) - -### Removed - -- Remove internal `utf8` utility - use the **utf8** package now instead ([431670f908](https://github.com/facebook/react-native/commit/431670f90860936c24260d36fc73e0c5fbf4e02a) by [@mathiasbynens](https://github.com/mathiasbynens)) - -#### iOS specific removals - -- Removed outdated assertion in RCTShadowView related to breaking change in Yoga ([e3ff3cf6cb](https://github.com/facebook/react-native/commit/e3ff3cf6cbc137e315eff6ac8aed43954b3668eb) by [@shergin](https://github.com/shergin)) - -#### Android specific removals - -- Fix an issue when swapping to and from the `visible-password` or `phone-pad` keyboard types. ([164f6b6afd](https://github.com/facebook/react-native/commit/164f6b6afd7e0050d63134fcdc65ec6969ab03a0) by [@BrandonWilliamsCS](https://github.com/BrandonWilliamsCS)) -- Remove redundant config in AndroidManifest.xml ([d7a9ca2893](https://github.com/facebook/react-native/commit/d7a9ca2893fb240c25d1cd1e0778f6b93b1e3ded) by [@gengjiawen](https://github.com/gengjiawen)) - -#### iOS specific removals - -- Delete RCTBatchedBridge ([816d417189](https://github.com/facebook/react-native/commit/816d41718998868f276d83b0c21e17d11ad392a2) by [@mhorowitz](https://github.com/mhorowitz)) - -### Changed - -- Docs clarifications ([7abffc3f8c](https://github.com/facebook/react-native/commit/7abffc3f8ce69fab5bbb4147f9b8bcb85a7d2c38) by [@IgorGanapolsky](https://github.com/IgorGanapolsky)) - -#### iOS Specific Changes - -- ⚡️ **Text** and **TextInput** have been re-implemented from the ground up for performance, flexibility, and reduced technical debt ([2716f53220](https://github.com/facebook/react-native/commit/2716f53220f947c690d5f627286aad51313256a0), [74963eb945](https://github.com/facebook/react-native/commit/74963eb945438a6fd269b5764a6cb251c86deda8), [d7fa81f181](https://github.com/facebook/react-native/commit/d7fa81f18110f0dc0f310a5c066d9a30020ca830), [74963eb945](https://github.com/facebook/react-native/commit/74963eb945438a6fd269b5764a6cb251c86deda8), [6c4ef287ad](https://github.com/facebook/react-native/commit/6c4ef287ad95eb14475a9f512487e5d05949309a), [ebc98840e9](https://github.com/facebook/react-native/commit/ebc98840e93c336e8c9e4a93c78e6ca03591f0ec), [d7fa81f181](https://github.com/facebook/react-native/commit/d7fa81f18110f0dc0f310a5c066d9a30020ca830), [7d1ec7a3dc](https://github.com/facebook/react-native/commit/7d1ec7a3dc66654b13a8e9cb3ddf912e92506f55), [52648326e6](https://github.com/facebook/react-native/commit/52648326e6ac4470eeffc0a56d91bc487bc1eae4), [6bb8617f3a](https://github.com/facebook/react-native/commit/6bb8617f3a2f3f80f89eb00595a621aec35aca83), [5dbb3c586c](https://github.com/facebook/react-native/commit/5dbb3c586c9e8483aa7e6f1edd35ffb12bd4305d), [7e7d00aebe](https://github.com/facebook/react-native/commit/7e7d00aebefd2416f948066c65c739581c6e3f54), [46fd864348](https://github.com/facebook/react-native/commit/46fd8643485b21147c780d22ee8cf751b2dc8750), [9dfa2e7f3c](https://github.com/facebook/react-native/commit/9dfa2e7f3cfa5009f6c54382e90681d99a9c3cb8), [8a882fe6d6](https://github.com/facebook/react-native/commit/8a882fe6d6bb35776551eb8b0cd6892f41cab492), and [0f9fc4b295](https://github.com/facebook/react-native/commit/0f9fc4b2953d52fa1754e786dc5c74bfecbeaaca) by [@shergin](https://github.com/shergin) and [@hovox](https://github.com/hovox)) -- **Image**'s `resizeMode="center"` is now documented and has an example present ([be7037fd8e](https://github.com/facebook/react-native/commit/be7037fd8e1c4b92646caf7a70b9d6d28ef2c30a) by [@motiz88](https://github.com/motiz88)) -- Geolocation API no longer timeouts when `skipPermissionRequests: true` ([5c17db8352](https://github.com/facebook/react-native/commit/5c17db8352abfd94f094deb9b550284ec17f1fcd) by [@ngandhy](https://github.com/ngandhy)) -- Rounding pixels is now done with an algorithm from Yoga rather than React Native, reducing debt and improving performance ([ceb1d1ca5b](https://github.com/facebook/react-native/commit/ceb1d1ca5bc7c04b9d9ad16dcd9583f05b0ef498) and [114c258045](https://github.com/facebook/react-native/commit/114c258045ccca3a4433de206c7983b42d14c03b) by [@shergin](https://github.com/shergin)) - -#### Android specific changes - -- Numerous refactors around bundle handling and the `DevServerHelper` ([644123aa6f](https://github.com/facebook/react-native/commit/644123aa6fc6132125f56b485e5ab3b16f28f666), [e756251413](https://github.com/facebook/react-native/commit/e7562514130f614a9f138c0b855bfe4516150add), [6e44356c9b](https://github.com/facebook/react-native/commit/6e44356c9bb364195280aafc69aae48cdcb2ab84), [1019bda930](https://github.com/facebook/react-native/commit/1019bda930fa4c26fc0006efa023ee2c586705c6), [06d8f96a64](https://github.com/facebook/react-native/commit/06d8f96a64f00a003e34b0c1e93033893173ccc8), [f88c9d6382](https://github.com/facebook/react-native/commit/f88c9d63828e975a9792969e27accd851ead3e86), and [108f9664bf](https://github.com/facebook/react-native/commit/108f9664bffd1a4e0a7b2c2da3dc3810f1b29de2) by [@davidaurelio](https://github.com/davidaurelio)) - -### Fixed - -- Fix JS debugger issues related to CORS ([29f8354c19](https://github.com/facebook/react-native/commit/29f8354c1946a6325e9020b9ef5ee4ccdf0fa51f) by [@njbmartin](https://github.com/njbmartin)) -- Keep the `.gitignore`d files during the `react-native-git-upgrade` process ([7492860ffb](https://github.com/facebook/react-native/commit/7492860ffb3a010ff2273abf45c7414c098bdc37) by [@ncuillery](https://github.com/ncuillery)) -- Fix re-render case on SwipeableRow ([a580a44b0d](https://github.com/facebook/react-native/commit/a580a44b0d51ca7f33a4394b0a22d1c7d2234190)) -- Fix display of syntax error messages when HMR is enabled ([2b80cdf1bb](https://github.com/facebook/react-native/commit/2b80cdf1bba3b756915117139474440c203cbd8d) by [@ide](https://github.com/ide)) -- Add fixtures to metro blacklist in order to let build succeed ([54dc11a5fb](https://github.com/facebook/react-native/commit/54dc11a5fbafaccc9c0a781f1151225909717597) by [@t4deu](https://github.com/t4deu)) - -#### Android specific fixes - -- Don't crash when using decimal `Animated.modulo` values with `useNativeDriver: true` ([6c38972327](https://github.com/facebook/react-native/commit/6c389723274712bc52d6642cc6c1907b5523726d) by [@motiz88](https://github.com/motiz88)) -- Don't crash when receiving unknown websocket IDs ([1a790f8703](https://github.com/facebook/react-native/commit/1a790f8703d44c2322000dbf40a55678ca8a436a) by [@sunweiyang](https://github.com/sunweiyang)) -- Dont crash when `NativeModules.UIManager.showPopupMenu` method calls error callback ([0c18ec5b9c](https://github.com/facebook/react-native/commit/0c18ec5b9c64613dbdcd4be9f80e470e9532483d) by [@dryganets](https://github.com/dryganets)) -- Maintain cursor position when **TextInput**'s `secureTextEntry` changes ([09b43e479e](https://github.com/facebook/react-native/commit/09b43e479e97dfe31910503190b5d081c78e4ea2) by [@jainkuniya](https://github.com/jainkuniya)) -- Race condition fix in Dialogs module ([d5e3f081c6](https://github.com/facebook/react-native/commit/d5e3f081c6b41697533775d378969fcf554c7290) by [@dryganets](https://github.com/dryganets)) -- Fix NPE in Android Switch during measure ([7b1915e74d](https://github.com/facebook/react-native/commit/7b1915e74daa82d0a94e90ff266e9271bc43f4d8) by [@4ndroidev](https://github.com/4ndroidev)) -- Fix initialScrollIndex ([ef596dec49](https://github.com/facebook/react-native/commit/ef596dec49975dd4f8860ad8adcd29dd23e04c14) by [@olegbl](https://github.com/olegbl)) -- Fix redbox style ([f363dfe766](https://github.com/facebook/react-native/commit/f363dfe766244c8fc10eab3d2c4acdd8fc4b576b) by [@ayc1](https://github.com/ayc1)) -- Fix crash due to mishandling of UTF-8 in progressive download. ([9024f56bda](https://github.com/facebook/react-native/commit/9024f56bda4186fbade7bbd1e61f8e0252585c02) by [@dryganets](https://github.com/dryganets)) -- Fix crash because ClassCastException fix: getText() returns CharSequence not Spanned ([46cc4907e3](https://github.com/facebook/react-native/commit/46cc4907e3e49f5c7b1ac0a1088866f2958f43a1) by [@dryganets](https://github.com/dryganets)) -- Fix and re-enable "view flattening" optimizations ([877f1cde2e](https://github.com/facebook/react-native/commit/877f1cde2ebe8f304d6fd0855fc4a874d1d5ee27) by [@mdvacca](https://github.com/mdvacca)) - -#### iOS specific fixes - -- Fix Crash when **CameraRoll** is getting assets from iCloud and no filename is provided ([2ae24361c5](https://github.com/facebook/react-native/commit/2ae24361c5e0fc4aed9a321123bba8ca416a35ff) by [@pentarex](https://github.com/pentarex)) -- Fix Xcode Archive task failing if project path contains whitespace ([8aa568e867](https://github.com/facebook/react-native/commit/8aa568e867bbbe7e23ded3651f23581ff2753323) by [@jevakallio](https://github.com/jevakallio)) -- `react-native link` has been fixed to correctly link iOS and tvOS targets ([a63fd378a4](https://github.com/facebook/react-native/commit/a63fd378a47173cc9f750e9980f18dc12dd7ea51) by [@dlowder-salesforce](https://github.com/dlowder-salesforce)) -- `GLog` fix on case sensitive APFS macOS ([2fef1bafc8](https://github.com/facebook/react-native/commit/2fef1bafc8bee33432486212caf4fef5c659dd37) by [@hovox](https://github.com/hovox)) -- Fixed issue where you cannot launch tvOS app on Apple TV simulator ([afd988f85a](https://github.com/facebook/react-native/commit/afd988f85a8cf0980b5844cb88c1803e41502d03)) - -### Internal work - -- A **massive** amount of Yoga optimizations, cleanups, refactors, and test fixes ([62d01006a1](https://github.com/facebook/react-native/commit/62d01006a125517c8991fa93979aaec6ccc18823), [1475fc4856](https://github.com/facebook/react-native/commit/1475fc4856d366f8ec2027374971ed5aefcdeafa), [9daa17458a](https://github.com/facebook/react-native/commit/9daa17458a5f4ab8ead4d7c29de331f08b1a4a46), [d4517ddb9f](https://github.com/facebook/react-native/commit/d4517ddb9f2ad6d6175cbe6a8be2b819e4aa2c29), [ca91f0e3ac](https://github.com/facebook/react-native/commit/ca91f0e3ac55cb1e7a0fa2399d594a47de80a100), [34b7ec82b5](https://github.com/facebook/react-native/commit/34b7ec82b5d22efbdaa8b74b930d3c4da87414ec), [fda861a889](https://github.com/facebook/react-native/commit/fda861a88914a008b94c12078c9e579a99929643), [9f7cedbe14](https://github.com/facebook/react-native/commit/9f7cedbe14321d24b7aee1ba969b3d23d5c9d204), [ac1c8c265e](https://github.com/facebook/react-native/commit/ac1c8c265e6030c52434f99e882639c67c8c175d), [fcf2c7cf61](https://github.com/facebook/react-native/commit/fcf2c7cf61ca454f10d398d57b78b5b29ed05ae2), [2b27f1aa19](https://github.com/facebook/react-native/commit/2b27f1aa1964eba749876100be1f3ac4c085fa8f), [210ae5b95a](https://github.com/facebook/react-native/commit/210ae5b95a9c94194e95a21fdb93f88ddfdc5ce2), [82088580ab](https://github.com/facebook/react-native/commit/82088580ab17417a51386722f98b83d6cad0a6a0), [7f94bff89a](https://github.com/facebook/react-native/commit/7f94bff89a09547e76b50ae4c96ec59de73a153a), [bd7bf94af9](https://github.com/facebook/react-native/commit/bd7bf94af9ddfc9221ac3f6f62821b7e53e9b0ea), [2fe65b032e](https://github.com/facebook/react-native/commit/2fe65b032e9ec3faf3cef31290372b9face2d3f1), [9658d9f82b](https://github.com/facebook/react-native/commit/9658d9f82ba536c2f39937d61b3954e3dcc6a54e), [ee5c91c031](https://github.com/facebook/react-native/commit/ee5c91c0317b0defbb8da21f7e6d8d3ac8967381), [64d530ba07](https://github.com/facebook/react-native/commit/64d530ba0785af21555d48ddc9e7d561af37db4c), [400a29e151](https://github.com/facebook/react-native/commit/400a29e15134f5264cc55b239bd2a18a107911dd), [f75e21f1ca](https://github.com/facebook/react-native/commit/f75e21f1caf9117ae3eda31c23e286116ebf586c), [528bbacf6b](https://github.com/facebook/react-native/commit/528bbacf6b8a5a62faf4db5bfc8dfe063f0b82a3), [be8e7c6e65](https://github.com/facebook/react-native/commit/be8e7c6e65724d4915862098238506172dbe9657), [d0f7d4d107](https://github.com/facebook/react-native/commit/d0f7d4d107a90fdfbf795d842f4bd4a81290ec62), [4b4959a21c](https://github.com/facebook/react-native/commit/4b4959a21cb1e9e356eab51bfba0f16b76e8ec7f), [fdef3784f0](https://github.com/facebook/react-native/commit/fdef3784f00e8c3233a30aa2e35aaaadaa867489), [831a1bb4b1](https://github.com/facebook/react-native/commit/831a1bb4b1cc201b53685874a9dbdd6c3c1615ad), [2a22d998f8](https://github.com/facebook/react-native/commit/2a22d998f8a7f896db6c0708ba92ed9c9082ee7c), [9f57dedc17](https://github.com/facebook/react-native/commit/9f57dedc1712733ce4a490121138a97917fd3a52), and [ff2658c3de](https://github.com/facebook/react-native/commit/ff2658c3de111ef745d9582c6863ab0d6c90f960) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar), [@passy](https://github.com/passy), [@ryu2](https://github.com/ryu2), and others) -- 🚧 Lifecycle methods were renamed to be consistent with [React RFC6](https://github.com/reactjs/rfcs/blob/master/text/0006-static-lifecycle-methods.md) – note that there are Yellowbox warnings right now because of this, it's work-in-progress ([6f007e8957](https://github.com/facebook/react-native/commit/6f007e8957c9bf5652b0184cba65f385050a8236) by [@bvaughn](https://github.com/bvaughn)) -- Some autogenerated mystery string files were added ([c7846c4bfb](https://github.com/facebook/react-native/commit/c7846c4bfb5b944714d95382210f83c83da1ac52), [bb6fceac27](https://github.com/facebook/react-native/commit/bb6fceac274422102b347ec7aedb36efd9b701cd), [8bd00a2361](https://github.com/facebook/react-native/commit/8bd00a2361bb39f1bda58a260b7ffd278a05d79d), [faa9519021](https://github.com/facebook/react-native/commit/faa951902161201846f20a4dc55950e8f96cb0ff), [f49f7932d5](https://github.com/facebook/react-native/commit/f49f7932d581fe1f9569fb460196801528cfb591)) -- Improvements to the cli's implementation ([1673c570f9](https://github.com/facebook/react-native/commit/1673c570f984d86e88a3b6b44eb78f4848eb0515), [752427b7b8](https://github.com/facebook/react-native/commit/752427b7b8221bbb8304a158b2dad12b26afd7a5), and [619a8c9f29](https://github.com/facebook/react-native/commit/619a8c9f298356db68f8cd7e5d25e5bcf48bab05) by [@arcanis](https://github.com/arcanis), [@voideanvalue](https://github.com/voideanvalue), and [@rozele](https://github.com/rozele)) -- Measure touch events from nearest "root view" ([a70fdac5bd](https://github.com/facebook/react-native/commit/a70fdac5bdd4500b4ca3074dac26d414bd931fb9) by [@mmmulani](https://github.com/mmmulani)) -- Allow to attach the HMR server to an external http server ([8c6b816caa](https://github.com/facebook/react-native/commit/8c6b816caa908845471460f453f9d761bfba3f3d) by [@rafeca](https://github.com/rafeca)) -- Split folly/Memory out from headers-only targets in Buck ([b8e79a7e8b](https://github.com/facebook/react-native/commit/b8e79a7e8be1f3db1482a849352fda6e23c1c78a) by [@mzlee](https://github.com/mzlee)) -- Code cleanup of **ReactHorizontalScrollView** in Android ([71ec85f24c](https://github.com/facebook/react-native/commit/71ec85f24c3a1007a9e1f036a140cce43b38019f) by [@mdvacca](https://github.com/mdvacca)) -- Always create a debugger websocket connection when in iOS dev builds ([fa334ce464](https://github.com/facebook/react-native/commit/fa334ce464da39625f4e4fbfee259e9dcea31abc) by [@bnham](https://github.com/bnham)) -- Make the React Native HMR client extend from the generic metro HMR client ([9a19867798](https://github.com/facebook/react-native/commit/9a198677989930971912b98487ec68d162636411) by [@rafeca](https://github.com/rafeca)) -- Removed use of xip.io ([40a8434bde](https://github.com/facebook/react-native/commit/40a8434bde855ecae42408ec1240622152432de7) by [@jvranish](https://github.com/jvranish)) -- Fix Buck dependencies ([cec2e80fc2](https://github.com/facebook/react-native/commit/cec2e80fc251e4ea45ce1e446323716a3792390d), [4f6c157250](https://github.com/facebook/react-native/commit/4f6c157250676f07619af2a935bddd8301b50caa) by [@swolchok](https://github.com/swolchok)) -- Fix permissions on test script ([42c410ac84](https://github.com/facebook/react-native/commit/42c410ac84619a3d12a4619e59a0a526a3ebdca9) by [@mzlee](https://github.com/mzlee)) -- Better handling exception in loadScript() ([3fbf7856d9](https://github.com/facebook/react-native/commit/3fbf7856d9acb0909357d6b315388471a6b5a69c)) -- Fix ESLint upgrade "parsing error" ([9d214967d2](https://github.com/facebook/react-native/commit/9d214967d2c8184ce26addec150e392e3b519fcd) by [@zertosh](https://github.com/zertosh)) -- Fixing 🤡 in RCTSurfaceRootShadowView ([5fba82deff](https://github.com/facebook/react-native/commit/5fba82deffde731176e3e118193c212f5d2c2bca) by [@shergin](https://github.com/shergin)) -- Handle invalidation error in RCTObjcExecutor ([493f3e8da5](https://github.com/facebook/react-native/commit/493f3e8da5a112e1b33bfb3e9f51e7a2bd7edc7a) by [@fromcelticpark](https://github.com/fromcelticpark)) -- Check for nullptr when accessing isInspectable method ([70d23e82ad](https://github.com/facebook/react-native/commit/70d23e82ad21a4cfde1ce7c3b1c00fe7c7d5adbd) by [@fromcelticpark](https://github.com/fromcelticpark)) -- Introduce new Fabric API in RNAndroid ([2d35bde101](https://github.com/facebook/react-native/commit/2d35bde10130167018791c1b2fe4fece27cefddc) by [@mdvacca](https://github.com/mdvacca)) -- Fixing Prepack model for latest global.nativeExtensions changes. ([01a58d182a](https://github.com/facebook/react-native/commit/01a58d182abd19c9e089ec38b08ffd4b45e2076c) by [@NTillmann](https://github.com/NTillmann)) -- General code cleanup: unused code and configurations ([e233646d09](https://github.com/facebook/react-native/commit/e233646d095a272091b07c29fa87b206831ad6e3) and [e7010348d8](https://github.com/facebook/react-native/commit/e7010348d8b2f703fcc057c2914bd45ca6238f98) by [@bvaughn](https://github.com/bvaughn) and others) -- Add support for finding multiple views with NativeIds using a single listener to Android ([f5efc460ad](https://github.com/facebook/react-native/commit/f5efc460ad30cc60a62edd540c3b0f45c67bcda3) by [@axe-fb](https://github.com/axe-fb)) -- Add CountingOutputStream ([a5e135aed6](https://github.com/facebook/react-native/commit/a5e135aed6941772c663adffd67729f7a5026d08) by [@hramos](https://github.com/hramos)) -- Changes from Prettier ([b815eb59be](https://github.com/facebook/react-native/commit/b815eb59bef7bed9825027adc676b8d09db463c6), [e758cb7f39](https://github.com/facebook/react-native/commit/e758cb7f397b37b5621a4e0afcabc1c74443bc06), [bf9cabb03c](https://github.com/facebook/react-native/commit/bf9cabb03c7245930c270a19816545eae1b9007d), and [a5af841d25](https://github.com/facebook/react-native/commit/a5af841d259b6b29d95a9fb346a0ffce9c6efbfe) by [@shergin](https://github.com/shergin)) -- Typos in code ([8ffc16c6e7](https://github.com/facebook/react-native/commit/8ffc16c6e7d25dd434ca3fc7f9ffd6d5917f7bcd) by [@ss18](https://github.com/ss18)) -- Support for inherited events in view managers ([2afe7d4765](https://github.com/facebook/react-native/commit/2afe7d4765ffc0d0c71d233211edd1d21972040e) by [@shergin](https://github.com/shergin)) -- Flow types changes ([3fc33bb54f](https://github.com/facebook/react-native/commit/3fc33bb54fc5dcf7ef696fe245addc320f85a269), [e485cde187](https://github.com/facebook/react-native/commit/e485cde187e4cd92bc821e58047b149a789dd713), [83ed9d170b](https://github.com/facebook/react-native/commit/83ed9d170b8fd750a345fc608ec69db2fe3ca9b2), [52ffa5d13e](https://github.com/facebook/react-native/commit/52ffa5d13ef6fe2752bc8f838dc1c2dfe651bb64), [d37cdd97ae](https://github.com/facebook/react-native/commit/d37cdd97aee4c1bac864cb28b686f2d1a128128e), [6e7fb01c02](https://github.com/facebook/react-native/commit/6e7fb01c02f3e91777c8292389c09a15d24cf800), [d99ba70c49](https://github.com/facebook/react-native/commit/d99ba70c492d3cd15ef6aded3f8712976d251f88), [bcfbdf4fbe](https://github.com/facebook/react-native/commit/bcfbdf4fbec1a05da151a2255f44a87b651965d6), and [a1c479fb3b](https://github.com/facebook/react-native/commit/a1c479fb3be674511131b46f856bc9b197a38cda) by [@alexeylang](https://github.com/alexeylang), [@sahrens](https://github.com/sahrens), [@yungsters](https://github.com/yungsters), and [@zjj010104](https://github.com/zjj010104)) -- Give IInspector a virtual destructor for correct InspectorImpl destruction ([2a3c37f424](https://github.com/facebook/react-native/commit/2a3c37f424a4d1b9f4c5a2960a1cbe3517eac007) by [@toulouse](https://github.com/toulouse)) -- Migrated `SourceCode` and `DeviceInfoModule` out of Native Modules ([47fe52380a](https://github.com/facebook/react-native/commit/47fe52380a232a1c364e21f71e2644a5a3348366) and [429fcc8cab](https://github.com/facebook/react-native/commit/429fcc8cab3ca877275d7deb1040fdff17a414c7)) -- Jest config change as part of bringing back support for the `assetPlugin` option in Metro ([af6450c660](https://github.com/facebook/react-native/commit/af6450c660d3055d9c5c70d200471541a1ce7e12) by [@ide](https://github.com/ide)) -- Nested virtualized lists should receive recordInteration events ([ae2d5b1e68](https://github.com/facebook/react-native/commit/ae2d5b1e68a2207c27ef2f1b533f86c86d6d849b)) -- Upgrade connect dependency ([709ede799c](https://github.com/facebook/react-native/commit/709ede799cc9820acadaf22aa84f0fe6dd2be319) by [@rafeca](https://github.com/rafeca)) -- xplat/js: asyncRequire: redirect async modules to control modules ([5e11b8870a](https://github.com/facebook/react-native/commit/5e11b8870aa855a56cfafa6575aed5e33b272065) by [@jeanlauliac](https://github.com/jeanlauliac)) -- More progress towards split bundle support ([1a1a956831](https://github.com/facebook/react-native/commit/1a1a956831aec93a4fe2c6e2f63f558271fb466b) and [9e34cbda9d](https://github.com/facebook/react-native/commit/9e34cbda9de8f7350cfb02c884fbef2da18e0e3a) by [@fromcelticpark](https://github.com/fromcelticpark)) -- Implement bundle sync status ([88980f2ef7](https://github.com/facebook/react-native/commit/88980f2ef7331aa630ff19e54427cdc3b7510869)) -- Various improvements to RCTSurface and RCTShadowView ([7d9e902d72](https://github.com/facebook/react-native/commit/7d9e902d72e240f54ea01225cc3272698ff70014), [06ebaf2205](https://github.com/facebook/react-native/commit/06ebaf2205f979b6e6595ec7985447a07d25c4d4), [6882132421](https://github.com/facebook/react-native/commit/688213242130536c5d4db8b9aa17dc418372aadf), and [193a2bd4cd](https://github.com/facebook/react-native/commit/193a2bd4cdffbbc79b69c067b31420663dc9b03a) by [@shergin](https://github.com/shergin)) -- Progress towards experimental ReactFabric and FabricUIManager ([b1e5c01483](https://github.com/facebook/react-native/commit/b1e5c01483a69b181c75d242231077cb2f96e846), [fa0ac92b2c](https://github.com/facebook/react-native/commit/fa0ac92b2c9cfc302314ff18325a96354bb1f432), [94dac23583](https://github.com/facebook/react-native/commit/94dac23583dc6b693475769c196c4b51954e74f1) by [@fkgozali](https://github.com/fkgozali)) -- (almost) kill fbjsc ([702b7e877e](https://github.com/facebook/react-native/commit/702b7e877e09afede0dcdc7f8c680be63e942153) by [@michalgr](https://github.com/michalgr)) -- Refactored bridge ReadableNativeMap and ReadableNativeArray to add centralized accesses ([7891805d22](https://github.com/facebook/react-native/commit/7891805d22e3fdc821961ff0ccc5c450c3d625c8), [28be33ac34](https://github.com/facebook/react-native/commit/28be33ac34d9214ffd452f88a4d19468683a6a0d), and [5649aed6d3](https://github.com/facebook/react-native/commit/5649aed6d3223ec49c42416f242249eb0c4fd890)) -- Removed unused core from Image.android.js ([ce3146a6f3](https://github.com/facebook/react-native/commit/ce3146a6f3162141c7dc06d2c91ec291d3756a92) by [@shergin](https://github.com/shergin)) -- Capture StackOverflowExceptions triggered when drawing a ReactViewGroup or ReactRootView and log more debugging information for it ([1aac962378](https://github.com/facebook/react-native/commit/1aac9623789e3d2a428b51ae699d4c340b3afb99) and [4d3519cc6a](https://github.com/facebook/react-native/commit/4d3519cc6af5bb33c6f21d9392b82379780d79dc) by [@mdvacca](https://github.com/mdvacca)) -- `babel-preset-react-native`: only require plugins once ([df6c48cf36](https://github.com/facebook/react-native/commit/df6c48cf36d39a75a6196462d661ce75c6aef104) by [@davidaurelio](https://github.com/davidaurelio)) -- Report module id as string and as double, in case of invalid values are passed to nativeRequire ([8f358a2088](https://github.com/facebook/react-native/commit/8f358a20881b61cf3256fa1e404b86d5f104932d) by [@fromcelticpark](https://github.com/fromcelticpark)) -- More work moving build configurations to Skylark ([d3db764f38](https://github.com/facebook/react-native/commit/d3db764f383fc588a87e0d1e4267b310d6188bc8), [869866cc5c](https://github.com/facebook/react-native/commit/869866cc5c639d8c0257c776368381987a7f7159), [a8c95d2417](https://github.com/facebook/react-native/commit/a8c95d241757fefaa06ff49193975f7c103a6418), and [79a63d040f](https://github.com/facebook/react-native/commit/79a63d040f1346a0e320104fb35da405502aae19) by [@mzlee](https://github.com/mzlee), [@ttsugriy](https://github.com/ttsugriy), and others) -- `[RCTShadowView isHidden]` was removed ([c19bc79688](https://github.com/facebook/react-native/commit/c19bc7968855e85758df9e1a47dc2a52e69668ed) by [@shergin](https://github.com/shergin)) -- Remove unused `packagerInstance` option and rename it to `server` ([bbbc18c4ee](https://github.com/facebook/react-native/commit/bbbc18c4ee9b13a5aeca10edcb29694db3f15769)) -- The blog has moved to [react-native-website](https://github.com/facebook/react-native-website/tree/master/website/blog) ([e16d67340e](https://github.com/facebook/react-native/commit/e16d67340e0ad1724afeee78f9d820177abbd8b6) by [@hramos](https://github.com/hramos)) -- Remove SoLoaderShim, use SoLoader ([fc6dd78935](https://github.com/facebook/react-native/commit/fc6dd78935a41106aa6a44058c1abb7d0ba0fa24) by [@foghina](https://github.com/foghina)) -- Removed broken link for 'Getting Help' in the README ([b3a306a667](https://github.com/facebook/react-native/commit/b3a306a66709a0ab0ff29151a38eaa3f8f845c1f) by [@rickydam](https://github.com/rickydam)) -- Changed to use boost-for-react-native cocoapod, which speeds up `pod install` a ton; this was in 0.53 originally but had to be re-added ([d40db3a715](https://github.com/facebook/react-native/commit/d40db3a715afaf1cde4a5e231e96e46b2808bbef) by [@CFKevinRef](https://github.com/CFKevinRef)) -- Remove fbobjc's RN copy ([af0c863570](https://github.com/facebook/react-native/commit/af0c8635709b8014c68ce88ebb1e9e94ec56768a)) -- Measure time to create **ReactInstanceManager** ([6224ef5301](https://github.com/facebook/react-native/commit/6224ef5301d67266b28c77e5e46816f319122f38) by [@alexeylang](https://github.com/alexeylang)) -- Upgrade create-react-class to v15.6.3 ([74f386633d](https://github.com/facebook/react-native/commit/74f386633d5e123b2ea73b4773d0ee7d83832fb5) by [@bvaughn](https://github.com/bvaughn)) -- Upgrade react-devtools to v3.1.0 ([8235a49a33](https://github.com/facebook/react-native/commit/8235a49a33cc8e84cd4ba1cc15bc09eed6712b4c) by [@bvaughn](https://github.com/bvaughn)) -- Upgrade flow to v0.65.0 ([7aba456b04](https://github.com/facebook/react-native/commit/7aba456b04ff6a4e4721bcf1064f22a8a87f90c7) and [298f3bb69a](https://github.com/facebook/react-native/commit/298f3bb69abecdcd83adb64e043a2974bd52b1ab) by [@avikchaudhuri](https://github.com/avikchaudhuri) and [@mroch](https://github.com/mroch)) -- Upgrade Jest to v22.2.1 ([46f4d3e1bc](https://github.com/facebook/react-native/commit/46f4d3e1bc9340009c53f366ebd98600c485c993) and [24e521c063](https://github.com/facebook/react-native/commit/24e521c063035e470587bb279976a955ff03717a) by [@mjesun](https://github.com/mjesun)) -- Upgrade ESLint to v4.17.0 (plus update related deps) ([bba19e846e](https://github.com/facebook/react-native/commit/bba19e846e377241826475906f642264409a3990) by [@zertosh](https://github.com/zertosh)) -- Upgrade React to v16.3.0-alpha.1 ([03d7b2aa0e](https://github.com/facebook/react-native/commit/03d7b2aa0e7f239c78b6fe3a96c0ddf3de00a58b) and [5e80d95e03](https://github.com/facebook/react-native/commit/5e80d95e034259af8c41b50756a623756cc81a77) by [@grabbou](https://github.com/grabbou) and [@hramos](https://github.com/hramos)) -- Synced React and ReactFabric render ([c7ed03a95c](https://github.com/facebook/react-native/commit/c7ed03a95c8c372c7631c11e0778cf9753afdabc), [13829751b1](https://github.com/facebook/react-native/commit/13829751b11330f8e1400c5c70c59c49ac2f091f), and [d676746f14](https://github.com/facebook/react-native/commit/d676746f14fb6d714d2576871655b13c005480e7) by [@bvaughn](https://github.com/bvaughn)) -- Upgrade metro to v0.26.0 ([9e6f3b8aff](https://github.com/facebook/react-native/commit/9e6f3b8aff7572f5e9008a2641c70846da0817bb), [ce50f25d22](https://github.com/facebook/react-native/commit/ce50f25d22d56f24bdb7d80a3f9a279863d5dc2a), [e9b83e608e](https://github.com/facebook/react-native/commit/e9b83e608e8487ef8fcbfc956a52bfa7ee1d727f), [2fe7483c36](https://github.com/facebook/react-native/commit/2fe7483c36b10146f737f0a84799c2eb01aaba79), [0f96ebd93b](https://github.com/facebook/react-native/commit/0f96ebd93b634ec3fb0e6036a4960bb4af167e7b), [0de470ec19](https://github.com/facebook/react-native/commit/0de470ec19f2b9f3f4f3ab3dd4322c0f0ece2868), [e8893a021f](https://github.com/facebook/react-native/commit/e8893a021f60ffeea27443998b1716e9a1963d64), and [b1d8af48ae](https://github.com/facebook/react-native/commit/b1d8af48ae251f57bdcd55f89d8fc62aa9eca872) by [@rafeca](https://github.com/rafeca) and [@grabbou](https://github.com/grabbou)) -- Add Context to Redbox report api ([e3c27f585a](https://github.com/facebook/react-native/commit/e3c27f585aaeb685e86250f45fc790c06932af0d) by [@ayc1](https://github.com/ayc1)) -- GitHub bot commands have been disabled in the short term ([b973fe45bd](https://github.com/facebook/react-native/commit/b973fe45bdbc84e12fd0a3afbd6fdd327bcb9d02) by [@hramos](https://github.com/hramos)) -- Various CI configuration changes ([17bd6c8e84](https://github.com/facebook/react-native/commit/17bd6c8e84d9f5d42767a6f42a9a2cf812aa778b), [51b6749c07](https://github.com/facebook/react-native/commit/51b6749c075bb87a340096a0dc06cd6cf9a19907), [a2f3ba864e](https://github.com/facebook/react-native/commit/a2f3ba864ed17ca32e71f15724a8ebf2b1e640c1), [2ef9b7f2da](https://github.com/facebook/react-native/commit/2ef9b7f2da5b875ac1a4fee0ade3cc16ad96772a), [40b17926bb](https://github.com/facebook/react-native/commit/40b17926bb2c724f1580b2eb0c30a37f5d48030a), [613afbab7f](https://github.com/facebook/react-native/commit/613afbab7f30748ba767b055f23d0d294562805f), [da8bec9f8b](https://github.com/facebook/react-native/commit/da8bec9f8b62b46e58e0e98413aa915ece05b71b), [fa11faecb6](https://github.com/facebook/react-native/commit/fa11faecb69f385a5c0aba60f4039612e46b87f3), [f50af7f8a4](https://github.com/facebook/react-native/commit/f50af7f8a48e9cae2cb512962870d5692da5aaf2), [9227ba73ab](https://github.com/facebook/react-native/commit/9227ba73ab8c2b8b8ce4086b5f4667a8a55cdcfa), [365a4d4b43](https://github.com/facebook/react-native/commit/365a4d4b4315d4ca7a0e1236012b763d7e5bb1fd), [b58d848d9c](https://github.com/facebook/react-native/commit/b58d848d9cf78d755fe38392e26826ed481175cd), [c8e98bbaf5](https://github.com/facebook/react-native/commit/c8e98bbaf58b7a7f866e831982355b78dfa43b9d), [f5975a97ad](https://github.com/facebook/react-native/commit/f5975a97adcf3ae9c2988d7e267947a84ab60cee), and [605a6e4031](https://github.com/facebook/react-native/commit/605a6e4031fc9b63edbb9120ffacf7b045dc9db8) by [@hramos](https://github.com/hramos), [@grabbou](https://github.com/grabbou), and [@dryganets](https://github.com/dryganets)) -- Restore copyright header ([4f883bd0bc](https://github.com/facebook/react-native/commit/4f883bd0bcdc015e2cf70bcc29bbe05fd5b8a40b) by [@hramos](https://github.com/hramos)) -- Trim docs that are already present in the open source docs site ([28d60b68ad](https://github.com/facebook/react-native/commit/28d60b68ad7bc5b7ebda6b720981feacd3bde337) by [@hramos](https://github.com/hramos)) -- Fix obsolete instructions about editing docs ([2f46712074](https://github.com/facebook/react-native/commit/2f46712074d187f5456723499e6885bf0941cfbc) by [@ExplodingCabbage](https://github.com/ExplodingCabbage)) -- Fix links to beginner friendly issues ([c355a34de1](https://github.com/facebook/react-native/commit/c355a34de107befd26bc495272b91c11957f3fd0) by [@hotchemi](https://github.com/hotchemi)) -- Typos in comments and log messages ([d2c569795c](https://github.com/facebook/react-native/commit/d2c569795ca07b6b7c0227cfc6d0b3bf5dd23b99) by [@ss18](https://github.com/ss18)) -- Don't run the Danger CI tool through Flow ([1ea3065feb](https://github.com/facebook/react-native/commit/1ea3065feb265bef738bd53e835567d595266725) by [@hramos](https://github.com/hramos)) -- Namespace custom ESLint rules through eslint-plugin-lint ([488b6825c5](https://github.com/facebook/react-native/commit/488b6825c5fb4ec68a8b7315559c4d34e012de12) by [@zertosh](https://github.com/zertosh)) - -- ... and now we're at 0.54 🎉 ([67e67ec83c](https://github.com/facebook/react-native/commit/67e67ec83ce83d4a1a38bc29dd52bf5c28723752), [21dd3dd296](https://github.com/facebook/react-native/commit/21dd3dd296989f4de2d4e9b1ba0df88ea2d32413), [49e35bd939](https://github.com/facebook/react-native/commit/49e35bd9399716a2734e824bab14faf1683cdfdd), [829f675b8b](https://github.com/facebook/react-native/commit/829f675b8b4abae696151e404552af515a2da1ce), and [294d95a236](https://github.com/facebook/react-native/commit/294d95a23687b2e3155fe4ae1bc5e4a649e6b014) by [@grabbou](https://github.com/grabbou) and [@hramos](https://github.com/hramos)) - -## v0.53.0 - -Welcome to the January 2018 release of React Native. The CLI now supports `--port` for both platforms, a few components were made to support consistent props across both platforms, and various fixes were made. There was a lot of under-the-cover work done with more test improvements and dependency updates. 118 commits were made by 43 contributors 🎉. - -### Added - -- ✨ **Keyboard** events now include `easing` and `duration` ([4d33080f0f](https://github.com/facebook/react-native/commit/4d33080f0fa7b2eb7b0e9ff7bbd50c222f461786) by [@sahrens](https://github.com/sahrens)) - -#### iOS exclusive additions - -- `react-native run-ios` now supports the `--port` argument for metro ([33d710e8c5](https://github.com/facebook/react-native/commit/33d710e8c58ef1dc69816a59ac1cf390894e7cb9)) - -#### Android exclusive additions - -- On Android, **ScrollView** now takes `snapToInterval` like iOS ([ddd65f1ba9](https://github.com/facebook/react-native/commit/ddd65f1ba9cca945313d116c1dcf75f3a0556099) and [b2848a54b0](https://github.com/facebook/react-native/commit/b2848a54b05470b3e258c935dd33b8c11a31b3c3) ) -- On Android, **TextInput** now takes `onKeyPress` like iOS ([c9ff0bc212](https://github.com/facebook/react-native/commit/c9ff0bc212b680232f7379fba7b9332927075c3c) by [@joshyhargreaves](https://github.com/joshyhargreaves)) - -### Changed - -- ⬆️ Metro to v0.24.2 ([2e008bc464](https://github.com/facebook/react-native/commit/2e008bc464f94df013794d3da6e9d4e4722151a0) and [0b5e8b4852](https://github.com/facebook/react-native/commit/0b5e8b485229957086d416c307f07c75a4139ffa) by [@rafeca](https://github.com/rafeca)) -- ⬆️ Flow to v0.63 ([6b95c4fb14](https://github.com/facebook/react-native/commit/6b95c4fb142a7015b2afca50cc19eec0b8913d8c) by [@gabelevi](https://github.com/gabelevi)) -- ⬆️ Danger to v2.0 ([b750e3b21b](https://github.com/facebook/react-native/commit/b750e3b21bc5c135773e8de53c5663bdf6266951) by [@hramos](https://github.com/hramos)) -- ⬆️ Jest to v22.0.0 ([4803419dc8](https://github.com/facebook/react-native/commit/4803419dc8406b6892f20cdfb448a01c16ad4338) by [@mjesun](https://github.com/mjesun)) -- 💄 Bundler is now called Metro Bundler in the terminal ([654d7595fe](https://github.com/facebook/react-native/commit/654d7595fe5766667c015307129e75d8986482e1) by [@edcs](https://github.com/edcs)) -- 📝 Update getting started url on Android CLI ([6661633390](https://github.com/facebook/react-native/commit/6661633390276f707faa60509b2805a83929e747)) -- 🐳 Dockerfile uses newest Android SDK, Buck, and new Docker tags have been pushed ([4fbfbe6bb0](https://github.com/facebook/react-native/commit/4fbfbe6bb0e0eaaf12ec713888bf2c6a347f0f96) and [c547f783c4](https://github.com/facebook/react-native/commit/c547f783c440019a4a87ba55b668b3af5ff8fc91) by [@hramos](https://github.com/hramos)) -- 📝 Update repo docs to use HTTPS ([33a2e533b7](https://github.com/facebook/react-native/commit/33a2e533b76d35c1b9fb32e926f7c2c27cb616e9) by [@him2him2](https://github.com/him2him2)) -- 🎨 Make **ScrollResponder** follow code style ([45e6fcdba0](https://github.com/facebook/react-native/commit/45e6fcdba089900555faa63fe8e37b4bd4a7700a) by [@TheSavior](https://github.com/TheSavior)) -- **VirtualizedList** now requires a windowSize greater than 0 ([3559e42c55](https://github.com/facebook/react-native/commit/3559e42c55366bacd9bb5178ecab64f95e9a8ea7)) -- react-devtools works with emulator and real devices now without needing to tweak the devServer value ([fa574c6092](https://github.com/facebook/react-native/commit/fa574c60920588e29d7b642e547e240ac8655e66) by [@jhen0409](https://github.com/jhen0409)) -- 📝 Clarify use of Flow props types in react-native-cli's template project ([9b147a53d1](https://github.com/facebook/react-native/commit/9b147a53d1ab1e14d7ef5b436f1e140a28a5d6a3) by [@hramos](https://github.com/hramos)) -- 📝 Add docs for `isInspectable` ([59c7967627](https://github.com/facebook/react-native/commit/59c79676277abaaaf61388309429c77164c3de4b) by [@bnham](https://github.com/bnham)) -- ✅ More Flow improvements (**Text**, **SectionList**, and others) ([f71f4e7906](https://github.com/facebook/react-native/commit/f71f4e7906648766e1a5b630abbad8935daef955), [632f1202ab](https://github.com/facebook/react-native/commit/632f1202ab3f9dd300a53f096bc15325e0d8f6c1), and [a8391bde7d](https://github.com/facebook/react-native/commit/a8391bde7d757d01521a6d12170fb9090c17a6a0) by [@yungsters](https://github.com/yungsters), [@samwgoldman](https://github.com/samwgoldman), and others) -- Various code cleanup to satisfy linting errors and standards ([b0319f3293](https://github.com/facebook/react-native/commit/b0319f3293b553c105b813dd12bff7d55940e60b), [dd4611721d](https://github.com/facebook/react-native/commit/dd4611721d0ad49ceaf4514df1b47cf2753b9ae6), and [7f58189605](https://github.com/facebook/react-native/commit/7f5818960596a2a18b7d427fd23d46396c05bee5) by [@ayc1](https://github.com/ayc1), [@grabbou](https://github.com/grabbou), and [@ide](https://github.com/ide)) - -#### iOS exclusive changes - -- 🔥⚡️ iOS UI Manager cleanup and optimizations ([0ec1017660](https://github.com/facebook/react-native/commit/0ec1017660602d6b3ae84b4d7a444cbd49ba0d53), [0ae4c47daa](https://github.com/facebook/react-native/commit/0ae4c47daa6280d2931d8bbf89612b2f1cb106d4), [2679f3efb6](https://github.com/facebook/react-native/commit/2679f3efb69bc7b0db1840b4ea59ebe791a54dd2),and [d9e5b313bb](https://github.com/facebook/react-native/commit/d9e5b313bb63a1ec0d402a96539c6df29bc72c42) by [@shergin](https://github.com/shergin)) -- If the inspector tries to handle a wrapped event but there is no connection, log a warning rather than a Redbox ([30da2622e2](https://github.com/facebook/react-native/commit/30da2622e222c338421508ce6e5663155fc874ef) by [@bnham](https://github.com/bnham)) -- Various under-the-covers changes around the bridge, RCTShadowView, RCTSurface, and a few others ([c3139d798a](https://github.com/facebook/react-native/commit/c3139d798af633bb81bf0da6df05b3c0beb0ced4), [2789ba016b](https://github.com/facebook/react-native/commit/2789ba016bfddace1407473769e933795333cfab), [b8e60a3ca3](https://github.com/facebook/react-native/commit/b8e60a3ca3314d79e9c38ee8c7995df81a27624c), [099b28006b](https://github.com/facebook/react-native/commit/099b28006b59abb11eae1f27424566b280860b0d), [b263560c73](https://github.com/facebook/react-native/commit/b263560c73af5559fdc3bba411f16c588abbffef), [19a9c5e41d](https://github.com/facebook/react-native/commit/19a9c5e41da0aa6ee28a54772edcb92daa498561), [d3b41e0da3](https://github.com/facebook/react-native/commit/d3b41e0da37c08ab0637d9f70d612e50b6f5e63c), [b2a251948f](https://github.com/facebook/react-native/commit/b2a251948f3309d2b1d0d533fb2fa74d2f8a10b8), [870bc4807a](https://github.com/facebook/react-native/commit/870bc4807a8c3f90498cf4c2ed3c030cb7b43ef9), [176a578238](https://github.com/facebook/react-native/commit/176a578238566ad857c0911e127669f1ee82107d), [c491b22233](https://github.com/facebook/react-native/commit/c491b2223313676bd4900de7a8c70a10051fa9f0), [c75612219e](https://github.com/facebook/react-native/commit/c75612219ef0c99d1ddca0aadf354f20de27608c), and[c01a171ed8](https://github.com/facebook/react-native/commit/c01a171ed881fb91a972ed475011f85697a29341) by [@shergin](https://github.com/shergin)) -- Changed to use _boost-for-react-native_ cocoapod, which speeds up `pod install` a ton ([d40db3a715](https://github.com/facebook/react-native/commit/d40db3a715afaf1cde4a5e231e96e46b2808bbef) by [@CFKevinRef](https://github.com/CFKevinRef)) - -#### Android exclusive changes - -- Include scroll momentum info when there are scroll events from Android ([c49d249fd7](https://github.com/facebook/react-native/commit/c49d249fd7c274f02e6018892992bcd273d6a465) by [@wwalser](https://github.com/wwalser)) -- Yoga's mkfile for Android now uses wildcard instead of manual file addition ([d89901fa60](https://github.com/facebook/react-native/commit/d89901fa6002802dc9d744bfe3e5e712d6a411a1) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) - -### Removed - -- **TextInput** no longer has the `autoGrow` prop, since this is platform-default behavior now ([dabb78b127](https://github.com/facebook/react-native/commit/dabb78b1278d922e18b2a84059460689da12578b) by [@shergin](https://github.com/shergin)) - -#### iOS exclusive removals - -- Updates to the bridge in order to enable future rendering optimizations ([d2dc451407](https://github.com/facebook/react-native/commit/d2dc4514077ae868f85d45ccdcc7c69df7b7648b) by [@shergin](https://github.com/shergin)) - -### Fixed - -- Do not set `minify=true` when calculating the list of dependencies for the CLI ([4a1bb8fe8d](https://github.com/facebook/react-native/commit/4a1bb8fe8dfd36ea207c0683d683bb8b22a282a5) by [@rafeca](https://github.com/rafeca)) -- 👷 Update CODEOWNERS now that the docs are in a separate repository ([85ff264445](https://github.com/facebook/react-native/commit/85ff264445aa4b9cf0b91aaca5764bb56caba997) by [@hramos](https://github.com/hramos)) -- Fixed a broken link in react-native-git-upgrade's readme ([bbedf2da9a](https://github.com/facebook/react-native/commit/bbedf2da9a3a091eeb687d43029f7d2450cf2612) by [@Taym95](https://github.com/Taym95)) -- 🤡 Do not use Node 8.x specific Stream.final for FS mocks ([4216cdef13](https://github.com/facebook/react-native/commit/4216cdef13c9ed47b9c746b39a0ddfdaf846d495) by [@hramos](https://github.com/hramos)) -- Fix virtualized cell keys for list headers and footers ([a010a0cebd](https://github.com/facebook/react-native/commit/a010a0cebd4afc0d88336c2c265a5d9dbb19918f)) -- Fix warnings of casting and null pointer handling in Yoga ([a8d4666651](https://github.com/facebook/react-native/commit/a8d46666518944a178e85c179da8047234c2d8fb) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) -- Fix broken buck failures on master ([4e767013ed](https://github.com/facebook/react-native/commit/4e767013ed73fb89f69f2e59626d6dcf3bb77684) by [@hramos](https://github.com/hramos)) -- **RefreshControl** appears correctly when expected on initial render of a **FlatList** again ([ed5872e2cc](https://github.com/facebook/react-native/commit/ed5872e2cca955ee407e87e37e13c7fed182199a) by [@vonovak](https://github.com/vonovak)) -- Fixed JS debugger CORS issue ([29f8354c19](https://github.com/facebook/react-native/commit/29f8354c1946a6325e9020b9ef5ee4ccdf0fa51f) by [@njbmartin](https://github.com/njbmartin)) - -#### Android exclusive fixes - -- Fix position of dev loading view on Android API < 20 ([7ff6657985](https://github.com/facebook/react-native/commit/7ff6657985a09bd2572615d16403fba3af709859) by [@kmagiera](https://github.com/kmagiera)) -- Fix Modal not disappearing when navigating from inside a Modal to another activity ([e5c2a66897](https://github.com/facebook/react-native/commit/e5c2a66897b9c562c549e63adcf70783ea34c418) - -#### iOS exclusive fixes - -- Fix regression introduced where layout wouldn't occur in some situations ([46be5bf71c](https://github.com/facebook/react-native/commit/46be5bf71c78d33cda5cb496c475dcfb8e229346) by [@shergin](https://github.com/shergin)) -- Fixed double initial prop applying for newly created views ([0ec1017660](https://github.com/facebook/react-native/commit/0ec1017660602d6b3ae84b4d7a444cbd49ba0d53) by [@shergin](https://github.com/shergin)) -- tvOS build now works again ([3bd89867d6](https://github.com/facebook/react-native/commit/3bd89867d6f23547f07b9b3a569d5a62971004f6) by [@dlowder-salesforce](https://github.com/dlowder-salesforce)) - -### Other - -Below is a list of the remaining, low-level changes that made it into this release of React Native. - -- Remove "prepareReact" call from the bridge ([80f9e1f7de](https://github.com/facebook/react-native/commit/80f9e1f7de407ea417cecb04b3ba20b05696b478) and [56a42e57d0](https://github.com/facebook/react-native/commit/56a42e57d05ff609e8fce35dcb5e9db7938db801) by [@fromcelticpark](https://github.com/fromcelticpark)) -- Add explicit componentControllerClass to CKComponent for RCTSurface ([ab972708a8](https://github.com/facebook/react-native/commit/ab972708a8dcc9b37c19843f2fe134928a7c7a3f)) -- Changes to RCTShadowView to increase RCTSurface performance ([f96f9c5fd6](https://github.com/facebook/react-native/commit/f96f9c5fd692000f561e87cba68642ef7daf43e7) by [@shergin](https://github.com/shergin)) -- Designated methods to control dirty propagation ([af226ef949](https://github.com/facebook/react-native/commit/af226ef949f3a21ef68a6e6b9fbd4cc06fa05152) by [@shergin](https://github.com/shergin)) -- Add missing tvOS header ([49cbca7464](https://github.com/facebook/react-native/commit/49cbca7464e27c34105122459ae29cc3b1247513) by [@grabbou](https://github.com/grabbou)) -- On Android, seperate logic to initialize JS from starting the app ([4996b9aeb4](https://github.com/facebook/react-native/commit/4996b9aeb4127892b7579b45927dec14833b8b4d) by [@axe-fb](https://github.com/axe-fb)) -- ♻️ JS linting was cleaned up: removed unused libs, strengthened the rules, removed unneeded rules, prevent disabled tests, and more ([2815ada238](https://github.com/facebook/react-native/commit/2815ada23872fc28dc8dd5a9833962cb73f452eb), [183c316f4c](https://github.com/facebook/react-native/commit/183c316f4c869804b88cffe40614c84ac0a472d0), [9c67e749d8](https://github.com/facebook/react-native/commit/9c67e749d8f63cf14ece201ec19eee4676f96a85), [79902f99b8](https://github.com/facebook/react-native/commit/79902f99b81f538042b38a857182c2e5adbfd006), [9a36872f0c](https://github.com/facebook/react-native/commit/9a36872f0c7ba03a92fabf65e4d659d6861ea786), [67a3c42d1a](https://github.com/facebook/react-native/commit/67a3c42d1a29b6fa1375f7445d1c9b4429939bae), [b826596700](https://github.com/facebook/react-native/commit/b82659670041d0e472f68c0a14b3ef5b962db09b), [a1a0a69546](https://github.com/facebook/react-native/commit/a1a0a6954635141ce6c167816b67674aa5c31062), and [11a495cb32](https://github.com/facebook/react-native/commit/11a495cb3235ebbc2ad890e92ec612fd5316bffb) by [@TheSavior](https://github.com/TheSavior)) -- 👷 Separate JS lint and flow checks from tests ([5ea5683d01](https://github.com/facebook/react-native/commit/5ea5683d01487b49c814fca6e11a818b9a777239) by [@hramos](https://github.com/hramos)) -- 👷 Fix Buck in build config to enable CI ([796122d8f3](https://github.com/facebook/react-native/commit/796122d8f3b825c0bf0c138c662f3477f8bab123), [7c3a61f3b6](https://github.com/facebook/react-native/commit/7c3a61f3b610e219fd798eccd330deb9a2471253), [82b123e744](https://github.com/facebook/react-native/commit/82b123e744b87cc59c96b4e82af9ed03981b4f42) by [@grabbou](https://github.com/grabbou)) -- ♻️ Various refactoring within the YGNode implementation ([28968e2c0b](https://github.com/facebook/react-native/commit/28968e2c0ba23db9af12b47681f165d29d0f132d), [0a9e652bdd](https://github.com/facebook/react-native/commit/0a9e652bdd031d53d712e2e9610fb608bfa54ff1), [6627d7723c](https://github.com/facebook/react-native/commit/6627d7723c2df244ccc8a462bd98499cc11da2e2), and [d85da86dc7](https://github.com/facebook/react-native/commit/d85da86dc7c7833e71099c6a621547bc3cec8d4f), [a163f70f87](https://github.com/facebook/react-native/commit/a163f70f875dff4428eebd989bfaf28dda6551bf) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) -- Fix ReactLegacy and delete RCTViewControllerProtocol ([a0ff8c7706](https://github.com/facebook/react-native/commit/a0ff8c7706fc37bdce78c9ec51da320f78d16a24) by [@javache](https://github.com/javache)) -- Define internal FB macro for OSS builds; remove some unused definitions ([077c3ab349](https://github.com/facebook/react-native/commit/077c3ab34952f4b442abdd7a47ab54ca4bd0ba2e) and ([a6a66c5b39](https://github.com/facebook/react-native/commit/a6a66c5b3943443e4016f32407e4a4f8d707e387) by [@ttsugriy](https://github.com/ttsugriy)) -- RNTester: Relax Bridge Release Check ([e3c6f38773](https://github.com/facebook/react-native/commit/e3c6f38773d0b578794726033d4fabbfa48d1c7b) by [@yungsters](https://github.com/yungsters)) -- Remove embeddedBundleURL from the asset resolver ([489b98bf10](https://github.com/facebook/react-native/commit/489b98bf1006818ba985e93478a088c0e1e1aae7)) -- Do not set FB_ASSERTION_ENABLED ([4cdbb77c33](https://github.com/facebook/react-native/commit/4cdbb77c3363e120877ff66f39cdcf51d668df7d) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) -- JSBigString to MAP_PRIVATE not MAP_SHARED ([f9f40cd3e4](https://github.com/facebook/react-native/commit/f9f40cd3e486314cd75bda8722147f2f0f5b8fe1)) -- Fixed black ARTSurfaceView ([5c8481e836](https://github.com/facebook/react-native/commit/5c8481e83646b9cae482a803c878fb007f370035) by [@shergin](https://github.com/shergin)) -- Kill orphaned marker end in JSCExecutor ([6ad1f0957a](https://github.com/facebook/react-native/commit/6ad1f0957a020cb57b177ab015c17aa883e1f0ad) by [@michalgr](https://github.com/michalgr)) -- Make YGNode as c++ struct with properties exposed through accessors ([f1055bcac8](https://github.com/facebook/react-native/commit/f1055bcac8b580c40f9646687e7a950fb6864c74) by [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) -- 🔖 ...and now we're at 0.53.0-rc.0 🎁 ([0b996577e3](https://github.com/facebook/react-native/commit/0b996577e321d439aa6ede4c7400ea76efb7816a) by [@grabbou](https://github.com/grabbou)) - -## v0.52.0 - -> This changelog has been prepared by Ryan Turner (@turnrye) - thank you for -> your time and making such a detailed changelog 🔥🔥 - -This release had a lot of work around the bundler and packager, a ton of -bugfixes, and updates to many of React Native's dependencies. Lots of -under-the-hood work was done as well to improve the layout engine. Happy new -year! - -> If you would like to help us with the next release changelog, please contact -> @grabbou - -### Added - -- Prettier has a config and an npm script; try it out with `npm run prettier` - ([164591218f](https://github.com/facebook/react-native/commit/164591218f5fab7d386e057e0d51b9c1fe30b0a9) by - [@janicduplessis](https://github.com/janicduplessis)) -- **Debug JS in Nuclide** is now an option in the dev menu 🐜 - ([7c7108a1e8](https://github.com/facebook/react-native/commit/7c7108a1e8e9354d8aeb2f0ff712561d8aa19408) and - [de424cc291](https://github.com/facebook/react-native/commit/de424cc291523a8f4e3d33059b725d5b85f31611)) -- Introducing **PlatformOS** – it looks a lot like **Platform**, but with a - simplified API - ([5ee27ff755](https://github.com/facebook/react-native/commit/5ee27ff7552a5707a6e6bdb3f23e7378f978a2f7) by - [@brishin](https://github.com/brishin)) -- New experimental _RCTSurface_: measure and layout a UI in a thread-safe and - synchronous manner - ([be6976d6fa](https://github.com/facebook/react-native/commit/be6976d6faa333311405bd6184300bbd8da6cbca), - [7df58e23a3](https://github.com/facebook/react-native/commit/7df58e23a3a265b0df0edc753cc79a153fec90d8), - [e75bd87a76](https://github.com/facebook/react-native/commit/e75bd87a76726a9b075061ef76156705b3c1e872), - [aa83b5a0ca](https://github.com/facebook/react-native/commit/aa83b5a0ca30736b2800833bcc6149dcbe8436fa), - [081f7d14ad](https://github.com/facebook/react-native/commit/081f7d14aded077a7627404e5e2d48163a5707ad), - [da17b237e1](https://github.com/facebook/react-native/commit/da17b237e15e20adf20d6b917349d6389efb17fd), - [e9e0cd7ab8](https://github.com/facebook/react-native/commit/e9e0cd7ab86c98bcd3201e306e96532685d8de1d), - [43b2509320](https://github.com/facebook/react-native/commit/43b25093202472c5af07d4f393d831e4d1484b07), - [ba6075120a](https://github.com/facebook/react-native/commit/ba6075120af9c0086b449aafa7420913fa58f746), - [d71d28f094](https://github.com/facebook/react-native/commit/d71d28f09495a1e2802db169e2d0cd1ec5bd5973), - [4d37cf0fbc](https://github.com/facebook/react-native/commit/4d37cf0fbcc529ad75eb4a04a185036a887e42c2), and - [d021dd25da](https://github.com/facebook/react-native/commit/d021dd25da92d84c62c9a77049bb798e3b891447) by - [@maicki](https://github.com/maicki) and - [@shergin](https://github.com/shergin)) -- Experimental **SwipeableRow**'s datasource now has a `getLastRowID` method - ([d79e245d19](https://github.com/facebook/react-native/commit/d79e245d19f7f246322bc657b407198b15cb1b98)) -- [React Native monthly - #5](https://reactnative.dev/blog/2017/11/06/react-native-monthly-5.html) - was added ([3c5a55ddc2](https://github.com/facebook/react-native/commit/3c5a55ddc21197cfa013dc6222e398138759b5d3) - by [@tenodi](https://github.com/tenodi)) - -#### iOS Specific - -- **DatePickerIOS** now takes **locale** 🌍 - ([fd9c3618fc](https://github.com/facebook/react-native/commit/fd9c3618fcd3dc80f9abf3da779627704c7350e4) by - [@RobertPaul01](https://github.com/RobertPaul01)) -- **CameraRoll** can now **deletePhotos** 📸 - ([554e873f58](https://github.com/facebook/react-native/commit/554e873f585ea05ce1e9fe4ff71173c47b3c259c) by - [@fxfactorial](https://github.com/fxfactorial)) -- There's now an API to specify a different directory for iOS image assets - ([8f9b291224](https://github.com/facebook/react-native/commit/8f9b291224d1ca57a5f90200ec4687abb4706f4b)) -- Support for [custom accessibility - actions](https://developer.apple.com/documentation/uikit/uiaccessibilitycustomaction) - on iOS ([36ad813899](https://github.com/facebook/react-native/commit/36ad8138997c195b8728906ceb51bd31338b6a24) by - [@ericdavmsft](https://github.com/ericdavmsft)) - -### Deprecated - -- Ignore YellowBox warnings with `YellowBox.ignoreWarnings([...])` rather than - `console.ignoredYellowBox = [...]` - ([26038f50bb](https://github.com/facebook/react-native/commit/26038f50bb003eec3770e2b66d428fbb739f1ce2) by - [@wli](https://github.com/wli)) - -### Changed - -- Metro-bundler is now metro, and it's v0.24.1; there were some performance - increases at the cost of a few breaking changes; improved tests of the bundler - too ([0bbd9f042a](https://github.com/facebook/react-native/commit/0bbd9f042a8ad7c7be094bd7636ca767c6f7b231), - [a2fd3fcef8](https://github.com/facebook/react-native/commit/a2fd3fcef84e916b36ef7753dff69b7c1b307890), - [503b4521a6](https://github.com/facebook/react-native/commit/503b4521a6ce6bb2282631df616440fa71416d25), - [654fed46f4](https://github.com/facebook/react-native/commit/654fed46f49b5002096ff55c2e8523af48b22c24), - [0091496891](https://github.com/facebook/react-native/commit/009149689119e180415f8138b2827366768fc1d3), - [aba148f733](https://github.com/facebook/react-native/commit/aba148f733e85a88d4be07b3b8ca37c43cf6a51e), - [3d5dc872a4](https://github.com/facebook/react-native/commit/3d5dc872a4eefa1557554b3b338227959d166370), - [48019a0c2a](https://github.com/facebook/react-native/commit/48019a0c2a9a45d51a4faab1d5bef52949f4b5c5), - [ecec4319c4](https://github.com/facebook/react-native/commit/ecec4319c4fda9bebc90216d5340442b2a5725df), - [f4d627c8fa](https://github.com/facebook/react-native/commit/f4d627c8faeb034eac8053fd253f17e42b85f2f2), - [f871d25eb4](https://github.com/facebook/react-native/commit/f871d25eb48dca224bb3796aa9cb5d714292662f), - [a7b231a327](https://github.com/facebook/react-native/commit/a7b231a3278e4fc2d7e4269ce106f22712f2e5a8), - [830b431453](https://github.com/facebook/react-native/commit/830b43145381e6e322569450affddba73f7dc2d1), - [29dafa1a86](https://github.com/facebook/react-native/commit/29dafa1a8644f7a537499074df334bab8da4ad00), - [7a5d5a4035](https://github.com/facebook/react-native/commit/7a5d5a40357bedfb24a01ff1160481656fda9554), - [4cd685a1e0](https://github.com/facebook/react-native/commit/4cd685a1e0a2ae07df02702dbf4702e407773df5), - [d326c86051](https://github.com/facebook/react-native/commit/d326c860519c5165c6e86fb4f3ce378ed055157c), - [231c7a0304](https://github.com/facebook/react-native/commit/231c7a03043b9fb3c4bf81251ad099bab0ba05c2), - [7d969a05de](https://github.com/facebook/react-native/commit/7d969a05de6a45543bc31a3b982828865bc57cdb), - [ae517307e7](https://github.com/facebook/react-native/commit/ae517307e76d977f813e5b880f3b7f42a20f461d), - [f587f8d51d](https://github.com/facebook/react-native/commit/f587f8d51dc57e6b9eb66edfbe58ee520a6cc568), - [fbf0aed3ac](https://github.com/facebook/react-native/commit/fbf0aed3acc056b5fd069af75fcae14246439a48), - [e9393f694d](https://github.com/facebook/react-native/commit/e9393f694d8f0d0190a3576fd65a65f747f8cce2), and - [968c88d141](https://github.com/facebook/react-native/commit/968c88d1410eac5b793345bacce6052f518fda8f) by - [@cpojer](https://github.com/cpojer), [@hramos](https://github.com/hramos), - [@jeanlauliac](https://github.com/jeanlauliac), and - [@rafeca](https://github.com/rafeca) - ) -- React is now v16.2.0, and it took react-test-renderer along with it; [now with - more - fragments!](https://react.dev/blog/2017/11/28/react-v16.2.0-fragment-support.html) - 🎉 ([c7f37074ac](https://github.com/facebook/react-native/commit/c7f37074ac89f7e568ca26a6bad3bdb02812c39f) and - [cd938d731c](https://github.com/facebook/react-native/commit/cd938d731c7531a683c050cd829a543d145e3dc1) by - [@bvaughn](https://github.com/bvaughn)) -- Jest is now v21.3.0-beta.13 - ([16bbd908e7](https://github.com/facebook/react-native/commit/16bbd908e72577e7d109397916323a0eeffce8d4) and - [ec2ea58e57](https://github.com/facebook/react-native/commit/ec2ea58e57872bfa077d9c9a5e1e8b253c6b37b3) by - [@mjesun](https://github.com/mjesun)) -- Flow is now v0.61.0, and there were a ton of Flow fixes/coverage improvements - made ([914ae93336](https://github.com/facebook/react-native/commit/914ae9333678df4888e3c72898991c8430625cce), - [eb0d6470e5](https://github.com/facebook/react-native/commit/eb0d6470e54663538610a70ab0bae9847eb33673), - [c8e72bb8b8](https://github.com/facebook/react-native/commit/c8e72bb8b8317bcdcb4fe2ff85978c7db70f4461), - [2d4bedba0f](https://github.com/facebook/react-native/commit/2d4bedba0f6a8f2cfe597a1044822eb635d5e243), - [e0202e459f](https://github.com/facebook/react-native/commit/e0202e459fd0181db551d0025ef562d7998186b0), - [2be3ae1ff2](https://github.com/facebook/react-native/commit/2be3ae1ff2441c0ee3f2b9255c23dc49ada852fe), - [22a1419900](https://github.com/facebook/react-native/commit/22a14199000ea994f24f6fe387ea26647af3c128), - [6ae0b344e5](https://github.com/facebook/react-native/commit/6ae0b344e5c221657287d1fc1511be520a6f6e58), - [76a2ca4c9c](https://github.com/facebook/react-native/commit/76a2ca4c9c09c9bdf922154c28040138a44ae672), - [3259353fce](https://github.com/facebook/react-native/commit/3259353fcec0dd9ea66de750a694c226f99f483d), - [e6c1fb7212](https://github.com/facebook/react-native/commit/e6c1fb72128fb13436028c2df9cdccf6ccfccb67), - [61d046be3c](https://github.com/facebook/react-native/commit/61d046be3c9b00f6a4d4f492d558a961a6d4210f), - [820cfa1f3b](https://github.com/facebook/react-native/commit/820cfa1f3b79406e47cb873773cadafefe0effb1), - [240039c6f2](https://github.com/facebook/react-native/commit/240039c6f2d8db700ebc15404b0acc2a49068249), - [343c5a97a0](https://github.com/facebook/react-native/commit/343c5a97a013669745cf3938728539001d3076e6), - [5f8d8e90c2](https://github.com/facebook/react-native/commit/5f8d8e90c2c43127b8a5d2fc5d18f16185c7a67e), and - [da047966e4](https://github.com/facebook/react-native/commit/da047966e4c2064a48e02ff74830c99808d8194b) by - [@Ashoat](https://github.com/Ashoat), - [@calebmer](https://github.com/calebmer), - [@cdlewis](https://github.com/cdlewis), - [@deecewan](https://github.com/deecewan), - [@grabbou](https://github.com/grabbou), - [@jamesisaac](https://github.com/jamesisaac), - [@mroch](https://github.com/mroch), [@nmn](https://github.com/nmn), - [@nmote](https://github.com/nmote), [@sahrens](https://github.com/sahrens), - [@samwgoldman](https://github.com/samwgoldman), - [@TheSavior](https://github.com/TheSavior), and others) -- react-devtools-core is now v3.0.0 - ([a7d46ea970](https://github.com/facebook/react-native/commit/a7d46ea97012bdcc644e3397bbf60bd3cb37e9eb) by - [@rsnara](https://github.com/rsnara)) -- Split out docs to [their own - repo](https://github.com/facebook/react-native-website/tree/master/docs) (and - a few formatting fixes along the journey) 👋 - ([2d86618e7e](https://github.com/facebook/react-native/commit/2d86618e7ef477cdfc2ed510c7bc05d41dbfe972), - [64d80b13db](https://github.com/facebook/react-native/commit/64d80b13db3dd28bb5d93cbedf511ae8f91e2127), - [3362da421c](https://github.com/facebook/react-native/commit/3362da421ce919fc6f4f1bda29b59e2e3bfe02de), - [75123c614b](https://github.com/facebook/react-native/commit/75123c614bb5a61c383cdc247230b3a76c76e14d), and - [79e24ede40](https://github.com/facebook/react-native/commit/79e24ede40b2508aaa77b8ff3876d3dbf4cfe6d8) by - [@hramos](https://github.com/hramos)). -- **TouchableHighlight** now has a default delayPressOut value of 100; it was - also refactored a bit for style - ([9a31fa5fd6](https://github.com/facebook/react-native/commit/9a31fa5fd62fa101b2a76c69b56248d7f5ba9876) by - [@sahrens](https://github.com/sahrens)) -- When in a dev build, more robustly validate arguments for native methods - ([ea2e2c54cb](https://github.com/facebook/react-native/commit/ea2e2c54cb4d1a99b41aaa98eaf51696d34770dd) by - [@mhorowitz](https://github.com/mhorowitz)) -- On integration tests, report _all_ errors - ([3bcb912786](https://github.com/facebook/react-native/commit/3bcb9127866ef60b3697553e98a3ae279d02290a) by - [@sahrens](https://github.com/sahrens)) -- Yoga has less technical debt, thanks to replacing _YGNodeList_ with vectors - ([b08a912f11](https://github.com/facebook/react-native/commit/b08a912f11c729f3fe76700c6614f9e6165ae1a1) by - [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) -- Yoga is now cpp, compiled as _c++1y_ - ([d7ab9496bc](https://github.com/facebook/react-native/commit/d7ab9496bc95f7b720fd6db1ed503af1c461e84d) by - [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar)) -- Bundle segments are handled better and used more - ([681278947e](https://github.com/facebook/react-native/commit/681278947eb4039a1d7a65f1edfeef25ae055a4f), - [a47431ed74](https://github.com/facebook/react-native/commit/a47431ed74f0b7b2a03ca48e84f2243d08ef3bdd), - [963c61d4d5](https://github.com/facebook/react-native/commit/963c61d4d546c94b689281ca1f5105ad050e10ff), - [b9f21dc2be](https://github.com/facebook/react-native/commit/b9f21dc2be14cd51543e6b2d1e63a861e5f433d1), - [f1258181ee](https://github.com/facebook/react-native/commit/f1258181eec84f73651d2fabd0d23764b8990ff8), and - [1988ba1d79](https://github.com/facebook/react-native/commit/1988ba1d7967dca04376e7e631e8910e5e79a6a7) by - [@fromcelticpark](https://github.com/fromcelticpark) and - [@jeanlauliac](https://github.com/jeanlauliac)) -- _packager-worker-for-buck_ has better tests - ([7fd5aa84a1](https://github.com/facebook/react-native/commit/7fd5aa84a1ef1744d01e7e877183b1f004216d00) by - [@jeanlauliac](https://github.com/jeanlauliac)) -- _RCTUIManager_ has less technical debt - ([46be5bf71c](https://github.com/facebook/react-native/commit/46be5bf71c78d33cda5cb496c475dcfb8e229346), - [60dc9bed00](https://github.com/facebook/react-native/commit/60dc9bed00cc13652752bf84f83c920ce66d5e39), and - [21714fe197](https://github.com/facebook/react-native/commit/21714fe1979ccbd62d665f383625f4ece8cf888e) by - [@shergin](https://github.com/shergin)) -- Numerous bridge changes, especially around URL resolution - ([e7bd0f056b](https://github.com/facebook/react-native/commit/e7bd0f056bf4edca1f0529d6eed03bbaaaca586a), - [260e6d2355](https://github.com/facebook/react-native/commit/260e6d23554a8e7f1743263894c9ca9a0cfbf01e), - [4894ac430d](https://github.com/facebook/react-native/commit/4894ac430d6df1118ce48f644fd8cf5bfce6344f), - [b983de9c54](https://github.com/facebook/react-native/commit/b983de9c5460e24c95a9a67f02695cd1c5f31bc5), - [b0193b098c](https://github.com/facebook/react-native/commit/b0193b098cdbd915bba90e1ab0b695ba44346f44), - [ae5ef653cb](https://github.com/facebook/react-native/commit/ae5ef653cbc4c03fe5edb5d4b0002e38cbb6f458), and - [1d6ce2311f](https://github.com/facebook/react-native/commit/1d6ce2311f6a51821b33c5473414d70c8bd34425) by - [@fromcelticpark](https://github.com/fromcelticpark) and others) -- Various cleanup and refactoring - ([053776338e](https://github.com/facebook/react-native/commit/053776338ea44c31f3671cb4502853da0c88e55a), - [0984f29a32](https://github.com/facebook/react-native/commit/0984f29a320ce7e40e8bc2a6c78b080908fa1384), - [6c70975689](https://github.com/facebook/react-native/commit/6c70975689d0f0839e6c2db9a9a25c3023f5be7b), - [d950dc6a21](https://github.com/facebook/react-native/commit/d950dc6a21c5cc1e736993b2ecc16abae086389e), - [70c359000a](https://github.com/facebook/react-native/commit/70c359000a2df091c3939f4c19db6024af992d43), - [cfa2bbf2f6](https://github.com/facebook/react-native/commit/cfa2bbf2f692d0bc5600d7e369a9a91272930ca6), and - [850efa8650](https://github.com/facebook/react-native/commit/850efa86508b19d800ff8cbdc725402c006db1a2) by - [@bnham](https://github.com/bnham), - [@priteshrnandgaonkar](https://github.com/priteshrnandgaonkar), and others) -- Jest preprocessing now uses the AST from metro - ([2ae255a6ea](https://github.com/facebook/react-native/commit/2ae255a6eaf820992bdf19799bb4403f3bbdcd5b) and - [d5b59517c2](https://github.com/facebook/react-native/commit/d5b59517c274874d7ce21e5c26d28b42ae389723) by - [@rafeca](https://github.com/rafeca)) -- `renderApplication()` now supports async initial render - ([1b22d49ae8](https://github.com/facebook/react-native/commit/1b22d49ae8945680dee4fd01e3fbb78b1e443e01) by - [@bvaughn](https://github.com/bvaughn)) -- Welcome [@lwinkyawmyat](https://github.com/lwinkyawmyat) to the React Native - GitHub Issue Task Force - ([4ebe76d559](https://github.com/facebook/react-native/commit/4ebe76d5598621160ffcf3ea8bc87c3ad1c1a2f8) by - [@lwinkyawmyat](https://github.com/lwinkyawmyat)) - -#### Android exclusive changes - -- Native components on Android register lazily rather than via ViewManager - ([1b71e03932](https://github.com/facebook/react-native/commit/1b71e03932f44e212b297b2c1e02100b6de74b93)) -- Android debug overlays (like **RedBox**, dev menu, loading) are no longer are - system overlays; they're now part of the _currentActivity_ - ([d19afc73f5](https://github.com/facebook/react-native/commit/d19afc73f5048f81656d0b4424232ce6d69a6368) by - [@kmagiera](https://github.com/kmagiera)) - -#### iOS exclusive changes - -- Improve iOS's _accessibilityLabel_ performance by up to 20% 📈 - ([19b0a65c5e](https://github.com/facebook/react-native/commit/19b0a65c5ecc4f41fea98a1e752785d6dbb6ea05) by - [@chendo](https://github.com/chendo)) - -### Fixed - -- Fix `backgroundColor` on **TouchableHighlight** - ([5a1171ebfa](https://github.com/facebook/react-native/commit/5a1171ebfaaedd9c7d5f1bfcf306049c3671a733) by - [@sahrens](https://github.com/sahrens)) -- Various corrections in messages, comments, and docblocks - ([58c3bc4901](https://github.com/facebook/react-native/commit/58c3bc490143b8d7831a00289e2565f49f5389ef), - [354e1cb508](https://github.com/facebook/react-native/commit/354e1cb5088a43fd4116504a34a65ca53c4de71b), - [58edf024a1](https://github.com/facebook/react-native/commit/58edf024a1ed3a71ef04f124546ee97496b6502f), - [b9e7006cc6](https://github.com/facebook/react-native/commit/b9e7006cc6dc2b0801ea0c776ba00cdea2204151), - [d2f0abdf4e](https://github.com/facebook/react-native/commit/d2f0abdf4ea94fbb3e2a5c7fb53ff5d1cf6abede), - [94cd9f5591](https://github.com/facebook/react-native/commit/94cd9f55915973355cdb63276b71f90df10281db), - [8547b7e111](https://github.com/facebook/react-native/commit/8547b7e11163d545b7b99d4bdd063ef71129d62c), - [44c16499fd](https://github.com/facebook/react-native/commit/44c16499fdc4665298f6c88b9ffee626fa1fc969), - [c91d87213e](https://github.com/facebook/react-native/commit/c91d87213e6862019b9ef7df7c38551bd6d659fd), - [85503a0612](https://github.com/facebook/react-native/commit/85503a0612b0c74b4d204e8748e9ed7010d838e4), and - [5b83dbe25a](https://github.com/facebook/react-native/commit/5b83dbe25af151d183009006b1fe323b2658d025) by - [@behrends](https://github.com/behrends), - [@bvaughn](https://github.com/bvaughn), - [@charpeni](https://github.com/charpeni), - [@dsandmark](https://github.com/dsandmark), - [@gusgard](https://github.com/gusgard), - [@nkabrown](https://github.com/nkabrown), - [@petterh](https://github.com/petterh), [@solon](https://github.com/solon), - [@swashcap](https://github.com/swashcap), and others) -- Various dev doc and project doc fixes for correctness and completeness - ([92c0980540](https://github.com/facebook/react-native/commit/92c0980540dde0053bad05fae6414cf8275a71b1), - [3c9092acf3](https://github.com/facebook/react-native/commit/3c9092acf39ecdb7c137a3cb0d4282694e95cbf5), - [e906525e84](https://github.com/facebook/react-native/commit/e906525e84f69a98de4d06ed1ec4c43d8589e350), - [60828566a7](https://github.com/facebook/react-native/commit/60828566a759dc579dbae1d76a8426e1e479166e), - [c49b97c4ef](https://github.com/facebook/react-native/commit/c49b97c4ef65a6351af437ef28033cb31ea0446f), - [45ed142596](https://github.com/facebook/react-native/commit/45ed14259677cff4cbd133e705ec4f0ec84bc216), - [cb6ec7c321](https://github.com/facebook/react-native/commit/cb6ec7c32141ef5bdde837d7f9d71b7adb83b751), - [9ec9567390](https://github.com/facebook/react-native/commit/9ec95673909beac7798f589e0e9821b4225f8fa9), - [e5a4ea97d9](https://github.com/facebook/react-native/commit/e5a4ea97d9e1b13509a3f36d0b469a6a88a90dc4), - [c544c0d2dc](https://github.com/facebook/react-native/commit/c544c0d2dca1d0e9f0b2a5565e03676ad71a36f5), - [33d5e5bd5a](https://github.com/facebook/react-native/commit/33d5e5bd5a5365ab712a2b9d33f33cbec305e128), - [95dac8db60](https://github.com/facebook/react-native/commit/95dac8db601ba48fe03da52e1adbdef0cac23546), - [6e1db1f1ee](https://github.com/facebook/react-native/commit/6e1db1f1ee263c3a8b68c3e1584e79ae86d5be86), - [e11d496e9d](https://github.com/facebook/react-native/commit/e11d496e9d907abb5bf58a8300c5a8f85aa03bbb), - [6da897945f](https://github.com/facebook/react-native/commit/6da897945f823728dbc82dd9f01c672354b1e76d), - [0ff576081b](https://github.com/facebook/react-native/commit/0ff576081b156ea26c4e7886f7266f3e4d8e3d5e), - [1ee64ccb8a](https://github.com/facebook/react-native/commit/1ee64ccb8a257210be3a74fb9b0adc83f2a8bb2b), - [3aa38564f7](https://github.com/facebook/react-native/commit/3aa38564f7b91c8588c8484140bc4221d50d55e0), - [6b26971a56](https://github.com/facebook/react-native/commit/6b26971a56fdd919d11cc338893d0b7a3f7a45ba), and - [de3976a486](https://github.com/facebook/react-native/commit/de3976a48655a248a2417fcf2d3a511be02e1996) by - [@adrianomelo](https://github.com/adrianomelo), - [@blargity](https://github.com/blargity), - [@charpeni](https://github.com/charpeni), - [@garlic-rice-with-butter](https://github.com/garlic-rice-with-butter), - [@gwmccull](https://github.com/gwmccull), - [@harikrishnanp](https://github.com/harikrishnanp), - [@hramos](https://github.com/hramos), - [@johnthewilson](https://github.com/johnthewilson), - [@jsdario](https://github.com/jsdario), [@kelset](https://github.com/kelset), - [@patrickkempff](https://github.com/patrickkempff), - [@ryanml](https://github.com/ryanml), - [@tiagomoraismorgado88](https://github.com/tiagomoraismorgado88), - [@timwangdev](https://github.com/timwangdev), and others) -- Stop `RCTRefreshControl` from jumping around - ([2e1707d0e6](https://github.com/facebook/react-native/commit/2e1707d0e600a30057511390dd87c18c00f19a59) by - [@sophiebits](https://github.com/sophiebits)) -- Fix a race condition in the animation module - ([515eb0e801](https://github.com/facebook/react-native/commit/515eb0e8012a7a8f085a8e410c6c694011fd8c1d) by - [@mhorowitz](https://github.com/mhorowitz)) -- Fix Windows local-cli's to not wrongfully identify as globally installed - ([ca106043fc](https://github.com/facebook/react-native/commit/ca106043fc655a1c51332aedf9b001a512269550) by - [@sballew](https://github.com/sballew)) -- Fix Jest mocks for **NetInfo**, **Dimensions**, and **ScrollView** modules - ([7fb3a9229d](https://github.com/facebook/react-native/commit/7fb3a9229df52bd45076470d059f245a8147cd2a), - [11a2a35c63](https://github.com/facebook/react-native/commit/11a2a35c63ae68de46482f5cd25271f8b0fb5ad4), and - [0c8a3e4f79](https://github.com/facebook/react-native/commit/0c8a3e4f797563c99e988ec2f42ec2a618a8b196) by - [@alvaromb](https://github.com/alvaromb), - [@timwangdev](https://github.com/timwangdev), and - [@uk-ar](https://github.com/uk-ar)) -- packager-worker-for-buck: `transformCommand`: add missing test - ([73a01be9bc](https://github.com/facebook/react-native/commit/73a01be9bcd9059f3172987fd30d8b6dc0125759) by - [@jeanlauliac](https://github.com/jeanlauliac)) -- Fixed issue where CLI wasn't following the config value for postMinifyProcess - when its running with `dev=false` - ([6d92046c56](https://github.com/facebook/react-native/commit/6d92046c56794a6a62bc07598545a23a7b53cdc0) by - [@rafeca](https://github.com/rafeca)) -- Fix asset resolver url handling - ([28d5d6baf1](https://github.com/facebook/react-native/commit/28d5d6baf1e6ac52e8672a653f56c3898e4e11d2) by - [@fkgozali](https://github.com/fkgozali)) -- Fix crash when destroying catalyst - ([f1015664e9](https://github.com/facebook/react-native/commit/f1015664e92f02c33417a591a2438db7c0cd3811)) -- You can now `justifyContent` while you're `minWidth`ing and `marginLeft`ing; - before the justification wasn't honored - ([f5becebc07](https://github.com/facebook/react-native/commit/f5becebc0710d5bb875bb9c0a2d3809a00f62605) by - [@woehrl01](https://github.com/woehrl01)) -- `marginLeft: auto` and `alignItem: stretch` now play nicely together; before - the width and height ended up incorrect - ([5f99b1a55f](https://github.com/facebook/react-native/commit/5f99b1a55f4002c105a7005cabf720aad422b628) by - [@woehrl01](https://github.com/woehrl01)) -- Fix assertion preventing YGNodeLayoutGet\* with YGEdgeEnd - ([a383b8ca05](https://github.com/facebook/react-native/commit/a383b8ca0545ba3704a51a78972107119f5683c0) by - [@justjake](https://github.com/justjake)) -- Fix shrinking in non-strech alignments - ([1d62848535](https://github.com/facebook/react-native/commit/1d6284853514be4da2b68d45732386eb81cc4253) by - [@woehrl01](https://github.com/woehrl01)) -- Correctly calculate min/max percentage constraints - ([4fdaf2de98](https://github.com/facebook/react-native/commit/4fdaf2de989c039a62681cc1f7a8407ec32b593e) by - [@woehrl01](https://github.com/woehrl01)) -- When running `react-native-git-upgrade`, don't execute git's hooks - ([0182086350](https://github.com/facebook/react-native/commit/018208635069311c1a7c7776c6f359f7ded45362) by - [@adrienthiery](https://github.com/adrienthiery)) -- When running `react-native-git-upgrade` and failing with a signal, return that - to the terminal - ([b9a5862f67](https://github.com/facebook/react-native/commit/b9a5862f670f52d48f1d3789c3f08ec139368da4) by - [@mateusz-](https://github.com/mateusz-)) -- In **KeyboardAvoidingView**, don't mistakenly try to layout when a hardware - keyboard changes - ([ad4450ac13](https://github.com/facebook/react-native/commit/ad4450ac1364710f052a927ceda7ae353440f682) by - [@koenpunt](https://github.com/koenpunt)) -- Don't endlessly collect websockets when not connected to the packager (dev - memory leak) - ([1e1e491246](https://github.com/facebook/react-native/commit/1e1e49124678f447d980bb22891d25db60fa83b3) by - [@mmmulani](https://github.com/mmmulani)) -- Fixed a bug in the sample project random `selection` prop that made it - not-so-random - ([766f020e68](https://github.com/facebook/react-native/commit/766f020e68abfc121ea6a9f92e0640368d69dae7) by - [@rozele](https://github.com/rozele)) - -#### Android exclusive fixes - -- Explicitly `#define isnan __builtin_isnan` for Android _clang-5_ to mimic - **gcc**'s default behavior - ([f8fe6b0c70](https://github.com/facebook/react-native/commit/f8fe6b0c70d1b7b626d05d9675c16b2f89339e8c)) -- Correctly update **NetInfo** on Android even if connection types change while - the app is in the background - ([e6f542d620](https://github.com/facebook/react-native/commit/e6f542d62037e9830c0ae5749a32874c44cf2334) by - [@berickson1](https://github.com/berickson1)) -- Direction-aware borders now work with Android APIs >= 17 - ([7170543e80](https://github.com/facebook/react-native/commit/7170543e8012250b7643a960b54cce7fd6d3a1e9) by - [@rsnara](https://github.com/rsnara)) -- Don't throw _BadTokenException_ and _IllegalArgmentException_ when showing or - dismissing Modal on Android - ([e57a43b97a](https://github.com/facebook/react-native/commit/e57a43b97ad24dc5b993753a45aa575b2a757b4f)) -- Fix Android crash when blurRadius is between 0 and 1 - ([dc01eff72d](https://github.com/facebook/react-native/commit/dc01eff72d23e1dd3f7ecf30859992ee3bf7c664) by - [@jamesreggio](https://github.com/jamesreggio)) -- Fix `borderRadius` with Android API level < 18 - ([5aa1fb3ff3](https://github.com/facebook/react-native/commit/5aa1fb3ff326a429e33a443576da866f2a63c20c) and - [ca7fe72c31](https://github.com/facebook/react-native/commit/ca7fe72c31fd7c7cbe4734118019f5808235560e) by - [@rsnara](https://github.com/rsnara)) -- Make Android `lineHeight` behavior match iOS's 📏 - ([3f1b021506](https://github.com/facebook/react-native/commit/3f1b0215060e4c27c286359cc90f3b2189956c4e)) -- Fixed autoscroll to cursor on Android **TextInput** - ([0bef872f3f](https://github.com/facebook/react-native/commit/0bef872f3fc8b1cd78c574d03eacc886bef4e239) by - [@shergin](https://github.com/shergin)) -- Fix logging unpacking time on Android when it happens concurrently with eager - unpacking ([028b64bcd3](https://github.com/facebook/react-native/commit/028b64bcd36c1c8dd76c0de95eeff80cf660aa23) - by [@alexeylang](https://github.com/alexeylang)) -- Prevent an Android crash when **TextInput** has `selectionColor` defined but - there is no drawable cursor - ([1e18d907bf](https://github.com/facebook/react-native/commit/1e18d907bfb8cc5f4f2e1a1ede0dd98aec40ab11) by - [@gpeal](https://github.com/gpeal)) - -#### iOS exclusive fixes - -- Don't have Xcode warnings for _YGDefaultLog_ in newly created projects - ([72e762d4bc](https://github.com/facebook/react-native/commit/72e762d4bca8d00cc2c73c390a654ae6143731bd) by - [@woehrl01](https://github.com/woehrl01)) -- iOS _RCTEventEmitter_ uses a `double` for count, not _NSInteger_ - ([eaa84997ce](https://github.com/facebook/react-native/commit/eaa84997cedc8dc4d46308e2217d2b094a51ed02)) -- Fix `isNuclideDebuggingAvailable` on iOS - ([59c3e33f63](https://github.com/facebook/react-native/commit/59c3e33f637d11e33204e8a912e98459ffad7fab)) -- iOS ScrollView is now rendered correctly with RefreshControl - ([75d62bf0a8](https://github.com/facebook/react-native/commit/75d62bf0a802b91a979d03ef497e84c3179e7767) by - [@vonovak](https://github.com/vonovak)) -- Fix a crash when keyboard is visible and bridge reload happens on iOS - ([d9c658566a](https://github.com/facebook/react-native/commit/d9c658566a14ce8767d87435264997aa18dd08e4) by - [@fromcelticpark](https://github.com/fromcelticpark)) -- **RedBox** now appears beneath the status bar on iOS - ([33cefc1760](https://github.com/facebook/react-native/commit/33cefc176096e03a4b3c3130a70abfabe9d40f38) by - [@adamjernst](https://github.com/adamjernst)) -- Fractional border widths on iOS are now the right size, honoring insets - ([15179f1798](https://github.com/facebook/react-native/commit/15179f1798b277c1836441fcf7f3b7f0bd5a4636) by - [@Nikita2k](https://github.com/Nikita2k)) -- Implement `requiresMainQueueSetup` in _RCTTVNavigationEventEmitter_ to satisfy - Xcode warning - ([ee3532b5c2](https://github.com/facebook/react-native/commit/ee3532b5c266d5ee7fb12920cb611a41b1daf750) by - [@charpeni](https://github.com/charpeni)) -- Support the iPhone X in the sample project's header - ([ad4b124aa1](https://github.com/facebook/react-native/commit/ad4b124aa117483b4a0ec9dfa145b8e9a17f06c6) by - [@vincentriemer](https://github.com/vincentriemer)) -- `testID` works on **TabBarItem** on iOS - ([e19d9dec9b](https://github.com/facebook/react-native/commit/e19d9dec9b3b257b5db3dc77ed8b95b93570f1e3)) -- On iOS, don't error on the first live-reload of large codebases because of too - little wait time - ([b6f1a6085f](https://github.com/facebook/react-native/commit/b6f1a6085f7470c16ae8850e7da8f4f9ae5c23ee) by - [@lelandrichardson](https://github.com/lelandrichardson)) -- Prevent iOS crash on receiving bad unicode in _XMLHTTPRequest_ - ([1c04ceeb4b](https://github.com/facebook/react-native/commit/1c04ceeb4ba954eee7ab34fc5b6c660d9772d9f6) by - [@cdlewis](https://github.com/cdlewis)) -- Define `pod_target_xcconfig` for PrivateDatabase - ([38b96cd7bb](https://github.com/facebook/react-native/commit/38b96cd7bb391f64066a6c91daa4173db1f33445) by - [@ide](https://github.com/ide)) -- Fixed podspec include/excludes around tvOS - ([ba1d7e92e4](https://github.com/facebook/react-native/commit/ba1d7e92e4f251b90a96be192214b5015cf6244e) by - [@yygene](https://github.com/yygene)) -- Don't spam the logs for iOS when receiving `ECONNREFUSED` on connecting to - packager ([b1701ccaef](https://github.com/facebook/react-native/commit/b1701ccaefa0c8cbb6d820b2ad07e0d911027d7c) - and [ff3dc2ed19](https://github.com/facebook/react-native/commit/ff3dc2ed19cdd4137ae8092599b16c09d4e2c711) by - [@adamjernst](https://github.com/adamjernst)) -- Don't crash Systrace when debugging JS remotely on iOS - ([e8eec24706](https://github.com/facebook/react-native/commit/e8eec24706e792314ee574bbf7f7c0066c4f3a7a) by - [@alexeylang](https://github.com/alexeylang)) - -### Removed - -- Removing `reactBridgeDidFinishTransaction` from _RCTScrollView_ - ([a255204e3e](https://github.com/facebook/react-native/commit/a255204e3e7fddefd2d7b0de224101768757ca7a) by - [@shergin](https://github.com/shergin)) -- Removing inherited background color optimization from _RCTText_ to reduce code - complexity – please give feedback if you find performance differences! - ([8c8944c10f](https://github.com/facebook/react-native/commit/8c8944c10fb7dc30ea99657225f25ea438cf6e14) by - [@shergin](https://github.com/shergin)) - -### Other - -Below is a list of the remaining, low-level changes that made it into this -release of React Native. - -- Foundational work for a new justifyContent value **space-evenly** - ([1050e0b476](https://github.com/facebook/react-native/commit/1050e0b47611602b758f73d99f51a1dd5ceabade) by - [@woehrl01](https://github.com/woehrl01)) -- Add Systrace-based telemetry to Hermes GC - ([05e862d48d](https://github.com/facebook/react-native/commit/05e862d48d363a8af765b2f0283569419dbd2e5c)) -- Unify Systrace native hook argument passing - ([52e3ae9063](https://github.com/facebook/react-native/commit/52e3ae9063705bac53bad99ffe23976c29c8f1b2) by - [@amnn](https://github.com/amnn)) -- Use different symbols for SystraceSection depending on `WITH_FBYSTRACE` - ([03956c4ecf](https://github.com/facebook/react-native/commit/03956c4ecfda381396336f725ea1c12d913df17d)) -- Don't set global.performance to undefined if it was initialized already - ([dfebcb70a5](https://github.com/facebook/react-native/commit/dfebcb70a5c948db94d1cd580bbcaa0aaa702349) by - [@alexeylang](https://github.com/alexeylang)) -- Autofixes for migrating to Buck's source-only ABI feature - ([801cbdb047](https://github.com/facebook/react-native/commit/801cbdb04788403cee022dec688136540da36fc5) by - [@jkeljo](https://github.com/jkeljo)) -- Add remote API to uninstall the global error handler in RN - ([1d16923063](https://github.com/facebook/react-native/commit/1d16923063940606dda89de94a83cbdf5f98e1f1)) -- Add _RCTLibraryPathForURL_ in _RCTUtil_ - ([2fecbf6171](https://github.com/facebook/react-native/commit/2fecbf61711f610124fc2453a79120932024f613)) -- Fix sections that come from React Fiber - ([1f40c95076](https://github.com/facebook/react-native/commit/1f40c95076297258a4194fd9c1b5af7002187c99) by - [@alexeylang](https://github.com/alexeylang)) -- Fix boolean conversion in sync RN method calls. - ([dd888d3346](https://github.com/facebook/react-native/commit/dd888d3346ef9477eae2cd2d29cef867467cb503)) -- Fix `embeddedBundleURL` update situation - ([d1fc8ef3a3](https://github.com/facebook/react-native/commit/d1fc8ef3a3cb3590b9cff4d1b3cc5d440b52ec8c)) -- Remove `android_react_native_perf.use_separate_ui_bg_thread` experiment. - ([4f886a29a1](https://github.com/facebook/react-native/commit/4f886a29a1234c967deae2354bbc5092e0e6595e)) -- ScrollView related files were moved to dedicated folder - ([098a63a1ce](https://github.com/facebook/react-native/commit/098a63a1cee1196a2f3eb5135eeb8fe59e7e8272) by - [@shergin](https://github.com/shergin)) -- move page registration logic in to jsinspector - ([bef7967f9a](https://github.com/facebook/react-native/commit/bef7967f9a485dc136d2cb32f552b2199ae3e2b8) by - [@bnham](https://github.com/bnham)) -- Type global hooks as function pointers - ([eca51eb46a](https://github.com/facebook/react-native/commit/eca51eb46a47112c8933d0a3b932f59008cadc78) by - [@johnislarry](https://github.com/johnislarry)) -- `std::string` to `const char*` - ([b952365ba6](https://github.com/facebook/react-native/commit/b952365ba6bd86f0e80a24aedec1f447cb3ec566) by - [@johnislarry](https://github.com/johnislarry)) -- Allow extending props supported by native animations - ([71751e9cc7](https://github.com/facebook/react-native/commit/71751e9cc7c67306ca038c5b254e6e81fe0aff1b) by - [@andrewimm](https://github.com/andrewimm)) -- Meyers singleton jsc error extractor - ([434f432d5d](https://github.com/facebook/react-native/commit/434f432d5d5ea2756c1adac8b1c36e82e60a2b13) by - [@johnislarry](https://github.com/johnislarry)) -- Do not overwrite the same text in **TextInput** - ([29f3f55298](https://github.com/facebook/react-native/commit/29f3f5529827579101f0d8bd6afe72f1cb0caeca)) -- Renaming _uiManagerWillFlushUIBlocks_ -> _uiManagerWillPerformMounting_ - ([0a8721c340](https://github.com/facebook/react-native/commit/0a8721c340480a972bb597cacdbddd9eb2015716) by - [@shergin](https://github.com/shergin)) -- Skylarkify flags macros. - ([ed2bfcb35a](https://github.com/facebook/react-native/commit/ed2bfcb35a2756eb700882ab8e21b6b273efa80a) by - [@ttsugriy](https://github.com/ttsugriy)) -- Skylarkify `config_utils_defs` macros. - ([88f6f69152](https://github.com/facebook/react-native/commit/88f6f69152e4b68609f28e80ee70705969529af8) by - [@ttsugriy](https://github.com/ttsugriy)) -- Round size geometry for Button and RichText components. - ([4034febb7e](https://github.com/facebook/react-native/commit/4034febb7ef9d9daa894a75b038226af74026163) by - [@iaroslav-pavlov](https://github.com/iaroslav-pavlov) -- Temporarily patched Map/Set non-extensible check into RN dev renderer - ([a99f0d6100](https://github.com/facebook/react-native/commit/a99f0d6100c9779f5f6df6008af54c06113355f6) by - [@bvaughn](https://github.com/bvaughn)) -- Run buildifier over all BUCK files - ([d674d48a7b](https://github.com/facebook/react-native/commit/d674d48a7b9b71169af59ceb886529371c26a2e5) by - [@zertosh](https://github.com/zertosh)) -- Pass `scriptURL` to _RCTTestRunner_ - ([266ab7a006](https://github.com/facebook/react-native/commit/266ab7a0061c11c4da7ccde9e0d461c0d7331563)) -- Make _RCTNativeModule::invokeInner_ explicitely return `folly::none` in case - of error ([0ac5a5230c](https://github.com/facebook/react-native/commit/0ac5a5230c4b5dd44db6a8dd7bb7752aff64d71c) - by [@fromcelticpark](https://github.com/fromcelticpark)) -- Make _RCTPackagerConnection_ a singleton - ([9180d4eb82](https://github.com/facebook/react-native/commit/9180d4eb82fb70a0fd396b15660c2ac6770183c9) by - [@adamjernst](https://github.com/adamjernst)) -- Register split segment paths with _RAMBundleRegistry_ - ([cff0d8e0e5](https://github.com/facebook/react-native/commit/cff0d8e0e599d1ab21b36779b41fbb26512874aa) by - [@fromcelticpark](https://github.com/fromcelticpark)) -- check if listener is still in the set before calling `onHostResume` - ([ad89ea7b50](https://github.com/facebook/react-native/commit/ad89ea7b5046c2cf9ca1cba88c387eb1db8dc042)) -- export _SeparatorsObj_ type for re-use in **ListItem**s etc. - ([c6fe101cdc](https://github.com/facebook/react-native/commit/c6fe101cdcc0b8d640a86108d8a76f7292b5f799) by - [@sahrens](https://github.com/sahrens)) -- Do not mark node as dirty if, new and old values are undefined - ([41da6e3128](https://github.com/facebook/react-native/commit/41da6e31284d46bb1dd2053c3c3100c075ace019) by - [@woehrl01](https://github.com/woehrl01)) -- Remove _RAMBundleRegistry_ subclasses - ([6ecae73fe5](https://github.com/facebook/react-native/commit/6ecae73fe5915863c27ac7e407f5b151fd0c5fc3) by - [@fromcelticpark](https://github.com/fromcelticpark)) -- Fix `minimumViewTime` in _ViewabilityHelper_ - ([d19d137cc1](https://github.com/facebook/react-native/commit/d19d137cc18f10957b5ac64ac727d15fde57f018)) - -[0.56]: https://github.com/facebook/react-native/compare/0.55-stable...0.56-stable -[0.55]: https://github.com/facebook/react-native/compare/0.54-stable...0.55-stable -[0.54]: https://github.com/facebook/react-native/compare/0.53-stable...0.54-stable -[0.53]: https://github.com/facebook/react-native/compare/0.52-stable...0.53-stable -[0.52.0]: https://github.com/facebook/react-native/compare/0.51-stable...0.52-stable From ede86a3c0c283f129727f14cda60a759fad8bfbf Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Thu, 22 Jun 2023 07:40:16 -0700 Subject: [PATCH 333/468] Create a pod for renderer debug module (#37620) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37620 changelog: [internal] To better align cocoapods structure with BUCK structure internally, we need render debug module to be a seaparate pod. This diff does that. Reviewed By: cortinico, cipolleschi Differential Revision: D46275529 fbshipit-source-id: d4402f264608e3297c232fcaa4fdc3df88551a65 --- .../AppDelegate/React-RCTAppDelegate.podspec | 7 +- .../React/React-RCTFabric.podspec | 4 +- .../ReactCommon/React-Fabric.podspec | 12 +- .../ReactCommon/React-FabricImage.podspec | 4 +- .../debug/React-rendererdebug.podspec | 58 ++++++++ .../platform/ios/React-ImageManager.podspec | 6 +- .../cocoapods/__tests__/codegen_utils-test.rb | 8 +- .../__tests__/new_architecture-test.rb | 7 +- .../scripts/cocoapods/codegen_utils.rb | 4 +- .../scripts/cocoapods/new_architecture.rb | 6 +- .../react-native/scripts/react_native_pods.rb | 1 + packages/rn-tester/Podfile.lock | 124 ++++++++++++------ 12 files changed, 175 insertions(+), 66 deletions(-) create mode 100644 packages/react-native/ReactCommon/react/renderer/debug/React-rendererdebug.podspec diff --git a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec index c22ba9279aeb76..ac5042a02a34d4 100644 --- a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec +++ b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec @@ -48,8 +48,10 @@ header_search_paths = [ "$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core", "$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers", "$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers/", + "$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers/", "$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers/", - "${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers/" + "$(PODS_CONFIGURATION_BUILD_DIR)/React-runtimescheduler/React_runtimescheduler.framework/Headers/", + "$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers/", ] : []).map{|p| "\"#{p}\""}.join(" ") Pod::Spec.new do |s| @@ -93,8 +95,9 @@ Pod::Spec.new do |s| s.dependency "React-Fabric" s.dependency "React-RCTFabric" s.dependency "React-graphics" - s.dependency "React-debug" s.dependency "React-utils" + s.dependency "React-debug" + s.dependency "React-rendererdebug" s.script_phases = { :name => "Generate Legacy Components Interop", diff --git a/packages/react-native/React/React-RCTFabric.podspec b/packages/react-native/React/React-RCTFabric.podspec index 1c1ac9f67937b7..d91c8f25018631 100644 --- a/packages/react-native/React/React-RCTFabric.podspec +++ b/packages/react-native/React/React-RCTFabric.podspec @@ -43,8 +43,9 @@ if ENV['USE_FRAMEWORKS'] header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-ImageManager/React_ImageManager.framework/Headers\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\"" - header_search_paths << "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"" + header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" + header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-rendererdebug/React_rendererdebug.framework/Headers\"" end Pod::Spec.new do |s| @@ -83,6 +84,7 @@ Pod::Spec.new do |s| s.dependency "React-FabricImage" s.dependency "React-debug" s.dependency "React-utils" + s.dependency "React-rendererdebug" if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" s.dependency "hermes-engine" diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index 1f5a9b955fd5ea..463002fb3ba627 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -54,6 +54,7 @@ Pod::Spec.new do |s| s.dependency "React-debug" s.dependency "React-utils" # s.dependency "React-runtimescheduler" + s.dependency "React-rendererdebug" s.dependency "React-cxxreact" if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" @@ -105,8 +106,9 @@ Pod::Spec.new do |s| "\"$(PODS_ROOT)/DoubleConversion\"", "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers\"", "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\"", + "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers/\"", "\"$(PODS_TARGET_SRCROOT)/react/renderer/textlayoutmanager/platform/ios\"", - "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/textinput/iostextinput\"" + "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/textinput/iostextinput\"", ] end @@ -232,14 +234,6 @@ Pod::Spec.new do |s| end end - s.subspec "debug_renderer" do |ss| - ss.dependency folly_dep_name, folly_version - ss.compiler_flags = folly_compiler_flags - ss.source_files = "react/renderer/debug/**/*.{m,mm,cpp,h}" - ss.exclude_files = "react/renderer/debug/tests" - ss.header_dir = "react/renderer/debug" - end - s.subspec "imagemanager" do |ss| ss.dependency folly_dep_name, folly_version ss.compiler_flags = folly_compiler_flags diff --git a/packages/react-native/ReactCommon/React-FabricImage.podspec b/packages/react-native/ReactCommon/React-FabricImage.podspec index 9250bad91b31b3..385ecdf322adec 100644 --- a/packages/react-native/ReactCommon/React-FabricImage.podspec +++ b/packages/react-native/ReactCommon/React-FabricImage.podspec @@ -38,7 +38,8 @@ if ENV['USE_FRAMEWORKS'] "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/imagemanager/platform/ios\"", "\"$(PODS_TARGET_SRCROOT)/react/renderer/textlayoutmanager/platform/ios\"", "\"$(PODS_TARGET_SRCROOT)/react/renderer/components/textinput/iostextinput\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\"" + "\"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\"", + "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers/\"" ] end @@ -78,6 +79,7 @@ Pod::Spec.new do |s| s.dependency "React-ImageManager" s.dependency "React-Fabric" s.dependency "React-utils" + s.dependency "React-rendererdebug" s.dependency "Yoga" if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" diff --git a/packages/react-native/ReactCommon/react/renderer/debug/React-rendererdebug.podspec b/packages/react-native/ReactCommon/react/renderer/debug/React-rendererdebug.podspec new file mode 100644 index 00000000000000..4ea1cd66b9bf47 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/debug/React-rendererdebug.podspec @@ -0,0 +1,58 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json"))) +version = package['version'] + +source = { :git => 'https://github.com/facebook/react-native.git' } +if version == '1000.0.0' + # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. + source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1") +else + source[:tag] = "v#{version}" +end + +folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32' +folly_version = '2021.07.22.00' + +header_search_paths = [ + "\"$(PODS_ROOT)/RCT-Folly\"", + "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\"", + "\"$(PODS_ROOT)/DoubleConversion\"" +] + +if ENV['USE_FRAMEWORKS'] + header_search_paths << "\"$(PODS_TARGET_SRCROOT)/../../..\"" #this is needed to allow the Renderer/Debug access its own files + header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"" +end + +Pod::Spec.new do |s| + s.name = "React-rendererdebug" + s.version = version + s.summary = "-" # TODO + s.homepage = "https://reactnative.dev/" + s.license = package["license"] + s.author = "Meta Platforms, Inc. and its affiliates" + s.platforms = { :ios => min_ios_version_supported } + s.source = source + s.source_files = "**/*.{cpp,h,mm}" + s.compiler_flags = folly_compiler_flags + s.header_dir = "react/renderer/debug" + s.exclude_files = "tests" + s.pod_target_xcconfig = { + "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", + "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')} + + if ENV['USE_FRAMEWORKS'] + s.module_name = "React_rendererdebug" + s.header_mappings_dir = "../../.." + end + + s.dependency "React-debug" + s.dependency "RCT-Folly", folly_version + s.dependency "DoubleConversion" +end diff --git a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec index 5dd7f9ef452028..34ad40c6fe5c61 100644 --- a/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +++ b/packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec @@ -48,8 +48,9 @@ Pod::Spec.new do |s| "\"$(PODS_ROOT)/DoubleConversion\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\"", "\"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\"", - "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" + "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"", + "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"", + "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers/\"", ] end @@ -64,6 +65,7 @@ Pod::Spec.new do |s| s.dependency "React-Core/Default" s.dependency "React-RCTImage" s.dependency "React-debug" + s.dependency "React-rendererdebug" s.dependency "React-utils" s.dependency "glog" end diff --git a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb index 297ed18bca59bb..6ba48ceec6ae12 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb @@ -577,8 +577,9 @@ def get_podspec_fabric_and_script_phases(script_phases) 'React-graphics': [], 'React-rncore': [], 'React-Fabric': [], - 'React-debug': [], 'React-utils': [], + 'React-debug': [], + 'React-rendererdebug': [], }) specs[:'script_phases'] = script_phases @@ -590,13 +591,14 @@ def get_podspec_when_use_frameworks specs = get_podspec_no_fabric_no_script() specs["pod_target_xcconfig"]["FRAMEWORK_SEARCH_PATHS"].concat([]) - specs["pod_target_xcconfig"]["HEADER_SEARCH_PATHS"].concat(" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-FabricImage/React_FabricImage.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"") + specs["pod_target_xcconfig"]["HEADER_SEARCH_PATHS"].concat(" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-FabricImage/React_FabricImage.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers\"") specs[:dependencies].merge!({ 'React-graphics': [], 'React-Fabric': [], - 'React-debug': [], 'React-utils': [], + 'React-debug': [], + 'React-rendererdebug': [], }) return specs diff --git a/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb b/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb index 1f0c04c216a168..8eb56511fe7a12 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/new_architecture-test.rb @@ -129,7 +129,7 @@ def test_installModulesDependencies_whenNewArchEnabledAndNewArchAndNoSearchPaths # Assert assert_equal(spec.compiler_flags, NewArchitectureHelper.folly_compiler_flags) - assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"") + assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers\"") assert_equal(spec.pod_target_xcconfig["CLANG_CXX_LANGUAGE_STANDARD"], "c++17") assert_equal(spec.pod_target_xcconfig["OTHER_CPLUSPLUSFLAGS"], "$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1") assert_equal( @@ -148,8 +148,9 @@ def test_installModulesDependencies_whenNewArchEnabledAndNewArchAndNoSearchPaths { :dependency_name => "Yoga" }, { :dependency_name => "React-Fabric" }, { :dependency_name => "React-graphics" }, - { :dependency_name => "React-debug" }, { :dependency_name => "React-utils" }, + { :dependency_name => "React-debug" }, + { :dependency_name => "React-rendererdebug" }, { :dependency_name => "hermes-engine" } ]) end @@ -168,7 +169,7 @@ def test_installModulesDependencies_whenNewArchDisabledAndSearchPathsAndCompiler # Assert assert_equal(spec.compiler_flags, "-Wno-nullability-completeness #{NewArchitectureHelper.folly_compiler_flags}") - assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "#{other_flags} \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"") + assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "#{other_flags} \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/Headers/Private/Yoga\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-FabricImage/React_FabricImage.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers\"") assert_equal(spec.pod_target_xcconfig["CLANG_CXX_LANGUAGE_STANDARD"], "c++17") assert_equal( spec.dependencies, diff --git a/packages/react-native/scripts/cocoapods/codegen_utils.rb b/packages/react-native/scripts/cocoapods/codegen_utils.rb index 1ea549fa094961..36868947f2f624 100644 --- a/packages/react-native/scripts/cocoapods/codegen_utils.rb +++ b/packages/react-native/scripts/cocoapods/codegen_utils.rb @@ -101,7 +101,8 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers\"", "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers\"", "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" + "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers\"", + "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers\"", ]) end @@ -141,6 +142,7 @@ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fa if fabric_enabled spec[:'dependencies'].merge!({ 'React-graphics': [], + 'React-rendererdebug': [], 'React-Fabric': [], 'React-debug': [], 'React-utils': [], diff --git a/packages/react-native/scripts/cocoapods/new_architecture.rb b/packages/react-native/scripts/cocoapods/new_architecture.rb index b9a51834c91269..a9884def75d994 100644 --- a/packages/react-native/scripts/cocoapods/new_architecture.rb +++ b/packages/react-native/scripts/cocoapods/new_architecture.rb @@ -109,8 +109,9 @@ def self.install_modules_dependencies(spec, new_arch_enabled, folly_version) header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\"" - header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"" header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\"" + header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"" + header_search_paths << "\"$(PODS_CONFIGURATION_BUILD_DIR)/React-rendererdebug/React_rendererdebug.framework/Headers\"" end header_search_paths_string = header_search_paths.join(" ") spec.compiler_flags = compiler_flags.empty? ? @@folly_compiler_flags : "#{compiler_flags} #{@@folly_compiler_flags}" @@ -137,8 +138,9 @@ def self.install_modules_dependencies(spec, new_arch_enabled, folly_version) spec.dependency "Yoga" spec.dependency "React-Fabric" spec.dependency "React-graphics" - spec.dependency "React-debug" spec.dependency "React-utils" + spec.dependency "React-debug" + spec.dependency "React-rendererdebug" if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1" spec.dependency "hermes-engine" diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index 40d5ee3b2b2579..42393998e79a99 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -131,6 +131,7 @@ def use_react_native! ( pod 'React-callinvoker', :path => "#{prefix}/ReactCommon/callinvoker" pod 'React-runtimeexecutor', :path => "#{prefix}/ReactCommon/runtimeexecutor" + pod 'React-rendererdebug', :path => "#{prefix}/ReactCommon/react/renderer/debug" pod 'React-perflogger', :path => "#{prefix}/ReactCommon/reactperflogger" pod 'React-logger', :path => "#{prefix}/ReactCommon/logger" pod 'ReactCommon/turbomodule/core', :path => "#{prefix}/ReactCommon", :modular_headers => true diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index b595f3ccdc18c0..e21162301b8c78 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -136,6 +136,7 @@ PODS: - React-jsi - React-jsiexecutor - React-NativeModulesApple + - React-rendererdebug - React-rncore - React-utils - ReactCommon/turbomodule/bridging @@ -377,7 +378,6 @@ PODS: - React-Fabric/components (= 1000.0.0) - React-Fabric/config (= 1000.0.0) - React-Fabric/core (= 1000.0.0) - - React-Fabric/debug_renderer (= 1000.0.0) - React-Fabric/imagemanager (= 1000.0.0) - React-Fabric/leakchecker (= 1000.0.0) - React-Fabric/mapbuffer (= 1000.0.0) @@ -392,6 +392,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/animations (1000.0.0): @@ -408,6 +410,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/attributedstring (1000.0.0): @@ -424,6 +428,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/butter (1000.0.0): @@ -440,6 +446,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/componentregistry (1000.0.0): @@ -456,6 +464,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/componentregistrynative (1000.0.0): @@ -472,6 +482,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components (1000.0.0): @@ -499,6 +511,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/inputaccessory (1000.0.0): @@ -515,6 +529,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/legacyviewmanagerinterop (1000.0.0): @@ -531,6 +547,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/modal (1000.0.0): @@ -547,6 +565,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/rncore (1000.0.0): @@ -563,6 +583,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/root (1000.0.0): @@ -579,6 +601,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/safeareaview (1000.0.0): @@ -595,6 +619,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/scrollview (1000.0.0): @@ -611,6 +637,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/text (1000.0.0): @@ -627,6 +655,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/textinput (1000.0.0): @@ -643,6 +673,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/unimplementedview (1000.0.0): @@ -659,6 +691,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/components/view (1000.0.0): @@ -675,6 +709,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - Yoga @@ -692,6 +728,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/core (1000.0.0): @@ -708,22 +746,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger - - React-utils - - ReactCommon/turbomodule/core (= 1000.0.0) - - React-Fabric/debug_renderer (1000.0.0): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 1000.0.0) - - RCTTypeSafety (= 1000.0.0) - - React-Core - - React-cxxreact - - React-debug - - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) - - React-jsiexecutor (= 1000.0.0) - - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/imagemanager (1000.0.0): @@ -740,6 +764,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/leakchecker (1000.0.0): @@ -756,6 +782,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/mapbuffer (1000.0.0): @@ -772,6 +800,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/mounting (1000.0.0): @@ -788,22 +818,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger - - React-utils - - ReactCommon/turbomodule/core (= 1000.0.0) - - React-Fabric/runtimescheduler (1000.0.0): - - DoubleConversion - - glog - - hermes-engine - - RCT-Folly/Fabric (= 2021.07.22.00) - - RCTRequired (= 1000.0.0) - - RCTTypeSafety (= 1000.0.0) - - React-Core - - React-cxxreact - - React-debug - - React-graphics (= 1000.0.0) - - React-jsi (= 1000.0.0) - - React-jsiexecutor (= 1000.0.0) - - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/scheduler (1000.0.0): @@ -820,6 +836,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/telemetry (1000.0.0): @@ -836,6 +854,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/templateprocessor (1000.0.0): @@ -852,6 +872,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/textlayoutmanager (1000.0.0): @@ -869,6 +891,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-Fabric/uimanager (1000.0.0): @@ -885,6 +909,8 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug + - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core (= 1000.0.0) - React-FabricImage (1000.0.0): @@ -900,6 +926,7 @@ PODS: - React-jsi (= 1000.0.0) - React-jsiexecutor (= 1000.0.0) - React-logger + - React-rendererdebug - ReactCommon/turbomodule/core (= 1000.0.0) - Yoga - React-graphics (1000.0.0): @@ -924,6 +951,7 @@ PODS: - React-debug - React-Fabric - React-RCTImage + - React-rendererdebug - React-utils - React-jsi (1000.0.0): - boost (= 1.76.0) @@ -972,6 +1000,7 @@ PODS: - React-NativeModulesApple - React-RCTImage - React-RCTNetwork + - React-runtimescheduler - ReactCommon/turbomodule/core - React-RCTBlob (1000.0.0): - hermes-engine @@ -994,6 +1023,8 @@ PODS: - React-ImageManager - React-RCTImage (= 1000.0.0) - React-RCTText + - React-rendererdebug + - React-runtimescheduler - React-utils - Yoga - React-RCTImage (1000.0.0): @@ -1043,6 +1074,10 @@ PODS: - React-Core/RCTVibrationHeaders (= 1000.0.0) - React-jsi (= 1000.0.0) - ReactCommon/turbomodule/core (= 1000.0.0) + - React-rendererdebug (1000.0.0): + - DoubleConversion + - RCT-Folly (= 2021.07.22.00) + - React-debug - React-rncore (1000.0.0) - React-runtimeexecutor (1000.0.0): - React-jsi (= 1000.0.0) @@ -1155,6 +1190,7 @@ DEPENDENCIES: - React-RCTTest (from `./RCTTest`) - React-RCTText (from `../react-native/Libraries/Text`) - React-RCTVibration (from `../react-native/Libraries/Vibration`) + - React-rendererdebug (from `../react-native/ReactCommon/react/renderer/debug`) - React-rncore (from `../react-native/ReactCommon`) - React-runtimeexecutor (from `../react-native/ReactCommon/runtimeexecutor`) - React-utils (from `../react-native/ReactCommon/react/utils`) @@ -1263,6 +1299,8 @@ EXTERNAL SOURCES: :path: "../react-native/Libraries/Text" React-RCTVibration: :path: "../react-native/Libraries/Vibration" + React-rendererdebug: + :path: "../react-native/ReactCommon/react/renderer/debug" React-rncore: :path: "../react-native/ReactCommon" React-runtimeexecutor: @@ -1303,16 +1341,16 @@ SPEC CHECKSUMS: RCTTypeSafety: 034ade4e3b36be976b8378f825ccadbe104fa852 React: cb6dc75e09f32aeddb4d8fb58a394a67219a92fe React-callinvoker: bae59cbd6affd712bbfc703839dad868ff35069d - React-Codegen: 42dae0c7801d765934f76cfbaefcb5742524cc98 - React-Core: b04375fb8581bb80b6c87c25061a1998c61b0006 + React-Codegen: 4ac0cb84d358edd26db783a441cade433333eb93 + React-Core: 98f0e61878ef96afbf3ec4e9690a4bf720e7cb73 React-CoreModules: fa9b32bbc7818672a7ca91eeef4867e133b566ec - React-cxxreact: 21b73aa1e245d6c701e62150312c3748756bbf42 + React-cxxreact: 9a06a6853644cb043351ca10edd4e2b913c5b41c React-debug: d1cd203242675d48eecec6c2553933c0e0a3874f - React-Fabric: e85af38574589ce0d1a353623ecda0f94435da16 - React-FabricImage: 8552a7e0919bc2ab09c6869a7507ad7a46e552d9 + React-Fabric: 31fa21f5749778fe4230fccb72fd110aaef96dbc + React-FabricImage: 5cbdd587ce4ef74a18d1189a0d668b9de146ff77 React-graphics: a85048af7e210ec4fed185ef201726f7b4825cc0 - React-hermes: fa4837e1d1e55f462ad3e485794056189b495d7e - React-ImageManager: 528eb68fe16f08d4c76cd32949e6bcd9e4aeae4b + React-hermes: 008e4f46da454b583bc4299fcd8cc7efdc6afd33 + React-ImageManager: 57044135702538c0c6c31c9d5502e82002be37c3 React-jsi: ae20bc6ced4999f64acc5163cbfa67f878f346f4 React-jsiexecutor: 754993beb8627912e5b25344cad02ed11a616d9f React-jsinspector: bede0a6ac88f2463eafc1301239fe943adf06fa7 @@ -1321,9 +1359,9 @@ SPEC CHECKSUMS: React-perflogger: c294d51cfc18b90caa1604ef3a0fe2dd76b9e15e React-RCTActionSheet: 943bd5f540f3af1e5a149c13c4de81858edf718a React-RCTAnimation: a430a8c32e7947b7b014f7bd1ef6825168ad4841 - React-RCTAppDelegate: c847ea72bc6fd48b7b6693755c232a3cecbbc970 + React-RCTAppDelegate: b7fe96fbc57165ceec257165301090897868616e React-RCTBlob: 9de0f88a876429c31b96b63975173c60978b5586 - React-RCTFabric: 911e88ea1b9f0b083b1502fb8dabda0a68142d42 + React-RCTFabric: b2a2df1b2a2f1f38a4b57d6f04671389c292266e React-RCTImage: 8addd5fae983149d4506fbf8b36be30585adadf4 React-RCTLinking: aec004e7f55b71be0f68913b1d993964fc8013e1 React-RCTNetwork: 67229afd0642c55d4493cad5129238a7a1599441 @@ -1332,8 +1370,10 @@ SPEC CHECKSUMS: React-RCTTest: d4004e03f9e5ca2607eb05bee5a0618b189a127a React-RCTText: 6d0a9927391dc26325c2edf60ef7d36f637e709c React-RCTVibration: ae65884c71d67f356396d6fcc44eec48b5afef70 + React-rendererdebug: 841615acbabf45cdc7029887f482662272115a7a React-rncore: fe8c75a4beb121d0f923f0a45a17910083ccb681 React-runtimeexecutor: e1c32bc249dd3cf3919cb4664fd8dc84ef70cff7 + React-runtimescheduler: 3f19ac94cc41d5ff1a15a54af9fad2c8e2bcc420 React-utils: 2c3b06a36a63d6fce240ac5cb1de003b95222810 ReactCommon: de6e7a92ad50207b08bcf696a61d9b509876e131 ReactCommon-Samples: 13b7118480fb9abeee8a98bc1cceff06984cfde4 From 1001cf653cfb43c68000994f2e9f8cd9976c912c Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 22 Jun 2023 09:13:25 -0700 Subject: [PATCH 334/468] Pass native stack to ExceptionManager (#37995) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37995 We now have native stack symbols (since D45182122) for TurboModule exceptions, so report those to ExceptionManager so they can end up in the crash reporting pipeline. It will likely not get symbolicated properly yet, but at least we'll have some metadata. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D46893131 fbshipit-source-id: 2b2713ed3af9a366cc43f8ceaef36000834310c7 --- .../Libraries/Core/ExceptionsManager.js | 20 +++++++++++++------ .../Libraries/Core/ExtendedError.js | 12 +++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/packages/react-native/Libraries/Core/ExceptionsManager.js b/packages/react-native/Libraries/Core/ExceptionsManager.js index d1de23cfa023f6..78252549622736 100644 --- a/packages/react-native/Libraries/Core/ExceptionsManager.js +++ b/packages/react-native/Libraries/Core/ExceptionsManager.js @@ -78,6 +78,19 @@ function reportException( message = e.jsEngine == null ? message : `${message}, js engine: ${e.jsEngine}`; + // $FlowFixMe[unclear-type] + const extraData: Object = { + // $FlowFixMe[incompatible-use] we can't define a type with a Symbol-keyed field in flow + ...e[decoratedExtraDataKey], + jsEngine: e.jsEngine, + rawStack: e.stack, + }; + if (e.cause != null && typeof e.cause === 'object') { + extraData.stackSymbols = e.cause.stackSymbols; + extraData.stackReturnAddresses = e.cause.stackReturnAddresses; + extraData.stackElements = e.cause.stackElements; + } + const data = preprocessException({ message, originalMessage: message === originalMessage ? null : originalMessage, @@ -87,12 +100,7 @@ function reportException( stack, id: currentExceptionID, isFatal, - extraData: { - // $FlowFixMe[incompatible-use] we can't define a type with a Symbol-keyed field in flow - ...e[decoratedExtraDataKey], - jsEngine: e.jsEngine, - rawStack: e.stack, - }, + extraData, }); if (reportToConsole) { diff --git a/packages/react-native/Libraries/Core/ExtendedError.js b/packages/react-native/Libraries/Core/ExtendedError.js index 2ff43c88a9c9e7..7ce700eb119699 100644 --- a/packages/react-native/Libraries/Core/ExtendedError.js +++ b/packages/react-native/Libraries/Core/ExtendedError.js @@ -18,4 +18,16 @@ export type ExtendedError = Error & // Note: A field keyed by the Symbol ExceptionsManager.decoratedExtraDataKey is also read from ExtendedErrors. // This field isn't documented in the types as Flow does not support this usecase, but it's effectively: // [decoratedExtraDataKey]?: {[string]: mixed}, + + // Included for native errors + cause?: { + name: string, + message: string, + // $FlowFixMe[unclear-type] + stackElements?: $ReadOnlyArray, + // $FlowFixMe[unclear-type] + stackSymbols?: $ReadOnlyArray, + // $FlowFixMe[unclear-type] + stackReturnAddresses?: $ReadOnlyArray, + }, }; From 4af80b7ed9567e8261cfd97a85c02a4db1b7a13f Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Thu, 22 Jun 2023 09:53:21 -0700 Subject: [PATCH 335/468] Updating Node references in Circle CI (#38003) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38003 Changelog: [General] [Fixed] - Update node version in `prepare_hermes_workspace` Reviewed By: cortinico, NickGerleman Differential Revision: D46905458 fbshipit-source-id: 970c0d2dba8601a8b39176852846aaad94cae24a --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06473be195e75d..5d18f2ec6f1095 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1139,7 +1139,7 @@ jobs: command: | apt update apt install -y wget git curl - curl -sL https://deb.nodesource.com/setup_16.x | bash - + curl -sL https://deb.nodesource.com/setup_18.x | bash - apt install -y nodejs npm install --global yarn - checkout From 43a6ea983126433d3257fafb8f01dff0e96a8c3a Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Thu, 22 Jun 2023 09:53:21 -0700 Subject: [PATCH 336/468] Breaking - Bump minimum Node version from 16 to 18 (#37709) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37709 ## Bump minimum Node JS version to 18 via `react-native/package.json#engines` In https://github.com/facebook/react-native/pull/35443 we bumped up the node version from 16 to 18. Node 16 [ends maintenance releases on 2023-09-11](https://nodejs.org/en/blog/announcements/nodejs16-eol/), and bumping this minimum will allow other associated Node JS tools (CLI, Metro, Jest) to reduce their support burden. This follows up by formally making Node 18 the minimum supported version. **Docs PR:** https://github.com/facebook/react-native-website/pull/3748 **Changelog:** [General][Breaking] Bump minimum Node JS version to 18 Reviewed By: yungsters Differential Revision: D46462639 fbshipit-source-id: d3b607788f596e8b5a9c4a6855d3b2f4bafe9a7a --- packages/react-native/package.json | 2 +- packages/react-native/template/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/package.json b/packages/react-native/package.json index d7fb83ab397cbf..9db53c3e573e91 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -21,7 +21,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" }, "bin": "./cli.js", "types": "types", diff --git a/packages/react-native/template/package.json b/packages/react-native/template/package.json index d98247f43312de..9ddba360bca1fd 100644 --- a/packages/react-native/template/package.json +++ b/packages/react-native/template/package.json @@ -31,6 +31,6 @@ "typescript": "5.0.4" }, "engines": { - "node": ">=16" + "node": ">=18" } } From 2eb25cbdbe8d1ce720ffdf5f5d855e1cbf14142b Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Thu, 22 Jun 2023 09:53:21 -0700 Subject: [PATCH 337/468] Update Node.js to v18 in all RN packages (#37791) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37791 ## Bump minimum Node JS version to 18 via `react-native/package.json#engines` In https://github.com/facebook/react-native/pull/35443 we bumped up the node version from 16 to 18. Node 16 [ends maintenance releases on 2023-09-11](https://nodejs.org/en/blog/announcements/nodejs16-eol/), and bumping this minimum will allow other associated Node JS tools (CLI, Metro, Jest) to reduce their support burden. This follows up by formally making Node 18 the minimum supported version. **Docs PR:** https://github.com/facebook/react-native-website/pull/3748 **Changelog:** [General][Breaking] Bump minimum Node JS version to 18 Reviewed By: cortinico, NickGerleman Differential Revision: D46583997 fbshipit-source-id: 1f31e2f205ac8b09494c2a7d3b73b9f36eff221b --- packages/assets/package.json | 2 +- packages/babel-plugin-codegen/package.json | 2 +- packages/eslint-config-react-native/package.json | 2 +- packages/eslint-plugin-react-native/package.json | 2 +- packages/eslint-plugin-specs/package.json | 2 +- packages/hermes-inspector-msggen/package.json | 2 +- packages/metro-config/package.json | 2 +- packages/normalize-color/package.json | 2 +- packages/polyfills/package.json | 2 +- packages/react-native-bots/package.json | 2 +- packages/react-native-codegen-typescript-test/package.json | 2 +- packages/react-native-codegen/package.json | 2 +- packages/react-native-gradle-plugin/package.json | 2 +- packages/rn-tester/package.json | 2 +- packages/virtualized-lists/package.json | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/assets/package.json b/packages/assets/package.json index cd55b751e227b2..c8e5100a2cc468 100644 --- a/packages/assets/package.json +++ b/packages/assets/package.json @@ -12,6 +12,6 @@ "keywords": ["assets", "registry", "react-native", "support"], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" } } diff --git a/packages/babel-plugin-codegen/package.json b/packages/babel-plugin-codegen/package.json index 3e3edcdb4ba5c6..3d85ab95eba721 100644 --- a/packages/babel-plugin-codegen/package.json +++ b/packages/babel-plugin-codegen/package.json @@ -12,7 +12,7 @@ "keywords": ["babel", "plugin", "codegen", "react-native", "native-modules", "view-manager"], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" }, "files": [ "index.js" diff --git a/packages/eslint-config-react-native/package.json b/packages/eslint-config-react-native/package.json index d32e774fadc947..659c6ef7dec6bd 100644 --- a/packages/eslint-config-react-native/package.json +++ b/packages/eslint-config-react-native/package.json @@ -16,7 +16,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" }, "main": "index.js", "dependencies": { diff --git a/packages/eslint-plugin-react-native/package.json b/packages/eslint-plugin-react-native/package.json index becda76cc32ffc..3b098f81572810 100644 --- a/packages/eslint-plugin-react-native/package.json +++ b/packages/eslint-plugin-react-native/package.json @@ -12,7 +12,7 @@ "keywords": ["eslint", "rules", "eslint-config", "react-native"], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" }, "main": "index.js" } diff --git a/packages/eslint-plugin-specs/package.json b/packages/eslint-plugin-specs/package.json index 8950f82a0ff850..3c5c534e2359ee 100644 --- a/packages/eslint-plugin-specs/package.json +++ b/packages/eslint-plugin-specs/package.json @@ -12,7 +12,7 @@ "keywords": ["eslint", "rules", "react-native", "native-modules", "components", "specs"], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" }, "main": "index.js", "scripts": { diff --git a/packages/hermes-inspector-msggen/package.json b/packages/hermes-inspector-msggen/package.json index bc4611a469301d..d15616cec61f9b 100644 --- a/packages/hermes-inspector-msggen/package.json +++ b/packages/hermes-inspector-msggen/package.json @@ -13,7 +13,7 @@ "msggen": "./bin/index.js" }, "engines": { - "node": ">=16" + "node": ">=18" }, "scripts": { "flow": "flow", diff --git a/packages/metro-config/package.json b/packages/metro-config/package.json index e86d78e60321ab..d43d0295ff48d7 100644 --- a/packages/metro-config/package.json +++ b/packages/metro-config/package.json @@ -12,7 +12,7 @@ "keywords": ["metro", "config", "react-native"], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" }, "exports": "./index.js", "dependencies": { diff --git a/packages/normalize-color/package.json b/packages/normalize-color/package.json index 079c3fe4dabea3..ab3fa6fd89f26a 100644 --- a/packages/normalize-color/package.json +++ b/packages/normalize-color/package.json @@ -12,6 +12,6 @@ "keywords": ["color", "normalization", "normalize-colors", "react-native"], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" } } diff --git a/packages/polyfills/package.json b/packages/polyfills/package.json index de11f640d1be8f..8cefc9909f6b1d 100644 --- a/packages/polyfills/package.json +++ b/packages/polyfills/package.json @@ -12,6 +12,6 @@ "keywords": ["polyfill", "polyfills", "js", "js-polyfills", "react-native"], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" } } diff --git a/packages/react-native-bots/package.json b/packages/react-native-bots/package.json index 5a86115c8a9696..40dfe8c2c18ee0 100644 --- a/packages/react-native-bots/package.json +++ b/packages/react-native-bots/package.json @@ -11,7 +11,7 @@ }, "homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/react-native-bots#readme", "engines": { - "node": ">=16" + "node": ">=18" }, "devDependencies": { "@rnx-kit/rn-changelog-generator": "^0.4.0", diff --git a/packages/react-native-codegen-typescript-test/package.json b/packages/react-native-codegen-typescript-test/package.json index 5c9daf3bb3e0d2..0d8b84f4e5df70 100644 --- a/packages/react-native-codegen-typescript-test/package.json +++ b/packages/react-native-codegen-typescript-test/package.json @@ -10,7 +10,7 @@ }, "homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/react-native-typescript-test", "engines": { - "node": ">=16" + "node": ">=18" }, "scripts": { "build": "yarn clean && node scripts/build.js --verbose && tsc", diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index 5028fea863a207..45f23b160b78d6 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -18,7 +18,7 @@ ], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" }, "scripts": { "build": "yarn clean && node scripts/build.js --verbose", diff --git a/packages/react-native-gradle-plugin/package.json b/packages/react-native-gradle-plugin/package.json index f5eb0fd73a30eb..a1b8f3a2ce7559 100644 --- a/packages/react-native-gradle-plugin/package.json +++ b/packages/react-native-gradle-plugin/package.json @@ -12,7 +12,7 @@ "keywords": ["gradle", "plugin", "react-native"], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" }, "scripts": { "build": "./gradlew build", diff --git a/packages/rn-tester/package.json b/packages/rn-tester/package.json index 009da93bf1bb77..2adbba48dd380c 100644 --- a/packages/rn-tester/package.json +++ b/packages/rn-tester/package.json @@ -10,7 +10,7 @@ "directory": "packages/rn-tester" }, "engines": { - "node": ">=16" + "node": ">=18" }, "scripts": { "start": "react-native start", diff --git a/packages/virtualized-lists/package.json b/packages/virtualized-lists/package.json index e640a73b2b5b88..b2623813a6902a 100644 --- a/packages/virtualized-lists/package.json +++ b/packages/virtualized-lists/package.json @@ -12,7 +12,7 @@ "keywords": ["lists", "virtualized-lists", "section-lists", "react-native"], "bugs": "https://github.com/facebook/react-native/issues", "engines": { - "node": ">=16" + "node": ">=18" }, "dependencies": { "invariant": "^2.2.4", From 1d861f38b4c95f3326a6d0d1217edd38d02d2930 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 09:53:49 -0700 Subject: [PATCH 338/468] translation auto-update for i18n/portal_ar.config.json on master Summary: Chronos Job Instance ID: 1125907904820442 Sandcastle Job Instance ID: 13510799860416949 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46940650 fbshipit-source-id: 8a4e143c4122096b450d6f46103e40bf7868faa2 --- .../res/views/uimanager/values-es/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml index b88dde0a04992a..d674a6459721ef 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-es/strings.xml @@ -3,8 +3,29 @@ + Enlace + Imagen + Botón, Imagen + Encabezado + Alerta + Cuadro combinado + Menú + Barra de menús + Opción del menú + Barra de progreso + Grupo de botones de opción + Barra de desplazamiento + Control de número + Pestaña + Lista de pestañas + Temporizador + Barra de herramientas + Resumen ocupado expandido contraído + no seleccionado + activado + desactivado mixto From 5c7a8e01873f428085f219ebfe2e02d49255618d Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 09:53:49 -0700 Subject: [PATCH 339/468] translation auto-update for i18n/creatorstudio.config.json on master Summary: Chronos Job Instance ID: 1125907904820442 Sandcastle Job Instance ID: 13510799860416949 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46940633 fbshipit-source-id: 04ab452df0f47a8150a52eb6931fb3ab3ee12250 --- .../src/main/res/views/uimanager/values-in/strings.xml | 9 +++++++++ .../src/main/res/views/uimanager/values-nb/strings.xml | 4 ++++ .../src/main/res/views/uimanager/values-ro/strings.xml | 9 +++++++++ 3 files changed, 22 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml index 8f8adf4b0de088..bdc65bbda79bea 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-in/strings.xml @@ -3,11 +3,19 @@ + Tautkan Gambar Tombol, Gambar + Judul Peringatan + Kotak Kombo + Bilah Menu Item Menu + Bilah Progres + Grup Radio Bilah Gulir + Tombol Putar + Daftar Tab Pengatur Waktu Bilah Fitur Ringkasan @@ -15,6 +23,7 @@ diperluas diciutkan batal dipilih + aktif nonaktif campuran diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml index 900e9a239fb400..1f3b2bb439dceb 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml @@ -3,8 +3,12 @@ + Meny + Rotasjonsknapp opptatt utvidet skjult + valgt bort + av blandet diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml index 0237a88fdb67db..635362f30d7a37 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ro/strings.xml @@ -5,16 +5,25 @@ Imagine Buton, imagine + Antet Alertă + Casetă combo Meniu + Bară meniu Element din meniu + Bară de progres + Grup de butoane radio Bară de derulare + Buton de incrementare + Filă + Listă file Bară de instrumente Rezumat ocupat extins restrâns neselectat + activat dezactivat mixt From b1b927629349b42b5af7531b7fb0bce884b57453 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 09:53:49 -0700 Subject: [PATCH 340/468] translation auto-update for i18n/barcelona.config.json on master Summary: Chronos Job Instance ID: 1125907904820442 Sandcastle Job Instance ID: 13510799860416949 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46940635 fbshipit-source-id: 8b04233b04b900a2b0cd8348d5d635a122613f86 --- .../src/main/res/views/uimanager/values-bg/strings.xml | 1 + .../src/main/res/views/uimanager/values-fa/strings.xml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml index 0c9a74b4f26a40..9a80c77c0dd058 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml @@ -7,6 +7,7 @@ Заглавие Сигнал Комбинирана кутия + Меню Лента с менюта Лента за напредък Радио група diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml index 429728fc5d1c48..6119ada8c88f1e 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml @@ -5,11 +5,18 @@ پیوند تصویر + دکمه، تصویر + سر‌صفحه هشدار جعبه گفتگو + منو + مورد منو برگه فهرست برگه + زمان‌سنج خلاصه بزرگ‌شده + لغو انتخاب شد + روشن خاموش From a572608734abc2f7099a11230b547e85df2ec14d Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 09:53:49 -0700 Subject: [PATCH 341/468] translation auto-update for i18n/messenger.config.json on master Summary: Chronos Job Instance ID: 1125907904820442 Sandcastle Job Instance ID: 13510799860416949 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46940632 fbshipit-source-id: e450cc47199642fbb086f28676f0c4a82cfc4d08 --- .../res/views/uimanager/values-pa/strings.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml index 06ddf2bd560542..7cc4e095fa7f2b 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pa/strings.xml @@ -3,8 +3,29 @@ + ਲਿੰਕ + ਚਿੱਤਰ + ਬਟਨ, ਚਿੱਤਰ + ਸਿਰਲੇਖ + ਸੁਚੇਤਨਾ + ਕੋਂਬੋ ਬਾਕਸ + ਮੀਨੂ + ਮੀਨੂ ਬਾਰ + ਮੀਨੂ ਆਈਟਮ + ਪ੍ਰੋਗਰੈੱਸ ਬਾਰ + ਰਡੀਓ ਗਰੁੱਪ + ਸਕ੍ਰੋਲ ਬਾਰ + \'ਘੁੰਮਾਓ\' ਬਟਨ + ਟੈਬ + ਟੈਬ ਸੂਚੀ + ਟਾਈਮਰ + ਟੂਲ ਬਾਰ + ਸਾਰ ਵਿਅਸਤ ਵਿਸਤਾਰ ਕੀਤਾ ਗਿਆ ਸਮੇਟਿਆ ਗਿਆ + ਚੋਣ ਹਟਾਈ ਗਈ + ਚਾਲੂ + ਬੰਦ ਮਿਕਸਡ From 10facdde36218b2f8d07d63874dd225adf9eee9f Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 09:53:49 -0700 Subject: [PATCH 342/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907904820442 Sandcastle Job Instance ID: 13510799860416949 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46940646 fbshipit-source-id: fa9706267b3a0248c2a0ec7ad8a6d34071d23c19 --- .../src/main/res/views/uimanager/values-et/strings.xml | 5 +++++ .../src/main/res/views/uimanager/values-mk/strings.xml | 1 + .../src/main/res/views/uimanager/values-my/strings.xml | 5 +++++ .../src/main/res/views/uimanager/values-si/strings.xml | 6 ++++++ .../src/main/res/views/uimanager/values-sq/strings.xml | 1 + .../src/main/res/views/uimanager/values-uz/strings.xml | 2 ++ 6 files changed, 20 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml index 09a037999775d2..ba66aff65d1d8d 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-et/strings.xml @@ -5,8 +5,11 @@ Pilt Nupp, pilt + Pealkiri Hoiatus Liitboks + Menüü + Menüüriba Menüü-üksus Edenemisriba Raadionuppude grupp @@ -16,10 +19,12 @@ Vahekaartide loend Taimer Tööriistariba + Kokkuvõte hõivatud laiendatud ahendatud valimata + sees väljas miksitud diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml index 5a62600cc41f21..1735389432da8e 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-mk/strings.xml @@ -4,5 +4,6 @@ Копче, слика + вклучено исклучено diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml index de6a7ba3757fcb..c236f93f7e942a 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-my/strings.xml @@ -6,8 +6,11 @@ လင့်ခ် ဓာတ်ပုံ ခလုတ်၊ ဓာတ်ပုံ + ခေါင်းစီး သတိပေးချက် မီနူးတွဲအကွက် + မီနူး + မီနူး ဘားတန်း မီနူး အကြောင်းအရာ ပြီးစီးမှုပြ ဘားတန်း ရေဒီယိုအုပ်စု @@ -17,10 +20,12 @@ တက်ဘ်စာရင်း အချိန်တိုင်းစက် ကိရိယာ ဘားတန်း + အနှစ်ချုပ် အလုပ်များနေပါတယ် ချဲ့ထားပြီး ခေါက်သိမ်းထားပါတယ် မရွေးချယ်ထား + ဖွင့် ပိတ် ရောစပ်ထားပြီး diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml index ddce17d51b188b..5aeb46293d7a4f 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-si/strings.xml @@ -9,6 +9,8 @@ සිරස්තලය ඇඟවීම සංයුක්ත පෙට්ටිය + මෙනුව + මෙනු තීරුව ‍මෙනු අයිතමය ප්‍රගති තීරුව ගුවන්විදුලි සමූහය @@ -17,9 +19,13 @@ ටැබය ටැබ ලැයිස්තුව කාල ගණකය + මෙවලම් තීරුව + සාරාංශය කාර්යබහුලයි විහිදුවන ලදි හකුළන ලදී + තේරීම ඉවත් කරන ලද ක්‍රියාත්මකයි අක්‍රියයි + මිශ්‍ර කළ diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml index 327e8a80b2f802..d92e0774b3d0da 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sq/strings.xml @@ -4,4 +4,5 @@ Buton, imazh + Kuti kombinimi diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uz/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uz/strings.xml index 9d4667fa9877e6..46ab988418d37e 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uz/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-uz/strings.xml @@ -3,4 +3,6 @@ + Rasm + Tugma, rasm From f87577dbc54f64ed058015cfba6160710c4c12f1 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 09:53:49 -0700 Subject: [PATCH 343/468] translation auto-update for i18n/pages-manager.config.json on master Summary: Chronos Job Instance ID: 1125907904820442 Sandcastle Job Instance ID: 13510799860416949 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46940639 fbshipit-source-id: fa3c3685febd710d1364d941637a713ba0d67c40 --- .../src/main/res/views/uimanager/values-pt/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml index 66c8eebe8ccd1d..8682b8162c0e2e 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml @@ -6,6 +6,7 @@ Link Imagem Botão, imagem + Alerta Caixa de combinação Menu Item do menu @@ -13,6 +14,7 @@ Botão para girar Aba Temporizador + Resumo ocupado expandido recolhido From 43602b8185e66de51e7bd6e9de04d9a1ac276ef0 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 09:53:49 -0700 Subject: [PATCH 344/468] translation auto-update for i18n/anna.config.json on master Summary: Chronos Job Instance ID: 1125907904820442 Sandcastle Job Instance ID: 13510799860416949 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46940647 fbshipit-source-id: dac7416563336629fcfe0a0f41c8f2b27b518d48 --- .../src/main/res/views/uimanager/values-pt/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml index 8682b8162c0e2e..0a2259724131fe 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml @@ -11,9 +11,13 @@ Menu Item do menu Barra de progresso + Botão de grupo de opções + Barra de rolamento Botão para girar Aba + Lista de abas Temporizador + Barra de ferramentas Resumo ocupado expandido From 0201e51bbe46219458f01cf5bfe67840bdde8d33 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 09:53:49 -0700 Subject: [PATCH 345/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907904820442 Sandcastle Job Instance ID: 13510799860416949 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46940637 fbshipit-source-id: 4395bfa1b14062447ad2cf7533bafd9686ef6822 --- .../src/main/res/views/uimanager/values-fa/strings.xml | 9 +++++++++ .../src/main/res/views/uimanager/values-sr/strings.xml | 2 ++ 2 files changed, 11 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml index 6119ada8c88f1e..e669a7bb65afd9 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-fa/strings.xml @@ -10,13 +10,22 @@ هشدار جعبه گفتگو منو + نوار منو مورد منو + نوار پیشرفت + گروه رادیویی + نوار پیمایش + دکمه چرخش برگه فهرست برگه زمان‌سنج + نوار ابزار خلاصه + مشغول بزرگ‌شده + کوچک‌شده لغو انتخاب شد روشن خاموش + ترکیب‌شده diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml index 656eb026405d41..d834e8e354b372 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml @@ -9,6 +9,7 @@ Заглавље Обавештење Комбиновано поље + Мени Трака са напретком Група за радио Картица @@ -18,6 +19,7 @@ заузето проширено скупљено + укључено искључено мешано From 0a9284a24216213dca9f7058b2787e5f8d699e3f Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Thu, 22 Jun 2023 15:44:03 -0700 Subject: [PATCH 346/468] Fix UnsupportedOperationException Summary: This would cause an UnsupportedOperationException in java and thus result in a white screen. The root cause is that ```mDelegate.getReactPackages()``` returns a non-resizable list so we wrap it to a resizable list in this diff. Created from CodeHub with https://fburl.com/edit-in-codehub Reviewed By: cortinico, adanoff Differential Revision: D46943066 fbshipit-source-id: 27fcb78610aea0c8cb98d6ead4d0e1603a767e6e --- .../main/java/com/facebook/react/bridgeless/ReactInstance.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java index 7f5c3acf492a37..35844a01e36c63 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java @@ -189,7 +189,7 @@ public void onHostDestroy() { Systrace.beginSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactInstance.initialize#initTurboModules"); - mReactPackages = mDelegate.getReactPackages(); + mReactPackages = new ArrayList<>(mDelegate.getReactPackages()); mReactPackages.add( new BridgelessReactPackage( bridgelessReactContext.getDevSupportManager(), From 95847fcd7e10697d43f085f67e311ae5d955eea0 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Thu, 22 Jun 2023 16:38:28 -0700 Subject: [PATCH 347/468] Initialize "rninstance" at ReactInstance class loading time (#38026) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38026 In this diff I'm moving the initialization of "rninstance" so as soon as the class is loaded The goal is to ensure so is loaded earlier and prevent issues like T156403678 changelog: [internal] internal Reviewed By: luluwu2032 Differential Revision: D46945464 fbshipit-source-id: f4d68574030ca3bda5d55fe3a9c1630a4879f3ab --- .../java/com/facebook/react/bridgeless/ReactInstance.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java index 35844a01e36c63..44d3fb724b405f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java @@ -88,6 +88,10 @@ final class ReactInstance { @DoNotStrip @Nullable private ComponentNameResolverManager mComponentNameResolverManager; + static { + loadLibraryIfNeeded(); + } + private static volatile boolean sIsLibraryLoaded; /* package */ ReactInstance( @@ -100,7 +104,6 @@ final class ReactInstance { boolean useDevSupport) { mBridgelessReactContext = bridgelessReactContext; mDelegate = delegate; - loadLibraryIfNeeded(); Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactInstance.initialize"); From 79e8474b14e118daa0f6e525d6546892a09a09a3 Mon Sep 17 00:00:00 2001 From: g4rb4g3 Date: Thu, 22 Jun 2023 17:19:40 -0700 Subject: [PATCH 348/468] fix: int cast can cause endless loop if value < 1 (#38016) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: I faced an issue that on Android the whole UI would freeze when using minimumFontScale. This is caused by an int cast that turns the while loop into an endless loop. Also the docs are not correct since they say it is an iOS only prop. https://reactnative.dev/docs/text#minimumfontscale-ios ## Changelog: [ANDROID] [FIXED] - UI freezing when using minimumFontScale Pull Request resolved: https://github.com/facebook/react-native/pull/38016 Test Plan: Run this sample app with and without this fix. https://github.com/g4rb4g3/androidMinimumFontScaleBug Without the ui will freeze when hitting the + button, with the fix a Text component will be shown and no freeze will happen. 🙂 Reviewed By: cipolleschi Differential Revision: D46931439 Pulled By: NickGerleman fbshipit-source-id: 6985443b3424539b40bc0081fe742ab59105a2ae --- packages/react-native/Libraries/Text/Text.d.ts | 10 +++++----- .../facebook/react/views/text/ReactTextShadowNode.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/react-native/Libraries/Text/Text.d.ts b/packages/react-native/Libraries/Text/Text.d.ts index bee0c632372ea0..b90bf240ba72d9 100644 --- a/packages/react-native/Libraries/Text/Text.d.ts +++ b/packages/react-native/Libraries/Text/Text.d.ts @@ -43,11 +43,6 @@ export interface TextPropsIOS { | 'largeTitle' | undefined; - /** - * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0). - */ - minimumFontScale?: number | undefined; - /** * When `true`, no visual change is made when text is pressed down. By * default, a gray oval highlights the text on press down. @@ -209,6 +204,11 @@ export interface TextProps * - >= 1: sets the maxFontSizeMultiplier of this node to this value */ maxFontSizeMultiplier?: number | null | undefined; + + /** + * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0). + */ + minimumFontScale?: number | undefined; } /** diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java index b69452d9384fcf..a66950c7966af6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java @@ -87,7 +87,7 @@ public long measure( // TODO: We could probably use a smarter algorithm here. This will require 0(n) // measurements // based on the number of points the font size needs to be reduced by. - currentFontSize = currentFontSize - (int) PixelUtil.toPixelFromDIP(1); + currentFontSize -= Math.max(1, (int) PixelUtil.toPixelFromDIP(1)); float ratio = (float) currentFontSize / (float) initialFontSize; ReactAbsoluteSizeSpan[] sizeSpans = From 1f8eb1de587a2f678946e93dcbe2f2ddfc40df34 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 18:08:55 -0700 Subject: [PATCH 349/468] translation auto-update for i18n/messenger.config.json on master Summary: Chronos Job Instance ID: 1125907905026809 Sandcastle Job Instance ID: 9007200231768659 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46959274 fbshipit-source-id: a98311c9026999808fe4fb365595a71959d45615 --- .../res/views/uimanager/values-hr/strings.xml | 21 +++++++++++++++++++ .../res/views/uimanager/values-pt/strings.xml | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml index 3630a6b4a56717..d2d2419b247b82 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-hr/strings.xml @@ -3,8 +3,29 @@ + Veza + Slika + Gumb, slika + Zaglavlje + Upozorenje + Kombinirani okvir + Izbornik + Traka izbornika + Stavka izbornika + Traka napretka + Grupa izbornih gumba + Traka za pomicanje + Gumb za vrtnju + Kartica + Popis kartica + Mjerač vremena + Traka s alatima + Sažetak zauzeto prošireno sažeto + poništen odabir + uključeno + isključeno mješovito diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml index 0a2259724131fe..af0cd558636969 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml @@ -6,9 +6,11 @@ Link Imagem Botão, imagem + Título Alerta Caixa de combinação Menu + Barra do menu Item do menu Barra de progresso Botão de grupo de opções @@ -22,5 +24,8 @@ ocupado expandido recolhido + desmarcados + ativado + desativado mesclado From 79e9e569392998048bed6b5088a59af5bfaef567 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 18:08:55 -0700 Subject: [PATCH 350/468] translation auto-update for i18n/instagram.config.json on master Summary: Chronos Job Instance ID: 1125907905026809 Sandcastle Job Instance ID: 9007200231768659 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46959284 fbshipit-source-id: a22f30e57eef3708a265992df1dde6ff0985759a --- .../res/views/uimanager/values-bg/strings.xml | 6 ++++++ .../res/views/uimanager/values-nb/strings.xml | 17 +++++++++++++++++ .../res/views/uimanager/values-sr/strings.xml | 6 ++++++ 3 files changed, 29 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml index 9a80c77c0dd058..a50ed8236cf755 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-bg/strings.xml @@ -3,18 +3,24 @@ + Връзка + Изображение Бутон, изображение Заглавие Сигнал Комбинирана кутия Меню Лента с менюта + Елемент от меню Лента за напредък Радио група Лента за превъртане Бутон за завъртане + Раздел + Списък с раздели Таймер Лента с инструменти + Обобщение заето разширено свито diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml index 1f3b2bb439dceb..edb1a1e7b20a79 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-nb/strings.xml @@ -3,12 +3,29 @@ + Lenke + Bilde + Knapp, bilde + Overskrift + Varsel + Kombinasjonsboks Meny + Menyfelt + Menyelement + Fremdriftslinje + Radiogruppe + Rullelinje Rotasjonsknapp + Fane + Faneliste + Tidsur + Verktøylinje + Sammendrag opptatt utvidet skjult valgt bort + av blandet diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml index d834e8e354b372..28d6ea337cbda8 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-sr/strings.xml @@ -10,15 +10,21 @@ Обавештење Комбиновано поље Мени + Трака са менијем + Ставка из менија Трака са напретком Група за радио + Трака за померање + Дугме за окретање Картица Листа картица Тајмер + Трака са алаткама Резиме заузето проширено скупљено + избор опозван укључено искључено мешано From 90563967d64427f5df78e3c1a83384dafdecca7e Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 18:08:55 -0700 Subject: [PATCH 351/468] translation auto-update for i18n/pages-manager.config.json on master Summary: Chronos Job Instance ID: 1125907905026809 Sandcastle Job Instance ID: 9007200231768659 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46959285 fbshipit-source-id: b71267bcd6b1ca8e2ebaaf3fc42391b4bf8406a3 --- .../src/main/res/views/uimanager/values-pt/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml index af0cd558636969..c2d412d12898c5 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-pt/strings.xml @@ -15,7 +15,7 @@ Barra de progresso Botão de grupo de opções Barra de rolamento - Botão para girar + Botão de rotação Aba Lista de abas Temporizador From 5f18d7f9932d6405b50434ca80a7b13cc27c2431 Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 18:08:55 -0700 Subject: [PATCH 352/468] translation auto-update for i18n/anna.config.json on master Summary: Chronos Job Instance ID: 1125907905026809 Sandcastle Job Instance ID: 9007200231768659 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46959269 fbshipit-source-id: 8cba4ed298805285ed0ece857eec08c9d7a704a3 --- .../res/views/uimanager/values-ha/strings.xml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ha/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ha/strings.xml index 084b1b6aac0de0..c365404fe61418 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ha/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ha/strings.xml @@ -3,4 +3,29 @@ + Kafa + Hoto + Madanni, Hoto + Kanu + Bayanan Ankararwa + Jerin Akwain Zaɓi ko Shigar da Rubutu + Mazaɓa + Bar Na Mazaɓa + Mazaɓar abu + Bar Na Nuna Ci Gaba + Rukunin Rediyo + Bar Na Jirgawa + Madanni Ƙarawa ko Rage Kima + Madannin shiga gurbi + Jerin Madannin Shiga Gurbi + Na\'urar sarrafa lokaci + Bar Na Kayan Aiki + Taƙaitawa + aiki + an faɗaɗa + rusasshe + wanda ba a zaɓa ba + kunna + kashe + gauraye From 7e934947d752d1f49a8d848209a7aaf02cdb700b Mon Sep 17 00:00:00 2001 From: Intl Scheduler <> Date: Thu, 22 Jun 2023 18:08:55 -0700 Subject: [PATCH 353/468] translation auto-update for i18n/fb4a.config.json on master Summary: Chronos Job Instance ID: 1125907905026809 Sandcastle Job Instance ID: 9007200231768659 allow-large-files ignore-conflict-markers opt-out-review Differential Revision: D46959288 fbshipit-source-id: 6d3e6c9a40a99847babddf1264a17cf332eb51eb --- .../res/views/uimanager/values-km/strings.xml | 3 +++ .../res/views/uimanager/values-lt/strings.xml | 15 +++++++++++++++ .../res/views/uimanager/values-lv/strings.xml | 6 ++++++ .../res/views/uimanager/values-ur/strings.xml | 7 +++++++ 4 files changed, 31 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml index 97888b8ff6af0b..a35cca14c5fabe 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-km/strings.xml @@ -4,7 +4,10 @@ តំណ + របារ​ដំណើរការ របាររំកិល + របារ​ឧបករណ៍ បានពង្រីក + បានបង្រួម បិទ diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml index fccf449c4d836d..efaddc081b6745 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lt/strings.xml @@ -3,11 +3,26 @@ + Nuoroda + Vaizdas Mygtukas, vaizdas Įspėjimas Sudėtinis laukelis + Meniu elementas + Eigos juosta Akučių grupė + Slinkimo juosta + Sukimo mygtukas + Skirtukas + Skirtukų sąrašas Laikmatis + Įrankių juosta + Suvestinė + naudojama + išskleista sutraukta + pasirinkimas atšauktas + įjungta išjungta + mišrus diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml index 7ae695b2a9faf3..159c77173d3930 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-lv/strings.xml @@ -3,5 +3,11 @@ + Saite + Attēls + Poga, attēls + Rīkjosla sakļauts + ieslēgts + izslēgts diff --git a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml index 4bb15414f464ef..3e5925de815a61 100644 --- a/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml +++ b/packages/react-native/ReactAndroid/src/main/res/views/uimanager/values-ur/strings.xml @@ -6,19 +6,26 @@ لنک تصویر بٹن، تصویر + سرخی الرٹ کومبو باکس + مینیو + مینو بار مینیو آئٹم پیشرفت کی بار ریڈیو گروپ سکرول بار گھمانے کا بٹن + ٹیب ٹیب کی لسٹ ٹائمر ٹول بار + خلاصہ مصروف توسیع کیا گیا سکیڑا گیا + غیر منتخب کردہ + آن ہے آف ہے امتزاج From c54092fe3bf44cc15ea6ef0d281bc55aec9f1011 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Fri, 23 Jun 2023 02:31:39 -0700 Subject: [PATCH 354/468] Update NativeAnimatedNodeTraversalTest to be more idiomatic (#37970) Summary: Follow up to: - https://github.com/facebook/react-native/pull/37960 ## Changelog: [INTERNAL] - Update NativeAnimatedNodeTraversalTest to be more idiomatic Pull Request resolved: https://github.com/facebook/react-native/pull/37970 Test Plan: Will run on CI Reviewed By: javache, cipolleschi Differential Revision: D46853581 Pulled By: cortinico fbshipit-source-id: 73776493163413b045482344b7b1be0635f5aa25 --- .../NativeAnimatedNodeTraversalTest.kt | 208 +++++++++--------- 1 file changed, 105 insertions(+), 103 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.kt index c8ecdb3bb8d751..b447213b131452 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/animated/NativeAnimatedNodeTraversalTest.kt @@ -7,6 +7,7 @@ package com.facebook.react.animated +import android.annotation.SuppressLint import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.Callback import com.facebook.react.bridge.CatalystInstance @@ -21,6 +22,7 @@ import com.facebook.react.uimanager.events.Event import com.facebook.react.uimanager.events.EventDispatcher import com.facebook.react.uimanager.events.RCTEventEmitter import kotlin.collections.Map +import kotlin.math.abs import org.assertj.core.api.Assertions.assertThat import org.junit.Before import org.junit.Rule @@ -50,11 +52,6 @@ import org.robolectric.RobolectricTestRunner class NativeAnimatedNodeTraversalTest { @get:Rule var rule = PowerMockRule() - companion object { - private val FRAME_LEN_NANOS: Long = 1000000000L / 60L - private val INITIAL_FRAME_TIME_NANOS: Long = 14599233201256L /* random */ - } - private var frameTimeNanos: Long = 0L private lateinit var reactApplicationContextMock: ReactApplicationContext private lateinit var catalystInstanceMock: CatalystInstance @@ -78,7 +75,7 @@ class NativeAnimatedNodeTraversalTest { reactApplicationContextMock = mock(ReactApplicationContext::class.java) whenever(reactApplicationContextMock.hasActiveReactInstance()).thenAnswer { true } whenever(reactApplicationContextMock.hasCatalystInstance()).thenAnswer { true } - whenever(reactApplicationContextMock.getCatalystInstance()).thenAnswer { catalystInstanceMock } + whenever(reactApplicationContextMock.catalystInstance).thenAnswer { catalystInstanceMock } whenever(reactApplicationContextMock.getNativeModule(UIManagerModule::class.java)).thenAnswer { uiManagerMock } @@ -93,21 +90,19 @@ class NativeAnimatedNodeTraversalTest { uiManagerMock = mock(UIManagerModule::class.java) eventDispatcherMock = mock(EventDispatcher::class.java) - whenever(uiManagerMock.getEventDispatcher()).thenAnswer { eventDispatcherMock } - whenever(uiManagerMock.getConstants()).thenAnswer { + whenever(uiManagerMock.eventDispatcher).thenAnswer { eventDispatcherMock } + whenever(uiManagerMock.constants).thenAnswer { MapBuilder.of("customDirectEventTypes", MapBuilder.newHashMap()) } - whenever(uiManagerMock.getDirectEventNamesResolver()).thenAnswer { + whenever(uiManagerMock.directEventNamesResolver).thenAnswer { object : UIManagerModule.CustomEventNamesResolver { override fun resolveCustomEventName(eventName: String): String { - val directEventTypes: Map>? = - uiManagerMock?.constants?.get("customDirectEventTypes") - as? Map>? - if (directEventTypes != null) { - val customEventType: Map? = - directEventTypes[eventName] as? Map? - if (customEventType != null) { - return customEventType["registrationName"] ?: eventName + val constants: Map = uiManagerMock.constants ?: emptyMap() + val directEventTypes: Any? = constants["customDirectEventTypes"] + if (directEventTypes != null && directEventTypes is Map<*, *>) { + val customEventType = directEventTypes[eventName] + if (customEventType != null && customEventType is Map<*, *>) { + return customEventType["registrationName"] as? String ?: eventName } } return eventName @@ -129,7 +124,8 @@ class NativeAnimatedNodeTraversalTest { *

Nodes are connected as follows (nodes IDs in parens): ValueNode(1) -> StyleNode(2) -> * PropNode(3) */ - private fun createSimpleAnimatedViewWithOpacity(viewTag: Int, opacity: Double) { + private fun createSimpleAnimatedViewWithOpacity(viewTag: Int = 1000) { + val opacity = 0.0 nativeAnimatedNodesManager.createAnimatedNode( 1, JavaOnlyMap.of("type", "value", "value", opacity, "offset", 0.0)) nativeAnimatedNodesManager.createAnimatedNode( @@ -143,7 +139,7 @@ class NativeAnimatedNodeTraversalTest { @Test fun testFramesAnimation() { - createSimpleAnimatedViewWithOpacity(1000, 0.0) + createSimpleAnimatedViewWithOpacity() val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) @@ -157,7 +153,7 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(frames.getDouble(i)) + assertThat(stylesCaptor.value.getDouble("opacity")).isEqualTo(frames.getDouble(i)) } reset(uiManagerMock) @@ -167,7 +163,7 @@ class NativeAnimatedNodeTraversalTest { @Test fun testFramesAnimationLoopsFiveTimes() { - createSimpleAnimatedViewWithOpacity(1000, 0.0) + createSimpleAnimatedViewWithOpacity() val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) val animationCallback: Callback = mock(Callback::class.java) @@ -184,7 +180,7 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(frames.getDouble(i)) + assertThat(stylesCaptor.value.getDouble("opacity")).isEqualTo(frames.getDouble(i)) } } @@ -197,7 +193,7 @@ class NativeAnimatedNodeTraversalTest { fun testNodeValueListenerIfNotListening() { val nodeId: Int = 1 - createSimpleAnimatedViewWithOpacity(1000, 0.0) + createSimpleAnimatedViewWithOpacity() val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) val animationCallback: Callback = mock(Callback::class.java) @@ -224,7 +220,7 @@ class NativeAnimatedNodeTraversalTest { fun testNodeValueListenerIfListening() { val nodeId: Int = 1 - createSimpleAnimatedViewWithOpacity(1000, 0.0) + createSimpleAnimatedViewWithOpacity() val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) val animationCallback: Callback = mock(Callback::class.java) @@ -248,8 +244,11 @@ class NativeAnimatedNodeTraversalTest { verifyNoMoreInteractions(valueListener) } - fun performSpringAnimationTestWithConfig(config: JavaOnlyMap?, testForCriticallyDamped: Boolean) { - createSimpleAnimatedViewWithOpacity(1000, 0.0) + private fun performSpringAnimationTestWithConfig( + config: JavaOnlyMap?, + testForCriticallyDamped: Boolean + ) { + createSimpleAnimatedViewWithOpacity() val animationCallback: Callback = mock(Callback::class.java) @@ -260,7 +259,7 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0.0) + assertThat(stylesCaptor.value.getDouble("opacity")).isEqualTo(0.0) var previousValue: Double = 0.0 var wasGreaterThanOne: Boolean = false @@ -271,12 +270,12 @@ class NativeAnimatedNodeTraversalTest { nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock, atMost(1)) .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - val currentValue: Double = stylesCaptor.getValue().getDouble("opacity") + val currentValue: Double = stylesCaptor.value.getDouble("opacity") if (currentValue > 1.0) { wasGreaterThanOne = true } // verify that animation step is relatively small - assertThat(java.lang.Math.abs(currentValue - previousValue)).isLessThan(0.12) + assertThat(abs(currentValue - previousValue)).isLessThan(0.12) previousValue = currentValue } // verify that we've reach the final value at the end of animation @@ -284,9 +283,9 @@ class NativeAnimatedNodeTraversalTest { // verify that value has reached some maximum value that is greater than the final value // (bounce) if (testForCriticallyDamped) { - assertThat(!wasGreaterThanOne) + assertThat(!wasGreaterThanOne).isTrue } else { - assertThat(wasGreaterThanOne) + assertThat(wasGreaterThanOne).isTrue } reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) @@ -345,7 +344,7 @@ class NativeAnimatedNodeTraversalTest { @Test fun testSpringAnimationLoopsFiveTimes() { - createSimpleAnimatedViewWithOpacity(1000, 0.0) + createSimpleAnimatedViewWithOpacity() val animationCallback: Callback = mock(Callback::class.java) nativeAnimatedNodesManager.startAnimatingNode( @@ -379,7 +378,7 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0.0) + assertThat(stylesCaptor.value.getDouble("opacity")).isEqualTo(0.0) var previousValue: Double = 0.0 var wasGreaterThanOne: Boolean = false @@ -391,31 +390,30 @@ class NativeAnimatedNodeTraversalTest { nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock, atMost(1)) .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - val currentValue: Double = stylesCaptor.getValue().getDouble("opacity") + val currentValue: Double = stylesCaptor.value.getDouble("opacity") if (currentValue > 1.0) { wasGreaterThanOne = true } // Test to see if it reset after coming to rest if (didComeToRest && currentValue == 0.0 && - Math.abs(Math.abs(currentValue - previousValue) - 1.0) < 0.001) { + abs(abs(currentValue - previousValue) - 1.0) < 0.001) { numberOfResets++ } // verify that an animation step is relatively small, unless it has come to rest and // reset - if (!didComeToRest) assertThat(Math.abs(currentValue - previousValue)).isLessThan(0.12) + if (!didComeToRest) assertThat(abs(currentValue - previousValue)).isLessThan(0.12) // record that the animation did come to rest when it rests on toValue - didComeToRest = - Math.abs(currentValue - 1.0) < 0.001 && Math.abs(currentValue - previousValue) < 0.001 + didComeToRest = abs(currentValue - 1.0) < 0.001 && abs(currentValue - previousValue) < 0.001 previousValue = currentValue } // verify that we've reach the final value at the end of animation assertThat(previousValue).isEqualTo(1.0) // verify that value has reached some maximum value that is greater than the final value // (bounce) - assertThat(wasGreaterThanOne) + assertThat(wasGreaterThanOne).isTrue // verify that value reset 4 times after finishing a full animation assertThat(numberOfResets).isEqualTo(4) reset(uiManagerMock) @@ -425,7 +423,7 @@ class NativeAnimatedNodeTraversalTest { @Test fun testDecayAnimation() { - createSimpleAnimatedViewWithOpacity(1000, 0.0) + createSimpleAnimatedViewWithOpacity() val animationCallback: Callback = mock(Callback::class.java) nativeAnimatedNodesManager.startAnimatingNode( @@ -440,7 +438,7 @@ class NativeAnimatedNodeTraversalTest { nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock, atMost(1)) .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - var previousValue: Double = stylesCaptor.getValue().getDouble("opacity") + var previousValue: Double = stylesCaptor.value.getDouble("opacity") var previousDiff: Double = Double.POSITIVE_INFINITY /* run 3 secs of animation */ for (i in 0 until 3 * 60) { @@ -448,20 +446,20 @@ class NativeAnimatedNodeTraversalTest { nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock, atMost(1)) .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - val currentValue: Double = stylesCaptor.getValue().getDouble("opacity") + val currentValue: Double = stylesCaptor.value.getDouble("opacity") val currentDiff: Double = currentValue - previousValue // verify monotonicity // greater *or equal* because the animation stops during these 3 seconds - assertThat(currentValue).`as`("on frame " + i).isGreaterThanOrEqualTo(previousValue) + assertThat(currentValue).describedAs("on frame $i").isGreaterThanOrEqualTo(previousValue) // verify decay if (i > 3) { // i > 3 because that's how long it takes to settle previousDiff if (i % 3 != 0) { // i % 3 != 0 because every 3 frames we go a tiny // bit faster, because frame length is 16.(6)ms - assertThat(currentDiff).`as`("on frame " + i).isLessThanOrEqualTo(previousDiff) + assertThat(currentDiff).describedAs("on frame $i").isLessThanOrEqualTo(previousDiff) } else { - assertThat(currentDiff).`as`("on frame " + i).isGreaterThanOrEqualTo(previousDiff) + assertThat(currentDiff).describedAs("on frame $i").isGreaterThanOrEqualTo(previousDiff) } } previousValue = currentValue @@ -475,7 +473,7 @@ class NativeAnimatedNodeTraversalTest { @Test fun testDecayAnimationLoopsFiveTimes() { - createSimpleAnimatedViewWithOpacity(1000, 0.0) + createSimpleAnimatedViewWithOpacity() val animationCallback: Callback = mock(Callback::class.java) nativeAnimatedNodesManager.startAnimatingNode( @@ -490,8 +488,8 @@ class NativeAnimatedNodeTraversalTest { nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock, atMost(1)) .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - var previousValue: Double = stylesCaptor.getValue().getDouble("opacity") - val initialValue: Double = stylesCaptor.getValue().getDouble("opacity") + var previousValue: Double = stylesCaptor.value.getDouble("opacity") + val initialValue: Double = stylesCaptor.value.getDouble("opacity") var didComeToRest: Boolean = false var numberOfResets: Int = 0 /* run 3 secs of animation, five times */ @@ -500,7 +498,7 @@ class NativeAnimatedNodeTraversalTest { nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock, atMost(1)) .synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - val currentValue: Double = stylesCaptor.getValue().getDouble("opacity") + val currentValue: Double = stylesCaptor.value.getDouble("opacity") val currentDiff: Double = currentValue - previousValue // Test to see if it reset after coming to rest (i.e. dropped back to ) if (didComeToRest && currentValue == initialValue) { @@ -510,11 +508,11 @@ class NativeAnimatedNodeTraversalTest { // verify monotonicity, unless it has come to rest and reset // greater *or equal* because the animation stops during these 3 seconds if (!didComeToRest) { - assertThat(currentValue).`as`("on frame " + i).isGreaterThanOrEqualTo(previousValue) + assertThat(currentValue).describedAs("on frame $i").isGreaterThanOrEqualTo(previousValue) } // Test if animation has come to rest using the 0.1 threshold from DecayAnimation.java - didComeToRest = Math.abs(currentDiff) < 0.1 + didComeToRest = abs(currentDiff) < 0.1 previousValue = currentValue } @@ -527,7 +525,7 @@ class NativeAnimatedNodeTraversalTest { @Test fun testAnimationCallbackFinish() { - createSimpleAnimatedViewWithOpacity(1000, 0.0) + createSimpleAnimatedViewWithOpacity() val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 1.0) val animationCallback: Callback = mock(Callback::class.java) @@ -545,8 +543,8 @@ class NativeAnimatedNodeTraversalTest { nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(animationCallback).invoke(callbackResponseCaptor.capture()) - assertThat(callbackResponseCaptor.getValue().hasKey("finished")).isTrue() - assertThat(callbackResponseCaptor.getValue().getBoolean("finished")).isTrue() + assertThat(callbackResponseCaptor.value.hasKey("finished")).isTrue + assertThat(callbackResponseCaptor.value.getBoolean("finished")).isTrue reset(animationCallback) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) @@ -560,9 +558,9 @@ class NativeAnimatedNodeTraversalTest { *

Add(3) node maps to a "translateX" attribute of the Style(4) node. */ private fun createAnimatedGraphWithAdditionNode( - viewTag: Int, - firstValue: Double, - secondValue: Double + viewTag: Int = 50, + firstValue: Double = 100.0, + secondValue: Double = 1000.0 ) { nativeAnimatedNodesManager.createAnimatedNode( 1, JavaOnlyMap.of("type", "value", "value", firstValue, "offset", 0.0)) @@ -585,7 +583,7 @@ class NativeAnimatedNodeTraversalTest { @Test fun testAdditionNode() { - createAnimatedGraphWithAdditionNode(50, 100.0, 1000.0) + createAnimatedGraphWithAdditionNode() val animationCallback: Callback = mock(Callback::class.java) val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 1.0) @@ -606,12 +604,12 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1100.0) + assertThat(stylesCaptor.value.getDouble("translateX")).isEqualTo(1100.0) reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1111.0) + assertThat(stylesCaptor.value.getDouble("translateX")).isEqualTo(1111.0) reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) @@ -627,7 +625,7 @@ class NativeAnimatedNodeTraversalTest { */ @Test fun testViewReceiveUpdatesIfOneOfAnimationHasntStarted() { - createAnimatedGraphWithAdditionNode(50, 100.0, 1000.0) + createAnimatedGraphWithAdditionNode() // Start animating only the first addition input node val animationCallback: Callback = mock(Callback::class.java) @@ -643,12 +641,12 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1100.0) + assertThat(stylesCaptor.value.getDouble("translateX")).isEqualTo(1100.0) reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1101.0) + assertThat(stylesCaptor.value.getDouble("translateX")).isEqualTo(1101.0) reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) @@ -665,7 +663,7 @@ class NativeAnimatedNodeTraversalTest { */ @Test fun testViewReceiveUpdatesWhenOneOfAnimationHasFinished() { - createAnimatedGraphWithAdditionNode(50, 100.0, 1000.0) + createAnimatedGraphWithAdditionNode() val animationCallback: Callback = mock(Callback::class.java) @@ -690,13 +688,13 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(1100.0) + assertThat(stylesCaptor.value.getDouble("translateX")).isEqualTo(1100.0) for (i in 1 until secondFrames.size()) { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")) + assertThat(stylesCaptor.value.getDouble("translateX")) .isEqualTo(1200.0 + secondFrames.getDouble(i) * 10.0) } @@ -741,12 +739,12 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(5.0) + assertThat(stylesCaptor.value.getDouble("translateX")).isEqualTo(5.0) reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(20.0) + assertThat(stylesCaptor.value.getDouble("translateX")).isEqualTo(20.0) reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) @@ -760,7 +758,7 @@ class NativeAnimatedNodeTraversalTest { */ @Test fun testHandleStoppingAnimation() { - createSimpleAnimatedViewWithOpacity(1000, 0.0) + createSimpleAnimatedViewWithOpacity() val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) val animationCallback: Callback = mock(Callback::class.java) @@ -788,14 +786,13 @@ class NativeAnimatedNodeTraversalTest { verifyNoMoreInteractions(animationCallback) verifyNoMoreInteractions(uiManagerMock) - assertThat(callbackResponseCaptor.getValue().hasKey("finished")).isTrue() - assertThat(callbackResponseCaptor.getValue().getBoolean("finished")).isFalse() + assertThat(callbackResponseCaptor.value.hasKey("finished")).isTrue + assertThat(callbackResponseCaptor.value.getBoolean("finished")).isFalse reset(animationCallback) reset(uiManagerMock) // Run "update" loop a few more times -> we expect no further updates nor callback calls to - // be - // triggered + // be triggered for (i in 0 until 5) { nativeAnimatedNodesManager.runUpdates(nextFrameTime()) } @@ -859,7 +856,7 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(frames.getDouble(i)) + assertThat(stylesCaptor.value.getDouble("opacity")).isEqualTo(frames.getDouble(i)) } reset(uiManagerMock) @@ -886,7 +883,7 @@ class NativeAnimatedNodeTraversalTest { fun testNativeAnimatedEventDoUpdate() { val viewTag: Int = 1000 - createSimpleAnimatedViewWithOpacity(viewTag, 0.0) + createSimpleAnimatedViewWithOpacity(viewTag) nativeAnimatedNodesManager.addAnimatedEventToView( viewTag, @@ -901,14 +898,14 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(10.0) + assertThat(stylesCaptor.value.getDouble("opacity")).isEqualTo(10.0) } @Test fun testNativeAnimatedEventDoNotUpdate() { val viewTag: Int = 1000 - createSimpleAnimatedViewWithOpacity(viewTag, 0.0) + createSimpleAnimatedViewWithOpacity() nativeAnimatedNodesManager.addAnimatedEventToView( viewTag, @@ -929,14 +926,14 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0.0) + assertThat(stylesCaptor.value.getDouble("opacity")).isEqualTo(0.0) } @Test fun testNativeAnimatedEventCustomMapping() { val viewTag: Int = 1000 - whenever(uiManagerMock.getConstants()).thenAnswer { + whenever(uiManagerMock.constants).thenAnswer { MapBuilder.of( "customDirectEventTypes", MapBuilder.of("onScroll", MapBuilder.of("registrationName", "onScroll"))) @@ -944,7 +941,7 @@ class NativeAnimatedNodeTraversalTest { nativeAnimatedNodesManager = NativeAnimatedNodesManager(reactApplicationContextMock) - createSimpleAnimatedViewWithOpacity(viewTag, 0.0) + createSimpleAnimatedViewWithOpacity() nativeAnimatedNodesManager.addAnimatedEventToView( viewTag, @@ -959,9 +956,10 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(10.0) + assertThat(stylesCaptor.value.getDouble("opacity")).isEqualTo(10.0) } + @SuppressLint("CheckResult") @Test fun testRestoreDefaultProps() { val viewTag: Int = 1001 @@ -990,12 +988,12 @@ class NativeAnimatedNodeTraversalTest { } verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("opacity")).isEqualTo(0.0) + assertThat(stylesCaptor.value.getDouble("opacity")).isEqualTo(0.0) reset(uiManagerMock) nativeAnimatedNodesManager.restoreDefaultValues(propsNodeTag) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(viewTag), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().isNull("opacity")) + assertThat(stylesCaptor.value.isNull("opacity")).isTrue } /** @@ -1005,9 +1003,9 @@ class NativeAnimatedNodeTraversalTest { *

Value(3) is set to track Value(1) via Tracking(2) node with the provided animation config */ private fun createAnimatedGraphWithTrackingNode( - viewTag: Int, - initialValue: Double, - animationConfig: JavaOnlyMap + animationConfig: JavaOnlyMap, + viewTag: Int = 1000, + initialValue: Double = 0.0, ) { nativeAnimatedNodesManager.createAnimatedNode( 1, JavaOnlyMap.of("type", "value", "value", initialValue, "offset", 0.0)) @@ -1048,14 +1046,14 @@ class NativeAnimatedNodeTraversalTest { val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.25, 0.5, 0.75, 1) val animationConfig: JavaOnlyMap = JavaOnlyMap.of("type", "frames", "frames", frames) - createAnimatedGraphWithTrackingNode(1000, 0.0, animationConfig) + createAnimatedGraphWithTrackingNode(animationConfig) val stylesCaptor: ArgumentCaptor = ArgumentCaptor.forClass(ReadableMap::class.java) reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")).isEqualTo(0.0) + assertThat(stylesCaptor.value.getDouble("translateX")).isEqualTo(0.0) // update "toValue" to 100, we expect tracking animation to animate now from 0 to 100 in 5 // steps @@ -1067,8 +1065,7 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")) - .isEqualTo(frames.getDouble(i) * 100.0) + assertThat(stylesCaptor.value.getDouble("translateX")).isEqualTo(frames.getDouble(i) * 100.0) } // update "toValue" to 0 but run only two frames from the animation, @@ -1081,12 +1078,12 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")) + assertThat(stylesCaptor.value.getDouble("translateX")) .isEqualTo(100 * (1 - frames.getDouble(i))) } // at this point we expect tracking value to be at 75 - assertThat((nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).getValue()) + assertThat((nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).value) .isEqualTo(75.0) // we update "toValue" again to 100 and expect the animation to restart from the current @@ -1099,7 +1096,7 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verify(uiManagerMock).synchronouslyUpdateViewOnUIThread(eq(1000), stylesCaptor.capture()) - assertThat(stylesCaptor.getValue().getDouble("translateX")) + assertThat(stylesCaptor.value.getDouble("translateX")) .isEqualTo(50.0 + 50.0 * frames.getDouble(i)) } } @@ -1116,14 +1113,14 @@ class NativeAnimatedNodeTraversalTest { val frames: JavaOnlyArray = JavaOnlyArray.of(0.0, 0.5, 1.0) val animationConfig: JavaOnlyMap = JavaOnlyMap.of("type", "frames", "frames", frames) - createAnimatedGraphWithTrackingNode(1000, 0.0, animationConfig) + createAnimatedGraphWithTrackingNode(animationConfig) nativeAnimatedNodesManager.setAnimatedNodeValue(1, 100.0) nativeAnimatedNodesManager.runUpdates(nextFrameTime()) // make sure animation starts reset(uiManagerMock) for (i in 0 until frames.size()) { - assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isTrue() + assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isTrue nativeAnimatedNodesManager.runUpdates(nextFrameTime()) } verify(uiManagerMock, times(frames.size())) @@ -1131,7 +1128,7 @@ class NativeAnimatedNodeTraversalTest { // the animation has completed, we expect no updates to be done reset(uiManagerMock) - assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isFalse() + assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isFalse nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verifyNoMoreInteractions(uiManagerMock) @@ -1142,7 +1139,7 @@ class NativeAnimatedNodeTraversalTest { reset(uiManagerMock) for (i in 0 until frames.size()) { - assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isTrue() + assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isTrue nativeAnimatedNodesManager.runUpdates(nextFrameTime()) } verify(uiManagerMock, times(frames.size())) @@ -1150,7 +1147,7 @@ class NativeAnimatedNodeTraversalTest { // the animation has completed, we expect no updates to be done reset(uiManagerMock) - assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isFalse() + assertThat(nativeAnimatedNodesManager.hasActiveAnimations()).isFalse nativeAnimatedNodesManager.runUpdates(nextFrameTime()) verifyNoMoreInteractions(uiManagerMock) } @@ -1184,7 +1181,7 @@ class NativeAnimatedNodeTraversalTest { "overshootClamping", false) - createAnimatedGraphWithTrackingNode(1000, 0.0, springConfig) + createAnimatedGraphWithTrackingNode(springConfig) // update "toValue" to 1, we expect tracking animation to animate now from 0 to 1 nativeAnimatedNodesManager.setAnimatedNodeValue(1, 1.0) @@ -1194,18 +1191,18 @@ class NativeAnimatedNodeTraversalTest { // passes the final point (that is 1) while going backwards var isBoucingBack: Boolean = false var previousValue: Double = - (nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).getValue() + (nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).value for (i in 500 downTo 0) { nativeAnimatedNodesManager.runUpdates(nextFrameTime()) val currentValue: Double = - (nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).getValue() + (nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).value if (previousValue >= 1.0 && currentValue < 1.0) { isBoucingBack = true break } previousValue = currentValue } - assertThat(isBoucingBack).isTrue() + assertThat(isBoucingBack).isTrue // we now update "toValue" to 1.5 but since the value have negative speed and has also // pretty @@ -1219,7 +1216,7 @@ class NativeAnimatedNodeTraversalTest { for (i in 0 until 8 * 60) { nativeAnimatedNodesManager.runUpdates(nextFrameTime()) val currentValue: Double = - (nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).getValue() + (nativeAnimatedNodesManager.getNodeById(3) as ValueAnimatedNode).value if (!hasTurnedForward) { if (currentValue <= previousValue) { bounceBackInitialFrames++ @@ -1235,4 +1232,9 @@ class NativeAnimatedNodeTraversalTest { // we verify that the value settled at 2 assertThat(previousValue).isEqualTo(1.5) } + + companion object { + private const val FRAME_LEN_NANOS: Long = 1000000000L / 60L + private const val INITIAL_FRAME_TIME_NANOS: Long = 14599233201256L /* random */ + } } From 387bd70e49f67d310764dd23a9e6edb93cc00b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Fri, 23 Jun 2023 02:56:04 -0700 Subject: [PATCH 355/468] Basic implementation of IntersectionObserver (#37853) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37853 This adds a basic implementation of `IntersectionObserver`. This will not be available yet and is only compatible with the new React Native architecture. This shouldn't show up in the changelog until we're ready to enable this in some form. Changelog: [Internal] ## Context This implements a basic version of the `IntersectionObserver` API (as defined on the Web) for React Native. The motivation for this is supporting several use cases that are not possible in React Native at the moment, most importantly: * Tracking paint times for elements in the screen. * Tracking precise visibility of elements in the screen outside the context of a `VirtualizedList` (with an even better precision and control). ## Implementation details This API is implemented as a native module that registers a mount hook in Fabric. Whenever there's a mount (an update to the UI of the host platform) we check for intersections in the shadow tree. The shadow tree contains information about the representation of the UI in a given time (including scroll position), which we use as source of truth for this in a cross-platform fashion. We rely on the fact that scroll position is updated regularly in the shadow tree to provide an up-to-date view into the UI. **This implementation is completely cross-platform.** The only platform-specific part is the report of mounts in mount hooks from the host platform to Fabric. This API uses a centralized entity in JS and native to handle registration of observers and dispatch of notifications. The dispatch the notifications for all observers in the same callback so we can easily change the sequencing of events easily (for example, we can change this to use microtasks when they're available in RN). ## Known limitations * Timestamps are generally accurate for paint (as we report mounts right after they happen in the host platform), but **state updates (like scroll) are reported with a slight delay**. * In regular rendering, we first update the shadow tree and then mount it (paint), which is generally precise. In state updates, the UI is updated first and then the shadow tree is updated. In this case, we're not correctly reporting the timestamp of the scroll event (which we should be using) but the timestamp of when the update is processed. We'll fix this in a following diff. * The IntersectionObserver API has a concept of initial notification. This is a mechanism to report the initial state of an observed target. If we start observing a target when it's added to the tree but before it's painted, this initial notification is supposed to provide initial paint time (which is important for performance measurements). This implements some logic to handle that correctly (we check if there is a pending transaction) but it's currently unreliable: * React Native does not currently block paint on microtasks or layout effects, so setting up an observer in these stages could have race conditions with actual mount. If mount happens before the observation is started, the initial notification doesn't report initial time but observation time. If mount happens after, the initial notification should be fine (except in some cases on Android, see the next point). * On Android, we have a push model to send mutations to the host platform, we means we consume transactions after commit, not immediately before mount. This breaks this logic and we need to figure out a solution in a following diff. ---- Reviewed By: sammy-SC, rshest Differential Revision: D45278720 fbshipit-source-id: de350388c6325128f1cf73328779a9d3577a258a --- .../Core/setUpIntersectionObserver.js | 16 ++ .../IntersectionObserver.js | 252 ++++++++++++++++++ .../IntersectionObserverEntry.js | 140 ++++++++++ .../IntersectionObserverManager.js | 221 +++++++++++++++ .../NativeIntersectionObserver.cpp | 118 ++++++++ .../NativeIntersectionObserver.h | 109 ++++++++ .../NativeIntersectionObserver.js | 41 +++ .../__mocks__/NativeIntersectionObserver.js | 158 +++++++++++ .../ReactNative/__mocks__/FabricUIManager.js | 12 +- .../renderer/mounting/MountingCoordinator.cpp | 4 + .../renderer/mounting/MountingCoordinator.h | 8 + .../intersection/IntersectionObserver.cpp | 202 ++++++++++++++ .../intersection/IntersectionObserver.h | 80 ++++++ .../IntersectionObserverManager.cpp | 213 +++++++++++++++ .../IntersectionObserverManager.h | 74 +++++ .../IntersectionObserverState.cpp | 60 +++++ .../intersection/IntersectionObserverState.h | 46 ++++ .../renderer/uimanager/UIManagerBinding.cpp | 4 + .../renderer/uimanager/UIManagerBinding.h | 2 + 19 files changed, 1758 insertions(+), 2 deletions(-) create mode 100644 packages/react-native/Libraries/Core/setUpIntersectionObserver.js create mode 100644 packages/react-native/Libraries/IntersectionObserver/IntersectionObserver.js create mode 100644 packages/react-native/Libraries/IntersectionObserver/IntersectionObserverEntry.js create mode 100644 packages/react-native/Libraries/IntersectionObserver/IntersectionObserverManager.js create mode 100644 packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.cpp create mode 100644 packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.h create mode 100644 packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.js create mode 100644 packages/react-native/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js create mode 100644 packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp create mode 100644 packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.h create mode 100644 packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.cpp create mode 100644 packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.h create mode 100644 packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.cpp create mode 100644 packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.h diff --git a/packages/react-native/Libraries/Core/setUpIntersectionObserver.js b/packages/react-native/Libraries/Core/setUpIntersectionObserver.js new file mode 100644 index 00000000000000..84fecbc0b56361 --- /dev/null +++ b/packages/react-native/Libraries/Core/setUpIntersectionObserver.js @@ -0,0 +1,16 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +import {polyfillGlobal} from '../Utilities/PolyfillFunctions'; + +polyfillGlobal( + 'IntersectionObserver', + () => require('../IntersectionObserver/IntersectionObserver').default, +); diff --git a/packages/react-native/Libraries/IntersectionObserver/IntersectionObserver.js b/packages/react-native/Libraries/IntersectionObserver/IntersectionObserver.js new file mode 100644 index 00000000000000..23d2c158569c0b --- /dev/null +++ b/packages/react-native/Libraries/IntersectionObserver/IntersectionObserver.js @@ -0,0 +1,252 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +// flowlint unsafe-getters-setters:off + +import type IntersectionObserverEntry from './IntersectionObserverEntry'; +import type {IntersectionObserverId} from './IntersectionObserverManager'; + +import ReactNativeElement from '../DOM/Nodes/ReactNativeElement'; +import * as IntersectionObserverManager from './IntersectionObserverManager'; + +export type IntersectionObserverCallback = ( + entries: Array, + observer: IntersectionObserver, +) => mixed; + +type IntersectionObserverInit = { + // root?: ReactNativeElement, // This option exists on the Web but it's not currently supported in React Native. + // rootMargin?: string, // This option exists on the Web but it's not currently supported in React Native. + threshold?: number | $ReadOnlyArray, +}; + +/** + * The [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) + * provides a way to asynchronously observe changes in the intersection of a + * target element with an ancestor element or with a top-level document's + * viewport. + * + * The ancestor element or viewport is referred to as the root. + * + * When an `IntersectionObserver` is created, it's configured to watch for given + * ratios of visibility within the root. + * + * The configuration cannot be changed once the `IntersectionObserver` is + * created, so a given observer object is only useful for watching for specific + * changes in degree of visibility; however, you can watch multiple target + * elements with the same observer. + * + * This implementation only supports the `threshold` option at the moment + * (`root` and `rootMargin` are not supported). + */ +export default class IntersectionObserver { + _callback: IntersectionObserverCallback; + _thresholds: $ReadOnlyArray; + _observationTargets: Set = new Set(); + _intersectionObserverId: ?IntersectionObserverId; + + constructor( + callback: IntersectionObserverCallback, + options?: IntersectionObserverInit, + ): void { + if (callback == null) { + throw new TypeError( + "Failed to construct 'IntersectionObserver': 1 argument required, but only 0 present.", + ); + } + + if (typeof callback !== 'function') { + throw new TypeError( + "Failed to construct 'IntersectionObserver': parameter 1 is not of type 'Function'.", + ); + } + + // $FlowExpectedError[prop-missing] it's not typed in React Native but exists on Web. + if (options?.root != null) { + throw new TypeError( + "Failed to construct 'IntersectionObserver': root is not supported", + ); + } + + // $FlowExpectedError[prop-missing] it's not typed in React Native but exists on Web. + if (options?.rootMargin != null) { + throw new TypeError( + "Failed to construct 'IntersectionObserver': rootMargin is not supported", + ); + } + + this._callback = callback; + this._thresholds = normalizeThresholds(options?.threshold); + } + + /** + * The `ReactNativeElement` whose bounds are used as the bounding box when + * testing for intersection. + * If no `root` value was passed to the constructor or its value is `null`, + * the root view is used. + * + * NOTE: This cannot currently be configured and `root` is always `null`. + */ + get root(): ReactNativeElement | null { + return null; + } + + /** + * String with syntax similar to that of the CSS `margin` property. + * Each side of the rectangle represented by `rootMargin` is added to the + * corresponding side in the root element's bounding box before the + * intersection test is performed. + * + * NOTE: This cannot currently be configured and `rootMargin` is always + * `null`. + */ + get rootMargin(): string { + return '0px 0px 0px 0px'; + } + + /** + * A list of thresholds, sorted in increasing numeric order, where each + * threshold is a ratio of intersection area to bounding box area of an + * observed target. + * Notifications for a target are generated when any of the thresholds are + * crossed for that target. + * If no value was passed to the constructor, `0` is used. + */ + get thresholds(): $ReadOnlyArray { + return this._thresholds; + } + + /** + * Adds an element to the set of target elements being watched by the + * `IntersectionObserver`. + * One observer has one set of thresholds and one root, but can watch multiple + * target elements for visibility changes. + * To stop observing the element, call `IntersectionObserver.unobserve()`. + */ + observe(target: ReactNativeElement): void { + if (!(target instanceof ReactNativeElement)) { + throw new TypeError( + "Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'ReactNativeElement'.", + ); + } + + if (this._observationTargets.has(target)) { + return; + } + + IntersectionObserverManager.observe({ + intersectionObserverId: this._getOrCreateIntersectionObserverId(), + target, + }); + + this._observationTargets.add(target); + } + + /** + * Instructs the `IntersectionObserver` to stop observing the specified target + * element. + */ + unobserve(target: ReactNativeElement): void { + if (!(target instanceof ReactNativeElement)) { + throw new TypeError( + "Failed to execute 'unobserve' on 'IntersectionObserver': parameter 1 is not of type 'ReactNativeElement'.", + ); + } + + if (!this._observationTargets.has(target)) { + return; + } + + const intersectionObserverId = this._intersectionObserverId; + if (intersectionObserverId == null) { + // This is unexpected if the target is in `_observationTargets`. + console.error( + "Unexpected state in 'IntersectionObserver': could not find observer ID to unobserve target.", + ); + return; + } + + IntersectionObserverManager.unobserve(intersectionObserverId, target); + this._observationTargets.delete(target); + + if (this._observationTargets.size === 0) { + IntersectionObserverManager.unregisterObserver(intersectionObserverId); + this._intersectionObserverId = null; + } + } + + /** + * Stops watching all of its target elements for visibility changes. + */ + disconnect(): void { + for (const target of this._observationTargets.keys()) { + this.unobserve(target); + } + } + + _getOrCreateIntersectionObserverId(): IntersectionObserverId { + let intersectionObserverId = this._intersectionObserverId; + if (intersectionObserverId == null) { + intersectionObserverId = IntersectionObserverManager.registerObserver( + this, + this._callback, + ); + this._intersectionObserverId = intersectionObserverId; + } + return intersectionObserverId; + } + + // Only for tests + __getObserverID(): ?IntersectionObserverId { + return this._intersectionObserverId; + } +} + +/** + * Converts the user defined `threshold` value into an array of sorted valid + * threshold options for `IntersectionObserver` (double ∈ [0, 1]). + * + * @example + * normalizeThresholds(0.5); // → [0.5] + * normalizeThresholds([1, 0.5, 0]); // → [0, 0.5, 1] + * normalizeThresholds(['1', '0.5', '0']); // → [0, 0.5, 1] + */ +function normalizeThresholds(threshold: mixed): $ReadOnlyArray { + if (Array.isArray(threshold)) { + if (threshold.length > 0) { + return threshold.map(normalizeThresholdValue).sort(); + } else { + return [0]; + } + } + + return [normalizeThresholdValue(threshold)]; +} + +function normalizeThresholdValue(threshold: mixed): number { + if (threshold == null) { + return 0; + } + + const thresholdAsNumber = Number(threshold); + if (!Number.isFinite(thresholdAsNumber)) { + throw new TypeError( + "Failed to read the 'threshold' property from 'IntersectionObserverInit': The provided double value is non-finite.", + ); + } + + if (thresholdAsNumber < 0 || thresholdAsNumber > 1) { + throw new RangeError( + "Failed to construct 'IntersectionObserver': Threshold values must be numbers between 0 and 1", + ); + } + + return thresholdAsNumber; +} diff --git a/packages/react-native/Libraries/IntersectionObserver/IntersectionObserverEntry.js b/packages/react-native/Libraries/IntersectionObserver/IntersectionObserverEntry.js new file mode 100644 index 00000000000000..315a53446c63e5 --- /dev/null +++ b/packages/react-native/Libraries/IntersectionObserver/IntersectionObserverEntry.js @@ -0,0 +1,140 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +// flowlint unsafe-getters-setters:off + +import type ReactNativeElement from '../DOM/Nodes/ReactNativeElement'; +import type {InternalInstanceHandle} from '../Renderer/shims/ReactNativeTypes'; +import type {NativeIntersectionObserverEntry} from './NativeIntersectionObserver'; + +import DOMRectReadOnly from '../DOM/Geometry/DOMRectReadOnly'; +import {getPublicInstanceFromInternalInstanceHandle} from '../DOM/Nodes/ReadOnlyNode'; + +/** + * The [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry) + * interface of the Intersection Observer API describes the intersection between + * the target element and its root container at a specific moment of transition. + * + * An array of `IntersectionObserverEntry` is delivered to + * `IntersectionObserver` callbacks as the first argument. + */ +export default class IntersectionObserverEntry { + // We lazily compute all the properties from the raw entry provided by the + // native module, so we avoid unnecessary work. + _nativeEntry: NativeIntersectionObserverEntry; + + constructor(nativeEntry: NativeIntersectionObserverEntry) { + this._nativeEntry = nativeEntry; + } + + /** + * Returns the bounds rectangle of the target element as a `DOMRectReadOnly`. + * The bounds are computed as described in the documentation for + * [`Element.getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). + */ + get boundingClientRect(): DOMRectReadOnly { + const targetRect = this._nativeEntry.targetRect; + return new DOMRectReadOnly( + targetRect[0], + targetRect[1], + targetRect[2], + targetRect[3], + ); + } + + /** + * Returns the ratio of the `intersectionRect` to the `boundingClientRect`. + */ + get intersectionRatio(): number { + const intersectionRect = this.intersectionRect; + const boundingClientRect = this.boundingClientRect; + + if (boundingClientRect.width === 0 || boundingClientRect.height === 0) { + return 0; + } + + return ( + (intersectionRect.width * intersectionRect.height) / + (boundingClientRect.width * boundingClientRect.height) + ); + } + + /** + * Returns a `DOMRectReadOnly` representing the target's visible area. + */ + get intersectionRect(): DOMRectReadOnly { + const intersectionRect = this._nativeEntry.intersectionRect; + + if (intersectionRect == null) { + return new DOMRectReadOnly(); + } + + return new DOMRectReadOnly( + intersectionRect[0], + intersectionRect[1], + intersectionRect[2], + intersectionRect[3], + ); + } + + /** + * A `Boolean` value which is `true` if the target element intersects with the + * intersection observer's root. + * * If this is `true`, then, the `IntersectionObserverEntry` describes a + * transition into a state of intersection. + * * If it's `false`, then you know the transition is from intersecting to + * not-intersecting. + */ + get isIntersecting(): boolean { + return this._nativeEntry.isIntersectingAboveThresholds; + } + + /** + * Returns a `DOMRectReadOnly` for the intersection observer's root. + */ + get rootBounds(): DOMRectReadOnly { + const rootRect = this._nativeEntry.rootRect; + return new DOMRectReadOnly( + rootRect[0], + rootRect[1], + rootRect[2], + rootRect[3], + ); + } + + /** + * The `ReactNativeElement` whose intersection with the root changed. + */ + get target(): ReactNativeElement { + const targetInstanceHandle: InternalInstanceHandle = + // $FlowExpectedError[incompatible-type] native modules don't support using InternalInstanceHandle as a type + this._nativeEntry.targetInstanceHandle; + + const targetElement = + getPublicInstanceFromInternalInstanceHandle(targetInstanceHandle); + + // $FlowExpectedError[incompatible-cast] we know targetElement is a ReactNativeElement, not just a ReadOnlyNode + return (targetElement: ReactNativeElement); + } + + /** + * A `DOMHighResTimeStamp` indicating the time at which the intersection was + * recorded, relative to the `IntersectionObserver`'s time origin. + */ + get time(): DOMHighResTimeStamp { + return this._nativeEntry.time; + } +} + +export function createIntersectionObserverEntry( + entry: NativeIntersectionObserverEntry, +): IntersectionObserverEntry { + return new IntersectionObserverEntry(entry); +} diff --git a/packages/react-native/Libraries/IntersectionObserver/IntersectionObserverManager.js b/packages/react-native/Libraries/IntersectionObserver/IntersectionObserverManager.js new file mode 100644 index 00000000000000..c3f88ee7ef194d --- /dev/null +++ b/packages/react-native/Libraries/IntersectionObserver/IntersectionObserverManager.js @@ -0,0 +1,221 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +/** + * This module handles the communication between the React Native renderer + * and all the intersection observers that are currently observing any targets. + * + * In order to reduce the communication between native and JavaScript, + * we register a single notication callback in native, and then we handle how + * to notify each entry to the right intersection observer when we receive all + * the notifications together. + */ + +import type ReactNativeElement from '../DOM/Nodes/ReactNativeElement'; +import type IntersectionObserver, { + IntersectionObserverCallback, +} from './IntersectionObserver'; +import type IntersectionObserverEntry from './IntersectionObserverEntry'; + +import {getShadowNode} from '../DOM/Nodes/ReadOnlyNode'; +import * as Systrace from '../Performance/Systrace'; +import warnOnce from '../Utilities/warnOnce'; +import {createIntersectionObserverEntry} from './IntersectionObserverEntry'; +import NativeIntersectionObserver from './NativeIntersectionObserver'; + +export type IntersectionObserverId = number; + +let nextIntersectionObserverId: IntersectionObserverId = 1; +let isConnected: boolean = false; + +const registeredIntersectionObservers: Map< + IntersectionObserverId, + {observer: IntersectionObserver, callback: IntersectionObserverCallback}, +> = new Map(); + +/** + * Registers the given intersection observer and returns a unique ID for it, + * which is required to start observing targets. + */ +export function registerObserver( + observer: IntersectionObserver, + callback: IntersectionObserverCallback, +): IntersectionObserverId { + const intersectionObserverId = nextIntersectionObserverId; + nextIntersectionObserverId++; + registeredIntersectionObservers.set(intersectionObserverId, { + observer, + callback, + }); + return intersectionObserverId; +} + +/** + * Unregisters the given intersection observer. + * This should only be called when an observer is no longer observing any + * targets. + */ +export function unregisterObserver( + intersectionObserverId: IntersectionObserverId, +): void { + const deleted = registeredIntersectionObservers.delete( + intersectionObserverId, + ); + if (deleted && registeredIntersectionObservers.size === 0) { + NativeIntersectionObserver?.disconnect(); + isConnected = false; + } +} + +/** + * Starts observing a target on a specific intersection observer. + * If this is the first target being observed, this also sets up the centralized + * notification callback in native. + */ +export function observe({ + intersectionObserverId, + target, +}: { + intersectionObserverId: IntersectionObserverId, + target: ReactNativeElement, +}): void { + if (NativeIntersectionObserver == null) { + warnNoNativeIntersectionObserver(); + return; + } + + const registeredObserver = registeredIntersectionObservers.get( + intersectionObserverId, + ); + if (registeredObserver == null) { + console.error( + `IntersectionObserverManager: could not start observing target because IntersectionObserver with ID ${intersectionObserverId} was not registered.`, + ); + return; + } + + const targetShadowNode = getShadowNode(target); + if (targetShadowNode == null) { + console.error( + 'IntersectionObserverManager: could not find reference to host node from target', + ); + return; + } + + if (!isConnected) { + NativeIntersectionObserver.connect(notifyIntersectionObservers); + isConnected = true; + } + + return NativeIntersectionObserver.observe({ + intersectionObserverId, + targetShadowNode, + thresholds: registeredObserver.observer.thresholds, + }); +} + +export function unobserve( + intersectionObserverId: number, + target: ReactNativeElement, +): void { + if (NativeIntersectionObserver == null) { + warnNoNativeIntersectionObserver(); + return; + } + + const registeredObserver = registeredIntersectionObservers.get( + intersectionObserverId, + ); + if (registeredObserver == null) { + console.error( + `IntersectionObserverManager: could not stop observing target because IntersectionObserver with ID ${intersectionObserverId} was not registered.`, + ); + return; + } + + const targetShadowNode = getShadowNode(target); + if (targetShadowNode == null) { + console.error( + 'IntersectionObserverManager: could not find reference to host node from target', + ); + return; + } + + NativeIntersectionObserver.unobserve( + intersectionObserverId, + targetShadowNode, + ); +} + +/** + * This function is called from native when there are `IntersectionObserver` + * entries to dispatch. + */ +function notifyIntersectionObservers(): void { + Systrace.beginEvent( + 'IntersectionObserverManager.notifyIntersectionObservers', + ); + try { + doNotifyIntersectionObservers(); + } finally { + Systrace.endEvent(); + } +} + +function doNotifyIntersectionObservers(): void { + if (NativeIntersectionObserver == null) { + warnNoNativeIntersectionObserver(); + return; + } + + const nativeEntries = NativeIntersectionObserver.takeRecords(); + + const entriesByObserver: Map< + IntersectionObserverId, + Array, + > = new Map(); + + for (const nativeEntry of nativeEntries) { + let list = entriesByObserver.get(nativeEntry.intersectionObserverId); + if (list == null) { + list = []; + entriesByObserver.set(nativeEntry.intersectionObserverId, list); + } + list.push(createIntersectionObserverEntry(nativeEntry)); + } + + for (const [ + intersectionObserverId, + entriesForObserver, + ] of entriesByObserver) { + const registeredObserver = registeredIntersectionObservers.get( + intersectionObserverId, + ); + if (!registeredObserver) { + // This could happen if the observer is disconnected between commit + // and mount. In this case, we can just ignore the entries. + return; + } + + const {observer, callback} = registeredObserver; + try { + callback.call(observer, entriesForObserver, observer); + } catch (error) { + console.error(error); + } + } +} + +function warnNoNativeIntersectionObserver() { + warnOnce( + 'missing-native-intersection-observer', + 'Missing native implementation of IntersectionObserver', + ); +} diff --git a/packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.cpp b/packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.cpp new file mode 100644 index 00000000000000..94657af8cffce3 --- /dev/null +++ b/packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.cpp @@ -0,0 +1,118 @@ +/* + * 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 "NativeIntersectionObserver.h" +#include +#include +#include + +#include "Plugins.h" + +std::shared_ptr +NativeIntersectionObserverModuleProvider( + std::shared_ptr jsInvoker) { + return std::make_shared( + std::move(jsInvoker)); +} + +namespace facebook::react { + +NativeIntersectionObserver::NativeIntersectionObserver( + std::shared_ptr jsInvoker) + : NativeIntersectionObserverCxxSpec(std::move(jsInvoker)) {} + +void NativeIntersectionObserver::observe( + jsi::Runtime &runtime, + NativeIntersectionObserverObserveOptions options) { + auto intersectionObserverId = options.intersectionObserverId; + auto shadowNode = + shadowNodeFromValue(runtime, std::move(options.targetShadowNode)); + auto thresholds = options.thresholds; + auto &uiManager = getUIManagerFromRuntime(runtime); + + intersectionObserverManager_.observe( + intersectionObserverId, shadowNode, thresholds, uiManager); +} + +void NativeIntersectionObserver::unobserve( + jsi::Runtime &runtime, + IntersectionObserverObserverId intersectionObserverId, + jsi::Object targetShadowNode) { + auto shadowNode = shadowNodeFromValue(runtime, std::move(targetShadowNode)); + intersectionObserverManager_.unobserve(intersectionObserverId, *shadowNode); +} + +void NativeIntersectionObserver::connect( + jsi::Runtime &runtime, + AsyncCallback<> notifyIntersectionObserversCallback) { + auto &uiManager = getUIManagerFromRuntime(runtime); + intersectionObserverManager_.connect( + uiManager, notifyIntersectionObserversCallback); +} + +void NativeIntersectionObserver::disconnect(jsi::Runtime &runtime) { + auto &uiManager = getUIManagerFromRuntime(runtime); + intersectionObserverManager_.disconnect(uiManager); +} + +std::vector +NativeIntersectionObserver::takeRecords(jsi::Runtime &runtime) { + auto entries = intersectionObserverManager_.takeRecords(); + + std::vector nativeModuleEntries; + nativeModuleEntries.reserve(entries.size()); + + for (auto const &entry : entries) { + nativeModuleEntries.emplace_back( + convertToNativeModuleEntry(entry, runtime)); + } + + return nativeModuleEntries; +} + +NativeIntersectionObserverEntry +NativeIntersectionObserver::convertToNativeModuleEntry( + IntersectionObserverEntry entry, + jsi::Runtime &runtime) { + RectAsTuple targetRect = { + entry.targetRect.origin.x, + entry.targetRect.origin.y, + entry.targetRect.size.width, + entry.targetRect.size.height}; + RectAsTuple rootRect = { + entry.rootRect.origin.x, + entry.rootRect.origin.y, + entry.rootRect.size.width, + entry.rootRect.size.height}; + std::optional intersectionRect; + if (entry.intersectionRect) { + intersectionRect = { + entry.intersectionRect.value().origin.x, + entry.intersectionRect.value().origin.y, + entry.intersectionRect.value().size.width, + entry.intersectionRect.value().size.height}; + } + + NativeIntersectionObserverEntry nativeModuleEntry = { + entry.intersectionObserverId, + (*entry.shadowNode).getInstanceHandle(runtime), + targetRect, + rootRect, + intersectionRect, + entry.isIntersectingAboveThresholds, + entry.time, + }; + + return nativeModuleEntry; +} + +UIManager &NativeIntersectionObserver::getUIManagerFromRuntime( + jsi::Runtime &runtime) { + return UIManagerBinding::getBinding(runtime)->getUIManager(); +} + +} // namespace facebook::react diff --git a/packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.h b/packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.h new file mode 100644 index 00000000000000..123e4cf20e6b5e --- /dev/null +++ b/packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.h @@ -0,0 +1,109 @@ +/* + * 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 +#include +#include +#include +#include +#include + +namespace facebook::react { + +using NativeIntersectionObserverIntersectionObserverId = int32_t; +using RectAsTuple = std::tuple; + +using NativeIntersectionObserverObserveOptions = + NativeIntersectionObserverCxxBaseNativeIntersectionObserverObserveOptions< + // intersectionObserverId + NativeIntersectionObserverIntersectionObserverId, + // targetShadowNode + jsi::Object, + // thresholds + std::vector>; + +template <> +struct Bridging + : NativeIntersectionObserverCxxBaseNativeIntersectionObserverObserveOptionsBridging< + // intersectionObserverId + NativeIntersectionObserverIntersectionObserverId, + // targetShadowNode + jsi::Object, + // thresholds + std::vector> {}; + +using NativeIntersectionObserverEntry = + NativeIntersectionObserverCxxBaseNativeIntersectionObserverEntry< + // intersectionObserverId + NativeIntersectionObserverIntersectionObserverId, + // targetInstanceHandle + jsi::Value, + // targetRect + RectAsTuple, + // rootRect + RectAsTuple, + // intersectionRect + std::optional, + // isIntersectingAboveThresholds + bool, + // time + double>; + +template <> +struct Bridging + : NativeIntersectionObserverCxxBaseNativeIntersectionObserverEntryBridging< + // intersectionObserverId + NativeIntersectionObserverIntersectionObserverId, + // targetInstanceHandle + jsi::Value, + // targetRect + RectAsTuple, + // rootRect + RectAsTuple, + // intersectionRect + std::optional, + // isIntersectingAboveThresholds + bool, + // time + double> {}; + +class NativeIntersectionObserver + : public NativeIntersectionObserverCxxSpec, + std::enable_shared_from_this { + public: + NativeIntersectionObserver(std::shared_ptr jsInvoker); + + void observe( + jsi::Runtime &runtime, + NativeIntersectionObserverObserveOptions options); + + void unobserve( + jsi::Runtime &runtime, + IntersectionObserverObserverId intersectionObserverId, + jsi::Object targetShadowNode); + + void connect( + jsi::Runtime &runtime, + AsyncCallback<> notifyIntersectionObserversCallback); + + void disconnect(jsi::Runtime &runtime); + + std::vector takeRecords( + jsi::Runtime &runtime); + + private: + IntersectionObserverManager intersectionObserverManager_{}; + + static UIManager &getUIManagerFromRuntime(jsi::Runtime &runtime); + static NativeIntersectionObserverEntry convertToNativeModuleEntry( + IntersectionObserverEntry entry, + jsi::Runtime &runtime); +}; + +} // namespace facebook::react diff --git a/packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.js b/packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.js new file mode 100644 index 00000000000000..ff620ec123a770 --- /dev/null +++ b/packages/react-native/Libraries/IntersectionObserver/NativeIntersectionObserver.js @@ -0,0 +1,41 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict + * @format + */ + +import type {TurboModule} from '../TurboModule/RCTExport'; + +import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry'; + +export type NativeIntersectionObserverEntry = { + intersectionObserverId: number, + targetInstanceHandle: mixed, + targetRect: $ReadOnlyArray, // It's actually a tuple with x, y, width and height + rootRect: $ReadOnlyArray, // It's actually a tuple with x, y, width and height + intersectionRect: ?$ReadOnlyArray, // It's actually a tuple with x, y, width and height + isIntersectingAboveThresholds: boolean, + time: number, +}; + +export type NativeIntersectionObserverObserveOptions = { + intersectionObserverId: number, + targetShadowNode: mixed, + thresholds: $ReadOnlyArray, +}; + +export interface Spec extends TurboModule { + +observe: (options: NativeIntersectionObserverObserveOptions) => void; + +unobserve: (intersectionObserverId: number, targetShadowNode: mixed) => void; + +connect: (notifyIntersectionObserversCallback: () => void) => void; + +disconnect: () => void; + +takeRecords: () => $ReadOnlyArray; +} + +export default (TurboModuleRegistry.get( + 'NativeIntersectionObserverCxx', +): ?Spec); diff --git a/packages/react-native/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js b/packages/react-native/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js new file mode 100644 index 00000000000000..7bd88d6e1a9606 --- /dev/null +++ b/packages/react-native/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js @@ -0,0 +1,158 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +import type ReactNativeElement from '../../DOM/Nodes/ReactNativeElement'; +import type IntersectionObserver from '../IntersectionObserver'; +import type { + NativeIntersectionObserverEntry, + NativeIntersectionObserverObserveOptions, + Spec, +} from '../NativeIntersectionObserver'; + +import {getShadowNode} from '../../DOM/Nodes/ReadOnlyNode'; +import {getFabricUIManager} from '../../ReactNative/__mocks__/FabricUIManager'; +import invariant from 'invariant'; +import nullthrows from 'nullthrows'; + +type ObserverState = { + thresholds: $ReadOnlyArray, + intersecting: boolean, + currentThreshold: ?number, +}; + +type Observation = { + ...NativeIntersectionObserverObserveOptions, + state: ObserverState, +}; + +let pendingRecords: Array = []; +let callback: ?() => void; +let observations: Array = []; + +const FabricUIManagerMock = nullthrows(getFabricUIManager()); + +function createRecordFromObservation( + observation: Observation, +): NativeIntersectionObserverEntry { + return { + intersectionObserverId: observation.intersectionObserverId, + targetInstanceHandle: FabricUIManagerMock.__getInstanceHandleFromNode( + // $FlowExpectedError[incompatible-call] + observation.targetShadowNode, + ), + targetRect: observation.state.intersecting ? [0, 0, 1, 1] : [20, 20, 1, 1], + rootRect: [0, 0, 10, 10], + intersectionRect: observation.state.intersecting ? [0, 0, 1, 1] : null, + isIntersectingAboveThresholds: observation.state.intersecting, + time: performance.now(), + }; +} + +function notifyIntersectionObservers(): void { + callback?.(); +} + +const NativeIntersectionObserverMock = { + observe: (options: NativeIntersectionObserverObserveOptions): void => { + invariant( + observations.find( + observation => + observation.intersectionObserverId === + options.intersectionObserverId && + observation.targetShadowNode === options.targetShadowNode, + ) == null, + 'unexpected duplicate call to observe', + ); + const observation = { + ...options, + state: { + thresholds: options.thresholds, + intersecting: false, + currentThreshold: null, + }, + }; + observations.push(observation); + pendingRecords.push(createRecordFromObservation(observation)); + setImmediate(notifyIntersectionObservers); + }, + unobserve: ( + intersectionObserverId: number, + targetShadowNode: mixed, + ): void => { + const observationIndex = observations.findIndex( + observation => + observation.intersectionObserverId === intersectionObserverId && + observation.targetShadowNode === targetShadowNode, + ); + invariant( + observationIndex !== -1, + 'unexpected duplicate call to unobserve', + ); + observations.splice(observationIndex, 1); + }, + connect: (notifyIntersectionObserversCallback?: () => void): void => { + invariant(callback == null, 'unexpected call to connect'); + callback = notifyIntersectionObserversCallback; + }, + disconnect: (): void => { + invariant(callback != null, 'unexpected call to disconnect'); + callback = null; + }, + takeRecords: (): $ReadOnlyArray => { + const currentRecords = pendingRecords; + pendingRecords = []; + return currentRecords; + }, + __forceTransitionForTests: ( + observer: IntersectionObserver, + target: ReactNativeElement, + ) => { + const targetShadowNode = getShadowNode(target); + const observation = observations.find( + obs => + obs.intersectionObserverId === observer.__getObserverID() && + obs.targetShadowNode === targetShadowNode, + ); + invariant( + observation != null, + 'cannot force transition on an unobserved target', + ); + if (observation.state.intersecting) { + observation.state.intersecting = false; + observation.state.currentThreshold = null; + } else { + observation.state.intersecting = true; + observation.state.currentThreshold = observation.thresholds[0]; + } + pendingRecords.push(createRecordFromObservation(observation)); + setImmediate(notifyIntersectionObservers); + }, + __getObservationsForTests: ( + observer: IntersectionObserver, + ): Array<{targetShadowNode: mixed, thresholds: $ReadOnlyArray}> => { + const intersectionObserverId = observer.__getObserverID(); + return observations + .filter( + observation => + observation.intersectionObserverId === intersectionObserverId, + ) + .map(observation => ({ + targetShadowNode: observation.targetShadowNode, + thresholds: observation.thresholds, + })); + }, + __isConnected: (): boolean => { + return callback != null; + }, +}; + +(NativeIntersectionObserverMock: Spec); + +export default NativeIntersectionObserverMock; diff --git a/packages/react-native/Libraries/ReactNative/__mocks__/FabricUIManager.js b/packages/react-native/Libraries/ReactNative/__mocks__/FabricUIManager.js index 0e9a67dccb0ba3..36cbb700fdb693 100644 --- a/packages/react-native/Libraries/ReactNative/__mocks__/FabricUIManager.js +++ b/packages/react-native/Libraries/ReactNative/__mocks__/FabricUIManager.js @@ -143,7 +143,11 @@ function hasDisplayNone(node: Node): boolean { return props != null && props.display === 'none'; } -const FabricUIManagerMock: FabricUIManager = { +interface IFabricUIManagerMock extends FabricUIManager { + __getInstanceHandleFromNode(node: Node): InternalInstanceHandle; +} + +const FabricUIManagerMock: IFabricUIManagerMock = { createNode: jest.fn( ( reactTag: number, @@ -458,10 +462,14 @@ const FabricUIManagerMock: FabricUIManager = { return [scrollLeft, scrollTop]; }, ), + + __getInstanceHandleFromNode(node: Node): InternalInstanceHandle { + return fromNode(node).instanceHandle; + }, }; global.nativeFabricUIManager = FabricUIManagerMock; -export function getFabricUIManager(): ?FabricUIManager { +export function getFabricUIManager(): ?IFabricUIManagerMock { return FabricUIManagerMock; } diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp index 16626c1eb561f6..be1132fc180940 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp @@ -178,6 +178,10 @@ std::optional MountingCoordinator::pullTransaction() return transaction; } +bool MountingCoordinator::hasPendingTransactions() const { + return lastRevision_.has_value(); +} + TelemetryController const &MountingCoordinator::getTelemetryController() const { return telemetryController_; } diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.h b/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.h index 7ca6aeb5a9b3c3..16d3ca1b77702c 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/MountingCoordinator.h @@ -58,6 +58,14 @@ class MountingCoordinator final { */ std::optional pullTransaction() const; + /* + * Indicates if there are transactions waiting to be consumed and mounted on + * the host platform. This can be useful to determine if side-effects of + * mounting can be expected after some operations (like IntersectionObserver + * initial paint notifications). + */ + bool hasPendingTransactions() const; + /* * Blocks the current thread until a new mounting transaction is available or * after the specified `timeout` duration. diff --git a/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp new file mode 100644 index 00000000000000..85dc0bb3ca6f2c --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.cpp @@ -0,0 +1,202 @@ +/* + * 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 "IntersectionObserver.h" +#include +#include +#include +#include +#include +#include + +namespace facebook::react { + +IntersectionObserver::IntersectionObserver( + IntersectionObserverObserverId intersectionObserverId, + ShadowNode::Shared targetShadowNode, + std::vector thresholds) + : intersectionObserverId_(intersectionObserverId), + targetShadowNode_(std::move(targetShadowNode)), + thresholds_(std::move(thresholds)) {} + +static Rect getRootBoundingRect( + LayoutableShadowNode const &layoutableRootShadowNode) { + auto layoutMetrics = layoutableRootShadowNode.getLayoutMetrics(); + + if (layoutMetrics == EmptyLayoutMetrics || + layoutMetrics.displayType == DisplayType::None) { + return Rect{}; + } + + // Apply the transform to translate the root view to its location in the + // viewport. + return layoutMetrics.frame * layoutableRootShadowNode.getTransform(); +} + +static Rect getTargetBoundingRect( + ShadowNodeFamily::AncestorList const &targetAncestors) { + auto layoutMetrics = LayoutableShadowNode::computeRelativeLayoutMetrics( + targetAncestors, + {/* .includeTransform = */ true, + /* .includeViewportOffset = */ true}); + return layoutMetrics == EmptyLayoutMetrics ? Rect{} : layoutMetrics.frame; +} + +static Rect getClippedTargetBoundingRect( + ShadowNodeFamily::AncestorList const &targetAncestors) { + auto layoutMetrics = LayoutableShadowNode::computeRelativeLayoutMetrics( + targetAncestors, + {/* .includeTransform = */ true, + /* .includeViewportOffset = */ true, + /* .applyParentClipping = */ true}); + + return layoutMetrics == EmptyLayoutMetrics ? Rect{} : layoutMetrics.frame; +} + +// Partially equivalent to +// https://w3c.github.io/IntersectionObserver/#compute-the-intersection +static Rect computeIntersection( + Rect const &rootBoundingRect, + Rect const &targetBoundingRect, + ShadowNodeFamily::AncestorList const &targetAncestors) { + auto absoluteIntersectionRect = + Rect::intersect(rootBoundingRect, targetBoundingRect); + + Float absoluteIntersectionRectArea = absoluteIntersectionRect.size.width * + absoluteIntersectionRect.size.height; + + Float targetBoundingRectArea = + targetBoundingRect.size.width * targetBoundingRect.size.height; + + // Finish early if there is not intersection between the root and the target + // before we do any clipping. + if (absoluteIntersectionRectArea == 0 || targetBoundingRectArea == 0) { + return {}; + } + + // Coordinates of the target after clipping the parts hidden by a parent + // (e.g.: in scroll views, or in views with a parent with overflow: hidden) + auto clippedTargetBoundingRect = + getClippedTargetBoundingRect(targetAncestors); + + return Rect::intersect(rootBoundingRect, clippedTargetBoundingRect); +} + +// Partially equivalent to +// https://w3c.github.io/IntersectionObserver/#update-intersection-observations-algo +std::optional +IntersectionObserver::updateIntersectionObservation( + RootShadowNode const &rootShadowNode, + double mountTime) { + auto const layoutableRootShadowNode = + traitCast(&rootShadowNode); + + react_native_assert( + layoutableRootShadowNode != nullptr && + "RootShadowNode instances must always inherit from LayoutableShadowNode."); + + auto targetAncestors = + targetShadowNode_->getFamily().getAncestors(rootShadowNode); + + // Absolute coordinates of the root + auto rootBoundingRect = getRootBoundingRect(*layoutableRootShadowNode); + + // Absolute coordinates of the target + auto targetBoundingRect = getTargetBoundingRect(targetAncestors); + + auto intersectionRect = computeIntersection( + rootBoundingRect, targetBoundingRect, targetAncestors); + + Float targetBoundingRectArea = + targetBoundingRect.size.width * targetBoundingRect.size.height; + auto intersectionRectArea = + intersectionRect.size.width * intersectionRect.size.height; + + Float intersectionRatio = + targetBoundingRectArea == 0 // prevent division by zero + ? 0 + : intersectionRectArea / targetBoundingRectArea; + + if (intersectionRatio == 0) { + return setNotIntersectingState( + rootBoundingRect, targetBoundingRect, mountTime); + } + + auto highestThresholdCrossed = getHighestThresholdCrossed(intersectionRatio); + if (highestThresholdCrossed == -1) { + return setNotIntersectingState( + rootBoundingRect, targetBoundingRect, mountTime); + } + + return setIntersectingState( + rootBoundingRect, + targetBoundingRect, + intersectionRect, + highestThresholdCrossed, + mountTime); +} + +Float IntersectionObserver::getHighestThresholdCrossed( + Float intersectionRatio) { + Float highestThreshold = -1; + for (auto threshold : thresholds_) { + if (intersectionRatio >= threshold) { + highestThreshold = threshold; + } + } + return highestThreshold; +} + +std::optional +IntersectionObserver::setIntersectingState( + Rect const &rootBoundingRect, + Rect const &targetBoundingRect, + Rect const &intersectionRect, + Float threshold, + double mountTime) { + auto newState = IntersectionObserverState::Intersecting(threshold); + + if (state_ != newState) { + state_ = newState; + IntersectionObserverEntry entry{ + intersectionObserverId_, + targetShadowNode_, + targetBoundingRect, + rootBoundingRect, + intersectionRect, + true, + mountTime, + }; + return std::optional{std::move(entry)}; + } + + return std::nullopt; +} + +std::optional +IntersectionObserver::setNotIntersectingState( + Rect const &rootBoundingRect, + Rect const &targetBoundingRect, + double mountTime) { + if (state_ != IntersectionObserverState::NotIntersecting()) { + state_ = IntersectionObserverState::NotIntersecting(); + IntersectionObserverEntry entry{ + intersectionObserverId_, + targetShadowNode_, + targetBoundingRect, + rootBoundingRect, + std::nullopt, + false, + mountTime, + }; + return std::optional(std::move(entry)); + } + + return std::nullopt; +} + +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.h b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.h new file mode 100644 index 00000000000000..5f0371b6b23c16 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserver.h @@ -0,0 +1,80 @@ +/* + * 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 +#include +#include +#include +#include +#include "IntersectionObserverState.h" + +namespace facebook::react { + +using IntersectionObserverObserverId = int32_t; + +struct IntersectionObserverEntry { + IntersectionObserverObserverId intersectionObserverId; + ShadowNode::Shared shadowNode; + Rect targetRect; + Rect rootRect; + std::optional intersectionRect; + bool isIntersectingAboveThresholds; + // TODO(T156529385) Define `DOMHighResTimeStamp` as an alias for `double` and + // use it here. + double time; +}; + +class IntersectionObserver { + public: + IntersectionObserver( + IntersectionObserverObserverId intersectionObserverId, + ShadowNode::Shared targetShadowNode, + std::vector thresholds); + + // Partially equivalent to + // https://w3c.github.io/IntersectionObserver/#update-intersection-observations-algo + std::optional updateIntersectionObservation( + RootShadowNode const &rootShadowNode, + double mountTime); + + IntersectionObserverObserverId getIntersectionObserverId() const { + return intersectionObserverId_; + } + + ShadowNode const &getTargetShadowNode() const { + return *targetShadowNode_; + } + + std::vector getThresholds() const { + return thresholds_; + } + + private: + Float getHighestThresholdCrossed(Float intersectionRatio); + + std::optional setIntersectingState( + Rect const &rootBoundingRect, + Rect const &targetBoundingRect, + Rect const &intersectionRect, + Float threshold, + double mountTime); + + std::optional setNotIntersectingState( + Rect const &rootBoundingRect, + Rect const &targetBoundingRect, + double mountTime); + + IntersectionObserverObserverId intersectionObserverId_; + ShadowNode::Shared targetShadowNode_; + std::vector thresholds_; + mutable IntersectionObserverState state_ = + IntersectionObserverState::Initial(); +}; + +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.cpp b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.cpp new file mode 100644 index 00000000000000..7959b9316d22a8 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.cpp @@ -0,0 +1,213 @@ +/* + * 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 "IntersectionObserverManager.h" +#include +#include +#include +#include "IntersectionObserver.h" + +namespace facebook::react { + +IntersectionObserverManager::IntersectionObserverManager() = default; + +void IntersectionObserverManager::observe( + IntersectionObserverObserverId intersectionObserverId, + const ShadowNode::Shared &shadowNode, + std::vector thresholds, + UIManager const &uiManager) { + SystraceSection s("IntersectionObserverManager::observe"); + + auto surfaceId = shadowNode->getSurfaceId(); + + // The actual observer lives in the array, so we need to create it there and + // then get a reference. Otherwise we only update its state in a copy. + IntersectionObserver *observer; + + // Register observer + { + std::unique_lock lock(observersMutex_); + + auto &observers = observersBySurfaceId_[surfaceId]; + observers.emplace_back(IntersectionObserver{ + intersectionObserverId, shadowNode, std::move(thresholds)}); + observer = &observers.back(); + } + + // Notification of initial state. + // Ideally, we'd have well defined event loop step to notify observers + // (like on the Web) and we'd send the initial notification there, but as + // we don't have it we have to run this check once and manually dispatch. + auto &shadowTreeRegistry = uiManager.getShadowTreeRegistry(); + MountingCoordinator::Shared mountingCoordinator = nullptr; + RootShadowNode::Shared rootShadowNode = nullptr; + shadowTreeRegistry.visit(surfaceId, [&](ShadowTree const &shadowTree) { + mountingCoordinator = shadowTree.getMountingCoordinator(); + rootShadowNode = shadowTree.getCurrentRevision().rootShadowNode; + }); + auto hasPendingTransactions = mountingCoordinator != nullptr && + mountingCoordinator->hasPendingTransactions(); + + if (!hasPendingTransactions) { + auto entry = observer->updateIntersectionObservation( + *rootShadowNode, JSExecutor::performanceNow()); + if (entry) { + { + std::unique_lock lock(pendingEntriesMutex_); + pendingEntries_.push_back(std::move(entry).value()); + } + notifyObserversIfNecessary(); + } + } +} + +void IntersectionObserverManager::unobserve( + IntersectionObserverObserverId intersectionObserverId, + ShadowNode const &shadowNode) { + SystraceSection s("IntersectionObserverManager::unobserve"); + + std::unique_lock lock(observersMutex_); + + auto surfaceId = shadowNode.getSurfaceId(); + + auto observersIt = observersBySurfaceId_.find(surfaceId); + if (observersIt == observersBySurfaceId_.end()) { + return; + } + + auto &observers = observersIt->second; + + observers.erase( + std::remove_if( + observers.begin(), + observers.end(), + [intersectionObserverId, &shadowNode](auto const &observer) { + return observer.getIntersectionObserverId() == + intersectionObserverId && + ShadowNode::sameFamily( + observer.getTargetShadowNode(), shadowNode); + }), + observers.end()); + + if (observers.empty()) { + observersBySurfaceId_.erase(surfaceId); + } +} + +void IntersectionObserverManager::connect( + UIManager &uiManager, + std::function notifyIntersectionObserversCallback) { + SystraceSection s("IntersectionObserverManager::connect"); + notifyIntersectionObserversCallback_ = + std::move(notifyIntersectionObserversCallback); + + // Fail-safe in case the caller doesn't guarantee consistency. + if (mountHookRegistered_) { + return; + } + + uiManager.registerMountHook(*this); + mountHookRegistered_ = true; +} + +void IntersectionObserverManager::disconnect(UIManager &uiManager) { + SystraceSection s("IntersectionObserverManager::disconnect"); + + // Fail-safe in case the caller doesn't guarantee consistency. + if (!mountHookRegistered_) { + return; + } + + uiManager.unregisterMountHook(*this); + mountHookRegistered_ = false; + notifyIntersectionObserversCallback_ = nullptr; +} + +std::vector +IntersectionObserverManager::takeRecords() { + std::unique_lock lock(pendingEntriesMutex_); + + notifiedIntersectionObservers_ = false; + + std::vector entries; + pendingEntries_.swap(entries); + return entries; +} + +void IntersectionObserverManager::shadowTreeDidMount( + RootShadowNode::Shared const &rootShadowNode, + double mountTime) noexcept { + updateIntersectionObservations(*rootShadowNode, mountTime); +} + +void IntersectionObserverManager::updateIntersectionObservations( + RootShadowNode const &rootShadowNode, + double mountTime) { + SystraceSection s( + "IntersectionObserverManager::updateIntersectionObservations"); + + std::vector entries; + + // Run intersection observations + { + std::shared_lock lock(observersMutex_); + + auto surfaceId = rootShadowNode.getSurfaceId(); + + auto observersIt = observersBySurfaceId_.find(surfaceId); + if (observersIt == observersBySurfaceId_.end()) { + return; + } + + auto &observers = observersIt->second; + for (auto &observer : observers) { + auto entry = + observer.updateIntersectionObservation(rootShadowNode, mountTime); + if (entry) { + entries.push_back(std::move(entry).value()); + } + } + } + + { + std::unique_lock lock(pendingEntriesMutex_); + pendingEntries_.insert( + pendingEntries_.end(), entries.begin(), entries.end()); + } + + notifyObserversIfNecessary(); +} + +/** + * This method allows us to avoid scheduling multiple calls to notify observers + * in the JS thread. We schedule one and skip subsequent ones (we just append + * the entries to the pending list and wait for the scheduled task to consume + * all of them). + */ +void IntersectionObserverManager::notifyObserversIfNecessary() { + bool dispatchNotification = false; + + { + std::unique_lock lock(pendingEntriesMutex_); + + if (!pendingEntries_.empty() && !notifiedIntersectionObservers_) { + notifiedIntersectionObservers_ = true; + dispatchNotification = true; + } + } + + if (dispatchNotification) { + notifyObservers(); + } +} + +void IntersectionObserverManager::notifyObservers() { + SystraceSection s("IntersectionObserverManager::notifyObservers"); + notifyIntersectionObserversCallback_(); +} + +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.h b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.h new file mode 100644 index 00000000000000..4691febc7524f0 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverManager.h @@ -0,0 +1,74 @@ +/* + * 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 +#include +#include +#include +#include +#include "IntersectionObserver.h" + +namespace facebook::react { + +class IntersectionObserverManager final : public UIManagerMountHook { + public: + IntersectionObserverManager(); + + void observe( + IntersectionObserverObserverId intersectionObserverId, + const ShadowNode::Shared &shadowNode, + std::vector thresholds, + UIManager const &uiManager); + + void unobserve( + IntersectionObserverObserverId intersectionObserverId, + ShadowNode const &shadowNode); + + void connect( + UIManager &uiManager, + std::function notifyIntersectionObserversCallback); + + void disconnect(UIManager &uiManager); + + std::vector takeRecords(); + +#pragma mark - UIManagerMountHook + + void shadowTreeDidMount( + RootShadowNode::Shared const &rootShadowNode, + double mountTime) noexcept override; + + private: + mutable std::unordered_map> + observersBySurfaceId_; + mutable std::shared_mutex observersMutex_; + + mutable std::function notifyIntersectionObserversCallback_; + + mutable std::vector pendingEntries_; + mutable std::mutex pendingEntriesMutex_; + + mutable bool notifiedIntersectionObservers_{}; + mutable bool mountHookRegistered_{}; + + void notifyObserversIfNecessary(); + void notifyObservers(); + + // Equivalent to + // https://w3c.github.io/IntersectionObserver/#update-intersection-observations-algo + void updateIntersectionObservations( + RootShadowNode const &rootShadowNode, + double mountTime); + + IntersectionObserver const &getRegisteredIntersectionObserver( + SurfaceId surfaceId, + IntersectionObserverObserverId observerId) const; +}; + +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.cpp b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.cpp new file mode 100644 index 00000000000000..79feead1cac578 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.cpp @@ -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 "IntersectionObserverState.h" + +namespace facebook::react { + +IntersectionObserverState IntersectionObserverState::Initial() { + static const IntersectionObserverState state = + IntersectionObserverState(IntersectionObserverStateType::Initial); + return state; +} + +IntersectionObserverState IntersectionObserverState::NotIntersecting() { + static const IntersectionObserverState state = + IntersectionObserverState(IntersectionObserverStateType::NotIntersecting); + return state; +} + +IntersectionObserverState IntersectionObserverState::Intersecting( + Float threshold) { + return IntersectionObserverState( + IntersectionObserverStateType::Intersecting, threshold); +} + +IntersectionObserverState::IntersectionObserverState( + IntersectionObserverStateType state) + : state_(state) {} + +IntersectionObserverState::IntersectionObserverState( + IntersectionObserverStateType state, + Float threshold) + : state_(state), threshold_(threshold) {} + +bool IntersectionObserverState::isIntersecting() const { + return state_ == IntersectionObserverStateType::Intersecting; +} + +bool IntersectionObserverState::operator==( + const IntersectionObserverState &other) const { + if (state_ != other.state_) { + return false; + } + + if (state_ != IntersectionObserverStateType::Intersecting) { + return true; + } + + return threshold_ == other.threshold_; +} + +bool IntersectionObserverState::operator!=( + const IntersectionObserverState &other) const { + return !(*this == other); +} +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.h b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.h new file mode 100644 index 00000000000000..67ae4e98c93861 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/observers/intersection/IntersectionObserverState.h @@ -0,0 +1,46 @@ +/* + * 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 + +namespace { +enum class IntersectionObserverStateType { + Initial, + NotIntersecting, + Intersecting, +}; +} + +namespace facebook::react { + +class IntersectionObserverState { + public: + static IntersectionObserverState Initial(); + static IntersectionObserverState NotIntersecting(); + static IntersectionObserverState Intersecting(Float threshold); + + bool isIntersecting() const; + + bool operator==(const IntersectionObserverState &other) const; + bool operator!=(const IntersectionObserverState &other) const; + + private: + explicit IntersectionObserverState(IntersectionObserverStateType state); + IntersectionObserverState( + IntersectionObserverStateType state, + Float threshold); + + IntersectionObserverStateType state_; + + // This value is only relevant if the state is + // IntersectionObserverStateType::Intersecting. + Float threshold_{}; +}; + +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp index 9d8daa8fd4df87..ef4100ef6c4df9 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp @@ -1179,4 +1179,8 @@ jsi::Value UIManagerBinding::get( return jsi::Value::undefined(); } +UIManager &UIManagerBinding::getUIManager() { + return *uiManager_; +} + } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.h b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.h index 0be85f6dc887f5..b2180ea4ede328 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.h +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.h @@ -68,6 +68,8 @@ class UIManagerBinding : public jsi::HostObject { */ jsi::Value get(jsi::Runtime &runtime, jsi::PropNameID const &name) override; + UIManager &getUIManager(); + private: std::shared_ptr uiManager_; std::unique_ptr eventHandler_; From a94bbfbe0e7a1c72350d92f4610ad6181a569abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Fri, 23 Jun 2023 02:56:04 -0700 Subject: [PATCH 356/468] Enable IntersectionObserver in Catalyst and RNTester (#37863) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37863 This creates 2 examples for IntersectionObserver in RNTester: * The first example is just a copy of the example provided by MDN in the documentation page for `IntersectionObserver` (https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API). This example is useful to show how React Native behaves the same way with the same code. * The second example is a "stress test" for the API: a screen with 500 simultaneous node being observed at the same time with different observers. As we compute the intersections after scroll (after "mounting" the state update with the updated scroll position) in the main thread, this highlights a possible impact on scroll performance. IntersectionObserver isn't yet enabled by default, so no need to add a changelog entry about this. We'll add one when the API becomes generally available. Changelog: [Internal] Reviewed By: rshest Differential Revision: D45736845 fbshipit-source-id: 40b6bce39f90e04653504b1033a4edfaa65e93ca --- .../rn-tester/js/components/RNTTestDetails.js | 9 +- .../IntersectionObserverBenchmark.js | 127 +++++++++++++++ .../IntersectionObserverIndex.js | 25 +++ .../IntersectionObserverMDNExample.js | 149 ++++++++++++++++++ .../js/utils/RNTesterList.android.js | 12 +- .../rn-tester/js/utils/RNTesterList.ios.js | 12 +- 6 files changed, 327 insertions(+), 7 deletions(-) create mode 100644 packages/rn-tester/js/examples/IntersectionObserver/IntersectionObserverBenchmark.js create mode 100644 packages/rn-tester/js/examples/IntersectionObserver/IntersectionObserverIndex.js create mode 100644 packages/rn-tester/js/examples/IntersectionObserver/IntersectionObserverMDNExample.js diff --git a/packages/rn-tester/js/components/RNTTestDetails.js b/packages/rn-tester/js/components/RNTTestDetails.js index 1a64dca9ef458e..2bc82dedbb590b 100644 --- a/packages/rn-tester/js/components/RNTTestDetails.js +++ b/packages/rn-tester/js/components/RNTTestDetails.js @@ -29,8 +29,12 @@ function RNTTestDetails({ <> {description == null ? null : ( - Description - {description} + + Description + + + {description} + )} {expect == null ? null : ( @@ -78,7 +82,6 @@ const styles = StyleSheet.create({ }, heading: { fontSize: 16, - color: 'grey', fontWeight: '500', }, paragraph: { diff --git a/packages/rn-tester/js/examples/IntersectionObserver/IntersectionObserverBenchmark.js b/packages/rn-tester/js/examples/IntersectionObserver/IntersectionObserverBenchmark.js new file mode 100644 index 00000000000000..7932f6dc2ff7cd --- /dev/null +++ b/packages/rn-tester/js/examples/IntersectionObserver/IntersectionObserverBenchmark.js @@ -0,0 +1,127 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @flow strict-local + */ + +import {RNTesterThemeContext} from '../../components/RNTesterTheme'; + +import * as React from 'react'; +import { + useLayoutEffect, + useState, + useRef, + type ElementRef, + useContext, +} from 'react'; +import {Button, ScrollView, StyleSheet, Text, View} from 'react-native'; + +export const name = 'IntersectionObserver Benchmark'; +export const title = name; +export const description = + 'Example of using IntersectionObserver to observe a large amount of UI elements'; + +export function render(): React.Node { + return ; +} + +const ROWS = 100; +const COLUMNS = 5; + +function IntersectionObserverBenchark(): React.Node { + const [isObserving, setObserving] = useState(false); + + return ( + <> + +