Commit Graph

25447 Commits

Author SHA1 Message Date
David Vacca 85e9b073cb Move react/fabric/components -> react/cxxcomponents
Summary:
This diff moves Component and ComponentManager classes -> react/cxxcomponents. The purpose is to be able to use these classes from any platform, not only Android

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D39531533

fbshipit-source-id: 4732aa7bf59d82dae11441212975f0e225c6d458
2022-09-16 12:33:15 -07:00
Luna Wei c9966e417d Alert
Summary: Changelog: [Internal] Add flow declaration for Alert. Couldn't figure out how to do type statics on interfaces in Flow.

Reviewed By: yungsters

Differential Revision: D39186533

fbshipit-source-id: 928ee76080490a133c9773d2330473a688e0612d
2022-09-16 11:46:00 -07:00
Adrian Hartanto 2aba3522ab fix: adjust clipboard mock (#34672)
Summary:
Currently, Clipboard's methods (setString, getString) can't be asserted when writing tests as the mock targeted `Libraries/BatchedBridge/NativeModules` instead of `Libraries/Components/Clipboard/Clipboard` that's used on react-native [entry point](https://github.com/facebook/react-native/blob/main/index.js#L270) so it won't be considered as `mock function`.

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

[General] [Changed] - Update `Clipboard` mock path

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

Test Plan:
```js
// App-test.js

import { Clipboard } from 'react-native';
import React from 'react';

it('renders correctly', () => {
  Clipboard.setString('string');
  expect(Clipboard.setString).toBeCalled();
});
```

### before

<img width="473" alt="Screen Shot 2022-09-13 at 16 24 30" src="https://user-images.githubusercontent.com/5382429/189864957-6b926478-6781-4291-a1eb-4493779de1a2.png" />

### after

<img width="598" alt="Screen Shot 2022-09-13 at 16 26 34" src="https://user-images.githubusercontent.com/5382429/189865131-e7c39f97-1cc1-4eb9-b4c0-d9ddf7a05c9c.png" />

Reviewed By: yungsters

Differential Revision: D39575916

Pulled By: cortinico

fbshipit-source-id: 34a3f93986a18d349ac033bb13a10ed77689935c
2022-09-16 08:54:05 -07:00
Tim Yung 527ac2f2c5 JS: Upgrade to yargs@^17.5.1
Summary:
Upgrades all of our JavaScript tooling to use `yargs@^17.5.1`.

Of all [release notes](https://github.com/yargs/yargs/releases), these are the major version notes:

- [v17.0.0](https://github.com/yargs/yargs/releases/tag/v17.0.0)
- [v16.0.0](https://github.com/yargs/yargs/releases/tag/v16.0.0)

A cursory inspection suggests that these breaking changes are unlikely to seriously impact our use cases (or can be fixed forward).

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D39550338

fbshipit-source-id: 5b2c5265f8c7a95ab0cc9bab62873f9e4355f32f
2022-09-16 08:25:34 -07:00
Tommy Nguyen 49c90f7a7e @react-native/tester should be private (#34570)
Summary:
Made `react-native/tester` private.

## Changelog

[Internal] [Fixed] - Made `react-native/tester` private

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

Test Plan: n/a

Reviewed By: lunaleaps

Differential Revision: D39235797

Pulled By: cortinico

fbshipit-source-id: d5dee20f1ddfc198b3a776464a91de470ce824f6
2022-09-16 03:46:03 -07:00
Vincenzo Vitale 0a3ca80af4 Build the React Native NPM package when git is not available (#34694)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34694

TL;DR Relax the assumption of having git to build the RN NPM package.

We do have two CI Systems: CircleCI for OpenSource and Sandcastle for Internal. It's crucial that the two CIs are aligned.

We currently don't have a way to test the new app template on Sandcastle for Android & iOS.
This results in scenarios where internal Diffs gets landed and break the public CI externally.

This is preparation work to then be able to build the RN NPM package in Sandcastle (which will be done in a follow-up diff).

With this we also introduce the restoring of all the changed files after the publishing script is done.

## Changelog

[Internal] [Added] - Made it possible to create publishing NPM packages in Sandcastle.

Reviewed By: cortinico, cipolleschi

Differential Revision: D39467471

fbshipit-source-id: b0de88a768b8a2fb798dd684fa8f97f4d0acb751
2022-09-16 02:58:36 -07:00
Luna Wei 1cdeb20d54 TextInput
Summary: Changelog: [Internal] Add a flow type for TextInput

Reviewed By: yungsters

Differential Revision: D38883693

fbshipit-source-id: 798c1cfac55479420e683bd79d685a46c866c5d1
2022-09-15 17:06:17 -07:00
Dmitry Rykun 2f94476c01 Add changelog for 0.70.1 (#34702)
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.70.1

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

Test Plan: N/A

Reviewed By: lunaleaps

Differential Revision: D39550336

Pulled By: dmytrorykun

fbshipit-source-id: 4e6ff93fb419bf08b4c5b1f88312591d79bd3e29
2022-09-15 15:59:58 -07:00
Rujin Cao b2ac528156 @emails -> @oncall (remaining ones)
Differential Revision: D39536169

fbshipit-source-id: 6c8d6787328eefecd23f3498b14a6d9ff750a670
2022-09-15 15:54:10 -07:00
Marshall Roch a8ece43a50 upgrade to flow 0.187.0
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D39542847

fbshipit-source-id: 2eeb8740dd0a142b7e411fbee4765a8f38685c76
2022-09-15 12:24:13 -07:00
Pieter Vanderwerff 03cb5aca3f Improve sample app
Summary: Improve RN sample application code quality.

Reviewed By: mroch

Differential Revision: D39488055

fbshipit-source-id: f6056c0790d6fee473a57b9d29a0ce21841f63c1
2022-09-15 11:03:03 -07:00
David Vacca 399907fe4a Create Feature Flag to Enable/Disable C++ Render System in JS
Summary:
This diff creates a new Feature Flag to Enable/Disable C++ Render System in JS

Changelog: [Internal] Internal

Reviewed By: sammy-SC

Differential Revision: D38725771

fbshipit-source-id: 3a238781bec427274dbd8f7c045d360135d1803e
2022-09-15 09:48:25 -07:00
David Vacca 5fb0ad0a48 Integrate execution of C++ ViewManagers in React Native Android renderer
Summary:
Execution of C++ ViewManagers in RN Android renderer

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D38725770

fbshipit-source-id: cd18e02940c4cb2559acdaf535e60f98b4cada13
2022-09-15 09:48:25 -07:00
David Vacca 0519dfeeaf Register C++ ViewManagers in React Native Renderer
Summary:
This diff integrates the registration of C++ component into React Native Android

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D38725769

fbshipit-source-id: 33eb9ebb93983c4038529748758eac3e43eec3e5
2022-09-15 09:48:25 -07:00
David Vacca a2d2a1df90 Introducing CPP View MutationWrapper
Summary:
CppViewMutationWrapper is a class that will be used to execute operations to mutate C++ Components in React Native Android

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D38725765

fbshipit-source-id: 3dfe11deb873750a78f6dbbaee82b62134908de4
2022-09-15 09:48:25 -07:00
David Vacca 53d2f1891e Introducing Registry for C++ Components in React Native renderer
Summary:
This diff introduces the APIs that will be used to register C++ components in React Native Renderer for Android

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D38725768

fbshipit-source-id: a7116b787f83544282230666d9d5acbfb1df4047
2022-09-15 09:48:25 -07:00
David Vacca c74f91957e Integrate C++ view managers into RN OSS build system
Summary:
Customize gradle/buck to be able to build fabric C++ components files

changelog: [internal] internal

Reviewed By: cortinico, sammy-SC

Differential Revision: D39448416

fbshipit-source-id: 3beddf27082728e2316e483c2541c7405e4c57f7
2022-09-15 09:48:25 -07:00
Alex a5cf3a46ab GitHub Workflows security hardening (#34541)
Summary:
Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>

This PR adds explicit [permissions section](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions) to workflows. This is a security best practice because by default workflows run with [extended set of permissions](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) (except from `on: pull_request` [from external forks](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an [injection](https://securitylab.github.com/research/github-actions-untrusted-input/) or compromised third party tool or action) is restricted.
It is recommended to have [most strict permissions on the top level](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions) and grant write permissions on [job level](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) case by case.

## 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] [Added] - Explicit security permission definitions in autorebase workflow

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

Reviewed By: cipolleschi

Differential Revision: D39544656

Pulled By: cortinico

fbshipit-source-id: 4918ee83fab7172a1d98689f10102fe2db2b17b7
2022-09-15 09:31:41 -07:00
Rob Hogan ff20062174 Update Jest to 27.5.1
Summary:
Update our internal tests to use Jest 27. If this sticks, we should follow up with updating the RN template.

Changelog:
[Internal][Fixed] Update Jest setup to v27.5.1

Reviewed By: motiz88

Differential Revision: D39383717

fbshipit-source-id: 0fbb5a7b1ab70ccbfaed22b2de92f445f756afe0
2022-09-15 07:37:40 -07:00
Nicola Corti 4ba9d0ecb1 Make the Android unitTests compile (#34690)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34690

While working on another part of the codebase I realized that
our Unit Tests are not compiling due to references to missing classes.
I'm cleaning them up + hooking the compileTest task inside the
`buildAll` task so at least they will be compiled on both CIs.

Changelog:
[Internal] [Changed] - Make the Android unitTests compile

Reviewed By: cipolleschi

Differential Revision: D39501945

fbshipit-source-id: 03d3e4872d6c738b8b85d1fef9302ac230e857d2
2022-09-15 07:00:43 -07:00
Sunbreak d0df6afe76 Remove Android.mk from internal Gradle task (#34687)
Summary:
`Android.mk`s are no longer used for internal Gradle tasks since [First Round of CMake files for React Android](https://github.com/facebook/react-native/commit/b676ca560d8af686276ac4b88e4feb9c5b7e468d) and [CMake setup for ReactAndroid](https://github.com/facebook/react-native/commit/e3830ddffd9260fe071e0c9f9df40b379d54cf26)

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

[General] [Fixed] - Remove Android.mk from internal Gradle task

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

Test Plan: None

Reviewed By: cipolleschi

Differential Revision: D39541322

Pulled By: cortinico

fbshipit-source-id: 421591effab2c1a82bcacff656360a2d02439a53
2022-09-15 06:32:49 -07:00
Christoph Purrer 9cb716ff76 Add additional Systrace support
Summary:
Adding support for application to hook into further tracing methods

## Changelog

[General][Added] - Add additional Systrace support

Reviewed By: NickGerleman

Differential Revision: D38673212

fbshipit-source-id: 55a90a0cd57809bca5f01da7acddcf253e5852ba
2022-09-14 16:29:20 -07:00
Paige Sun 447be62909 Fix: Install Fabric UIManager before main bundle execution
Summary:
Changelog: [Internal] Fix install Fabric UIManager before main bundle execution in Bridgeless

In iOS, fixed Bridgeless so that [UIManagerBinding::createAndInstallIfNeeded](https://github.com/facebook/react-native/blob/ce50c43986bae05ad62552be46f4d5bb4a46f097/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp#L24-L41) happens BEFORE the JS main bundle is evaluated.

Logic is unchanged in Android.

# Before
```
> UI [FBReactModule.mm:325] Initializing FBReactModule: start.
> UI [FBReactModule.mm:524] Initializing FBReactModule: end.
> UI [FBReactModule.mm:1839] Initializing RCTHost: start.
> UI [FBReactModule.mm:1891] Initializing RCTHost: end.
> UI[-[FBNavigationControllerObserver navigationController:willShowViewController:animated:]] <FBNewNavigationController: 0x7fd0e7859400> will show <FBReactRootViewController: 0x7fd0e7161a00; react_GemstoneHomeRoute> (animated: 1)
>   VJCPP ****** ReactInstance loadScript ->  evaluateJavaScript start      <--- loads Main Bundle
> UI[-[FBNavigationControllerObserver navigationController:didShowViewController:animated:]] <FBNewNavigationController: 0x7fd0e7859400> did show <FBReactRootViewController: 0x7fd0e7161a00; react_GemstoneHomeRoute> (animated: 1)
>   VJCPP ****** ReactInstance loadScript ->  evaluateJavaScript end
>   VJCPP ****** UIManagerBinding createAndInstallIfNeeded      <--- should happen BEFORE evaluateJavaScript

```

Reviewed By: RSNara

Differential Revision: D39493654

fbshipit-source-id: 4491d6de110966b2eb4f554ff4db8548899020e3
2022-09-14 14:51:27 -07:00
Paige Sun e2028a8cb8 Remove unused RuntimeExecutor from UIManagerBinding constructor
Summary:
Changelog: [Internal] Remove unused RuntimeExecutor from UIManagerBinding constructor

Since [UIManager is the class that has a reference to RuntimeExecutor](https://github.com/facebook/react-native/blob/ce50c43986bae05ad62552be46f4d5bb4a46f097/ReactCommon/react/renderer/uimanager/UIManager.h#L35-L36), there's no reason for `UIManagerBinding` to own a reference to RuntimeExecutor too.

The purpose of `UIManagerBinding` is to bind the Fabric `std::shared_ptr<UIManager>` in C++ to `global.nativeFabricUIManager` in JS.

Doing this cleanup to make the next diff easier.

Reviewed By: sammy-SC

Differential Revision: D39490927

fbshipit-source-id: 4c393dccc6985bef44e3b0afc32b9f79bea25f80
2022-09-14 14:51:27 -07:00
Pieter De Baets f44469076d Remove unused Hermes inspector auto-attach logic
Summary:
We already support attaching-on-reload when a debugger was a previously connected, and this connection logic seems to slow down app startup by 2 seconds in debug mode when running on device.

Changelog:
[Internal][Removed]

Reviewed By: jpporto

Differential Revision: D39272704

fbshipit-source-id: deb8651798cb9a13b81e1703920d3f9bd58869d2
2022-09-14 14:49:47 -07:00
Samuel Susla 5c0536db12 Register "RawText" component in BUCK file
Summary: changelog: [internal]

Reviewed By: javache

Differential Revision: D39502987

fbshipit-source-id: 238ca8fbf5f589086d612ded49f0842e7d0a6742
2022-09-14 10:48:01 -07:00
Riccardo Cipolleschi ea1ec29ba6 Revert part of D39268920
Summary:
This task has been created T131775291 that blames D39268920 (https://github.com/facebook/react-native/commit/f1c1f8116ba1cfa9d10c5b8c30b98b796047b9c2). I reverted part of the changes and added the support of capital letters for the font weight. It should make the test pass.

However, I am a bit puzzled: I tried to change the title of the `GemstoneTitleBar` and the test was not showing the changed value. I think I'm missing something.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D39478951

fbshipit-source-id: d3e28336fe52c5c58b49872c3f5b6e63e1e37ca5
2022-09-14 07:21:04 -07:00
Nick Gerleman a6bc77cd94 Remove dead code for restoring state to nested VirtualizedList
Summary:
When `getItemLayout` is not supplied, VirtualizedList doesn't know the measurements for its child items ahead of time. It caches most recent cell measurements so that an item which is virtualized away is associated with its correct height. VirtualizedList will not consume space for an item it has not yet rendered/knows measurements for.

This also means an initially created list will only take up the height of its `initialNumToRender()`. This can cause scroll jumping for the scenario of nested VirtualizedLists of the same orientation, since a virtualized away child list will shrink (compared to the spacer), then re-expand, once returned to.

There is logic in the VirtualizedList constructor to load cached frame metrics based on supplied listKey, to enable reloading most recent state. Though locally it seems to be reading the context too early in the lifecycle (compared to other successful checks during componentDidMount, render). It was moved from `componentDidMount` to `constructor` as part of the initial change (https://www.internalfb.com/diff/D6330846 (https://github.com/facebook/react-native/commit/2668dc8e1be7bf93e65ca2e11c87cbeef3310c3e)?dst_version_fbid=131968984136932&transaction_fbid=1578362385612542), and I think has likely been unreliable or dead since.

Restoring state was the only usage of a durable key for nested lists beyond their lifetime. So removing the dead code lets us remove the need for a `listKey`, which has been error-prone. This still leaves the problem present since inception, but there may be alternate solutions like scroll anchoring.

Changelog:
[Internal][Removed] - Remove dead code for restoring state to nested VirtualizedList

Reviewed By: ryancat

Differential Revision: D39466678

fbshipit-source-id: fc2f39802e5cdf9b920974333be64c74211b99a9
2022-09-14 07:05:08 -07:00
Gabriel Donadel Dall'Agnol 09d420707f feat: Add space-separated string support for fontVariant (#34641)
Summary:
This updates `fontVariant` to support space-separated string values, i.e., `'small-caps common-ligatures'`, thus aligning it with the [CSS Fonts Module Level 4](https://drafts.csswg.org/css-fonts/#font-variant-prop) specification as requested on https://github.com/facebook/react-native/issues/34425. This also adds unit tests to the `processFontVariant` function ensuring the style processing works as expected.

## Changelog

[General] [Added] - Add space-separated string support for fontVariant

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

Test Plan:
This can be tested either through `processFontVariant-tests` or by using the following code:

```js
 <Text
   style={{
     fontVariant: 'small-caps common-ligatures',
  }} />
```

Reviewed By: javache

Differential Revision: D39423317

Pulled By: cipolleschi

fbshipit-source-id: ad971addb423ed338e178528a11fe9d456c03e6e
2022-09-14 05:08:10 -07:00
Riccardo Cipolleschi 34fafb2b88 Simplify furthermore App migration
Summary:
This Diff adds a couple of APIs to the `react_native_pods.rb` file to simplify further the migration to the New Architecture for the iOS app.
Specifically, it aims to simplify [this](https://reactnative.dev/docs/next/new-architecture-app-intro#ios---build-the-project) steps by offering a RN-managed min version and creating the .xcode.env file for the user if it is missing.

## Changelog

[iOS][Added] - Add new API to simplify app migration

Reviewed By: cortinico

Differential Revision: D39469599

fbshipit-source-id: f0323e86c83c2731671fcd5bb4288071304bb43b
2022-09-14 04:21:02 -07:00
Riccardo Cipolleschi f31134af7d Set RCT_NEW_ARCH_ENABLED to true when using cocoapod flag (#34670)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34670

Users can enable the New Architecture on iOS in two way: using the `RCT_NEW_ACRH_ENABLED` env variable or setting the `new_arch_enabled` flag when invoking the `use_react_native` function.

We need to set the `RCT_NEW_ACRH_ENABLED` even when the other method is used because we need to inject that flag into the codebase.

## Changelog
[iOS][Fixed] Make sure to turn on the `RCT_NEW_ACRH_ENABLED` flag

Reviewed By: cortinico

Differential Revision: D39430904

fbshipit-source-id: abb55642b4c72d7dec8b045fb4a43c1763f0ee0f
2022-09-14 04:21:02 -07:00
Nick Gerleman be620298cd Add Nested FlatList RNTester Example
Summary:
This adds an example FlatList with nested children of both orientations. Debug text is shown for what is detected to be visible, and what is currently being rendered.

Changelog:
[Internal][Added] - Add Nested FlatList RNTester Example

Reviewed By: rshest

Differential Revision: D39466679

fbshipit-source-id: 5d6ce4adb9a862ca96b1a7b268b70101207d2980
2022-09-14 04:09:52 -07:00
Nicola Corti aba82a503d Update the OnLoad.cpp to use the facebook::react namespace
Summary:
Small follow up to my template update. Using the namespace in the OnLoad.cpp
should prevent name clashing and make it easier to read.

Changelog:
[Android] [Changed] - Update the OnLoad.cpp to use the facebook::react namespace

Reviewed By: cipolleschi

Differential Revision: D39475773

fbshipit-source-id: 9c0748d37858196d4e8ea6674d9cfd6ef4eff1cd
2022-09-14 04:06:53 -07:00
Joshua Selbo 59dc7f1b20 Remove support for is_androidx arg for robolectric tests (#34682)
Summary:
## Changelog

[Android] [Changed] - Remove internal buck rule arg for robolectric tests

Reviewed By: xiphirx

Differential Revision: D39452733

fbshipit-source-id: 2ef2ea6a30e99df11a6f0b65c61af841f396f7d7
2022-09-13 16:56:37 -07:00
Luna Wei e8a778d494 Add buttons
Summary: Changelog: [Internal] Add support for buttons/button property according to W3C PointerEvent spec

Reviewed By: vincentriemer

Differential Revision: D39460411

fbshipit-source-id: 3544a9b00e870a6028e37417ca9e4de5af62ef70
2022-09-13 16:11:35 -07:00
David Vacca 57b6bce58b Fix RN OSS CI
Summary:
Fix RN OSS CI

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D39474507

fbshipit-source-id: 7327fb0b078c21cecfc7a48166fbd944cdd725b7
2022-09-13 11:26:49 -07:00
David Vacca 4d74b4ae61 Remove ReactFeatureFlags.enableSpannableCache
Summary:
This diff removes the feature flag ReactFeatureFlags.enableSpannableCache and it's already disabled MC

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D39449840

fbshipit-source-id: 69a514b611c1179f2160a1bfd4c4199538738448
2022-09-13 09:48:57 -07:00
David Vacca 6f92a05c10 Remove ReactFeatureFlags.enableScrollEventThrottle
Summary:
Remove feature flag: ReactFeatureFlags.enableScrollEventThrottle

This feature has been disabled for a while

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D39449184

fbshipit-source-id: c5ad0d43462422d284e14302fb9d7b39aa37da70
2022-09-13 09:48:57 -07:00
Matt Blagden 4a0aa8f7c7 Simplify runtime type in Inspector Connection
Summary:
A previous change made the RuntimeAdapter contain a HermesRuntime (as opposed to an arbitrary JSI Runtime).

Now that it's known to be a HermesRuntime, expose that type information to the Inspector, so a runtime type check can be skipped (which is failing in some builds, despite the concrete type being what's expected).

Changelog: [internal]

Reviewed By: neildhar

Differential Revision: D39429109

fbshipit-source-id: ad5ae0604ac208da2002fd37e38d24319b45aebd
2022-09-13 08:43:43 -07:00
Alex Smeshkov 71c0d2e369 Add accessibilityContext to CKOverlayLayoutComponent
Summary: Changelog: [Internal]

Reviewed By: Andrey-Mishanin

Differential Revision: D38906662

fbshipit-source-id: f0501f48df6a9debebd9211d388c6c89d29d149d
2022-09-13 07:08:01 -07:00
Nicola Corti 59ae0487ce Further simplify the New App Template by don't requiring the dynamic library name (#34671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34671

I'm simplifying the template further by:
- Do not expose a configurable dynamic library name. Let's use `appmodules`
and still allow the users to configure it, if needed.
- Move all the initialization logic inside the `JNI_OnLoad` method
- Cleanup the `DefaultReactNativeHost` to don't require a dynamic library
name but just a boolean.

Changelog:
[Android] [Changed] - Further simplify the New App Template by don't requiring the dynamic library name

Reviewed By: cipolleschi

Differential Revision: D39462948

fbshipit-source-id: 737733fc263162a0baf3b7a451e48b8616679d3b
2022-09-13 06:42:37 -07:00
Danilo Bürger 6bdcb49966 Align android image style / source logic with ios (#34655)
Summary:
This aligns the logic of setting style (width / height) and source of Android with iOS.
iOS handles nullish uris with set width and heigth by passing them through. Android did not.

## Changelog

[Android] [Fixed] - Align android image style / source logic with ios

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

Test Plan:
```
<Image source={{width: 100, height: 100}} />
```

Before this Patch:
* iOS: Renders a blank image with 100x100
* Android: Renders a blank image with 0x0

After this Patch:
* iOS: Renders a blank image with 100x100
* Android: Renders a blank image with 100x100

Reviewed By: sammy-SC

Differential Revision: D39423391

Pulled By: cipolleschi

fbshipit-source-id: 997c06dea42e9b69fda12b678a1b82ad8319537f
2022-09-13 05:18:45 -07:00
Roman Melnyk 0cae4959b7 #34610 Fix invalid range "t-5" in string transliteration [iOS] (#34636)
Summary:
Fix invalid range "t-5" in string transliteration [iOS] for M1 pod install issue.

This should fix pod install error for M1 machines.

## Changelog
[iOS] [Fixed] - Fix ios pod install error

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

Test Plan: Run pod install on M1 machine.

Reviewed By: sammy-SC

Differential Revision: D39423276

Pulled By: cipolleschi

fbshipit-source-id: 4ec95af7103395792facba0f93fd8de05a3fe78d
2022-09-13 04:14:04 -07:00
Nicola Corti 406c9d097a Remove :packages:react-native-codegen:android from top level settings (#34579)
Summary:
The folder `/packages/react-native-codegen/android` is not existing anymore, I'm removing it.

## Changelog

[Internal] - Remove :packages:react-native-codegen:android from top level settings

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

Test Plan: Will rely on a green CI

Reviewed By: cipolleschi

Differential Revision: D39440292

Pulled By: cortinico

fbshipit-source-id: 492722b1b697e0bf03cf2803b25fb9604cf0778a
2022-09-13 04:07:44 -07:00
Luna Wei 767f8e0249 Add bots as a yarn workspace and update danger action (#34652)
Summary:
allow-large-files

When working on https://github.com/facebook/react-native/pull/34614, danger is failing because it doesn't share `node_modules` with the root directory where `typescript` is installed as we added it as a parser in our eslint config.

By setting `bots` as a yarn workspace, dependencies are all installed under the root `node_modules` folder and in local testing (detailed in test section) we no longer have the `typescript module not found` error. However, danger will continue to fail on https://github.com/facebook/react-native/pull/34614 as the `danger_pr` Github action runs from what's defined on `main`.

Once these changes land, I can rebase https://github.com/facebook/react-native/pull/34614 on it and danger's eslint should pass.

## 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][Fixed] - Add `bots` directory as a yarn workspace and update `danger_pr` Github action

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

Test Plan:
To verify this fix I had to run:
```
react-native $ yarn && cd bots
react-native/bots$ yarn run danger pr https://github.com/facebook/react-native/pull/34614
```

which resulted in
```
❯ yarn run danger pr https://github.com/facebook/react-native/pull/34614
yarn run v1.22.19
$ lunaleaps/react-native/node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/34614
Starting Danger PR on facebook/react-native#34614

Danger: ✓ found only warnings, not failing the build
## Warnings
🔒 package.json - <i>Changes were made to package.json. This will require a manual import by a Facebook employee.</i>

  Done in 12.78s.
```
Verified this also on another PR:
```
yarn run danger pr https://github.com/facebook/react-native/pull/34650
```

Reviewed By: NickGerleman

Differential Revision: D39435286

Pulled By: lunaleaps

fbshipit-source-id: 8c82f49facf162f4fc0918e3abd95eb7e4ad1e37
2022-09-12 22:03:34 -07:00
Tianyu Yao bfb36c2163 Stop inspecting when an element is selected
Summary:
Changelog:
[General][Fixed] In RN devtools, call that method, and then set component state to not inspecting.

Reviewed By: lunaruan

Differential Revision: D38852009

fbshipit-source-id: d14bd4cc4461f0f7ec4ae9cd6098a58eef3e6ab9
2022-09-12 16:56:19 -07:00
Tianyu Yao 6163029d4a Fix selectNode in fabric
Summary:
Changelog:
[General][Fixed] - Currently selectNode doesn't work for Fabric. Passing the instance instead of a tag to `selectNode` works.

Reviewed By: lunaruan

Differential Revision: D38851141

fbshipit-source-id: 7640d0f31fb099346a4d8205981e262da6be4990
2022-09-12 16:56:19 -07:00
Danilo Bürger 2d5db284b0 Support PlatformColor in borderColor on Android (#33544)
Summary:
PlatformColor should work on all *color style attributes on all platform.

Partially fixes https://github.com/facebook/react-native/issues/32942

## Changelog

[Android] [Fixed] - Support PlatformColor in borderColor

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

Test Plan: Open rn tester (USE_FABRIC=false) platform color api examples. Without the changes to ViewProps.java, it will error out.

Reviewed By: lunaleaps

Differential Revision: D39413519

Pulled By: NickGerleman

fbshipit-source-id: 58962ba2956aa3df45144108eec194aedf23886b
2022-09-12 15:07:19 -07:00
Vincent Riemer 93b51b5f86 Add MoveAcross test for pointer events
Summary:
Changelog: [RNTester][Internal] - Add "move across" test for pointer events

This diff adds a new platform test ported from the wpt's [mousemove-across test](https://github.com/web-platform-tests/wpt/blob/master/uievents/order-of-events/mouse-events/mousemove-across.html) along with a rough port of the wpt's event recorder class which is made to work in a react component environment.

Reviewed By: lunaleaps

Differential Revision: D39221252

fbshipit-source-id: 16b2e03dbc71a2e83cc43af1e950803feaf6657b
2022-09-12 14:48:39 -07:00
Elliott Kember 7be829f2c9 Fix ImageLoader.getSize jest mock (#34653)
Summary:
`getSize` should resolve with an array of `[width, height]` but this mock resolves with `{ width, height }`.

It should be `ReadOnlyArray<number>` instead of `{width: number, height: number}`

The native image loader call is [here](https://github.com/facebook/react-native/blob/main/Libraries/Image/NativeImageLoaderIOS.js#L18):
```js
  +getSize: (uri: string) => Promise<$ReadOnlyArray<number>>;
```

but in the [jest setup file](https://github.com/facebook/react-native/blob/main/jest/setup.js):
```js
  getSize: jest.fn(url => Promise.resolve({width: 320, height: 240})),
```

My tests were failing on `Image.getSize()` - `TypeError: Invalid attempt to destructure non-iterable instance.`

I managed to trace this down to this object being returned by the Jest mock - looks like it's returning a size object instead of a dimensions array.

## Workaround

If you are hitting this issue, you can work around this mock by using:

```js
ReactNative.NativeModules.ImageLoader.getSize = jest.fn((_) => Promise.resolve([320, 240]));
```

## Changelog

[JavaScript] [Changed]: Changed the mocked return value of `ImageLoader.getSize` to be `[320, 240]` instead of `{ width: 320, height: 240 }`

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

Test Plan: TBD? I think a test with `Image.getSize(path)` will cover it. That's where I hit the error with the ios-specific imageLoader's getSize method.

Reviewed By: robhogan

Differential Revision: D39413522

Pulled By: NickGerleman

fbshipit-source-id: 7f18d7acde0cf94da0b4aec8fe2d0cad3fb0cc55
2022-09-12 14:11:28 -07:00