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

26920 Коммитов

Автор SHA1 Сообщение Дата
Genki Kondo bc749a1623 Early exit during matching in EventAnimationDriverMatchSpec
Summary:
Simple optimization to exit before iterating through the hit path if the event name doesn't match.

Changelog:
[Android][Internal] - Optimization for natively-driven Animated PointerEvents to early exit during matching in EventAnimationDriverMatchSpec. This should have no effect if you are not using PointerEvents

Reviewed By: lunaleaps

Differential Revision: D43400457

fbshipit-source-id: fe8d811d371c78622cd4f3f9cd469cff9ccce585
2023-02-21 16:17:30 -08:00
Ruslan Shestopalyuk 407fb5c238 Implement ability to emit device events from C++ TurboModules
Summary:
[Changelog][Internal]

This adds a method, `emitDeviceEvent` to the C++ API of TurboModules, which allows to make calls to JS's `RCTDeviceEventEmitter.emit` from a C++ TurboModules.

This is a very common pattern, specifically for the VR apps, but not only for them - e.g. Desktop fork also has a [custom implementation for this](https://www.internalfb.com/code/fbsource/third-party/microsoft-fork-of-react-native/react-native-utils/RCTEventEmitter.cpp).

Note that my original intent was to actually backport the latter, however there are some complications with wiring things in a robust way, without exposing too much stuff and relying on singletons or folly::dynamic.

So I ended up adding it to the TurboModule API itself and use the scheduler/JSI facilities instead.

This approach is arguably well self-contained, uses high level APIs, and shouldn't be abusable much.

Since I was trying to avoid usage of folly::dynamic in this case, I used a kind of "value factory" pattern instead in order to send the arguments to the JS thread in a thread safe way (see [the discussion here](https://fb.workplace.com/groups/rn.fabric/permalink/1398711453593610/)).

Reviewed By: christophpurrer

Differential Revision: D43466326

fbshipit-source-id: a3cb8359d08a46421559edd0f854772863cb5c39
2023-02-21 15:15:31 -08:00
Nick Gerleman 817948e0aa Add "Text Styles" TextInput Example
Summary:
This adds a series of examples for TextInput styles to screenshot test, specifically the ones which are projected to Android as spans. This will be used in refactoring to verify we do not change visual output.

Changelog:
[Internal][Added] - Add "Text Styles" TextInput Example

Reviewed By: cortinico

Differential Revision: D43158004

fbshipit-source-id: adaecf0e37941e66e280db282e2631a95b08b27a
2023-02-21 15:03:14 -08:00
Nicola Corti d147bbbe84 Bump RNGP to 0.72.4 (#36233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36233

Bump RNGP to 0.72.4

Changelog:
[Internal] [Changed] - Bump RNGP to 0.72.4

Reviewed By: cipolleschi, hoxyq

Differential Revision: D43445016

fbshipit-source-id: 4d8b0b05da44fb433909ec6be64156234c4e0051
2023-02-21 09:56:07 -08:00
Riccardo Cipolleschi dba8cb71bd Bump Flipper to 0.182.0
Summary:
This change bumps Flipper to 0.182.0, mirroring the [Android Commit](8fae37eaea)

allow-large-files

## Changelog:
[iOS][Changed] - Bump Flipper to 0.182.0

Reviewed By: dmytrorykun

Differential Revision: D43454236

fbshipit-source-id: c852520d1e7f3a386a2fac11318a9fb6e868b520
2023-02-21 09:46:02 -08:00
Nicola Corti 39e1a3c3a6 RNGP - Fix RNTester crashing for JSC and safeguard against fetching JSC from Maven Central (#36232)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36232

Seems like RN Tester is crashing for JSC debug/release.

This happens because RN Tester ends up fetching JSC from Maven Central which contains older versions
of the artifacts (r17) which are not compatible with our setup AND are missing `libjsc.so`.

This is happening as our file layout is a bit different than a regular NPM project so
the repository declaration for JSC, being `../jsc-android/dist` from React Native root ends
in the wrong folder.

In this specifically I:
- Add an excludeModule for "org.webkit:android-jsc" on Maven Central inside RNGP
- Remove the allproject{repositories{}} block which was overriding RNGP configuration
- Add a specific repository declaration inside RN Tester to point to where JSC effectively lives

Changelog:
[Internal] [Changed] - RNGP - Fix RNTester crashing for JSC and safeguard against fetching JSC from Maven Central

Reviewed By: sshic

Differential Revision: D43462015

fbshipit-source-id: db830d7567bbf7dd91412df417418aa61a0ca8fe
2023-02-21 09:22:09 -08:00
Pieter De Baets 753bccc47a Forward dynamic values where possibe
Summary: Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D42961391

fbshipit-source-id: d07f8627a59d43e762bddb0641b3961806e9a7ec
2023-02-21 05:46:37 -08:00
Riccardo Cipolleschi 3e88fd01ce Install the RuntimeScheduler when the New Architecture is enabled (#36209)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36209

ThisChange automatically enable the RuntimeScheduler when the new architecture is enabled, both on RNester and in the Template app.

Note that no migration steps are required.

## Changelog
[iOS][Changed] - Automatically install the RuntimeScheduler

Reviewed By: sammy-SC

Differential Revision: D43392059

fbshipit-source-id: 609ded9bdc3db13a0d54ff44d0d4687dfc8617a5
2023-02-21 04:17:26 -08:00
Tarun Chauhan 8be9dbfcc1 consolidate parsers component schema to common root (#36219)
Summary:
> [Codegen 85] The parses/flow/components/schema.js and parses/typescript/components/schema.js are the same. Move the schema.js from the one of the two folders to the parsers common root. Delete the other. Update the references to use the shared file.

Part of the Codegen ☂️ Issue https://github.com/facebook/react-native/issues/34872

## Changelog

<!-- 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
-->
[Internal] [Changed] - Consolidated the schema.js files for parses/flow/components and parses/typescript/components to a common root.

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

Test Plan: Run ```yarn jest react-native-codegen```

Reviewed By: christophpurrer

Differential Revision: D43444666

Pulled By: cipolleschi

fbshipit-source-id: 24d791fd3a8110730d3f6054497ea3a31549a5a5
2023-02-21 03:46:38 -08:00
Pieter De Baets 726a40ce28 Fix catalyst instance lifecycle warnings on shutdown
Summary:
Callling `getReactApplicationContextIfActiveOrWarn` from `invalidate` will always warn because the context is deactivated, which is preventing us from cleaning up these listeners.

Changelog: [Internal]

Reviewed By: jehartzog

Differential Revision: D43352929

fbshipit-source-id: f29564a290a6c93b2304865d445829f5e486d84f
2023-02-21 02:46:18 -08:00
Ruslan Lesiutin 18b402cbd0 refactor(bump-all-updated-packages): use tag instead of custom commit message (#36220)
Summary:
Having custom commit message script is not an option for `main` branch, because we have internal tooling, which strips `[x]` tags from commit messages before merging them into `main` branch.

Instead of constant commit message, we are now using a tag which will be concatenated with the commit message, which was entered via interactive commit dialog, see demo below.

## Changelog
[Internal] - updated validation in bumping packages script

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

Test Plan: https://user-images.githubusercontent.com/28902667/220163767-015bf37b-6914-4df2-84d9-aa25fb2887d3.mov

Reviewed By: cortinico

Differential Revision: D43443597

Pulled By: hoxyq

fbshipit-source-id: 08e5e08524a1d934fbb35529e025358d7bf3b203
2023-02-21 01:39:51 -08:00
ArthurAssuncao 0e30c7b853 fix: conditional to include rn-tester and react-native-gradle-plugin in settings.gradle.kts (#36188)
Summary:
Relative path in conditional IF in settings.gradle.kts doesn't work when it try to build (`yarn install-android-jsc`) a package that isn't in root dir and needs of react-native-gradle-plugin or when it try to run rn-tester.

When trying to compile rn-tester (`yarn install-android-jsc` command) the error below:

```Shell
arthur@assuncao � ~/projects/react-native-test/react-native/packages/rn-tester � � main � yarn install-android-jsc
yarn run v1.22.19
$ ../../gradlew :packages:rn-tester:android:app:installJscDebug
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
Project directory '/home/arthur/projects/react-native-test/react-native/packages/rn-tester' is not part of the build defined by settings file '/home/arthur/projects/react-native-test/react-native/settings.gradle.kts'. If this is an unrelated build, it must have its own settings file.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

```

## Changelog

[INTERNAL] [FIXED] - Fix conditional to include rn-tester and react-native-gradle-plugin in settings.gradle.kts.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

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

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

Test Plan:
Execute rn-tester like [(RN-Tester Readme)](https://github.com/facebook/react-native/blob/main/packages/rn-tester/README.md).

After my changes, the output of `yarn install-android-jsc` is:
```Shell
[... many of the other tasks completed above]
> Task :packages:rn-tester:android:app:compileJscDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :packages:rn-tester:android:app:stripJscDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libicu_common.so.

> Task :packages:rn-tester:android:app:installJscDebug
Installing APK 'app-jsc-arm64-v8a-debug.apk' on 'ASUS_Z01KD - 8.0.0' for :packages:rn-tester:android:app:jsc-debug
Installed on 1 device.

BUILD SUCCESSFUL in 31m 53s
121 actionable tasks: 121 executed
Done in 1913.92s.

```

This PR Resolves https://github.com/facebook/react-native/issues/36187

Reviewed By: rshest

Differential Revision: D43393440

Pulled By: cortinico

fbshipit-source-id: 824644aa77147b3747007908db11fe9c120ad92f
2023-02-21 01:35:46 -08:00
Nicola Corti 8fae37eaea Flipper to 0.182.0 (#36221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36221

As the title says.

allow-large-files

Changelog:
[Android] [Changed] - Flipper to 0.182.0

Reviewed By: lblasa

Differential Revision: D43444516

fbshipit-source-id: 33c2cd4bdf98dc3f7037774003bfdfde2123d8cd
2023-02-21 00:30:16 -08:00
Riccardo Cipolleschi 23eb380f65 Enable CircleCI tests for Use_Frameworks with the New Arch (#36148)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36148

This change enables 4 noew tests to make sure that `use_frameworks!` with the New Architecture don't break

Note: We may have to publish the codegen to make this work on CircleCI properly

## Changelog:
[iOS][Added] - Added tests for use_frameworks! with the new architecture

Reviewed By: cortinico, dmytrorykun

Differential Revision: D43271625

fbshipit-source-id: fe1fa4be660f933e0113f44a0467eaa1fa3669ca
2023-02-20 11:50:10 -08:00
Riccardo Cipolleschi e7becb06c1 Update RCTFabric to generate headers in the `React` folder when using Frameworks
Summary:
By leveraging the `PUBLIC_HEADERS_FOLDER_PATH` build settings of Xcode, we can instruct cocoapods to generate the frameworks Headers in a specific folder, for example the `React` folder.
This allows us to maintain the `#include`/`#import` structure, even if the framework has a different name.
However, we need to update the search paths to take into account this extra folder.

## Changelog:
[iOS][Changed] - Generate RCTFabric framework's headers in the React folder

Reviewed By: sammy-SC, dmytrorykun

Differential Revision: D43425677

fbshipit-source-id: 94a4f3a3c7de86341b3ce3457704e6b8fb9a588e
2023-02-20 11:50:10 -08:00
Riccardo Cipolleschi 5d175c6775 Break Circular Dependency between React-Codegen and React-Fabric (#36210)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36210

One of the circular dependencies we have in OSS was between React-Codegen and React-Fabric.

React-Codegen generates component which has to depends on React-Fabric because they need to use the files contained in the `react/renderer/view` folder.

React-Fabric contains some components that depends on RNCore, which was generated inside the React-Codegen folder.

This change generates the RNCore components inside the `ReactCommon/react/renderer/components/rncore` folder, breaking the dependency as `rncore` folder is now contained by React-Fabric itself.

**Fun Fact:** That's how it always should have been. There was already a line in the `.gitignore` to exclude the content of `ReactCommon/react/renderer/components/rncore` folder. I guess that with some of the refactoring/previous projects on Codegen, this requirements has slipped.

## Changelog:
[iOS][Breaking] -  generates RNCore components inside the ReactCommon folder and create a new pod for platform-specific ImageManager classes

Reviewed By: sammy-SC, dmytrorykun

Differential Revision: D43304641

fbshipit-source-id: ebb5033ce73dbcd03f880c3e204511fdce04b816
2023-02-20 11:50:10 -08:00
Riccardo Cipolleschi 6d34952420 Update ruby scripts to install the dependencies with `use_frameworks`.
Summary:
This diff update the Cocoapods scripts to install the proper dependencies and search paths when `use_frameworks!` is declared together with the New Architecture.

Practically, it adds the right search paths to the codegen and the project files and makes sure that third party dependencies that leverage the `install_modules_dependencies` are populated with the right search paths for Frameworks.

It also adds unit tests for the changes and the new methods introduced.

## Changelog:
[iOS][Changed] - Properly install dependencies with `use_frameworks!`

Reviewed By: sammy-SC, dmytrorykun

Differential Revision: D43089869

fbshipit-source-id: 1981b6853f774fdb3dbe8d17ea37fd5154c54b25
2023-02-20 11:50:10 -08:00
Riccardo Cipolleschi b1b2b8baaf Update podspecs with the right search paths
Summary:
Update podspecs with the right search paths to include the required framework by every module.

## Changelog:
[iOS][Changed] - Update search paths to support `use_frameworks!` with Fabric

Reviewed By: sammy-SC, dmytrorykun

Differential Revision: D43089372

fbshipit-source-id: 4bbfc4b98bd289d66ce4015429d581856d9c05b3
2023-02-20 11:50:10 -08:00
Riccardo Cipolleschi 36a64dc2bd Move the RCTAppsetuUtils to AppDelegate
Summary:
This change solve a Circular Dependency where
- `React-Core` depends on `ReactCommon` because `RCTAppSetupUtils.h` (in Core) imports the `RCTTurboModuleManager` (from ReactCommon)
- `RCTTurboModuleManager` in `ReactCommon` depends on `React-Core` because it imports several classes from it (e.g. the `RCTBridge` class)

## Changelog:
[iOS][Breaking] - Moved the RCTAppSetupUtils to the AppDelegate library to break a dependency cycle

Reviewed By: sammy-SC, dmytrorykun

Differential Revision: D43089183

fbshipit-source-id: d7fc36a50811962caf7cff77bb45d42b8cdd4575
2023-02-20 11:50:10 -08:00
Ruslan Shestopalyuk b77841d991 Improvements in ReadableNativeMap locking mechanism (a follow up to D43398416)
Summary:
[Changelog][Internal]

A follow-up, based on javache comments on D43398416 (9aac13d4dc) (post-land) - just some minor potential improvements for locking efficiency.

Reviewed By: javache

Differential Revision: D43438414

fbshipit-source-id: 0cf807a045a1f132d5481d3f6115a97869e93d65
2023-02-20 09:57:32 -08:00
Nicola Corti 1cb46ea6c1 bump package versions (#36218)
Summary:
Bumping RNGP as build from source on nightlies is broken

## Changelog

[INTERNAL] - bump package versions

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

Test Plan: n/a

Reviewed By: hoxyq

Differential Revision: D43438374

Pulled By: cortinico

fbshipit-source-id: 871b56eaba5bc35286882e459136703778dea514
2023-02-20 09:53:56 -08:00
Rob Hogan afc91de79a Breaking - Bump minimum Node version from 14 to 16 (#36217)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36217

## Bump minimum Node JS version to 16 via `react-native/package.json#engines`
In https://github.com/facebook/react-native/pull/35443 we stopped running CI in Node 14 - this follows up by formally making Node 16 the minimum supported version ahead of the 0.72 cut.

Node 14 [ends maintenance releases in April](https://github.com/nodejs/release#release-schedule), and bumping this minimum will allow other associated Node JS tools (CLI, Metro, Jest) to reduce their support burden.

## Insert `engines` into `template/package.json`
The constraint at `react-native/package.json#engines` ensures the minimum at install/init time, with package managers providing an actionable error or warning if the constraint is not met. However, it doesn't help guide users to a supported version if on an existing project they run (e.g.) `yarn start`.

Adding a constraint to the template helps prevent accidental use of an older version, as well as providing a clear reference for the current minimum.

Insertion of `engines` below existing `package.json` fields is consistent with [`sort-package-json`](https://github.com/keithamus/sort-package-json/blob/main/defaultRules.md) and [`prettier-package-json`](https://github.com/cameronhunter/prettier-package-json/blob/main/src/defaultOptions.ts) - and keeps it out of the way of fields RN developers are likely to be more concerned about.

## Docs PR
https://github.com/facebook/react-native-website/pull/3580

## Changelog:
[General][Breaking] Bump minimum Node JS version to 16

Reviewed By: jacdebug

Differential Revision: D43436883

fbshipit-source-id: 0b369487fe44fe777e6fedc2299973a5fddd06b2
2023-02-20 09:47:24 -08:00
Rob Hogan a80578afc4 Remove `.node-version` file from repo root and template (#36208)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36208

IMO, there's no value in having `.node-version` files either in the repository or the template.

I don't believe it's standard practice, the support from tooling is patchy (at least `nvm` [ignores it](https://github.com/nvm-sh/nvm/issues/794), and Node is often used without a version manager), and it's unnecessarily restrictive when it is actually enforced. In every other case, it's potentially misleading noise.

Libraries should use `package.json#engines` to specify their Node JS compatibility ranges, as indeed `react-native` [already does](1629b9f0a1/package.json (L10)). React Native users may wish to add one to their own projects according to their own setup or team, but we shouldn't confuse the issue by including an arbitrary one in the template.

Changelog:
[General][Removed] Remove `.node_version` from app template.

Reviewed By: jacdebug, blakef

Differential Revision: D43421085

fbshipit-source-id: 37a9b0fb7701f06fffb867dbc7ecac479b4d9c95
2023-02-20 09:47:24 -08:00
Riccardo Cipolleschi 5d6f21d744 Make sure not to override user background color (#36215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36215

When we introduced the RCTAppDelegate library, we prepared some template methods for the user to customise their views.

However, after they customized their view, we were chaing the background color to match the system background. This would actually override the background color they set in their own customisation step.

This change make sure that we set the background color before they apply their customisations. In this way, we set the background color and, if they want, they can change it and that changw would be honoured.

This change also fixes [this issue](https://github.com/facebook/react-native/issues/35937)

## Changelog
[iOS][Fixed] - Honour background color customisation in RCTAppDelegate

Reviewed By: cortinico

Differential Revision: D43435946

fbshipit-source-id: cdbdbd5b07082ae7843a4dab352dd1195c69e036
2023-02-20 07:14:20 -08:00
Nicola Corti f8d8764e8f RNGP - Fix defaults for PrivateReactExtension
Summary:
When building from source, the PrivateReactExtension is getting no defaults (or missing defaults).
Specifically root should point to ../../ (as the build from source will originate
from `./node_modules/react-native`).

Without that root specified, all the subsequent paths are broken,
specifically, the default being `../` causes the codegen to be searched inside:
```
project/node_modules/node_modules/react-native/codegen
```
which is broken

Changelog:
[Internal] [Changed] - RNGP - Fix defaults for PrivateReactExtension

Reviewed By: cipolleschi

Differential Revision: D43435590

fbshipit-source-id: 2ed5e26c1d63fd808fc2d559ea83d6d39d106ff6
2023-02-20 05:52:20 -08:00
Riccardo Cipolleschi 421df9ffd5 Enable NDEBUG in production builds (#36194)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36194

This change is the iOS equivalent of D43344120 (8486e191a1), but for iOS.

## Changelog:
[iOS][Fixed] - Turn on NDEBUG when pods are installed for production.

Reviewed By: cortinico

Differential Revision: D43388881

fbshipit-source-id: 5c16d3d7b4265e4ee2f265a5f992cffee30f3887
2023-02-19 01:55:16 -08:00
Ruslan Shestopalyuk 1629b9f0a1 Refactor BUCK file for WebPerformance (use TurboModule plugins) (#36197)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36197

[Changelog][Internal]

This turns NativePerformance* module dependencies into "TurboModule plugins", which allows for more streamlined client integration (as it makes them register automatically once the dependency is there).

Reviewed By: rubennorte

Differential Revision: D43353204

fbshipit-source-id: 01d0089750a4873088dc4aefe34fd48693ee9791
2023-02-17 19:10:41 -08:00
Steve Alves-Blyt bcf493f346 fix: add width, height and crossOrigin props on Image type declaration file (#36196)
Summary:
According this Issue [`https://github.com/facebook/react-native/issues/36182`](https://github.com/facebook/react-native/issues/36182), the typescript compiler doesn't know the `width`, `height` and `crossOrigin` props for the `Image` component although they are taken in account in the code, [docs](https://reactnative.dev/docs/image#crossorigin) and the flow types.

## Changelog

[GENERAL] [FIXED] - Fix missing `height`, `width`, `crossOrigin` props on Typescript Image.d.ts file

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

Reviewed By: christophpurrer

Differential Revision: D43406094

Pulled By: rshest

fbshipit-source-id: 547ed142d7c39c361d195275b79b0885ef829ba1
2023-02-17 18:32:18 -08:00
Pieter Vanderwerff a4b41d2828 Deploy v0.200.0 to xplat
Reviewed By: mroch

Differential Revision: D43377809

fbshipit-source-id: fb95e86a1d5155f45104dca2a9a5989f0acea827
2023-02-17 16:47:34 -08:00
Ruslan Shestopalyuk 9aac13d4dc Fix race condition in ReadableNativeMap (#36201)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36201

[Changelog][Internal]

Guard call to the C++ ReadableNAtiveMap.importValues with a lock.

Note that all the occurrences in this class (together with importTypes) already were protected by a lock, except of this one, which with the very high chance caused crashes in T145271136.

My corresponding comment from the task,  for justification:
> If callstack to be trusted, the crash happens on the C++ side, in ReadableNativeMap::importValues().
It throws ArrayIndexOutOfBoundsException, which, looking at the code, seems to be only possible due to a corrupted data or race conditions.

> Now, looking at the Java side of ReadableNativeMap, and the particular call site... it's very dodgy, since all other occurrences of calling to native importTypes/importValues are guarded by locks, but the one crashing isn't.

NOTE: A couple of `importKeys()` instances appears to suffer from the same problem as well.

Reviewed By: javache

Differential Revision: D43398416

fbshipit-source-id: 0402de5dc723a2fba7d0247c8ad4aeff150d8340
2023-02-17 15:19:44 -08:00
Samuel Susla 60f381a8b9 Fix a crash when reloading the JS bundle
Summary:
changelog: [iOS][Fixed] Fix a crash when reloading JS bundle

Do not crash if self is nil.

Reviewed By: blakef

Differential Revision: D43352039

fbshipit-source-id: dd53677ca152d4021e43ed8d0f1b51c071ca3365
2023-02-17 14:50:53 -08:00
Nicola Corti 0b2bd0f62c Update all package usage on main after a bump (#36200)
Summary:
This updates all the package usages after the recent bump on main.

## Changelog

[INTERNAL] - Update all package usage on main after a bump

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

Test Plan: Relying on CI

Reviewed By: hoxyq

Differential Revision: D43397084

Pulled By: cortinico

fbshipit-source-id: 06a13772a627f812d7d39931f32071fa3eaa59f9
2023-02-17 14:10:15 -08:00
Pieter Vanderwerff 260aab74ce Deploy presuppressions for v0.200.0 to xplat
Reviewed By: mroch

Differential Revision: D43377746

fbshipit-source-id: 288fe8639420931ccc2f1b50a5f35090a2f023c3
2023-02-17 13:36:03 -08:00
Blake Friedman ed8a3e08e2 brew should overwrite existing python links (#36192)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36192

Builds are failing on CI because brew bails out when it tries installing Python 3.1. The image already has an existing version of Python 3, which we should overwrite.

{F876436464}

This seems to be a known issue [1] with Brew. In this case it seems safe to overwrite.

Changelog:
[General][Changed] - Brew overwrites system Python 3.

[1] https://github.com/actions/setup-python/issues/577#issuecomment-1431468702

Reviewed By: cipolleschi

Differential Revision: D43391941

fbshipit-source-id: 9b0cb234eeb0b7473b17b5ebfa6ed12c6448760f
2023-02-17 08:08:39 -08:00
Nicola Corti 6dde1dc7cb RNGP - ENTRY_FILE should resolve relative paths from root (#36193)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36193

Fixes #36186

Changelog:
[Android] [Fixed] - ENTRY_FILE should resolve relative paths from root

Reviewed By: cipolleschi

Differential Revision: D43392121

fbshipit-source-id: ddf302d333c5fc5f822e0635a73e5b52470140ee
2023-02-17 07:40:09 -08:00
Nicola Corti e42dd1593d bump package versions (#36184)
Summary:
We do have a lot of changes on `main` to ship to nightlies. This change bump all the packages with pending changes.

## Changelog

[INTERNAL] [CHANGED] - [ci][monorepo] bump package versions

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

Test Plan: Will rely on CI run.

Reviewed By: hoxyq

Differential Revision: D43363981

Pulled By: cortinico

fbshipit-source-id: eba5152dbe007eb3fad43f9088d145b3741fd94e
2023-02-17 06:19:37 -08:00
Moti Zilberman 21a0fb597a Add invalid props example to RNTester (#36162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36162

Changelog: [Internal]

Adds a dedicated screen to RNTester to help manually test the handling of various invalid prop values.

Reviewed By: huntie

Differential Revision: D43270626

fbshipit-source-id: 3fbf452955b2caace7a09fbb9c83960703fd974f
2023-02-17 05:43:24 -08:00
Blake Friedman 2cfb34f6bb log out brew install messages (#36191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36191

Brew commands used to be piped to /dev/null. We weren't able to investigate brew install failures because of this.

# Changelog:

[General][Changed] - log out brew stdout messages in CircleCI

Reviewed By: robhogan, cortinico

Differential Revision: D43389785

fbshipit-source-id: 4dc56125ef5fb87b181ad0b8f9069995ad896812
2023-02-17 05:43:22 -08:00
Samuel Susla 321868011b Avoid redundant copy of shared_ptr
Summary:
changelog: [internal]

Making a copy of shared_ptr is order of magnitude more expensive than moving it. This diff avoids two redundant copies in commit phase.

Reviewed By: rubennorte, cipolleschi

Differential Revision: D43306245

fbshipit-source-id: cfa942cc67b1e5c91be47803b80f7c8cda2e32d8
2023-02-16 13:42:26 -08:00
Samuel Susla 1f151e0d2f Back out "Add TraceUpdateOverlay to RN AppContainer"
Summary:
changelog: backout

Original commit changeset: a1530cc6e2a9

Original Phabricator Diff: D43180893 (89ef5bd6f9)

Reviewed By: Andjeliko, javache

Differential Revision: D43350025

fbshipit-source-id: 896057e16c2f466b2ecf2da6b38c56963dc51020
2023-02-16 11:46:36 -08:00
Joshua Selbo dff9f5bdef Disable Android platform for ReactCommon/react/renderer/core tests (#36176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36176

Changelog: [Internal]

Reviewed By: IanChilds, javache

Differential Revision: D43322808

fbshipit-source-id: ad0cd88c7dc892a12438c33ee6fe2727825926a2
2023-02-16 10:32:11 -08:00
Ana Margarida Silva 1d51032278 fix: border rendering problem in Android (#36129)
Summary:
Fixes https://github.com/facebook/react-native/issues/36036

The problem was in `ReactViewBackgroundDrawable.java` that was not accounting for adjacent borders that add width set to 0.

## Changelog

[Android] [Fixed] - Fix border rendering issue when bottom borders has no width

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

Test Plan:
| Previously | Now with the fix  |
| --------------- | --------------- |
| <img width="417" alt="image" src="https://user-images.githubusercontent.com/25725586/218149384-00e2145c-3c84-4590-87be-3258574489e5.png"> | <img width="414" alt="image" src="https://user-images.githubusercontent.com/25725586/218148215-a8d37158-0feb-47ae-874b-cba2f422d792.png">  |

Reviewed By: cipolleschi

Differential Revision: D43303228

Pulled By: javache

fbshipit-source-id: cf9d30fe12a5740d9ee8974a66904fd0850e7606
2023-02-16 08:09:22 -08:00
Moti Zilberman a064de151f Reduce use of assertions in parsing accessibility props
Summary:
Changelog:
[General][Fixed] - Reduce use of assertions when parsing accessibility props passed from JS

Fixes some more cases along the same lines as D43184380 (d16c1a04d8) and D43184994 (ee4714e369).

Reviewed By: jacdebug

Differential Revision: D43324899

fbshipit-source-id: fb343203f16464009931f07592e663b06dcf20e7
2023-02-16 07:03:06 -08:00
Samuel Susla e665a0f995 Use std::shared_mutex instead of folly::shared_mutex
Summary:
changelog: [internal]

C++17 has implementation of shared_mutex in standard library. Let's use it instead of folly.

Reviewed By: cipolleschi

Differential Revision: D43275493

fbshipit-source-id: d766251226aa230110011aca94b4e697fe0d31a1
2023-02-16 06:25:26 -08:00
Ruslan Shestopalyuk cf194aebfe Implement durationThreshold option for PerformanceObserver (#36152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36152

[Changelog][Internal]

By [the W3C standard](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/observe), `PerformanceObserver.observer` can optionally take a `durationThreshold` option, so that only entries with duration larger than the threshold are reported.

This diff adds support for this on the RN side, as well as unit tests for this feature on the JS side.

NOTE: The standard suggests that default value for this is 104s. I left it at 0 for now, as for the RN use cases t may be to too high (needs discussion).

Reviewed By: rubennorte

Differential Revision: D43154319

fbshipit-source-id: 0f9d435506f48d8e8521e408211347e8391d22fc
2023-02-16 06:21:43 -08:00
Ruslan Shestopalyuk 581357bc9b Implement EventCounts Web Performance API for React Native (#36181)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36181

[Changelog][Internal]

Implements EventCounts API (`Performance.eventCounts`) for Web Performance, according to the W3C standard, see the specs here: https://www.w3.org/TR/event-timing/#eventcounts

The rationale for why we need it is to support some advanced metrics computations, such as a ratio of "slow events" to total event count, per event type.

Reviewed By: rubennorte

Differential Revision: D43285073

fbshipit-source-id: 2c53d04d9a57c1301e37f2a5879072c8d33efbbf
2023-02-16 06:21:43 -08:00
Nicola Corti 8486e191a1 Address New Architecture performance regressions by properly setting NDEBUG (#36172)
Summary:
It looks like we're not properly setting `NDEBUG` for "non debug" builds with CMake (the name is terrible but that's what Buck uses originally).

This configures `NDEBUG` correctly so that is set only for release variants, so that also `REACT_NATIVE_DEBUG` is set correctly (and we don't fire asserts on release builds).
This should address several performance regression we saw for New Architecture on some release scenarios (credits to sammy-SC for spotting it).

## Changelog

[ANDROID] [FIXED] - Address New Architecture performance regressions by properly setting NDEBUG

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

Test Plan:
I've tested this by checking the ninja output for the debug/release builds for the `YogaLayoutableShadowNode.cpp` file

### Debug (does not contain `-DNDEBUG`)

```
build ReactCommon/react/renderer/components/view/CMakeFiles/rrc_view.dir/YogaLayoutableShadowNode.cpp.o: CXX_COMPILER__rrc_view_Debug /Users/ncor/git/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp || cmake_object_order_depends_target_rrc_view
  DEFINES = -Drrc_view_EXPORTS
  DEP_FILE = ReactCommon/react/renderer/components/view/CMakeFiles/rrc_view.dir/YogaLayoutableShadowNode.cpp.o.d
  FLAGS = -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -g  -fno-limit-debug-info -fPIC -Wall -Werror -std=c++17 -fexceptions -frtti -Wpedantic -Wno-gnu-zero-variadic-macro-arguments -DLOG_TAG=\"Fabric\" -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DFOLLY_HAVE_XSI_STRERROR_R=1
  INCLUDES = -I/Users/ncor/git/react-native/ReactCommon -I/Users/ncor/git/react-native/ReactAndroid/build/third-party-ndk/folly/. -I/Users/ncor/git/react-native/ReactAndroid/build/third-party-ndk/glog/exported -I/Users/ncor/git/react-native/ReactAndroid/build/third-party-ndk/double-conversion/. -I/Users/ncor/git/react-native/ReactAndroid/build/third-party-ndk/boost/boost_1_76_0 -I/Users/ncor/git/react-native/ReactAndroid/build/third-party-ndk/fmt/include -I/Users/ncor/git/react-native/ReactAndroid/src/main/jni/first-party/fbgloginit/. -I/Users/ncor/git/react-native/ReactCommon/jsi -I/Users/ncor/git/react-native/ReactCommon/logger/. -I/Users/ncor/git/react-native/ReactCommon/react/renderer/graphics/platform/android -I/Users/ncor/git/react-native/ReactAndroid/src/main/jni/first-party/fb/include -I/Users/ncor/git/react-native/ReactAndroid/src/main/jni/first-party/yogajni/jni -I/Users/ncor/git/react-native/ReactCommon/yoga/. -isystem /Users/ncor/.gradle/caches/transforms-3/ebdfaf25aad9044f80de924d25488688/transformed/fbjni-0.3.0/prefab/modules/fbjni/include
  OBJECT_DIR = ReactCommon/react/renderer/components/view/CMakeFiles/rrc_view.dir
  OBJECT_FILE_DIR = ReactCommon/react/renderer/components/view/CMakeFiles/rrc_view.dir
  TARGET_COMPILE_PDB = ReactCommon/react/renderer/components/view/CMakeFiles/rrc_view.dir/
  TARGET_PDB = /Users/ncor/git/react-native/ReactAndroid/build/intermediates/cxx/Debug/193k1y15/obj/arm64-v8a/librrc_view.pdb
```

### Release (does contain `-DNDEBUG`)

```
build ReactCommon/react/renderer/components/view/CMakeFiles/rrc_view.dir/YogaLayoutableShadowNode.cpp.o: CXX_COMPILER__rrc_view_RelWithDebInfo /Users/ncor/git/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp || cmake_object_order_depends_target_rrc_view
  DEFINES = -Drrc_view_EXPORTS
  DEP_FILE = ReactCommon/react/renderer/components/view/CMakeFiles/rrc_view.dir/YogaLayoutableShadowNode.cpp.o.d
  FLAGS = -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -O2 -g -DNDEBUG -fPIC -Wall -Werror -std=c++17 -fexceptions -frtti -Wpedantic -Wno-gnu-zero-variadic-macro-arguments -DLOG_TAG=\"Fabric\" -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DFOLLY_HAVE_XSI_STRERROR_R=1
  INCLUDES = -I/Users/ncor/git/react-native/ReactCommon -I/Users/ncor/git/react-native/ReactAndroid/build/third-party-ndk/folly/. -I/Users/ncor/git/react-native/ReactAndroid/build/third-party-ndk/glog/exported -I/Users/ncor/git/react-native/ReactAndroid/build/third-party-ndk/double-conversion/. -I/Users/ncor/git/react-native/ReactAndroid/build/third-party-ndk/boost/boost_1_76_0 -I/Users/ncor/git/react-native/ReactAndroid/build/third-party-ndk/fmt/include -I/Users/ncor/git/react-native/ReactAndroid/src/main/jni/first-party/fbgloginit/. -I/Users/ncor/git/react-native/ReactCommon/jsi -I/Users/ncor/git/react-native/ReactCommon/logger/. -I/Users/ncor/git/react-native/ReactCommon/react/renderer/graphics/platform/android -I/Users/ncor/git/react-native/ReactAndroid/src/main/jni/first-party/fb/include -I/Users/ncor/git/react-native/ReactAndroid/src/main/jni/first-party/yogajni/jni -I/Users/ncor/git/react-native/ReactCommon/yoga/. -isystem /Users/ncor/.gradle/caches/transforms-3/ebdfaf25aad9044f80de924d25488688/transformed/fbjni-0.3.0/prefab/modules/fbjni/include
  OBJECT_DIR = ReactCommon/react/renderer/components/view/CMakeFiles/rrc_view.dir
  OBJECT_FILE_DIR = ReactCommon/react/renderer/components/view/CMakeFiles/rrc_view.dir
  TARGET_COMPILE_PDB = ReactCommon/react/renderer/components/view/CMakeFiles/rrc_view.dir/
  TARGET_PDB = /Users/ncor/git/react-native/ReactAndroid/build/intermediates/cxx/RelWithDebInfo/53pv2v65/obj/arm64-v8a/librrc_view.pdb
```

Reviewed By: sammy-SC, cipolleschi

Differential Revision: D43344120

Pulled By: cortinico

fbshipit-source-id: e0567aec2742c5dab2d008cdcf198f34d5626b65
2023-02-16 06:03:01 -08:00
Nicola Corti 40c687c132 Allow for Android offline mirrors to be executed on developer's laptops
Summary:
Before this change, the only way to update the offline mirror was to run it on a devmachine
(OD won't work either due to network restriction).

Developer's laptop also won't work as they would download AAPT2 for MacOS.
In the offline mirror instead we need AAPT2 for Linux as that's Sandcastle runner type.

This relaxes this requirement so the next time a developer has to update the offline
mirror they will see the message on the diff with the command to execute, and they should
be able to run the command locally (or on their devbox).

Changelog:
[Internal] [Changed] - Allow for Android offline mirrors to be executed on developer's laptops

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D43344651

fbshipit-source-id: 3e91adb2db45cf94d3f947aaab501d98580dc43d
2023-02-16 04:38:36 -08:00
Xin Chen 70fb2dce45 Add performance.memory API
Summary:
This diff adds new performance API `memory`, which is a read-only property that gets the current JS heap size from native side.

Note that the JSI API returns an unordered map with unknown list of memory information, which is different from the [web spec](https://fburl.com/p0vpbt33). We may enforce specific memory info type on the JSI API so that it can be properly translate to the web spec.

- Update the JS spec
- Update Native implementation and return memory information with JSI API `jsi::instrumentation()::getHeapInfo()`
- Add native performance module to catalyst package

Changelog:
[General][Added] - Add performance memory API with native memory Info

Reviewed By: rubennorte

Differential Revision: D43137071

fbshipit-source-id: 319f1a6ba78fce61e665b00849ecf2579094af83
2023-02-15 20:52:48 -08:00
Moti Zilberman ee4714e369 Consistently assign defaults when prop parsing fails (#36163)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36163

Changelog:
[General][Fixed] - Fix assertions in Fabric layout and transform prop parsing

Continues D43184380 by adding more graceful fallback paths to the prop parsing logic in Fabric.

Reviewed By: sammy-SC

Differential Revision: D43184994

fbshipit-source-id: 8f2bb6cdc23197a431b914b36523dce8a8af9b54
2023-02-15 15:40:24 -08:00