Граф коммитов

24102 Коммитов

Автор SHA1 Сообщение Дата
Gabriel Donadel Dall'Agnol 6b61995647 build(deps): Bump android Appcompat to 1.4.1 (#33072)
Summary:
Currently we are using Appcompat in version 1.0.2 which is almost 4 years old now, this PR updates it to version 1.4.1.

Using Appcompat 1.0.2 was also causing a crash on RNTester due to an error where FontFamily's method was not found (Related to https://github.com/facebook/react-native/issues/33065)

Closes https://github.com/facebook/react-native/issues/31620

## Changelog

[Android] [Changed] - Bump android Appcompat to 1.4.1

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

Test Plan: Use `./scripts/test-manual-e2e.sh` to test both RNTester and a new app

Reviewed By: cortinico

Differential Revision: D34107105

Pulled By: ShikaSD

fbshipit-source-id: 966e4687b09ae50a88ee518622f073d72e8c6550
2022-02-10 09:52:59 -08:00
Nicola Corti 327c4d7a08 Place Android.mk dependencies on separate lines for codegen.
Summary:
That's a really nit change, but when we moved the Makefile deps to be on separate
lines, we havent' done the same for the codegen. Here I'm doing it.

Changelog:
[Internal] [Changed] - Place Android.mk dependencies on separate lines for codegen

Reviewed By: ShikaSD

Differential Revision: D34144715

fbshipit-source-id: be9d5fb75b6b93c0b2bb479145053ae6f201e1fc
2022-02-10 09:40:52 -08:00
Ramanpreet Nara e254073b17 Update ViewConfigIgnore comment
Summary:
This comment was out of date.

Changelog: [Internal]

Reviewed By: sshic

Differential Revision: D34113966

fbshipit-source-id: 0768baa9238736aea26e354792096fea6bb7fcdb
2022-02-10 08:47:22 -08:00
Ian Childs 172f990dcf exported and provided dep should be exported_provided_dep
Reviewed By: astreet

Differential Revision: D34108185

fbshipit-source-id: 72a6c9fb3654d674df405faac49dfbe67fe193b7
2022-02-10 07:47:52 -08:00
Samuel Susla e47e869a00 Remove gating for react_fabric.enableV2AsynchronousEventBeat
Summary:
changelog: [internal]

enableV2AsynchronousEventBeat is shipped, let's remove gating

Reviewed By: javache

Differential Revision: D34108109

fbshipit-source-id: 0264c85cf01f011ab368d56e12f79cc978f9e106
2022-02-10 06:53:20 -08:00
Andrei Shikov 980c52de41 Disable view flattening when the view has event handlers on Android
Summary:
The views with touch event props are currently flattened by Fabric core, as we don't take event listeners into account when calculating whether the view should be flattened. This results in a confusing situation when components with touch event listeners (e.g. `<View onTouchStart={() => {}} /> `) or ones using `PanResponder` are either ignored (iOS) or cause a crash (Android).

This change passes touch event props to C++ layer and uses them to calculate whether the view node should be flattened or not. It also refactors events to be kept as a singular bitset with 32 bit (~`uint32_t`).

Changelog: [Changed][General] Avoid flattening nodes with event props

Reviewed By: sammy-SC

Differential Revision: D34005536

