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

26694 Коммитов

Автор SHA1 Сообщение Дата
Lulu Wu 6d45e49dc7 Align creation of FabricUIManager with bridge
Summary:
- Bridgeless is using a deprecated FabricUIManager constructor which bridge doesn't use, and is the only one using it, this diff migrated bridgeless to use the same FabricUIManager constructor as bridge
- Remove static view config check (mShouldDeallocateEventDispatcher), instead use Bridgeless check since SVC is enabled in Bridgeless but not in Bridge.

Changelog:
[Android][Changed] - Align creation of FabricUIManager with bridge

Reviewed By: javache

Differential Revision: D42681489

fbshipit-source-id: b9c7c4a81a98db52e881138cc85be0e85df636d9
2023-02-02 05:35:47 -08:00
Luna Wei 1e53f88b72 PointerEvents: Account for root view exits
Summary:
Changelog: [Internal] Support hovering in/out of root views

Prior to this change, we did not have signal when an input device moved out of the root view and so our internal state would not be aware and we would not trigger enter/leave events.

This diff starts listening to `HOVER_EXIT` events as dispatched from `onInterceptHoverEvent` and assumes that's the right event to signal a cursor has moved out of the root view. We dispatch the relevant leave events for this case and update our internal state to ensure the next `HOVER_MOVE` in our rootview, will properly dispatch the enter events.

## Investigation for creating this diff

Determining the signal for when an inputDevice enters/exits our rootview wasn't straight-forward.

From my understanding Android event dispatching follows a similar capture, bubbling phase as web. With `onIntercept..` handlers to swallow events. See this explanation: https://suragch.medium.com/how-touch-events-are-delivered-in-android-eee3b607b038 and this video talk: https://youtu.be/EZAoJU-nUyI?t=929

However when trying to understand hover enter/exit events on the root view, my understanding of this logic broke down.

