Commit Graph

23299 Commits

Author SHA1 Message Date
Phillip Pan 99f706e5df introduce RCTComputeScreenScale
Summary:
Changelog: [Internal]

in this diff, we add a function that allows us to retrieve screen scale. enforcing thread safety will be dependent on the consumer to make sure it's used on main thread.

i'd like for this to be a more temporary solution, i think we should have a more scalable screen solution for consumers to handle the gambit of uiscreen use cases.

Reviewed By: sammy-SC

Differential Revision: D31163909

fbshipit-source-id: 78104e9ef982b47c60697461141afb4b06eede72
2021-09-24 16:59:29 -07:00
Phillip Pan c744528da1 fix inaccurate comment for RCTScreenSize()
Summary:
Changelog:
[iOS][changed] - fixed inaccurate comment

while looking around, i saw this comment for RCTScreenSize that says it's called on app start - i looked around and also put a breakpoint here, and this assumption doesn't seem accurate anymore. just updating the comment for clarity.

Reviewed By: sammy-SC

Differential Revision: D31136182

fbshipit-source-id: 5f02a1a9fd95e16495bb79b3645b5f4e3bc1d9c9
2021-09-24 16:59:29 -07:00
Héctor Ramos c0b46f3487 Circle CI: Package a release on every commit, but do not publish it
Summary:
Otherwise known as "commitlies," these are per-commit releases that do not get published to npm. They can be downloaded from Circle CI's artifacts pane on the relevant "build_npm_package" job.

If `--dry-run` flag is passed to `publish-npm.js`, it will perform the same steps as a `--nightly` but it will stop short of publishing the nightly to npm. The tarball for the release will be available in the `build/` directory.

Commitlies are implemented by triggering a `--dry-run` publish step on any commit that is not tagged as an open source release (e.g. `/v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/`).

Changelog:
[Internal]

Reviewed By: sota000

Differential Revision: D31177828

fbshipit-source-id: 7d4f79e1ed15718a177d2cb8fc620d5fb860ccf9
2021-09-24 13:49:16 -07:00
Andrei Shikov 4090195122 Ensure elevated views are not changing drawing order
Summary:
Uses `enableZ` trick to ensure that Skia doesn't try to reorder the views based on elevation. Unfortunately, it only helps for some cases, but the proper fix would require reimplementing `ViewGroup` completely to remove its internal logic of reordering based on Z coordinate.

Changelog: [Android][Fixed] Ensure elevated views are behind sticky header in FlatList

Reviewed By: cortinico

Differential Revision: D30700566

fbshipit-source-id: d2c59b22332922c610f4f2d415df34e81f5a33c5
2021-09-24 10:05:12 -07:00
Amy Nichol 4e8da9b28f Back out "Fix - ReconnectingWebSocket race condition mClosed"
Summary:
Changelog:[Internal]
Original commit changeset: 48793bd3bea9

Reviewed By: ShikaSD

Differential Revision: D31170947

fbshipit-source-id: cb460e3261fdc2a0df6e3a4597c61bd879ecf38f
2021-09-24 09:44:32 -07:00
Nicola Corti 9cf4bb73c0 Removed extra missing script from package.json
Summary:
The generate script file was removed but the package.json file was never update.
I'm doing it here.

Changelog:
[Internal] [Changed] - Removed extra missing script from package.json

Reviewed By: ShikaSD

Differential Revision: D31171736

fbshipit-source-id: 5b9474651d10374ccbb0b06f2c83bc34da01a179
2021-09-24 09:32:23 -07:00
Nicola Corti 3a41131913 Setup a package inside react-native-gradle-plugin.
Summary:
This diff adds a `package.json` inside `react-native-gradle-plugin`
so it can be distributed and used inside the `template/` project
similarly to what we do with the `react-native-codegen` package.

Changelog:
[Internal] [Added] - Setup a package inside `react-native-gradle-plugin`

