Commit Graph

38536 Commits

Author SHA1 Message Date
Nicola Corti e168db4c3b Add missing retention policy on EventCategoryDef annotation
Summary:
This annotation is missing it's retention policy which should be `SOURCE` as it's an IntDef and not used at runtime.

Changelog:
[Internal] [Changed] - Add missing retention policy on EventCategoryDef annotation

Created from CodeHub with https://fburl.com/edit-in-codehub

Reviewed By: cipolleschi

Differential Revision: D43187398

fbshipit-source-id: d00bc3a5cf74d2eb983fa7369905e2260db80142
2023-02-13 07:37:04 -08:00
Nicola Corti ee9465f058 Stale issues more frequently (4 times a day) (#36130)
Summary:
Our stale bot is at capacity and reaches quota, resulting in marking as stale 2/3 issues a day.
I'm increasing the frequency of the bot to 4 times a day.

## Changelog

Changelog:
[Internal] [Changed] - Stale issues more frequently (4 times a day)

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

Test Plan: nothing to test

Reviewed By: cipolleschi

Differential Revision: D43207979

Pulled By: cortinico

fbshipit-source-id: 1de45315e724ddf9afdb9426eddc639875ba0b24
2023-02-13 06:30:22 -08:00
Riccardo Cipolleschi 12cd42d2fa Stabilize Hermes build in CI (#36137)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36137

This change stabilize the build for Hermes in CI, making it more robust in case the rename step fails or the wrong params are passed to hermes.

## Changelog:
[internal] - Update Hermes build logic

Reviewed By: cortinico

Differential Revision: D43232941

fbshipit-source-id: 1121716c69dd3ca247ffeaed57e0d4dfd5daca84
2023-02-13 05:51:02 -08:00
Nicola Corti 7f20deb428 Use namespace for ReactAndroid and hermes-engine
Summary:
Our first party modules are still using `namespace`. This cleans this up.
The Manifest file for ReactAndroid is also not needed anymore. The one
from hermes-engine can also be removed from facebook/hermes in a separate diff.

Changelog:
[Internal] [Changed] - Use namespace for ReactAndroid and hermes-engine

Reviewed By: cipolleschi

Differential Revision: D43198514

fbshipit-source-id: d988cfa81ecc4484b6b2add4ae2c1d9376febc3e
2023-02-13 05:24:00 -08:00
Zihan Chen (MSFT) be3845adec Add minimum necessary .d.ts files to react-native-codegen (#36102)
Summary:
Add minimum necessary .d.ts files to react-native-codegen.

I found .d.ts files will be copied to `lib` so I guess no additional script is needed.

## Changelog

[GENERAL] [CHANGED] - Add minimum necessary .d.ts files to react-native-codegen

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

Test Plan: `npm run build` in `packages/react-native-codegen` and see all .d.ts files appear in `lib`.

Reviewed By: cortinico

Differential Revision: D43157233

Pulled By: cipolleschi

fbshipit-source-id: 6f122f0f4cda693ba22af6dd534e9d34d069ecac
2023-02-13 04:10:20 -08:00
Nick Gerleman b6b982f563 Add config null-check as remediation
Summary:
See code comment. D42282358 (https://github.com/facebook/react-native/commit/e55277c3310d8f6b712a57f80589cfe91ed35553) added usage of `YGConfigIsExperimentalFeatureEnabled` during layout, in a place where we sometimes encounter a Yoga node from RN which has an unexpectedly null config.

This is a hack to stop the bleed while we add logging to figure out where the null config is coming from in RN.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D43203521

fbshipit-source-id: 2a21143a45c712ca00d16172f734fb116d165926
2023-02-10 17:51:46 -08:00
Riccardo Cipolleschi 9707378efc fix: update Hermes dSYM path for Catalyst (#36126)
Summary:
After a [change](https://github.com/facebook/hermes/commit/4ff7c31fb43f534947cca591e1f156d8c45aef9c) that landed on Hermes, the build script for Hermes generated an invalid dSYM name for Catalyst builds, which make our CI fail.
This PR aims to patch it while the Hermes team works on a long term fix for it.

The CI will go back to red as soon as that happen, but in that case, we will just need to revert this change. But, at least, we can go back to a green state for CircleCI.

## Changelog

[Internal] - update Hermes build script to be more resilient from dSYM names

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

Test Plan: CircleCI is green

Reviewed By: cortinico

Differential Revision: D43193705

Pulled By: cipolleschi

fbshipit-source-id: a349dde8556564dacf4852f050610ae59139ffd8
2023-02-10 12:22:28 -08:00
Nicola Corti 0487108461 RNGP - Monorepo: Make sure libraries are honoring codegenDir provided by app (#36128)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36128

This commit fixes a problem which is making harder to use the New Architecture in monorepos.
Specifically if a user specifies a `codegenDir` in their app, libraries should honor it.
This is not the case today.

The fix is to register an extension on the root project which will "pass" values from app
to libraries.

I've also cleaned up some of the logic in `readPackageJsonFile` function restricting
the access to those functions only to `.root` which is the only field they're accessing.

Fixes #35495

Changelog:
[Android] [Fixed] - Better Monorepo support for New Architecture

Reviewed By: cipolleschi

Differential Revision: D43186767

fbshipit-source-id: 5c5ca39397306120b6b6622cb728633bd331e021
2023-02-10 10:04:55 -08:00
Nicola Corti b67a4ae90f Do not use a mixture of plugins{} and buildscript{}
Summary:
In our build logic we're mixing `plugins{}` and `buildscript{}`
which have unpredictable side-effect on the build classpath.

I'm moving over everything to use `plugins{}`. This is possible now
that we don't use build from source for New Architecture anymore.

Changelog:
[Internal] [Changed] - Do not use a mixture of plugins{} and buildscript{}

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D43186768

fbshipit-source-id: dcd115bd9d7aadf5cb837b3a28598e274a092873
2023-02-10 10:04:55 -08:00
Samuel Susla 6439baaca1 Fix accessibilityRole and accessibilityTraits default values when node is cloned
Summary:
changelog: [internal]

There was a bug in prop parsing where `accessibilityRole` and `accessibilityTraits` had wrong default value. Instead of falling back to sourceProps, they would set role to empty and trait to none. The fix is to fall back to sourceProps.

The issue surfaces with Animated, which clones props.

Reviewed By: cipolleschi

Differential Revision: D43190775

fbshipit-source-id: ec6b48c082c1dcc5b6e81dbff4f92b3a58a41da2
2023-02-10 09:04:22 -08:00
Nicola Corti 96df8c0ac8 Remove unused variable in a test in RNGP
Summary:
Changelog:
[Internal] [Changed] - Remove unused variable in a test in RNGP

Created from CodeHub with https://fburl.com/edit-in-codehub

Reviewed By: cipolleschi

Differential Revision: D43185910

fbshipit-source-id: b1f328592e0b38654fd2e0a36304ce8f1d433b44
2023-02-10 06:57:54 -08:00
Adam Gleitman 5308fcc9ea Fix typo in Dynamic Type docs (#36113)
Summary:
When working on Dynamic Type, I accidentally referred to it as "Dynamic Text" in some of the documentation. This is just a minor cleanup bit.

## Changelog

[IOS] [FIXED] - Fix typo in documentation

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

Test Plan: Non-functional change, no testing should be needed :-)

Reviewed By: javache

Differential Revision: D43184999

Pulled By: cortinico

fbshipit-source-id: ed057e48289ae6037637bacecb20b8dd58c1d8b5
2023-02-10 06:05:50 -08:00
Skander Ellouze ba7f9b40a6 fix a typo in the initialNumToRenderOrDefault description's comment (#36110)
Summary:
Fix typo in the initialNumToRenderOrDefault description's comment : function's parameter should be this.props.initialNumToRender instead of this.props.initialNumToRenderOrDefault

## Changelog
[GENERAL] [FIXED] - Fixed typo in the initialNumToRenderOrDefault description's comment

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

Test Plan: Typo in a comment - no testing required

Reviewed By: christophpurrer

Differential Revision: D43160548

Pulled By: cortinico

fbshipit-source-id: 0555c7752102f431fb327b920434faaf4de4ff81
2023-02-10 02:10:55 -08:00
Nicola Corti 81e7f2fe91 Hardcode concurrentRootEnabled to true when Fabric is enabled (#36107)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36107

Having concurrentRoot disabled when Fabric is enabled is not recommended.
This simplifies the setup and makes sure that both are either enabled or disabled.

Changelog:
[Android] [Breaking] - Hardcode concurrentRootEnabled to true when Fabric is enabled

Reviewed By: cipolleschi

Differential Revision: D43127625

fbshipit-source-id: 88e5e800b55d5df228fb072bedf8533b0ab6c20d
2023-02-10 01:06:17 -08:00
Tomek Zawadzki 681b35daab Fix ScrollView momentum not stopping when calling scrollTo programmatically (#36104)
Summary:
Fixes https://github.com/facebook/react-native/issues/32235.

See https://github.com/facebook/react-native/issues/32235#issuecomment-1420826665 for details.

Before:

https://user-images.githubusercontent.com/20516055/217268275-7ec9a228-bbd6-4294-aa1f-a43c4268984c.mov

After:

https://user-images.githubusercontent.com/20516055/217786242-f44b008f-6c6d-4f11-a7bd-b7a01150f3fb.mov

## Changelog

[ANDROID] [FIXED] - Fixed ScrollView momentum not stopping when calling scrollTo programmatically

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

Test Plan: Reproducer: https://github.com/tomekzaw/Issue32235/blob/master/App.tsx

Reviewed By: christophpurrer

Differential Revision: D43153500

Pulled By: cortinico

fbshipit-source-id: ac9c5ed754ed8ba72fe45d506c76f52d795dc83e
2023-02-09 15:51:25 -08:00
Vincent Riemer d92cb7360c Replace assert calls with RCTAssert in RCTSurfaceTouchHandler
Summary:
Changelog: [Internal] Replace assert calls with RCTAssert in RCTSurfaceTouchHandler

We've been recieving crash report tasks related to these calls but it appears (based on D19221204 (https://github.com/facebook/react-native/commit/23d2a6248c9ce1e3b969e3b8fae0ae43c549db93)) that the expectation was that these should be stripped in production and don't cause real problems. RCTAssert does not have that same issue.

Reviewed By: fkgozali

Differential Revision: D43167817

fbshipit-source-id: 45b1b4a3060cfd1e01356c003d63fa4b91c4222a
2023-02-09 15:28:05 -08:00
Xin Chen 6faddc3870 Fix string key issue with constexpr StrKey in Performance C++ native module
Summary:
I encountered build error when using performance API in catalyst android mobile app. The error message P617433618 points at using non-const `std::strlen` API in a `constexpr`.

```
$ buck install catalyst-android
...
stderr: xplat/js/react-native-github/Libraries/WebPerformance/PerformanceEntryReporter.cpp:208:13: error: constexpr constructor never produces a constant expression [-Winvalid-constexpr]
  constexpr StrKey(const char *s)
            ^
xplat/js/react-native-github/Libraries/WebPerformance/PerformanceEntryReporter.cpp:209:39: note: non-constexpr function 'strlen' cannot be used in a constant expression
      : key(folly::hash::fnv32_buf(s, std::strlen(s))) {}
```

Changelog:
[General][Fixed] - Fixed string key calculation in constexpr from Performance C++ native module.

Reviewed By: javache

Differential Revision: D43136624

fbshipit-source-id: c691671b157b507745c67a505c91f75cf6b878d1
2023-02-09 11:23:11 -08:00
Moti Zilberman d6e9891577 Reduce log level of "unrecognized font family" from Error to Info
Summary:
Changelog:
[iOS][Fixed] - Unrecognized fontFamily values no longer trigger a redbox

## Context

We are starting to roll out a new consistent approach to style errors in React Native, where malformed or semantically invalid style values will never be treated as runtime errors. Instead, bad style values will consistently fall back to known defaults; the incorrect visual rendering will serve as the main runtime diagnostic for developers. We will advise developers to rely on static types for additional diagnostics.

This work will take place over multiple commits and possibly multiple releases of React Native.

## This diff

Here we fix this issue as it applies to the `fontFamily` style prop. The legacy (Paper) renderer on iOS is the only concrete implementation that had to change. Fabric and Android already implement the correct behaviour.

h/t EvanBacon for the report: https://twitter.com/Baconbrix/status/1623039650775371792

Reviewed By: huntie

Differential Revision: D43159284

fbshipit-source-id: 6afeef3abc5781e18671708f642073d25f2347e9
2023-02-09 10:57:50 -08:00
Nick Gerleman 8a0fe30591 Fix measurement of uncontrolled TextInput after edit
Summary:
D42721684 (https://github.com/facebook/react-native/commit/be69c8b5a77ae60cced1b2af64e48b90d9955be5) left a pretty bad bug when using Fabric for Android. I missed that in Fabric specifically, on edit we will cache the Spannable backing the EditText for use in future measurement.

Because we've stripped the sizing spans, Spannable measurement has incorrect font size, and the TextInput size will change (collapsing) after the first edit. This effectively breaks any uncontrolled TextInput which does not have explicit dimensions set.

Changelog:
[Android][Fixed] - Fix measurement of uncontrolled TextInput after edit

Reviewed By: sammy-SC

Differential Revision: D43158407

fbshipit-source-id: 51602eab06c9a50e2b60ef0ed87bdb4df025e51e
2023-02-09 09:56:05 -08:00
Rubén Norte 97d90c66a8 Create synchronous method to get bounding client rect
Summary: Changelog: [internal] Added internal method in Fabric to synchronously get layout information

Reviewed By: sammy-SC

Differential Revision: D43080208

fbshipit-source-id: 8af9fe8ef9dbfe37c4b70101cc13e12905ee5b69
2023-02-09 09:36:08 -08:00
Rubén Norte 6018c19991 Fix computation of relative layouts when nodes are not displayed
Summary: Changelog: [General][Fixed] Fix computation of relative layout to return empty layout for nodes with display: none and children.

Reviewed By: sammy-SC

Differential Revision: D43045691

fbshipit-source-id: c7605cf320809ab1975e420ac1de58d72e1b8e44
2023-02-09 09:36:08 -08:00
Rubén Norte 673c7617bc Implement DOMRect and DOMRectReadOnly matching Web
Summary:
This adds the `DOMRect` and `DOMRectReadOnly` classes to React Native, mostly following the Web spec.

This is a requirement for `node.getBoundingClientRect()`, which we'll implement in React (in https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFabricHostConfig.js#L134-L323).

Changelog: [General][Added] - Added Web-compatible `DOMRect` and `DOMRectReadOnly` classes to the global scope.

Reviewed By: ryancat

Differential Revision: D42963222

fbshipit-source-id: bf2ed15bfbfd71822cb6f969f8cc0a67c7834333
2023-02-09 09:36:08 -08:00
Rubén Norte 333755367f Declare some missing globals
Summary:
This declares a few globals that were missing in our `global.js` Flow declaration file:
* `process`
* `performance` with its current definition. We'll replace it with the new API when we replace `setupPerformance` with `setupWebPerformance`.
* `navigator`
* `setImmediate`
* `clearImmediate`

Eventually we should stop including all DOM definitions that Flow provides out of the box and define only what we provide (which is pretty much this file).

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D42964772

fbshipit-source-id: 6156968e8a9d193e7068d8a5043aa682ad45bba1
2023-02-09 09:36:08 -08:00
Nicola Corti c8c6abeeaf Disable a /Libraries/Pressability test on Windows only
Summary:
This test is flaky on Windows only on CI, so I'm disabling it as we cover this
test already on other platforms.

Changelog:
[Internal] [Changed] - Disable a /Libraries/Pressability test on Windows only

Reviewed By: yungsters

Differential Revision: D43153475

fbshipit-source-id: 861a31fbbf3c14f2af95ca3ffd40737ef975048b
2023-02-09 08:52:57 -08:00
Nicola Corti bd1ddfbe95 Setup retries on Gradle donwload tasks
Summary:
This mitigates some of the failures we're seeing inside the docker containers
where we're receiving 50x when trying to download native sources.

Changelog:
[Internal] [Changed] - Setup retries on Gradle donwload tasks

Reviewed By: cipolleschi

Differential Revision: D43155926

fbshipit-source-id: fa2266b3f5de48faefad37d6239f54f13481cd5f
2023-02-09 08:25:28 -08:00
Riccardo Cipolleschi 7eaabfb174 Hardcode concurrentRootEnabled to true when Fabric is enabled (#36106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36106

Having `concurrentRoot` disabled when Fabric is enabled is not recommended.
This simplifies the setup and makes sure that both are either enabled or disabled.

## Changelog:
[iOS] [Breaking] - Hardcode concurrentRootEnabled to `true` when Fabric is enabled

Reviewed By: cortinico

Differential Revision: D43153402

fbshipit-source-id: d67aeb3413dbdf2430381aa44ede47ed00db32c6
2023-02-09 07:02:32 -08:00
Saad Najmi 90327d9fba Build codegen package while using old architecture (#36098)
Summary:
Fixes https://github.com/facebook/react-native/issues/36097

When building RNTester with the old architecture, we skip a call to `build_codegen`, which will build the JS package at `packages/react-native-codegen`. This is needed for the Xcode Script phase `Generate Specs`. This causes a build with fabric disabled to fail. We can fix this by ensuring we call `build_codegen` in both paper and fabric.

We've had this change in React Native macOS already since 0.68: https://github.com/microsoft/react-native-macos/commit/1175372ffecf6b4e18fa27b75b68f3ec7967a384

## Changelog

[IOS] [FIXED] - Build codegen package while using old architecture

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

Test Plan:
CI should suffice. Locally built RN-Tester without fabric with and without my change to show that disabling fabric will only succeed with this change included.
While running `pod install`, you should now see this extra line with the old architecture:
> [Codegen] building ./../../packages/react-native-codegen.

Reviewed By: cortinico

Differential Revision: D43152692

Pulled By: cipolleschi

fbshipit-source-id: 2cf3002f07eaad442ccb0272831fe2de58ec9c1a
2023-02-09 06:45:31 -08:00
Rubén Norte d5e8b6d974 Remove unused modules from react-native
Summary: Changelog: [internal] Removed several unused internal modules

Reviewed By: cortinico

Differential Revision: D43116878

fbshipit-source-id: dd33660bf3d97ebc56261f2dea6566ad2211afea
2023-02-09 06:29:14 -08:00
Rubén Norte c628d07044 Remove unused buildStyleInterpolator module from react-native
Summary: Changelog: [internal] Removed unused internal buildStyleInterpolator module

Reviewed By: christophpurrer

Differential Revision: D43116880

fbshipit-source-id: e9f89ad99ecb3e22b9c7516c7a2610f9dd05f984
2023-02-09 06:29:14 -08:00
Rubén Norte 86fba5375a Remove unused deprecatedPropType module from react-native
Summary: Changelog: [internal] Removed unused internal deprecatedPropType module

Reviewed By: christophpurrer

Differential Revision: D43116885

fbshipit-source-id: 6833f104e8b2d818a04dd957d1a219776355606e
2023-02-09 06:29:14 -08:00
Rubén Norte 7c1b6759c2 Remove unused mergeIntoFast module from react-native
Summary: Changelog: [internal] Removed unused internal mergeIntoFast module

Reviewed By: filhoweuler

Differential Revision: D43116879

fbshipit-source-id: 16dca709deb1fca714d95535658e1e7700764781
2023-02-09 06:29:14 -08:00
Rubén Norte 8cab3b0fbd Remove unused truncate module from react-native
Summary: Changelog: [internal] Removed unused internal truncate module

Reviewed By: waddah-fb

Differential Revision: D43116881

fbshipit-source-id: 36ba4bbbea4c07dd14e4922a5aa53cba95927b9e
2023-02-09 06:29:14 -08:00
Rubén Norte 69e23658e1 Remove unused groupByEveryN module from react-native
Summary: Changelog: [internal] Removed unused internal groupByEveryN module

Reviewed By: sammy-SC

Differential Revision: D43116883

fbshipit-source-id: 4d2e3240ab11cfc67ae4e08b9dbf4c1ca1e2f388
2023-02-09 06:29:14 -08:00
Rubén Norte b2a858d4f3 Remove unused UserFlow module from react-native
Summary: Changelog: [internal] Removed unused internal UserFlow module

Reviewed By: sammy-SC

Differential Revision: D43116882

fbshipit-source-id: cb9a6322aec56760cddacda18ec4b9659428efec
2023-02-09 06:29:14 -08:00
Rubén Norte 38542aeebe Remove unused MatrixMath module from react-native
Summary: Changelog: [internal] Removed unused internal MatrixMath module

Reviewed By: sammy-SC

Differential Revision: D43116884

fbshipit-source-id: 6b7ae02e4f465730e7ae8d6092e6bd8304f8f7d6
2023-02-09 06:29:14 -08:00
Pieter De Baets c80b0eaf92 Fully remove usage of timed runtime
Summary:
Re-land of D42923921 (https://github.com/facebook/react-native/commit/1c8179b9b199c46ebfed898253786cce63b201fc), which was backed out due to a flow-error.

 ---

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D43152663

fbshipit-source-id: 03b2fe096ac3b8b996d032b13c6d5c74ba2b1952
2023-02-09 06:16:26 -08:00
Samuel Susla afec07aca2 Add option to make commit asynchronous
Summary:
changelog: [internal]

`useLayoutEffect` has two guarantees which React Native breaks:
- Layout metrics are ready.
- Updates triggered inside `useLayoutEffect` are applied before paint. State between first commit and update is not shown on the screen.

React Native breaks the first guarantee because it uses Background Executor. Background executor moves Yoga layout to another thread. If user core reads layout metrics in `useLayoutEffect` hook, it is a race. The information might be there, or it might not. They can even read partially update information. This diff does not affect this. We already have a way to turn off Background Executor. We haven't done this because it introduces regressions on one screen but we have a solution for that.

React Native breaks the second guarantee. After Fabric's commit phase, Fabric moves to mounting the changes right away. In this diff, we queue the mounting phase and give React a chance to change what is committed to the screen. To do that, we schedule a task with user blocking priority in `RuntimeScheduler`. React, if there is an update in `useLayoutEffect`, schedules a task in the scheduler with higher priority and stops the mounting phase.
We are not delaying mounting, this just gives React a chance to interrupt it.

Fabric commit phase may be triggered by different mechanisms. C++ state update, surface tear down, template update (not used atm), setNativeProps, to name a few. Fabric only needs to block paint if commit originates from React. Otherwise the scheduling is wrong and we will get into undefined behaviour land.

Rollout:
This change is gated behind `react_fabric:block_paint_for_use_layout_effect` and will be rolled out incrementally.

Reviewed By: javache

Differential Revision: D43083051

fbshipit-source-id: bb494cf56a11763e38dce7ba0093c4dafdd8bf43
2023-02-09 05:52:42 -08:00
Pieter De Baets 753539917e Avoid allocating empty map for events without payload
Summary:
It's cheaper to pass nullptr over JNI, and allocate an empty folly::dynamic::object on the stack.

Changelog: [Internal]

Reviewed By: genkikondo

Differential Revision: D43117216

fbshipit-source-id: e127cce7a1ccf50395073ca9c1c0469d0faa9f82
2023-02-09 04:01:33 -08:00
bigcupcoffee 23607aea68 Fix incorrect touchable hitSlop and pressRetentionOffset type (#36065)
Summary:
Incorrect TS type disallows use of `hitSlop={number}`. Fixed by using Pressable's hitSlop type.

NOTE: I did not bother to change Flow types in the `.js` file, please add a commit doing that if required.

## Changelog
[GENERAL] [FIXED] - Fix touchable hitSlop type

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

Test Plan: None needed

Reviewed By: christophpurrer

Differential Revision: D43117689

Pulled By: javache

fbshipit-source-id: 96e5ae650f47382c8d7fa1ddf63c76461c65dcc7
2023-02-09 03:05:23 -08:00
Nick Gerleman 6d1667cf86 Back out "Add Appearance.setColorScheme support"
Summary:
See https://github.com/facebook/react-native/pull/35989#discussion_r1101016329

Changelog:
[General][Fixed] - Back out "Add Appearance.setColorScheme support"

Reviewed By: jacdebug

Differential Revision: D43148056

fbshipit-source-id: 823ab8276207f243b788ce7757839a3e95bdbe07
2023-02-09 00:54:42 -08:00
Christoph Purrer 7c82a3fa11 Add enum example to Android/iOS rn-tester TurboModule (#35133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35133

Add enum example to Android/iOS rn-tester TurboModule

Changelog:
[General][Added] - Add enum example to Android/iOS rn-tester TurboModule

Reviewed By: javache, cipolleschi

Differential Revision: D40711269

fbshipit-source-id: c8ad6fb7dee40b45b696660cc4d78921edafd8a1
2023-02-08 22:49:30 -08:00
Christoph Purrer 292a9904c4 react-native code-gen > C++ TurboModules enum example (#36083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36083

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D43036612

fbshipit-source-id: fc70650bc4ba48d11f489556d1290ae9e7e58016
2023-02-08 20:24:28 -08:00
Samuel Susla 2e3f55aced Pass MountingCoordinator by value instead of reference
Summary:
changelog: [internal]

Passing MountingCoordinator argument by value instead of reference. Using reference does not make sense since we eventually take ownership of shared_ptr anyway. This better communicates the intent.

Reviewed By: christophpurrer

Differential Revision: D43082955

fbshipit-source-id: 29e20abb9824c10a5f0d5e0ba1049ff6d67cee98
2023-02-08 15:48:17 -08:00
yinfei bc766ec7f8 fix memory leak in Android (#35889)
Summary:
fix memory leak in Android
The issues link: https://github.com/facebook/react-native/issues/35890
Explain Defect
since 0.65, when call dispatchViewUpdates, we add judge mNumRootViews>0
<img width="531" alt="image" src="https://user-images.githubusercontent.com/20136688/213394240-4c284df4-27de-494e-8eed-8e5f30796cce.png">
When we call removeRootView, it will decrease the mNumRootViews before dispatchViewUpdates
<img width="430" alt="image" src="https://user-images.githubusercontent.com/20136688/213394611-d47ab49f-fc7a-4dd1-9836-fe667d655660.png">
So when we remove the last rootview, it will skip call dispatchViewUpdates and do not remove it, it will cause memory leak
Explain Fix
We should use the original root view num to judge, we can get it from NativeViewHierarchyManager

## Changelog
[ANDROID] [FIXED] - fix memory leak in Android
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

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

Reviewed By: christophpurrer

Differential Revision: D42636805

Pulled By: sshic

fbshipit-source-id: 76845b5c1fbdeaf1ebe990356e82059dc1e5b46e
2023-02-08 13:35:48 -08:00
Nicola Corti 9eaf6f5bdb Move test-docker-android from GH Actions to CircleCI (#36093)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36093

The Test Docker Android job is flaky as sometimes fetching artifacts from remote
returns different hashes.
I'm moving the job to CircleCI (so it's faster) + I'm using the `buck_fetch.sh`
script we already have which has a retry logic.

Changelog:
[Internal] [Changed] - Move test-docker-android from GH Actions to CircleCI

Reviewed By: javache

Differential Revision: D43121477

fbshipit-source-id: 1df114fd3ad9445a4a5dc7834bf811c3476322cd
2023-02-08 12:51:09 -08:00
Nicola Corti 69f11cbc1a Bump activesupport to 6.1.7.1 to address CVE-2023-22796
Summary:
Just got a report that we depend on `activesupport` 6.1.7 which is marked as vulnerable
as per CVE-2023-22796
https://github.com/advisories/GHSA-j6gc-792m-qgm2

I'm adding a dep on >= 6.1.7.1 in the Gemfile.

Changelog:
[Internal] [Changed] - Bump activesupport to 6.1.7.1 to address CVE-2023-22796

Reviewed By: yungsters

Differential Revision: D43117034

fbshipit-source-id: 2c925754ca32257c9523d5bd68d6cf3bb3eb31e3
2023-02-08 11:23:08 -08:00
Stephanie Nicholson 3951b27807 Revert D42923921: Fully remove usage of timed runtime
Differential Revision:
D42923921 (https://github.com/facebook/react-native/commit/1c8179b9b199c46ebfed898253786cce63b201fc)

Original commit changeset: 33024a43269f

Original Phabricator Diff: D42923921 (https://github.com/facebook/react-native/commit/1c8179b9b199c46ebfed898253786cce63b201fc)

fbshipit-source-id: 32f59baacd88fbdf34c7d8e248479cbe6eb4cc6d
2023-02-08 09:39:15 -08:00
Pieter De Baets 1c8179b9b1 Fully remove usage of timed runtime
Summary: Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D42923921

fbshipit-source-id: 33024a43269fd5b1512421f13c141350aa619732
2023-02-08 08:59:48 -08:00
Nicola Corti 4128df20de Reduce flakyness on InteractionManager-test (#36092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36092

This test is partially disabled already, causing high flakyness of the `test_windows` CI job.
I'm taking a different approach at disabling it here (disabling the offending tests using a `Promise`
rather than disabling at the assert level).

Changelog:
[Internal] [Changed] - Reduce flakyness on InteractionManager-test

Reviewed By: cipolleschi

Differential Revision: D43120897

fbshipit-source-id: 69edee804aaaa8b6f89ff8440561254f393efae4
2023-02-08 08:43:54 -08:00
Samuel Susla 56cb19f419 Remove default arguments from ShadowTree::commit and ShadowTree::tryCommit
Summary:
Changelog: [Internal]

Caller needs to explicitly set commit options. This is for readability and making sure caller is aware of what are the options of the commit. This will be important in subsequent diff where we will add another commit option.

Reviewed By: christophpurrer

Differential Revision: D43082837

fbshipit-source-id: 1417205299c19430f902453c2b6d9bb9ca31707d
2023-02-08 06:58:33 -08:00