Here's what confused me:
* When moving a cursor from inside to outside the root view, I would receive `HOVER_ENTER/EXIT` MotionEvents on `onInterceptHoverEvent` and since we did not swallow them, we'd receive those same events on the bubble up in `onHover`. That makes sense.
* However, when I hovered from the rootview into a child view, I would receive MotionEvents of `HOVER_ENTER/HOVER_EXIT` in the `onHoverEvent` handler of the rootview without having seen them in the `onInterceptHoverEvent` (re: capture phase down). This was confusing, where was the capture down?
* What tips me off that these events (`HOVER_ENTER/EXIT`) don't follow the classic capture, bubbling model as explained in the linked article, is that I don't receive `HOVER_ENTER/HOVER_EXIT` events for each child view in the root view's `onInterceptHoverEvent`.
   * Like when a cursor moves from root -> child, I'd expect to motion events 1. exit for the rootview, 2. enter for the child view. But I never receive the 2. from the root view --
   * I also wonder if the wording for `HOVER_EXIT` events mean that these events are directly dispatched to the view? Re: ["This action is always delivered to the window or view that was previously under the pointer."](https://developer.android.com/reference/android/view/MotionEvent#ACTION_HOVER_ENTER)
* There also seems to be some optimizations around the dispatch path as mentioned in this video at this timestamp: https://youtu.be/EZAoJU-nUyI?t=929 for the UP gesture.. so maybe there's some optimization happening with hover events? I'm not sure how hover events are account for in gesture handling for Android.

Reviewed By: vincentriemer

Differential Revision: D42817315

fbshipit-source-id: 412c971c1d1e7afc0d67fadcc4417189967fe48c
2023-02-01 23:52:16 -08:00
eps1lon a0800ffc7a Add `borderCurve` and `pointerEvents` to `ViewStyle` (#35998)
Summary:
Forward-porting https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64125

## Changelog

[GENERAL] [FIXED] - Add `borderCurve` and `pointerEvents` to `ViewStyle`

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

Test Plan: - [x] https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64125 green

Reviewed By: christophpurrer

Differential Revision: D42906357

Pulled By: lunaleaps

fbshipit-source-id: 6a5763cf7880888462fbabe1a00e560065c9a551
2023-02-01 12:20:40 -08:00
Lorenzo Sciandra 95b995270a add 0.71.2 changelog (#36032)
Summary:
Adds changelog for new patch.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - add changelog entry for 0.71.2

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D42928179

Pulled By: cipolleschi

fbshipit-source-id: 1eb7b399e58c6e78a6961dc98198fb747df5ceb3
2023-02-01 10:04:51 -08:00
Dmitry Rykun e18787e7b5 Update changelog for 0.70.7 (#36018)
Summary:
This PR updates the Changelog for release 0.70.7

## Changelog

[Internal] - Update Changelog

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

Test Plan: CircleCI

Reviewed By: cortinico

Differential Revision: D42928093

Pulled By: cipolleschi

fbshipit-source-id: 25c23eeb47e4ffe34884db5b8adc514c235c2c77
2023-02-01 10:04:51 -08:00
Zihan Chen (MSFT) bf34810c5c Turbo module codegen support interface with inheritance in module (#36011)
Summary:
The [previous pull request](https://github.com/facebook/react-native/pull/35812) enables defining interfaces and using them in a turbo module, but all members are flattened, this is not the best option for codegen for object oriented languages.

In this pull request, an optional member `baseTypes` is added to aliased objects. Members are still flattened for backward compatibility, if a codegen doesn't care about that nothing needs to be changed.

### Example

```typescript
interface A {
  a : string;
}

interface B extends A {
  b : number;
}
```

#### Before the previous pull request

`interface` is not allowed here, you must use type alias.

#### At the previous pull request

`interface` is allowed, but it is translated to

```typescript
type A = {a : string};
type B = {a : string, b : number};
```

#### At this pull request

Extra information is provided so that you know `B` extends `A`. By comparing `B` to `A` it is easy to know that `B::a` is obtained from `A`.

## Changelog

[GENERAL] [CHANGED] - Turbo module codegen support interface with inheritance in module

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

Test Plan: `yarn jest react-native-codegen` passed

Reviewed By: rshest

Differential Revision: D42882650

Pulled By: cipolleschi

fbshipit-source-id: 32d502e8a99c4151fae0a1f4dfa60db9ac827963
2023-01-31 12:05:46 -08:00
gabrieldonadel 597a1ff60b feat: Add logical border block color properties (#35999)
Summary:
This PR implements logical border block color properties as requested on https://github.com/facebook/react-native/issues/34425. This implementation includes the addition of the following style properties

- `borderBlockColor`, equivalent to `borderTopColor` and `borderBottomColor`.
- `borderBlockEndColor`, equivalent to `borderBottomColor`.
- `borderBlockStartColor`, equivalent to `borderTopColor`.

## Changelog

[GENERAL] [ADDED] - Add logical border block color properties

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

Test Plan:
1. Open the RNTester app and navigate to the `View` page
2. Test the new style properties through the `Logical Border Color` section

<table>
<tr>
    <td>Android</td>
    <td>iOS</td>
</tr>
  <tr>
    <td><video src="https://user-images.githubusercontent.com/11707729/215384882-5b96518e-ad70-4157-a7f3-130f488cc41c.mov"  alt="1" width="360px"   />
    </td>
<td>
<video src="https://user-images.githubusercontent.com/11707729/215392728-cfc6a097-26c1-4ffe-ab0e-f0a5a71a902d.mov"2" width="360px"  />
</td>
   </tr>
</table>

Reviewed By: cipolleschi

Differential Revision: D42849911

Pulled By: jacdebug

fbshipit-source-id: 822cff5264689c42031d496105537032b5cd31ef
2023-01-31 10:58:24 -08:00
Samuel Susla dea48e2248 React Native sync for revisions 17f6912...48b687f
Summary:
This sync includes the following changes:
- **[48b687fc9](https://github.com/facebook/react/commit/48b687fc9 )**: [trusted types][www] Add enableTrustedTypesIntegration flag back in ([#26016](https://github.com/facebook/react/pull/26016)) //<an onion>//
- **[9b1423cc0](https://github.com/facebook/react/commit/9b1423cc0 )**: Revert "Hold host functions in var" ([#26079](https://github.com/facebook/react/pull/26079)) //<Samuel Susla>//
- **[ce09ace9a](https://github.com/facebook/react/commit/ce09ace9a )**: Improve Error Messages when Access Client References ([#26059](https://github.com/facebook/react/pull/26059)) //<Sebastian Markbåge>//
- **[0652bdbd1](https://github.com/facebook/react/commit/0652bdbd1 )**: Add flow types to Maps in ReactNativeViewConfigRegistry.js ([#26064](https://github.com/facebook/react/pull/26064)) //<Samuel Susla>//
- **[ee8509801](https://github.com/facebook/react/commit/ee8509801 )**: [cleanup] remove deletedTreeCleanUpLevel feature flag ([#25529](https://github.com/facebook/react/pull/25529)) //<Jan Kassens>//
- **[0e31dd028](https://github.com/facebook/react/commit/0e31dd028 )**: Remove findDOMNode www shim ([#25998](https://github.com/facebook/react/pull/25998)) //<Jan Kassens>//
- **[379dd741e](https://github.com/facebook/react/commit/379dd741e )**: [www] set enableTrustedTypesIntegration to false ([#25997](https://github.com/facebook/react/pull/25997)) //<Jan Kassens>//
- **[555ece0cd](https://github.com/facebook/react/commit/555ece0cd )**: Don't warn about concurrently rendering contexts if we finished rendering ([#22797](https://github.com/facebook/react/pull/22797)) //<Sebastian Silbermann>//
- **[0fce6bb49](https://github.com/facebook/react/commit/0fce6bb49 )**: [cleanup] remove feature flags warnAboutDefaultPropsOnFunctionComponents and warnAboutStringRefs ([#25980](https://github.com/facebook/react/pull/25980)) //<Jan Kassens>//
- **[7002a6743](https://github.com/facebook/react/commit/7002a6743 )**: [cleanup] remove unused values from ReactFeatureFlags.www-dynamic ([#25575](https://github.com/facebook/react/pull/25575)) //<Jan Kassens>//
- **[a48e54f2b](https://github.com/facebook/react/commit/a48e54f2b )**: [cleanup] remove old feature flag warnAboutDeprecatedLifecycles ([#25978](https://github.com/facebook/react/pull/25978)) //<Jan Kassens>//
- **[0f4a83596](https://github.com/facebook/react/commit/0f4a83596 )**: Remove duplicate JSResourceReferenceImpl mock ([#25976](https://github.com/facebook/react/pull/25976)) //<Jan Kassens>//
- **[c49131669](https://github.com/facebook/react/commit/c49131669 )**: Remove unused Flow suppressions ([#25977](https://github.com/facebook/react/pull/25977)) //<Jan Kassens>//
- **[afe6521e1](https://github.com/facebook/react/commit/afe6521e1 )**: Refactor: remove useless parameter ([#25923](https://github.com/facebook/react/pull/25923)) //<Chris>//
- **[34464fb16](https://github.com/facebook/react/commit/34464fb16 )**: Upgrade to Flow 0.196.3 ([#25974](https://github.com/facebook/react/pull/25974)) //<Jan Kassens>//
- **[e2424f33b](https://github.com/facebook/react/commit/e2424f33b )**: [flow] enable exact_empty_objects ([#25973](https://github.com/facebook/react/pull/25973)) //<Jan Kassens>//
- **[0b4f44302](https://github.com/facebook/react/commit/0b4f44302 )**: [flow] enable enforce_local_inference_annotations ([#25921](https://github.com/facebook/react/pull/25921)) //<Jan Kassens>//
- **[0b974418c](https://github.com/facebook/react/commit/0b974418c )**: [Fizz] Fork Fizz instruction set for inline script and external runtime ([#25862](https://github.com/facebook/react/pull/25862)) //<mofeiZ>//
- **[5379b6123](https://github.com/facebook/react/commit/5379b6123 )**: Batch sync, default and continuous lanes ([#25700](https://github.com/facebook/react/pull/25700)) //<Tianyu Yao>//
- **[bbf4d2211](https://github.com/facebook/react/commit/bbf4d2211 )**: Update import for babel-code-frame in build script ([#25963](https://github.com/facebook/react/pull/25963)) //<Ming Ye>//
- **[b83baf63f](https://github.com/facebook/react/commit/b83baf63f )**: Transform updates to support Flow this annotation syntax ([#25918](https://github.com/facebook/react/pull/25918)) //<Jan Kassens>//
- **[c2d655207](https://github.com/facebook/react/commit/c2d655207 )**: Unify `use` and `renderDidSuspendDelayIfPossible` implementations ([#25922](https://github.com/facebook/react/pull/25922)) //<Andrew Clark>//
- **[48274a43a](https://github.com/facebook/react/commit/48274a43a )**: Remove vestigial Suspense batching logic ([#25861](https://github.com/facebook/react/pull/25861)) //<Andrew Clark>//
- **[de7d1c907](https://github.com/facebook/react/commit/de7d1c907 )**: Add `fetchPriority` to `<img>` and `<link>` ([#25927](https://github.com/facebook/react/pull/25927)) //<Steven>//
- **[81d4ee9ca](https://github.com/facebook/react/commit/81d4ee9ca )**: reconciler docs: fix small typo - "mode" (instead of "node") ([#25863](https://github.com/facebook/react/pull/25863)) //<satelllte>//
- **[5fcf1a4b4](https://github.com/facebook/react/commit/5fcf1a4b4 )**: Bugfix: Synchronous ping during render phase sometimes unwinds the stack, leading to crash ([#25851](https://github.com/facebook/react/pull/25851)) //<Andrew Clark>//
- **[2b1fb91a5](https://github.com/facebook/react/commit/2b1fb91a5 )**: ESLint upgrade to use hermes-eslint ([#25915](https://github.com/facebook/react/pull/25915)) //<Jan Kassens>//
- **[fabef7a6b](https://github.com/facebook/react/commit/fabef7a6b )**: Resubmit Add HydrationSyncLane ([#25878](https://github.com/facebook/react/pull/25878)) //<Tianyu Yao>//
- **[7efa9e597](https://github.com/facebook/react/commit/7efa9e597 )**: Fix unwinding context during selective hydration ([#25876](https://github.com/facebook/react/pull/25876)) //<Tianyu Yao>//
- **[84a0a171e](https://github.com/facebook/react/commit/84a0a171e )**: Rename experimental useEvent to useEffectEvent ([#25881](https://github.com/facebook/react/pull/25881)) //<Sebastian Markbåge>//
- **[4dda96a40](https://github.com/facebook/react/commit/4dda96a40 )**: [react-www] remove forked bundle ([#25866](https://github.com/facebook/react/pull/25866)) //<Jan Kassens>//
- **[9c09c1cd6](https://github.com/facebook/react/commit/9c09c1cd6 )**: Revert "Fork ReactDOMSharedInternals for www ([#25791](https://github.com/facebook/react/pull/25791))" ([#25864](https://github.com/facebook/react/pull/25864)) //<lauren>//
- **[996e4c0d5](https://github.com/facebook/react/commit/996e4c0d5 )**: Offscreen add attach ([#25603](https://github.com/facebook/react/pull/25603)) //<Samuel Susla>//
- **[b14d7fa4b](https://github.com/facebook/react/commit/b14d7fa4b )**: Add support for setNativeProps to Fabric ([#25737](https://github.com/facebook/react/pull/25737)) //<Samuel Susla>//
- **[819687279](https://github.com/facebook/react/commit/819687279 )**: [Float] Fix typo in ReactDOMResourceValidation.js ([#25798](https://github.com/facebook/react/pull/25798)) //<Ikko Ashimine>//
- **[5dfc485f6](https://github.com/facebook/react/commit/5dfc485f6 )**: fix tests for when float is off ([#25839](https://github.com/facebook/react/pull/25839)) //<Josh Story>//
- **[bfcbf3306](https://github.com/facebook/react/commit/bfcbf3306 )**: toString children of title ([#25838](https://github.com/facebook/react/pull/25838)) //<Sebastian Markbåge>//
- **[d4bc16a7d](https://github.com/facebook/react/commit/d4bc16a7d )**: Revert "[react-www] remove forked bundle" ([#25837](https://github.com/facebook/react/pull/25837)) //<Ricky>//
- **[d69b2cf82](https://github.com/facebook/react/commit/d69b2cf82 )**: [bug fix] revert values in ReactFiberFlags to keep consistency for devtools ([#25832](https://github.com/facebook/react/pull/25832)) //<Mengdi Chen>//
- **[645ae2686](https://github.com/facebook/react/commit/645ae2686 )**: [react-www] remove forked bundle ([#25831](https://github.com/facebook/react/pull/25831)) //<Jan Kassens>//
- **[d807eb52c](https://github.com/facebook/react/commit/d807eb52c )**: Revert recent hydration changes ([#25812](https://github.com/facebook/react/pull/25812)) //<Andrew Clark>//
- **[2ccfa657d](https://github.com/facebook/react/commit/2ccfa657d )**: Fork ReactDOMSharedInternals for www ([#25791](https://github.com/facebook/react/pull/25791)) //<lauren>//
- **[f0534ae94](https://github.com/facebook/react/commit/f0534ae94 )**: Avoid replaying SelectiveHydrationException in dev ([#25754](https://github.com/facebook/react/pull/25754)) //<Tianyu Yao>//
- **[7fab379d8](https://github.com/facebook/react/commit/7fab379d8 )**: fix link to ReactDOMHostconfig in reconciler docs ([#25788](https://github.com/facebook/react/pull/25788)) //<Dmitry>//
- **[500c8aa08](https://github.com/facebook/react/commit/500c8aa08 )**: Add component name to StrictMode error message ([#25718](https://github.com/facebook/react/pull/25718)) //<Samuel Susla>//
- **[353c30252](https://github.com/facebook/react/commit/353c30252 )**: Hold host functions in var ([#25741](https://github.com/facebook/react/pull/25741)) //<Samuel Susla>//

Changelog:
[General][Changed] - React Native sync for revisions 17f6912...48b687f

jest_e2e[run_all_tests]

Reviewed By: rubennorte

Differential Revision: D42855483

fbshipit-source-id: c244a595bb2d490a23b333c1b16d04a459ec94fc
2023-01-31 09:17:55 -08:00
Dmitry Rykun b086e5dc0a chore: Add changelog for 0.68.6 and 0.69.8 (#36010)
Summary:
Create changelog for 0.69.8

## Changelog
[Internal] [Changed] - add changelog entry for 0.69.8

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

Test Plan: N/A

Reviewed By: rshest

Differential Revision: D42882254

Pulled By: dmytrorykun

fbshipit-source-id: 2cf12ab1898d292bd525d9c357203c69b58b3247
2023-01-31 08:01:08 -08:00
Nicola Corti 9e4b4ef2d5 Remove the `react-native-bot` context from CircleCI
Summary:
While working on T143721371 I've noticed that we still have an exposed context
for `react-native-bot` which gives access to `PAT_TOKEN` and `PAT_USERNAME`.
As those two variables are unused, we can fully clean this us.

Changelog:
[Internal] [Changed] - Remove the `react-native-bot` context from CircleCI

Reviewed By: cipolleschi

Differential Revision: D42886196

fbshipit-source-id: 4eba7a53557fe7af7d87650052630eea2d2d3934
2023-01-31 08:00:08 -08:00
Krystof Woldrich 86852f8cb5 Fix displayed name when codegen dependency is not found (#36013)
Summary:
The fixed error guides users toward the right missing dependency. The original error pointed to the old name.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[INTERNAL] [FIXED] - Display correct codegen dependency name when not found

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [FIXED] - Display correct codegen dependency name when not found

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

Test Plan: This is an error message wording change.

Reviewed By: jacdebug

Differential Revision: D42881807

Pulled By: cipolleschi

fbshipit-source-id: d96fb867cfe27ae922d398ab981f5797cb51a269
2023-01-31 02:54:19 -08:00
Jordan Eldredge 83743e1edf Update React Native's synced sort-imports lint rule
Summary:
Changelog:
[Internal][Changed] - Update synced sort-import lint rule to newest version

Reviewed By: yungsters

Differential Revision: D42779224

fbshipit-source-id: bd388c258e5882331fd20d7313b4717a6b88f611
2023-01-30 17:05:25 -08:00
Sebastian Silbermann 8568b93733 react-native: Use number literals in TypeScript types for `FileReader` and `XMLHttpRequest` states (#36000)
Summary:
Mostly to improve compat in codebases where `lib.dom.d.ts` is loaded alongside RN. TS 5.0 updates to `lib.dom.d.ts` added number literals for these states as well so the abstract `number` type from RN was no longer compatible.

Forward-port of https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64144

Underlying flow types:
- https://github.com/facebook/react-native/blob/v0.71.1/Libraries/Blob/FileReader.js#L33-L35
- https://github.com/facebook/react-native/blob/v0.71.1/Libraries/Network/XMLHttpRequest.js#L54-L58

## Changelog

[GENERAL] [CHANGED] - Use number literals in TypeScript types for `FileReader` and `XMLHttpRequest` states

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

Test Plan: - [x] https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64144 green

Reviewed By: christophpurrer

Differential Revision: D42849886

Pulled By: jacdebug

fbshipit-source-id: c3cf2ac4f5f53ab889a9190583486da4627d3dcc
2023-01-30 15:13:31 -08:00
Genki Kondo 115dbe9433 In onLayoutChange, only scroll if the view is shown and the content view is ready
Summary:
ScrollViews don't properly maintain position where they are hidden and shown. When a ScrollView's content is laid out, onLayoutChange is triggered. This is also fired when the views are hidden, which is not desirable as the layout may not be accurate when the view is hidden. Check that the scroll view is showing before attempting a scroll.

Changelog:
[Internal][Fixed] - In onLayoutChange, only scroll if the view is shown and the content view is ready

Reviewed By: sshic

Differential Revision: D42808119

fbshipit-source-id: 0197ae55fa7d80e52c2ea483609e62d512a117f3
2023-01-30 14:06:37 -08:00
Genki Kondo 9e65ba2b7b In onLayout, only scroll if the content view is ready
Summary:
ScrollViews don't properly maintain position where they are hidden and shown. There is an edge case where on onLayout for a ScrollView, its content may not have been laid out yet. This happens in some cases when a scroll view is hidden via display: 'none' (resulting in setVisibility(INVISIBLE)). Check that the content view is laid out before attempting a scroll.

Changelog:
[Internal][Fixed] - In onLayout, only scroll if the content view is ready

Reviewed By: sshic

Differential Revision: D42794750

fbshipit-source-id: 654a380bcae306da2704d3e190423c8de125833d
2023-01-30 11:55:13 -08:00
Genki Kondo 47903d0c62 Restore scroll position when scroll view is hidden and shown
Summary:
ScrollViews don't properly maintain position where they are hidden and shown. On iOS, when a UIScrollView (or its ancestor) is hidden, its scroll position is set to 0 (its window also becomes nil). When it is shown again, its scroll position is not restored.

When a scroll is attempted when the scroll view is hidden, we keep track of the last known offset before it was hidden. Then, in updateLayoutMetrics (which is triggered when the view is shown), we apply the pending offset if there is one. This is [consistent with Android's behavior in ReactScrollView.java](https://www.internalfb.com/code/fbsource/[2930f8c146af62ad63673c8d34e9876b77634c05]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java?lines=289).

Changelog:
[Internal][Fixed] - In onLayoutChange, only scroll if the view is shown and the content view is ready

Reviewed By: cipolleschi

Differential Revision: D42815359

fbshipit-source-id: 4b209c1e54edf3f5c0bea902b48450a1a2e9661a
2023-01-30 11:10:51 -08:00
Nicola Corti c0004092f9 RNGP - Properly set the `jsRootDir` default value (#35992)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35992

Fixes https://github.com/software-mansion/react-native-gesture-handler/issues/2382

I've just realized that the default value fo `jsRootDir` is not entirely correct.
That's the root of the folder where the codegen should run.

For apps, it should be defaulted to `root` (i.e. ../../)
For libraries, it should be defaulted to `../` (currently is root).

This causes a problem where libraries without either a `codegenConfig` or a `react{ jsRootDir = ... }`
specified in the build.gradle will be invoking the codegen and generating duplicated symbols.

Changelog:
[Android] [Fixed] - RNGP - Properly set the `jsRootDir` default value

Reviewed By: cipolleschi

Differential Revision: D42806411

fbshipit-source-id: ffe45f9684a22494cc2e4d0a19de9077cb341365
2023-01-30 06:50:24 -08:00
Vitali Zaidman 112c89e810 refactor: Renamed emitPartial to emitObject (#35982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35982

This reflects better what the former `emitPartial` was doing - emitting an object with set props.

Changelog: [Internal] - Renamed emitPartial to emitObject

Reviewed By: christophpurrer

Differential Revision: D42740958

fbshipit-source-id: 4f974c6911bc129e698323a8039bbd7aa7602461
2023-01-30 06:34:32 -08:00
Vitali Zaidman 84c1547526 refactor: Renamed emitObject to emitGenericObject (#35981)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35981

This reflects better what the former `emitObject` was doing - emitting a generic object.

It would also allow us to rename `emitPartial` to `emitObject` in the next diff whence the function name `emitObject` will be free.

Changelog: [Internal] - Renamed emitObject to emitGenericObject

Reviewed By: christophpurrer

Differential Revision: D42740871

fbshipit-source-id: 1b9112464695b8abeccc95eed908b0b45a0e3bf2
2023-01-30 06:34:32 -08:00
Ruslan Lesiutin 9856c334bd fix(publishing-bumped-packages): look for status code instaead of stderr (#36004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36004

Changelog: [Internal]

This fixes CircleCI job, which is responsible for publishing bumped packages. We should not check for `stderr`, apparently `npm` uses it to store debug information:
- https://github.com/npm/npm/issues/118#issuecomment-325440

So we've tried to use this on 0.71-stable before and it succesfully published one package, but have exited right after it because `stderr` was not empty

Reviewed By: cortinico, cipolleschi

Differential Revision: D42836212

fbshipit-source-id: 6f2a9a512121683268fe6aae6a187fccb8d9dfbc
2023-01-30 06:22:12 -08:00
Riccardo Cipolleschi 8056cd7f05 Add Tests in CircleCI to check dynamic frameworks with the old arch (#36003)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36003

This diff adds 4 tests in CircleCI to make sure we don't regress in the support of Dynamic Frameworks for the old architecture.

## Changelog
[iOS][Fixed] - Add CircleCI tests for dynamic frameworks with the Old Architecture.

Reviewed By: cortinico

Differential Revision: D42829895

fbshipit-source-id: 5669be45d4f55161a11a6ece161b2a2aa384a644
2023-01-30 04:25:26 -08:00
Riccardo Cipolleschi b3040ec624 Restore Dynamic framework with Hermes in the Old Architecture
Summary:
I discovered that 0.69 could run React Native as Dynamic framework with Hermes and starting from 0.70 that's not possible anymore.
This diff restore that possibility.

Notice that now Hermes provisdes JSI and Dynamic Frameworks requires that all the dependencies are explicitly defined, therefore, whenever we have a pod that depended on `React-jsi`, now it also has to explicitly depends on `hermes-engine`

## Changelog
[iOS][Fixed] - Add Back dynamic framework support for the Old Architecture with Hermes

Reviewed By: cortinico

Differential Revision: D42829728

fbshipit-source-id: a660e3b1e346ec6cf3ceb8771dd8bceb0dbcb13a
2023-01-30 04:25:26 -08:00
Riccardo Cipolleschi da270d038c Restore Dynamic framework with JSC in the Old Architecture
Summary:
I discovered that 0.69 and 0.70 could run React Native as Dynamic framework with JSC and starting from 0.71 that's not possible anymore.
This diff restore that possibility.

## Changelog
[iOS][Fixed] - Add Back dynamic framework support for the old architecture

Reviewed By: cortinico

Differential Revision: D42829137

fbshipit-source-id: 848672f714d8bab133e42f5e3b80202b350d5261
2023-01-30 04:25:26 -08:00
Kræn Hansen dc959c9271 Update `react-native-xcode.sh` to use `PROJECT_DIR` from Xcode (#35970)
Summary:
In a mono-repo the `react-native` package could be hoisted compared to the app directory, in which case it's not a good strategy for the `react-native-xcode.sh` script to guess the app project root relative to the location of itself. Instead I suggest to relying on a build setting provided by Xcode to derive the default app path.

I could have use the `SRCROOT` instead. According to https://stackoverflow.com/questions/36323031/what-the-different-between-srcroot-and-project-dir this is equivalent and also a bit less ambiguous as I see it. I.e. I would expect most Xcode projects to be located in the `ios` directory of the app.

As a workaround, before this merge, users can add the following to their "Bundle React Native code and images" build phase or `ios/.xcode.env` file:

```shell
export PROJECT_ROOT="$PROJECT_DIR/.."
```

This build phase can also be used for users wanting to revert this default behaviour once merged.

## Changelog

[iOS] [Changed] - Changed default `PROJECT_ROOT` (used in when bundling for iOS) to rely on the `PROJECT_DIR` build setting.

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

Test Plan:
I've updated this locally and verified this does indeed pick up the correct app path - even in a mono-repo.

To verify this:
- Instantiate the template with this patch applied.
- Update the "Run scheme"'s "Build Configuration" to "Release".
- Build the app without errors.

Reviewed By: cortinico

Differential Revision: D42842636

Pulled By: cipolleschi

fbshipit-source-id: 040c31ac59a8abec5f5b38f795c8e74649420bac
2023-01-30 04:03:31 -08:00
Samuel Susla e91e468edc React Native sync for revisions d1e35c7...17f6912
Summary:
Three problems popped up during the sync:
- https://github.com/facebook/react/commit/07f46ecf2 breaks breaks tests
- https://github.com/facebook/react/commit/6fb8133ed breaks fbsource tests. I added a workaround and created a test for the team that owns the test.
- https://fb.workplace.com/groups/flowlang/permalink/1198137807458547/ enables local type interference in fbsource but not in github React repo and some code breaks. Addressed in https://github.com/facebook/react/pull/26064

This sync includes the following changes:
- **[17f6912a4](https://github.com/facebook/react/commit/17f6912a4 )**: Add flow types to ReactFiberHooks ([#25752](https://github.com/facebook/react/pull/25752)) //<Samuel Susla>//
- **[f101c2d0d](https://github.com/facebook/react/commit/f101c2d0d )**: Remove Reconciler fork (2/2) ([#25775](https://github.com/facebook/react/pull/25775)) //<Jan Kassens>//
- **[420f0b7fa](https://github.com/facebook/react/commit/420f0b7fa )**: Remove Reconciler fork (1/2) ([#25774](https://github.com/facebook/react/pull/25774)) //<Jan Kassens>//
- **[3ba7add60](https://github.com/facebook/react/commit/3ba7add60 )**: Allow async blocks in `to(Error|Warn)Dev` ([#25338](https://github.com/facebook/react/pull/25338)) //<Sebastian Silbermann>//
- **[fa11bd6ec](https://github.com/facebook/react/commit/fa11bd6ec )**: [ServerRenderer] Add option to send instructions as data attributes ([#25437](https://github.com/facebook/react/pull/25437)) //<mofeiZ>//
- **[e98225485](https://github.com/facebook/react/commit/e98225485 )**: Add ref cleanup function ([#25686](https://github.com/facebook/react/pull/25686)) //<Samuel Susla>//
- **[15557fa67](https://github.com/facebook/react/commit/15557fa67 )**: [Fix] properly track `useId` use in StrictMode in development ([#25713](https://github.com/facebook/react/pull/25713)) //<Josh Story>//
- **[8a23def32](https://github.com/facebook/react/commit/8a23def32 )**: Resubmit Add HydrationSyncLane ([#25711](https://github.com/facebook/react/pull/25711)) //<Tianyu Yao>//
- **[2655c9354](https://github.com/facebook/react/commit/2655c9354 )**: Fizz Browser: fix precomputed chunk being cleared on Node 18 ([#25645](https://github.com/facebook/react/pull/25645)) //<Jimmy Lai>//
- **[c08d8b804](https://github.com/facebook/react/commit/c08d8b804 )**: Revert "Add SyncHydrationLane" ([#25708](https://github.com/facebook/react/pull/25708)) //<Tianyu Yao>//
- **[56ffca8b9](https://github.com/facebook/react/commit/56ffca8b9 )**: Add Bun streaming server renderer ([#25597](https://github.com/facebook/react/pull/25597)) //<Colin McDonnell>//
- **[f31005d6a](https://github.com/facebook/react/commit/f31005d6a )**: Add SyncHydrationLane ([#25698](https://github.com/facebook/react/pull/25698)) //<Tianyu Yao>//
- **[f284d9faf](https://github.com/facebook/react/commit/f284d9faf )**: Track ThenableState alongside other hooks //<Andrew Clark>//
- **[6b4c0314e](https://github.com/facebook/react/commit/6b4c0314e )**: Check thenable instead of thenableState //<Andrew Clark>//
- **[33e3d2878](https://github.com/facebook/react/commit/33e3d2878 )**: Reuse hooks when replaying a suspended component //<Andrew Clark>//
- **[4387d752d](https://github.com/facebook/react/commit/4387d752d )**: Allow more hooks to be added when replaying mount //<Andrew Clark>//
- **[5eb78d0a0](https://github.com/facebook/react/commit/5eb78d0a0 )**: Pass ThenableState to replaySuspendedUnitOfWork //<Andrew Clark>//
- **[4a2d86bdd](https://github.com/facebook/react/commit/4a2d86bdd )**: Don't reset work loop until stack is unwound //<Andrew Clark>//
- **[9dfbd9fa9](https://github.com/facebook/react/commit/9dfbd9fa9 )**: use: Don't suspend if there are pending updates //<Andrew Clark>//
- **[44c4e6f4d](https://github.com/facebook/react/commit/44c4e6f4d )**: Force unwind work loop during selective hydration ([#25695](https://github.com/facebook/react/pull/25695)) //<Andrew Clark>//
- **[7b17f7bbf](https://github.com/facebook/react/commit/7b17f7bbf )**: Enable warning for defaultProps on function components for everyone ([#25699](https://github.com/facebook/react/pull/25699)) //<Sebastian Markbåge>//
- **[6fb8133ed](https://github.com/facebook/react/commit/6fb8133ed )**: Turn on string ref deprecation warning for everybody (not codemoddable) ([#25383](https://github.com/facebook/react/pull/25383)) //<Sebastian Silbermann>//
- **[07f46ecf2](https://github.com/facebook/react/commit/07f46ecf2 )**: Turn on key spread warning in jsx-runtime for everyone ([#25697](https://github.com/facebook/react/pull/25697)) //<Sebastian Markbåge>//
- **[d65b88d03](https://github.com/facebook/react/commit/d65b88d03 )**: Eagerly initialize an mutable object for instance.refs ([#25696](https://github.com/facebook/react/pull/25696)) //<Sebastian Markbåge>//
- **[c343f8025](https://github.com/facebook/react/commit/c343f8025 )**: [react-float] feature detect getRootNode ([#25689](https://github.com/facebook/react/pull/25689)) //<Jan Kassens>//
- **[e1dd0a2f5](https://github.com/facebook/react/commit/e1dd0a2f5 )**: Remove recoverable error when a sync update flows into a dehydrated boundary ([#25692](https://github.com/facebook/react/pull/25692)) //<Sebastian Markbåge>//
- **[c54e3541b](https://github.com/facebook/react/commit/c54e3541b )**: [DevTools] bug fix for Hydrating fibers ([#25663](https://github.com/facebook/react/pull/25663)) //<Mengdi Chen>//

Changelog:
[General][Changed] - React Native sync for revisions d1e35c7...17f6912

jest_e2e[run_all_tests]

Reviewed By: makovkastar

Differential Revision: D42804802

fbshipit-source-id: 6a9f00724cc73378025bbd04edb2d17760a87280
2023-01-30 01:51:33 -08:00
Ruslan Lesiutin 8d5f8804d8 save registry auth token before bootstrapping verdaccio (#35991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35991

Changelog: [Internal]

While cherry-picking all this logic to `0.71-stable` branch, we've discovered several issues where some packages were failing to be published on Verdaccio proxy

This was failing only on node v16+, after some research, I've noticed that there might be a race-condition and npm unable to grab this token before first `npm publish` executes

Although this still work well on `main` branch, I am backporting it to keep aligned with `0.71-stable`

Reviewed By: christophpurrer, cortinico

Differential Revision: D42806081

fbshipit-source-id: af244d26ea529e6085ed5b2d731623dfaf78a14d
2023-01-27 11:01:45 -08:00
Sebastian Silbermann fac7859863 Add `TextInput`'s `inputMode` TypeScript types (#35987)
Summary:
Forward-porting https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64100/

## Changelog

[GENERAL] [FIXED] - Add `TextInput`'s `inputMode` TypeScript types

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

Test Plan: - [x] https://github.com/DefinitelyTyped/DefinitelyTyped/pull/64100/ green

Reviewed By: christophpurrer

Differential Revision: D42799862

Pulled By: jacdebug

fbshipit-source-id: b387fd8bc53e66d6125fee810862de3e292e6e74
2023-01-27 08:35:51 -08:00
Ruslan Shestopalyuk a00cea46bf Add missing C++ include for prop conversion of complex array type (#35984)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35984

[Changelog][Internal]

Codegen for props parsing was failing to add a required include for the case when the type is an array of objects, which in turn use non-trivial types.

Something like:
```
export type NativeProps = $ReadOnly<{
  ...ViewProps,
  bounds: $ReadOnlyArray<
    $ReadOnly<{
      height?: Float,
      left?: Float,
      top?: Float,
      width?: Float,
    }>,
  >,
}>;
```

would cause compilation errors on C++ side, since the required header for the `Float` conversion wasn't included.

Reviewed By: cipolleschi

Differential Revision: D42781128

fbshipit-source-id: d5b133b931a60e414761db0b3ed09893d3fcc9aa
2023-01-27 05:19:17 -08:00
SheetJS eaf465d0df Blob#slice end <= size (fixes #35959) (#35971)
Summary:
See https://github.com/facebook/react-native/issues/35959 .  Potentially fixes other issues including https://github.com/facebook/react-native/issues/34988

## Changelog

[INTERNAL] [FIXED] - Blob#slice end check avoids overflow

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

Test Plan: Added a test which fails against current release but passes after code changes.

Reviewed By: cipolleschi

Differential Revision: D42772352

Pulled By: jacdebug

fbshipit-source-id: 3c26baedad5cd459061459a9485ae20af1d2417b
2023-01-27 01:36:57 -08:00
Nicola Corti d30bd1bb21 Migrate nightly from scheduled workflow to scheduled pipeline (#35977)
Summary:
I'm moving nightlies from scheduled workflow to scheduled pipeline.
We're not able to manually retrigger nightlies as they're a scheduled workflow and don't expose a parameter. Here I'm cleaning it up.

Plus I'm:
1. Removing the `main_only` reference which is unused
2. Setting up the `run_release_workflow` and `run_nightly_workflow` parameters.

## Changelog

[INTERNAL] - Migrate nightly from scheduled workflow to scheduled pipeline

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

Test Plan: Will wait for CI results.

Reviewed By: cipolleschi

Differential Revision: D42776969

Pulled By: cortinico

fbshipit-source-id: d4ef9654d23cb91f85ce2b38e75e27dc0c575e95
2023-01-27 01:33:21 -08:00
Genki Kondo d3cc48d9a6 Add codegen support for DimensionValue for components (#35953)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35953

DimensionValue is a reserved prop type that can be a number or string (such as '50%'). On Java, it will get converted to a YogaValue (converter added to this diff); on C++ it will get converted to a YGValue (converter already exists as it's used in Fabric).

Changelog:
[Internal][Added] - Add codegen support for DimensionValue for components

Reviewed By: cipolleschi

Differential Revision: D42650799

fbshipit-source-id: 1d2bc30bbd93837dedbbb4c74f814963c8140957
2023-01-26 18:52:10 -08:00
Vitali Zaidman 97e707d897 simple support to the Partial<T> annotation (#35961)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35961

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

This fixes #35864

This feature allows using `$Partial<Obj>` in flow and `Partial<Obj>` in TypeScript based on the spec mentioned here: https://flow.org/en/docs/types/utilities/#toc-partial.

We currently only allow passing an Obj to Partial so
```
export type SomeObj = {
  a: string,
  b?: boolean,
};

export type PartialSomeObj = Partial<SomeObj>;
```
should work.
and also-
```
export type PartialSomeObj = Partial<{
  a: string,
  b?: boolean,
}>;
```
But not
```
export type PartialSomeObj = Partial<Partial<{
  a: string,
  b?: boolean,
}>>;
```
This can be improved in the future by a recursive unwrapping of the value inside the `Partial` annotation.

Changelog:
[General] [Added] -  Allow the use of "Partial<T>" in Turbo Module specs.

Reviewed By: christophpurrer, cipolleschi

Differential Revision: D42640880

fbshipit-source-id: 03a3fccc38ccfc7a5440fe11893beb68e77753f3
2023-01-26 12:30:38 -08:00
Xin Chen 53932d0022 Add extra logs to diagnose null view state issue
Summary:
We still see crashes for T112157805 and this diff is to add missing information to help diagnose the issue better.

We added a line of log to indicate which `mountItem` triggered the exception.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D42556576

fbshipit-source-id: 4283c34cb18d601ca7b80d3524c9c65cc4ae3f8a
2023-01-26 09:13:24 -08:00
Marshall Roch ce75f89667 Upgrade to Flow 0.198.2
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D42766915

fbshipit-source-id: 12248ce404902871509eea7b40aa6716931dbec3
2023-01-26 08:21:15 -08:00
Nick Gerleman be69c8b5a7 Mitigation for Samsung TextInput Hangs (#35967)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35967

In https://github.com/facebook/react-native/issues/35936 we observed that the presence of AbsoluteSizeSpan may lead to hangs when using the Grammarly keyboard on Samsung.

This mitigation makes it so that we do not emit this span in any case where it is sufficient to rely on already set EditText textSize. In simple cases, tested on two devices, it causes typing into the TextInput to no longer hang.

This does not fully resolve the issue for TextInputs which meaningfully use layout-effecting spans (or at least font size), such as non-uniform text size within the input. We instead just try to reduce to minimum AbsoluteSizeSpan possible.

Testing the first commit was able to resolve hangs in some simpler inputs tested, by me and cortinico.

Changelog:
[Android][Fixed] - Mitigation for Samsung TextInput Hangs

Reviewed By: cortinico

Differential Revision: D42721684

fbshipit-source-id: e0388dfb4617f0217bc1d0b71752c733e10261dd
2023-01-25 21:21:51 -08:00
mym0404 a8166bd75b Fix crash by conditional value of aspectRatio style value (#35858) (#35859)
Summary:
fix https://github.com/facebook/react-native/issues/35858

## Changelog

1. Handle not `number` | `string` value passed to `aspectRatio`
2. Add some tests

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [FIXED] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

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

Test Plan:
## Sample
[Sample Repository](https://github.com/mym0404/rn-aspect-ratio-crash-sample)

Video

![1](https://user-images.githubusercontent.com/33388801/212956921-94b21cda-d841-4588-a05a-d604a82e204c.gif)

Reviewed By: necolas

Differential Revision: D42575942

Pulled By: NickGerleman

fbshipit-source-id: 2f7f46e6e3af85146e4042057477cb6d63b3b279
2023-01-25 17:15:19 -08:00
MaeIg 462815001b Extract parseString and parseModuleFixture functions in typescript and flow parsers (#35928)
Summary:
This PR aims to extract parseString and parseModuleFixture functions into the typescript and flow parsers. This task was proposed in https://github.com/facebook/react-native/issues/35158 and helps https://github.com/facebook/react-native/issues/34872.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Internal] [Changed] - Extract parseString and parseModuleFixture functions in typescript and flow parsers

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

Test Plan:
yarn test:
<img width="386" alt="image" src="https://user-images.githubusercontent.com/40902940/213889984-f0cadaff-4472-42d6-b55b-4901023aad1e.png">

yarn flow:
<img width="166" alt="image" src="https://user-images.githubusercontent.com/40902940/213889974-21ac2483-2731-4cb1-a2b5-195d98619649.png">

yarn lint:
<img width="514" alt="image" src="https://user-images.githubusercontent.com/40902940/213889980-090af354-346f-4a9c-90bc-7006899f0819.png">

Reviewed By: jacdebug

Differential Revision: D42673866

Pulled By: cipolleschi

fbshipit-source-id: f1b5f8a7b3944e7e8223b25c0fb9bf4e8b512aa7
2023-01-25 12:38:52 -08:00
Samuel Susla 6f7428e27b Delete feature flag enable_simulate_image_props_memory_access
Summary:
changelog: [internal]

Clean up unused feature flag

Reviewed By: fkgozali

Differential Revision: D42709723

fbshipit-source-id: 289697dfb0c0378ff0369e1474150f7be68c8635
2023-01-25 05:43:38 -08:00
Samuel Susla 8863be41b1 Delete feature flag enable_crash_on_missing_component_descriptor
Summary:
changelog: [internal]

Clean up unused feature flag

Reviewed By: fkgozali

Differential Revision: D42709724

fbshipit-source-id: a124015783983dea28db31a4431183f5c30a30e7
2023-01-25 05:43:38 -08:00
Samuel Susla 51c03a0880 Delete feature flag react_fabric:enabled_skip_invalidated_key_frames_ios
Summary:
changelog: [internal]

clean up unused feature flag

Reviewed By: fkgozali

Differential Revision: D42709640

fbshipit-source-id: f64bb0eac67744dec321160c1cbe945e2dd74068
2023-01-25 05:43:38 -08:00
Samuel Susla 0a30aa3612 Enable layout animations on iOS in OSS
Summary:
changelog: Enable Layout Animations on iOS

[LayoutAnimations](https://reactnative.dev/docs/next/layoutanimation) in New Architecture have been disabled in OSS on iOS because of unresolved crash. This crash only happens rarely. Turning on LayoutAnimations in OSS should be safe and brings New Architecture to parity with old.

Reviewed By: fkgozali

Differential Revision: D42708774

fbshipit-source-id: b0f7febee3aa4f0ddac25556644198ebe79378c1
2023-01-25 05:43:38 -08:00
Nicola Corti ae557a1b03 Fix a couple of warnings in the ReactAndroid:hermes-engine build
Summary:
While buildling locally, those two warnings pop up.
- ANDROID_LD being unused by the CMake toolchain. I'm removing it.
- The Download task encountering a weak eTag. I'm updating it:
https://github.com/michel-kraemer/gradle-download-task

Changelog:
[Internal] [Changed] - Fix a couple of warnings in the ReactAndroid:hermes-engine build

Reviewed By: dmytrorykun

Differential Revision: D42738919

fbshipit-source-id: 7bd8785ad5b7431d557e2f8c8876b7c3f7294a43
2023-01-25 05:13:53 -08:00
Joshua Kaplan 2bfb53c2fb Use modern Podfile syntax to avoid polluting application build settings (#35954)
Summary:
Fixes conflicts in pod build settings like the one below:

Example warning
> Can't merge user_target_xcconfig for pod targets: ["RNReanimated", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.

Background:

> The former attribute xcconfig is deprecated and will cause a linter error when pushing new versions to trunk. The new attributes are available as pod_target_xcconfig and user_target_xcconfig, which makes their effects more clear. The latter attribute (user_target_xcconfig) should be used with great care, because well designed Pods should be self-contained and make as few assumptions about their environment as possible. Furthermore, this attribute can cause conflicts when different values are specified by two Pods for a build setting which doesn't allow multiple values and so cannot be merged.
- https://blog.cocoapods.org/CocoaPods-0.38/

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[IOS] [FIXED] - Fix cocoapods warning about merging user_target_xcconfig

-->

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

Test Plan:
- Run in example app

## Related PR

- https://github.com/facebook/hermes/pull/903

Reviewed By: christophpurrer

Differential Revision: D42737921

Pulled By: jacdebug

fbshipit-source-id: 75d087a5287e660a703342d6e0ad6632f05f3c4c
2023-01-25 02:17:07 -08:00
Paul Mandel 305ca337c0 Adding AlertOptions to ts Alert.prompt function (#35957)
Summary:
Bringing the typescript function signature in-line with the js code.

## Changelog

[GENERAL] [FIXED] - Added AlertOptions argument to the type definition for Alert.prompt to bring it into parity with the js code.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

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

Test Plan: Before the change, VS Code would show a typescript error when I pass AlertOptions to Alert.prompt (even though the js would execute successfully and respect the options I passed. After the change, when I use an Alert.prompt in VS code the function signature was recognized without errors.

Reviewed By: christophpurrer

Differential Revision: D42737818

Pulled By: jacdebug

fbshipit-source-id: 4d4318f38f5c7b7302aae62de5ce224db67e088a
2023-01-25 02:14:45 -08:00
Saad Najmi d5e6d9cecd Add a nil check to prevent a crash (#35941)
Summary:
This is a [change](https://github.com/microsoft/react-native-macos/pull/1120) we made in our fork (React Native macOS) that we are now upstreaming to reduce the number of diffs between React Native Core and React Native macOS. Also.. one less crash �!

Resolves https://github.com/microsoft/react-native-macos/issues/1679

Original PR notes:

> We've seen a crash downstream where -[NSString stringByReplacingCharactersInRange:withString:] receives a nil value as the replacement string. This is not good, since we expect that argument to be non-null.
>
>We believe that a cause of this is that -[RCTUITextField textView:shouldChangeTextInRange:replacementString:] is being called with nil as the replacement string. (This is legal, as per [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextviewdelegate/1449325-textview?language=objc).) Right now, the only check that this delegate method does is enforcing the maxLength parameter if it exists, and changes in attributes shouldn't affect the length of the string.

## Changelog

[IOS] [FIXED] - `-[RCTUITextField textView:shouldChangeTextInRange:replacementString:]` no longer crashes when we pass in a `nil` replacement string

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

Test Plan: Build should pass. This change has been running in our fork in production for a while so we're fairly confident of it.

Reviewed By: cipolleschi

Differential Revision: D42705382

Pulled By: jacdebug

fbshipit-source-id: 066cd8a4ba134a681f0f4c955594b1fcda61a30e
2023-01-24 03:57:45 -08:00
Prakash Gurung b8f1bb50f7 Fix ScrollView automaticallyAdjustKeyboardInsets not resetting when Prefer Cross-Fade Transitions is enabled (#35933)
Summary:
Similar to the issue here https://github.com/facebook/react-native/pull/34503 but this is also happening if we just use `ScrollView` and `TextInput` with `automaticallyAdjustKeyboardInsets` enabled.

When we enable `Prefer Cross-Fade Transitions` in `iOS` we get a keyboard height of `0` which causes the inset/offset miscalculation and the content jumps up when the keyboard gets hidden.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[IOS] [FIXED] - Fix ScrollView `automaticallyAdjustKeyboardInsets` not resetting when Prefer Cross-Fade Transitions is enabled and keyboard hides

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS] [FIXED] - Fix ScrollView `automaticallyAdjustKeyboardInsets` not resetting when Prefer Cross-Fade Transitions is enabled and keyboard hides

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

Test Plan:
Tested with brand new react native project with/without the fix

before fix `automaticallyAdjustKeyboardInsets` with enabled/disabled opening/closing keyboard

https://user-images.githubusercontent.com/6507800/214039873-33bfb016-f99f-4644-9174-20bf32cf07d6.mov

after fix `automaticallyAdjustKeyboardInsets` with enabled/disabled opening/closing keyboard

https://user-images.githubusercontent.com/6507800/214039887-4054a749-ab15-4399-b6a9-73dc9283aa6b.mov

Reviewed By: christophpurrer

Differential Revision: D42686390

Pulled By: jacdebug

fbshipit-source-id: 98488e0c9639c19a4acae1a1de1a5fde411e2462
2023-01-24 03:25:25 -08:00
Frieder Bluemle efe5f62f91 Fix whitespace and newline at EOF (#35939)
Summary:
Just a couple of minor fixes in the `template/` folder:

- Remove a trailing space in `rn_edit_text_material.xml` (this was the _only_ trailing space present in a newly generated RN project), which results in the check against the empty tree object failing:
  ```
  $ git diff --check 4b825dc -- template/
  template/android/app/src/main/res/drawable/rn_edit_text_material.xml:23: trailing whitespace.
  +        <!--
  ```
- Add missing newline at end of file in `.watchmanconfig` and `app.json` - Both are text files, and each line (including the last) is expected to end with a newline character (flagged by Git, and also visible as a warning on GitHub):
  <img width="369" alt="image" src="https://user-images.githubusercontent.com/743291/214195867-81c8e622-2130-44d4-bdaf-588e3510c109.png">

## Changelog

[GENERAL] [FIXED] - Fix whitespace and newline at EOF in template

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

Reviewed By: christophpurrer

Differential Revision: D42698256

Pulled By: rshest

fbshipit-source-id: 765fd41d4f501aec578755c754ea0ecb290ae6ca
2023-01-24 03:00:08 -08:00
sottar 3876368f0c Update Podfile in template (#35931)
Summary:
Added comment on Podfile under template directory.
I'm working with monorepo and didn't realize it easily to specify the path for react_native_post_install, so I thought it would be better to add this comment.

## Changelog

[IOS] [ADDED] - add comments for specifying the path to React Native

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

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

Reviewed By: cipolleschi

Differential Revision: D42673707

Pulled By: jacdebug

fbshipit-source-id: 39e424a051d238f6dad42cb0b7748d4f4c400787
2023-01-24 02:29:00 -08:00
Janic Duplessis c19548728c Add maintainVisibleContentPosition support on Android (#35049)
Summary:
This adds support for `maintainVisibleContentPosition` on Android. The implementation is heavily inspired from iOS, it works by finding the first visible view and its frame before views are update, then adjusting the scroll position once the views are updated.

Most of the logic is abstracted away in MaintainVisibleScrollPositionHelper to be used in both vertical and horizontal scrollview implementations.

Note that this only works for the old architecture, I have a follow up ready to add fabric support.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Android] [Added] - Add maintainVisibleContentPosition support on Android

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

Test Plan:
Test in RN tester example on Android

https://user-images.githubusercontent.com/2677334/197319855-d81ced33-a80b-495f-a688-4106fc699f3c.mov

Reviewed By: ryancat

Differential Revision: D40642469

Pulled By: skinsshark

fbshipit-source-id: d60f3e2d0613d21af5f150ca0d099beeac6feb91
2023-01-23 12:00:05 -08:00
Genki Kondo 04cf92fa9e Fix codegen for Array<EdgeInsetsValue>
Summary:
Changelog:
[Internal][Added] - Add support for props of type Array<EdgeInsetsValue>

Reviewed By: christophpurrer

Differential Revision: D42651078

fbshipit-source-id: 3b8683ab199c3d590136cec0e6a67e9e85aaa2c0
2023-01-23 11:06:09 -08:00