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

6575 Коммитов

Автор SHA1 Сообщение Дата
Nishan Bende d85d72d0d9 fix: TouchableNativeFeedback ripple starts on previous touch location (#31777)
Summary:
TouchableNativeFeedback's ripple starts from previous location on subsequent presses. This is similar to https://github.com/facebook/react-native/pull/31669

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

Issue

https://user-images.githubusercontent.com/23293248/123521731-1f375f00-d6d6-11eb-8e4c-fc5ffb322e67.mov

Fix

https://user-images.githubusercontent.com/23293248/123521735-2bbbb780-d6d6-11eb-88b2-be75342cf22a.mov

## 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] - TouchableNativeFeedback ripple starts on previous touch location.

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

Test Plan: Tested TouchableNativeFeedback examples in rn-tester app. Registering coordinates before pressed command fixes the issue.

Reviewed By: lunaleaps

Differential Revision: D29496515

Pulled By: kacieb

fbshipit-source-id: 77ac626181a61eee2cd30c4d48e52d10d800f2d8
2021-07-06 17:50:35 -07:00
Ruslan Serebriakov d5676f8370 CKComponentLayout
Summary:
fastmod --accept-all "CKComponentLayout" "RCLayout"
Changelog: [Internal]

## Changelog:

[Internal] - Renaming

Reviewed By: cuva

Differential Revision: D29228868

fbshipit-source-id: 2a5601eb7464e2cff3302781030c175e972f38bb
2021-07-01 09:04:46 -07:00
Joshua Gross afafbf8ec4 Log soft exception instead of crashing if ref is null on TextInput onPress
Summary:
See title.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D29410457

fbshipit-source-id: 0b9a9836baa0b5b7deb88cd73f4f634ca10c5868
2021-06-25 19:49:04 -07:00
Nick Gerleman 5cb2debbea Add "CellRenderMask" Region Tracking Structure (#31420)
Summary:
A CellRenderMask helps track regions of cells/spacers to render. It's API allows adding ranges of cells, where its otput be an ordered list of contiguous spacer/non-spacer ranges.

The implementation keeps this region list internally, splitting or merging regions when cells are added. This output will be used by the render function of a refactored VirtualizedList.

## 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] [Added] - Add "CellRenderMask" Region Tracking Structure

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

Test Plan: Validated via UTs.

Reviewed By: lunaleaps

Differential Revision: D28293161

Pulled By: rozele

fbshipit-source-id: a5e4e2144a90387aabe0974650429018440abf67
2021-06-24 07:57:01 -07:00
Tim Yung 123d184944 ImageSource: Convert `ImageURISource` to Interface
Summary:
Changes the `ImageURISource` Flow type into an interface.

- This enables both objects and class instances to be subtypes of `ImageURISource`.
- This makes it invalid to spread `ImageURISource` as a type, so `interface X extends ImageURISource` can instead be used.
- This makes it invalid to spread `ImageURISource` as a value, so `getImageSourceProperties(x)` can instead be used.
- This makes it invalid to use `$Exact` with `ImageURISource`.

Changelog:
[General][Changed] - `ImageURISource` Flow type is now an interface instead of an object.

Reviewed By: timrc

Differential Revision: D29323508

fbshipit-source-id: 647c2f9b0bfead6d7e56bdb7108e623cbf8b6c89
2021-06-23 13:15:02 -07:00
Peter Argany e83feffeba Back out "Avoid re-encoding images when uploading local files"
Summary:
This was causing an upload error in FB Dating, will need to re-land with the fix.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D29320144

fbshipit-source-id: 5d09dd2171b5696afe89cffa064947f0a0bb413d
2021-06-22 19:18:22 -07:00
Kacie Bawiec d4d22fbfb9 React Native sync for revisions c96b78e...568dc35
Summary:
This sync includes the following changes:
- **[43f4cc160](https://github.com/facebook/react/commit/43f4cc160 )**: Fix failing test ([#21697](https://github.com/facebook/react/pull/21697)) //<Dan Abramov>//
- **[d0f348dc1](https://github.com/facebook/react/commit/d0f348dc1 )**: Fix for failed Suspense layout semantics ([#21694](https://github.com/facebook/react/pull/21694)) //<Brian Vaughn>//
- **[bd0a96344](https://github.com/facebook/react/commit/bd0a96344 )**: Throw when `act` is used in production ([#21686](https://github.com/facebook/react/pull/21686)) //<Andrew Clark>//
- **[9343f8720](https://github.com/facebook/react/commit/9343f8720 )**: Use the server src files as entry points for the builds/tests ([#21683](https://github.com/facebook/react/pull/21683)) //<Sebastian Markbåge>//
- **[502f8a2a0](https://github.com/facebook/react/commit/502f8a2a0 )**: [Fizz/Flight] Don't use default args ([#21681](https://github.com/facebook/react/pull/21681)) //<Sebastian Markbåge>//
- **[a8f5e77b9](https://github.com/facebook/react/commit/a8f5e77b9 )**: Remove invokeGuardedCallback from commit phase ([#21666](https://github.com/facebook/react/pull/21666)) //<Dan Abramov>//
- **[dbe3363cc](https://github.com/facebook/react/commit/dbe3363cc )**: [Fizz] Implement Legacy renderToString and renderToNodeStream on top of Fizz ([#21276](https://github.com/facebook/react/pull/21276)) //<Sebastian Markbåge>//
- **[101ea9f55](https://github.com/facebook/react/commit/101ea9f55 )**: Set deletedTreeCleanUpLevel to 3 ([#21679](https://github.com/facebook/react/pull/21679)) //<Dan Abramov>//
- **[1a106bdc2](https://github.com/facebook/react/commit/1a106bdc2 )**: Wrap eventhandle-specific logic in a flag ([#21657](https://github.com/facebook/react/pull/21657)) //<Dan Abramov>//
- **[cb30388d1](https://github.com/facebook/react/commit/cb30388d1 )**: Export React Native `AttributeType` Types ([#21661](https://github.com/facebook/react/pull/21661)) //<Timothy Yung>//
- **[c1536795c](https://github.com/facebook/react/commit/c1536795c )**: Revert "Make enableSuspenseLayoutEffectSemantics static for www ([#21617](https://github.com/facebook/react/pull/21617))" ([#21656](https://github.com/facebook/react/pull/21656)) //<Sebastian Markbåge>//

Changelog:
[General][Changed] - React Native sync for revisions c96b78e...568dc35

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D29303157

fbshipit-source-id: 90952885eb2264f4effa04070357b80700bb9be3
2021-06-22 14:29:17 -07:00
Luna Wei fc9c326912 Use Animated.event implementation in AnimatedMock
Summary: Changelog: [Internal] - Animated.event from my limited understanding attaches Animated.Values to native views. In terms of animation, Animated.Values are already handled by AnimatedMock to skip interpolation.

Reviewed By: GijsWeterings

Differential Revision: D29241590

fbshipit-source-id: 98650883dad53d6f77dbc398ba0cac903194deca
2021-06-22 08:16:42 -07:00
David Vacca 7f117394af Refactor Image to log component stacktraces for images rendering non-fb sources
Summary:
This diff refactors the Image component in order to log the component hierarchy stacktraces for images rendering non-fb sources

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D29266451

fbshipit-source-id: 826230b1a18a5809b340ef0767d80a281e20477a
2021-06-21 20:29:27 -07:00
Luna Wei ad0ccac0d6 Remove Picker from OSS
Summary:
Changelog:
[General][Removed] - Remove Picker/PickerIOS export from react-native and delete JS related code

Reviewed By: kacieb

Differential Revision: D29122947

fbshipit-source-id: 9f754396d1f221fde57ec4dec8e29af598432102
2021-06-21 15:19:09 -07:00
David Vacca 14ca57b435 Log ImageSource uris that are not using Facebook domain
Summary:
This diff adds logging to uncover what are the ReactNative screens that are rendering images using NON-Facebook domains

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D29179990

fbshipit-source-id: 85f6380848d1ac1461419bc29c4666be389fb87a
2021-06-17 15:11:06 -07:00
Tim Yung 765d1e247b RN: Change `ImageURISource` to Object Type
Summary:
Changes `ImageURISource` back to an object type.

It was changed to an interface by D27193522 (05418f8fcc), but that is not the right direction for this type.

Changelog:
[Internal] - There was no changelog entry for this initially, so the revert can also be omitted.

Reviewed By: lunaleaps

Differential Revision: D29205798

fbshipit-source-id: 727ef70bbf47d14b163ecf5d6f31184da51c894a
2021-06-17 13:51:41 -07:00
Ramanpreet Nara 8a677face4 Add NOBRIDGE prefix to Venice Metro logs
Summary:
## Context
In dev mode, Metro hijacks the JavaScript `console`, and prints all logs into the terminal running the Metro server.

## Problem
We have no way to distinguish between Bridge mode and Bridgeless mode logs. This makes it hard to tell catch warnings and errors are coming from bridgeless mode.

## Changes
- This diff adds a "NOBRIDGE" prefix to all React Native Metro logs coming from Bridgeless mode.
- Bridge mode console logs/warnings/errors are **unaffected**.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D29152292

fbshipit-source-id: 257b8140327cfd7a0a10aa229bcb88117231e452
2021-06-16 12:45:08 -07:00
Peter Argany c3dffe059b Fix native module lookup followup from D28630805
Summary:
In D28630805 (f78526ce3d) ([github link](https://github.com/facebook/react-native/pull/31457)) I added a setter to workaround a bug I perceived with `moduleRegistry`. Turns out - the proper fix was to remove the `synthesize` line. See conversation on linked diff for more context.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D29144717

fbshipit-source-id: aa95b670b540b9007eed76769c9babc10ea399ce
2021-06-15 18:50:08 -07:00
Arthur Lee f78526ce3d Avoid re-encoding images when uploading local files (#31457)
Summary:
Fixes https://github.com/facebook/react-native/issues/27099

When you upload a local file using XHR + the `FormData` API, RN uses `RCTNetworkTask` to retrieve the image file data from the local filesystem (request URL is a file:// URL) ([code pointer](https://github.com/facebook/react-native/blob/master/Libraries/Network/RCTNetworking.mm#L398)). As a result, if you are uploading a local image file that is in the app's directory `RCTNetworkTask` will end up using `RCTLocalAssetImageLoader` to load the image, which reads the image into a `UIImage` and then re-encodes it using `UIImageJPEGRepresentation` with a compression quality of 1.0, which is the higest ([code pointer](4c5182c1cc/Libraries/Image/RCTImageLoader.mm (L1114))). Not only is this unnecessary, it ends up inflating the size of the jpg if it had been previously compressed to a lower quality.

With this PR, this issue is fixed by forcing the `RCTFileRequestHandler` to be used when retrieving local files for upload, regardless of whether they are images or not. As a result, any file to be uploaded gets read into `NSData` which is the format needed when appending to the multipart body.
I considered fixing this by modifying the behavior of how the handlers were chosen, but this felt like a safer fix since it will be scoped to just uploads and wont affect image fetching.

## Changelog

[iOS] [Fixed] - Avoid re-encoding images when uploading local files

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

Test Plan:
The repro for this is a bit troublesome, especially because this issue doesn't repro in RNTester. There is [some code](https://github.com/facebook/react-native/blob/master/packages/rn-tester/RNTester/AppDelegate.mm#L220) that is to be overriding the handlers that will be used, excluding the `RCTImageLoader`. I had to repro this in a fresh new RN app.

1. Create a blank RN app
2. Put an image in the folder of the app's install location. This would be similar to where files might be placed after an app downloads or captures an image.
3. Set up a quick express server that accepts multipart form uploads and stores the files
4. Trigger an upload via react native
```
const data = new FormData();
data.append('image', {
  uri:
    '/Users/arthur.lee/Library/Developer/CoreSimulator/Devices/46CDD981 (d0c8cb12f2)-9164-4925-9025-1A76C0D9 (1946aee3d9)F0F5/data/Containers/Bundle/Application/B1E8A764-6221-4EA9-BE9A-2CB1699FD218 (1c92b1cff6)/test.app/test.bundle/compressed.jpg',
  type: 'image/jpeg',
  name: 'image.jpeg',
});

fetch(`http://localhost:3000/upload`, {
  method: 'POST',
  headers: {'Content-Type': 'multipart/form-data'},
  body: data,
}).then(console.log);
```
5. Trigger the upload with and without this patch

Original file:
```
$ ls -lh
total 448
-rw-r--r--  1 arthur.lee  staff   223K Apr 29 17:08 compressed.jpg
```

Uploaded file (with and without patch):
```
$ ls -lh
total 1624
-rw-r--r--@ 1 arthur.lee  staff   584K Apr 29 17:11 image-nopatch.jpeg
-rw-r--r--@ 1 arthur.lee  staff   223K Apr 29 17:20 image-withpatch.jpeg
```

Would appreciate pointers on whether this needs to be tested more extensively

Reviewed By: yungsters

Differential Revision: D28630805

Pulled By: PeteTheHeat

fbshipit-source-id: 606a6091fa3e817966548c5eb84b19cb8b9abb1c
2021-06-14 22:52:58 -07:00
Martin Sherburn e539e7d0be Fix bug in parseHermesStack.js
Summary:
If function name is an empty string then it would fail to parse the line. And not only that, it would cause the entire stack to be lost. This fixes the issue by replacing `.+?` with `.*?`.

For example this line fails to parse:
```
    at global (:2:4)
```

Changelog:
[General][Fixed] - Fixed bug parsing hermes call stacks when the file name is empty

Reviewed By: yungsters

Differential Revision: D29063192

fbshipit-source-id: 604e457af51f852fe547e6424283631ae148897d
2021-06-14 02:57:37 -07:00
Tim Yung ed76d4d8db RN: Statically Define `ReactNativeStyleAttributes`
Summary:
Rewrites `ReactNativeStyleAttributes` so that it is statically defined.

This means it will no longer require a handful of modules that defines `prop-types` only to use their keys.

Functionally, this should be equivalent to what was there before.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D29019308

fbshipit-source-id: 47f85a8c7703a133c68c20c7f3e14e1026ce4ff2
2021-06-11 23:52:09 -07:00
Tim Yung 33b385825c RN: Simplify `ReactNativeStyleAttributes` Type
Summary:
Simplifies the Flow type for `ReactNativeStyleAttributes`, an internal module.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D29019311

fbshipit-source-id: cf95dac4b8c2261812cc1d753255dfb905540759
2021-06-11 23:52:09 -07:00
Tim Yung 2e8c0bd7ea RN: Delete `StyleSheetValidation`
Summary:
Deletes `StyleSheetValidation` because it is `prop-types` in disguise.

Changelog:
[General][Removed] - `StyleSheet.create` will no longer do DEV-time validation.

Reviewed By: TheSavior

Differential Revision: D29019310

fbshipit-source-id: bfe886d8dc09a1aa8dac4a73bfd62f481e3eb9e9
2021-06-11 23:52:09 -07:00
Tim Yung 052b3e3faa RN: Cleanup `DeprecatedTextInputPropTypes`
Summary:
Removes the unnecessary dependency from `DeprecatedTextInputPropTypes` on `Text`. Just use `DeprecatedTextPropTypes` directly.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D29017596

fbshipit-source-id: b816c2261bf473e02473d84984cfb3d5a63ec8c1
2021-06-11 23:52:09 -07:00
Tim Yung efefae92ca RN: Move `{ => Deprecated}ImageProp{s => Types}` (Android)
Summary:
Moves `ImagePropTypes` out of `Image.android.js` in preparation for some cleanup.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D29017076

fbshipit-source-id: e7d3d6533f69dc2c54e7c25e215648d7c7ff1840
2021-06-11 23:52:09 -07:00
Daniel Sainati 974f0a3281 pre-suppress this typing errors ahead of 154
Summary:
This pre-suppresses the 154 error diff ahead of its release, since it is large.

Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D29065246

fbshipit-source-id: f418041305a46df410dcbe3d9a4db81a61ac7014
2021-06-11 14:31:41 -07:00
Samuel Susla 2a6df5b375 Pass concurrentRoot flag through to renderApplication
Summary:
Changelog: [internal]

Pass concurrentRoot flag to renderApplication.

Reviewed By: rubennorte

Differential Revision: D28630516

fbshipit-source-id: 959b9c684a8736a28a86d42699a78c96da859224
2021-06-11 04:23:50 -07:00
Samuel Susla e31e2cc318 React Native sync for revisions 0eea577...c96b78e
Summary:
This sync includes the following changes:
- **[c96b78e0e](https://github.com/facebook/react/commit/c96b78e0e )**: Add concurrentRoot property to ReactNativeTypes ([#21648](https://github.com/facebook/react/pull/21648)) //<Samuel Susla>//
- **[1a3f1afbd](https://github.com/facebook/react/commit/1a3f1afbd )**: [React Native] Fabric get current event priority ([#21553](https://github.com/facebook/react/pull/21553)) //<Samuel Susla>//
- **[48a11a3ef](https://github.com/facebook/react/commit/48a11a3ef )**: Update next React version ([#21647](https://github.com/facebook/react/pull/21647)) //<Andrew Clark>//
- **[5aa0c5671](https://github.com/facebook/react/commit/5aa0c5671 )**: Fix Issue with Undefined Lazy Imports By Refactoring Lazy Initialization Order ([#21642](https://github.com/facebook/react/pull/21642)) //<Sebastian Markbåge>//

Changelog:
[General][Changed] - React Native sync for revisions 0eea577...c96b78e

jest_e2e[run_all_tests]

Reviewed By: bvaughn

Differential Revision: D29029542

fbshipit-source-id: 9f2e19b4714b5697b5b846f2db8eb28c25420932
2021-06-11 02:09:02 -07:00
Kacie Bawiec 6e2989a7b3 Update Image.[android|ios].js to use import from instead of require
Summary:
As title

Changelog:
[General][Changed] Update Image.[android|ios].js to use import from instead of require

Reviewed By: TheSavior, yungsters

Differential Revision: D29003824

fbshipit-source-id: 0f98c730b1bd9cb581d2fcf6f4c0e911bb8c24b5
2021-06-10 17:12:06 -07:00
Luna Wei fc587c9e98 Back out "Back out "[react-native][PR] remove defaultProps from picker of components""
Summary:
Changelog:
[Internal] - Remove defaultProps from Picker

Reviewed By: TheSavior

Differential Revision: D28941586

fbshipit-source-id: ca9efef597936badfd5c2920028ebd11dc7422a0
2021-06-09 10:34:50 -07:00
Luna Wei 0aa8e25deb Switch: useMergeRef for forwarding ref
Summary:
Changelog:
[Internal] - Replace `useImperativeHandle` usage with new `useMergeRef` which will keep both the forwarded and internal ref handle up to date (in case the instance ever changes). That being said, this change was not motivated in fear of a stale ref but more an intention to show that `useImperativeHandle`'s use case is more about creating a selective API and `useMergeRef` is better suited for publishing ref updates.

Reviewed By: yungsters

Differential Revision: D28950632

fbshipit-source-id: 594afda02693545aab77f24566180c338b58bb8b
2021-06-09 10:12:53 -07:00
Nishan Bende 961b00d8c0 Pressable ripple should pick press event coordinates on subsequent press. (#31669)
Summary:
Please watch the recording below for better explanation. Ripple effect starts from previous press event's coordinates on subsequent presses.

https://user-images.githubusercontent.com/23293248/120929850-51bdef80-c708-11eb-906c-d711672370ee.mov

## Changelog

[Android] [Fixed] - Pressable ripple subsequent press coordinates.

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

Test Plan:
- Tested all Pressable examples. Registering coordinates before press seems to fix the issue.

https://user-images.githubusercontent.com/23293248/120929905-892c9c00-c708-11eb-9e63-576ae800733c.mov

Reviewed By: yungsters

Differential Revision: D28966505

Pulled By: kacieb

fbshipit-source-id: b745180065611390e1897692a0bdea7d6e022cdd
2021-06-08 15:28:22 -07:00
Birkir Gudjonsson 4b9d9dda27 Accessible colors for DynamicColorIOS (#31651)
Summary:
Allow you to harvest the `UIAccessibilityContrastHigh` trait from iOS to show accessible colors when high contrast mode is enabled.

```jsx
// usage

PlatformColorIOS({
  light: '#eeeeee',
  dark: '#333333',
  highContrastLight: '#ffffff',
  highContrastDark: '#000000',
});

// {
//   "dynamic": {
//     "light": "#eeeeee",
//     "dark": "#333333",
//     "highContrastLight": "#ffffff",
//     "highContrastDark": "#000000",
//   }
// }
```

This is how apple's own dynamic system colors work under the hood (https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/#dynamic-system-colors)

 ---

The react native docs mention that more keys may become available in the future, which this PR is adding:

> In the future, more keys might become available for different user preferences, like high contrast.

https://reactnative.dev/docs/dynamiccolorios

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

[iOS] [Added] - High contrast dynamic color options for dark and light mode.

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

Test Plan: Added unit tests for `normalizeColor` to pass the high contrast colors downstream to RCTConvert

Reviewed By: lunaleaps

Differential Revision: D28922536

Pulled By: p-sun

fbshipit-source-id: f81417f003c3adefac50e994e62b9be14ffa91a1
2021-06-08 11:51:23 -07:00
Nishan Bende 0823f299e5 Foreground ripple support in Pressable (#31632)
Summary:
This PR aims to enable support for foreground ripple in Pressable. This makes it possible to show ripple on top of custom child components like Image as shown in the below example.

## 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] [Added] - Support for foreground ripple in Pressable

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

Test Plan:
- Pass property useForeground: true in android_ripple config to verify the changes.

https://user-images.githubusercontent.com/23293248/120111371-4cecbf00-c18f-11eb-8acb-d10718d5483c.mov

Reviewed By: kacieb

Differential Revision: D28926493

Pulled By: yungsters

fbshipit-source-id: 12a6ba71a7dc6ed60fbaeb651f015cace38e03b1
2021-06-07 17:07:58 -07:00
Andrei Shikov a403e76177 React Native sync for revisions 2d8d133...0eea577
Summary:
- **[0eea57724](https://github.com/facebook/react/commit/0eea57724 )**: Fix typo in comment (accumlated → accumulated) ([#21637](https://github.com/facebook/react/pull/21637)) //<ithinker5>//
- **[0706162ba](https://github.com/facebook/react/commit/0706162ba )**: Fix typo in comment (environement → environment) ([#21635](https://github.com/facebook/react/pull/21635)) //<niexq>//
- **[9d17b562b](https://github.com/facebook/react/commit/9d17b562b )**: Fix typo in comment (satsify → satisfy) ([#21629](https://github.com/facebook/react/pull/21629)) //<niexq>//
- **[b610fec00](https://github.com/facebook/react/commit/b610fec00 )**: fix comments: expiration time -> lanes ([#21551](https://github.com/facebook/react/pull/21551)) //<Shannon Feng>//
- **[cc4d24ab0](https://github.com/facebook/react/commit/cc4d24ab0 )**: [Fizz] Always call flush() if it exists ([#21625](https://github.com/facebook/react/pull/21625)) //<Dan Abramov>//
- **[e0d9b2899](https://github.com/facebook/react/commit/e0d9b2899 )**: [Fizz] Minor Fixes for Warning Parity ([#21618](https://github.com/facebook/react/pull/21618)) //<Sebastian Markbåge>//
- **[1b7b3592f](https://github.com/facebook/react/commit/1b7b3592f )**: [Fizz] Implement Component Stacks in DEV for warnings ([#21610](https://github.com/facebook/react/pull/21610)) //<Sebastian Markbåge>//
- **[39f007489](https://github.com/facebook/react/commit/39f007489 )**: Make enableSuspenseLayoutEffectSemantics static for www ([#21617](https://github.com/facebook/react/pull/21617)) //<Brian Vaughn>//
- **[8f3794276](https://github.com/facebook/react/commit/8f3794276 )**: Prepare semver (`latest`) releases in CI ([#21615](https://github.com/facebook/react/pull/21615)) //<Andrew Clark>//
- **[8b4201535](https://github.com/facebook/react/commit/8b4201535 )**: Devtools: add feature to trigger an error boundary ([#21583](https://github.com/facebook/react/pull/21583)) //<Bao Pham>//
- **[154a8cf32](https://github.com/facebook/react/commit/154a8cf32 )**: Fix reference to wrong variable //<Andrew Clark>//
- **[6736a38b9](https://github.com/facebook/react/commit/6736a38b9 )**: Add single source of truth for package versions ([#21608](https://github.com/facebook/react/pull/21608)) //<Andrew Clark>//
- **[86715efa2](https://github.com/facebook/react/commit/86715efa2 )**: Resolve the true entry point during tests ([#21505](https://github.com/facebook/react/pull/21505)) //<Sebastian Markbåge>//
- **[a8a4742f1](https://github.com/facebook/react/commit/a8a4742f1 )**: Convert ES6/TypeScript/CoffeeScript Tests to createRoot + act ([#21598](https://github.com/facebook/react/pull/21598)) //<Sebastian Markbåge>//
- **[1d3558965](https://github.com/facebook/react/commit/1d3558965 )**: Disable deferRenderPhaseUpdateToNextBatch by default ([#21605](https://github.com/facebook/react/pull/21605)) //<Sebastian Markbåge>//
- **[a8964649b](https://github.com/facebook/react/commit/a8964649b )**: Delete an unused field ([#21415](https://github.com/facebook/react/pull/21415)) //<okmttdhr>//
- **[76f85b3e5](https://github.com/facebook/react/commit/76f85b3e5 )**: Expose Fizz in stable builds ([#21602](https://github.com/facebook/react/pull/21602)) //<Dan Abramov>//
- **[e16d61c30](https://github.com/facebook/react/commit/e16d61c30 )**: [Offscreen] Mount/unmount layout effects ([#21386](https://github.com/facebook/react/pull/21386)) //<Andrew Clark>//
- **[63091939b](https://github.com/facebook/react/commit/63091939b )**: OSS feature flag updates ([#21597](https://github.com/facebook/react/pull/21597)) //<Brian Vaughn>//
- **[efbd69b27](https://github.com/facebook/react/commit/efbd69b27 )**:  Define global __WWW__ = true flag during www tests ([#21504](https://github.com/facebook/react/pull/21504)) //<Sebastian Markbåge>//
- **[28625c6f4](https://github.com/facebook/react/commit/28625c6f4 )**: Disable strict effects for legacy roots (again) ([#21591](https://github.com/facebook/react/pull/21591)) //<Brian Vaughn>//
- **[3c2341416](https://github.com/facebook/react/commit/3c2341416 )**: Update jest to v26 ([#21574](https://github.com/facebook/react/pull/21574)) //<Sebastian Silbermann>//
- **[0d493dcda](https://github.com/facebook/react/commit/0d493dcda )**: Removed _debugID field from Fiber - Issue #21558 ([#21570](https://github.com/facebook/react/pull/21570)) //<Pulkit Sharma>//
- **[7841d0695](https://github.com/facebook/react/commit/7841d0695 )**: Enable the updater-tracking feature flag in more builds ([#21567](https://github.com/facebook/react/pull/21567)) //<Brian Vaughn>//
- **[6405efc36](https://github.com/facebook/react/commit/6405efc36 )**: Enabled Profiling feature flags for OSS release ([#21565](https://github.com/facebook/react/pull/21565)) //<Brian Vaughn>//

Changelog:
[General][Changed] - React Native sync for revisions 2d8d133...0eea577

jest_e2e[run_all_tests]

Reviewed By: bvaughn

Differential Revision: D28932083

fbshipit-source-id: 012c1bfb857ed59d7283334d633f1cce8ec50360
2021-06-07 11:42:50 -07:00
Tim Yung c774f9e97e Animated: Support Concurrent Rendering
Summary:
Creates a `useAnimatedProps` hook that is compatible with concurrent mode, and uses this in `createAnimatedComponent_EXPERIMENTAL`.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D28390393

fbshipit-source-id: d8aa471507a5d096832b93caf63a24f71733deda
2021-06-06 17:08:55 -07:00
Tim Yung cb25638a0e RN: Create `useRefEffect` Utility
Summary:
Creates `useRefEffect` which will be used by components in React Native.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D28862440

fbshipit-source-id: 50e0099c1a3e0a0f506bf82e68984fc5a032f101
2021-06-06 17:08:55 -07:00
Tim Yung 0b994ac19c RN: Create `useMergeRefs` Utility
Summary:
Creates `useMergeRefs` which will be used by components in React Native.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D28862439

fbshipit-source-id: 60eac7bcd6cceb06ee82181386b4712d642f5404
2021-06-06 17:08:55 -07:00
Andrei Shikov 29bc96135b Back out "remove defaultProps from picker of components"
Summary:
Reverts changes that were causing insta crashes on Android surfaces.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D28924291

fbshipit-source-id: eebaf9d28b40e4bb4168af1ceafd5ee29935c81c
2021-06-06 11:10:50 -07:00
Kermit b4cde15cdb remove defaultProps from picker of components (#31644)
Summary:
Remove `defaultProps` from `Picker` of components, replace it with destructuring assignment.

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

[JavaScript] [Changed] - Remove defaultProps from picker

close https://github.com/facebook/react-native/issues/31603

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

Test Plan: all test suite and CI passes.

Reviewed By: TheSavior

Differential Revision: D28886320

Pulled By: lunaleaps

fbshipit-source-id: d88a922dffeebe2bce019250d460b5e43a0af562
2021-06-04 21:00:17 -07:00
Shuhao Zhang f3b8d4976f Bug fix: <TextInput> content is reset when emoji is entered at the max length
Summary:
When maxLength is defined in <TextInput>, if the last character at max length is an emoji, the content of the input is cleared:

{F620865178} {F620865237}

Related Github issues:

https://github.com/facebook/react-native/issues/10929
https://github.com/facebook/react-native/issues/10964

## Root cause:

When NSString was created, unicode characters were 16-bit long, so Objective-C considers every unicode character as 16-bit. However, unicode was later extended to more than 16bit, for example, emojis, which causes NSString substring method cuts off at the wrong position.

Example:

```
NSString *s = @"abc{emoji:1f601}";
NSInteger len = s.length; //length is 5 (as {emoji:1f601} occupies two 16-bit characters)
NSString *s3 = [s substringToIndex: 3]; //s3 is "abc"
NSString *s4 = [s substringToIndex: 4]; //s4 is null!
```

If string s, "abc{emoji:1f601}", is entered in <TextInput>, which has max length 4, it will truncate the string to the first 4 characters, "cutting" the emoji in half which causes encoding error and returns null. The text input is cleared.

## Solution:

If the character at max length is longer than 16-bit, truncate the character BEFORE it instead. In the previous example, truncate till index 3 instead of 4. The end result will be "abc" and the emoji is dropped.

## Changelog:

[iOS] [Fixed] - <TextInput> content is reset when emoji is entered at the max length

Reviewed By: p-sun

Differential Revision: D28821909

fbshipit-source-id: 4720d864970b554160ed5388f65b352ce95a6199
2021-06-04 13:40:42 -07:00
Nick Gerleman 41f145fa47 Add testID to NewAppScreen Header Component (#31652)
Summary:
The RN OSS release process includes manual testing that a new template app can be started under various platforms, JS engines, etc. This should ideally be automated, to help reduce wasted engineer-time, and to allow reliably increasing release velocity.

`react-native-windows` does already have tests to create and build template projects across our matrix, but they do not do any runtime validation on the newly created app. Adding a `testID` to the new app screen header gives us something to search for in black-box testing to validate that the app started successfully. This should help catch cases where a sample project in repo has changes not reflected in a newly created template app.

## 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] [Added] - Add testID to NewAppScreen Header Component

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

Test Plan: Did not manually validate the change, though did check that `ImageBackground` forwards props to `Image`, and that `Image` is aware of `testID` and will forward to the native component.

Reviewed By: kacieb

Differential Revision: D28907197

Pulled By: p-sun

fbshipit-source-id: db3974294afba25878383f1955cad37b69d95da3
2021-06-04 13:14:48 -07:00
Rubén Norte 249b8d21c4 Fix inline requires for ESM in react-native-github
Summary:
This fixes how ES modules are handled in Jest tests in the react-native codebase.

They caused some problems before because `import` statements weren't inlined as `require` calls were, so there were some errors in tests when migrating from CommonJS to ESM.

This changes the transform that Jest uses to inline import statements the same way, so we can migrate everything without issues in tests.

Changelog: [Internal]

Reviewed By: kacieb

Differential Revision: D28899692

fbshipit-source-id: 027690f57ca3b5613c261a1089c0635af76662b2
2021-06-04 13:05:11 -07:00
Kacie Bawiec 7f3f868020 Convert KeyboardAvoidingView to use export default
Summary:
Changelog:
[General][Changed] Convert KeyboardAvoidingView to use export default

Reviewed By: TheSavior

Differential Revision: D28884111

fbshipit-source-id: e2d144505536362b405b833c9ebad530f6dcacb5
2021-06-04 12:56:17 -07:00
Tim Yung 819b926beb Animated: Create Experimental Stub
Summary:
Creates an experimental stub implementation of `createAnimatedComponent` to be implemented in future commits.

Changelog:
[Internal]

Reviewed By: lunaleaps, kacieb

Differential Revision: D28799738

fbshipit-source-id: dc3fbee557db353de6807bd87561f8f372d7cab5
2021-06-02 22:36:13 -07:00
Tim Yung 8ccc4064c5 Animated: Setup Experiment Injection
Summary:
Sets up an injection mechanism for experimenting in production with an alternate implementation of `createAnimatedComponent`.

This will be used to implement and refine a new `createAnimatedComponent` that is compatible with concurrent rendering.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D28799739

fbshipit-source-id: 46ba2dd6137f7bf73ce8a659698533ed3985516f
2021-06-02 22:36:13 -07:00
Håkon Knutzen 58444c74f5 Custom NSURLSession configuration (#27701)
Summary:
While it is possible in the React Native implementation for Android to provide a custom configuration for HTTP requests, the iOS implementation does not allow for the same customization. As the NSURLSession used for HTTP requests on iOS is configured internally, one may for instance not supply an ephemeral configuration for HTTP requests. Other concerns related to the given problem have been addressed in the community: https://github.com/react-native-community/discussions-and-proposals/issues/166. I did make a PR with an RFC in the community repo, but after some discussion in the said repo, I figured I might as well make a PR with a suggestion :)

## Changelog

[iOS] [Added] - Allow for configuring the NSURLSessionConfiguration

Implement a C function `RCTSetCustomNSURLSessionConfigurationProvider` which gives the app programmer the ability to provide a block which provides an NSURLSessionConfiguration that will be used for all HTTP requests instead of the default configuration. The provided block will be called when the session configuration is needed.

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

Test Plan: Unsure if this can be tested in any other way than uncommenting the example code in `RNTester/RNTester/AppDelegate.mm`.

Reviewed By: yungsters

Differential Revision: D28680384

Pulled By: JoshuaGross

fbshipit-source-id: ae24399955581a1cc9f4202f0f6f497bfe067a5c
2021-06-02 18:39:52 -07:00
Janic Duplessis 1538fa4455 Fix Switch ref forwarding (#31629)
Summary:
Since moving Switch to a function component it is no longer possible to get the native switch ref. This adds forwardRef so it is possible again.

## Changelog

[General] [Fixed] - Fix Switch ref forwarding

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

Test Plan: Tested the change in an app using react-native-gesture-handler, which tries to set a ref on Switch. Also made sure flow still passes.

Reviewed By: TheSavior

Differential Revision: D28839605

Pulled By: lunaleaps

fbshipit-source-id: 1fee86145caeabb60c0010bb9062dddca419f7ca
2021-06-02 14:44:52 -07:00
Tim Yung 249435c4d5 RN: Cleanup `collapsable` Experiment (iOS)
Summary:
With the conclusion of D27944688 (925af8ddea), this backs out the experiment introduced via D27987619 (f598dd0ee3).

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D28799741

fbshipit-source-id: 607ee85db26326e13dd8ddb52f5aebb732e9a354
2021-06-02 09:43:41 -07:00
Tim Yung e4a4c4d6d7 ExceptionsManager: Report Fatal "Warnings"
Summary:
As suggested by motiz88 on D28421692 (883e0d5752), make sure to still report fatal "warnings".

Changelog:
[General][Fixed] Report fatal errors even if its `type` is "warn".

Reviewed By: motiz88

Differential Revision: D28815228

fbshipit-source-id: 8d3b77958ef687a4ce64bdfccbf6ce2dc5557eaf
2021-06-02 01:31:50 -07:00
Tim Yung b85572af6e RN: Cleanup `TextInjection`
Summary:
Deletes `TextInjection` which is no longer needed.

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D28799740

fbshipit-source-id: 5dfbff23db3f73153aa0c3df25fec5acfb4977e4
2021-06-01 15:29:59 -07:00
Daniel Sainati 74d5d03dbd pre-suppress Flow errors in xplat ahead of 153 release
Summary:
This pre-suppresses the 153 error diff ahead of its release, since it is large.

Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D28754374

fbshipit-source-id: 1806f53bc7d804644d434583a2dcd6da63d00328
2021-06-01 09:01:26 -07:00
Paige Sun 8a5ee96354 Remove log info when TurboModule cannot be found
Summary: Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D28749474

fbshipit-source-id: 28079904023f23e88b4f5bca45d7e600171e929e
2021-05-27 10:42:34 -07:00
Dennis Urtubia 44717152ca Adds accessiblity actions on core components (#31532)
Summary:
Android: Adding custom actions (https://github.com/facebook/react-native/issues/30854).
Adds accessiblity actions on core components (Button, TextInput, Text, and Picker).

## Changelog
[General] [Added] - Adds accessiblity actions on core components

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

Test Plan:
- `npm test`
- Rendering of components on `RNTesterApp` using talkback:
    - Check if accessibility actions were available;
    ![image](https://user-images.githubusercontent.com/33161939/118381843-a668c180-b5c5-11eb-9ce4-016a49157dc5.png)
    - Trigger `activate` action for all components;
    ![image](https://user-images.githubusercontent.com/33161939/118381736-7bca3900-b5c4-11eb-82fb-32e824e1b38c.png)

## Notes
- For `TextInput` an unexpected error is raised:
![image](https://user-images.githubusercontent.com/33161939/118381603-d1054b00-b5c2-11eb-93f2-1d5730ee2d24.png)

Reviewed By: kacieb

Differential Revision: D28654294

Pulled By: lunaleaps

fbshipit-source-id: 80dd3f3c7aa27bbaf16ef12997e8f55952a02eb2
2021-05-26 16:49:11 -07:00