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

26159 Коммитов

Автор SHA1 Сообщение Дата
Dmitry Rykun 27e7295ca7 Abort pod install if bad HERMES_ENGINE_TARBALL_PATH is set
Summary:
Changelog:
[iOS][Changed] - Abort pod install if bad HERMES_ENGINE_TARBALL_PATH is set.

Reviewed By: cipolleschi

Differential Revision: D41341471

fbshipit-source-id: 34a3ac154b0a3f795d07dcd10f92361cb9bb4ad6
2022-11-21 03:06:15 -08:00
Mike Hardy 81e441ae8a fix(template): reference App.tsx vs App.js in template text (#35377)
Summary:
The template has moved to typescript now, the self-reference needed an update

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

[GENERAL] [FIXED] - reference App.tsx vs App.js in text of new typescript template

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

Test Plan: It is just a text change - it either makes sense or it doesn't. I think it makes sense?

Reviewed By: cipolleschi

Differential Revision: D41386912

Pulled By: NickGerleman

fbshipit-source-id: 6e62c11567e8fbff70b123446a827b18af43e864
2022-11-18 15:56:58 -08:00
Gabriel Donadel Dall'Agnol 8b1f6e09c1 Fix TouchableOpacity componentDidUpdate causing an excessive number of pending callbacks (#35387)
Summary:
The commit 3eddc9abb7 included on v0.69 introduced a wrong `if` statement inside the `componentDidUpdate` function of the `TouchableOpacity` component. As this `if` statement always evaluates to `true` (`(true || false) !== undefined`) we end up making unnecessary calls to the `_opacityInactive` method every time the component props changes, e.g. every time a `<Text>` inside the TouchableOpacity changes we call this function over and over, and this has been causing some performance issues on big lists.

This PR fixes this problem by adjusting the `componentDidUpdate` function to only call  `_opacityInactive` when necessary.

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

## Changelog

[General] [Fixed] - Fix TouchableOpacity componentDidUpdate causing an excessive number of pending callbacks

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

Test Plan:
1. Open the RNTester app and navigate to the `Touchable* and onPress` page
2. Test the `TouchableOpacity` component through the many sections

Reviewed By: cipolleschi

Differential Revision: D41397396

Pulled By: ryancat

fbshipit-source-id: 24863b5cbbdd2f3dd1f654b43d7031560937b888
2022-11-18 12:46:10 -08:00
Phillip Pan ad0c8551c2 remove all unnecessary imports to Geometry.h
Summary: Changelog: [Internal]

Reviewed By: stephinphection

Differential Revision: D41366189

fbshipit-source-id: ea4ed1f0c759b5a05012425684bfb835dbe90904
2022-11-18 11:51:39 -08:00
Riccardo Cipolleschi 56e724fd88 Fix `react-native-oss-ios-xxx`
Summary:
Regenerating pods to fix the outage
allow-large-files
## Changelog
[internal] - Regenerating pods to fix the outage

Reviewed By: blakef

Differential Revision: D41402573

fbshipit-source-id: 6a378705e48db99ef04405c50098b239e1a73045
2022-11-18 10:24:15 -08:00
Richard Howell 88d1825c73 remove -weak_framework (#89233)
Summary:
X-link: https://github.com/pytorch/pytorch/pull/89233

The `-weak_framework` flag is no longer necessary, Buck will weakly link frameworks depending on the `target_sdk_version` of the binary being linked.

Reviewed By: ebgraham, malfet

Differential Revision: D41348639

fbshipit-source-id: 47992282ba030294b2304c550d49df13e24e9c79
2022-11-18 08:23:55 -08:00
Gabriel Donadel Dall'Agnol c06323f463 fix: Patch AnimatedStyle to avoid discarding the initial style info (#35198)
Summary:
This PR patches `AnimatedStyle` to avoid discarding the initial style information which destroys the output of web-style compilers and breaks rendering, as requested on https://github.com/facebook/react-native/issues/34425. This uses a slightly modified version of a patch used by react-native-web  4c678d2912.

## Changelog

[General] [Fixed] - Patch AnimatedStyle to avoid discarding the initial style info

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

Test Plan:
Run `yarn jest Animated` and ensure CI is green

![image](https://user-images.githubusercontent.com/11707729/199869612-4f2302da-5791-492f-83a7-683305757c23.png)

Reviewed By: necolas

Differential Revision: D41379826

Pulled By: javache

fbshipit-source-id: 7e16726828b98def14847ec3499ff93777a9cbfb
2022-11-18 07:22:01 -08:00
Pranav Yadav 0ba1127c15 untrack test reports generated by test libraries (reporters) (#35187)
Summary:
- Untrack Test Reports generated by test libraries (reporters E.g. `jest-junit`)
- E.g. `/reports/junit/js-test-results.xml` report is generated; when we exec `yarn test-ci`, which is **_shouldn't_ be tracked**

### NOTE: Used `[skip ci]` to avoid wastage of compute resources �🌏
- Feel free to init tests manually if you find it necessary

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

[GENERAL] [CHANGED] - Untrack Test Reports generated by test libraries (reporters E.g. `jest-junit`)

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

Test Plan:
`yarn test-ci`
![image](https://user-images.githubusercontent.com/55224033/199709131-240d844c-a98a-419b-a370-cafe8e927de4.png)

Reviewed By: cipolleschi

Differential Revision: D40993282

Pulled By: sshic

fbshipit-source-id: 3fe150d3e8bd45cec56b50f2dc071002412e475e
2022-11-18 05:58:04 -08:00
Nicola Corti 95c5e181ad Bump RNGP to 0.72.1 (#35389)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35389

As the title says, just bumping RNGP

Changelog:
[Internal] [Changed] - Bump RNGP to 0.72.1

Reviewed By: cipolleschi

Differential Revision: D41398920

fbshipit-source-id: 39baadc54c604ababe7f558cc1c1291c08aae983
2022-11-18 04:46:16 -08:00
Nicola Corti 55b1670aa6 Void the Maven coordinates for react-native and hermes-engine (#35379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35379

This diff moves the publishing coordinates from:
```
com.facebook.react:react-native
com.facebook.react:hermes-engine
```

to

```
com.facebook.react:react-android
com.facebook.react:hermes-android
```

I've picked those they are the most layout friendly when building from source, but we can discuss if we want others.
I've updated the Gradle plugin to have a dependencySubstitution rule + update the template with those changes.

It should now be possible to still use `implementation("com.facebook.react:react-native:+")` inside libraries
on 0.71+ and RNGP will resolve dependencies correctly.

Changelog:
[Android] [Changed] - Void the Maven coordinates for react-native and hermes-engine

Reviewed By: cipolleschi

Differential Revision: D41380525

fbshipit-source-id: 91e059fa261acb89bee7ca0c79c30c3d856a2c80
2022-11-18 04:46:16 -08:00
Alpha 15656342a8 Resolve android crash on display modal (#35380)
Summary:
From exception logging, found crashes due to `Attempt to invoke virtual method 'int android.view.ViewGroup.getChildCount()' on a null object reference`. Tracing through the stack, it appears the constructor for `ViewGroup` conditionally calls `initializeScrollbarsInternal()`, which in turn calls `getChildCount()`.  However `ReactModalHostView` overrides `getChildCount()`, so `getChildCount()` is called before `ReactModalHostView` constructor completes, resulting in null reference when accessing `mHostView` from `getChildCount()`.

## 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] [Fixed] - Fix crash on initialize modal

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

Test Plan: In the rn-tester project, display a modal.

Reviewed By: javache, cipolleschi

Differential Revision: D41392235

Pulled By: ryancat

fbshipit-source-id: ce78e4d458ad41769e78139ea0a8a038384e830d
2022-11-18 04:06:32 -08:00
Connor Tumbleson 4d7ddd445c build: allow packager override for PROJECT_ROOT (#35354)
Summary:
This allows folks with a monorepo setup for React Native to set a simple configuration on the "Bundle React Native code and images" phase. This is because the bundler was configured to look for node_modules in a specific place, but in a monorepo your node_modules may be at the root one layer lower than a default configuration.

This same pattern of overriding this variable exists in the [react-native-xcode](https://github.com/facebook/react-native/blob/main/scripts/react-native-xcode.sh#L63) file.

Fixes: https://github.com/facebook/react-native/issues/33636 - "Unable to resolve module index"

```
Error: Unable to resolve module ./index from /Volumes/Nexus/Projects/xxx/.:

None of these files exist:
  * index(.native|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
  * index/index(.native|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
```

## Changelog

[General] [Added] - Add support for overriding `PROJECT_ROOT` during bundle steps for monorepos.

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

Test Plan: Working CI build via CircleCI.

Reviewed By: cipolleschi

Differential Revision: D41319439

Pulled By: ryancat

fbshipit-source-id: 8516e54436b0a9d4b9df1efeee8e62c95d4d35b2
2022-11-17 14:18:09 -08:00
Tianyu Yao e047eed2eb Fix inspecting for non-fabric
Summary:
Changelog: [Internal]

I think this started to break when https://github.com/facebook/react/pull/25441 was synced to RN. Before, `closestInstance` would only be non-null under Fabric, after it could be non-null in both. And we were using `closestInstance` to determine which data to send to `selectNode` in devtools. This diff makes a change to call `selectNode` once for non-fabric and once for fabric, one of them would not send anything to devtools frontend, this would make sure it works for both platforms.

Reviewed By: mondaychen

Differential Revision: D41366466

fbshipit-source-id: fcf30d03e443f6fa067782cd31b7cfd2e0cd841e
2022-11-17 11:36:33 -08:00
Nicolas Gallagher 3681df2878 Add web compat unit tests and fixes (#35316)
Summary:
Adds compat with W3C logical CSS properties. See https://github.com/facebook/react-native/issues/34425

This is a replacement for reverted https://github.com/facebook/react-native/issues/34590, which can no longer be imported internally.

## Changelog

[General][Added] - Added CSS logical properties.

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

Test Plan: Unit test snapshots.

Reviewed By: NickGerleman

Differential Revision: D41230978

Pulled By: necolas

fbshipit-source-id: 40e93d0d697f0cb28390480ce2b4bcbce18da70a
2022-11-17 10:58:38 -08:00
Pieter De Baets 04c286c3c2 Remove fb_apple_library export from rn_defs
Summary: Cleanup rn_defs. Most of the imports here were not related to RN, and for others we can use rn_apple_library instead.

Reviewed By: mdvacca

Differential Revision: D41302584

fbshipit-source-id: 0db79e202c0e18dd590ae0e6bf2821e6b49b606a
2022-11-17 09:56:30 -08:00
Rafael 0062b10b56 RCTRefreshControl: Updates progressOffset behaviour to prevent it from being applied by default (#35281)
Summary:
UIRefreshControl has a tight integration with iOS in terms of UINavigationBar/UIScrollView. In this regard, whenever there's a UIScrollView with a UINavigationBar on top, the OS automatically adjusts the contentInset of the UIScrollView to reflect that (something that is exposed to React Native). In a similar manner, UIScrollView passes this along to the attached UIRefreshControl.

By setting the frame manually, the RCTRefreshControl component was preventing this behavior. Although having the option is desired, it should not be done by default. In the past it was possible to adjust for this by manually setting the correct value, calculating the statusBar's height/safeAreaInsets.top and appending 44pt (the UINavigationBar height). However, due to changes related to the Dynamic Island (see [here](https://useyourloaf.com/blog/iphone-14-screen-sizes)), the safe area and the status bar size no longer align, making this calculation more tricky.

In summary: this changes allows `progressViewOffset` to exist (in order to maintain feature parity with Android) but provides the opportunity for the OSs default behavior to kick in when applicable.

| Applying by default  | Not applying by default (this change) |
:-------------------------:|:-------------------------:
![](https://user-images.githubusercontent.com/753361/200828632-0c9aa605-770c-47be-a825-1e061478c2b4.gif)  |  ![](https://user-images.githubusercontent.com/753361/200828664-dded9a47-bdbc-4b88-8ab7-92a76cea47e8.gif)

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

[iOS] [Fixed] - Fix application of _progressViewOffset in RCTRefreshControl to not occur by default (when value is unset)

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

Test Plan: The GIFs attached display the behavior as expected/unexpected. I'm unaware of any tests written for RCTRefreshControl that could be improved to cover this change. Notes appreciated.

Reviewed By: sammy-SC

Differential Revision: D41302080

Pulled By: cipolleschi

fbshipit-source-id: a2a8e6ef1dcc2e73220c2a182b4516f3bbd94f60
2022-11-17 08:06:41 -08:00
Stian Jensen 462d93d9c1 Bump jscodeshift to 0.14 (#35356)
Summary:
Jscodeshift has become maintained again in the past year, and has gotten rid of quite a good chunk of old dependencies that are no longer needed!

## 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] - update jscodeshift

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

Reviewed By: cipolleschi

Differential Revision: D41325527

Pulled By: rshest

fbshipit-source-id: 666b25c9bb3b1720479e9e098968b3b983adc2b4
2022-11-17 08:04:00 -08:00
Pieter De Baets e504141583 Remove 'using namespace' from header files
Summary:
Fix linter warning when pulling in some code into AR

Changelog: [Internal]

Reviewed By: NickGerleman, mdvacca

Differential Revision: D41269423

fbshipit-source-id: 4305d6c362a51e62b19b4d3590fb0823073dff9a
2022-11-17 06:19:07 -08:00
Robert Balicki a9bed8e75d Add JS changes
Summary:
# What

* Pass the DevTools Settings Manager to connectToDevTools.
* This is an object that provides write and synchronized read access to on-device storage, that React DevTools will use during startup.
* This allows us to persist settings like whether to show component stacks on error, and on restart, behave correctly. In the future, this will be used to power the "restart and profile" flow.

Changelog
[General][Added] Pass DevTools Settings Manager to connectToDevTools

Reviewed By: lunaruan

Differential Revision: D40880260

fbshipit-source-id: 379a2c93b4cde0360e6fd380d837f426943bfa9e
2022-11-16 19:47:55 -08:00
Nick Gerleman 418e95799f Fixup template devDependencies (#35372)
Summary:
Fixes missing/incorrect devDependencies in a newly built app. The previous set did not pull in prettier, causing linting to fail.  There was a peerDependency warning on yarn install. We also saw a separate lint warning at runtime specific to TS 4.9 being pulled in now, so we constrain in that version a bit.

Prettier and preset-env versions match the constraints and lockfiles of other RN packages.

## Changelog

[General] [Fixed] - Fixup template devDependencies

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

Test Plan:
Created a new app targeting 0.71 via `react-native init`.

1. `yarn install --force` no longer shows warnings
2. `prettier` is installed, `yarn lint` no longer fails, and shows no warnings or errors
3. ~Tentatively a test step to add tests against linting in new app, but last time doing that in CircleCI led to timeouts with no output  that I didn't have time to debug, so maybe that's fixed now? �‍♀️.~ (edit: still hangs)

Reviewed By: NickGerleman

Differential Revision: D41363021

Pulled By: lunaleaps

fbshipit-source-id: d6163b01e8934d75a231fa0fd849d7bde7b3500c
2022-11-16 18:47:42 -08:00
Christoph Purrer 1ec1785e32 Unify SystraceSection.h implementation (#35353)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35353

Unfortunately we have 2 different definitions of SystraceSection.h
- xplat/js/react-native-github/ReactCommon/cxxreact/SystraceSection.h
- xplat/js/react-native-github/ReactCommon/react/renderer/debug/SystraceSection.h

The first one is the Old Arch one and the second one is the New Arch one.

As we first step, we unify the implementation

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D41307049

fbshipit-source-id: a9eb854dfcf49f87ad81fd9cc8dbe51648ecd209
2022-11-16 12:58:42 -08:00
Nick Gerleman 67b8e182fa Add Fabric implementation of flow-relative padding and margin (#35342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35342

This is a native implementation of the JS shimmed layout-specific properties in https://github.com/facebook/react-native/pull/35316.

There is an experiment splitting the prop splitting codepath in Fabric, so this change effectively has two implementations depending on whether `enablePropIteratorSetter` is enabled.

None of these changes make sense to propagate Yoga. `inlineEnd`, etc are already mapped to `YGEdgeStart` and `YGEdgeEnd`, but RN's mapping used a different name. Then `blockStart`, `blockEnd`, map directly to existing edges in all cases since we don't support a writing mode.

On web, the last value in the style which computes the given dimension is given precedence. E.g. if "left" comes after "start" it will be chosen. Yoga stylesheets are unordered, and precedence for edges is given based on specificity (left > start > horizontal > all).

We give precedence to new renamings (e.g. start to inlineStart), but to preserve consistent behavior, we give precedence to specific edges before overwriting them with flow relative ones (e.g. marginTop has precedence over marginBlockStar).

Changelog:
[General][Added] - Add Fabric implementation of flow-relative padding and margin

Reviewed By: javache

Differential Revision: D41267765

fbshipit-source-id: 896e2ed71fe8bf83aef00b0a9d70fd20b2ce47a7
2022-11-16 12:31:33 -08:00
Nick Gerleman 0bc4547fc4 Run `js1 oss prepare-pods` (#35369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35369

Somwhere between importing https://github.com/facebook/react-native/pull/35017 and running `js1 oss update-pods`, the entire Podfile lock was deleted without me noticing. This change runs `js1 oss prepare-pods` to restore it.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41343786

fbshipit-source-id: 79abe41b18b8e13b9fba70906b8301b002d0e3db
2022-11-16 11:58:53 -08:00
Ellis Tsung 2d2f9da80b Scale text line height according to system font size
Summary:
## Changelog:
[Android] [Added] - Added getter for line height in CustomLineHeightSpan

Reviewed By: javache

Differential Revision: D41324647

fbshipit-source-id: 4c2b18fb6566f5f9f25e26acb2f7f157f4ab75f8
2022-11-16 11:24:56 -08:00
Riccardo Cipolleschi da27c78075 Configure BlobModule as proper TurboModule
Summary:
This change puts back D40716048 (279cfec55f) but in the right way, i.e. modifying the script that should generate those changes.

## Changelog
[iOS][Added] - Make the blobs proper TM

Reviewed By: dmytrorykun

Differential Revision: D41312160

fbshipit-source-id: 38850a63eb8d66ffd179743b4948a23340c8782e
2022-11-16 10:10:06 -08:00
Samuel Susla c3018328d2 Remove TTRC flag may be clipped warning
Summary:
changelog: [internal]

Removing this to decrease clutter of warnings when devs navigate to Marketplace Home.

Reviewed By: cipolleschi

Differential Revision: D41306378

fbshipit-source-id: a1b7f8ebe1f4bb00e931d609eb97a3bbd5ef9052
2022-11-16 08:04:52 -08:00
Pranav Yadav fb37dea38e Refactor `buildPropertySchema` fn of (Flow, TS) into common fn (#35288)
Summary:
This PR is a task of https://github.com/facebook/react-native/issues/34872
- combined `Flow` and `TS` `buildPropertySchema` fn 's into common fn
- added callback param `resolveTypeAnnotation` to the same
- moved it to `parsers-commons.js`
- re-organized imports and exports

## Changelog

[INTERNAL] [CHANGED] - [Codegen]: Refactored `buildPropertySchema` fn of (Flow, TS) into common fn in `parsers-commons.js`

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

Test Plan:
- ensure 👇  is `#00ff00`
```bash
yarn lint && yarn flow && yarn test-ci
```

Reviewed By: christophpurrer

Differential Revision: D41247738

Pulled By: cipolleschi

fbshipit-source-id: aecc0ed8d07efa1c2c39e8a8e64b4ee73b720b8f
2022-11-16 07:45:20 -08:00
Saad Najmi 85ceff529f Port RCTDisplayLink fix from React Native macOS (#35359)
Summary:
Cherry pick e877ebfe08 from React Native macOS into React Native Core. We've had this bug fix in our fork for a while now, so it's probably safe.

=== Original change notes ===

First, misc straightforward deprecated API updates.

Second, defensive changes to potentially address RCTDisplayLink crash.
Real-world data suggests crashes with this stack:
CVDisplayLink::start()
-[RCTDisplayLink updateJSDisplayLinkState] (RCTDisplayLink.m:157)
-[RCTDisplayLink registerModuleForFrameUpdates:withModuleData:]_block_invoke (RCTDisplayLink.m:67)
-[RCTTiming timerDidFire] (RCTTiming.mm:324)
-[_RCTTimingProxy timerDidFire] (RCTTiming.mm:93)

Some symbols are missing in this stack, presumably due to compiler optimizations.
-updateJSDisplayLinkState is calling CVDisplayLinkStart as a result of a
call to "_jsDisplayLink.paused = NO".
-registerModuleForFrameUpdates block is presumably getting called via pauseCallback,
likely via [RCTTiming startTimers], presumably owned by RCTCxxBridge.

The most likely immediate explanation for the crash is that we are calling
CVDisplayLinkStart with a zombie _displayLink pointer.
However there is a lot of indirection here as well as thread-hopping, and
unfortunately no clearly incorrect code that would explain such a zombie pointer.

Some defensive changes:
-explicitly remove the association to pauseCallback when underlying display link object is invalidated.
-remove a prior attempt at additional check in updateJSDisplayLinkState itself as it is not relevant.
-make sure we explicitly set _displayLink to NULL when we release it, such that there is one less failure point.

## 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] - RCTDisplayLink fix plus bonus deprecated API cleanup

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

Test Plan: CI should pass.

Reviewed By: cipolleschi

Differential Revision: D41335438

Pulled By: christophpurrer

fbshipit-source-id: 5e97d28eab7dd8e5c81d0a5386df6631e16405a2
2022-11-16 06:27:35 -08:00
Saad Najmi 50f7804d2f Port Shadow props test page fix from React Native macOS (#35360)
Summary:
Cherry pick 19a62d9f57 to React Native. These style props were being applied to a <Text> element, not a <View> element. They seemingly only worked because of a quirk of iOS.

=== Original change notes ===

The issue with the test is that the react native Text component has its own props for shadows - i.e. [textShadowColor, textShadowRadius, etc](https://reactnative.dev/docs/text-style-props) and the shadow props that View uses does not work on Text (i.e. shadowColor, shadowRadius, etc.). Not entirely sure how this test was passing without any errors before my change, it seems like something about the change is causing (expected) errors to actually show up.

## 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] [Fixed] - Shadow consistency opacity fix with test updates

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

Test Plan: Tested in our React Native macOS fork on iOS.

Reviewed By: cipolleschi

Differential Revision: D41335366

Pulled By: christophpurrer

fbshipit-source-id: f789b9565ed4e00fa558af8e418dd9e078064f98
2022-11-16 06:05:01 -08:00
Nick Gerleman 1aa157b196 Incorporate gap space into main axis overflow flag (#1173)
Summary:
X-link: https://github.com/facebook/yoga/pull/1173

In https://github.com/facebook/react-native/issues/35351 we see incorrect child item height when the flex-wrap is enabled, the cross-axis is to be stretched, and main-axis overflow is caused by gap.

In YGDistributeFreeSpaceSecondPass, if we do not have overflow (determined by flexBasisOverflows), we have stretch cross-alignment, and we reason that nothing can add to main axis dimensions, we know we're a single line and want to take full cross dimensions. and can set YGMeasureModeExactly which uses parent dimensions. Guessing an optimization?

If we do have overflow, then we set YGMeasureModeAtMost to find minimum possible cross-axis dimensions instead.

`flexBasisOverflows` incorporates both computed flex basis, and margin, so it is more generally a flag for whether we will wrap. So we should incorporate gap spacing into it. E.g. it is also used for whether we should the match main axis parent dimension of the overall container. This change does just that, and renames the flag to `mainAxisOverflows`.

We will want to cherry-pick the fix for this into RN 0.71 since we have not yet introduced the community to the incorrect behavior, and we expect a lot of usage of flex-gap.

Changelog:
[General][Fixed] - Fix incorrect height when gap causes main axis to overflow and cross-axis is stretched

Reviewed By: yungsters

Differential Revision: D41311424

fbshipit-source-id: bd0c3b5aac478a56878703b6da84fc3993cc14da
2022-11-15 19:51:48 -08:00
Adam Gleitman 11c8bf3137 Add Dynamic Type support for iOS (Paper and Fabric) (#35017)
Summary:
This adds Dynamic Type support in iOS as described [here](https://github.com/react-native-community/discussions-and-proposals/issues/519).

`Text` elements have a new prop, `dynamicTypeRamp`, that allows users to specify which font ramp a particular `Text` element should take on as the OS's accessibility setting for text size. The different types line up with different values of `UIFontTextStyle`. If not specified, we default to the current behavior.

~~For the moment, this change is only for Paper. I tried applying a corresponding change to Fabric by adding an additional field to [`facebook::react::TextAttributes`](https://github.com/facebook/react-native/blob/main/ReactCommon/react/renderer/attributedstring/TextAttributes.h) and changing [`RCTEffectiveFontSizeMultiplierFromTextAttributes`](afb124dcf0/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm (L79-L84)) to use that new field, but in the process I discovered that this function doesn't seem to ever get called, hence [this bug](https://github.com/facebook/react-native/issues/34990).~~

## Changelog

[iOS] [Added] - Dynamic Type support

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

Test Plan:
Validated with a test page in RNTester. Screenshots follow:

A) Default text size
B) Largest non-accessibility text size
C) Largest accessibility text size, split across two screenshots due to size

| A | B | C |
|-|-|-|
| ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 17 08](https://user-images.githubusercontent.com/717674/196562746-c8bbf53d-3c70-4e55-8600-0cfed8aacf5d.png) | ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 17 55](https://user-images.githubusercontent.com/717674/196563051-68bb0e34-c573-47ed-8c19-58ae45a7ce2b.png) | ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 18 33](https://user-images.githubusercontent.com/717674/196563185-61ede5ee-e79e-4af5-84a7-8f1e230a25f8.png) |
||| ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 18 42](https://user-images.githubusercontent.com/717674/196563208-2242efa2-5f24-466d-80f5-eb57a7678a67.png) |

Reviewed By: sammy-SC

Differential Revision: D40779346

Pulled By: NickGerleman

fbshipit-source-id: efc7a8e9810a93afc82c5def97af15a2e8453d90
2022-11-15 19:03:37 -08:00
David Vacca 5fda72f678 Inroduce BoxComponent
Summary:
The goal of this diff is to introduce the scafolding of a BoxComponent. This class will be eventually shared by Android and iOS

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D41205801

fbshipit-source-id: e33e58062aa33e0c8e9a48fd112309a358f0a060
2022-11-15 12:17:18 -08:00
David Vacca 9ca30adff8 Exclude mapbuffer files from Mac/iOS builds
Summary:
In this diff I'm excluding mapbuffer files from Mac/iOS builds

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41309209

fbshipit-source-id: d92ae685ac05592e326ec3e046106f9a884271d6
2022-11-15 12:17:18 -08:00
David Vacca 878b745fd6 Refactor Component -> ComponentDeprecatedAPI
Summary:
The goal of this diff is to refactor the name of Component to ComponentDeprecatedAPI

Also, I'm introducing a new very simple Component API, this new Component will evolve in the next few diffs and days

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D41128461

fbshipit-source-id: b6aea08caa609153663cdd4165694cc57b4b76b6
2022-11-15 12:17:18 -08:00
Riccardo c8c901513f add 0.70.6 changelog (#35352)
Summary:
Create Changelog for 0.70.6

## Changelog

[Internal] - Update changelog

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

Test Plan: Not needed

Reviewed By: NickGerleman

Differential Revision: D41306645

Pulled By: cipolleschi

fbshipit-source-id: ebcfec1884fcd34b0d0ce1cde63fb9f1773796ae
2022-11-15 11:27:14 -08:00
Tien Anh Nguyen 7425c24cbe feat: fix show soft input on focus behavior (#35244)
Summary:
The `showSoftInputOnFocus` of `TextInput` is not working properly. When we set `showSoftInputOnFocus` to false and subsequently to `true`, it fails to open the keyboard, we have to re-focus on the input in order for the keyboard to show. It's expected that the keyboard will be opened as soon as  `showSoftInputOnFocus` becomes `true`. This happens on iOS only.
Reference in React Native doc: https://reactnative.dev/docs/textinput#showsoftinputonfocus.

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

[iOS] [Fixed] - Fix issue where keyboard does not open when `TextInput` `showSoftInputOnFocus` changes from `false` to `true`

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

Test Plan:
I've made a clean `create-react-native-app` repo to demonstrate this https://github.com/christianwen/reduced-rn-app.
Here's the steps:
1. Clone https://github.com/christianwen/reduced-rn-app
2. Run `yarn install`
3. Run `cd ios`, then `pod install`, then `cd ..`
4. Run `yarn ios`
5. See the text input on the top of the screen, it can be observed that the keyboard does not open because `showSoftInputOnFocus` is `false`, 3 seconds later it becomes `true` due to a `setTimeout` that is used
<img width="528" alt="Screenshot 2022-11-07 at 23 39 50" src="https://user-images.githubusercontent.com/21312517/200365369-a92fdea3-762c-4224-b463-7143b63329a7.png">

https://user-images.githubusercontent.com/21312517/200366099-db8626a6-1a31-4bfc-862c-2e37a8b35a3f.mov

However, it can be seen that the keyboard does not open even though `showSoftInputOnFocus` becomes `true`
6. Now add the change in this PR to `Libraries/Text/TextInput/RCTBaseTextInputView.m`
7. Run `yarn ios` again
8. Now verify the step 5 again, the keyboard will open automatically when `showSoftInputOnFocus` becomes `true`

https://user-images.githubusercontent.com/21312517/200363910-726716b1-e76d-420b-848d-a98747868db9.mp4

The reason why I created a fresh RN repo instead of using `rn-tester` app is because the `showSoftInputOnFocus` example is not working in `rn-tester` app for some reasons (it shows the keyboard even though `showSoftInputOnFocus` is `false` in the example).

Regarding the code, it's similar to the fix for `keyboardType` in 8baaacb664.

<img width="924" alt="Screenshot 2022-11-07 at 23 36 41" src="https://user-images.githubusercontent.com/21312517/200364649-38e7ddc3-ddac-47c4-a72d-a38cf32e120c.png">

Reviewed By: cipolleschi

Differential Revision: D41274007

Pulled By: jacdebug

fbshipit-source-id: dbdf45194db85eeb0a2a4ed372f8c71f44983725
2022-11-15 09:37:21 -08:00
Pieter De Baets effbae5f8c Rename rn_xplat_cxx_library2 to rn_apple_xplat_cxx_library
Summary:
Rename this helper to make it explicit what it's used for. There's still more to do here to simplify these.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D41184338

fbshipit-source-id: a33d306978cb9026ebf10b00853042da4aaecd5a
2022-11-15 09:14:09 -08:00
Samuel Susla f8f2a3ed65 Re-add NativeAnimatedModule invariant
Summary: changelog: [internal]

Reviewed By: yungsters

Differential Revision: D41302490

fbshipit-source-id: 769473528a57cdcce7f226e62e2e879705fe98ab
2022-11-15 08:43:36 -08:00
Phillip Pan 9138712934 decouple various files from Geometry.h
Summary:
a lot of files were depending on Geometry even though they didn't use Vector, this will help with future modularity

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D41127194

fbshipit-source-id: 024519c638a1f0df3fdbfbdd937eac84b9adee6e
2022-11-15 08:06:45 -08:00
David Buchan-Swanson 64ff077a66 fix detection of android emulator (#35111)
Summary:
at some point, the `Build.FINGERPRINT` of the emulator has changed and no longer includes `generic` as an option.

It apparently now, on all platforms, includes `google/sdk_gphone` at the beginning. Older emulators may still include `generic` in the `Build.FINGERPRINT` so we should maintain that check too.

## 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] [Fixed] - Fix android emulator detection for packager host

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

Test Plan: When running on a modern emulator, ensure that the packager attempts to load from `10.0.2.2`.

Reviewed By: cipolleschi

Differential Revision: D41266071

Pulled By: GijsWeterings

fbshipit-source-id: 43115dbde6a411fe2ebde23e720dff4812a4309f
2022-11-15 07:20:36 -08:00
Pranav Yadav adee7be5d8 Chore: mv `translateFunctionTypeAnnotation` fn > `parsers-commons.js` (#35343)
Summary:
This PR should solve the `"Circular Dependencies"` problem/issue because of which some PRs are getting blocked as discussed here https://github.com/facebook/react-native/pull/35288#issuecomment-1314081952

- also moved below helpers to `parsers-commons.js`;
- `getTypeAnnotationParameters`
- `getFunctionNameFromParameter`
- `getParameterName`
- `getParameterTypeAnnotation`
- `getTypeAnnotationReturnType`

<3

## Changelog

[INTERNAL] [CHANGED] - Moved `translateFunctionTypeAnnotation` fn from `parsers-primitives.js` to `parsers-commons.js` also, moved it's helpers

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

Test Plan:
- ensure 👇 is `#00ff00`

`yarn lint && yarn flow && yarn test-ci`

Reviewed By: christophpurrer

Differential Revision: D41273191

Pulled By: rshest

fbshipit-source-id: cc1839a91579e7914f05516a90b280a776510c9d
2022-11-15 06:47:55 -08:00
Samuel Susla 49d5e7c519 Remove feature flag removeListenersOnDetach
Summary:
changelog: [internal]

Remove unused feature flag.

Reviewed By: yungsters

Differential Revision: D41188496

fbshipit-source-id: 13507197e7943aea9303ffb828feddb77c94ab0c
2022-11-15 06:30:42 -08:00
Arushi Kesarwani b8893c7003 Deprecating create() for the Default Dev Support Manager Factory
Summary:
Changelog:
    [Internal][Changeded] - https://github.com/facebook/react-native/pull/31841 introduced customisations for DevSupportManager which made this create() redundant, hence deprecating and adding the annotation.

Reviewed By: cipolleschi

Differential Revision: D41292920

fbshipit-source-id: 9fc348a3f4f8f64ba6f7aee85f302e87e10e8cd5
2022-11-15 04:02:42 -08:00
Christoph Purrer 2eccd59d7c react-native-code-gen Add Union Type support for Java/ObjC TurboModules (#35312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35312

Changelog:
[General][Added] react-native-code-gen Add Union Type support for Java/ObjC TurboModules

Reviewed By: javache

Differential Revision: D41216605

fbshipit-source-id: d411abed66c694d855ede40725667cbc7067538f
2022-11-14 19:11:26 -08:00
Gabriel Donadel Dall'Agnol 72d3da19ce chore: Update Text props aria-labelledby documentation (#35327)
Summary:
`aria-labelledby` Flow types were added to the Text props on f353119113  but the text component does not support `accessibilityLabelledBy`, which is the prop we were supposed to map `aria-labelledby` to. As the Text component does not really support `aria-labelledby` this PR updates the `TextProps` documentation to explain that this prop is necessary for cross-platform purposes and that other platforms need it.

## Changelog

[Android] [Changed] - Add notes to `aria-labelledby` from Text props

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

Test Plan: Ensure CI is green

Reviewed By: necolas

Differential Revision: D41280877

Pulled By: lunaleaps

fbshipit-source-id: 81cf016bcf3117f15385ddd119c44d6f9fdd6b68
2022-11-14 17:16:20 -08:00
Samuel Susla 5cdf3cf726 Re-land of modern animated
Summary:
changelog:
[general][Added] - Concurrent rendering safe implementation of Animated

This is a re land of D40681265 (5e863fc42c). Previously, Modern Animated did not work correctly for animations that were driven by ScrollView's contentOffset. This was fixed in D41122065 (1b1b26a099).

Reviewed By: javache, huntie

Differential Revision: D41264757

fbshipit-source-id: 3a9213997710e483d6c2c09b51359d17a6f9567e
2022-11-14 13:25:52 -08:00
youedd a7ae9885ed move remapUnionTypeAnnotationMemberNames to Parser (#35314)
Summary:
Part of https://github.com/facebook/react-native/issues/34872#issuecomment-1304236257

> [Assigned to youedd] Create a new function [remapUnionTypeAnnotationMemberNames](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L110) in the [parser.js file](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parser.js) and add documentation to it. Implement it properly in the [FlowParser.js](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/parser.js#L15) and in the [TypeScriptParser.js](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/parser.js#L15). Remove the function [remapUnionTypeAnnotationMemberNames](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L110) and update the [emitUnionTypeAnnotation](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L110) signature to accept a Parser parameter instead of a language one. Use the new Parser function instead of the old one [here](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L139).

## 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] - move remapUnionTypeAnnotationMemberNames to the parsers implementations

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

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

![image](https://user-images.githubusercontent.com/19575877/201389910-31d48601-7023-4c94-a6d5-efccb18629cd.png)

Reviewed By: christophpurrer

Differential Revision: D41247716

Pulled By: cipolleschi

fbshipit-source-id: 6f708895392d5bdac5d4edbc67587194321ddb3d
2022-11-14 12:28:35 -08:00
Evan Yeung 1bb67e7818 Deploy 0.193.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D41243915

fbshipit-source-id: ed4416898bfb53325d1958d173ad037cf24683d5
2022-11-14 12:08:53 -08:00
Pieter Vanderwerff f45329221a Fix and enforce empty array providers in xplat/js
Reviewed By: bradzacher

Differential Revision: D41207298

fbshipit-source-id: cd25a3edbb8bb94fd18434c9cee16f9c36f9b74a
2022-11-14 10:41:58 -08:00
Tim Yung bf6ed07c0f RN: Delete `setAndForwardRefs`
Summary:
Deletes `setAndForwardRefs` because it encourages a subtle pitfall with managing the referential equality of `ref` entities.

By the time this commit is landed, there will have been no more call sites to it in the `facebook/react-native` repository.

Changelog:
[Internal]

Reviewed By: sammy-SC

Differential Revision: D41209331

fbshipit-source-id: 3ef9c3543b581a716a1e41e524957867ee811675
2022-11-14 08:50:22 -08:00