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

23680 Коммитов

Автор SHA1 Сообщение Дата
CodemodService FBSourceClangFormatLinterBot 64711b0d98 Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D31891742

fbshipit-source-id: f6f6ad019e972de5acc8d04f0e8c8d9c9a2e3324
2021-10-25 04:08:21 -07:00
Andrew Rahn 72ea0e111f Hide the logbox window explicitly. New behavior in iOS SDK appears to… (#32435)
Summary:
Fixes  https://github.com/facebook/react-native/issues/32434: RCTLogBox window is orphaned, covering entire screen.

After this change, the logbox window once again is removed from the screen.

## Changelog

Some third-party SDKs may hold references to created UIWindow, UIViewController, or UIView objects. Doing so means that the current code's `hide` method that releases the reference to the UIWindow in LogBox will not cause the window to be dealloc'd, and thus instead it will remain on the screen. This change explicitly hides the LogBox window when the reference is released, so that even if some other SDK holds onto the window it will still be taken off the screen.

<!-- 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] - 32434

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

Test Plan:
1.     Use console.warn to generate a yellow warning message in log box.  Also install a third-party SDK that holds onto a reference to UIWindow -- for example the Facebook SDK, the Data Dog SDK, or any number of other SDKs that use `swizzling` to intercept calls like `viewDidAppear:`.
2.     click the log
3.     tap "dismiss"
4.     try to tap anywhere
5. Use Xcode view debugger to inspect the UI state

## Expected

The app still responds to the touch.
In Xcode, there is not an extra UIWindow covering the screen

Reviewed By: philIip

Differential Revision: D31794242

Pulled By: sshic

fbshipit-source-id: 28aa247b3ed3fd60b8e7c2ed7d0606cbf5c42408
2021-10-24 13:52:40 -07:00
Luna Wei ebe5417c7a Fix up dark mode for main lists
Summary: Changelog: [Internal] Fix up basic styling of dark mode for examples. Individual examples still may be broken and will be fixed up individually

Reviewed By: yungsters

Differential Revision: D31710790

