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

24508 Коммитов

Автор SHA1 Сообщение Дата
J.T. Yim f4c4f446e4 Remove AsyncStorage from rn-tester and fix InternalSettings Example
Summary:
Changelog:
[**General**][**Removed**] - Removed AsyncStorage usage from RNTester

As part of the "Lean Core" efforts (see https://github.com/react-native-community/discussions-and-proposals/issues/6) to remove outdated and/or unused components (status: https://gist.github.com/Simek/88a9f1a014a47c37f4fce3738864d2e1), this diff removes usage of the deprecated AsyncStorage API from RNTester.

RNTester is intended as a reference to showcase various components and APIs. The implications of the replacement of AsyncStorage in RNTester with in-memory management of state is a tradeoff of persistance to a lighter weight implementation and user predictable behavior.

1. Removed AsyncStorage from rn-tester
  - removed Navigation and bookmark persisting from reducer
  - moved JS Stalls and tracking to application state with context and reducer
2. Fixed InternalSettings Example bugs

Reviewed By: lunaleaps

Differential Revision: D35435562

fbshipit-source-id: a879787d8683a1c452e5b6b75a9e01f3ceadfe5d
2022-04-19 15:34:40 -07:00
Luna Wei 361b9a808c PointerEvents: Reset childHandlingNativeGesture on first ACTION_DOWN
Summary:
Changelog: [Internal] - Reset the mChildHandlingNativeGesture on the first ACTION_DOWN after it's been set.

I noticed this issue when scrolling sometimes in the event log for the W3CPointerEvents example, none of the pointer events would get captured because we'd call [`notifyNativeGestureStarted`](https://www.internalfb.com/code/fbsource/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/NativeGestureUtil.java?lines=25-25) which would prevent any pointerevents being fired.

Reviewed By: vincentriemer

Differential Revision: D35685378

fbshipit-source-id: 01fc255afc5e22dc6c42f7eb11a8aa5a9a091b87
2022-04-19 15:22:00 -07:00
Rob Hogan 18196512db Fall back to non-localized string if no translation is available
Summary:
We've seen a couple of `EXC_BAD_ACCESS` crashes in [`RCTParagraphComponentAccessibilityProvider.mm:L125`](52d8a797e7/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm (L125)), most likely explained by [RCTLocalizationProvider RCTLocalizedString] returning nil, which will happen in the case that a language pack has no entry for the input string.

This is a small defensive change to fall back to the input if there's no better alternative.

Changelog:
[iOS][Fixed] - `RCTLocalizationProvider` Fall back to input when no localization is available

Reviewed By: luluonet

Differential Revision: D35583786

fbshipit-source-id: e8ae6ff61518e105301e7e51f5d8f43290fb20bf
2022-04-19 04:10:31 -07:00
Paige Sun 23b6240b25 (Easy) Add RCTNotAllowedInAppWideFabric validation to the only static method in RCTUIManager, JSResponder
Summary:
Changelog: [Internal][iOS] Add validation log to the only static method in RCTUIManager, JSResponder

When all surfaces of an app has been fully migrated to Fabric, we don't expect `[RCTUIManager JSResponder]` to be called, so I'm expecting this API to be broken on Fabric and Bridgeless.

Reviewed By: RSNara

Differential Revision: D35723794

fbshipit-source-id: ec786946a33fca98c89e8cad0e0467bf45dc1735
2022-04-18 18:57:40 -07:00
Vincent Riemer 32c704c30f Add gated option to use w3c pointer events for Pressibility's hover callbacks
Summary: Changelog: [Internal] - Add gated option to use w3c pointer events for Pressibility's hover callbacks

Reviewed By: p-sun

Differential Revision: D35596600

fbshipit-source-id: f9e4b71497efd0dbb09dbc1872694fc93a6e1f2e
2022-04-18 15:47:55 -07:00
Vincent Riemer 64034f3976 Put W3C PointerEvents RNTester examples behind a feature flag
Summary: Changelog: [Internal] - Put W3C PointerEvents RNTester examples behind a feature flag

Reviewed By: lunaleaps, p-sun

Differential Revision: D35684411

fbshipit-source-id: c69c12c5ed7ee7acc925d4ca8932e8bd8b6d4eee
2022-04-18 15:47:55 -07:00
Vincent Riemer a40747e2d8 Add experimental disclaimers to pointer event APIs
Summary: Changelog: [Internal] - Add experimental disclaimers to pointer event APIs

Reviewed By: lunaleaps, p-sun

Differential Revision: D35682318

fbshipit-source-id: e85a37a2eb9568df636352e170bd42a3bb30a2f6
2022-04-18 15:47:55 -07:00
Richard Howell 7d4f6840f6 add casts for implicit int to float
Summary: Apply //fbobjc/Tools/cAST:implicit_conversion to existing warnings

Reviewed By: adamjernst

Differential Revision: D35692786

fbshipit-source-id: 13fb4f8a6b6e701c324b00c682943a4b3d80de72
2022-04-18 11:51:50 -07:00
Anand Bashyam da48d0dc63 Back out "Revert D35705825: [JSI] Fix typo in Value's constructor with a Symbol"
Summary:
During the sheriff shift, incorrectly reverted a diff. fixing it by reverting the revert.

Original commit changeset: b5a6c9f6f576
Original Phabricator Diff: D35705825 (a7a0f86a73)

See : https://fb.workplace.com/groups/mobile.sheriffs/posts/8461935673854973/?comment_id=8462686143779926

The current JSI implementation is converting a Symbol to String when creating a jsi Value.
Changelog: [General][Fixed]

Reviewed By: neildhar

Differential Revision: D35710710

fbshipit-source-id: d36667001002032a37569c9bc5288d10b9bc7011
2022-04-18 10:08:22 -07:00
Anand Bashyam 82f2b1d4e9 Revert D35705825: Fix typo in Value's constructor with a Symbol
Differential Revision:
D35705825 (a7a0f86a73)

Original commit changeset: 3bee0a02bb77

Original Phabricator Diff: D35705825 (a7a0f86a73)

fbshipit-source-id: b5a6c9f6f576ea1771dca8977b394bd90064c669
2022-04-17 12:51:12 -07:00
John Porto a7a0f86a73 Fix typo in Value's constructor with a Symbol
Summary:
The current JSI implementation is converting a Symbol to String when creating a jsi Value.

Changelog: [General][Fixed]

Reviewed By: neildhar

Differential Revision: D35705825

fbshipit-source-id: 3bee0a02bb77643c6a33031b4d98ac9a7e126303
2022-04-17 11:53:12 -07:00
Scott Kyle 3c1a814465 Fix visibility of C++ TM spec library when focusing
Summary:
This fixes an oversight where focusing fails if a C++ TurboModule is in the build graph. See line 391 in `rn_codegen_components` that does the same thing.

Changelog:
Internal

Reviewed By: mdvacca

Differential Revision: D35663755

fbshipit-source-id: d7d2e0109fd536586292d333b7d53b7b2e948d86
2022-04-15 11:08:31 -07:00
Sam Zhou 0c86597f91 Deploy 0.176.2 to xplat
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D35669393

fbshipit-source-id: b1a3220a22ac1091f599f5179e3c7f6726480752
2022-04-15 01:02:05 -07:00
Panagiotis Vekris 4daeb30f86 Restore 0.175.1 to xplat
Summary:
Flow v0.176.1 has a bug when run in a non-lazy mode.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D35665720

fbshipit-source-id: a5fa691adf9ab5f5f4a67188fb3b52b4c69ee325
2022-04-14 23:11:50 -07:00
Rick Hanlon 1369eb57ec React Native sync for revisions 8dcedba...60e63b9
Summary:
This sync includes the following changes:
- **[60e63b960](https://github.com/facebook/react/commit/60e63b960 )**: remove console.error in ReactFiberLane ([#24319](https://github.com/facebook/react/pull/24319)) //<Luna Ruan>//
- **[ec52a5698](https://github.com/facebook/react/commit/ec52a5698 )**: Fix: Don't call cWU if already unmounted //<Andrew Clark>//
- **[46db4e996](https://github.com/facebook/react/commit/46db4e996 )**: Combine deletion phase into single recursive function //<Andrew Clark>//
- **[481dece58](https://github.com/facebook/react/commit/481dece58 )**: Use recursion to traverse during mutation phase //<Andrew Clark>//
- **[f9e6aef82](https://github.com/facebook/react/commit/f9e6aef82 )**: Wrap try-catch directly around each user function //<Andrew Clark>//
- **[bcc1b3121](https://github.com/facebook/react/commit/bcc1b3121 )**: Move reportUncaughtErrorInDev to captureCommitPhaseError //<Andrew Clark>//
- **[c99c5f1df](https://github.com/facebook/react/commit/c99c5f1df )**: Move ad hoc flag checks into main switch statement //<Andrew Clark>//
- **[54b5b32d5](https://github.com/facebook/react/commit/54b5b32d5 )**: Move Update flag check into each switch case //<Andrew Clark>//
- **[e66e7a0fb](https://github.com/facebook/react/commit/e66e7a0fb )**: Inline commitWork into commitMutationOnFiber //<Andrew Clark>//
- **[12d7a9ad7](https://github.com/facebook/react/commit/12d7a9ad7 )**: Combine commitWork into single switch statement //<Andrew Clark>//
- **[ea7b2ec28](https://github.com/facebook/react/commit/ea7b2ec28 )**: Remove wrong return pointer warning //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 8dcedba...60e63b9

jest_e2e[run_all_tests]

Reviewed By: kacieb

Differential Revision: D35581192

fbshipit-source-id: d8674d2871612d2f27eaf8d75ff05e54ab91271d
2022-04-14 10:50:23 -07:00
Vincent Riemer 8e58f685a2 Fix pointer-events crash in catalyst-ios when running RNTester in legacy mode
Summary: Changelog: [Internal] Fix pointer-events setter crash in Paper

Reviewed By: appden

Differential Revision: D35617077

fbshipit-source-id: 975840a2474235a027279035ac327e9eb88d3f08
2022-04-14 10:40:54 -07:00
Paige Sun 033ad83b29 Refactor the JS base StaticViewConfig to be easier to understand
Summary:
Changelog: [Internal][SVC][JS] Refactor the JS base SVC StaticViewConfig to be easier to understand

This diff is a refactor that doesn't change any logic.

# Context
NativeViewConfigs are generated from RCTViewManager in iOS and ViewManager in Android.
StaticViewConfigs are partially generated from JS, and partially handwritten in JS.

We've noticed in at least 2 instances that engineers who add new props to NativeViewConfigs sometimes don't put props in the correct place for StaticViewConfigs, and thus they accidentally break the landblocking jest e2e test that validates the StaticViewConfigs matches the NativeViewConfigs.

The human error is mostly because PlatformBaseViewConfig.js was too nested to be easily understood. This diff refactors PlatformBaseViewConfig.js and adds clarifying comments.

Reviewed By: RSNara

Differential Revision: D35623775

fbshipit-source-id: 498a3daa812fa314821a2e7cb7d6f809900dbe3a
2022-04-14 10:34:55 -07:00
Paige Sun 8b7d0f6837 (Easy) Fix SVCs for Android, by removing iOS-only accessibilityLanguage prop
Summary:
Changelog: [Internal][Fixed] Fix StaticViewConfigs for Android, by removing iOS-only accessibilityLanguage prop

The accessibilityLanguage was a prop added to RCTViewManager, that is iOS-only, so it shouldn't exist in the SVCs for Android.

Reviewed By: RSNara

Differential Revision: D35630945

fbshipit-source-id: 7ed7f2619f73bb88babfbb207793d5415addaee6
2022-04-14 10:34:55 -07:00
Pieter Vanderwerff a223874cb5 Deploy 0.176.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D35635188

fbshipit-source-id: e85d49e684758198ace639e9f450998c7a32e359
2022-04-13 20:45:21 -07:00
Phillip Pan e500e89fd6 check if bridge exists when we access the module registry
Summary:
Changelog: [internal]

we have an issue where the moduleRegistry that the TM uses is released, adding this log to check if it's bc the bridge was released

Reviewed By: RSNara

Differential Revision: D35420922

fbshipit-source-id: 93c206b5afefeac3121df148940d9658736cb9d2
2022-04-13 19:29:09 -07:00
Paige Sun 8c5fc4f123 Add PointerEvent props to StaticViewConfigs to pass StaticViewConfigs-e2e.js test for FBiOS
Summary: Changelog: [Internal] Add PointerEvents props to StaticViewConfigs ensure SVC == NVC

Reviewed By: RSNara

Differential Revision: D35625443

fbshipit-source-id: 71209a65b1a7ef821f1bb9f4e19de577ede8fef5
2022-04-13 17:53:51 -07:00
Rick Hanlon ecd4c3f513 React Native sync for revisions e8f4a66...8dcedba
Summary:
This sync includes the following changes:
- **[8dcedba15](https://github.com/facebook/react/commit/8dcedba15 )**: Add fallback shim for AbortController ([#24285](https://github.com/facebook/react/pull/24285)) //<Ricky>//
- **[b86baa1cb](https://github.com/facebook/react/commit/b86baa1cb )**: Add back lost cache test ([#24317](https://github.com/facebook/react/pull/24317)) //<Ricky>//
- **[bafe912a5](https://github.com/facebook/react/commit/bafe912a5 )**: update types for InputContinuousLane and DefaultLane ([#24316](https://github.com/facebook/react/pull/24316)) //<Leo>//
- **[4ebaeae40](https://github.com/facebook/react/commit/4ebaeae40 )**: moved mutation code to passive ([#24251](https://github.com/facebook/react/pull/24251)) //<Luna Ruan>//
- **[caa60e8fc](https://github.com/facebook/react/commit/caa60e8fc )**: update types for NonIdleLanes and IdleLane ([#24313](https://github.com/facebook/react/pull/24313)) //<Leo>//
- **[1f7a901d7](https://github.com/facebook/react/commit/1f7a901d7 )**: Fix false positive lint error with large number of branches  ([#24287](https://github.com/facebook/react/pull/24287)) //<Stephen Cyron>//
- **[f56dfe950](https://github.com/facebook/react/commit/f56dfe950 )**: Warn on setState() in useInsertionEffect() ([#24298](https://github.com/facebook/react/pull/24298)) //<dan>//
- **[d68b09def](https://github.com/facebook/react/commit/d68b09def )**: Fix warning about setState in useEffect ([#24295](https://github.com/facebook/react/pull/24295)) //<dan>//
- **[057915477](https://github.com/facebook/react/commit/057915477 )**: Update create-subscription README ([#24294](https://github.com/facebook/react/pull/24294)) //<dan>//

Changelog:
[General][Changed] - React Native sync for revisions e8f4a66...8dcedba

jest_e2e[run_all_tests]

Reviewed By: kacieb

Differential Revision: D35581147

fbshipit-source-id: 33661d77eb000fdedab7e506a458fc739eab0056
2022-04-13 17:08:47 -07:00
NikoAri 3f98c8e4c2 Avoid full copy of large folly::dynamic objects by switching to std::move semantics (#33621)
Summary:
Problem:
Current creation of ModuleConfig does a full copy of folly::dynamic object, which for large objects can cause 1000's of memory allocations, and thus increasing app's memory footprint and speed.

Fix:
Use std::move semantics to avoid copy of folly::dynamic, thus avoiding memory allocations.

## Changelog

[General] [Fixed] - Avoid full copy of large folly::dynamic objects by switching to std::move semantics

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

Test Plan:
Compiled React Native for Windows
Consumed into Microsoft Excel App
Tested functionality through Microsoft Office Excel App
Viewed Memory Allocations in Debugger

Reviewed By: cortinico

Differential Revision: D35599759

Pulled By: RSNara

fbshipit-source-id: 095a961422cca4655590d2283f6955472f1f0410
2022-04-13 16:26:55 -07:00
Brett Lavalla 70fcab76a4 Fix RN accessibility links with UIAutomator
Summary:
D34687371 (7b5b114d57) unfortunately caused a regression with UIAutomator, where it would no longer be able to see any Views that have the ReactAccessibilityDelegate attached to them. This was because the delegate was changed to extend ExploreByTouchHelper which implements its own default AccessibilityNodeProvider, which does nothing in the case of a view without any virtual children.

This diff simply *only* uses the node provider if the view in question has virtual children, otherwise defaulting to the standard behavior from the View class.

Changelog:
[Android][Fixed] - Fixed issue where any node with an AccessibilityDelegate set (which was any node with any accessibility propoerty), was using ExploreByTouchHelper's built in AccessibilityNodeProvider, and not properly populating their AccessibilityNodeInfo's, leading to focus issues and issues with automated test services like UIAutomator.

Reviewed By: kacieb

Differential Revision: D35601320

fbshipit-source-id: 92e009c6e8b4ddcab860e2c91e6bd1a8f95359f0
2022-04-13 16:05:29 -07:00
Pieter Vanderwerff f8dee0e43e Deploy 0.176.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D35603908

fbshipit-source-id: 970831d9d89754772d3e8a641f44f7a3341ce01e
2022-04-13 15:03:28 -07:00
fortmarek e331b64ea6 Update changelog for 0.68.1 (#33630)
Summary:
Update changelog for 0.68.1

## 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] - Update changelog for 0.68.1

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

Reviewed By: dmitryrykun

Differential Revision: D35611623

Pulled By: cortinico

fbshipit-source-id: 2b5801810fc1c7416ad17859bf62c591b0be8c2c
2022-04-13 07:53:58 -07:00
Nicola Corti e48a580080 Use NDK 23 only for Windows users. (#33611)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33611

Bumping the NDK to 23 to prevent build failures due to the NDK
using longer paths.

Changelog:
[Android] [Fixed] - Use NDK 23 only for Windows users.

Reviewed By: motiz88

Differential Revision: D35547459

fbshipit-source-id: 4e44c0b5fd8d1c559b04fb43eb4eeadc13943394
2022-04-13 05:40:46 -07:00
Vladyslav Stepanov 86f8d0bb52 Fix Android implementation for Linking.sendIntent()
Summary:
Changelog:
[Android][Fixed] - Fix Extras usage in Android implementation of Linking.sendIntent()

The implementation of sendIntent() has a bug in a way it uses extras map.

From JS layer the API sends and array of map, where each map contains exactly 2 entries: {"key" -> "name_of_extra_to_use", "value" -> value_of_extra_to_use}

However Java parsing was just picking a random pair out of this map and was sending it as extra.

Most frequently the result was "value" -> value_of_extra_to_use in Intent instead of name_of_extra_to_use -> value_of_extra_to_use

This diff fixes the problem

Reviewed By: lunaleaps

Differential Revision: D35516496

fbshipit-source-id: 7da0a1cb3b8aa30463004dbb47008c83d8e95bd1
2022-04-12 16:35:40 -07:00
Rick Hanlon 46ab59c881 React Native sync for revisions 34aa5cf...e8f4a66
Summary:
This sync includes the following changes:
- **[e8f4a6653](https://github.com/facebook/react/commit/e8f4a6653 )**: Fix import in example //<dan>//
- **[bb49abea2](https://github.com/facebook/react/commit/bb49abea2 )**: Update some READMEs ([#24290](https://github.com/facebook/react/pull/24290)) //<dan>//
- **[4bc465a16](https://github.com/facebook/react/commit/4bc465a16 )**: Rename Controls to PipeableStream ([#24286](https://github.com/facebook/react/pull/24286)) //<Sebastian Markbåge>//
- **[ece5295e5](https://github.com/facebook/react/commit/ece5295e5 )**: Remove unnecessary flag check ([#24284](https://github.com/facebook/react/pull/24284)) //<zhoulixiang>//
- **[9ededef94](https://github.com/facebook/react/commit/9ededef94 )**: Don't mute hydration errors forcing client render ([#24276](https://github.com/facebook/react/pull/24276)) //<dan>//
- **[985272e26](https://github.com/facebook/react/commit/985272e26 )**: Fix name mismatch in react-reconciler custom build. ([#24272](https://github.com/facebook/react/pull/24272)) //<Hikari Hayashi>//
- **[b8cfda15e](https://github.com/facebook/react/commit/b8cfda15e )**: changed Transitions type to Array<Transition> ([#24249](https://github.com/facebook/react/pull/24249)) //<Luna Ruan>//
- **[c89a15c71](https://github.com/facebook/react/commit/c89a15c71 )**: [ReactDebugTools] wrap uncaught error from rendering user's component ([#24216](https://github.com/facebook/react/pull/24216)) //<Mengdi "Monday" Chen>//
- **[ebd7ff65b](https://github.com/facebook/react/commit/ebd7ff65b )**: Don't recreate the same fallback on the client if hydrating suspends ([#24236](https://github.com/facebook/react/pull/24236)) //<dan>//
- **[aa05e7315](https://github.com/facebook/react/commit/aa05e7315 )**: Add 4.4.0 release to eslint rules CHANGELOG ([#24234](https://github.com/facebook/react/pull/24234)) //<Brian Vaughn>//
- **[7e3121e1c](https://github.com/facebook/react/commit/7e3121e1c )**: Remove unstable_createMutableSource from experimental build ([#24209](https://github.com/facebook/react/pull/24209)) //<Sebastian Silbermann>//
- **[0415b18a1](https://github.com/facebook/react/commit/0415b18a1 )**: [ReactDebugTools] add custom error type for future new hooks ([#24168](https://github.com/facebook/react/pull/24168)) //<Mengdi "Monday" Chen>//

Changelog:
[General][Changed] - React Native sync for revisions 34aa5cf...e8f4a66

jest_e2e[run_all_tests]

Reviewed By: kacieb

Differential Revision: D35581059

fbshipit-source-id: ee031dfc49b1ef663b601f33f3f3f6c5a804971e
2022-04-12 13:41:59 -07:00
David Vacca fbeb51ef51 Fix NullPointerException when disaptching events
Summary:
This diff fixes a NullPointerException when disaptching events while the SurfaceMountingManager is being destroyed

changelog: [android] android

Reviewed By: cortinico

Differential Revision: D35559550

fbshipit-source-id: c07f74493384fb1b306338ec1bc8b96f1b6f1f41
2022-04-12 12:18:14 -07:00
Hugo Cuvillier 52d8a797e7 Use logical operator instead of bit operation
Summary:
I guess it's the same since we're working on a `bool` but... this causes some compilation error.

Changelog:
[General][iOS] - Fix compilation warning in yoga

Reviewed By: Andrey-Mishanin

Differential Revision: D35438992

fbshipit-source-id: 22bb848dfee435ede66af0a740605d4618585e18
2022-04-12 09:27:25 -07:00
Rick Hanlon 41cbccd98d @nocommit React Native sync for revisions 1159ff6...34aa5cf
Summary:
I'm kicking this off to see what's the extent of failures we're going to get if we try to bump to React 18 inside RN OSS.

This sync includes the following changes:
- **[34aa5cfe0](https://github.com/facebook/react/commit/34aa5cfe0 )**: Update local package.jsons for 18 //<Andrew Clark>//
- **[e7d0053e6](https://github.com/facebook/react/commit/e7d0053e6 )**: [fizz] Fix validateIterable call ([#24166](https://github.com/facebook/react/pull/24166)) //<salazarm>//
- **[6b85823b3](https://github.com/facebook/react/commit/6b85823b3 )**: Clean up Selective Hydration / Event Replay flag ([#24156](https://github.com/facebook/react/pull/24156)) //<salazarm>//

Changelog:
[General][Changed] - React Native sync for revisions 1159ff6...34aa5cf

jest_e2e[run_all_tests]

Reviewed By: cortinico

Differential Revision: D35504622

fbshipit-source-id: ad0f6b42b6e03d78cd5d6ba51ce5a5730d25b167
2022-04-12 08:50:06 -07:00
Danilo Bürger 2c87b7466e Bump ruby to 2.7.5 (#33485)
Summary:
This bumps ruby to the latest 2.7.x versions which includes bug fixes and 3 CVEs (https://www.ruby-lang.org/en/news/2021/11/24/ruby-2-7-5-released/)

## Changelog

[iOS] [Changed] - Bump ruby to 2.7.5

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

Test Plan: no test plan, should just pass tests.

Reviewed By: cortinico

Differential Revision: D35116757

Pulled By: GijsWeterings

fbshipit-source-id: a8e96bfcc6086b70dac21aee24bae46fe6b072bb
2022-04-12 07:59:52 -07:00
Mike Hardy 41cfd2f976 chore(typo): fix spacing typo in gradle plugin message (#33619)
Summary:
There is a simple typo - a missing space in to string concatenation in a deprecation message, the message pops up in a newly initialized RN68 project so seems worth fixing

## 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 typo in gradle plugin deprecation message

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

Test Plan:
Fixed via visual inspection (adding a single space character is luckily easy like that, yes that's perhaps over-confident but if you see the diff you will probably agree?)

cortinico

Reviewed By: cortinico

Differential Revision: D35577039

Pulled By: GijsWeterings

fbshipit-source-id: 84dc28ca0d0dcce89e1ca0c39ab0357b59396073
2022-04-12 06:34:30 -07:00
Michał Pierzchała 7dceb9b63c Upgrade RN CLI to v8 alpha (#33610)
Summary:
Upgrades the React Native CLI to v8 alpha. This version removes manual linking configuration and a few other things, hence changes to the project configuration.

cc kelset fortmarek

## Changelog

[General] [Changed] - Upgrade RN CLI to v8 alpha

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

Test Plan: CI green.

Reviewed By: rubennorte

Differential Revision: D35547624

Pulled By: cortinico

fbshipit-source-id: 4de9f280f9d1949c94057c32568b3fdfa4ee6a73
2022-04-12 04:17:20 -07:00
Luna Wei de09bd3b84 Dispatch enter/leave for ancestor hit path
Summary: Changelog: [Internal] - Fix pointer event dispatch to also fire enter/leave for ancestors in the hit path. Compared the event order with web on the RNTester W3C pointer example

Reviewed By: appden

Differential Revision: D35403076

fbshipit-source-id: 726e45e49a901b1d97ad3e20f5898701fd1f763b
2022-04-11 17:17:10 -07:00
Alex Landau 9bac0b77d0 Fix warnings about inconsistent override keyword
Summary:
The `override` keyword was used for some overriden methods and was not
used for others. This caused the `-Winconsistent-missing-destructor-override`
warning to show up, and since in some cases we build with `-Werror`, this broke
the build.

This diff adds the missing `override` keyword in a few places.

Changelog:
[Internal][Fixed] - Build issues

Reviewed By: kodafb

Differential Revision: D35513149

fbshipit-source-id: 92bca699f1be163189487d50c1050402df2ff038
2022-04-11 16:19:51 -07:00
Vincent Riemer c5cb707ba8 Add basic onPointerEnter/Leave event emitting to iOS
Summary: Changelog: [Internal] Add basic onPointerEnter/Leave event emitting to iOS

Reviewed By: lunaleaps

Differential Revision: D35414116

fbshipit-source-id: dd62cf7736c466e328b9ebbf51bf010610f4bd92
2022-04-11 15:49:30 -07:00
Paige Sun c032401b67 Fix sticky headers for scrollviews by sending onScroll event to legacy RCTEventDispatcher
Summary:
Changelog: [Internal][Bridgeless] Fix sticky headers for scrollviews by sending onScroll event to legacy RCTEventDispatcher

## Extra Context

FYI. <ScrollView> is the only Fabric component view that needs to send events via the legacy RCTEventDispatcher. Ideally, all component views should only use `ViewEventEmitter` to send events to JS and not use RCTEventDispatcher. This ScrollView does use ScrollViewEventEmitter, a subclass of ViewEventEmitter:
```
std::static_pointer_cast<ScrollViewEventEmitter const>(_eventEmitter)->onScroll([self _scrollViewMetrics]);
```

However, it also needs RCTEventDispatcher for animations using `Animated.event` for `useNativeDriver: true`. See [ScrollView.js](370c65b943/Libraries/Components/ScrollView/ScrollView.js (L1124-L1129)).

Reviewed By: RSNara

Differential Revision: D35540277

fbshipit-source-id: a28535ed10cac8e003523ecda6080574fbb89b85
2022-04-11 15:30:14 -07:00
almouro f503b21203 improve interpolation performance with big input range (#33598)
Summary:
This drastically improves `Animated.interpolate` performance when `inputRange` has a considerable amount of elements (~100 in my tests).

For instance in `ActivityIndicator` inside `react-native-paper`, the input has 144 elements https://github.com/callstack/react-native-paper/blob/main/src/components/ActivityIndicator.tsx#L170. `react-native-elements` has 9k stars, so I'm assuming this is widely used.

### Cause

The reason for the performance drop is that if we assume `n` to be the size of the range, calculating `'inputRange must be monotonically non-decreasing ' + arr` essentially calculates `arr.toString()` which has O(n) complexity.
Since it is recalculated in a for loop, we end up with `checkValidInputRange` having a O(n²) complexity. Which means ~10k operations if the array has a size close to 100.

## Changelog

[General] [Fixed] - Fix performance issue on Animated.interpolate with big input range

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

Test Plan:
[Here's a repo](https://github.com/Almouro/AnimatedInterpolationRepro) reproducing the issue.
The branch `fix` includes the fix.
Clicking `Interpolate` runs:

```js
new Animated.Value(0).interpolate({
  inputRange: Array(144)
    .fill()
    .map((_, i) => 1 / (i + 1))
    .reverse(),
  outputRange: Array(144)
    .fill()
    .map((_, i) => 1 / (i + 1))
```

Here's a comparison of JS thread perf before the fix and after the fix:
- on a Samsung J3 2017 (lower end)
- using Flipper and https://github.com/bamlab/react-native-performance)
- ` __DEV__` mode deactivated
- clicking the button and waiting 15s

| Before   |      After      |
|----------|:-------------:|
| ![image](https://user-images.githubusercontent.com/4534323/162413692-307c2be1-5c7f-4e7f-ba69-8ba8d7c52bda.png) |  ![image](https://user-images.githubusercontent.com/4534323/162413842-780f12d2-ce8b-457c-b66c-c6d86f14ed28.png)|

The error still throws if `inputRange` is incorrect:

<img width="517" alt="image" src="https://user-images.githubusercontent.com/4534323/162439219-6ce120ae-98e5-496b-899a-492978689d6d.png">

However if `__DEV__` mode is deactivated, no error is thrown

Reviewed By: yungsters

Differential Revision: D35507441

Pulled By: javache

fbshipit-source-id: 36ac49422f7a42d247130c42d12248b2be1232c6
2022-04-11 10:37:33 -07:00
Fadi Quader e14736589e Bump 'async' from v2.4.2 to v3.2.2 to fix a prototype pollution exploit (#802)
Summary:
## Summary
The PR is essentially to update [async](https://www.npmjs.com/package/async) to version [3.2.2](https://github.com/caolan/async/blob/master/CHANGELOG.md#v322) to fix t a  [prototype pollution exploit](https://security.snyk.io/vuln/SNYK-JS-ASYNC-2441827) found in versions < `3.2.2` . The vulnerability was discovered by [Snyk](https://snyk.io/) has discovered an exploit in  and labelled as **High Severity**.

Changelog: [Internal]

X-link: https://github.com/facebook/metro/pull/802

Reviewed By: GijsWeterings

Differential Revision: D35543054

Pulled By: robhogan

fbshipit-source-id: b176c584dbcb139115e466a765e3efbe6f1f984d
2022-04-11 10:12:16 -07:00
Simek 77d2834c7e Circle CI: switch to next-gen images (#33590)
Summary:
<img width="819" alt="Screenshot 2022-04-07 at 20 42 30" src="https://user-images.githubusercontent.com/719641/162288224-1f360edd-3d9f-4f82-aac9-341d97480dfc.png">

This PR switches the Circle CI images to the next-gen ones, according to the migration guide.

With new images, specifying the minor version is required, and I have selected the latest version for each major release.

References:
* https://discuss.circleci.com/t/legacy-convenience-image-deprecation/41034
* https://circleci.com/developer/images/image/cimg/node

 ---

Orbs are still using the full `circleci` name, however during the update I have spotted that used Windows Orb is quite outdated. I will push another PR and try the Orb bump in there, unless there is a reason, why the specific Orb version is used.

## Changelog

N/A

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

Test Plan: Run the CI.

Reviewed By: neildhar, sshic

Differential Revision: D35550086

Pulled By: cortinico

fbshipit-source-id: b37aa9c8157b5b4f7ab3d9aac20dcb5aed028482
2022-04-11 09:39:10 -07:00
Marces Engel dac56ce077 fix: Android headless JS timeout (#33044)
Summary:
Fixes https://github.com/facebook/react-native/issues/33043 and thereby https://github.com/invertase/react-native-firebase/issues/3955.

The issue arised because when there currently is no available React context, `HeadlessJsTaskService` will create a new one in background and start the task using `onReactContextInitialized` of `ReactInstanceManager.addReactInstanceEventListener`.
7ef14af81f/ReactAndroid/src/main/java/com/facebook/react/HeadlessJsTaskService.java (L94-L113)
The `TimingModule` however is initialized asynchronously, meaning the headless JS is started before its initialization. That's an issue because the `TimingModule` is only run when there is JS code executing (meaning if the application is running or there is a headless task running) - this is checked by registering a `HeadlessJsTaskEventListener` on the `HeadlessJsTaskContext` in `TimingModule.initialize()`.
7ef14af81f/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.java (L69-L75)
However this event listener is never invoked because the task was started before `TimingModule.initialize()` is called -> `TimingModule.onHeadlessJsTaskStart(...)` is not called and the timer never resumes.

In order to fix this we can just invoke `HeadlessJsTaskEventListener.onHeadlessJsTaskStart(...)` for all currently running tasks when a new listener is added to `HeadlessJsTaskContext`. This call then needs to be `synchronized` as otherwise there's a race condition with `HeadlessJsTaskContext.finishTask(...)` where `onHeadlessJsTaskFinish(...)` could be called before `onHeadlessJsTaskStart(...)`. See the diff for the exact changes.

## 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] [Fix] - Fixed `TimingModule` related functions for headless JS tasks, eg. `setTimeout`

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

Test Plan: I did a local build with the changes and tested the provided example code from https://github.com/facebook/react-native/issues/33043 there.

Reviewed By: sshic

Differential Revision: D34006573

Pulled By: dmitryrykun

fbshipit-source-id: d6a821bbd6476ba278c1d8895edb4a0ba16d889e
2022-04-11 06:58:37 -07:00
Kudo Chien 65abc361bf Fix ios build error when podfile generate_multiple_pod_projects=true and fabric is on (#33381)
Summary:
there are build errors happened when in [`generate_multiple_pod_projects`](https://blog.cocoapods.org/CocoaPods-1.7.0-beta/#multiple-xcodeproj-generation) mode and fabric is on. since we have multiple pod projects, there are something breaks.

### `-DRCT_NEW_ARCH_ENABLED=1` does not pass to `RCTAppSetupUtils.mm`

because `installer.pods_project` is targeting `Pods.xcodeproj` but not `React-Core.xcodeproj`. we should use ` installer.target_installation_results.pod_target_installation_results` to deal with `generate_multiple_pod_projects` mode.

### fatal error: 'CompactValue.h' file not found

```
In file included from /path/to/react-native/packages/rn-tester/build/generated/ios/react/renderer/components/rncore/Props.cpp:11:
In file included from /path/to/react-native/packages/rn-tester/Pods/Headers/Private/React-Codegen/react/renderer/components/rncore/Props.h:13:
In file included from /path/to/react-native/packages/rn-tester/Pods/Headers/Private/React-Fabric/react/renderer/components/view/ViewProps.h:11:
In file included from /path/to/react-native/packages/rn-tester/Pods/Headers/Private/React-Fabric/react/renderer/components/view/YogaStylableProps.h:10:
/path/to/react-native/packages/rn-tester/Pods/Headers/Public/Yoga/yoga/YGStyle.h:16:10: fatal error: 'CompactValue.h' file not found
#include "CompactValue.h"
         ^~~~~~~~~~~~~~~~
1 error generated.
```

`Props.cpp` -> `YogaStylableProps.h` -> `YGStyle.h` -> `CompactValue.h`
[`CompactValue.h` is internal private header for Yoga pod](4eef075a58/ReactCommon/yoga/Yoga.podspec (L54-L56)) where `React-Codegen` project cannot access to.

~there are some solutions toward this problem. one way is to make other yoga headers as public headers. i am not sure whether this solution would introduce any side effects. so i only make necessary projects to search yoga private headers.~

Update: a solution is to expose all yoga headers publicly.  however, CocoaPods will put all public headers to module umbrella header. this will break YogaKit (swift) integration because swift module doesn't support c++. my pr is trying to expose all yoga headers to `$PODS_ROOT/Headers/Public/Yoga/yoga`, but use custom `module_map` to control which headers should be exposed to the swift module. CocoaPods's custom module_map has some limitation where cannot well support for both `use_frameworks!` mode and non use_frameworks! mode. there's a workaround to use `script_phase` copying the umbrella header to right place.

## Changelog

[iOS] [Fixed] - Fix iOS build error when Podfile `generate_multiple_pod_projects=true` and Fabric is on

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

Test Plan:
verify with rn-tester

1. add `generate_multiple_pod_projects`

```diff
 --- a/packages/rn-tester/Podfile
+++ b/packages/rn-tester/Podfile
@@ -5,7 +5,7 @@ platform :ios, '11.0'

 # Temporary solution to suppress duplicated GUID error.
 # Can be removed once we move to generate files outside pod install.
-install! 'cocoapods', :deterministic_uuids => false
+install! 'cocoapods',  :generate_multiple_pod_projects => true, :deterministic_uuids => false

 USE_FRAMEWORKS = ENV['USE_FRAMEWORKS'] == '1'

```

2. pod install and build rn-tester from xcode

Reviewed By: cortinico

Differential Revision: D34844041

Pulled By: dmitryrykun

fbshipit-source-id: 93311b56d8e44491307a911ad58442f267c979eb
2022-04-11 06:04:20 -07:00
Riccardo Cipolleschi 0480f56c5b Introduce .xcode.env configuration file to source `node` (#33546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33546

This Diff does 2 things:
1. Removes all the remnant of the `find-node.sh` script. This allows React Native to stay agnostic from any other node manager
2. Introduces a way for the developers to specify which `node` executable they want to use, through a simple `.env` file.

## Changelog
[iOS][Changed] - This PR removes the `find-node.sh` scripts and replaces it with an `.xcode.env` file that is sourced by the script phases that needs it. The `.xcode.env` file is versioned: to customize a local environment, an unversioned `.xcode.local.env` can be used.

Reviewed By: cortinico

Differential Revision: D35317070

fbshipit-source-id: 4b400ba56aa2d574db563fa67b2008e1ddde1c59
2022-04-11 02:50:57 -07:00
Danilo Bürger 61b013e7ad Allow modifying iOS image cache limits (#33554)
Summary:
Allow modifying iOS image cache limits. Currently the image cache imposes some strict limits:

[NSCache.totalCostLimit](https://developer.apple.com/documentation/foundation/nscache/1407672-totalcostlimit?language=objc) of 20MB.
Single Image Size Limit of 2MB (bitmap size).

This may not be enough for applications that make heavy use of images. With this commit it is possible to fine tune them to the applications need.

This can be set for example in the App Delegate with:

```objc
RCTSetImageCacheLimits(4*1024*1024, 200*1024*1024);
```
This would increase the single image size limit to 4 MB and the total cost limit to 200 MB.

## Changelog

[iOS] [Added] - Allow modifying iOS image cache limits

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

Test Plan: There is no easy way to test this except adding the above snippet and checking via break points that the new limits are used.

Reviewed By: cipolleschi

Differential Revision: D35485914

Pulled By: cortinico

fbshipit-source-id: 646cf7cab5ea5258d0d0d0bce6383317e27e4445
2022-04-08 09:00:06 -07:00
Simek 09b06485e9 GitHub: update workflow actions (#33595)
Summary:
This PR updates the GitHub actions uses in the repository workflows.

## Changelog

N/A

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

Test Plan: Run the workflows.

Reviewed By: rickhanlonii

Differential Revision: D35495697

Pulled By: cortinico

fbshipit-source-id: a41a83dc61f199f9acbc0ce28d6a23fafc94a99c
2022-04-08 06:26:47 -07:00
Nicola Corti bfc39353d1 Do not specify a Kotlin version in the RN rootProject (#33589)
Summary:
As we introduced KGP inside `ReactAndroid` (cc ShikaSD), we now need to specify a version for it (as users will consume that build on Android New Architecture.

Currently, the version is loaded in the RN `rootProject` which is not available on user's project. I'm cleaning this up.

## Changelog

[Internal] - Do not specify a Kotlin version in the RN rootProject

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

Test Plan:
Tested on a nightly version with

```
npx react-native init RNNightly --version nightly
```

Reviewed By: mdvacca

Differential Revision: D35476777

Pulled By: cortinico

fbshipit-source-id: 5a819ef5fa9a6886d7b7b683f31d59cb05a49f29
2022-04-08 03:44:56 -07:00
Vincent Riemer 3693928fb8 Add mechanism for iOS native components to expose capturing-only events
Summary: Changelog: [Internal] Add mechanism for iOS native components to expose capturing-only events

Reviewed By: lunaleaps

Differential Revision: D35328883

fbshipit-source-id: 0becb5e26ede3a12a69b0eb41fb15742422f5a4f
2022-04-07 14:07:58 -07:00
Vincent Riemer 179c24e255 Emit touch-equivalent W3C pointer events on iOS
Summary: Changelog: [Internal] Emit touch-equivalent W3C pointer events on iOS

Reviewed By: lunaleaps

Differential Revision: D35295104

fbshipit-source-id: 1c1d5a4159bbfed92df151f7e12a4973ec44e970
2022-04-07 14:07:58 -07:00