Reviewed By: fkgozali

Differential Revision: D31081980

fbshipit-source-id: 9a9ad696ee6db01666bae75255616fd20aadd243
2021-09-24 09:27:59 -07:00
Nicola Corti 5b8da02296 Fix GenerateCodegenArtifactsTask calling two generators with Java enabled
Summary:
This diff fixes a bug with `GenerateCodegenArtifactsTask` that was causing
two generators to be called one after the other (first the JS and then the Java one).
Now they're mutually exclusive.

Changelog:
[Internal] [Changed] -  Fix GenerateCodegenArtifactsTask calling two generators with Java enabled

Reviewed By: ShikaSD

Differential Revision: D31169379

fbshipit-source-id: 668d8e440ad6b3f06654f29c5cbc344ef82c4b9c
2021-09-24 08:19:17 -07:00
Samuel Susla 6d367d70f2 Re-introduce AsyncEventBeatV2 experiment
Summary: changelog: internal

Reviewed By: javache

Differential Revision: D31056006

fbshipit-source-id: 423c81a0fde77b0e2e4b3ddcd6e23c0552b16b3b
2021-09-24 07:16:23 -07:00
Samuel Susla 382e78e0f0 Cleanup react_fabric_marketplace_home_android_universe.enable_props_forwarding
Summary: changelog: [internal]

Reviewed By: GijsWeterings, ShikaSD

Differential Revision: D30835467

fbshipit-source-id: 6ce2a9dd64eb8a3711370fd07c1b0703b7b3345b
2021-09-24 05:09:58 -07:00
Pieter De Baets 133705b130 Re-implement hover state calculation to support nested Text nodes
Summary:
Changelog: [Internal]

Add a path calculation method to TouchTargetHelper to avoid relying on the view hierarchy ourselves and better support virtual touch targets.

Reviewed By: JoshuaGross

Differential Revision: D30993410

fbshipit-source-id: 17577c815413ab0f03bcb6a2140ea1d4c9fd694a
2021-09-24 04:11:49 -07:00
Nicola Corti c3e294f2a8 Move PathUtilsTest.kt to the correct package
Summary:
This file was placed in the wrong package. I'm moving it.

Changelog:
[Internal] [Changed] - Move `PathUtilsTest.kt` to the correct package

Reviewed By: motiz88

Differential Revision: D31168890

fbshipit-source-id: 59d09b5fd329b776bd2800921889281a116c26ee
2021-09-24 04:09:08 -07:00
Nicola Corti 861acce530 Add unit tests for GenerateCodegenSchemaTask
Summary:
Adding tests for the `GenerateCodegenSchemaTask`.
Plus fixing a bug where `delete()` was used instead of `deleteRecursively` causing
the files inside the output folder to don't be properly cleaned up.

Changelog:
[Internal] [Changed] - Add unit tests for GenerateCodegenSchemaTask

Reviewed By: ShikaSD

Differential Revision: D31142346

fbshipit-source-id: 69bb026fa2c64d91193a153fdc99c9b5d0a9e1ff
2021-09-24 03:02:55 -07:00
Nicola Corti 0d9b32769c Add unit tests for BuildCodegenCLITask
Summary:
This Diff is adding some tests for BuildCodegenCLITask.
Plus I found a bug in how we pass the input/output relative to `codegenDir`
so I'm fixing the properties to use `by lazy{}`.

Moreover the `output` was not correctly annotated with `OutputDirectories`,
fixing it here.

Changelog:
[Internal] [Changed] - Add unit tests for BuildCodegenCLITask

Reviewed By: ShikaSD

Differential Revision: D31109599

fbshipit-source-id: bec75b216e8cef18072179c89c3223ee2bad74e3
2021-09-24 02:13:03 -07:00
Nicola Corti 929cb56f22 Merge CodegenPlugin with ReactAppPlugin
Summary:
Since we moved several classes from the older Java plugin to standalone files,
we can now remove the old `CodegenPlugin.java` class and have a single plugin class.

