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

23990 Коммитов

Автор SHA1 Сообщение Дата
David Vacca 34dcbfb8d9 Ship ReactFeatureFlags.enableScrollViewSnapToAlignmentProp
Summary:
This diff ships ReactFeatureFlags.enableScrollViewSnapToAlignmentProp, QE showed neutral metrics in fb4a

changelog: [internal] internal

Reviewed By: philIip

Differential Revision: D33781627

fbshipit-source-id: d4e52d8bdf1acb4904e92f13b7d721582d140ba3
2022-01-27 17:03:26 -08:00
David Vacca 11b7443afb Delete ReactFeatureFlags.enableReactContextCleanupFix
Summary:
This diff deletes the flag ReactFeatureFlags.enableReactContextCleanupFix, the flag was disabled for many months, I just disable it.

changelog: [internal] internal

Reviewed By: genkikondo, makovkastar

Differential Revision: D33781628

fbshipit-source-id: 4b5e22adf9d30da5b85bbbde8bdc98d98f5e8891
2022-01-27 17:03:26 -08:00
David Vacca 9abcea7e11 Delete enableFabricInLogBox flag
Summary:
This diff deletes the ReactFeatureFlag enableFabricInLogBox, from now on Logbox will be rendered in Fabric when Fabric is enabled

changelog: [internal] internal

Reviewed By: genkikondo

Differential Revision: D33781626

fbshipit-source-id: 3187a22fec80125afd27860995637564640dab8d
2022-01-27 17:03:25 -08:00
Genki Kondo ea90a76efe Initial non-native implementation of AnimatedColor
Summary:
Creates Animated.Color for animating color props.

Implement AnimatedColor, which basically consists of 4 AnimatedValues (along the same vein as ValueXY) which allows us to just use AnimatedValue's interpolation. Provides a string color value of shape 'rgba(r, g, b, a)'

AnimationNode DAG looks like:

{F696076974}

Followup changes will include support for string color values, platform colors, and native driver.

Changelog:
[General][Added] - New Animated.Color node

Reviewed By: mdvacca

Differential Revision: D33778456

fbshipit-source-id: 83ddbc955156bf589c864f229a5f83fe6875fd0e
2022-01-27 13:37:59 -08:00
Pieter De Baets 20b9ed91c0 Remove FBREMAP experiment
Summary:
The flag was removed in https://www.internalfb.com/diff/D28467996 (2c5f68df46) but the code was not removed yet.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D33792884

fbshipit-source-id: 0ae5d904ca2ca94437ca63b495d41e47585fde33
2022-01-27 12:02:19 -08:00
Xin Chen 67355f6c74 Update PointerEvents static method to reduce duplication
Summary:
This diff updated `PointerEvents` enum to reduce duplication for null checks on pointer events string.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D33717223

