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

26488 Коммитов

Автор SHA1 Сообщение Дата
Sheikh Jamir Alam f3155d0f80 Update RCTDevMenu.mm (#35910)
Summary:
Fixed typo with the word "running" in 2 places when failing to open Flipper.

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

Changelog:
[Internal] [Changed] - Fix typo with the word "running" when failing to open Flipper

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

Reviewed By: christophpurrer

Differential Revision: D42641042

Pulled By: sshic

fbshipit-source-id: acebb26ab921e98235c4f8e8535fa89be2ffa8cd
2023-01-23 05:04:03 -08:00
Vicary A a69a924d51 fix(deps): expose yarn peer dependencies (#35915)
Summary:
Fixes https://github.com/facebook/react-native/issues/35913

## CHANGELOG

[General] [Fixed] - Peer dependency warnings for Yarn 3

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

Test Plan:
```bash
yarn set version berry
yarn add react-native-changelog
```

Reviewed By: cortinico

Differential Revision: D42674105

Pulled By: jacdebug

fbshipit-source-id: 4270512b1b4857765a183389981b797cfecefcbd
2023-01-23 04:25:32 -08:00
Neil Dhar cd5a8c48c5 Only intercept JSIExceptions when constructing JSError
Summary:
Constructing a `JSError` currently catches all exceptions that occur,
regardless of their type, and embeds the information from them in the
newly created `JSError`. This means that the type of exceptions can be
silently changed.

This results in a bug if Hermes is built with
`HERMESVM_EXCEPTION_ON_OOM` enabled. The OOM exception will get
converted to a `JSError`, which in turn can get converted into a
regular JS exception. The regular JS exception can then be caught by JS
and ignored. This leads to the VM continuing to execute in a bad
state.

I considered three ways to fix this:
1. Add a new type of exception to JSI that is intentionally meant to be
ignored, and the Hermes OOM exception then subclasses it.
2. Propagate all exceptions that happen when constructing `JSError`.
3. Propagate all exceptions except `JSIException`s when constructing
`JSError`.

The first is technically the most surgical, but it adds complexity to
JSI, and will require some extra machinery to implement since we
wouldn't be able to throw it directly from inside the VM. I'm also not
comfortable with the idea of JSI suppressing exceptions that are
completely unrelated to JSI.

The second is the simplest, and seems to match what JS would do if
`throw new Error()` itself threw, but there is some possibility that it
is a change in behaviour for existing code.

So the third approach, which is implemented in this diff, tries to
compromise between the two. Hermes can only ever throw `JSIException`s
from regular JS operations, so there should be no change for existing
code (except code that uses exceptions on OOM, which is what we're
trying to fix). Any other exception gets passed through to the caller.

Changelog:
[Internal][Fixed] - Fixed handling of Hermes OOM exceptions in JSI.

Reviewed By: jpporto

Differential Revision: D41831616

fbshipit-source-id: 42e0dde1c4acc016ab19533941c58fc1797ba1c2
2023-01-22 00:25:49 -08:00
Luna Wei 8fbcb5cf94 RNTester: Number the WPT tests
Summary: Changelog: [Internal] Number WPT tests

Reviewed By: vincentriemer

Differential Revision: D42591932

fbshipit-source-id: 53d32692dc2fd2ec150e836b0ffb81cba87051ef
2023-01-20 15:16:28 -08:00
Luna Wei 675a7a12cf PointerEvents: Infer hoverability
Summary: Changelog: [Internal] Infer whether a pointer supports hover or not by presence of events

Reviewed By: vincentriemer, NickGerleman

Differential Revision: D42589958

fbshipit-source-id: aa42affc98ef78ebbf9a6e420684ed098869b905
2023-01-20 12:22:40 -08:00
Arushi Kesarwani 208f559505 Getting rid of Toast in Dev Loading View post Native Module is released (#35888)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35888

Changelog:
[Android][Removed] - For supporting Dev Loading View across multiple platforms, changed the Loading View of Android to rely on the native implementation instead of Toast. Getting rid of the JS changes relying on Toast for Dev Loading View now that the native module is released.

Reviewed By: rshest

Differential Revision: D42599220

fbshipit-source-id: ec7098b508c766c07384d48d3bffed075b092b72
2023-01-19 21:15:03 -08:00
Devon Mars 9cf35bfcc4 Add newline to UTFSequence
Summary:
Changelog:
[General][Added] - Added newline to UTFSequence

Reviewed By: bvanderhoof

Differential Revision: D42614321

fbshipit-source-id: 50af9815af9d2f57de1b216b4adf05bea6c4ad46
2023-01-19 14:04:23 -08:00
Thibault Malbranche 1405269270 add 0.71.1 changelog (#35902)
Summary:
Create Changelog for 0.71.1

## Changelog

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

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

Test Plan: Not needed

Reviewed By: christophpurrer

Differential Revision: D42609062

Pulled By: cipolleschi

fbshipit-source-id: 60e5f9b49bb50fa451481161e9dc1037bb735582
2023-01-19 10:43:07 -08:00
Ruslan Shestopalyuk 059184e7ce setUpPerformance not to redirect to WebPerformance before the API is public (#35901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35901

[Changelog][Internal]
Partially reverts the change that was redirecting `performance` instance to the new implementation in WebPerformance, until the actual implementation becomes public and native modules are included by default.

Reviewed By: rubennorte

Differential Revision: D42607379

fbshipit-source-id: c1ce995d20b9dfe7aef8436cea00d89b81e32932
2023-01-19 10:08:32 -08:00
Nick Gerleman 32f54877ff Do not use WindowInsetsCompat for Keyboard Events (#35897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35897

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

Android 11 added native support for querying whether the IME is present along with its size, as part of the WindowInsets API. D38500859 (1e48274223) changed our logic for Android keyboard events to use it when available, fixing a longstanding issues where we could not reliably tell where the keyboard was open depending on softInputMode.

An androidx library WindowInsetsCompat aimed to backport some of the functionality to older versions of Android, with the same API, documenting IME queries to work down to API level 23 (Android 6). I used this, so that we would be able to remove our own logic for detecting keyboard insets once we supported 23+.

From an issue report, WindowInsetsCompat is not accurately returning whether the IME is open on at least Android 9. So this change makes it so we only use WindowInsets methods when they are provided by the OS (a tested golden path), and otherwise use the previously working heuristics on anything older.

Changelog:
[Android][Fixed] - Do not use WindowInsetsCompat for Keyboard Events

Reviewed By: christophpurrer

Differential Revision: D42604176

fbshipit-source-id: da6a0bbc34c36f8e6d4e4ac07bc96da048fd6aa8
2023-01-19 06:43:27 -08:00
Nick Gerleman 26580a3022 Remove legacy layout diffing
Summary:
This removes some unused flags which will cause Yoga to layout every tree twice, then diffing the tree, reporting whether the whole tree is different. This is too expensive to run outside of local experimentation, but we have more nuanced ways to implement the `YGNodeLayoutAffectedByQuirk` I am wanting to add.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D42406917

fbshipit-source-id: b415ed02768f6b59de3a6fa90c60c750d56fd4b0
2023-01-19 06:38:45 -08:00
Dimitar Nestorov e162b07982 Add `accessibilityLabelledBy` TypeScript type (#35883)
Summary:
`accessibilityLabelledBy` is missing from `AccessibilityPropsAndroid` TypeScript interface

## Changelog

[GENERAL] [FIXED] - Added missing `accessibilityLabelledBy` TypeScript type

<!-- 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/35883

Test Plan: Ran `yarn test-typescript` and `yarn test-typescript-offline` and there were no errors.

Reviewed By: christophpurrer

Differential Revision: D42604287

Pulled By: NickGerleman

fbshipit-source-id: 476d24d1c0257be787b7e84c2c11bcadc3527979
2023-01-19 05:57:51 -08:00
Janic Duplessis c289442848 Fix TurboModuleRegistry TS type (#35885)
Summary:
TurboModuleRegistry export functions and not a TurboModuleRegistry object. See https://github.com/facebook/react-native/blob/main/Libraries/TurboModule/TurboModuleRegistry.js#L37

## Changelog

[GENERAL] [FIXED] - Fix TurboModuleRegistry TS type

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

Test Plan:
Tested that the import doesn't generate a type error when used correctly.

```ts
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';

export default TurboModuleRegistry.get<Spec>('RNCSafeAreaContext');
```

Reviewed By: christophpurrer

Differential Revision: D42604208

Pulled By: NickGerleman

fbshipit-source-id: e6259df24aaf6e37b32cc4b51947294fd655837e
2023-01-19 05:56:51 -08:00
Dimitar Nestorov 71c4f57baf Add `accessibilityLanguage` type (#35882)
Summary:
`accessibilityLanguage` is missing from `AccessibilityPropsIOS` TypeScript interface

## Changelog

[GENERAL] [FIXED] - Added missing `accessibilityLanguage` TypeScript type

<!-- 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/35882

Test Plan: Ran `yarn test-typescript` and `yarn test-typescript-offline` and there were no errors.

Reviewed By: christophpurrer

Differential Revision: D42604363

Pulled By: NickGerleman

fbshipit-source-id: fb8dd4b5bba78a080473a9dc7b49a07587530229
2023-01-19 05:52:57 -08:00
Nick Gerleman 1fef376812 Fix invariant violation when nesting VirtualizedList inside ListEmptyComponent (#35875)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35875

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

Nested VirtualizedLists register to their parents for updates, associated to a specfific cellKey set by VirtualizedListCellContextProvider. This cellKey is usually set when rendering a cell for a data item, but we can also render a nested VirtualizedList by putting one in a ListHeaderComponent/ListFooterComponent/ListEmptyComponent.

D6603342 (a010a0cebd) added cellKeys when we render from a header/footer, but not ListEmptyComponent, so that association would silently fail earlier.

D39466677 (010da67bef) added extra invariants to child list handling, that are now triggered by this case, complaining because we are trying to unregister a child list we never successfully registered, due to a missing cellKey.

This fixes the issue by providing a cellKey for ListEmptyComponent as well.

Changelog:
[General][Fixed] - Fix invariant violation when nesting VirtualizedList inside ListEmptyComponent

Reviewed By: christophpurrer

Differential Revision: D42574462

fbshipit-source-id: f76fa795bf471cb8a929c2efdbd814ea51927663
2023-01-19 05:13:50 -08:00
Elias Nahum 4cdc2c48e8 fix: ReactRootView checkForKeyboardEvents to check if rootInsets are set (#35869)
Summary:
react-native-navigation allows to register React components to be included in the navigation top bar as buttons, the way this work is by using the AppRegistry. When the ViewTreeObserver executes the `CustomGlobalLayout` we are checking for the RootWindowInsets in the `checkKeyboardEvents` which in the case for the top bar component it returns null and the **WindowInsetsCompat.toWindowInsetsCompat** function throws if the insets are null causing the app to crash.

Interestingly in the function `checkForKeyboardEventsLegacy` the null value is being checked, so I guess it was overlooked in the newer function.

## Changelog

[ANDROID] [FIXED] - Fix ReactRootView crash when root view window insets are null

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

Test Plan:
The following videos show how the app crashes as soon as we attempt to pop a screen that contains a react component as a button in the navigation top bar and how it correctly pops to the previous screen after applying the fix

| Crash | Fix |
| -- | -- |
| https://user-images.githubusercontent.com/6757047/213116971-fe693989-f978-438c-b8f9-fc56f2a477c8.mp4 | https://user-images.githubusercontent.com/6757047/213118352-fe258f28-07aa-4d17-98d2-97136464ffd5.mp4 |

Reviewed By: cipolleschi

Differential Revision: D42580156

Pulled By: cortinico

fbshipit-source-id: 4dbd656d7c8148df67668a2a50913206bc35c07f
2023-01-19 03:47:58 -08:00
Vincent Riemer 0c150b2289 Add explicit support for Apple Pencil hovering
Summary:
Changelog: [IOS][ADDED] - Add explicit support for M2 iPad Apple Pencil hovering in the Pointer Events implementation

I personally am not a huge fan of how this has to be implemented but it's literally the way Apple suggests to differentiate between mouse and pen hover events.

Reviewed By: lunaleaps

Differential Revision: D40962916

fbshipit-source-id: a6fb5bcfe19bcf500021922baac3fa7c4375a874
2023-01-18 13:43:21 -08:00
Moti Zilberman 05ff52b656 Update Jest type definitions to v29
Summary:
@public

Changelog: [Internal]

TSIA

Reviewed By: jacdebug

Differential Revision: D42570767

fbshipit-source-id: 26deffc1a749ed9403a71dcef64db02d0bf652e8
2023-01-18 10:52:29 -08:00
Nicola Corti 477f546d1b Bump CMake to 3.22.1 to properly honor CMAKE_BUILD_TYPE (#35857)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35857

It seems like there is an incompatibility between NDK 23 (shipped in 0.71)
and the usage of custom `CMAKE_BUILD_TYPE` we do for Hermes.

Specifically the `-DCMAKE_BUILD_TYPE=Release` we specify for the debug
variant of Hermes is partially ignored by the new Android native build toolchain.
See https://github.com/android/ndk/issues/463 for mentions on how the
toolchains requires CMake 3.20+

As AGP 7.3 defaults to use CMake 3.18 unless specified, and NDK 23 unless specified.
AGP 7.4 defaults to use CMake 3.22 unless specified, and NDK 23 unless specified.
See: https://developer.android.com/studio/releases/gradle-plugin#7-4-0

Here I'm:
1. Bumping the docker image to an image that contains the CMake 3.22
2. Updating the logic for building `react-native` & `hermes-engine` to use 3.22
3. Provide fallbacks if the user specified `CMAKE_VERSION`

Template tests will run on AGP 7.3 and will still use CMake 3.18, but I forecast
no problem there as the user is not supposed to specify custom `CMAKE_BUILD_TYPE`.
This is only a problem as we build `hermes-engine` with custom build types.

Changelog:
[Android] [Fixed] - Bump CMake to 3.22.1 to properly honor CMAKE_BUILD_TYPE

Reviewed By: cipolleschi

Differential Revision: D42544864

fbshipit-source-id: efd0f51120370fb808337c201df31d71f4ddfdbc
2023-01-18 09:49:27 -08:00
Lorenzo Sciandra f238f15317 fix(scripts): add logic for version scripts to account for local E2E test versioning (#35846)
Summary:
While working on 0.71 branch I encountered a problem in testing locally. Basically, I was getting hit by a silent error caused by recent work https://github.com/facebook/react-native/pull/35296 that didn't account for the shape of E2E local script for the release, `0.71.0-20230116-1649`.

This scripts fixes both aspects: the error now gets thrown "better" and the logic accounts for the E2E shape.

## Changelog

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

[INTERNAL] [FIXED] - add logic for version scripts to account for local E2E test versioning

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

Test Plan: Tested via the other PR: https://github.com/facebook/react-native/pull/35847

Reviewed By: cortinico

Differential Revision: D42543200

Pulled By: cipolleschi

fbshipit-source-id: 727eb887fcbd183ec56d8a9b7e98241eaacb1d98
2023-01-18 08:27:11 -08:00
Andrey Lunyov 58a6cf840a remove unused type imports 1/1
Summary:
Cleans up unused type imports from the codebase.

  ./scripts/typedjs/flow/runner --config /data/sandcastle/boxes/www/scripts/typedjs/flow/runner.config.xplat.js codemod local/removeUnusedTypeImports /data/sandcastle/boxes/fbsource/xplat/js

drop-conflicts
bypass-lint
bypass_size_limit

Reviewed By: GijsWeterings

Differential Revision: D42556504

fbshipit-source-id: 05885edccb686390f29f69c2f2049bf650a1b8c5
2023-01-18 08:21:49 -08:00
Nicola Corti 60b9d8c2b9 Fix for resources not correctly bundlded on release appbundles (#35872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35872

When downgrading from AGP 7.4 to 7.3 we were forced to resort to older APIs
to bundle resources. It seems like we haven't properly wired the task to make sure
resources generated by Metro are correctly accounted before the generation of
release app bundles/apks.

This fixes it. This fix can also be removed once we are on AGP 7.4
Fixes #35865

Changelog:
[Android] [Fixed] - Fix for resources not correctly bundlded on release appbundles

Reviewed By: cipolleschi

Differential Revision: D42573450

fbshipit-source-id: a810924315f72e02e4c988ae86112bf0a06a9ce5
2023-01-18 07:12:38 -08:00
Nicola Corti 470f79b617 RNGP - Honor the --active-arch-only when configuring the NDK (#35860)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35860

I've just realized that the `--active-arch-only` is not correctly passed down
to RNGP to set up an abiFilter so users on 0.71 on New Architecture end up
building all the architectures even if `--active-arch-only` is set.

This fix makes sure the `abiFilters` is applied if the user specified
either the `--active-arch-only`, the `reactNativeArchitectures` property
and is not using the Split ABI feature.

Changelog:
[Android] [Fixed] - RNGP - Honor the --active-arch-only when configuring the NDK

Reviewed By: cipolleschi

Differential Revision: D42547987

fbshipit-source-id: 5a34e7087bb4f89de74cc52f9c505e36896fbf03
2023-01-18 07:10:49 -08:00
Nick Gerleman 235887aeaa Remove unneeded deps from OSS Yoga Buck Build (#35851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35851

Yoga moved away from fbjni, to use vanilla JNI. This removes fbjni, and proguard annotations (see last stack) as Yoga dependencies from the OSS RN Buck build.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D42538671

fbshipit-source-id: c940d370d9d34bdb905c5dc9331e0bd57b5d49db
2023-01-18 06:52:46 -08:00
Jean-Baptiste LARRIVIERE b314e6f147 feat: add initialProps property to RCTAppDelegate (#35848)
Summary:
Hi there,

While upgrading to 0.71 we realised the RCTAppDelegate doesn't offer a way to set custom `initProps` that would depend on `launchOptions`.

This PR adds an `initialProps` property to the RCTAppDelegate. This would let us set this property based on `launchOptions` in our implementation of `didFinishLaunchingWithOptions` before calling `[super didFinishLaunchingWithOptions]`

Thanks !

## Changelog

[IOS] [ADDED] - Add `initialProps` property to `RCTAppDelegate`

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

Reviewed By: rshest

Differential Revision: D42543027

Pulled By: cipolleschi

fbshipit-source-id: 55374914890445f8193c12a06a943b7796edb457
2023-01-18 06:42:39 -08:00
Adnan Bacic 473eb1dd87 Move jest config from package.json to dedicated jest.config.js file (#35856)
Summary:
According to: https://jestjs.io/docs/configuration

> It is recommended to define the configuration in a dedicated JavaScript, TypeScript or JSON file. The file will be discovered automatically, if it is named jest.config.js|ts|mjs|cjs|json.

react-native projects have the jest config in package.json, this change aims to follow jest recommendations and have a dedicated file for jest configs.

Originally suggested here: https://github.com/react-native-community/discussions-and-proposals/discussions/583

## 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
-->

[GENERAL] [CHANGED] - Moved jest config from package.json to dedicated jest.config.js file

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

Test Plan:
1. cd template
2. yarn
3. yarn test

The test should (still) pass

Reviewed By: christophpurrer

Differential Revision: D42544351

Pulled By: robhogan

fbshipit-source-id: e27d1dad2b52d757777c40a77d0639f381557c88
2023-01-18 02:00:19 -08:00
Sam Zhou f4072b1e00 Pre-suppress errors ahead of 0.197.0 release
Summary: Changelog: [internal]

Reviewed By: mroch

Differential Revision: D42558696

fbshipit-source-id: 3367fb1233c9630bd31b0ae9950f7b2f13438057
2023-01-17 22:24:49 -08:00
Blake Friedman 2430d1fcf3 ci: Fix wording on stale bot for Author Feedback
Summary:
Fix wording to make it clear that the issue / PR is marked stale because of inaction.
Changelog:
[Internal] - Fix wording that was meant to go in on D42531703 (474c0edafe)

Reviewed By: cortinico

Differential Revision: D42547980

fbshipit-source-id: 01e624ae66348d2528fa1f5bbbc2aacb24ddd865
2023-01-17 09:11:53 -08:00
Rob Walker 8ea1cba06a Remove iOS flag from scrollEventThrottle prop (#35840)
Summary:
The `scrollEventThrottle` prop is documented as only applying to iOS, but in [this commit](cf55fd587e) it was also implemented for Android, but the documentation was not updated.

## Changelog
[GENERAL] [CHANGED] - Removed iOS flag from `scrollEventThrottle` docs
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

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

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

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

Test Plan: I've not been able to find how to build the docs locally, so I don't have a screenshot of the changes :(

Reviewed By: cipolleschi

Differential Revision: D42530943

Pulled By: sammy-SC

fbshipit-source-id: 2948eca2621712ccd832f4f99f1aab0cbd4af2d0
2023-01-17 05:38:19 -08:00
Blake Friedman 474c0edafe ci: Add `unsupported-version` label action (#35849)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35849

Users will provide issues or examples that use unsupported versions of React Native. Provide label to track and ask them to update example / issue to currently mainted version.

Changelog:

[Internal] - Support 'unsupported version' tag comment

Reviewed By: cortinico

Differential Revision: D42531703

fbshipit-source-id: 5577943a329e17147269b9e5a5da2b2c16a6ae3e
2023-01-17 04:21:57 -08:00
Christoph Purrer 55af2fe74f Remove API_AVAILABLE(ios(10.0)) / API_AVAILABLE(ios(12.0)) (#35835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35835

The minimum iOS version for react-native-macOS is 12.4 at this time.
These checks can be removed.
See: https://github.com/microsoft/react-native-macos/issues/1605

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D42523417

fbshipit-source-id: 45e7c0b6f31710dd6fcace0eb624e52489599e09
2023-01-17 02:58:24 -08:00
Christoph Purrer e7dcad2ba1 Remove UIKit import from RCTDevLoadingView.h (#35843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35843

See: https://github.com/microsoft/react-native-macos/issues/1604

Changelog:
[iOS][Fixed]: Remove UIKit import from RCTDevLoadingView.h

Reviewed By: cipolleschi

Differential Revision: D42529787

fbshipit-source-id: 2a63574794a5c962a17b49fa46a146b1252a0445
2023-01-17 02:57:51 -08:00
Connor Tumbleson 732a02a3c8 build: remove deprecated File.exists() method from Hermes podspec. (#35853)
Summary:
Remove deprecated `File.exists` method which was removed in later Ruby versions. Spotted during a brew upgrade [here](https://github.com/software-mansion/react-native-reanimated/pull/3919).

https://rubyapi.org/2.5/o/file#method-c-exist-3F

```
Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`
[!] Failed to load 'hermes-engine' podspec:
[!] Invalid `hermes-engine.podspec` file: undefined method `exists?' for File:Class.
 #  from [..]/node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec:46
 ```

## Changelog

[IOS] [FIXED] - Migrated `File.exists` from Hermes podspec for non-deprecated `File.exist`.

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

Test Plan: Valid CI via CircleCI.

Reviewed By: dmytrorykun

Differential Revision: D42543148

Pulled By: cipolleschi

fbshipit-source-id: 5ed30d8cc3e4c91a6e86d51f7d44a125bf85f7e8
2023-01-17 02:56:29 -08:00
Nick Gerleman e6d1ab9266 Replace "facebook.proguard.annotations" with "facebook.yoga.annotations" (#35841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35841

X-link: https://github.com/facebook/litho/pull/928

X-link: https://github.com/facebook/yoga/pull/1216

The Yoga JNI bindings use Reflection, so we need to let ProGuard know not to strip certain annotated fields.

This is done internally using a single copy of `com.facebook.proguard.annotations` from fbandroid (sometimes), which is then repackaged externally, and published as its own whole Yoga specific package. We never actually inform the stock Gradle project of the rules for the annotations though, so apps must add these manually.

This simplifies the setup, where Yoga has its own self-contained annotations/rules. The rules are exposed for Gradle/Buck dependencies, but RN and Litho both consume Yoga via dirsync + custom Gradle logic, so we need to duplicate the proguard rules to them instead of them being propagated automatically.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D42406641

fbshipit-source-id: c2b12fd498f93f144e5651917ca878d2a5050e08
2023-01-16 11:25:59 -08:00
Nick Gerleman cb80f16d00 Add Global CMake Build and OSS Tests (#1217)
Summary:
X-link: https://github.com/facebook/yoga/pull/1217

This updates the CMake build present for being able to share options, fixing up flags, etc. A GTest build is added as well, along with a script and VSCode debug target so that OSS contributors can very easily run and debug tests on any OS.

Note that this isn't completely done (need to revise Windows, Mac, documentation), but should be finished enough otherwise for review.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D42406686

fbshipit-source-id: 95e7ba5e4751c496a171785490e85cf0097fa839
2023-01-16 07:56:11 -08:00
Mikhail Mikhaylov 8d2a62931f Fixes an error in the reactConsoleErrorHandler comment (#35830)
Summary:
Fixes an error in the `reactConsoleErrorHandler` comment

## Changelog
[GENERAL] [FIXED] - Fixed a typo in the `reactConsoleErrorHandler` comment
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

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

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

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

Test Plan: No tests needed

Reviewed By: cipolleschi

Differential Revision: D42529639

Pulled By: cortinico

fbshipit-source-id: 89a01838bae6c260f510a9bedcc48b157fcf859b
2023-01-16 04:23:22 -08:00
Adnan Bacic 3c03aef151 rename App-test.tsx to App.test.tsx (#35826)
Summary:
The starter test file when creating a `create-react-app` project is `App.test.js`, while in react-native its `App-test.js`_(recently changed to `.tsx` instead of `.js`)_

This aims to unify the naming convention between `create-react-app` and `react-native init`.

Originally suggested here: https://github.com/react-native-community/discussions-and-proposals/discussions/570

## 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
-->

[GENERAL] [CHANGED] - Renamed App-test.tsx to App.test.tsx to unify naming convention with create-react-app

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

Test Plan:
1. cd template
2. yarn
3. yarn test

The test inside `__tests__/App.test.tsx` should (still) pass

Reviewed By: cipolleschi

Differential Revision: D42527535

Pulled By: NickGerleman

fbshipit-source-id: 5247c5a65760973afe39a4b37abb5a6b52c1fadc
2023-01-16 03:03:53 -08:00
Ruslan Lesiutin 465e937533 internalize Slider module (#35825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35825

Changelog:
[iOS][Removed] - removed Slider module
[Android][Removed] - removed Slider module

Reviewed By: cortinico

Differential Revision: D42394124

fbshipit-source-id: 92ba3bc50d16996a597148fa2f8178e6bd6d8eb7
2023-01-16 02:42:18 -08:00
Oleksandr Melnykov b40beebd26 Upgrade Danger to 11.2.1 to mitigate jsonwebtoken security vulnerability
Summary:
Upgrades Danger to the latest available version to mitigate the jsonwebtoken security vulnerability.

Changelog:
[Internal] [Changed] - Upgrade Danger to 11.2.1 to mitigate jsonwebtoken security vulnerability

Reviewed By: cortinico

Differential Revision: D42505940

fbshipit-source-id: 740edc7316791e5afe894ecdd1e05e13d2ef1f2c
2023-01-13 12:27:51 -08:00
Wojciech Lewicki 97c7c6a4b6 fix: dispatch ContentSizeChange event on Fabric on iOS (#35816)
Summary:
On Fabric, `onContentSizeChange` of `TextInput` component was never fired on `iOS`, since the logic dispatching it was implemented in `RCTBaseTextInputShadowView` on Paper: 0f8dc067ac/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m (L105). This class is not used on Fabric, therefore the event was never dispatched. On Paper, it was dispatched in `dirtyLayout` method,  so I added dispatching of this event based on the change of content size in `layoutSubviews` method, since this method seems the closest one on Fabric. I am not sure if it is the best place for it though.

## Changelog

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

[IOS] [ADDED] - dispatch `onContentSizeChange` event on Fabric.

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

Test Plan:
Try to use `onContentSizeChange` callback in `TextInput` component:
```tsx
import React from 'react';
import {TextInput, SafeAreaView} from 'react-native';

const App = () => {
  return (
    <SafeAreaView style={{flex: 1, backgroundColor: 'red'}}>
      <TextInput
        multiline={true}
        placeholder="type here"
        onContentSizeChange={e => console.log(e)}
      />
    </SafeAreaView>
  );
};

export default App;

```

Reviewed By: christophpurrer

Differential Revision: D42499974

Pulled By: sammy-SC

fbshipit-source-id: 3e010ff096cf91cb3e7b87ed2753e9d0e7be9650
2023-01-13 09:34:03 -08:00
Zihan Chen (MSFT) 8befb740d6 Turbo module codegen support interface like alias in module (#35812)
Summary:
Turbo module codegen support interface like alias in module.

In typescript, interface allows inheritance, but the codegen schema doesn't have such information. In this PR the codegen schema is not changed, interfaces are flattened.

In the next change, I will update the codegen schema so that it allows inheritance, in order to generate more precise C++ code.

## Changelog

[GENERAL] [CHANGED] - Turbo module codegen support interface like alias in module

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

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

Reviewed By: cortinico

Differential Revision: D42475368

Pulled By: cipolleschi

fbshipit-source-id: 26025f8a55b600dfea27026c998cd8b5fe752af4
2023-01-12 08:04:40 -08:00
Riccardo Cipolleschi 0f8dc067ac Changelog for 0.71.0 (#35200)
Summary:
Adds changelog for new release.

## 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.0

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

Test Plan: N/A

Reviewed By: dmytrorykun

Differential Revision: D42477941

Pulled By: cipolleschi

fbshipit-source-id: be91742d8800051b9b167b66592b43e715b9a893
2023-01-12 07:39:56 -08:00
Riccardo Cipolleschi 4c5fa6e372 fix: use properly exclude parameter of matrix (#35794)
Summary:
Update the CircleCI configuration to use the proper `exclude` parameter of matrix rather then bootstrap a machine and then kill it.

## 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
-->
## Changelog
[Internal] - Use the `exclude` parameter of matrices to avoid spinning up unnecessary machines

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

Test Plan: The number of jobs on CircleCI should decrease.

Reviewed By: dmytrorykun

Differential Revision: D42475445

Pulled By: cipolleschi

fbshipit-source-id: 3d733ac459a3bc9747440a62cb2caecb7a235fec
2023-01-12 07:36:45 -08:00
MaeIg dc4d73c954 Extract the buildSchema function in the parsers-commons.js (#35158)
Summary:
This PR aims to extract  the buildSchema function into parsers-commons that is shared between typescript and flow. It is a task of https://github.com/facebook/react-native/issues/34872:
> Extract the buildSchema function ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/index.js#L66), [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/index.js#L72)) in the parsers-commons.js file to a top level buildSchema function which takes additional parameters to properly parse the content, get the config type and to build the schema, based on the language used.

## 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] - Extract the buildSchema function in the parsers-commons.js

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

Test Plan:
yarn test:
<img width="380" alt="image" src="https://user-images.githubusercontent.com/40902940/209584411-40f66047-e25d-43d4-975d-af10cd202f24.png">

yarn flow:
<img width="150" alt="image" src="https://user-images.githubusercontent.com/40902940/209584423-4cf2cb5a-a300-40a6-962c-e57934f19ad2.png">

yarn lint:
<img width="510" alt="image" src="https://user-images.githubusercontent.com/40902940/209584440-2d2b2658-73d8-47e2-bb8c-64d4633369a2.png">

Reviewed By: cortinico

Differential Revision: D42386804

Pulled By: cipolleschi

fbshipit-source-id: 2a238f7cec982d8ef3fd57a34dc9f58171e32b53
2023-01-12 04:23:42 -08:00
Ruslan Lesiutin 91397d4247 refactor(bump-all-updated-packages): support force-bump to next minor version of the package (#35810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35810

Changelog: [Internal]

`bump-all-updated-packages` script now supports `release-branch-cutoff` argument

If this argument is provided, the script will bump each public package to next minor version

Updated [wiki](https://github.com/facebook/react-native/wiki/Release-and-its-automated-processes) with relevant information about how to use it

Reviewed By: cortinico

Differential Revision: D42455329

fbshipit-source-id: a40d2f5dc356f22d3182da3a118c6383b634817d
2023-01-12 03:35:41 -08:00
David f47b5b8b5d Exclude `react-native-flipper` when `NO_FLIPPER=1` to prevent iOS build fail (#35686)
Summary:
- Flipper issue: https://github.com/facebook/flipper/issues/3995#issuecomment-1333863641

iOS build fail with an error:

```sh
node_modules/react-native-flipper/ios/FlipperReactNativeJavaScriptPlugin.h:9:9: 'FlipperKit/FlipperConnection.h' file not found

#import <FlipperKit/FlipperConnection.h>
```

## Changelog

[IOS] [FIXED] - Exclude `react-native-flipper` when `NO_FLIPPER=1` to prevent iOS build fail

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

Test Plan:
```sh
npx react-native init RN0710RC5 --version 0.71.0-rc.5
cd RN0710RC5
yarn add react-native-flipper
NO_FLIPPER=1 pod install --project-directory=ios
yarn ios # will fail
```

Reviewed By: rshest

Differential Revision: D42368444

Pulled By: cipolleschi

fbshipit-source-id: a8614ccadb98970ebae15d8743136fa60ead318c
2023-01-12 02:53:28 -08:00
Luna Wei ac54a5ba2b Remove SafeAreaView flow declaration
Summary: Changelog: [Internal] Remove flow declaration for SafeAreaView in preparation for TS generation

Reviewed By: christophpurrer

Differential Revision: D42349686

fbshipit-source-id: b792313b18f3804d8c68955afd918ec8cbb0b80f
2023-01-11 14:29:37 -08:00
Luna Wei da415398bd Remove AccessibilityInfo.flow
Summary: Changelog: [Internal] Remove flow declaration in preparation for TS generation

Reviewed By: christophpurrer

Differential Revision: D42350837

fbshipit-source-id: 05e80226931cdea04e7f14ddf2876297ab31ada7
2023-01-11 14:29:37 -08:00
Luna Wei 69716ad9ff Make PanResponder an ES Module
Summary: Changelog: [General][Changed] ESM PanResponder

Reviewed By: christophpurrer

Differential Revision: D42272981

fbshipit-source-id: 1191e8f3425aed024b77365da1ad42f44099e94a
2023-01-11 14:29:37 -08:00
Nicola Corti 573734f4e6 Remove PAT_TOKEN and PAT_USERNAME from CircleCI (#35808)
Summary:
This is a cleanup change needed after the CircleCI security incident.
We should be using the `Authorization: Bearer` header to trigger `rn-diff-purge` instead of using username & password authentication.

Source: https://docs.github.com/rest/reference/repos#create-a-repository-dispatch-event

## Changelog

[INTERNAL] - Remove PAT_TOKEN and PAT_USERNAME from CircleCI

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

Test Plan:
I've tested this locally with:

```
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
                    -H "Accept: application/vnd.github.v3+json" \
                    -H "Authorization: Bearer [...]" \
                    -d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"test.test.test\" }}"
```

and the run was succesfully fired by react-native-bot:
https://github.com/react-native-community/rn-diff-purge/actions/runs/3894079133

Reviewed By: lunaleaps

Differential Revision: D42456065

Pulled By: cortinico

fbshipit-source-id: 475e9ca80760522cc08bad37d85c5af6727922d3
2023-01-11 10:58:25 -08:00