Commit Graph

12270 Commits

Author SHA1 Message Date
Luna Wei 4603e76777 Fix styling
Summary: Changelog: [Internal] Fix styling for FlatList test output

Reviewed By: charlesbdudley

Differential Revision: D30816724

fbshipit-source-id: 3e756311c31a38dd4beb27ed16f8aaa206ddb7e8
2021-09-10 17:28:54 -07:00
Luna Wei a7b0943aa9 Move out inverted example
Summary: Changelog: [Internal] Refactor FlatList examples, move invert example under FlatList index

Reviewed By: charlesbdudley

Differential Revision: D30816725

fbshipit-source-id: 6eb4d3133206117646e4738cefdfdbf8f51127fe
2021-09-10 17:28:54 -07:00
Luna Wei 062cd4b2e7 Move Flatlist-contentInset
Summary: Changelog: [Internal] Refactor FlatList examples, move contentInset under FlatList index

Reviewed By: yungsters

Differential Revision: D30816720

fbshipit-source-id: 9b35c575be6819e31ff9ef768f9acfd721a876e8
2021-09-10 17:28:54 -07:00
Luna Wei bde0be26d9 Move out FlatList-onEndReached
Summary: Changelog: [Internal] Refactor FlatList examples, move onEndReached under FlatList index

Reviewed By: charlesbdudley

Differential Revision: D30816722

fbshipit-source-id: 4ee233c7674ed0f5707d9d98388b8c36af900641
2021-09-10 17:28:54 -07:00
Luna Wei 3c3ff30774 Create FlatListExampleIndex
Summary: Changelog: [Internal] Create FlatList example index for 3 levels of navigation

Reviewed By: charlesbdudley

Differential Revision: D30816721

fbshipit-source-id: a3bdae7f385bab3695a9c2dc6fe3148ebdbd12b4
2021-09-10 17:28:54 -07:00
Nicola Corti d8d9c28b48 Make the BundleJsAndAssetsTask Task more Gradle friendly
Summary:
This Diff is adapting the `BundleJsAndAssetsTask` to be a bit more idiomatic. Here the summary of changes.
- Make the task `abstract` to let Gradle properly implement it.
- Make all the annotated filed `public` instead of `internal` as they will be easier to access for Gradle + will show up
correctly in logs/scans
- Update the Task to subclass a `Exec` that is a specificed Task
- Do not reference `project.` inside the Task body as that is breaking the Configuration Caching of Gradle

Changelog:
[Internal] [Changed] - Make the `BundleJsAndAssetsTask` Task more Gradle friendly

Reviewed By: mdvacca

Differential Revision: D30865159

fbshipit-source-id: 74d4c77f6a2b3fac944e7e0b123726e6a423ba1d
2021-09-10 08:39:21 -07:00
Nicola Corti d4c347c052 Export detected* functions fron ReactAppExtension to its own file
Summary:
Ideally a Gradle `Extension` should contain only properties as it's the public facing API of our
Gradle surface. Here I'm movign a couple of functions away from it. Now they're located inside their
own Util file. Moreover I've added tests and documentation to those.

Changelog:
[Internal] [Changed] - Export `detected*` functions fron `ReactAppExtension` to its own file

Reviewed By: mdvacca

Differential Revision: D30865494

fbshipit-source-id: 59925414c0eb427161691950f5b9b6495121da00
2021-09-10 08:31:43 -07:00
Nicola Corti c40b177f61 Export file utils to a separate file and test them
Summary:
Another small diff to setup some testing for our Gradle Plugin.
Here I exported a couple of extension functions on `File` to a separate
Utils file + I've added some tests for them.

Changelog:
[Internal] [Added] - Add tests for AndroidConfiguration

Reviewed By: mdvacca

Differential Revision: D30841339