fbshipit-source-id: ff542a05240393416d85651ca08cd55136eb79a4
2022-01-27 11:17:55 -08:00
owjsub d6db5c5464 Android: upgrading OkHttp from 4.9.1 to 4.9.2 to fix CVE-2021-0341 (#32968)
Summary:
Security vulnerability CVE-2021-0341 is present in okhttp 4.9.1. Upgrading to 4.9.2 will resolve the issue.

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-0341

## Changelog

[Android] [Security] - Upgraded okhttp to 4.9.2 to fix CVE-2021-0341

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

Test Plan: Upgrading okhttp 4.9.1 to 4.9.2 should be backwards compatible per https://github.com/square/okhttp/blob/master/CHANGELOG.md#version-492. Should be safe to merge if CircleCI tests pass.

Reviewed By: ShikaSD

Differential Revision: D33788131

Pulled By: cortinico

fbshipit-source-id: e9593a42a8e40a903ee6f529d94c82adcf5d0977
2022-01-27 07:23:03 -08:00
Dmytro Voronkevych 12a67425ab Adding string annotations to markEvent
Summary:
Adding string annotations support to markEvent API in ReactNative

Changelog:
[Internal][Change] - markEvent API now supports string annotations

Differential Revision: D33795346

fbshipit-source-id: 414cbd08ce5ff6045e2f35ae77059be5add3d834
2022-01-27 04:47:33 -08:00
Dmytro Voronkevych 0e39b95a45 Adding markEvent to the ReactNative QPL
Summary:
QPL in ReactNative were missing markEvent API - adding it in this diff. In the next diff I will add support for annotations.

Customer request: https://fb.workplace.com/groups/QPL.QandA/posts/1228789167531266/

Changelog:
[Internal][Change] - Adding markEvent API to QuickPerformanceLogger

Differential Revision: D33789590

fbshipit-source-id: 3e9dfde9d413943281d6aa7e85b9feeafc3bef7a
2022-01-27 04:47:33 -08:00
AntoineDoubovetzky 507b05f4c0 fix(jest/setup): fix circular dependencies in mockModal (#32964)
Summary:
Fixes https://github.com/facebook/react-native/issues/32939
It appears there is circular dependencies on the Modal component that causes the modalMock function to be an empty object. Removing the import fixes the issue.
I don't know yet why this is not happening when executing the test suite inside `Modal-test.js` but I will investigate this later.

## 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] [Fixed] - Fix error "mockModal is not a function"

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

Test Plan:
On a newly initiated project using react-native 0.67.1 I created a ModalComponent:
```
import React from 'react';
import {Modal, Text} from 'react-native';

export const ModalComponent = () => {
  return (
    <Modal visible>
      <Text>Test</Text>
    </Modal>
  );
};
```
and a ModalComponent.test.tsx:
```
import 'react-native';
import React from 'react';
import {ModalComponent} from '../ModalComponent';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
  renderer.create(<ModalComponent />);
});
```

Running the test throws the error "TypeError: mockModal is not a function".

After modifying the mockModal inside node_modules/react-native/jest/mockModal.js it works correctly.

Reviewed By: christophpurrer

Differential Revision: D33771136

Pulled By: lunaleaps

fbshipit-source-id: c09ada8d2f864f5568b3379616a6cace9fb9921e
2022-01-26 23:54:55 -08:00
Genki Kondo 8858c21124 Make sure that AnimatedTracking is started when CompositeAnimation.start is called
Summary:
In Animated, when a toValue of AnimatedValue (as opposed to a number) is passed in, the [AnimatedValue starts tracking via AnimatedTracking](https://www.internalfb.com/code/fbsource/[b688f3747a706236fce300636978ed1ca5e4081a]/xplat/js/react-native-github/Libraries/Animated/AnimatedImplementation.js?lines=142) but it doesn't actually start animating even if start() is called on the animation.

This behavior is inconsistent with a toValue of a number, which executes immediately on start(). This diff adds a call to AnimatedTracking.update within AnimatedValue.track, which starts the tracking animation.

Changelog:
[General][Fixed] - Fixes execution of animation when a toValue of AnimatedValue is used.

Reviewed By: JoshuaGross

Differential Revision: D33800373

fbshipit-source-id: 85ee6f51bc2bb2e078b586b076a8d1dfe92c1155
2022-01-26 21:23:54 -08:00
Xin Chen 45244ebce2 Fix TouchTargetHelper to correctly use the overflowInset information
Summary:
The overflowInset uses negative values to indicate extending from parent view. This diff fixes the math so that it's correctly check if the point is within overflowInset.

Changelog
[Android][Fixed] - Fix math for detecting if children views are in parent's overflowInset area.

Reviewed By: genkikondo

Differential Revision: D33750129

fbshipit-source-id: 1a5a33a227280c687b158b4a81a56017b6f4f3e0
2022-01-26 19:23:13 -08:00
Pieter De Baets 86fa2a5106 Emit warning when dispatching event to null target
Reviewed By: ShikaSD

Differential Revision: D33767454

fbshipit-source-id: c2f10b6b857544c06780fb13b66417d12f9b8d2c
2022-01-26 11:24:32 -08:00
joshua 420caeaa26 Updates octokit package and adds userAgent header to code analysis bot (#32891)
Summary:
As stated in [https://github.com/facebook/react-native/issues/28043](https://github.com/facebook/react-native/issues/28043) the requests with the `Octokit` lib is not optimal since tracking issues were raised. Since the issue could not be reproduced (see comments in the mentioned issue) I'm proposing to update the `Octokit` package to the newest version and add the required fields as stated [in the documentation](https://octokit.github.io/rest.js/v18#authentication).

## Changelog

[Internal] [Changed] - Changed requests of the internal code analysis

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

Test Plan:
Ran the code analysis bot manually

```
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow-check-ios --silent --json; echo flow; npm run flow-check-android --silent --json; echo google-java-format; node scripts/lint-java.js --diff) | GITHUB_PR_NUMBER="$CIRCLE_PR_NUMBER" node bots/code-analysis-bot.js

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
```

Reviewed By: christophpurrer

Differential Revision: D33793194

Pulled By: cortinico

fbshipit-source-id: 21b5f9f3911dd82e3254ab009637ab63aa36d30c
2022-01-26 11:24:32 -08:00
Samuel Susla b856465e3a Add missing header and initialisation in RuntimeSchedulerTest
Summary: changelog: [internal]

Reviewed By: ShikaSD

Differential Revision: D33789519

fbshipit-source-id: 395c0cc7ddd1d63fbe57efb8f3212e5f5647e2bd
2022-01-26 09:23:08 -08:00
Samuel Susla 9bf533e6b8 Remove shared_ptr from RuntimeScheduler::cancelTask interface and add comments
Summary:
Changelog: [internal]

Add comments and avoid using shared_ptr unnecessarily.

Why note shared_ptr? Using shared_ptr suggests we are transferring ownership of object, which we are not.

Reviewed By: javache

Differential Revision: D33741836

fbshipit-source-id: 56ebb098e6185793f05e2bb587005bb0f093c0c9
2022-01-26 09:23:08 -08:00
Samuel Susla 16ed62a850 Delete RuntimeScheduler yielding mobile config
Summary:
changelog: [internal]

Yielding in RuntimeScheduler is shipped. This diff removes the gating around it.

Reviewed By: sshic

Differential Revision: D33740360

fbshipit-source-id: 267372e81e66dda96e451435954a7c3546cc6fbe
2022-01-26 09:23:08 -08:00
Max Thirouin c9e4d34885 - Support fnm when detecting node binary (#32890)
Summary:
Since 0.64, local code in `Bundle React Native code and images` step for iOS is not enough anymore.
This add support for [fnm](https://github.com/Schniz/fnm) that is widely used this days.

## 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] [Added] - Support fnm when detecting node binary

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

Test Plan: I use fnm & it's working. Tested this code via patch-package.

Reviewed By: christophpurrer

Differential Revision: D33766842

Pulled By: cortinico

fbshipit-source-id: 77bbda2c7742de9ec64e6faa9a3526d3997bb4aa
2022-01-26 07:52:45 -08:00
Pieter De Baets 988fefc44d Enable react/no-unstable-nested-components rule
Summary:
Dynamic nested components can cause tricky performance issues in React, as the reconciler will not be able to reuse the previously mounted component tree.

Changelog: [General] [Added] Added linter warning config for unstable nested components

Reviewed By: motiz88

Differential Revision: D33767283

fbshipit-source-id: 869ece99dc63cc3a150bae882d26df8541e8db59
2022-01-26 04:23:14 -08:00
Chiara Mooney 3d1d4ee457 Update RN Version Expected Structure (#32892)
Summary:
Current syntax options for RN version values break Windows. Following change to nightly build format to be 0.0.0-X-X-X, prerelease value is now a string (X-X-X).

https://github.com/microsoft/react-native-windows/issues/9223

## Changelog

[General] [Fixed] - Fix RN version syntax to match new nightly build structure.

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

Reviewed By: cortinico

Differential Revision: D33712950

Pulled By: lunaleaps

fbshipit-source-id: 9e47cae34930ee624a863c832430962354ebb5be
2022-01-25 22:23:30 -08:00
Brian Vaughn 1cc217d5ef React DevTools 4.22.1 -> 4.23.0
Summary:
Update `react-devtools-core` and `react-devtools` dependencies for RN, VSCode, Flipper, etc.

`js1 upgrade react-devtools -v 4.23.0`

# Changelog:

[General][Changed] - Upgraded react-devtools-core dependency to 4.23.0

Reviewed By: lunaruan

Differential Revision: D33752754

fbshipit-source-id: 81d123e058d5660b3b7c34823d15272b34d6c0b6
2022-01-25 18:23:17 -08:00
Evan Yeung baea87811f Deploy v0.170.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D33756092

fbshipit-source-id: 9a15a7114864c8a41c16e6e0a7729aedd76ae861
2022-01-25 17:23:30 -08:00
David Vacca 93677cecde Ship eager initialization of mapbuffer
Summary:
Ship eager initialization of mapbuffer

changelog: [internal] internal

Reviewed By: ShikaSD

Differential Revision: D33754255

fbshipit-source-id: 1b8359b8c9fbc4fc7a155cb73e9147fd5b1f5963
2022-01-25 17:23:30 -08:00
David Vacca 9df02fff6b Eager initialize Fabric in RN VR apps
Summary:
Enable eager intialization of FabricUIManager during intiialization of React Native.
This feature highly improved TTRC in Markeptlace Home

changelog: [internal] internal

Reviewed By: genkikondo

Differential Revision: D33585099

fbshipit-source-id: 0ffbc720bcb1edd1b04180189a52c82e9e2fa800
2022-01-25 17:23:29 -08:00
Marshall Roch 203a82e90a fix flow suppression in VirtualizedList
Summary:
flow 0.146 became more conservative about refinement invalidation, no longer accepting that `this.props.onViewableItemsChanged` is truthy. this was suppressed at the time.

instead, we can assign to a const to restore typechecking.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D33743126

fbshipit-source-id: 0b1f0b83c2fe812e88b027c3b1d3d8aca7b09277
2022-01-25 15:23:47 -08:00
Marshall Roch 851e87a1a6 make Easing an object, not a class
Summary:
`Easing` only has static properties and is never constructed or subclassed, so there doesn't seem to be any reason for it to be a class instead of an object.

as a class, Flow errors about `method-unbinding` on every single use of it.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D33774944

fbshipit-source-id: c0bd2e3d7a78e538f95b88b2b1b12d301c8f590c
2022-01-25 15:23:46 -08:00
Paige Sun 0567fd0e91 4/4 Fix RNHostComponentDetailsRoute to display differences between SVCs and NVCs
Summary: Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D33718142

fbshipit-source-id: d3a05503e7cc2b76a66a26376a47e4acdc30d514
2022-01-25 15:23:46 -08:00
Paige Sun 63605323b0 2/4 Fix RNHostListComponentListRoute to validate SVCs with NVCs
Summary: Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D33715385

fbshipit-source-id: d8d31e92dd934648f8431a508a78e2813c462f8f
2022-01-25 15:23:46 -08:00
Gabriel Donadel Dall'Agnol 4f1f42b076 ci: Add github action to apply version label to pre-release issues (#32957)
Summary:
Add workflow to automatically label issues with the `Type: Upgrade Issue` label as `Version: XX` using [actions-apply-version-label](https://github.com/marketplace/actions/apply-version-label-to-issue-with-specific-label) github action.

Closes https://github.com/facebook/react-native/issues/32691

## Changelog

[Internal] [Added] - Add github action to apply version label to pre-release issues

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

Test Plan:
As I don't have admin rights to this repo I merged these same changes  in my fork (https://github.com/gabrieldonadel/react-native/pull/3) and tested this action by opening [an issue](https://github.com/gabrieldonadel/react-native/issues/5) tagged as `pre-release`

https://user-images.githubusercontent.com/11707729/150696182-82381f86-78af-4ba0-a94c-e5780ee54316.mov

## Next steps

Transfer [core-workflow-apply-version-label](https://github.com/gabrieldonadel/core-workflow-apply-version-label) to [react-native-community](https://github.com/react-native-community)

Reviewed By: lunaleaps

Differential Revision: D33744979

Pulled By: cortinico

fbshipit-source-id: c917b62d3aa561d779d6e2c94a7af69cd462b60e
2022-01-25 12:23:38 -08:00
MaeIg 8b5a5d4645 Fix capitalize Text style on IOS (#32774)
Summary:
On my project, I realized that capitalize style doesn't work with dates on IOS. I found [this issue](https://github.com/facebook/react-native/issues/32697) and tried to solve it.

(code example: https://snack.expo.dev/maelg/capitalize-demo)
| Android | IOS | Web |
| ------------- | ------------- | ------------- |
| ![image](https://user-images.githubusercontent.com/40902940/146158714-c658a83e-d8f3-41c9-92c8-4fc1f722f942.png) | ![image](https://user-images.githubusercontent.com/40902940/146159059-3cec1f7b-9bc7-4060-8164-79c47694b86b.png) | ![image](https://user-images.githubusercontent.com/40902940/146158095-0f94f25f-f245-4e45-9191-73520a0f6568.png) |

As we can see, the behavior is different on IOS, Android and web:
- **Android**: Capitalize the first letter of each word, unless it begins with a number. And put the rest in lowercase.
- **IOS**: Capitalize the first letter of each word, ~~unless it begins with a number~~. And put the rest in lowercase.
- **Web**: Capitalize the first letter of each word, unless it begins with a number. ~~And put the rest in lowercase.~~

This PR aims to unify behavior on Android and Ios. I am not changing the behavior which differs from the web because I don't know if it is desirable to align with the web.

## Changelog

[IOS] [Changed] - Don't capitalize the first letter of a word that is starting by a number

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

Test Plan:
I manually tested my changes on a POC app (same code: https://snack.expo.dev/maelg/capitalize-demo) on react-native v0.66.4 and react-native main branch.

You can see the result here:
| Android | IOS |
| ------------- | ------------- |
| ![image](https://user-images.githubusercontent.com/40902940/146191361-e2de26d1-3915-47dc-8707-480504af24d6.png) | ![image](https://user-images.githubusercontent.com/40902940/146161660-c869202a-104e-4d16-8f5e-db1c72b2ea5e.png) |

~~I tried to use rn-tester but it was not taking my code. I think it is because fabric was enabled so it was using other code.
I tried to disable fabric but I was not able to build the app on my IOS simulator anymore:~~

On rn-tester:
<image src="https://user-images.githubusercontent.com/40902940/146457851-864b2962-5e9c-4c7e-83fd-7686e27cb996.png" width=50% height=50% />

Reviewed By: philIip

Differential Revision: D33165963

Pulled By: yungsters

fbshipit-source-id: c3bf32bf33d2f109a119798eefdbb9077e904252
2022-01-25 09:08:18 -08:00
Dmitry Rykun f595a4e681 Duplicate Xcodeproj UUIDs in iOS app template Podfile fixed
Summary:
Disabled deterministic UUIDs in the Podfile.
Changelog: [iOS][Fixed] - Fixed duplicated UUIDs problem during pod install phase.

Reviewed By: sota000

Differential Revision: D33741572

fbshipit-source-id: 65cdd8a0ae34200e36e5a68849f5d3537c39dda2
2022-01-25 05:07:25 -08:00
CodemodService FBSourceClangFormatLinterBot 45d196a9e5 Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D33762300

fbshipit-source-id: 34957241276cf9cdcdcf175cc73accd837ff7a54
2022-01-25 03:30:00 -08:00
Luna Wei 76a2cf3569 Use CircleCI API to trigger releases (#32937)
Summary:
Changelog: [Internal]
* Refactor release automation so it doesn't use intermediate tags to trigger the release workflow. Now, we POST to CircleCI's ["trigger pipeline" API](https://circleci.com/docs/api/v2/#operation/triggerPipeline)
* This does have the con of needing to give CircleCI project permission for whoever wants to run a release as you'll need a token to trigger
* See related discussion: https://github.com/reactwg/react-native-releases/discussions/7#discussioncomment-1836420

Description of changes:
* Changes to config.yml allow us to use our POST data to trigger a certain workflow. There is no direct API to trigger a workflow, CircleCI only has an API to trigger pipelines, so the suggestion is to leverage conditionals: https://support.circleci.com/hc/en-us/articles/360050351292-How-to-trigger-a-workflow-via-CircleCI-API-v2
* Update `bump-oss-version` to make the api call -- the instructions for running a release are still the same: https://github.com/facebook/react-native/wiki/Release-Process#creating-0minor0-rc0
   * Would be good to make this a yarn script as tido64 mentioned
* Remove unused utilities now that we don't use intermediate tags like `publish-...`

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

Test Plan:
Have this on a Github branch and tried this out locally:

## Running release script
Running the bump-oss script (I had to hack it locally to be allowed to run on a non-release branch):
{F694804729}
* Link to resulting workflow: https://app.circleci.com/pipelines/github/facebook/react-native/11836 -- you can [verify that the parameters are the same as I passed](https://app.circleci.com/pipelines/github/facebook/react-native/11836/workflows/59ac0c86-5fe3-4d7a-80e9-c61129d49e9f/jobs/232388?invite=true#step-106-2)

## Other attempts triggering this workflow
Notice that when I tried to run it on an actual release-branch (0.67-stable) but because the `config.yml` changes aren't on that branch, the job faisl
| {F694804321} |

## Verifying the right workflows trigger on a regular push
* Notice that the workflows "analysis" and "test" are still triggered on push (ie, the `unless:` clause isn't messing things up)
{F694804320}

Reviewed By: sota000

Differential Revision: D33715336

Pulled By: lunaleaps

fbshipit-source-id: 82672d6d50768015bdfc9f4ea4d22aa801b84f06
2022-01-24 14:08:43 -08:00
Tommy Nguyen 60cef850bd fix(ios): fix `Time.h` patch not being applied (#32961)
Summary:
The path to `Time.h` is currently hard-coded and does not take into
consideration the `--project-directory` flag when running `pod install`.

## Changelog

[iOS] [Fixed] - Fix `Time.h` patch not being applied when running `pod install --project-directory=ios`

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

Test Plan:
```
git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version main
yarn
cd example
pod install --project-directory=ios
../scripts/xcodebuild.sh ios/Example.xcworkspace build
```

Reviewed By: christophpurrer

Differential Revision: D33748789

Pulled By: lunaleaps

fbshipit-source-id: b125734eba30e552ae139e7ecd4e634c8fa1bcd7
2022-01-24 13:31:01 -08:00
Sota Ogo c48e5acca4 Fix config file dir incorrectly set in the build time codegen. (#32946)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32946

Changelog: [Internal]
This fixes a bug where config file dir was incorrectly and breaks the codegen which runs when building an app.

Reviewed By: dmitryrykun

Differential Revision: D33724558

fbshipit-source-id: 0c04c1d41f2fb9b958da64fa414746695cea60cb
2022-01-24 11:09:37 -08:00
Mattéo Martin e6a3410afe Add allowsEdgeAntialiasing on views with rotations or skew tr… (#32920)
Summary:
…ansforms

On iOS, if a View is rotated with the a transform (e.g. <View style={{transform: {rotationZ: 5}}} />), the view has aliasing  (see screenshot). Same for a skew transformation. We don't have the issue on Android

This behavior had originally being fixed by this PR https://github.com/facebook/react-native/pull/1999

However a new PR was merge ( https://github.com/facebook/react-native/pull/19360 ) that broke this. I think it was made to add antialiasing during perspective transforms but seems to have broken the antialiasing when rotationZ transforms

This PR adds back the antialising during rotation transform , while keeping it during perspective transform.

## Changelog

I changed the allowsEdgeAntialiasing condition, making it "true" when the m12 or m21 is not 0. From this article https://medium.com/swlh/understanding-3d-matrix-transforms-with-pixijs-c76da3f8bd8 , I've understood that in all rotation or skew transformations, m12 or m21 is different than 0 . In the other transformation (e.g. scale or translate) it stays at 0.

Although, I'm not a matrix transformation expert so I may be mistaken

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

Test Plan:
I've written several views with all rotateX/Y/Z , skewX,Y and perpective transformation. Before the PR some transformation was showing aliasing on iOS (e.g. top-left view in the screenshot, don't hesitate to zoom in the image if you don't see it) and with this PR it does not have anymore

Before

![Simulator Screen Shot - iPhone 13 - 2022-01-19 at 10 09 35](https://user-images.githubusercontent.com/6890533/150100149-5370c0fc-ba4f-499f-8e41-a40a10b466a9.png)

After
![Simulator Screen Shot - iPhone 13 - 2022-01-19 at 10 10 39](https://user-images.githubusercontent.com/6890533/150100229-1bb5077f-d6bb-48a2-b852-acf726fcb59e.png)

Code I used to test

```
const commonStyle = {
  width: 150,
  height: 100,
  backgroundColor: "red",
  margin: 10,
}

const Test = () => (
  <View style={{ flexDirection: "row" }}>
    <View>
      <View
        style={[
          commonStyle,
          {
            transform: [{ rotateZ: "4deg" }],
          },
        ]}
      />

      <View
        style={[
          commonStyle,
          {
            transform: [{ rotateX: "30deg" }],
          },
        ]}
      />

      <View
        style={[
          commonStyle,
          {
            transform: [{ rotateY: "30deg" }],
          },
        ]}
      />
      <View
        style={[
          commonStyle,
          {
            transform: [{ rotateX: "30deg" }, { rotateY: "30deg" }, { rotateZ: "3deg" }],
          },
        ]}
      />
    </View>

    <View>
      <View
        style={[
          commonStyle,
          {
            transform: [{ skewX: "4deg" }],
          },
        ]}
      />

      <View
        style={[
          commonStyle,
          {
            transform: [{ skewY: "4deg" }],
          },
        ]}
      />

      <View
        style={[
          commonStyle,
          {
            transform: [{ skewY: "4deg" }, { rotateZ: "3deg" }],
          },
        ]}
      />

      <View
        style={[
          commonStyle,
          {
            transform: [{ perspective: 1000 }],
          },
        ]}
      />
    </View>
  </View>
)
```

Reviewed By: lunaleaps

Differential Revision: D33665910

Pulled By: sshic

fbshipit-source-id: 91163ec2a0897a73ddf0310d86afacea04b89bc7
2022-01-24 07:21:57 -08:00
Xin Chen 48f6967ae8 Add pointerEvents prop to RN Android scroll views
Summary:
Per discussion in the previous diff D33672110, it's ok to add the `pointerEvents` prop to scrollview. This will help prevent scrolling on the ScrollView if pointerEvents is set to `box-none`, or `none`.

Corresponding doc changes are in https://github.com/facebook/react-native-website/pull/2936

Changelog:
[Android][Added] - Add new API in ScrollView and HorizontalScrollView to process pointerEvents prop.

Reviewed By: javache

Differential Revision: D33699223

fbshipit-source-id: 1cae5113e9e7d988fc4c4765c41d817a321804c4
2022-01-21 13:40:09 -08:00
AKB48 d0f0234656 Bump Kotlin version to 1.6.10 (#32936)
Summary:
Bump Kotlin version to 1.6.10 with changes:

https://kotlinlang.org/docs/whatsnew16.html

Primarily:

- stabilization to several language features
- various type inference improvements
- support for annotations on class type parameters

## Changelog

[Android] [Changed] - Bump Kotlin version to 1.6.10

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

Reviewed By: ShikaSD

Differential Revision: D33708397

Pulled By: cortinico

fbshipit-source-id: a09b4504c194676d18a749c5e297b7598e5f32b4
2022-01-21 07:46:30 -08:00
Dmitry Rykun 37e5cc966f Bump to version 0.0.13
Summary:
Bump react-native-codegen version to include new fixes and improvements.
Changelog: [internal] Updated react-native-codegen version

Reviewed By: cortinico

Differential Revision: D33684175

fbshipit-source-id: bfc6cb627659c7cdfca2676894bece5f02aff767
2022-01-21 07:30:41 -08:00
Lorenzo Sciandra 293fb51e3a add 0.67.1 changelog & fix 0.67.0 (#32938)
Summary:
Adds changelog for new patch and removes an entry that was rolled back.

## 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] [Changed] - add changelog entry for 0.67.1 & fix 0.67

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

Test Plan: N/A

Reviewed By: ShikaSD

Differential Revision: D33709914

Pulled By: cortinico

fbshipit-source-id: 0829be764e7aeae6191aa2138eb8bc74d9c2a880
2022-01-21 07:06:38 -08:00
Nicola Corti 50057158ca Bump Flipper to 0.125.0 (#32923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32923

As our Flipper version is quite old, let's bump it to one of the latest stable: 0.125.0
This required to update also the following:
- Flipper-Folly to 2.6.10 - This was needed as I aligned the versions to https://github.com/facebook/flipper/blob/v0.125.0/react-native/ReactNativeFlipperExample/ios/Podfile
- OpenSSL-Universal to 1.1.1100 - This was required with the `pod update` command

I've picked 0.125.0 as 0.127.x and following are crashing on Android
and will potentially require a bump of the NDK to r23:
See: https://github.com/facebook/flipper/issues/3245

Changelog:
[General] [Changed] - Bump Flipper to 0.125.0

allow-large-files

Reviewed By: mdvacca

Differential Revision: D33583090

fbshipit-source-id: 2a2020c3213273087ec4a152076f846e35e275c5
2022-01-21 06:54:21 -08:00
Tim Yung 23717c6381 RN: Remove DeprecatedPropTypes
Summary:
Removes all of the `DeprecatedPropTypes` modules from React Native.

Any call sites that were deep-linking to these modules and still requires them can instead import them from the `deprecated-react-native-prop-types` package.

Since this also removes the last reference to `prop-types`, this diff also removes the `prop-types` dependency from `react-native`. 🥳

Changelog:
[General][Removed] DeprecatedPropTypes (deep-link) modules removed from React Native.

Reviewed By: kacieb

Differential Revision: D33671645

fbshipit-source-id: 91829a556b272bbd17ee94806fc548af753593db
2022-01-20 18:17:03 -08:00
Moses DeJong f12c8fba60 Avoid self capture in blocks that would extend ImageView instance lifetime.
Summary:
Avoid self capture in blocks that would extend ImageView instance lifetime.

Changelog:
[iOS][Fixed] - Use weakSelf in objc block instead of self.

Reviewed By: RSNara

Differential Revision: D33639088

fbshipit-source-id: b6e5200d9410ddd9e0683ea6d3cc3116591dd31c
2022-01-20 15:39:52 -08:00
Moses DeJong 95585a9730 Avoid self capture in blocks that would extend RCTDevSettings instance lifetime.
Summary:
Avoid self capture in blocks that would extend RCTDevSettings instance lifetime.

Changelog:
[iOS][Fixed] - Use weakSelf in objc block instead of self.

Reviewed By: RSNara

Differential Revision: D33594868

fbshipit-source-id: 2dce135ae88337a09fb2f3e9462e10a4692bc7a7
2022-01-20 15:39:51 -08:00
Sota Ogo ad14eb4bd3 Refine RNTester documentation to disable fabric
Summary:
Changelog: [Internal] Update the documentation to disable fabric in RN Tester.

RNTester build would fail if you previously built with fabric_enabled. This documentation adds the instruction to clean up before runing pod install.

In the future, we'd want to detect and do the clean up so that it doesn't fail in an obscure way.

Reviewed By: cortinico, dmitryrykun

Differential Revision: D33173173

fbshipit-source-id: a396eb71edc7bf174d0eb392799f45ae74274b76
2022-01-20 14:57:24 -08:00
Michelle Laurenti 86db62b7a8 fix race condition in iOS websocket implementation (#32847)
Summary:
The iOS WebSocket implementation has a race condition that causes WebSocket frame payloads to be processed incorrectly.
This can cause errors on RFC6455 compliant WebSocket servers:
- the server sends a ping frame with no payload
- the server sends a text frame with a payload longer than 125 bytes
- the client answers the ping with a pong frame echoing back the contents of the text frame

This is caused by concurrent modification of the current frame contents, that is passed by reference to the handlers. The concurrent modification happens [here](https://github.com/facebook/react-native/blob/main/Libraries/WebSocket/RCTSRWebSocket.m#L1162).

The bug was detected and fixed in the original SocketRocket repository in [this PR](https://github.com/facebookincubator/SocketRocket/pull/371). The relevant part of the fix is applied in this PR.

Resolves https://github.com/facebook/react-native/issues/30020.

## 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] [Fixed] - Fix WebSocket control frames having payloads longer than 125 bytes

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

Test Plan:
The bug is not easily and consistently reproduced, being a race condition.
We were able to reproduce it by connecting a react native app to a websocket server that sent ~100 pings per second and ~100 text frames per second. After a couple of seconds, the server receives an invalid pong message, with a payload equal to the payload of the text frame. The following is a node server that can replicate the problem on a react-native app running on iOS.

<details>

```
const { WebSocketServer } = require('ws');

const wss = new WebSocketServer({ port: 8080 });

wss.on('connection', function connection(ws) {
  const pingInterval = setInterval(() => {
    ws.ping();
  }, 10);

  const sendInterval = setInterval(() => {
    const arr = new Array(100);
    for (let i = 0; i < arr.length; i++) {
      arr[i] = Math.random();
    }
    ws.send('message with payload longer than 125 bytes: ' + arr.join(','));
  }, 10);

  ws.on('close', () => {
    clearInterval(pingInterval);
    clearInterval(sendInterval);
  });

  ws.on('error', (err) => {
    console.error(err);
    process.exit(1);
  });
});
```

</details>

Reviewed By: hramos

Differential Revision: D33486828

Pulled By: sota000

fbshipit-source-id: ba52958a584d633813e0d623d29b19999d0c617b
2022-01-20 13:56:26 -08:00
Ramanpreet Nara 0343e697fd Fix NVC for RCTTextInlineImage
Summary:
This diff fixes the Static/Native ViewConfigs for RCTTextInlineImage.

Changelog: [Internal]

Reviewed By: p-sun, sshic

Differential Revision: D33674127

fbshipit-source-id: 8cf5ffeaca635b4afd30c437dc0f87ea1fdc15a8
2022-01-20 13:52:03 -08:00
Ramanpreet Nara 26d05d8dd7 Fix SVC for RCTModalHostView
Summary:
Making the native ViewConfig for RCTModalHostView match its static ViewConfig.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D33303419

fbshipit-source-id: 6fac237d670ee221ad867f79e54d5a3576c156da
2022-01-20 13:52:03 -08:00
Andrei Shikov 3c86e82a02 Namespace MapBuffer structs and typealiases by moving them into class
Summary:
Refactors MapBuffer-related `primitives.h` to be namespaced with `MapBuffer` class, to avoid name collisions and confusion later on.
Most of the size constants are moved to relevant .cpp files or updated to use `sizeof`.

Additionally, adds a little bit of documentation about `MapBuffer` serialization format.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33662487

fbshipit-source-id: 5a7a2b1c7f2bb13ee1edfc5fae51ba88c34f0d3c
2022-01-20 12:57:22 -08:00
Andrei Shikov adb2167640 Serialize and assert type information in mapbuffer
Summary:
Serializes type information along with key/value in MapBuffer, asserting the data type on Java side during read. At the moment, accessing value with incorrect will result in a crash.

Other changes:
Adds a `getType` method to verify types before accessing them.
Removes `null` as a type, as just not inserting value and checking for its existence with `hasKey` is more optimal.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33656841

fbshipit-source-id: 23a78daa0d84704aab141088b5dfe881e9609472
2022-01-20 12:57:22 -08:00