Changelog:
[Internal] [Changed] - Merge `CodegenPlugin` with `ReactAppPlugin`

Reviewed By: ShikaSD

Differential Revision: D31080558

fbshipit-source-id: c4b005f8648ab62a71cb5bee22c06ae5272ecc44
2021-09-24 01:40:08 -07:00
Nicola Corti 12b0e024e1 Test the Android template on CircleCI (#32228)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32228

This setups a step on Circle to
test the Android template with the head of `main` of react-native to make
sure we're not actually breaking the Android template.

Changelog:
[General] [Added] - Test the Android template on CircleCI

Reviewed By: ShikaSD

Differential Revision: D31018850

fbshipit-source-id: 6f0abc9e0c22ef61e1aa79b513c70065ace5088e
2021-09-24 01:04:24 -07:00
Nicola Corti d314d1f265 Export GenerateCodegenArtifactTask to its own task.
Summary:
This is the last task from the Codegen Plugin that is exported to
its own Task file and converted to Kotlin.

Changelog:
[Internal] [Changed] - Export `GenerateCodegenArtifactTask` to its own task.

Reviewed By: ShikaSD

Differential Revision: D31054781

fbshipit-source-id: 6787065b497570fb312310e3d9f4120f0629f374
2021-09-24 00:47:10 -07:00
Héctor Ramos b494ae0703 Move react-native-codegen dependency to react-native root package.json
Summary:
The `react-native-codegen` package handles the generation of native code artifacts for modules and components in the new React Native architecture.

This change moves the dependency from being an application-level dependency to being a direct dependency of the `react-native` package.

Changelog:
[General] Move react-native-codegen dependency to react-native root package.json

Reviewed By: yungsters

Differential Revision: D31129619

fbshipit-source-id: dfa0df589c4dbca70dde6db0208485431e304809
2021-09-23 21:40:22 -07:00
Kevin Gozali ec9e97179e OSS: bump-oss-version -- update Podfile.lock later in the flow
Summary:
There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow.

This also restrict the version number change check to the specific files for better reliability

Changelog: [Internal]

Reviewed By: sota000

Differential Revision: D31160139

fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd
2021-09-23 19:31:36 -07:00
Kevin Gozali d3c7e20183 OSS: update Podfile.lock automatically when bumping release version
Summary:
To ensure consistency of RNTester Podfile.lock:
* introduce a script to run `pod install` on the current commit
* have the script check the exact CocoaPods version to use for consistency
* have version bump script run this automatically to keep it up-to-date with the version change

To validate, have this change in `0.66-stable` branch, then try:

```
./scripts/bump-oss-version.js 0.66.0-rc.5
```

This automatically ran `pod install` which produced the Podfile.lock update.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D31132867

fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90
2021-09-23 08:27:27 -07:00
CodemodService FBSourceClangFormatLinterBot 1a1c3a6405 Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D31138547

fbshipit-source-id: ba134ae7f057c918eaefdc6310f7663e187e9749
2021-09-23 07:54:31 -07:00
Jesse Katsumata dbd5c3d8e5 chore: add ImageBackgroundPropType (#32099)
Summary:
Added FlowType definition for ImageBackground component Props

## Changelog

[General] [Changed] - Add ImageBackground component type definition
[General] [Fixed] - ImageBackground now respects `imageStyle` width and height

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

Test Plan:
- [ ] flow check passes
- [ ] rn-tester app runs

Reviewed By: charlesbdudley

Differential Revision: D30597737

Pulled By: yungsters

fbshipit-source-id: 9699ee2bb727a1a8f30d6ffe3a2845c8a134e89d
2021-09-22 20:20:57 -07:00
Pieter De Baets 67b62adf4b Reduce LockFreeEventDispatcherImpl logspam
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D31116209

fbshipit-source-id: 90dacad32f20148c5956815cff54e2077b7b83a3
2021-09-22 15:45:40 -07:00
Muhammad Numan 01856633a1 feat: add cancelButtonTintColor props in ActionSheetIOS for change cancel button tint color (#31972)
Summary:
we need to change the text color of the cancel button in `ActionSheetIOS` but `tintColor` changes the all button text color except `destructiveButtonIndex`

so I have added `cancelButtonTintColor` prop to change only the text color of the cancel button

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Changed] - added `cancelButtonTintColor` prop for `ActionSheetIOS` to change only the text color of the cancel button

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

Test Plan:
With this PR you can change the cancel text button of `ActionSheetIOS` by this `cancelButtonTintColor` prop

| <img src="https://user-images.githubusercontent.com/36044436/128414537-c4454786-a5cf-49d2-8225-1ff26c9c5058.png"  /> | <img src="https://user-images.githubusercontent.com/36044436/128414549-74a21509-711e-48e0-baf1-3718beae1598.png"  /> | <img src="https://user-images.githubusercontent.com/36044436/128414559-4bee9d1a-ac9f-4cd2-b158-5c4c441158ec.png"  /> |
|-|-|-|

Reviewed By: lunaleaps

Differential Revision: D30878022

Pulled By: yungsters

fbshipit-source-id: c70204f9f2510c75d8e9bed4e0fba79f1c941a1f
2021-09-22 10:44:17 -07:00
Kudo Chien e2b5b6504c Propose to connect metro server programmatically (#31828)
Summary:
nowadays, we could only specify metro server by either dev settings or building time ip.txt.
this pr adds a new way to specify metro server programmatically which makes rn launcher or testing more feasible.

## Changelog

[Internal] [iOS] [Added] - Propose to connect metro server programmatically

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

Test Plan:
just exposing a public interface for RCTPackagerConnection without much code change.
test to call this interface success locally.

Reviewed By: sammy-SC

Differential Revision: D30878774

Pulled By: yungsters

fbshipit-source-id: 5f1d6a4835a983abde7e095d20153e4ba2146a61
2021-09-22 10:40:06 -07:00
Ken Tominaga 398595e074 Remove iOS 11 version check (#32151)
Summary:
This pull request aims to remove iOS 11 version check which is no longer needed.

The minimum iOS deployment target for React Native is `iOS 11` but we still have iOS 11 version check like below.

```
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
        if (available(iOS 11.0, *)) {
```

> React Native apps may target iOS 11.0 and Android 5.0 (API 21) or newer.

ref: https://github.com/facebook/react-native#-requirements

------

If there is a team motivation to remove the deprecated methods and classes before iOS 10, I can continue the work in this pull request or in the continuing pull requests.

We have deprecated warnings for these in the project.

- `UIUserNotificationSettings`
- `UILocalNotification`
- `topLayoutGuide` and `bottomLayoutGuide`
- `automaticallyAdjustsScrollViewInsets`

## Changelog

[iOS] [Changed] - Remove iOS 11 version check

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

Reviewed By: sammy-SC

Differential Revision: D30877917

Pulled By: yungsters

fbshipit-source-id: d903ea5d557beeb65ef87bfce572e4db3532b3c5
2021-09-22 10:37:09 -07:00
Kudo Chien 369b28ce01 Support custom DevSupportManager (#31841)
Summary:
to open possibilities for some DX enhancement, the pr introduces `DevSupportManagerFactory` customization. applications could implement a different DevSupportManager in ReactNativeHost.

## Changelog

[Internal] [Added] - Support custom DevSupportManager

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

Test Plan: this pr just introduces some new interfaces and should not break existing functionalities.

Reviewed By: RSNara

Differential Revision: D30878134

Pulled By: yungsters

fbshipit-source-id: ccdf798caa322b07a876da8312b97002da057388
2021-09-22 10:33:14 -07:00
Kacie Bawiec 88021894f2 React Native sync for revisions 95d762e...e8feb11
Summary:
This sync includes the following changes:
- **[f4ac680c7](https://github.com/facebook/react/commit/f4ac680c7 )**: Fixed broken build script --unsafe-partial flag ([#22324](https://github.com/facebook/react/pull/22324)) //<Brian Vaughn>//
- **[67222f044](https://github.com/facebook/react/commit/67222f044 )**: [Experiment] Warn if callback ref returns a function ([#22313](https://github.com/facebook/react/pull/22313)) //<Dan Abramov>//
- **[263cfa6ec](https://github.com/facebook/react/commit/263cfa6ec )**: [Experimental] Add useInsertionEffect ([#21913](https://github.com/facebook/react/pull/21913)) //<Ricky>//
- **[806aaa2e2](https://github.com/facebook/react/commit/806aaa2e2 )**: [useSES shim] Import prefixed native API ([#22310](https://github.com/facebook/react/pull/22310)) //<Andrew Clark>//
- **[fd5e01c2e](https://github.com/facebook/react/commit/fd5e01c2e )**: [useSES/extra] Reuse old selection if possible ([#22307](https://github.com/facebook/react/pull/22307)) //<Andrew Clark>//
- **[33226fada](https://github.com/facebook/react/commit/33226fada )**: Check for store mutations before commit ([#22290](https://github.com/facebook/react/pull/22290)) //<Andrew Clark>//
- **[86c7ca70a](https://github.com/facebook/react/commit/86c7ca70a )**: Fix link ([#22296](https://github.com/facebook/react/pull/22296)) //<Konstantin Popov>//
- **[0fd195f29](https://github.com/facebook/react/commit/0fd195f29 )**: update error message to include useLayoutEffect or useEffect on bad e… ([#22279](https://github.com/facebook/react/pull/22279)) //<salazarm>//
- **[8f96c6b2a](https://github.com/facebook/react/commit/8f96c6b2a )**: [Bugfix] Prevent infinite update loop caused by a synchronous update in a passive effect ([#22277](https://github.com/facebook/react/pull/22277)) //<Andrew Clark>//
- **[4ce89a58d](https://github.com/facebook/react/commit/4ce89a58d )**: Test bad useEffect return value with noop-renderer ([#22258](https://github.com/facebook/react/pull/22258)) //<Sebastian Silbermann>//
- **[a3fde2358](https://github.com/facebook/react/commit/a3fde2358 )**: Detect subscriptions wrapped in startTransition ([#22271](https://github.com/facebook/react/pull/22271)) //<salazarm>//

Changelog:
[General][Changed] - React Native sync for revisions 95d762e...e8feb11

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D30966369

fbshipit-source-id: 6c88e591005deb1fd93493628ef4695add49186c
2021-09-22 10:10:44 -07:00
Pieter De Baets f29ad54534 Pass through coalesce info to Fabric eventEmitter
Summary: Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30767649

fbshipit-source-id: d5e730850408afd23a4d4964ef7dd3b17fa44a19
2021-09-22 06:07:35 -07:00
Nicola Corti b4ac21152b Remove mavenLocal()
Summary:
Having mavenLocal specified as part of the build is creating confusion as stale artifacts could be used inside the build.

This Diff is attempting to remove. Developers that need it for local development can still re-add it.

Changelog:
[Internal] [Changed] - Remove mavenLocal()

Reviewed By: ShikaSD

Differential Revision: D31057038

fbshipit-source-id: 90335047a0ba5a537ce347e4c1592bfe756d4135
2021-09-22 03:23:00 -07:00
Amy Nichol 94bcfb71a2 Fix - ReconnectingWebSocket race condition mClosed
Summary:
Changelog : [Internal]
Use synchronized blocks to avoid race conditions surrounding mClosed.

Reviewed By: makovkastar

Differential Revision: D31019994

fbshipit-source-id: 48793bd3bea98224d8df344bc4fc8771b517cf72
2021-09-22 01:11:34 -07:00
Tong Liu e20335a2ac Revert D31024459: Merge base AppleTVOS flags into base Apple flags (take #3)
Differential Revision:
D31024459 (https://github.com/facebook/react-native/commit/0a46e5efada5f0be8f2e8ebf721178e685bf5925)

Original commit changeset: be85296cda36

fbshipit-source-id: ceb8e5a3cda57a40a876b07133d8021942308878
2021-09-21 17:50:56 -07:00
Jakob Krigovsky ef5ff3e055 Don’t hard-code CocoaPods’s sandbox path (#32243)
Summary:
When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails.

References:
* https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox
* https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method

## Changelog

[iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios`

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

Test Plan:
1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install`
2. `cd AwesomeProject`
3. `yarn install`
4. `pod install --project-directory=ios`

This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0.

5. `npx react-native run-ios`

The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834.

6. Apply this patch using `(cd node_modules/react-native && curl https://github.com/kontist/react-native/commit/ec330f756e477e53dde891fe02fd74916d9faef0.patch | patch -p1)`
7. Re-run `pod install --project-directory=ios`
8. Re-run `npx react-native run-ios`

The iOS app should now run successfully.

Reviewed By: sota000

Differential Revision: D31089656

Pulled By: fkgozali

fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23
2021-09-21 13:07:11 -07:00
David Vacca f8e4a783ac Avoid calling getEventData() method twice
Summary:
EZ diff that avoids calling getEventData() method twice

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D31076778

fbshipit-source-id: 63c2a469e8e684202dbdbbf12166487328685976
2021-09-21 11:35:53 -07:00
David Vacca fbb802ca63 Fix typo in Event class
Summary:
Just a fix of a typo

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D31076782

fbshipit-source-id: 192de92ba080a565acd67e038b370917ea9fcddc
2021-09-21 11:35:53 -07:00
Samuel Susla 9a308697e2 Do not retain RuntimeScheduler beyond Runtime's lifetime
Summary:
changelog: [internal]

Retaining RuntimeScheduler beyond Runtime's lifetime can lead to crashes.

Reviewed By: ShikaSD

Differential Revision: D31084763

fbshipit-source-id: df6dd6fcf5aa224b9465ed7df1e64ad0ca964510
2021-09-21 10:24:12 -07:00
Moti Zilberman a7ff7229f0 Centralize HERMES_BYTECODE_VERSION setting
Summary: Changelog: [Internal]

Reviewed By: javache

Differential Revision: D31081032

fbshipit-source-id: e0e18e424a192f42daed6dc802155022b41b0067
2021-09-21 10:24:12 -07:00
Samuel Susla 3d83ca0331 Ship initial max size on iOS
Summary:
changelog: [internal]

Ship initial max size on iOS

Reviewed By: fkgozali

Differential Revision: D30990650

fbshipit-source-id: cf8f202ee862145a6fa9f173c2073096f86015e3
2021-09-21 08:23:08 -07:00
Pieter De Baets 6025611bd0 Use real propsParserContext in LayoutAnimation
Summary: Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D31053819

fbshipit-source-id: 8ec21012500f3bfc7e8aea018b5ca72323da2d9e
2021-09-21 04:24:28 -07:00
Lulu Wu f4fdf4b55e Fix currentActivity being null when launching Redbox
Summary:
Try to reuse currentActivity when the new context from "mReactInstanceDevHelper.getCurrentActivity()" is null to fix  "Unable to launch redbox because react activity is not available..."

Changelog:
[Android][Fixed] - Fix currentActivity being null when launching Redbox

Reviewed By: philIip

Differential Revision: D30942434

fbshipit-source-id: faf03390adc545376f3cec223eac5a16bf8233ea
2021-09-20 14:27:26 -07:00
Radek Pietruszewski c0e04460f5 Time out packager liveness check after 10s (#31367)
Summary:
`isPackagerRunning` check on iOS makes a http request to packager's /status endpoint to check if it's alive... The problem is if the packager can't be reached, but doesn't error out immediately. This can happen, for example, if running the app on device, and host computer's firewall doesn't allow a :8081 connection. In that case, the request will never succeed or fail until default timeout of 60s. It makes debugging the underlying issue quite unbearable. It's hard for me to imagine a legitimate packager connection that wouldn't respond in less than a second, so I propose a conservative timeout of 10s

## Changelog

[iOS] [Fixed] - Don't hang app for 60s if packager can't be reached

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

Test Plan: Checked my app in dev mode to see if packager connects properly.

Reviewed By: sammy-SC

Differential Revision: D30912047

Pulled By: charlesbdudley

fbshipit-source-id: 110743dc45b9cc7d30e49f79ce3b0d5986f7aebd
2021-09-20 13:29:27 -07:00
Alex Malyshev 0a46e5efad Merge base AppleTVOS flags into base Apple flags (take #3)
Summary:
Previous iterations of this diff that were reverted: D30678341 (https://github.com/facebook/react-native/commit/800945982fae92c859f4525e777d016bb61b138b), D30868627 (https://github.com/facebook/react-native/commit/abd0f387cd9b60887d5d8ad986e7cbda7a49ec40).

With the power of selects, we can move the base AppleTVOS flags into the regular
base Apple flags.

While I'm here, drop the third `p` in `get_application_apppletvos_flags()` as
it's driving me insane.

Note - This puts get_visibility_option() on all Apple builds.  I believe this is
the right thing to do as everything except macOS static libraries already do it,
and it shouldn't affect binaries.

Changelog: [Internal]

Reviewed By: mzlee, jdonald

Differential Revision: D31024459

fbshipit-source-id: be85296cda3612836c1c74632dc52f6e3f89512e
2021-09-20 09:27:46 -07:00
Nicola Corti 7df5f57fa7 Export GenerateCodegenSchemaTask to its own task.
Summary:
Similarly to the previous diff, this is moving another small part of the codegen
to its own Kotlin separate task. I've used the Gradle idiomatic APIs and added a couple of tests.

Changelog:
[Internal] [Changed] - Export `GenerateCodegenSchemaTask` to its own task.

Reviewed By: ShikaSD

Differential Revision: D31017274

fbshipit-source-id: f0d288a63883e92a9d725eb3bf695a3aa77f9030
2021-09-20 03:23:44 -07:00
Luis Miguel Alvarado 64aa1e5ffe chore: removed unused files (#31465)
Summary:
All these files are unused

## Changelog

[JavaScript] [Removed] - chore: removed unused files

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

Test Plan: CI is passing

Reviewed By: yungsters

Differential Revision: D30653225

Pulled By: charlesbdudley

fbshipit-source-id: 30c646f10be382c4898a8e362176acc382eb9090
2021-09-20 02:23:26 -07:00
Ramanpreet Nara 564b944e56 Ensure RCTJSThread is initialized in Bridgeless mode
Summary:
## Context
When Venice is enabled app-wide, we won't be creating/initializing the bridge. This means that RCTBridge +(void)initialize; won't execute:

https://www.internalfb.com/code/fbsource/[d8b25a1907ee55baa21e02a69ecab0f7a9442b8e]/xplat/js/react-native-github/React/Base/RCTBridge.m?lines=167%2C171-180

## Problem
When RCTBridge initialize isn't executed, we won't initialize RCTJSThread to kCFNull. RCTJSThread will be nil.

NativeModules like RCTEventDispatcher use RCTJSThread to indicate that their methods must be executed on the JavaScript thread:

https://www.internalfb.com/code/fbsource/[44976912ae618619a394f063c4c942ef020b86e8]/xplat/js/react-native-github/React/CoreModules/RCTEventDispatcher.mm?lines=198-201

If RCTJSThread is nil, these NativeModules will fail to initialize w/ the TurboModule system:

https://www.internalfb.com/code/fbsource/[f6a04f529ac1354b2973bd3553d12aef28ff24f2][blame]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm?lines=584-589%2C595%2C599%2C610-618

How:
1. The TurboModuleManager will see that each of these NativeModules has a methodQueue getter (line 587 above).
2. It'll invoke that getter (line 588), and get a nil methodQueue out, when **that methodQueue should be kCFNull**.
3. Because the TurboModuleManager gets a nil method queue from the getter, !methodQueue will pass (line 595).
4. So, TurboModuleManager try to create and assign a method queue to these modules (line 611), which'll raise an error (line 613), because none of these modules synthesize the methodQueue (b/c they expose a getter to methodQueue instead).

## Changes
We need to initialize RCTJSThread to kCFNull in all cases, to prevent this breakage. So, I moved RCTJSThread into its own header: RCTJSThread.h. RCTJSThread.h exports a function that initializes the RCTJSThread constant: _RCTInitializeJSThreadConstantInternal. This function gets invoked inside RCTHost initialize, and RCTBridge initialize.

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

Changelog: [Internal]

Reviewed By: p-sun, mdvacca

Differential Revision: D30910515

fbshipit-source-id: 2dd9b0cfcda92c497bb497f12f9fb847da563f47
2021-09-19 16:23:53 -07:00
Jimmy Zhang be5372801a Pass accessibilityHint through Button component
Summary:
Changelog: [Internal]

Previously, the `accessibilityHint` value isn't passed through the underlying component so that the voice over system doesn't announce it. This diff fixes that.

Reviewed By: sammy-SC

Differential Revision: D31017275

fbshipit-source-id: 1bf5a5e36fdfed2a199986b82684a40e18325ba1
2021-09-17 17:23:22 -07:00
Samuel Susla 6c66cef8ec Show warning if TTRC flag may clipped
Summary: changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D31016886

fbshipit-source-id: 26b5b97382936141ae7ef69fb1701d9822df5e8c
2021-09-17 14:23:54 -07:00
Nicola Corti 2a0d8cccea Export BuildCodegenCLITask to its own task class
Summary:
This diff moves `BuildCodegenCLITask` from being inlined to have its own task definition
I've also cleaned up the task body and refactored a bit how we do the CLI invocation.

Changelog:
[Internal] [Changed] - Export `BuildCodegenCLITask` to its own task class

Reviewed By: ShikaSD

Differential Revision: D31016610

fbshipit-source-id: 8407fc2a62ea473daa775196925c1b9b6f4f2f4b
2021-09-17 11:26:30 -07:00
Gareth Knowles cc59a7cbde Fix: find-node.sh location in react-native-xcode.sh script (#32227)
Summary:
Fix the `find-node.sh` call in `react-native-xcode.sh` script

## Related issue
https://github.com/facebook/react-native/issues/32168

## Changelog

[iOS] [Fixed] - Fix for unable to find `find-node.sh` in `react-native-xcode.sh` script

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

Test Plan: • Run an Xcode build which uses the `scripts/react-native-xcode.sh` in the JS Bundle build phase.

Reviewed By: TheSavior

Differential Revision: D31022043

Pulled By: GijsWeterings

fbshipit-source-id: 10aafd595c3a3a87c22f385ca4f61756f67e9b9d
2021-09-17 10:22:51 -07:00
Pieter De Baets 9b97c09612 Short-circuit evaluation of formsView
Summary:
Changelog: [Internal]

Small optimization, we can avoid evaluating some properties if `formsStackingContext` is already set, because the end-result is always true.

Reviewed By: sammy-SC

Differential Revision: D30990925

fbshipit-source-id: 08f500aa4b75446a6c644e8821f84dbfccbfebb6
2021-09-17 07:25:54 -07:00