fbshipit-source-id: 6ca4fb8a6238f38ff484ec91518057b243ba1d7b
2021-10-22 16:07:41 -07:00
Connor Tumbleson 4b25a0aaa0 feat: add missing Android dangerous permissions (#32445)
Summary:
This PR adds all missing `dangerous` permissions in Android. I recently updated these for Android 12 and found many more missing dating all the way back to API 26. After this PR, it will be in sync with ALL dangerous permissions as of the recently released Android 12.

https://developer.android.com/reference/android/Manifest.permission.html#ACCEPT_HANDOVER - 28
https://developer.android.com/reference/android/Manifest.permission.html#ACTIVITY_RECOGNITION - 29
https://developer.android.com/reference/android/Manifest.permission.html#ANSWER_PHONE_CALLS - 26
https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_NUMBERS - 26
https://developer.android.com/reference/android/Manifest.permission.html#UWB_RANGING - 31

## Changelog

[Android] [Changed] - Add ACCEPT_HANDOVER, ACTIVITY_RECOGNITION, ANSWER_PHONE_CALLS, READ_PHONE_NUMBERS & UWB_RANGING to PermissionsAndroid

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

Test Plan:
```
PermissionsAndroid.ACCEPT_HANDOVER === 'android.permission.ACCEPT_HANDOVER'
PermissionsAndroid.ACTIVITY_RECOGNITION === 'android.permission.ACTIVITY_RECOGNITION'
PermissionsAndroid.ANSWER_PHONE_CALLS === 'android.permission.ANSWER_PHONE_CALLS'
PermissionsAndroid.READ_PHONE_NUMBERS === 'android.permission.READ_PHONE_NUMBERS'
PermissionsAndroid.UWB_RANGING === 'android.permission.UWB_RANGING'
```

Reviewed By: yungsters

Differential Revision: D31793802

Pulled By: sshic

fbshipit-source-id: 4a2e5086e92ccd223e74db451c4ccd87485ffb63
2021-10-22 06:57:24 -07:00
Pieter De Baets b03e824c52 Mock composite animations when testing
Summary:
Single and composite animations were handled inconsistently in AnimatedMock. Also added a guard to prevent callbacks from triggering additional animations, since we had a test-scenario that did exactly that.

Changelog:
[General][Fixed] - Composite animations will now be ran immediately when the app is in testing mode

Reviewed By: yungsters

Differential Revision: D31826967

fbshipit-source-id: a6416b42e227fe79f5c3a55a9c51beb8451874f8
2021-10-22 06:38:17 -07:00
Nicola Corti e3a71b019f Bump react-native-codegen to 0.0.9
Summary:
Bumping the codegen to a new version to ship a change to the Android template.

Changelog:
[General] [Changed] - Bump react-native-codegen to 0.0.9

Reviewed By: hramos, mdvacca

Differential Revision: D31762139

fbshipit-source-id: 71a96210a3577c12ff3c9f9013c6e72adf4a0ecb
2021-10-22 03:09:24 -07:00
Tim Yung 3f629049ba RN: Deprecate Prop Types
Summary:
Deprecates `prop-types` from React Native.

Existing use cases will be presented with a warning to migrate to the newly published `deprecated-react-native-prop-types` module.

In a subsequent release, these will be removed from React Native.

Changelog:
[General][Changed] - Accessing `Image.propTypes`, `Text.propTypes`, `TextInput.propTypes`, `ColorPropType`, `EdgeInsetsPropType`, `PointPropType`, or `ViewPropTypes` now emits a deprecation warning.

Reviewed By: kacieb

Differential Revision: D29019309

fbshipit-source-id: 21e518e588fa05c498cc75ba81f69cfa8a9d0613
2021-10-21 17:45:47 -07:00
Gustavo Sverzut Barbieri 1e6add1a43 iOS Ruby Updates (#32456)
Summary:
Fix the `scripts/update-ruby.sh` so it always use the correct [bundle config](https://bundler.io/man/bundle-config.1.html#DESCRIPTION). In the current version it wasn't using the correct configuration inside the `template/` directory, resulting in incorrect platform for `template/Gemfile.lock`.

While at that, update the gems to their latest version:
- ethon 0.14.0 -> 0.15.0
- json 0.5.1 -> 0.6.0
- zeitwerk 2.4.2 -> 2.5.1
- bundler 2.2.28 -> 2.2.29

## Changelog

No changelog

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

Test Plan:
Run `bump-oss-version.js` and see `template/Gemfile.lock` lists `ruby` as the `PLATFORM` (no diff in that line).

## References
 - e18cf90d71 (r58230816)

Reviewed By: yungsters

Differential Revision: D31841524

Pulled By: charlesbdudley

fbshipit-source-id: 695c245fcb344c866afed45f747e04233e5c91e4
2021-10-21 15:58:18 -07:00
Héctor Ramos ad399f7a4f Utility script to discover codegen-enabled libraries
Summary:
Adds utility script which crawls through a React Native app's Node dependencies and, for each compatible library, generates the relevant native code artifacts.

This script is for development purposes, and is not hooked into the existing codegen integration by design.

Changelog: [Internal]

Reviewed By: sota000

Differential Revision: D28915433

fbshipit-source-id: de36d3e1dc0e11aad3ca55cea5e6731db09c5377
2021-10-21 15:24:30 -07:00
Tim Yung 70dcba9994 JS: Remove Unused Flow Suppressions
Summary:
Cleans up all unused Flow suppressions.

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D31754978

fbshipit-source-id: 951e28a245782b9bc9e93a6417d88b19ba0c8f1c
2021-10-21 14:26:00 -07:00
Xin Chen 7b77cc637e Change Vertical ScrollView to take Context instead of ReactContext
Summary:
The `ReactScrollView.java` constructor is using `ReactContext` instead of `Context`, which is inconsistent to the horizontal scroll view. This is the result from D3863966 (2cf2fdbc04) when an OSS issue needs to be addressed. That issue and all call sites to use the `ReactContext` are deprecated now.

Revert this back to use `Context` to be less restrictive.

Changelog:
[Android][Fixed] - Revert `ReactScrollView` to use `Context` instead of `ReactContext` in the constructor to be less restrictive.

Reviewed By: javache

Differential Revision: D31819799

fbshipit-source-id: 3f00d64850aebd2e20615033b2e1f1c721fed37e
2021-10-21 13:26:12 -07:00
Rubén Norte eccbf9b5cb Back out "Re-apply: [RN] Make runtime initialization from React renderers a no-op"
Summary:
Changelog: [internal]

This change had to be reverted because it caused some issues internally at Facebook. After we solved those we re-applied the changes but this also has issues in OSS apps. Specifically, the option in Metro to inject modules to execute before the EntryPoint (in this case `InitializeCore`) doesn't work if those modules aren't part of the bundle in the first place.

This reverts again so we can think about a long-term solution for this.

Original commit changeset: ba145a30ead5

Reviewed By: ShikaSD

Differential Revision: D31825736

fbshipit-source-id: 393b3d5d2a726951a9ac386dc2b1c19ef4a916a5
2021-10-21 04:29:07 -07:00
Pieter De Baets 8de8d475d4 Add surfaceId helper to Event baseclass
Summary:
Colocate the surface ID generate with the code that consumes it. This allows us to re-use this method in other event emitter locations.

Changelog: [Android][Changed] Add helper to get surfaceId for event dispatching

Reviewed By: philIip

Differential Revision: D31651881

fbshipit-source-id: 109e189f90261d3ba0077ffa519c3d12a9111439
2021-10-21 03:43:49 -07:00
Pieter De Baets 03e513de41 Add emitting view to onChildStartedNativeGesture callback
Summary:
Changelog:
[Android][Changed] RootView's onChildStartedNativeGesture now takes the child view as its first argument

Reviewed By: philIip

Differential Revision: D31399515

fbshipit-source-id: b9438f6118e604a04799ef67d0b46303a06d6434
2021-10-21 03:43:49 -07:00
CodemodService FBSourceGoogleJavaFormatLinterBot e007c8a9de Daily `arc lint --take GOOGLEJAVAFORMAT`
Reviewed By: zertosh

Differential Revision: D31824304

fbshipit-source-id: 146d9ca721773af1200ca01876387bcb44f95a40
2021-10-21 03:34:48 -07:00
Phillip Pan def7dd857d use new instead of alloc init
Summary:
i saw this a lot in the codebase, it's not optimal bc we're using two selectors when we only need one.

  fastmod --extensions m,mm '\[\[(.*) alloc] init]' '[${1} new]' --dir xplat/js/react-native-github/*

i manually updated the callsites that this codemod couldn't handle (e.g., where there were more than one of these instances in a single line)

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D31776561

fbshipit-source-id: 1b16da240e8a79b54da67383d548921b82b05a9f
2021-10-20 22:18:38 -07:00
Tim Yung 9ac03361e6 RN: Add `glob` Flow Definition
Summary:
Adds the `glob` type definition via `flow-typed` so that the `combine-js-to-schema-cli.js` script does not need a Flow suppression.

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D31800809

fbshipit-source-id: 3e01a096d2153639a619a7152bd06332df57f06b
2021-10-20 19:25:45 -07:00
Tuomas Jaakola d839b24b06 Load jsc or hermes lib in static method (#30749)
Summary:
Many have reported about the misguiding error `Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so` even though they don't use Hermes (for example issues https://github.com/facebook/react-native/issues/26075 #25923).

**The current code does not handle errors correctly when loading JSC or Hermes in `ReactInstanceManagerBuilder`**.

**ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.java:**
```java
try {
  return new HermesExecutorFactory();
} catch (UnsatisfiedLinkError hermesE) {
  // We never get here because "new HermesExecutorFactory()" does not throw an exception!
  hermesE.printStackTrace();
  throw jscE;
}
```

In Java, when an exception is thrown in static block, it will be RuntimeException and it can't be caught. For example the exception from `SoLoader.loadLibrary` can't be caught and it will crash the app.

**ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/HermesExecutor.java:**
```java
static {
  // Exception from this code block will be RuntimeException and it can't be caught!
  SoLoader.loadLibrary("hermes");
  try {
    SoLoader.loadLibrary("hermes-executor-debug");
    mode_ = "Debug";
  } catch (UnsatisfiedLinkError e) {
    SoLoader.loadLibrary("hermes-executor-release");
    mode_ = "Release";
  }
}
```

This PR fixes the code so that the original exception from failed JSC loading is not swallowed. It does not fix the original issue why JSC loading is failing with some devices, but it can be really helpful to know what the real error is. For example Firebase Crashlytics shows wrong stack trace with current code.

I'm sure that this fix could have been written better. It feels wrong to import `JSCExecutor` and `HermesExecutor` in `ReactInstanceManagerBuilder.java`. However, the main point of this PR is to give the idea what is wrong with the current code.

## 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 error handling when loading JSC or Hermes

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

Test Plan:
* from this PR, modify  `ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutor.java` so that JSC loading will fail:
```java
// original
SoLoader.loadLibrary("jscexecutor");
// changed
SoLoader.loadLibrary("jscexecutor-does-not-exist");
```
* Run `rn-tester` app
* Check from Logcat that the app crashed with correct exception and stacktrace. It should **not** be `java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so`

Tested with Hermes

```
    SoLoader.loadLibrary("hermes-executor-test");
```
Got this one in logcat
```
09-24 20:12:39.552  6412  6455 E AndroidRuntime: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes-executor-test.so
```

Reviewed By: cortinico

Differential Revision: D30346032

Pulled By: sota000

fbshipit-source-id: 09b032a9e471af233b7ac90b571c311952ab6342
2021-10-20 17:53:26 -07:00
Phillip Pan 6acb18ca5d do not return BOOL for start and stop methods
Summary:
Changelog: [Internal]

these are returning bools for some reason even though no one is using the returned value. changing them to return void

Reviewed By: RSNara

Differential Revision: D31594241

fbshipit-source-id: 04c115b573b74996eaf2fef631eedb12c6734ea8
2021-10-20 15:42:22 -07:00
Phillip Pan f1aabc5164 remove unnecessary public methods on RCTFabricSurface
Summary:
Changelog: [Internal]

`start` and `stop` are already part of `RCTSurfaceProtocol` which is a public protocol conformance, we don't need to add these to this header, it's just extra work for the compiler

Reviewed By: RSNara

Differential Revision: D31776005

fbshipit-source-id: d89ad4dbe35e1b67cfa750c6414c40f9b4fc7f24
2021-10-20 15:42:22 -07:00
Nicola Corti c7d0c94bf9 Update codegen template to include correct native modules and C++17
Summary:
This diff updates the Makefile generated by `react-native-codegen`
to include the correct list of modules. Specifically I've removed some modules that are unused
like `libreact_debug` and added others that are necessary for the build to compile correctly
such as `libfbjni`.

Plus I've bumped the C++ version to 17 as we had a mixture of 14 and 17 across the codebase.

Changelog:
[Internal] [Changed] - Update codegen template to include correct native modules and C++17

Reviewed By: mdvacca

Differential Revision: D31754427

fbshipit-source-id: 8490fa5c5ad298689b564f760c3fc65550c94547
2021-10-20 10:19:10 -07:00
Nicola Corti c980d0d5b8 Move Bug Report Issue template to Issue Form
Summary:
Similary to the `release_blocker_form` we already have, this is migrating the
Bug report template to be an issue form.

Changelog:
[Internal] [Changed] - Move Bug Report Issue template to Issue Form

Reviewed By: lunaleaps

Differential Revision: D31729676

fbshipit-source-id: e78d5f4e8776fead17d45d340d98932cc41681e9
2021-10-20 10:09:34 -07:00
Joshua Gross cd0dae00b1 Followup: fix rn_defs CircleCI build failures
Summary:
I missed some spots where an unsupported key (fbandroid_compiler_flags) was being referenced.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D31796826

fbshipit-source-id: 491b5121ef6461bef4a59c6aef65ce61f683341f
2021-10-20 10:01:26 -07:00
Nicola Corti 30df66c648 Use explicit codegen path in ReactAndroid
Summary:
This Diff is adapting the codegen configuration for ReactAndroid
to specify a path for the codegen package. I've used the `findNodeModulePath`
so this will work for both:
* The top level OSS project as `node_modules` will be at the top level
* The scenario where ReactAndroid will be included and built from source (as `node_modules` is in the `..` folder).

Changelog:
[Internal] [Changed] - Use explicit codegen path in ReactAndroid

Reviewed By: mdvacca

Differential Revision: D31730920

fbshipit-source-id: 6637da5d0098114f4379bcaeb8a40e976c46f194
2021-10-20 09:34:06 -07:00
Andrei Shikov d9689b90a4 Fix memory corruption issue in SurfaceHandler
Summary:
SurfaceHandlerBinding uses string from JVM memory when initializing, which is released before it is used. If JVM manages to collect this memory before instance init, it can lead to use-after-free.

Changelog:
[Internal] - fix memory corruption in cxx binding of surface handler

Reviewed By: mdvacca

Differential Revision: D31794515

fbshipit-source-id: 3944ebd065f42a516f036096d07c0126a43c912f
2021-10-20 08:28:23 -07:00
David Vacca 928519e4bd Remove extra invariant
Summary:
Remove extra invariant in Text.js

changelog: [internal] internal

Reviewed By: philIip

Differential Revision: D31628462

fbshipit-source-id: ec703c7b77dc842890865d79095b357a80dfa33d
2021-10-20 08:22:28 -07:00
Nicola Corti e5ad0b403e useJavaGenerator output should override the react-native-codegen one
Summary:
Turns out that the Java generator is (as expected) outputting only Java code.
Therefore the C++ and the Markdown files are still generated by `react-native-codegen`.
I'm updating the logic to make sure the Java generator is not mutually exclusive and
overrides the output of `react-native-codegen`

Changelog:
[Internal] [Changed] - useJavaGenerator output should override the react-native-codegen one

Reviewed By: sshic

Differential Revision: D31754428

fbshipit-source-id: 3e6dae8212fbfebd28247ec17e88243871265808
2021-10-20 06:11:20 -07:00
Nicola Corti afc96ab126 Safely access the project NDK properties
Summary:
This diff is making sure that we're not failing the build
if either `ANDROID_NDK_PATH` or `ANDROID_NDK_VERSION` are missing.
Currently if any of the two is missing, a Gradle sync will fail.

This is problematic for the New Arch Rollout playbook as users will
import the `:ReactAndroid` project to build from source, and those
properties are instead defined at the `react-native` top level project.

Changelog:
[Internal] [Changed] - Safely access the project NDK properties

Reviewed By: sshic

Differential Revision: D31731291

fbshipit-source-id: ce4b762998ed545b3ec7ddcc07abbe4452602190
2021-10-20 06:07:15 -07:00
Rubén Norte 1486b31b2b Re-apply: [RN] Make runtime initialization from React renderers a no-op
Summary: Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D31760907

fbshipit-source-id: ba145a30ead52abeb8affca84c3dec21dfefe30c
2021-10-20 04:06:20 -07:00
Joshua Gross 3dc5dc11f6 Fix CircleCI build: OSS cxx_library BUCK macro cannot take platform-specific compiler flags
Summary:
Fix CircleCI build.

Changelog: [Internal]

Reviewed By: sota000

Differential Revision: D31785389

fbshipit-source-id: 75676e787760b40e0b262c4475c9a20bdcef5234
2021-10-19 21:44:17 -07:00
CodemodService FBSourceClangFormatLinterBot a110de9b0e Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D31785584

fbshipit-source-id: 6e73901bdeaec659fbf46f1a5559f18cd09ae091
2021-10-19 21:16:42 -07:00
Sota Ogo 8fcc2fa31a Update the path to use the full path so that they can be found in the OSS environment.
Summary:
I had to make this change when enabling Fabric in OSS. Without the full path, it can't find the modules like processColor within node_modules.

Changelog: Internal

Reviewed By: motiz88

Differential Revision: D31300424

fbshipit-source-id: 59b82470ec1ce63b63704931786e22b98f4bf046
2021-10-19 18:35:13 -07:00
Joshua Gross d291a7efdd Allow disabling RTTI/exceptions for android builds; disable by default on Android
Summary:
For fbandroid builds only, disable RTTI and exceptions by default.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D31632757

fbshipit-source-id: cfe0e43486df19fcaacc2b5b818b9d00ec2d427f
2021-10-19 17:17:30 -07:00
David Vacca e494e4beb6 Fix onPress event for nested Text in RN Android
Summary:
This bug is caused by RNAndroid dispatching an incorrect sequence of events to JS when the user taps on a Text.

Taking into consideration the example P462662009, when the user taps of the "Inner" text, RN Android is dispatching three events:
topTouchStart, topTouchStart and topTouchEnd.

The information stored on the first two JS events is correct, but the problem is that it is duplicated. This sequence of events makes Pressability to dispatch the event to the incorrect target.

This was originally introduced in D3035589 (39fdce259d) (2016)

In this diff I'm changing the way RN Android bubbles events when the user taps on a ReactTextView. From now on, events won't be bubbled anymore, and they will be handled by the ReactRootView.onInterceptTouchEvent: https://fburl.com/code/rbt8$

Additionally, I'm creating a FeatureFlag in case this change has a unknown side effect that's only detected in production.
I will create a MC for FB4A in the next diffs of the stack

changelog: [Fixed][Android] Fix onPress event for nested Text in RN Android

Reviewed By: javache

Differential Revision: D31628461

fbshipit-source-id: 177397d4369191a3c97e2f86e801757b27ee5121
2021-10-19 15:49:36 -07:00
Xuan Huang d5689b959a Inherit type of queueMicrotask from Flow
Summary:
Changelog: [Internal]

Now that Flow releases include a type def of `queueMicrotask`,
we can just inherit it from Flow

Reviewed By: yungsters

Differential Revision: D31754482

fbshipit-source-id: f42f8ec955f898d7a964ff85b6061d4840590d4d
2021-10-19 11:30:58 -07:00
Juan Tejada 288ca22583 Update React DevTools v4.20.1
Summary:
Update `react-devtools-core` and `react-devtools` dependencies for RN, VSCode, Flipper, etc.

`js1 upgrade react-devtools -v 4.20.1`

# Changelog:

[General][Changed] - Upgraded react-devtools-core dependency to 4.20.1

Reviewed By: lunaruan

Differential Revision: D31762360

fbshipit-source-id: 9269a49afb263c78916852f51ebbd48ceaf531b0
2021-10-19 10:01:05 -07:00
Lulu Wu ce74aa4ed3 Add ReactInstanceEventListener for Venice and expose in FbReactInstanceHolder
Summary:
Add ```ReactInstanceEventListener``` for Venice and migrate Bridge-only callsites from
- FbReactInstanceHolder.getReactInstanceManager().addReactInstanceEventListener()
- FbReactInstanceHolder.getReactInstanceManager().removeReactInstanceEventListener()

To:
- FbReactInstanceHolder.addReactInstanceEventListener()
- FbReactInstanceHolder.removeReactInstanceEventListener()

Changelog:
[Android][Changed] - Add ReactInstanceEventListenerV2 for migration

Reviewed By: RSNara

Differential Revision: D31501785

fbshipit-source-id: e1cd03f07e28fbb995ea0a1bb76400089a461879
2021-10-19 04:11:17 -07:00
Tim Yung ba7424d4d2 RN: Normalize Prettier Configuration
Summary:
Changelog:
[Internal]

Reviewed By: zertosh

Differential Revision: D31745469

fbshipit-source-id: b930e4aefd8d21021b7c43a48ee84d0546fb56eb
2021-10-19 01:51:36 -07:00
Tim Yung addf4dab51 RN: Strict Static View Config Validator
Summary:
Creates a new `StaticViewConfigValidator` module that does strict, bidirectional validation. This is notably different from `verifyComponentAttributeEquivalence`, which is undirectional validation.

This will enforce that two configs are equivalent so we can start addressing the inconsistencies (especially per platform). It also improves upon the reporting format by providing more details about the invalidations.

It is hidden behind a `strict` runtime configuration parameter.

Changelog:
[Internal]

Reviewed By: RSNara

Differential Revision: D29024229

fbshipit-source-id: 10271945e089183f505205bd41de5e01faea7568
2021-10-19 00:25:00 -07:00
Sota Ogo eebc829b23 Add a method to generate a temp podspec
Summary:
The new architecture generates code that needs to be included in the xcode project. This diff adds a method that will be called when calling "pod install". There will be following diffs that will add the usage of this function.

Changelog: [internal]

Reviewed By: hramos

Differential Revision: D31699330

fbshipit-source-id: 491de7f60afee69aae750bbda6a687cea2526cc0
2021-10-18 15:34:21 -07:00
luism3861 1121ed94ab remove accessibilityStates validAttributes config from ReactNativeViewViewConfig.js (#29656)
Summary:
this little PR remove `accesibilityStates` config in validAttributes, like comment says it can be removed after next release.

## Changelog
[General][Removed] - `accessibilityStates` no longer passed through to RCTView.

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

Reviewed By: philIip

Differential Revision: D31732866

Pulled By: yungsters

fbshipit-source-id: 83b6eb223e76537a09c13ccdb382317421ab4585
2021-10-18 14:34:21 -07:00
Nicola Corti 63f66fce49 Fixes documantion for back Easing
Summary:
The documentation of back easing contains a old link that
is now stale. I'm updating it to link to https://easings.net/#easeInBack

Fixes https://github.com/facebook/react-native/issues/32419

Changelog:
[Android] [Fixed] - Fixes documentation for back Easing animation

Reviewed By: hramos

Differential Revision: D31728560

fbshipit-source-id: 99f7aa60d3748af5429b4ae1aa6cbd79326c5fe6
2021-10-18 13:35:11 -07:00
Kevin Gozali 0c07500183 OSS CI: Store bundle size info for release branch as well (#32418)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32418

This commit does 2 things:
* Process and store stats for *-stable branches, in addition to main
* Print out the new stats to stdout, so that CI jobs can display them for verification purpose

This also means a new field `branch` is used for the Firestore data.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D31717251

fbshipit-source-id: 9dbfa8fb8f0243c013dcd822230400d26c09eaa4
2021-10-18 11:06:33 -07:00
Nicola Corti bc93fefe13 Refactor Extract Headers and JNI from AARs to an internal task (#32426)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32426

This diff refactors the extractHeader and extractJni tasks to a single Gradle task in the `.internal` package.
The reason for this change is that those two tasks were always running, therefore invalidating the
whole native build cache.

Changelog:
[Internal] [Changed] - Refactor Extract Headers and JNI from AARs to an internal task

Reviewed By: mdvacca, ShikaSD

Differential Revision: D31682942

fbshipit-source-id: 191cc77902e82c0425949cee743d240ded790137
2021-10-18 04:34:43 -07:00
Nicola Corti 75b2e5cc97 Export prepareJSC to an internal task (#32427)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32427

This diff refactors the `prepareJSC` task to a separate Gradle task in the `.internal` package.

The reason for this change is that `prepareJSC` was just a plain `Task` and not a `Copy` task.
It was defining a top level `doLast` action and would result in being
invalidated whenever the `build.gradle` file would change. This means that the JSC headers/source files
would have been extracted again, effectively invalidating the timestamps for the native build.

Changelog:
[Internal] [Changed] - Export prepareJSC to an internal task

Reviewed By: ShikaSD

Differential Revision: D31682293

fbshipit-source-id: 3d4cd9d9ce2fcd45e61f3c8c6685b69a622a1912
2021-10-18 04:34:43 -07:00
Nicola Corti 52b0cc0355 Export prepareBoost to an internal task (#32424)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32424

This diff refactors the `prepareBoost` task to a separate Gradle task in the `.internal` package.
The reason for this change is that `prepareBoost` was defining a `doLast` action and would result in being
invalidated whenever the `build.gradle` file would change. This means that the Boost headers/source files
would have been extracted again, effectively invalidating the timestamps for the native build.

Changelog:
[Internal] [Changed] - Export prepareBoost to an internal task

Reviewed By: ShikaSD

Differential Revision: D31662120

fbshipit-source-id: 87ba82c634da832ee54c3d13561df45d3fd71381
2021-10-18 04:34:43 -07:00
Nicola Corti bb981b2055 Export prepareLibevent to an internal task (#32425)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32425

This diff refactors the `prepareLibevent` task to a separate Gradle task in the `.internal` package.
The reason for this change is that `prepareLibevent` was defining a `doLast` action and would result in being
invalidated whenever the `build.gradle` file would change. This means that the Libevent headers/source files
would have been extracted again, effectively invalidating the timestamps for the native build.

Changelog:
[Internal] [Changed] - Export prepareLibevent to an internal task

Reviewed By: ShikaSD

Differential Revision: D31661988

fbshipit-source-id: e55c2179a187fa156f701c25bae3b48a796e2660
2021-10-18 04:34:43 -07:00
Nicola Corti c3e7ea0b5b Export prepareGlog to an internal task (#32421)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32421

This diff refactors the `prepareGlog` task to a separate Gradle task in the `.internal` package.
The reason for this change is that `prepareGlog` was defining a `doLast` action and would result in being
invalidated whenever the `build.gradle` file would change. This means that the Glog headers/source files
would have been extracted again, effectively invalidating the timestamps for the native build.

Changelog:
[Internal] [Changed] - Export prepareGlog to an internal task

Reviewed By: ShikaSD

Differential Revision: D31661668

fbshipit-source-id: efcd5505a67d6c9f02fcab7a5c3255a160215661
2021-10-18 04:34:43 -07:00
Nicola Corti a2b5e4cd82 Fix enableVmCleanup not working for apps with product flavors. (#32422)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32422

While working on the NDK AGP Api I realized that the `enableVmCleanup` function,
that is supposed to cleanup the extra `.so` files from the final artifacts, is broken
for apps with variants. Specifically say for a `liteDebug` app it tries to search for `.so` files inside:

```
intermediates/stripped_native_libs/lite/debug/out/lib
```

while the `.so` files are located inside:

```
intermediates/stripped_native_libs/liteDebug/out/lib
```

I've fixed changing the token of the path from `targetPath` to `variant.name`

Changelog:
[Android] [Fixed] - Fix enableVmCleanup not working for apps with product flavors

Reviewed By: ShikaSD

Differential Revision: D31654704

fbshipit-source-id: 4af3478a3079ebcde4bd8e0c62bf4df7b6c75c0f
2021-10-18 04:34:43 -07:00
Nicola Corti 79e72e05ce Fix applyAppPlugin being accessed too early in the React App Gradle Plugin (#32420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32420

While working on the NDK AGP Apis, I realized the the `applyAppPlugin` is accessed
too early inside the Gradle plugin. Specifically is accessed once the plugin is applied,
and the extension is not configured afterwards. This means that the extension is always set
the default values.

I'm fixing it moving it inside the `project.afterEvaluate` that was already need to access
the variant informations.

Changelog:
[Internal] [Changed] - Fix applyAppPlugin being accessed too early in the React App Gradle Plugin

Reviewed By: ShikaSD

Differential Revision: D31652984

fbshipit-source-id: e7ead3f8acb24372bf953fd90ad2a5dfbbeeeec0
2021-10-18 04:34:43 -07:00