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

26694 Коммитов

Автор SHA1 Сообщение Дата
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
Moti Zilberman d16c1a04d8 Reduce use of assertions in prop parsing (#36164)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36164

Changelog:
[General][Fixed] - Invalid prop values no longer trigger assertion failures in Fabric

## Context

Fabric has historically been very strict about prop parsing. It originally `abort()`ed on any prop value that failed to parse according to the expected type; this was replaced with dev-only assertions in D27540903 (cb37562f83). We've received feedback that C++ assertions (and other similar mechanisms in the legacy renderer) are still too aggressive and disruptive as a diagnostic for developers working on JS code.

We are changing React Native to behave more like a browser in this regard, reflecting a new principle that **bad style values are not runtime errors**. (See e.g. D43159284 (d6e9891577).) The recommended way for developers to ensure they are passing correct style values is to use a typechecker (TypeScript or Flow) in conjunction with E2E tests and manual spot checks.

More broadly, values passed from JS product code should not be able to crash the app, which is why we're not strictly limiting this change to style props. From now on, if a JS developer can trigger an internal assertion in React Native simply by writing normal application code, that is a bug.

## This diff

This diff introduces a new macro called `react_native_expect` which serves as a drop-in replacement for `react_native_assert`, but logs (to glog / logcat / stdout) instead of asserting. This way we don't need to fully delete the existing call sites. This will be helpful if we decide that we want to repurpose these checks for a new, more visible diagnostic.

I'm *intentionally* opting for the simplest possible improvement here, which is to silence the assertions - not to print them to the JS console, not to convert them to LogBox warnings, etc. The hypothesis is that this is already strictly an improvement over the previous behaviour, will help us get to feature parity between renderers faster, and allow us to design improved diagnostics that are consistent and helpful.

## Next steps

1. There are still places where Fabric can hit an unguarded assertion in prop conversion code (e.g. unchecked casts from `RawValue` with no fallback code path). I will fix those in a separate diff.
2. Paper on iOS needs a similar treatment as it calls `RCTLogError` liberally during prop parsing (resulting in a native redbox experience that is nearly as bad as an outright crash). I will fix that in a separate diff.
3. I'll add some manual test cases to RNTester to cover these scenarios.
4. We will eventually need to take a clear stance on PropTypes, but since they provide reasonable, non-breaking diagnostics (recoverable JS LogBox + component stack) it is less urgent to do so.

Reviewed By: sammy-SC

Differential Revision: D43184380

fbshipit-source-id: 0c921efef297d935a2ae5acc57ff23171356014b
2023-02-15 15:40:24 -08:00
Felipe Perez 8232c47dcf Make JSONArguments accept Long values
Summary:
This util class was introduced in D42978852 (611f9c615e), but the Long type was not ported over. Not sure if this was intentional or not, but this is used from return values from DeviceConfig, where number values are encoded as Long types.

Changelog:
[Internal] - internal

Differential Revision: D43323851

fbshipit-source-id: 6a8a27b75b1738f2f87dd56ee814316af323c258
2023-02-15 14:04:52 -08:00
Moti Zilberman e328fc2e24 Reduce use of Java exceptions in prop parsing (#36160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36160

Changelog:
[Android][Fixed] - Invalid prop values no longer trigger Java exceptions in the legacy renderer

## Context

We are changing React Native to behave more like a browser in the sense that **bad style values are not runtime errors**. (See e.g. D43159284 (d6e9891577), D43184380.) The recommended way for developers to ensure they are passing correct style values is to use a typechecker (TypeScript or Flow) in conjunction with E2E tests and manual spot checks.

## This diff

This change is similar to D43184380, but here we target the legacy renderer on Android by (1) replacing exceptions with logging calls, (2) adding fallback values (equivalent to resetting the respective props to `null`) where needed, and (3) replacing `null` checks in `ReactProp` converters with `instanceof` checks.

Leaving the logging call sites in place (as opposed to deleting them) will be helpful if we decide that we want to repurpose these checks for a new, more visible diagnostic (though we would likely only build such a diagnostic in Fabric at this point).

Reviewed By: javache

Differential Revision: D43274525

fbshipit-source-id: 9d1e7ca3b6299dd827e8667e3d542433ec896c0e
2023-02-15 13:06:36 -08:00
Moti Zilberman cb28a2c46e Reduce use of RCTLogError (redbox) in prop parsing (#36161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36161

Changelog:
[iOS][Fixed] - Invalid prop values no longer trigger redbox in the legacy renderer

## Context

We are changing React Native to behave more like a browser in the sense that **bad style values are not runtime errors**. (See e.g. D43159284 (d6e9891577), D43184380.) The recommended way for developers to ensure they are passing correct style values is to use a typechecker (TypeScript or Flow) in conjunction with E2E tests and manual spot checks.

## This diff

This change is similar to D43184380, but here we target the legacy renderer on iOS by removing the redboxes from most of `RCTConvert`'s methods.

I'm intentionally going with the simplest possible improvement which is to downgrade the redboxes to `RCTLogInfo` ( = log to stdout but not the JS console). Leaving the call sites in place (as opposed to deleting them) will be helpful if we decide that we want to repurpose these checks for a new, more visible diagnostic (though we would likely only build such a diagnostic in Fabric at this point).

Reviewed By: javache

Differential Revision: D43184379

fbshipit-source-id: 5a3d12f5d884372c7dc8743227d58d403caf24e3
2023-02-15 09:34:23 -08:00
Pieter De Baets 167d52dacd Fix ComponentDescriptorProviderRegistry uninitialized fields
Summary:
`setComponentDescriptorProviderRequest` is only used on iOS for dynamic registration of additional components. This variable is not default initialized, so will point to invalid memory when a component is missing and thus crash.

Changelog: [Internal] Fix Android crash when component is missing

Reviewed By: rubennorte

Differential Revision: D43305656

fbshipit-source-id: 70dd2973d50abbfcc19e051bd24c1deb90883941
2023-02-15 08:13:23 -08:00
Samuel Susla 8299cdcdea React Native sync for revisions 48b687f...fccf3a9
Summary:
This sync includes the following changes:
- **[86c8c8db7](https://github.com/facebook/react/commit/86c8c8db7 )**: test: Don't retry flushActWork if flushUntilNextPaint threw ([#26121](https://github.com/facebook/react/pull/26121)) //<Sebastian Silbermann>//
- **[64acd3918](https://github.com/facebook/react/commit/64acd3918 )**: remove unguarded getRootNode call ([#26152](https://github.com/facebook/react/pull/26152)) //<Josh Story>//
- **[71cace4d3](https://github.com/facebook/react/commit/71cace4d3 )**: Migrate testRunner from jasmine2 to jest-circus ([#26144](https://github.com/facebook/react/pull/26144)) //<Ming Ye>//
- **[c8510227c](https://github.com/facebook/react/commit/c8510227c )**: Treat displayName as undefined ([#26148](https://github.com/facebook/react/pull/26148)) //<Sebastian Markbåge>//
- **[55542bc73](https://github.com/facebook/react/commit/55542bc73 )**: Update jest printBasicPrototype config ([#26142](https://github.com/facebook/react/pull/26142)) //<Ming Ye>//
- **[6396b6641](https://github.com/facebook/react/commit/6396b6641 )**: Model Float on Hoistables semantics ([#26106](https://github.com/facebook/react/pull/26106)) //<Josh Story>//
- **[ef9f6e77b](https://github.com/facebook/react/commit/ef9f6e77b )**: Enable passing Server References from Server to Client ([#26124](https://github.com/facebook/react/pull/26124)) //<Sebastian Markbåge>//
- **[35698311d](https://github.com/facebook/react/commit/35698311d )**: Update jest escapeString config ([#26140](https://github.com/facebook/react/pull/26140)) //<Ming Ye>//
- **[6ddcbd4f9](https://github.com/facebook/react/commit/6ddcbd4f9 )**: [flow] enable LTI inference mode ([#26104](https://github.com/facebook/react/pull/26104)) //<Jan Kassens>//
- **[53b1f69ba](https://github.com/facebook/react/commit/53b1f69ba )**: Implement unstable_getBoundingClientRect in RN Fabric refs ([#26137](https://github.com/facebook/react/pull/26137)) //<Rubén Norte>//
- **[594093496](https://github.com/facebook/react/commit/594093496 )**: Update to Jest 29 ([#26088](https://github.com/facebook/react/pull/26088)) //<Ming Ye>//
- **[28fcae062](https://github.com/facebook/react/commit/28fcae062 )**: Add support for SVG `transformOrigin` prop ([#26130](https://github.com/facebook/react/pull/26130)) //<Aravind D>//
- **[3ff1540e9](https://github.com/facebook/react/commit/3ff1540e9 )**: Prefer JSX in ReactNoop assertions (to combat out-of-memory test runs) ([#26127](https://github.com/facebook/react/pull/26127)) //<Sebastian Silbermann>//
- **[01a0c4e12](https://github.com/facebook/react/commit/01a0c4e12 )**: Add Edge Server Builds for workerd / edge-light ([#26116](https://github.com/facebook/react/pull/26116)) //<Sebastian Markbåge>//
- **[f0cf832e1](https://github.com/facebook/react/commit/f0cf832e1 )**: Update Flight Fixture to "use client" instead of .client.js ([#26118](https://github.com/facebook/react/pull/26118)) //<Sebastian Markbåge>//
- **[03a216070](https://github.com/facebook/react/commit/03a216070 )**: Rename "dom" fork to "dom-node" and "bun" fork to "dom-bun" ([#26117](https://github.com/facebook/react/pull/26117)) //<Sebastian Markbåge>//
- **[4bf2113a1](https://github.com/facebook/react/commit/4bf2113a1 )**: Revert "Move the Webpack manifest config to one level deeper ([#26083](https://github.com/facebook/react/pull/26083))"  ([#26111](https://github.com/facebook/react/pull/26111)) //<Sebastian Markbåge>//
- **[2ef24145e](https://github.com/facebook/react/commit/2ef24145e )**: [flow] upgrade to 0.199.0 ([#26096](https://github.com/facebook/react/pull/26096)) //<Jan Kassens>//
- **[922dd7ba5](https://github.com/facebook/react/commit/922dd7ba5 )**: Revert the outer module object to an object ([#26093](https://github.com/facebook/react/pull/26093)) //<Sebastian Markbåge>//
- **[9d111ffdf](https://github.com/facebook/react/commit/9d111ffdf )**: Serialize Promises through Flight ([#26086](https://github.com/facebook/react/pull/26086)) //<Sebastian Markbåge>//
- **[0ba4698c7](https://github.com/facebook/react/commit/0ba4698c7 )**: Fix async test in React reconciler ([#26087](https://github.com/facebook/react/pull/26087)) //<Ming Ye>//
- **[8c234c0de](https://github.com/facebook/react/commit/8c234c0de )**: Move the Webpack manifest config to one level deeper ([#26083](https://github.com/facebook/react/pull/26083)) //<Sebastian Markbåge>//
- **[977bccd24](https://github.com/facebook/react/commit/977bccd24 )**: Refactor Flight Encoding ([#26082](https://github.com/facebook/react/pull/26082)) //<Sebastian Markbåge>//
- **[d7bb524ad](https://github.com/facebook/react/commit/d7bb524ad )**: [cleanup] Remove unused package jest-mock-scheduler ([#26084](https://github.com/facebook/react/pull/26084)) //<Ming Ye>//
- **[6b3083266](https://github.com/facebook/react/commit/6b3083266 )**: Upgrade prettier ([#26081](https://github.com/facebook/react/pull/26081)) //<Jan Kassens>//
- **[1f5ce59dd](https://github.com/facebook/react/commit/1f5ce59dd )**: [cleanup] fully roll out warnAboutSpreadingKeyToJSX ([#26080](https://github.com/facebook/react/pull/26080)) //<Jan Kassens>//

Changelog:
[General][Changed] - React Native sync for revisions 48b687f...fccf3a9

jest_e2e[run_all_tests]

Reviewed By: rubennorte

Differential Revision: D43305607

fbshipit-source-id: 8da7567ca2a182f4be27788935c2da30a731f83b
2023-02-15 08:03:07 -08:00
Nicola Corti 4a07ed2c0c Make it easier for users to build from source if needed (#36165)
Summary:
This page is not up to date anymore:
https://reactnative.dev/contributing/how-to-build-from-source

I'm pushing those changes to make it easier to consume our build when building from source.
I'll update the page those change lands.

## Changelog

[Internal] [Changed] - Make it easier for users to build from source if needed

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

Test Plan: If the CI is green, we should be good to merge this

Reviewed By: cipolleschi

Differential Revision: D43303867

Pulled By: cortinico

fbshipit-source-id: c0080b06cbcbf872ee92fcfa82a9f823d5b247f4
2023-02-15 06:05:56 -08:00
Tomek Zawadzki 3418f65d88 Expose `rrc_root` via prefab (#36166)
Summary:
The `rrc_root` was not exposed via prefab. I'm adding it to make possible for Reanimated to integrate on top of React Native via prefab. Based on https://github.com/facebook/react-native/issues/35643.

## Changelog

[ANDROID] [CHANGED] - Expose `rrc_root` via prefab.

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

Reviewed By: cipolleschi

Differential Revision: D43304302

Pulled By: cortinico

fbshipit-source-id: 1c4a7013a33b48a8a7a445a78430630542420f4d
2023-02-15 06:04:52 -08:00
Ruslan Shestopalyuk f76d4dee6f Reference implementation (mock) for NativePerformanceObserver (#36116)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36116

[Changelog][Internal]

Add a minimal/reference JavaScript implementation for NativePerformanceObserver - the purpose is both unit testing (JS and native sides separately) and potentially shimming the part of functionality that is not dependent on native side.

This is both a setup for adding general unit tests for the Performance* APIs, but also to be able to do non-trivial changes on JS side for WebPerformance (such as in (D43154319).

Reviewed By: rubennorte

Differential Revision: D43167392

fbshipit-source-id: 213d9534d810dece1dd464f910e92e08dbf39508
2023-02-15 06:03:12 -08:00
Ruslan Shestopalyuk 96fb708d3e Make enums to work as part of data structures for C++ TurboModules codegen (#36155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36155

[Changelog][Internal]

The PR  https://github.com/facebook/react-native/pull/36030 (diff D42884147 (ceb1d0dea6)) added support for enum types in JS to C++ bridging in C++ TurboModules.

This only worked for enums as argument types for exposed methods, but not for the cases when enums are members of complex data structures that are also exposed through a codegen.

This diff fixes this problem, so that codegen now correctly works both with enum types as method arguments, but also as data structure members.

Some part of the change is the same as D42008724 (963e45afd1), but there are also some changes related to the types, that were required.

Reviewed By: christophpurrer

Differential Revision: D43292254

fbshipit-source-id: b2d6cf4a2d4d233b8cc403ecd02b5be16d5d91a7
2023-02-15 06:03:12 -08:00
Saad Najmi 7208cd6384 Switch to xcbeautify (#36131)
Summary:
`xcpretty` is no longer maintained. Let's switch to `xcbeautify`, which is faster and is maintained. I'm also biased because `xcpretty` hid an error from me that `xcbeautify` did not.

## Changelog

[INTERNAL] [CHANGED] - Move CI from `xcpretty` to `xcbeautify`

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

Test Plan:
Locally yarn `yarn test-ios` and got output that looks like this:

<img width="1245" alt="Screenshot 2023-02-11 at 9 34 07 PM" src="https://user-images.githubusercontent.com/6722175/218291538-07760f94-7e52-4919-b603-8a35a623fc9a.png">

I also confirmed a junit report that looks like this was generated:
```xml
<testsuites name="Selected tests" tests="193" failures="0">
    <testsuite name="RCTLoggingTests" tests="1" failures="0">
        <testcase classname="RCTLoggingTests" name="testLogging" time="0.175" />
    </testsuite>
    <testsuite name="RCTUIManagerScenarioTests" tests="3" failures="0">
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToAddRemoveAndMove" time="0.001" />
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToAddViews" time="0.000" />
        <testcase classname="RCTUIManagerScenarioTests" name="testManagingChildrenToRemoveViews" time="0.001" />
    </testsuite>
    ...
```

Reviewed By: cortinico

Differential Revision: D43232774

Pulled By: cipolleschi

fbshipit-source-id: fda4e217d4df55b5088026d6911d3dc6c8c9e824
2023-02-15 04:20:20 -08:00
Riccardo Cipolleschi 13271d3c80 Align OfflineMirrors
Summary:
Align offline mirrors after changes

allow-large-files

## Changelog
[internal] - Align offline mirrors

Reviewed By: cortinico

Differential Revision: D43302165

fbshipit-source-id: d4903d03a54f938ca78d295b4d7c9bca213721cb
2023-02-15 04:17:06 -08:00
Riccardo Cipolleschi 0e09d6f8a6 Move files from `.../textlayoutmanager/platform/ios` to `.../textlayoutmanager/platform/ios/react/renderer/textlayoutmanager` (#36158)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36158

To properly setup the Header Search Paths for `use_frameworks!`, we need to move the files that are in the `.../textlayoutmanager/platform/ios` folder into the `.../textlayoutmanager/platform/ios/react/renderer/textlayoutmanager` folder.

This mimic the same folder structure we have also `android`

## Changelog
[iOS][Changed] Moved the files from `.../textlayoutmanager/platform/ios` to `.../textlayoutmanager/platform/ios/react/renderer/textlayoutmanager`

Reviewed By: cortinico

Differential Revision: D43088586

fbshipit-source-id: 9589fe62f36fbff2744fdfbf3475e95954424232
2023-02-15 04:17:06 -08:00
Riccardo Cipolleschi 931a4c5e23 Move files from `.../imagemanager/platform/ios` to `.../imagemanager/platform/ios/react/renderer/imagemanager`
Summary:
To properly setup the Header Search Paths for `use_frameworks!`, we need to move the files that are in the `.../imagemanager/platform/ios` folder into the `.../imagemanager/platform/ios/react/renderer/imagemanager` folder.

This mimic the same folder structure we have also `android`

## Changelog
[iOS][Changed] Moved the files from `.../imagemanager/platform/ios` to `.../imagemanager/platform/ios/react/renderer/imagemanager`

Reviewed By: cortinico

Differential Revision: D43088421

fbshipit-source-id: c3b86a95e67cc1ab9531997bb1bfbf011b7f730f
2023-02-15 04:17:06 -08:00
Riccardo Cipolleschi 5588e0fe0b Move files from `.../textinput/iostextinput` to `.../textinput/iostextinput/react/renderer/components/iostextinput`
Summary:
To properly setup the Header Search Paths for `use_frameworks!`, we need to move the files that are in the `.../textinput/iostextinput` folder into the `.../textinput/iostextinput/react/renderer/components/iostextinput` folder.

This mimic the same folder structure we have also `android`

## Changelog
[iOS][Changed] Moved the files from `.../textinput/iostextinput` to `.../textinput/iostextinput/react/renderer/components/iostextinput`

Reviewed By: cortinico

Differential Revision: D43084639

fbshipit-source-id: fe0f55d9f372bda0fbd59c6c567ac747ca308a69
2023-02-15 04:17:06 -08:00
Riccardo Cipolleschi d1e500c3b1 Move ReactCommon's `.../nativemodule/xxx/platform/ios` files to `.../nativemodule/xxx/platform/ios/ReactCommon`
Summary:
To properly setup the Header Search Paths for `use_frameworks!`, we need to move the files that are in the `.../nativemodule/xxx/platform/ios` folder into the `.../nativemodule/xxx/platform/ios/ReactCommon` folder.

We have two folders to migrate: `core` and `sample`.
As a cleanup, `sample` should be extracted from the codebase and moved to RNTester or a library as it can be used as an example to add more examples in the codebase that we ship to our users.

This mimic the same folder structure we have also in `cxx` and `android`

## Changelog
[iOS][Changed] Moved the files from `.../nativemodule/xxx/platform/ios` to `.../nativemodule/xxx/platform/ios/ReactCommon`

Reviewed By: cortinico

Differential Revision: D43082851

fbshipit-source-id: 414426274d9a5ab20cc0e76cdada0c2977264b5f
2023-02-15 04:17:06 -08:00
Riccardo Cipolleschi b5e4fea86e Move graphics' platform/ios files to graphics/platform/ios/react/renderer/graphics folder structure
Summary:
To Properly setup the Header Search Paths for `use_frameworks!`, we need to move the files that are in the `react/renderer/graphics/platform/ios` folder into the `react/renderer/graphics/platform/ios/react/renderer/graphics` folder.

This mimic the same folder structure we have also in `cxx` and `android`

## Changelog:
[iOS][Changed] - Moved the files from `.../platform/ios` to `.../platform/ios/react/renderer/graphics`

Reviewed By: sshic

Differential Revision: D43082032

fbshipit-source-id: 519d2e12eb7edd50b5f71bac5b1c618c6bf89919
2023-02-15 04:17:06 -08:00
Xin Chen 89ef5bd6f9 Add TraceUpdateOverlay to RN AppContainer
Summary:
This diff adds `TraceUpdateOverlay` native component to RN `AppContainer.js`. This will enable the overlay when the build is in DEV environment and the DevTools global hook exists. It also closed gap between the JS dev mode and native dev support flag, so that the native component will be available when used by JS.

## Update (2/13/2023)
Instead of the original approach where I put a default value to the devsupport manager flag, I did ui manager check from JS and make sure the native component exists before using it. This is cleaner.

## Problem
Since the `AppContainer` is being used by all RN apps, we need to make sure the native component is registered in UI Manager of the RN app when it's used. Currently, the native component lives in the `DebugCorePackage.java`, which is added to the RN app [when the `DevSupportManager` is used](https://fburl.com/code/muqmqbsa). However, there's no way to tell if an app is using dev support manager in JS, hence there are gaps when the JS code uses `TraceUpdateOverlay`, vs when the native code registered the native component. This issue caused test error in [ReactNativePerfTest](https://fburl.com/testinfra/j24wzh46) from the [previous diff](https://fburl.com/diff/bv9ckhm7), and it actually prevents Flipper from running this properly as shown in this video:

https://pxl.cl/2sqKf

The errors shown in Flipper indicates the RN surface from the plugin is also missing `TraceUpdateOverlay` in its UI Manager:

{F869168865}

## Solution
To fix this issue, we should find a way to expose if the app is using dev support manager in JS. Or we should set to use DevSupportManager whenever it's a dev build as claimed in JS. I will try to find some way to achieve either one of this. I am open to suggestions here for where I should add the native component to. Given that it's used in the AppContainer, and any app could be built in development mode, I don't want to make people to manually add this native component themselves.

## Alternatives
There are some other approaches that could mitigate the issue, but less ideal:

For the test issue
1) Add `setUseDeveloperSupport(true)` to [ReactNativeTestRule.java](https://fburl.com/code/7jaoamdp). That will make the related test pass by using the DevSupportPackages, which has the native component. However, it only fixes tests using that class.

2) Override the package for [ReactNativeTestRule.java](https://fburl.com/code/b4em32fa), or `addPackage` with more packages including the native component. Again this only fixes this test.

3) Add the native component to the [`MainReactPackage`](https://fburl.com/code/nlayho86), which is what I did here in this diff. This would fix more cases as this package is [recommended to be used](https://fburl.com/code/53eweuoh) for all RN app. However, it may not fix all the cases if the RN app didn't manually use it.

4) Add the native component in the [`CoreModulesPackage`](https://fburl.com/code/lfeklztl), which will make all RN apps work, but at the cost of increase package size when this feature is not needed. Or, we could argue that we want to have highlights on trace updates for production build as well?

Changelog:
[Internal] - Enable TraceUpdateOverlay to RN AppContainer

Reviewed By: rubennorte

Differential Revision: D43180893

fbshipit-source-id: a1530cc6e2a9d8c905bdfe5d622d85c4712266f8
2023-02-14 22:32:55 -08:00
Ramanpreet Nara 11570e71a2 Deprecate LazyReactPackage.getReactModuleInfoProviderViaReflection
Summary:
There are two different ways of getting the ReactModuleInfoProvider from LazyReactPackage:
1. static LazyReactPackage.getReactModuleInfoProviderViaReflection(LazyReactPackage)
2. LazyReactPackage.getReactModuleInfoProvider()

The first way calls into codegen that only works within Meta's infra. This code-path is *now* dead. Therefore, this diff deprecates the first path, to make LazyReactPackage less confusing.

This diff simplifies the implementation to return an empty ReactModuleInfoProvider for the v0.72 cut.

In the v0.73 cut, we'll just outright delete this method.

Changelog: [Android][Changed] - Deprecate LazyReactPackage.getReactModuleInfoProviderViaReflection()

Reviewed By: sshic

Differential Revision: D43066800

fbshipit-source-id: 2145c3265ff2bd24e6828b193577ba1f500bce49
2023-02-14 14:31:52 -08:00
Xin Chen 611f9c615e Create util class for parsing JSONObject and JSONArray to ReadableMap and ReadableArray
Summary:
This diff pays the duty in T126215968 where we should move the util methods to a shareable place. ~~I cannot find a good util namespace so I created on under `com.facebook.react.panelapp`.~~ This lives under `com.facebook.react.bridge` next to the `Arguments` class.

- Create ~~`ReadableDataParser.java`~~ `JSONArguments.java`
- Reuse in multiple places within `react-panellib`

Changelog:
[Internal] - Code refactor on JSON and ReadableMap conversion

Reviewed By: javache

Differential Revision: D42978852

fbshipit-source-id: e00a5c4cefcf6114d9a5d947cb00e3ff7f0dccaa
2023-02-14 13:41:32 -08:00
Vojtech Novak 7b14180302 fix: remove unavailable EventEmitter TS export (#36109)
Summary:
currently, using TS, this is a valid import:

`import { EventEmitter } from 'react-native';`

However, looking at the [index file](https://github.com/facebook/react-native/blob/main/index.js) we can see that there is no such export.

I first thought I'd add the EventEmitter export in order to get the `index.js` in line with the types, but it appears that the Event Emitter will become a separate package at some point https://github.com/facebook/react-native/pull/34401 so removing it from the types seems to be better for future.

## Changelog

fix: remove unavailable EventEmitter TS export

Pick one each for the category and type tags:

[INTERNAL] [CHANGED] - remove unavailable EventEmitter TS export

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

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

Test Plan: tested locally: using `import { EventEmitter } from 'react-native';` correctly gives `TS2305: Module '"react-native"' has no exported member 'EventEmitter'.`

Reviewed By: javache, cortinico

Differential Revision: D43155568

Pulled By: NickGerleman

fbshipit-source-id: b9e8c3f4be9812637c8588d14a9ce4edf188ed36
2023-02-14 10:12:34 -08:00
Nick Gerleman 9a885db962 Remove config null check
Summary:
This removes the null-check on Yoga config added (we think we root-caused the issue), and adds an assertion to the public API accepting a config that it is non-null.

There are more changes to config setting that will come later.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D43273456

fbshipit-source-id: cba498352d114a3fa2694f3a144f5f01a83d3190
2023-02-14 09:42:43 -08:00
Ruslan Lesiutin 28d8f25c76 fix: update executor for packages publishing workflow (#36146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36146

Changelog: [Internal]

- While working on 0.71.3, it was discovered that `react-native-codegen` package is being published almost empty (without `lib` folder)
- The reason for it is that `prepare` script is not being executed
- The main reason for it is npm v6, which requires adding `unsafe-perm` flag for it: https://www.vinayraghu.com/blog/npm-unsafe-perm
- Instead of using this flag, changing executor to `nodelts`, which has node v18 and npm v8
- Also adding `run_yarn` before running the script, because `react-native/codegen` uses external dependencies (such as rimraf) for its build scripts

Reviewed By: cipolleschi

Differential Revision: D43248175

fbshipit-source-id: d12b93decbf408713e309fe8be75d8d5ec994868
2023-02-14 07:06:53 -08:00
Umut Topuzoğlu 0d82b402aa Fix missing node error message not printed correctly (#36140)
Summary:
When the node version could not be found there is an error message shown to help what can be done to fix this issue (for example in the error logs in xcode)

The problem was that the backtick symbol is interpreted as running commands in terminals so the parts that were in backticks were run and the error message was printed incompletely. Also there were other errors added (.xcode.env command not found, for example) which makes it harder to understand what is going on.

In bash / zsh single quotes does not expand commands and variables unlike double quotes which does this.

## Changelog

[IOS] [FIXED] - Fix missing node error message not printed correctly when deprecated `find-node-for-xcode.sh` is used.

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

Test Plan:
I just ran the xcode build again after updating it manually in the node_modules folder.

The log output changed from this
```
[Warning] You need to configure your node path in the  environment.  You can set it up quickly by running:  echo 'export NODE_BINARY=/Users/uloco/Library/Caches/fnm_multishells/78434_1676301546457/bin/node' > .xcode.env  in the ios folder. This is needed by React Native to work correctly.  We fallback to the DEPRECATED behavior of finding . This will be REMOVED in a future version.  You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment
```

to this
```
[Warning] You need to configure your node path in the `".xcode.env" file` environment.  You can set it up quickly by running:  `echo export NODE_BINARY=$(command -v node) > .xcode.env`  in the ios folder. This is needed by React Native to work correctly.  We fallback to the DEPRECATED behavior of finding `node`. This will be REMOVED in a future version.  You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment
```

Reviewed By: cortinico, cipolleschi

Differential Revision: D43258623

Pulled By: rshest

fbshipit-source-id: 7db0d983b204e59504666686be78311c4c2fb993
2023-02-14 07:05:03 -08:00
Lorenzo Sciandra e45e718dd6 add 0.71.3 changelog (#36149)
Summary:
Adds changelog for new patch.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - add changelog entry for 0.71.3

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

Test Plan: N/A

Reviewed By: dmytrorykun

Differential Revision: D43272716

Pulled By: cipolleschi

fbshipit-source-id: 58ca3f598aa6a23092902ab6317b01d6915e74e9
2023-02-14 06:51:38 -08:00
szymonrybczak f72f8daeaf feat: add invoking dev menu on iOS by pressing `d` in terminal (#36115)
Summary:
Inspired by tido64's comment https://github.com/react-native-community/cli/issues/1820#issuecomment-1424270890 I'm adding missing implementation on iOS for invoking dev menu by pressing `d` in terminal while metro is launched.

## Changelog

[IOS][ADDED] - Add invoking dev menu on iOS by pressing `d` in terminal.

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

Test Plan:
Press `d` in terminal while metro is launched - dev menu should appear.

https://user-images.githubusercontent.com/63900941/217936561-deea1390-221e-4f32-bbc4-e6fcfdf2a992.mp4

Reviewed By: rshest

Differential Revision: D43185001

Pulled By: javache

fbshipit-source-id: daa7af3b24b1b9f10d1a1ef8db8d9af816e912ea
2023-02-14 04:33:39 -08:00