fbshipit-source-id: fcb00d7397d1f3e2b4500e9920508c71f20c76f3
2021-09-10 02:40:32 -07:00
Nick Gerleman ffcaef64e4 Fix BorderExample Crash on Out of Tree Platforms (#32120)
Summary:
https://github.com/facebook/react-native/commit/9b4f8e01442356f820e135fae3849063b2b8c92c#diff-ee44452e2deeb3a607e863852bb720518875b88c4e78ea7dc76805488bfb1818 added examples to the border test page using PlatformColor. An iOS specific instance was later conditioned to only iOS in https://github.com/facebook/react-native/commit/f6d0f9deaccdc53114d47b8a69c49fda7cb1f8e1#diff-ee44452e2deeb3a607e863852bb720518875b88c4e78ea7dc76805488bfb1818 but one example remains that has values for Android, and iOS only. This causes a crash on at least RNW, since none of the PlatformColors are valid.

This change addsa a fallback to black for unsupported platforms, and also adds a Windows PlatformColor for kicks (and marginal extra usefuleness).

## Changelog

[Internal] [Fixed] - Fix BorderExample Crash on Out of Tree Platforms

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

Test Plan: Validated on RNTester on Windows.

Reviewed By: yungsters

Differential Revision: D30822765

Pulled By: lunaleaps

fbshipit-source-id: 6b3e65204259205bb2f3c9153a2361d1decebe98
2021-09-10 00:58:03 -07:00
Sota Ogo 2a0293906f Add an error message when there is no modules to process in codegen
Summary:
Adding an error message when codegen doesn't recognize any modules to help users understand what's going on.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D30624535

fbshipit-source-id: 781f1f874a5b0c16a05191186b81c2d3892da95b
2021-09-09 17:26:19 -07:00
Timothy Yung ab2bdee735 Fix encoding for gradlew.bat files (#32178) 2021-09-09 14:33:50 -07:00
Moti Zilberman f22e6033d9 Support nonstandard pixel densities for Android drawables
Summary:
Adds functionality to RN's built-in version of the `getAndroidAssetSuffix` function. Open source uses a [fork of this code](https://github.com/react-native-community/cli/blob/df55a78f2d27e3443f15b15b87459b54a78e2c47/packages/cli/src/commands/bundle/assetPathUtils.ts#L19-L36) as part of the RN CLI and is therefore unaffected.

Specifically, we can now package drawable assets for Android with nonstandard pixel densities by placing them in [`drawable-<nnn>dpi`](https://developer.android.com/guide/topics/resources/providing-resources#:~:text=nnndpi), where `nnn` is a number representing a pixel density. Previously using nonstandard scale factors like `1.25x` would be a build-time error when building for Android.

We could send a corresponding PR to the RN CLI, but [Gradle doesn't support this convention](https://issuetracker.google.com/issues/72884435) (although it is documented and supported by Android) so it may not be of much use in OSS right away.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D30784087

fbshipit-source-id: ea82f924d14a316702cabba759722cf26f69eb21
2021-09-09 08:19:42 -07:00
Nicola Corti ebcdf511a5 Add tests for AndroidConfiguration
Summary:
Another small diff to setup some testing for our Gradle Plugin.
Specifically this one is also setting up a test environment where we would be able to exercies
AGP usages on top of `ProjectBuilder`. This will allow us to verify that an Android project
is configured correctly for a React Native build.

Changelog:
[Internal] [Added] - Add tests for AndroidConfiguration

Reviewed By: GijsWeterings

Differential Revision: D30839600

fbshipit-source-id: 10e3b3c0fcf5979c2a0eaf64320f87ae58093fbd
2021-09-09 06:42:53 -07:00
Michał Osadnik 21b2d6c8e7 Fix "Running on device" in RNTester README (#32169)
Summary:
Fix broken link
## 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
-->

[CATEGORY] [TYPE] - Message

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

Reviewed By: yungsters

Differential Revision: D30809096

Pulled By: GijsWeterings

fbshipit-source-id: b600e411c7292ba840e076d68f66cb3043887335
2021-09-08 10:27:20 -07:00
Nicola Corti 90a465f8a8 Add tests for TaskUtils
Summary:
This Diff is adding some really simple tests for TaskUtils.
It also adds a couple of utilities to run some sample tests (e.g. mocking the OS version)
that would come handy the more we keep on writing tests and adding functionalities to the Gradle plugin.

Changelog:
[Internal] [Changed] - Added tests for TaskUtils

Reviewed By: mdvacca

Differential Revision: D30809779

fbshipit-source-id: c401cb78e386964e429c6f459c699e6f18f54f11
2021-09-08 10:19:54 -07:00
Ramanpreet Nara cf561b4052 Remove rootView.bridge access in RCTRootViewIntegrationTests
Summary:
RCTRootView exposes the RCTEventDispatcher directly via the .eventDispatcher property. So, there's no need to access the bridge to access the eventDispatcher.

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

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D30753792

fbshipit-source-id: 5820d65c061e9b88382692dfc2791ed4a4841c0f
2021-09-06 04:57:38 -07:00
Nicola Corti 805d798d30 Do not use kotlin-dsl inside react-native-gradle-plugin (#32139)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32139

Currently RN Gradle Plugin is using `kotlin-dsl` that comes will all sorts of side effects on Gradle plugins projects.
Specifically we can't specify the Kotlin version, plus it makes harder to include Java source code in a single
project.

I'm removing it in favor of Kotlin-JVM plugin. I've adapted the code to use the correct APIs.
Specifically most of the lambdas are changing the scope of the parameter (from `this` to `it`) so I had to adapt
those as well.

Changelog:
[Internal] [Changed] - Do not use `kotlin-dsl` for `react-native-gradle-plugin`

Reviewed By: yungsters

Differential Revision: D30726977

fbshipit-source-id: b10635eefdbbb496c4adddd418db6b0ab613ab59
2021-09-06 02:47:50 -07:00
Nicola Corti 040f548ba0 Setup Gradle Wrapper inside packages/react-native-gradle-plugin/ (#32140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32140

This diff is setting up the Gradle wrapper inside packages/react-native-gradle-plugin/.
Currently the `./gradlew` file is missing so it's not possible to `cd` inside the project and build it from
there (also opening that folder inside the IDE will trigger the creation of the files I added here).

This diff is fixing. The files have been generated with the command:

```
gw -p packages/react-native-gradle-plugin wrapper --gradle-version 7.0.2 --distribution-type=all
```

Changelog:
[Internal] [Added] - Setup Gradle Wrapper inside packages/react-native-gradle-plugin/

Reviewed By: yungsters

Differential Revision: D30730145

fbshipit-source-id: a0bd6be0ac062e089b2b90a55b47987c0f4b6644
2021-09-06 02:42:30 -07:00
Xuan Huang 8e66f0b35b Bump Hermes pod to 0.9.0
Summary:
Changelog:
[General][Changed] - Bump Hermes to 0.9.0

(Note: this ignores all push blocking failures!)

Reviewed By: lunaleaps

Differential Revision: D30726473

fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80
2021-09-02 18:42:44 -07:00
Nicola Corti b1120c6a65 Bump Gradle to 7.1.1 (#32138)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32138

This is a follow up to the Gradle bump: D30486612 (https://github.com/facebook/react-native/commit/85249cafe8870ab8f47c38569b106555ce2f8527)

Changelog:
[Android] [Changed] - Bumped Gradle to 7.1.1

Reviewed By: ShikaSD

Differential Revision: D30698411

fbshipit-source-id: ae51499c36380dca6763abeaf04ab3d6ca37456d
2021-09-02 04:31:42 -07:00
fabriziobertoglio1987 c360b1d92b Fix non selectable Text in FlatList (#28952)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/26264 fixes https://github.com/facebook/react-native/issues/27107
Text is not selectable inside a FlatList on Android. The solution is to invalidate the ReactTextView after a change of the selectable prop. If the view is visible, onDraw(android.graphics.Canvas) will be called at some point in the future and make the Text selectable.

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

[Android] [Fixed] - Fix non selectable Text in FlatList

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

Test Plan:
**<details><summary>CLICK TO OPEN TESTS RESULTS</summary>**
<p>

The issue was demonstrated in the following [snack](https://snack.expo.io/fabrizio.bertoglio/selectable-bug-in-flatlist) (more info in issue https://github.com/facebook/react-native/issues/26264).

The solution is:

1) Calling `invalidate()` from [setSelectableText][1] after changing the `selectable` prop and `mSelectableText` value. [`invalidate()`](https://developer.android.com/reference/android/view/View#invalidate()) triggers the `onDraw` callback.

[1]: https://github.com/fabriziobertoglio1987/react-native/blob/8027524947cafd5cbdc492e4ef9c92b346fe23fc/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java#L427-L430

2) calling `setTextIsSelectable(mSelectableText);` from the [`onDraw`][2] callback

[2]: https://github.com/fabriziobertoglio1987/react-native/blob/8027524947cafd5cbdc492e4ef9c92b346fe23fc/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java#L456-L460

The example below is availabe in RNTester FlatList example. Two options (`onPressDisabled` and `textSelectable`) have been added to test the functionality inside a FlatList.

<p align="center">
<img src="https://user-images.githubusercontent.com/24992535/82672536-c2e74d80-9c40-11ea-8fd8-156bfacfac8a.gif" width="200" height="" />
</p>

</p>
</details>

Reviewed By: ShikaSD

Differential Revision: D30000870

Pulled By: lunaleaps

fbshipit-source-id: 4851a294960df0af057d006793aa9ba97c51e3f9
2021-09-01 15:28:30 -07:00
Samuel Susla 329b026f3a Switch order of search libraries to fix M1 build error
Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template

Reviewed By: fkgozali

Differential Revision: D30693466

fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e
2021-09-01 08:26:42 -07:00
Tim Yung 65e58f26e1 RN: @react-native/normalize-color support Node.js
Summary:
Changes `react-native/normalize-color` to be useable from Node.js by making the following changes:

1. Rename `base.js` to `index.js` so importing is more convenient.
2. Move Flow definitions into a seprate library definition flow so `index.js` can be consumed directly.

I also made a few improvements to the actual implementation:

1. Avoid allocating `matchers` for non-strings.
2. Avoid allocating an object of all the color keywords. This will reduce memory usage (in exchange for slightly larger compiled bytecode).

Changelog:
[General][Changed] - react-native/normalize-color now supports Node.js

Reviewed By: lunaleaps

Differential Revision: D30595908

fbshipit-source-id: e6279e9ff815d8d1f489811187deabfdf53b8fbf
2021-09-01 01:26:56 -07:00
Utkarsh b26f277262 Add Linking examples in rn-tester (#30547)
Summary:
Added examples to RNTester for the Linking API.

## Changelog
[General] [Added] - Added example for openSettings() for Linking API.
[General] [Added] - Added [LSApplicationQueriesSchemes](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW14) in info.plist with entries tel, telprompt, http, fb, geo

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

Test Plan: ![Screen Recording 2020-12-07 at 11 19 13 PM (1)](https://user-images.githubusercontent.com/16796008/102250807-05001580-3f2a-11eb-9ce0-58de4d6fca54.gif)

Reviewed By: yungsters

Differential Revision: D30559457

Pulled By: lunaleaps

fbshipit-source-id: dba2721a9905ddb9ddd2b14141e5553bdf8880da
2021-09-01 00:27:42 -07:00
Kevin Gozali ac4ddec542 OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround
Summary:
Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly.

Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues

Reviewed By: lunaleaps

Differential Revision: D30691291

fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212
2021-09-01 00:27:42 -07:00
Kevin Gozali 945c5f714d OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds
Summary:
The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy.

The 2nd PR had multiple issues:
* It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535
* RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption

It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var.

So this diff does 2 things:
* Undid https://github.com/facebook/react-native/pull/29263
* Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly

{F659123377}

Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling

Reviewed By: lunaleaps

Differential Revision: D30690900

fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27
2021-09-01 00:27:42 -07:00
Héctor Ramos 6651d8c346 Enable codegen in RNTester's NativeModuleExample
Summary:
Create a ScreenshotManager.podspec (codegen recipe included) and add ScreenshotManager Pod to the Podfile.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D30623054

fbshipit-source-id: be20880a53ba8a08f8b42b8d81c868c8a21960e1
2021-08-31 16:26:52 -07:00
Matt Oakes ed20a85152 Bump the version of @react-native-community/eslint-config (#32117)
Summary:
The version of this package needs to be bumped for me to release the changes from https://github.com/facebook/react-native/issues/28637 to NPM.

## Changelog

[Internal] [Added] - Bump react-native-community/eslint-config version

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D30663708

Pulled By: yungsters

fbshipit-source-id: f433c324f12663d76e55c9395630cd642955b25e
2021-08-31 16:26:52 -07:00
Nicola Corti 85249cafe8 Update project to build on Gradle 7.0.2 (#32073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32073

This Diff bumps the version of Gradle used to build the project to
7.0.2. Ideally we could bump to 7.2.x directly, but I'll do one minor version
at a time to exclude potential build problems.

This diff is addressing all the extra build warnings that got raised by the new version.

Changelog:
[Android][Changed] - Bumped Gradle project version to 7.0.2

Reviewed By: ShikaSD

Differential Revision: D30486612

fbshipit-source-id: 70e0f7d18e547013ca7b1d12f8dd64a633df5870
2021-08-31 13:27:27 -07:00
Daiki Ihara de1a72acae move prettier to peerDeps in eslint-config-react-native-community (#28637)
Summary:
In monorepo environment, prettier-plugin in some editor load from nearest `node_modules`. Older version of eslint-config-react-native-community includes prettier v1 in their dependencies. It cause conflict of code style inside the monorepo.

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

[Internal] [Fixed] - move prettier to peerDependencies in eslint-config-react-native-community

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

Test Plan: I think it would be good with no plan to test.

Reviewed By: yungsters

Differential Revision: D30648134

Pulled By: charlesbdudley

fbshipit-source-id: 6c01226d6e4cc37ddbc86be260563deb093758d0
2021-08-30 16:32:23 -07:00
Héctor Ramos b51a99c73c rn-demo-app: Implement getModuleInstanceFromClass:
Summary:
While not strictly necessary for rn-demo-app at this point, we do need to provide the `getModuleInstanceFromClass:` implementation to simplify the TurboModule migration process later on.

Also, removed some issues in the Xcode project that must have been introduced during a recent rebase (duplicate Embed Pods build phases).

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30618992

fbshipit-source-id: a9b496cfa0cd34fca6389ddf829613aa13ea409d
2021-08-28 11:32:51 -07:00
Neil Dhar 1bc885b8b8 Make JSI a dynamic library
Summary:
Ship libjsi as a standalone dynamic library. This prevents problems
with exception handling caused by duplicate typeinfo across multiple
shared libs, and reduces bundle size by removing duplicate copies of
JSI.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30599215

fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96
2021-08-27 17:16:49 -07:00
Adlai Holler 4ac42d88ef Optimize font handling on iOS (#31764)
Summary:
Few issues I saw when profiling RNTester:
- Repeatedly calling `-lowercaseString` during `weightOfFont` causes a TON of extra memory traffic, for no reason.
- `NSCache` is thread-safe, so no need for a mutex.
- Using `stringWithFormat:` for the cache key is slow. Use `NSValue` to store the data directly instead.
- Calling `-fontDescriptor` in `isItalicFont` and `isCondensedFont` is overly expensive and unnecessary.
- `+fontNamesForFamilyName:` is insanely expensive. Wrap it in a cache.

Unscientific test on RNTester iPhone 11 Pro, memory & time. Before:
<img width="1656" alt="Screen Shot 2021-06-23 at 7 40 06 AM" src="https://user-images.githubusercontent.com/2466893/123092882-f4f55100-d3f8-11eb-906f-d25086049a18.png">
<img width="1656" alt="Screen Shot 2021-06-23 at 7 41 30 AM" src="https://user-images.githubusercontent.com/2466893/123092886-f6267e00-d3f8-11eb-89f6-cfd2cae9f7b6.png">

After:
<img width="1455" alt="Screen Shot 2021-06-23 at 9 02 54 AM" src="https://user-images.githubusercontent.com/2466893/123101899-7d2c2400-d402-11eb-97f8-2ee97ee69ec4.png">
<img width="1455" alt="Screen Shot 2021-06-23 at 8 59 44 AM" src="https://user-images.githubusercontent.com/2466893/123101892-7bfaf700-d402-11eb-9a10-def46b37b87f.png">

Changelog:
[iOS][Changed] - Optimized font handling

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

Reviewed By: appden

Differential Revision: D30241725

Pulled By: yungsters

fbshipit-source-id: 342e4f6e5492926acd2afc7d645e6878846369fc
2021-08-26 22:47:41 -07:00
Valentin Shergin 1acf334614 Fixed alignItems: baseline for <Text> elements on Android (#31575)
Summary:
This fixes https://github.com/facebook/react-native/issues/20666 and https://github.com/facebook/react-native/issues/21918.

This is pretty much the same as 51b3529f6c but implemented for Android.
Now <Text> exposes the actual base-line offset value that allows Yoga to position it properly when `alignItems: baseline` is requested.

## Changelog
[Android][Fixed] - Fixed `alignItems: baseline` for <Text> elements on Android

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

Test Plan:
The same test case that we have for iOS.
Before:
<img width="487" alt="Screen Shot 2021-05-22 at 7 03 18 PM" src="https://user-images.githubusercontent.com/22032/119277516-d62b5100-bbe5-11eb-9141-3abe56e1a476.png">

After:
<img width="487" alt="Screen Shot 2021-05-22 at 7 01 51 PM" src="https://user-images.githubusercontent.com/22032/119277518-d75c7e00-bbe5-11eb-9139-4c6b5fcd9157.png">

Reviewed By: JoshuaGross

Differential Revision: D28631468

Pulled By: yungsters

fbshipit-source-id: 7c259e469d19d8344298319f066b8437dfdedad0
2021-08-26 21:46:37 -07:00
Genki Kondo a0d30b848a Remove unsupported values for android_hyphenationFrequency
Summary:
hyphenationStrategy must be one of one of Layout#HYPHENATION_FREQUENCY_NONE, Layout#HYPHENATION_FREQUENCY_NORMAL, Layout#HYPHENATION_FREQUENCY_FULL: (https://developer.android.com/reference/android/widget/TextView#setHyphenationFrequency(int))

Thus "high" and "balanced" are not only redundant, but actually don't do what the value indicates - Layout#BREAK_STRATEGY_BALANCED (constant value: 2) and Layout#BREAK_STRATEGY_HIGH_QUALITY (constant value: 1) are only meant to be used for android:breakStrategy

Changelog:
[Android][Changed] - Remove `"high"` and `"balanced"` as values for `android_hyphenationFrequency` on `Text`

Reviewed By: JoshuaGross

Differential Revision: D30531096

fbshipit-source-id: 1a0b6e733bb21ce6b2f104a2025a79c16de3cfea
2021-08-26 10:40:11 -07:00
Xuan Huang a8e2415a91 Type global queueMicrotask
Summary:
Changelog: [Internal]

This diff
- add `queueMicrotask` to eslint and metro so it's globally available.
- add `queueMicrotask` to the global libdef of react native so the type
  is available to `global.queueMicrotask` (which is common) as well.

Reviewed By: yungsters

Differential Revision: D30158144

fbshipit-source-id: 00a62193b838745c91179ff1e983636200560690
2021-08-26 01:06:44 -07:00
Luna Wei ad9030ca9a Include Swift lib in LIBRARY_SEARCH_PATHS
Summary:
changelog: Fix Xcode 13 build error in RNTester

Including `usr/lib/swift` fixes error:
{F642876047}

Reviewed By: fkgozali

Differential Revision: D30559838

fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329
2021-08-25 16:49:33 -07:00
Matthew Gray 2abacace54 Adding Accessibility Display Options Enabled to RNTester (#29231)
Summary:
Currently there isn't any way to test if the Accessibility Display Options or the event listeners for them were working properly within RNTester. It turns out that because of changes to the accessibility API Apple made when they added Smart Invert AccessibilityInfo.isInvertColorsEnabled() and the associated event listener are working incorrectly. You can see this if you take a look at how RNTester (with this PR incorporated) responds to toggling Invert Colors. I've submitted a bug report to Apple, but this might have been caught earlier if this had been implemented.

## Changelog

[General] [Added] - Adding Accessibility Display Options Enabled to RNTester

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

Test Plan:
1. Build iOS app
2. Navigate to the Accessibility page
3. Switch over to settings and change any of the settings at
  - Settings>Accessibility>Display and Text Size>Bold Text
  - Settings>Accessibility>Display and Text Size>Color Filters>Grayscale
  - Settings>Accessibility>Display and Text Size>Smart Invert (or Classic Invert)
  - Settings>Accessibility>Motion>Reduce Motion
  - Settings>Accessibility>VoiceOver>VoiceOver
4. Switch back to the app and see the results

![Simulator Screen Shot - iPhone 11 - 2020-06-26 at 21 13 16](https://user-images.githubusercontent.com/65255457/85914380-f09c5500-b7f1-11ea-98db-b83fb4ab5305.png)
![Simulator Screen Shot - iPhone 11 - 2020-06-26 at 21 13 39](https://user-images.githubusercontent.com/65255457/85914382-f2feaf00-b7f1-11ea-8ebf-cdb2b703c731.png)

Modified it a bit to only show relevant statuses for the Platform

| {F656951547} | {F656951643} |

Reviewed By: TheSavior

Differential Revision: D29531642

Pulled By: lunaleaps

fbshipit-source-id: f54fb3216ef663428c23b613f0a3b10b01d7f24d
2021-08-25 16:29:07 -07:00
Xuan Huang ee868091b1 Add instructions to test RNTester with Hermes on Android (#32085)
Summary:
Title said it all.

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

[Internal]

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

Reviewed By: TheSavior

Differential Revision: D30555218

Pulled By: Huxpro

fbshipit-source-id: 857ee81d4f402209bb2db2e1f4a2956d46ea3a54
2021-08-25 14:36:25 -07:00
Nick Gerleman 2550948ec6 Bump @react-native/polyfills version (#32074)
Summary:
https://github.com/facebook/react-native/commit/8a62583f794875e6dc5d1e4a24889b3b702d9f86 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one.

Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish.

## Changelog

[Internal][Fixed] - Bump react-native/polyfills version

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

Reviewed By: lunaleaps, cortinico

Differential Revision: D30498104

Pulled By: yungsters

fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86
2021-08-25 12:14:02 -07:00
pietro909 1d0fb08556 Fix typo and grammar (#31916)
Summary:
> Always leave the campground cleaner than you found it.

Fixing:
* typo in _dismissed_
* make the subject agree with the verb

## Changelog

[Internal] [Fixed] - A typo in a comment

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

Test Plan: Grammarly says it's better now.

Reviewed By: lunaleaps

Differential Revision: D29967403

Pulled By: yungsters

fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc
2021-08-22 22:51:29 -07:00
Chatura Atapattu 2c2b831716 Apply new buildifier fixes
Summary: Changelog: [Internal]

Reviewed By: zertosh

Differential Revision: D30407205

fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c
2021-08-19 20:01:02 -07:00
Jimmy Zhang f085e09be5 Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http
Reviewed By: lunaleaps

Differential Revision: D30218490

fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48
2021-08-19 10:28:49 -07:00
Moti Zilberman 8db946ade8 Pass configFile: false to Babel parser
Summary:
Changelog: [Internal]

Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config.

Reviewed By: javache

Differential Revision: D30396331

fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10
2021-08-19 07:03:41 -07:00
Carmi Grushko ec3a3df94f Enable ktfmt
Summary: Changelog: [internal]

Reviewed By: zertosh

Differential Revision: D30423755

fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9
2021-08-19 06:16:37 -07:00
Sota Ogo b29a78732d Emit soft error for warning
Summary:
This diff adds a default behavior for the unified logger on Android.

Added the call site in the CXXNativeModule.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30377767

fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536
2021-08-18 23:38:01 -07:00
Sota Ogo 3e0d77834a Move react_native_log out of utils (#32042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32042

This diff moves react_native_log out of utils to make it easier/possible to import from modules.
Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30411247

fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230
2021-08-18 20:14:47 -07:00
Paige Sun d3345f5720 JS: Fix "Modal | Basic" Test's Layout
Summary:
Fix the CSS on the main Modal test

Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning.

Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style.

Reviewed By: lunaleaps

Differential Revision: D30323087

fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49
2021-08-17 13:41:21 -07:00
Luna Wei f6d0f9deac Fix BorderExample for DynamicColorIOS
Summary:
Changelog:
[Internal] - Fix border example for RNTester

Reviewed By: charlesbdudley

Differential Revision: D30262957

fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60
2021-08-12 12:05:40 -07:00
Nicola Corti 1f8c5607b2 Flatten the react-native-codegen included build. (#32007)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32007

This Diff simplifies the codegen Gradle build.
Previously the build used to have a 2-level nesting of included build.

Turns out that the `react-native-codegen/android/build.gradle` build
is just providing a task and including an inner build that contains the codegen
Gradle plugin. I've moved such plugin to the outer build.

This will also make sure that the Gradle plugin files are properly index by the
IDE when opening the build (as nested included build are not yet supported).

Changelog:
Internal - Flatten the `react-native-codegen` Gradle included build

Reviewed By: fkgozali, ShikaSD

Differential Revision: D30227784

fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f
2021-08-12 05:14:58 -07:00