fbshipit-source-id: 96255b389a7bfff4aa208a96fd0c173d9edf1512
2022-02-10 06:07:39 -08:00
Kuba Holuj 9ed2df628d Fix StatusBar on Android API 30 (#33058)
Summary:
In https://github.com/facebook/react-native/issues/32975 I implemented the new `insetsController#setSystemBarsAppearance` interface, but I found that on Android 11 (API 30) it doesn't appear to work which I missed in earlier testing. It works correctly on Android 12 and the deprecated `systemUiVisibility` interface still works fine on Android 11, so I'm having Android 11 use the deprecated mechanism.

## Changelog

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

[Android] [Fixed] - Fix StatusBar on Android API 30

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

Test Plan: Tested in `rn-tester` on simulators using Android 9, 10, 11, 12, and on an Android 9 device.

Reviewed By: lunaleaps

Differential Revision: D34050025

Pulled By: ShikaSD

fbshipit-source-id: ad80fae1446aca368b09df810785a1cc38383450
2022-02-10 05:31:30 -08:00
John Porto b467094f18 Add StringPrimitive::create for UTF8 strings
Summary:
This is pre-work for adding the v8 stack trace API support.

Changelog: [Internal]

Reviewed By: kodafb

Differential Revision: D34048366

fbshipit-source-id: 9d2b469767f7669cb428c61b215f193894892c03
2022-02-10 05:00:32 -08:00
Moti Zilberman 159eb0bdf4 Normalize platform colors early
Summary:
Changelog: [Internal]

Fixes `normalizeColor` to always return the normalized color. Previously, when normalization was delegated to `normalizeColorObject`, we would return the *original* color object, which is a bug.

Reviewed By: javache

Differential Revision: D34048595

fbshipit-source-id: 083cbe36be2311ea9cffe8ef61e6a986840aec71
2022-02-10 04:57:47 -08:00
Minsik Kim 1a83dc36ce Fix a broken input for the Korean alphabet in TextInput (#32523)
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

Fix https://github.com/facebook/react-native/issues/32503

Updating the attributed text in TextView/TextField while inputting Korean language will break input mechanism of the Korean alphabet. This results unexpected text input.

This PR supersedes the previous fixes: https://github.com/facebook/react-native/issues/19809, https://github.com/facebook/react-native/issues/22546

## Changelog

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

[iOS] [Fixed] - Fix a broken input for the Korean alphabet in TextInput

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

Test Plan: https://user-images.githubusercontent.com/20317121/140013434-1674c391-54d6-4410-b4c1-c633697e639d.mov

Reviewed By: lunaleaps, sammy-SC

Differential Revision: D32470543

Pulled By: philIip

fbshipit-source-id: e7e34bd362fa2ab2ca579103db01ad8d1a891c35
2022-02-09 22:06:55 -08:00
Ian Childs f7e7e89335 provided_dep does not need to be a dep too
Differential Revision: D34108108

fbshipit-source-id: b31d2e87c8dcbe5a9b2ad9d74c54958cf1571026
2022-02-09 16:21:55 -08:00
Xin Chen fc7eb91f56 Add RedBoxSurfaceDelegate to DevSupportManagerBase to abstract surface logic to show RedBox
Summary:
This diff adds `RedBoxSurfaceDelegate` to replace existing logic in `DevSupportManagerBase` to abstract how we show/hide the RedBox surface. The delegate will wrap a RedBoxDialog instance, which is used to show/hide the dialog for default behavior (when there is no surface delegate for redbox got provided).

I also updated the interface for delegate to accomodate new use cases:
- Add `isShowing` for the `SurfaceDelegate`
- Add a list of getters for `DevSupportManager` for data access in the delegate
- (Update 2/7) Separate Dialog from `RedBoxDialog`, and re-named it to `RedBoxContentView`. This is to make it clear that the delegate is responsible to provide actual surface implementation (Dialog). The content view is meant to be shared.

Changelog:
[Android][Internal]

Reviewed By: javache

Differential Revision: D33987835

fbshipit-source-id: 57c20648e7f2ec8238963feca27ccd5518e7931d
2022-02-09 15:16:22 -08:00
Hamid 5341ad8962 use root locale when converting string case (#33028)
Summary:
Not setting locale for language/country neutral operation may cause bug depending on the default locale.
See https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#ROOT

Note: I am just searching for toLowerCase() and toUppercase() in my project's dependencies and send the same PR, in order to just be considered. Although I've seen the lack of explicit locale has caused issues for us, I am not sure if react-native is actually affected. I haven't checked for `String.format()` yet.

Example related issue: joltup/rn-fetch-blob#573

## Changelog

[Android] [Fixed] - Use root locale when converting string case.

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

Reviewed By: ShikaSD

Differential Revision: D33943446

Pulled By: cortinico

fbshipit-source-id: d5be9392ea7c21a33436acac5b5e8c50b7c7e31e
2022-02-09 14:06:34 -08:00
Aniket Mathur 4f42f4d18f Revert D34084935: Fix analysis errors with the FBCODE platform
Differential Revision:
D34084935 (216ac27aa3)

Original commit changeset: 8199b0b16b6b

Original Phabricator Diff: D34084935 (216ac27aa3)

fbshipit-source-id: b5d725854c92282b2e5eddeff48d6b57b2318c1f
2022-02-09 13:16:07 -08:00
Chiara Mooney 42b391775f Fix ReactCommon Break for Windows (#33047)
Summary:
Changes to MapBuffer code in aaff15c...d287598 broke build for Windows. Errors included incompatible type conversions, the use of `__attribute__(__packed__)` which is only supported by GCC and Clang, and the usage of designated initializers which are only supported on C++20.

Changes here restore build on Windows.

## Changelog

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

[General] [Fixed] - Fix build break on Windows with ReactCommon

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

Test Plan: React Native project built on Windows and passes react-native-windows repository pipeline. These edits are currently merged into the main branch of react-native-windows.

Reviewed By: ShikaSD

Differential Revision: D34101367

Pulled By: philIip

fbshipit-source-id: 1596365c2e92f377c6375805b33de5e1c7b78e66
2022-02-09 13:03:10 -08:00
Aniket Mathur 216ac27aa3 Fix analysis errors with the FBCODE platform (#33073)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33073

Differential Revision: D34084935

fbshipit-source-id: 8199b0b16b6b390a09138cf30b4056c578d2354f
2022-02-09 12:43:29 -08:00
Nicola Corti 3d8a7fe14a Set Java source/target compatibility for react-native-gradle-plugin to 8
Summary:
This is necessary otherwise when building from source on JVM < 11, the `compileJava`
task of the Gradle Plugin will fail with `invalid source: 11`.
Essentially the Gradle build will not even start because of this. Instead we delegate
to a better formatted warning from either AGP or from our plugin.

Changelog:
[Internal] [Changed] - Set Java source/target compatibility for react-native-gradle-plugin to 8

Reviewed By: ShikaSD

Differential Revision: D34111799

fbshipit-source-id: 57ab11fe6c4532576776b586f75e8fcb5c71adcd
2022-02-09 12:06:54 -08:00
Kacie Bawiec a6c792db0b React Native sync for revisions 51947a1...a3bde79
Summary:
This sync includes the following changes:
- **[a3bde7974](https://github.com/facebook/react/commit/a3bde7974 )**: Exclude react-dom/unstable_testing entry point from stable releases ([#23258](https://github.com/facebook/react/pull/23258)) //<Sebastian Markbåge>//
- **[569093276](https://github.com/facebook/react/commit/569093276 )**: Add onErrorShell Callback ([#23247](https://github.com/facebook/react/pull/23247)) //<Sebastian Markbåge>//
- **[0dedfcc68](https://github.com/facebook/react/commit/0dedfcc68 )**: Update the exports field ([#23257](https://github.com/facebook/react/pull/23257)) //<Sebastian Markbåge>//
- **[9d4e8e84f](https://github.com/facebook/react/commit/9d4e8e84f )**: React Native raw event EventEmitter - intended for app-specific perf listeners and debugging ([#23232](https://github.com/facebook/react/pull/23232)) //<Joshua Gross>//
- **[1dece5235](https://github.com/facebook/react/commit/1dece5235 )**: Add back warning with component stack on Hydration mismatch ([#23241](https://github.com/facebook/react/pull/23241)) //<salazarm>//
- **[cd4eb116c](https://github.com/facebook/react/commit/cd4eb116c )**: Revert "update node.js version for CI ([#23236](https://github.com/facebook/react/pull/23236))" ([#23239](https://github.com/facebook/react/pull/23239)) //<dan>//
- **[1d7728bf9](https://github.com/facebook/react/commit/1d7728bf9 )**: update node.js version for CI ([#23236](https://github.com/facebook/react/pull/23236)) //<sunderls>//
- **[848e802d2](https://github.com/facebook/react/commit/848e802d2 )**: Add onRecoverableError option to hydrateRoot, createRoot ([#23207](https://github.com/facebook/react/pull/23207)) //<Andrew Clark>//
- **[5318971f5](https://github.com/facebook/react/commit/5318971f5 )**: Remove logic for multiple error recovery attempts ([#23227](https://github.com/facebook/react/pull/23227)) //<Andrew Clark>//
- **[3a4462129](https://github.com/facebook/react/commit/3a4462129 )**: Disable avoidThisFallback support in Fizz  ([#23224](https://github.com/facebook/react/pull/23224)) //<salazarm>//
- **[0318ac2c4](https://github.com/facebook/react/commit/0318ac2c4 )**: Revert 4f5449 //<Ricky>//
- **[4f5449eb4](https://github.com/facebook/react/commit/4f5449eb4 )**: Remove main from scheduler `index.js` //<Ricky>//
- **[3f5ff16c1](https://github.com/facebook/react/commit/3f5ff16c1 )**: [Hydration] Fallback to client render if server rendered extra nodes ([#23176](https://github.com/facebook/react/pull/23176)) //<salazarm>//
- **[529dc3ce8](https://github.com/facebook/react/commit/529dc3ce8 )**: Fix context providers in SSR when handling multiple requests ([#23171](https://github.com/facebook/react/pull/23171)) //<Fran Dios>//
- **[505c15c9e](https://github.com/facebook/react/commit/505c15c9e )**: Don't inject timeline hooks unless React supports profiling ([#23151](https://github.com/facebook/react/pull/23151)) //<Brian Vaughn>//
- **[e12a9dfc9](https://github.com/facebook/react/commit/e12a9dfc9 )**: Fix production-only updateSyncExternalStore() crash when doing setState in render ([#23150](https://github.com/facebook/react/pull/23150)) //<Douglas Armstrong>//
- **[e48940255](https://github.com/facebook/react/commit/e48940255 )**: Warn when a callback ref returns a function ([#23145](https://github.com/facebook/react/pull/23145)) //<Dan Abramov>//
- **[d8cfeaf22](https://github.com/facebook/react/commit/d8cfeaf22 )**: Fix context propagation for offscreen/fallback trees ([#23095](https://github.com/facebook/react/pull/23095)) //<Dan Abramov>//
- **[d50482478](https://github.com/facebook/react/commit/d50482478 )**: Enable scheduling profiler flag in react-dom/testing builds ([#23142](https://github.com/facebook/react/pull/23142)) //<Brian Vaughn>//
- **[790b5246f](https://github.com/facebook/react/commit/790b5246f )**: Fix setState ignored in Safari when iframe is added to DOM in the same commit ([#23111](https://github.com/facebook/react/pull/23111)) //<Dan Abramov>//

Changelog:
[General][Changed] - React Native sync for revisions 51947a1...a3bde79

jest_e2e[run_all_tests]

Reviewed By: ShikaSD

Differential Revision: D34108924

fbshipit-source-id: 96acb66c1a7da79d6ef9403490cd0e29ad23d9fb
2022-02-09 11:24:29 -08:00
Andrei Shikov 3112238b14 De-duplicate conversion of SharedColor to Android int value
Summary:
Removes duplicated code in SharedColor conversions. The original copy was done for the MapBuffer experiment, as the method was returning `folly::dynamic` instead of integer. Nothing prevents us from returning integer here directly, so we can keep one implementation.

Changelog: [Internal] - Removed duplicated SharedColor conversion for Android

Reviewed By: javache

Differential Revision: D33797490

fbshipit-source-id: 196657f0616e6cb7e987225b76328fe77fd6c28a
2022-02-09 10:26:30 -08:00
Muhammad Numan 4e947ecb2d fix: jvm 11 error message from ReactPlugin.kt and react.gradle (#33048)
Summary:
you can see discussion here: https://github.com/reactwg/react-native-releases/discussions/13#discussioncomment-2069527
we were getting this error message when we build Gradle with other than 11 JVM
```
> Task :react-native-gradle-plugin:compileJava FAILED
2 actionable tasks: 2 executed

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-gradle-plugin:compileJava'.
> invalid source release: 11
```
this solution is suggested by mikehardy

after this PR, now the error is like this
```
**************************************************************************************************************

ERROR: requires JDK11 or higher.
Incompatible major version detected: '8'

**************************************************************************************************************
```

## Changelog

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

[Android] [Fixed] - jvm 11 error message

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

Test Plan: install other than 11 java version and just run `./scripts/test-manual-e2e.sh` this command at the root of RN repo than this error will appair `invalid source release: 11`

Reviewed By: ShikaSD

Differential Revision: D34110990

Pulled By: cortinico

fbshipit-source-id: c142a363c7cec0db65d5ab9da858fd25866c7c49
2022-02-09 10:23:27 -08:00
David Vacca eafa5bcb38 Log timestamp in ReactMarker.logFabricMarker method
Summary:
Ensure we always log a timestamp in ReactMarker.logFabricMarker

changelog: [internal] internal

Reviewed By: ShikaSD

Differential Revision: D34006699

fbshipit-source-id: 79ff1005ba1f0ed44bf319e50a80dbdebd1ec24f
2022-02-09 10:03:34 -08:00
Nicola Corti 8ee1f832b6 Update `test_android_template` to use `build_npm_package` (#33068)
Summary:
I'm updating the `test_android_template` CI step to use the result of `build_npm_package` instead of sed-ing the RN version to `file:..`.
This should be more robust and will allow to install transitive deps automatically, without having to deal with separate installation steps.

This also fixes the broken CI for Android

Changelog:
[Internal] [Changed] - Update `test_android_template` to use `build_npm_package`

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

Reviewed By: ShikaSD

Differential Revision: D34083047

Pulled By: cortinico

fbshipit-source-id: de34472d5737db445cfc0d4b1c6feaf1e746bb61
2022-02-09 08:38:56 -08:00
Pieter De Baets a75bbe7552 Fix docs in ModalHostView headers
Summary:
Copy-paste error

Changelog: [Internal]

Reviewed By: genkikondo

Differential Revision: D34077530

fbshipit-source-id: 04ab17ba9308762361d993b7ed1b372af400b8d1
2022-02-09 03:03:09 -08:00
David Vacca 97064ae1fb Fix DarkMode for DatePickerDialogFragment
Summary:
Fix DarkMode for DatePickerDialogFragment

changelog: [Android][Fixed] Fix DarkMode on Calendar DateTimePicker

Reviewed By: JoshuaGross

Differential Revision: D34092084

fbshipit-source-id: 4fbe3484bc7101c4b7d244671d7d46cae1c23bec
2022-02-08 20:46:58 -08:00
CodemodService FBSourceClangFormatLinterBot e737270d11 Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D34099214

fbshipit-source-id: 7a1fc8550968d8b87f016e4bf706252bf03e4483
2022-02-08 19:15:34 -08:00
Ramanpreet Nara 971ba5c26b Re-introduce {eventName}: true ViewConfig ValidAttributes in Static ViewConfigs
Summary:
# Problem
I removed the {eventName}: true entries from ViewConfigs validAttributes in D33303950 (ca5aaa7663). These entries were iOS-only. I removed them to achieve platform-consistency in native ViewConfigs.

This change broke the onLayout event for all React Native components. So, I reverted D33303950 (ca5aaa7663) for native ViewConfigs server-side. But I never got around to reverting D33303950 (ca5aaa7663) for static ViewConfigs.

# Changes
This diff reverts D33303950 (ca5aaa7663) for Static ViewConfigs, with server-side gating.

Now, these {eventName}: true ViewConfig validAttribute will be inserted into all view configs (static and native) **by default**.

Calling RCTDisableViewConfigEventValidAttributes(YES) on iOS will remove {eventName}: true ViewConfig ValidAttributes entries from Static ViewConfigs. (Previously, this method only removed the entries from native ViewConfigs).

https://www.internalfb.com/code/fbsource/[6615b0675bdf]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=344

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D33933403

fbshipit-source-id: 17823ed99f97d7851f04e5cdab9c95667df13253
2022-02-08 19:11:08 -08:00
Ramanpreet Nara f89ed90a1e Remove the onChange event for Slider
Summary:
The onChange event for slider isn't necessary. Instead, it uses onValueChanged.

## What motivated this change?
After D33933403, the SliderNativeComponent starts generating an onChange: true entry in its static ViewConfig's validAttributes map.

**The Problem:** Slider inherits the onChange event from RCTViewManager. And in RCTViewManager, onChange is defined as an event that doesn't generate a ViewConfig validAttribute:
1. onChange is exported from [RCTViewManager customBubblingEventTypes](https://www.internalfb.com/code/fbsource/[210a214c9da7a847dd8840cae9f8341ed39a2ff6]/xplat/js/react-native-github/React/Views/RCTViewManager.m?lines=99%2C105%2C118)
2. Events exported from customBubblingEventTypes [don't insert into validAttributes](https://www.internalfb.com/code/fbsource/[8237815744b8cf7e38d9cf107a55c015f7b1545b]/xplat/js/react-native-github/React/Views/RCTComponentData.m?lines=393-398).

To summarize:
- onChange isn't used by slider
- onChange generates an onChange: true entry in SVCs
- onChange **doesn't** generate an onChange: true entry in NVC

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D34052662

fbshipit-source-id: 76bfd75c1ecbaa40d33e2b097b1f4458bf200ac2
2022-02-08 19:11:07 -08:00
Ramanpreet Nara 95f950de2a Move validateStaticViewConfigs to RNHostComponentList route
Summary:
This function is only used by the RNHostComponentList route. Let's move it into the route, so that we could keep the StaticViewConfigValidator slim.

This will also allow us to more heavily customize this function for the route.

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D34026073

fbshipit-source-id: c3b3a93aed6007fadda2993afa52c28c028f6327
2022-02-08 17:41:06 -08:00
Genki Kondo bb435a2b11 Support AnimatedColor.setValue for platform colors
Summary:
In order to support AnimatedColor.setValue for platform colors, we need to pass the platform color object to the native animated node which will then resolve and apply the color.

Thus, the approach is:
- Add a new API updateAnimatedNodeConfig to NativeAnimatedModule
- [JS] On AnimatedColor.setValue, if the value is a platform color, then we call updateAnimatedNodeConfig
- [Android] We introduce AnimatedNodeWithUpdateableConfig interface with a method updateConfig. On ColorAnimatedNode.java, we use updateConfig to resolve and apply the color

Changelog:
[Internal][Fixed] - Use context from view when resolving platform color

Reviewed By: javache, mdvacca

Differential Revision: D34025193

fbshipit-source-id: 8b368f6b7cb2cf7cebe8b66461cd4185cbadd44c
2022-02-08 16:31:14 -08:00
Neil Dhar 5b66bb90c6 Add missing symbol handling in kindToString
Summary: Changelog: [Internal]

Reviewed By: kodafb

Differential Revision: D34062869

fbshipit-source-id: 08fed59d62b0d0a46e0868874a89b125731a44e5
2022-02-08 15:18:15 -08:00
Genki Kondo 1a044123fc Use context from view when resolving platform color if activity doesn't exist
Summary:
There are cases where the activity may not exist (such as for VRShell panel apps). In this case we will search for a view associated with a PropsAnimatedNode to get the context.

Changelog:
[Internal][Fixed] - Use context from view when resolving platform color if activity doesn't exist

Reviewed By: javache

Differential Revision: D34022882

fbshipit-source-id: c316935af1034ea770f3ef9334f77d6dc783fb27
2022-02-08 11:42:27 -08:00
Nicola Corti cd79317672 Remove `react-native-gradle-plugin` as a dependency from template's package.json
Summary:
We should now be able to remove the explicit `react-native-gradle-plugin` dependency
from the `template/package.json` file.

Changelog:
[Android] [Changed] - Remove `react-native-gradle-plugin` as a dependency from template's package.json

Reviewed By: motiz88

Differential Revision: D34050589

fbshipit-source-id: c8d4e4fba481af6b56723906b71411132d60aded
2022-02-08 08:47:31 -08:00
Nicola Corti 3346efb7d4 Make react-native depend on react-native-gradle-plugin
Summary:
Similarly to what we did for react-native-codegen, I'm introducing
a dependency between RN and the Gradle plugin, to be processed upon OSS bumps.

Changelog:
[General] [Added] - Make react-native depend on react-native-gradle-plugin

Reviewed By: motiz88

Differential Revision: D31334773

fbshipit-source-id: 978da4946b7864d891553e6a7dcb67783399e76f
2022-02-08 08:47:31 -08:00
Andrei Shikov ebc856b2de Check if view exists before skipping CREATE command
Summary:
Updates early return in the CREATE command codepath that checks if the view already exists before allocating it. Normally the view state is expected to be created only if the view is preallocated, but empty view state is also created for the flattened nodes when they create an event emitter.

By checking the view existence, we can ensure that view was indeed preallocated before, and skip for optimization purposes.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D34050884

fbshipit-source-id: 489fc1052fec9f71712ea729121ac8ef3e3f3d4e
2022-02-08 08:41:35 -08:00
Raphael Herouart 669cd0257c Test Chrome DevTools Notifications
Summary:
Some test to make sure hermes engine follows the Chrome DevTools Protocol for all implemented Debugger Notifications
Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D34055503

fbshipit-source-id: 8c2dd1066ba2b68e395226f15954d303894d0365
2022-02-08 06:46:31 -08:00
Raphael Herouart 921ed737eb Test Chrome DevTools Protocol Responses Format
Summary:
Some test to make sure hermes engine follows the Chrome DevTools Protocol for all implemented Debugger Responses
Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D34052619

fbshipit-source-id: d213ed41335b64bf3168a43ce043f2c57f05fc52
2022-02-08 06:46:30 -08:00
Joshua Gross 271b9132bc Rename RawEventTelemetryEventEmitter to RawEventEmitter
Summary:
This event listener does nothing by default and will do nothing if (developer) users don't explicitly create some telemetry system for their own app.

This EventEmitter makes that easier but isn't necessarily tied to telemetry, especially since it does nothing at all by default.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D34060116

fbshipit-source-id: 9345a52f502e0225358fdaa1431c052a70fa54ce
2022-02-07 18:19:53 -08:00
Joshua Gross 1f15a64028 Add RawEventTelemetryEventEmitter interface to ReactNativePrivateInterface
Summary:
This will be used from the React JS renderer in a followup PR.

Changelog: [Added][JS] New event telemetry mechanism exposed from JS to supercede the Pressability-specific telemetry mechanism

Reviewed By: ryancat

Differential Revision: D33986916

fbshipit-source-id: 912d0b351869348f0ca6e5f6a882fc0501c2c7f0
2022-02-07 15:44:17 -08:00
Xin Chen 97ce240a27 Update RedBoxDialog to separate content view and dialog
Summary:
This diff separates the content view creation logic from existing `RedBoxDialog` logic. After the change, `RedBoxDialog` is no longer a subclass of `Dialog`, but behaves like a dialog with forwarding pattern to delegate dialog API to internal member. This will keep the APIs consistent with dependent components.

The motivation of the change is to make the content view reusable. This is important in VR surface where we don't have activities and necessary implementations for Dialog to show.

Changelog:
[Android][Internal]

Reviewed By: javache

Differential Revision: D34016503

fbshipit-source-id: 261594bda9f6fb2d83764a1e5ec2e9e60d8d39a3
2022-02-07 15:31:15 -08:00
Xin Chen 99890bfacf Move RedBoxHandler interface to the proper interfaces directory
Summary:
We put the `:interfaces` target on the dependencies list for `:devsupport` target in the [BUCK file](https://fburl.com/code/lrr1c0pn). In the following diffs I will need to put the interface [`/devsupport/RedBoxHandler`](https://fburl.com/code/v53euvps) on to [`/devsupport/interfaces/DevSupportManager`](https://fburl.com/code/k8gwxa0f). This violates the dependency rule.

Since `RedBoxHandler` is an interface, I moved it to the interfaces list in this diff to unblock.

Changelog:
[Android][Internal]

Reviewed By: yungsters

Differential Revision: D33987834

fbshipit-source-id: 77a1ee14bd10c6bbaac2ee465ae7050e99ed0399
2022-02-07 13:43:49 -08:00
Marc Rousavy d1c2458930 fix: Fix Typo in Java Docs (#33050)
Summary:
Probably my smallest PR yet, this just fixes a comment in the template's Java files.

## Changelog

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

[CATEGORY] [TYPE] - Message

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

Reviewed By: christophpurrer

Differential Revision: D34045805

Pulled By: cortinico

fbshipit-source-id: a7355b4dbae84b79ee9d68e2524393d03cda67fc
2022-02-07 11:45:58 -08:00
Danilo Bürger 9a35818797 Use trait collection to resolve border colors (#32492)
Summary:
c974cbff04 changed the border colors to be of UIColor instead of CGColor. This allowed working with dark mode to switch the border colors automatically. However, in certain situation the system can't resolve the current trait collection (see https://stackoverflow.com/a/57177411/2525941). This commit resolves the colors with the current trait collection to ensure the right colors are selected. This matches with the behavior of how the background color is resolved (also in displayLayer:).

## Changelog

[iOS] [Fixed] - Resolve border platform color based on current trait collection

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

Test Plan: Same test plan as https://github.com/facebook/react-native/pull/29728

Reviewed By: sammy-SC

Differential Revision: D33819225

Pulled By: cortinico

fbshipit-source-id: 2f8024be7ee7b32d1852373b47fa1437cc569391
2022-02-07 10:24:47 -08:00
Samuel Susla 731429ebcf Enable RuntimeScheduler::callExpiredTasks on Android
Summary:
changelog: [internal]

In order to call `RuntimeScheduler::callExpiredTasks`, we need to pass it to `Scheduler` through context container.

Reviewed By: javache

Differential Revision: D34042293

fbshipit-source-id: 62d18507fb107c5be2ac9d003f63735aab6a09ac
2022-02-07 10:06:08 -08:00
Samuel Susla d79f658016 Rename RuntimeScheduler::callImmediates to RuntimeScheduelr::callExpiredTasks
Summary:
changelog: [internal]

Rename method so it does not collide with immediates that already exist in React Native.

Reviewed By: javache

Differential Revision: D34041418

fbshipit-source-id: 0ae75b683983c3be50320b195a7068d7178b0ed8
2022-02-07 10:06:07 -08:00
Pieter De Baets b0bae21249 Improve error when using mutable object as prop
Summary:
I was trying to add an object property to my ViewManager and got a really opaque error (and I almost thought Objects weren't supported by the codegen) until I realized it expected the object to wrapped in a $ReadOnly type.

Changelog: [Internal] Improved error in codegen

Reviewed By: mdvacca

Differential Revision: D34006557

fbshipit-source-id: b3ab15a40cb66fdcd377f4e68df92060498e8e7f
2022-02-07 09:06:31 -08:00
Raphael Herouart 31a92b008d Add some tests for compliance to the Chrome DevTools Protocol
Summary:
Some test to make sure hermes engine follows the Chrome DevTools Protocol for all implemented Debugger Messages

Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D34042008

fbshipit-source-id: 3a074e9840706ca977ff86d050e67b0dcea5c7ef
2022-02-07 09:06:31 -08:00
Samuel Susla ee454e4f0b Add description to ConcreteComponentDescriptor::adopt
Summary: changelog: [internal]

Reviewed By: javache

Differential Revision: D34041312

fbshipit-source-id: 3b6d650034481813273f67444426e2fa5cb7d59f
2022-02-07 09:03:56 -08:00
Hetan Thakkar 3eddc9abb7 Opacity in TouchableOpacity properly react to state change (#32956)
Summary:
This PR fixes the opacity bug where it fails to properly react to state change. This PR resolves the issue detailed in https://github.com/facebook/react-native/issues/32476

## Changelog

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

[General] [Fixed] - Fixed opacity value in TouchableOpacity

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

Test Plan: The code I added in componentDidUpdate does solve the issue and passes all the test cases

Reviewed By: ryancat

Differential Revision: D33766718

Pulled By: cortinico

fbshipit-source-id: 951bedf22619fc12e66156d0a6074cd8adf1d3eb
2022-02-07 04:23:01 -08:00
Phillip Pan 113f8257ce lift out prerendering logic into its own module
Summary: this is to break any unique dependencies this module is bringing in from the original module it was in.

Reviewed By: sammy-SC

Differential Revision: D33935581

fbshipit-source-id: 2ccf5b4a9d1dca1e6059cafb888091e450f6f980
2022-02-04 21:51:02 -08:00
Moses DeJong eb19499484 Enable custom sound for local notification in PushNotificationIOS
Summary:
Add soundName property in NativePushNotificationManagerIOS JS module and deliver to native local notification API.
Changelog:
[iOS][Fixed] - Enable custom sound for local push notifications.

Reviewed By: RSNara

Differential Revision: D33898630

fbshipit-source-id: c6362032601f0f6d20479465ce1f0a84c450ea72
2022-02-04 18:16:19 -08:00