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

3794 Коммитов

Автор SHA1 Сообщение Дата
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
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
fabriziobertoglio1987 49d5277afc remove duplicate role grid from RCTViewManager (#35932)
Summary:
Fix warning: duplicate key in dictionary literal. Different PRs tried to fix this issue at the same time and introduced a duplicate. Related 55c0df43b9 f3d9f2ea23

## Changelog

[IOS] [FIXED] - remove duplicate role grid from RCTViewManager

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

Test Plan: <img width="1920" alt="duplicated grid role on iOS" src="https://user-images.githubusercontent.com/24992535/214054716-d79dec11-2b5c-4780-a4af-08d50be4a1a2.png">

Reviewed By: sammy-SC

Differential Revision: D42677641

Pulled By: jacdebug

fbshipit-source-id: f3eaa99ce89d7f9602843fde0dc0f371300e7052
2023-01-23 10:21:52 -08:00
Sheikh Jamir Alam f3155d0f80 Update RCTDevMenu.mm (#35910)
Summary:
Fixed typo with the word "running" in 2 places when failing to open Flipper.

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

Changelog:
[Internal] [Changed] - Fix typo with the word "running" when failing to open Flipper

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

Reviewed By: christophpurrer

Differential Revision: D42641042

Pulled By: sshic

fbshipit-source-id: acebb26ab921e98235c4f8e8535fa89be2ffa8cd
2023-01-23 05:04:03 -08:00
Vincent Riemer 0c150b2289 Add explicit support for Apple Pencil hovering
Summary:
Changelog: [IOS][ADDED] - Add explicit support for M2 iPad Apple Pencil hovering in the Pointer Events implementation

I personally am not a huge fan of how this has to be implemented but it's literally the way Apple suggests to differentiate between mouse and pen hover events.

Reviewed By: lunaleaps

Differential Revision: D40962916

fbshipit-source-id: a6fb5bcfe19bcf500021922baac3fa7c4375a874
2023-01-18 13:43:21 -08:00
Christoph Purrer 55af2fe74f Remove API_AVAILABLE(ios(10.0)) / API_AVAILABLE(ios(12.0)) (#35835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35835

The minimum iOS version for react-native-macOS is 12.4 at this time.
These checks can be removed.
See: https://github.com/microsoft/react-native-macos/issues/1605

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D42523417

fbshipit-source-id: 45e7c0b6f31710dd6fcace0eb624e52489599e09
2023-01-17 02:58:24 -08:00
Christoph Purrer e7dcad2ba1 Remove UIKit import from RCTDevLoadingView.h (#35843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35843

See: https://github.com/microsoft/react-native-macos/issues/1604

Changelog:
[iOS][Fixed]: Remove UIKit import from RCTDevLoadingView.h

Reviewed By: cipolleschi

Differential Revision: D42529787

fbshipit-source-id: 2a63574794a5c962a17b49fa46a146b1252a0445
2023-01-17 02:57:51 -08:00
Ruslan Lesiutin 465e937533 internalize Slider module (#35825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35825

Changelog:
[iOS][Removed] - removed Slider module
[Android][Removed] - removed Slider module

Reviewed By: cortinico

Differential Revision: D42394124

fbshipit-source-id: 92ba3bc50d16996a597148fa2f8178e6bd6d8eb7
2023-01-16 02:42:18 -08:00
Wojciech Lewicki 97c7c6a4b6 fix: dispatch ContentSizeChange event on Fabric on iOS (#35816)
Summary:
On Fabric, `onContentSizeChange` of `TextInput` component was never fired on `iOS`, since the logic dispatching it was implemented in `RCTBaseTextInputShadowView` on Paper: 0f8dc067ac/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m (L105). This class is not used on Fabric, therefore the event was never dispatched. On Paper, it was dispatched in `dirtyLayout` method,  so I added dispatching of this event based on the change of content size in `layoutSubviews` method, since this method seems the closest one on Fabric. I am not sure if it is the best place for it though.

## Changelog

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

[IOS] [ADDED] - dispatch `onContentSizeChange` event on Fabric.

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

Test Plan:
Try to use `onContentSizeChange` callback in `TextInput` component:
```tsx
import React from 'react';
import {TextInput, SafeAreaView} from 'react-native';

const App = () => {
  return (
    <SafeAreaView style={{flex: 1, backgroundColor: 'red'}}>
      <TextInput
        multiline={true}
        placeholder="type here"
        onContentSizeChange={e => console.log(e)}
      />
    </SafeAreaView>
  );
};

export default App;

```

Reviewed By: christophpurrer

Differential Revision: D42499974

Pulled By: sammy-SC

fbshipit-source-id: 3e010ff096cf91cb3e7b87ed2753e9d0e7be9650
2023-01-13 09:34:03 -08:00
Ruslan Lesiutin 0ff7b7fac2 refactor(react-native-github): move DatePickerIOS to internal (#35366)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35366

# Changelog:
[JS][Removed] - removed DatePickerIOS module
[iOS][Removed] - removed DatePickerIOS module

Reviewed By: lunaleaps

Differential Revision: D41163591

fbshipit-source-id: fda31d6f3a5d7a9ca3e50ae3b4817e7deb22819c
2023-01-09 08:53:29 -08:00
Ruslan Lesiutin ac66512eb3 Revert D41069547: Multisect successfully blamed D40984397 for test or build failures (#35789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35789

Changelog: [Internal]

This diff is reverting D41069547 (fee9510b2d) D41062668 (4c40014d43) D40984397 (05968d16e1)
D40984397 (05968d16e1) has been identified to be causing the following test or build failures:

We're generating a revert to back out the changes in this diff, please note the backout may land if someone accepts it.

allow-large-files

Differential Revision: D42371475

fbshipit-source-id: daa01c9215811c397f5cef958fd4620f36295b60
2023-01-06 13:06:17 -08:00
Gabriel Donadel Dall'Agnol 4ae4984094 feat: Add logical border radius implementation (#35572)
Summary:
This PR implements logical border-radius as requested on https://github.com/facebook/react-native/issues/34425. This implementation includes the addition of the following style properties

- `borderEndEndRadius`, equivalent to `borderBottomEndRadius`.
- `borderEndStartRadius`, equivalent to `borderBottomStartRadius`.
- `borderStartEndRadius`, equivalent to `borderTopEndRadius`.
- `borderStartStartRadius`, equivalent to `borderTopStartRadius`.

## Changelog

[GENERAL] [ADDED] - Add logical border-radius implementation

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

Test Plan:
1. Open the RNTester app and navigate to the `RTLExample` page
2. Test the new style properties through the `Logical Border Radii Start/End` section

https://user-images.githubusercontent.com/11707729/206623732-6d542347-93f9-40da-be97-f7dcd5f66ca9.mov

Reviewed By: necolas

Differential Revision: D42002043

Pulled By: NickGerleman

fbshipit-source-id: a0aa9783c280398b437aeb7a00c6eb3f767657a5
2023-01-06 06:00:03 -08:00
Ruslan Lesiutin fee9510b2d refactor(ReactNative/Slider): moved iOS sources to internal (#35365)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35365

# Changelog:
[iOS][Removed] - removed iOS sources of Slider module

Reviewed By: NickGerleman

Differential Revision: D41069547

fbshipit-source-id: 8faf96701f69e19074fafac45b1c95b939c2b1ac
2023-01-05 06:12:47 -08:00
abing 0c53420a7a Fix RCTAlertController not showing when using SceneDelegate on iOS 13.0+ (#35716)
Summary:
On iOS 13.0+, app may use SceneDelegate for multiple windows support or CarPlay support. RCTAlertController can't find the correct root vc in such scene based apps.

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

[iOS] [Fixed] - Fix RCTAlertController not showing when using SceneDelegate on iOS 13.0+.

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

Reviewed By: cipolleschi

Differential Revision: D42253653

Pulled By: makovkastar

fbshipit-source-id: ae4e833abca2af7af8028f3af9bd8d3f60ebd392
2023-01-04 11:40:34 -08:00
Liam Xu 2217ea4136 Repair when RCTRedBoxGetEnabled is false , inoperative in RCTExceptio… (#35576)
Summary:
Repair when RCTRedBoxGetEnabled is false , the red box will still be on display,It resolve that I send test-pack to QA with Xcode Archive on DEBUG env.

## Changelog
[General] [Changed] - Append RCTRedBoxGetEnabled() in RCTExceptionsManager.mm

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

Test Plan: Xcode Archive on DEBUG env, the red box will be not on display.

Reviewed By: cipolleschi

Differential Revision: D41809649

Pulled By: skinsshark

fbshipit-source-id: 7d6be3479decf369c415f6a08dec9611b1441b1d
2023-01-04 09:23:38 -08:00
admirsaheta 79e603c5ab Null Exception Handling | Input Validation - RCTAlertController - RCTDevLoadingView (#35689)
Summary:
Enhancing native iOS modules and preventing crashes inside the RCTAlertController

## Changelog
[iOS][Fixed] - Handle properly a `nil` `keyWindows` in the AlertController

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

Pick one each for the category and type tags:

[IOS] [SECURITY] - Message

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

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

Reviewed By: cipolleschi

Differential Revision: D42179169

Pulled By: ryancat

fbshipit-source-id: 05a6788f610db1d222e3c10b3c774c75edaf55f5
2023-01-03 13:53:42 -08:00
wood1986 e948c79bda fix: fix the potential race condition when dismissing and presentating modal (#35705)
Summary:
`react-native-screens` has a bug about `UIViewControllerHierarchyInconsistency` when dismissing a `react-native` `<Modal>`. Here is the bug https://github.com/software-mansion/react-native-screens/issues/944

After adding `dispatch_async` block, it solves the issue. But I do not know if this is right.

Here is the example repo https://github.com/wood1986/react-native-modal-crash

You can revert my last commit 86e7bc1adf to reproduce the issue

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

[IOS] [FIXED] - fixed the potential race condition when dismissing and presentating modal

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

Reviewed By: cipolleschi

Differential Revision: D42253488

Pulled By: makovkastar

fbshipit-source-id: 3e98fa9e719ecdeddeb2a367b0cd364e15136d56
2023-01-03 11:41:40 -08:00
Saad Najmi 70d9b56d71 Fix Catalyst @availablity checks in RCTPullToRefreshViewComponentView.mm (#35673)
Summary:
Judging from the original [commit](4c4948b6e8), the availability check is probably for Catalyst, not macOS.  That matches the [apple documentation](https://developer.apple.com/documentation/uikit/uiscrollview/2127691-refreshcontrol?language=objc) as well (though we need 13.1, not 13).

To avoid needing to introduce a diff in React Native macOS (where we actually compile for macOS and not Mac Catalyst) let's fix the availability check to be more accurate. Changing `macOS` to `MacCatalyst` should be supported as per https://docs.swift.org/swift-book/ReferenceManual/Attributes.html#ID348 (2c5a966054)

## Changelog

[IOS] [FIXED] - Fixed Mac Catalyst availability checks

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

Test Plan: Code compiles

Reviewed By: christophpurrer

Differential Revision: D42149589

Pulled By: cipolleschi

fbshipit-source-id: fbbd31cba44f55215f2c4c0f37aad410d5bcd627
2022-12-30 01:45:18 -08:00
Ruslan Shestopalyuk ad953f6f4b Unify native performanceNow implementation across platforms
Summary:
[Changelog][Internal]

Both iOS and Android platforms are at this point using the same native implementation of `performanceNow`, based on `std::chrono` (it used to be different some time ago).

This diff unifies the implementations, so it comes from one place in C++ code for all platforms.

The context is that I am developing event timing instrumentation and need a consistent way to get current timestamp from either JS or native (C++) side. The latter is now possible via calling `JSExecutor::performanceNow()`, which is guaranteed to be the same as called from JS.

Reviewed By: christophpurrer

Differential Revision: D42267898

fbshipit-source-id: dcb592f37d6567340ea59faddbf3b6d2b8507d50
2022-12-28 11:03:14 -08:00
Samuel Susla 874881e73e Bring setNativeProps to Fabric
Summary:
changelog: [internal]

This is experimental implementation of `setNativeProps` in Fabric.

This diff brings `setNativeProps` to Fabric to make migration easier. I tried to stay as close as possible to Paper's behaviour, with all of its flaws (ready CAUTION section on https://reactnative.dev/docs/direct-manipulation)

State can't be stored in views because on iOS, eventually on Android, views are not the source of truth, shadow tree is. Fabric's implementation keeps state from setNativeProps in shadow node family in very inefficient data structure folly::dynamic. It is always reconciled with new prop updates. The performance cost is only paid in case node has used `setNativeProps` before.

Reviewed By: mdvacca

Differential Revision: D41875413

fbshipit-source-id: 453a5f7612a6f86a4cece269b13bd2ffd0c0e2d1
2022-12-24 06:40:42 -08:00
Ruslan Latypov 43e7f50a99 fix missing imports and set disable_infer_precompiled_header] [shard:2/3][1/2]
Reviewed By: rmaz

Differential Revision: D41796827

fbshipit-source-id: e2dc03e02854150901f71626a76b3370404d4f96
2022-12-08 15:27:25 -08:00
Michael Anthony Leon de28f9b8ea Include sampling profiler & inspector behind a compile-time flag
Summary:
Changelog:
[iOS][Changed] - Create a new compile time flag to enable remote sample profiling.

Reviewed By: cortinico

Differential Revision: D41554133

fbshipit-source-id: 00a7f9f6c9f09d72afee070c1cc6187aa3d0ddb1
2022-12-08 14:57:29 -08:00
Samuel Susla 1d3fa40c59 Add setNativeProps to Fabric
Summary:
changelog: Introduce setNativeProps to Fabric

Add support for `setNativeProps` in Fabric for backwards compatibility. It is still recommended to move away from `setNativeProps` because the API will not work with future features.

We can make step [Migrating off setNativeProps](https://reactnative.dev/docs/new-architecture-library-intro#migrating-off-setnativeprops) in migration guide optional.

Reviewed By: yungsters, mdvacca

Differential Revision: D41521523

fbshipit-source-id: 4d9bbd6304b8c5ee24a36b33039ed33ae1fc21f8
2022-12-06 04:47:51 -08:00
Pieter De Baets 1452a55845 Remove RCTViewConfigEventValidAttributesDisabled
Summary:
Changelog: [Internal]

Codemod-bot already hardcoded this to false a while back, so cleaning up the code related to it.

Reviewed By: RSNara

Differential Revision: D41615378

fbshipit-source-id: 7b62b20b8e25f0a06d207b2457d6caf9ad5c695e
2022-12-02 09:08:16 -08:00
Pieter De Baets 70bb6444aa Remove iOS TurboModuleManager experiment with shared mutex
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41551085

fbshipit-source-id: f4d1d8126529d5f384ada941f6fb140abcfd9716
2022-11-29 08:29:05 -08:00
Pieter De Baets 229a1ded15 Remove ObjCTurboModule experiments with retaining JS callbacks in custom scopes
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41551086

fbshipit-source-id: b70965bcf2af6ebac921cc627c196ec108f73944
2022-11-29 08:29:05 -08:00
Riccardo Cipolleschi f3bf4d02ab Move JSCRuntime into its own folder (#35482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35482

This change moves the JSCRuntime.h/cpp into a `jsc` folder.

This change is required for several reasons:
1. on iOS, the new `jsi`, `jsidynamic` and `jsc` setup is breaking the `use_frameworks!` with  `:linkage => :static` option with the old architecture. So it is a regression.
2. JSCRuntime is required by some libraries and needs to be exposed as a prefab and the current setup makes it hard to achieve.

allow-large-files

## Changelog:
[General][Changed] - Move JSCRuntime into a separate pod/prefab

Reviewed By: cortinico

Differential Revision: D41533778

fbshipit-source-id: 642240c93a6c124280430d4f196049cb67cb130b
2022-11-28 04:13:55 -08:00
Christoph Purrer 022e22cbd4 Replace folly::Optional with std::optional (#35436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35436

Using std::optional as react-native has been using C++17 for quite some time

changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D41415031

fbshipit-source-id: d786647f64b4f90cf75409109830ae0885460c17
2022-11-28 02:08:12 -08:00
Pieter De Baets ef66856bae Fix packager liveness check broken on internal builds
Summary: Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D41437735

fbshipit-source-id: 83dbea41512c196bfcb4b8b9e5d94847f2b11ce4
2022-11-21 10:36:05 -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
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
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
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
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
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
Christoph Purrer c0f06e8bba Adding missing #import <QuartzCore/QuartzCore.h> imports (#35315)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35315

These headers are needed on react-native-macOS, but not explicitly imported all the time.

It seems that some UIKit header will implicitly import them.

We have other use case in react-native(-iOS) in which we also explicitly importing them - https://github.com/facebook/react-native/search?q=QuartzCore- , hence use following 'that' practice 'here'.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D41229835

fbshipit-source-id: b0182bf4f7905e8e157b341eb62cadec6ba354ca
2022-11-14 06:04:19 -08:00
Ruslan Lesiutin 1453ef1a88 refactor(react-native-github): move ProgressViewIOS to internal (#35277)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35277

# Changelog:
[JS][Removed] - removed ProgressViewIOS module
[iOS][Removed] - removed native iOS sources of ProgressViewIOS

Reviewed By: lunaleaps

Differential Revision: D40937475

fbshipit-source-id: 9060adf3c99727af4eeffc767ccfd0a70574859d
2022-11-09 16:09:31 -08:00
Riccardo Cipolleschi 25a00520d8 Refactor subclassing of RCTEventEmitter (#35106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35106

This Diff remove the assert on the initializer in the EventEmitter in place of a more idiomatic check when the method is invoked.

It aims to solve an internal error and promotes best practices for the iOS platform.

## Changelog:
[iOS][Changed] Refactor RCTEventEmitter initialization

Reviewed By: sammy-SC

Differential Revision: D40762253

fbshipit-source-id: 83d26616ce147914948e536e9e4b1010758fb690
2022-11-08 07:06:07 -08:00
fabriziobertoglio1987 55c0df43b9 Adding pager, scrollview, viewgroup, webview, drawer roles (#34477)
Summary:
- adds missing roles
- adds custom roles that don't exist in TalkBack (see the [compositor.json][10] and [string.xml][11] files).
- fixes [issues with Drawer][12]
- fixes issues with ScrollView missing roles
- seek control already exist as adjustable d460d097ac

Relevant https://github.com/facebook/react-native/issues/30839#issuecomment-1222293556
fixes https://github.com/facebook/react-native/issues/30839

## Changelog

[Android] [Fixed]  - Adding pager, scrollview, viewgroup, webview, drawer roles

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

Test Plan:
Android
- Drawer Layout and ScrollView (02/09/22) https://github.com/facebook/react-native/pull/34477#issuecomment-1235293165
- sliding drawer, drawer layout, icon menu https://github.com/facebook/react-native/pull/34477#issuecomment-1224112650
- Horizontal and Vertical ScrollView https://github.com/facebook/react-native/pull/34477#issuecomment-1225478289
- Toast https://github.com/facebook/react-native/pull/34477#issuecomment-1225369629
- CheckedTextView https://github.com/facebook/react-native/pull/34477#discussion_r959329833
- Spinner (dropdownlist) https://github.com/facebook/react-native/pull/34477#discussion_r959374894
- EditText https://github.com/facebook/react-native/pull/34477#discussion_r959412185
- WebView https://github.com/facebook/react-native/pull/34477#discussion_r959417518
- Testing chime_up and chime_down sound feedback in Scrollable https://github.com/facebook/react-native/pull/34477#issuecomment-1238882030

iOS https://github.com/facebook/react-native/pull/34477#issuecomment-1232418595

[10]: 771de7cdbf/compositor/src/main/res/raw/compositor.json (L1082-L1108)
[11]: 771de7cdbf/compositor/src/main/res/values/strings.xml (L223)
[12]: https://github.com/facebook/react-native/pull/34477#issuecomment-1224112650

Reviewed By: NickGerleman

Differential Revision: D39894307

Pulled By: blavalla

fbshipit-source-id: 4a8da78bae485ead0523689631d88d1031a07b74
2022-11-07 23:25:33 -08:00
Christoph Purrer 19d65a2baf Update .podspec license information (#35245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35245

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41084913

fbshipit-source-id: a4ba31a19ffe515aa4e7c5a6e273a8cc4b6bc42d
2022-11-07 09:52:52 -08:00
Robert Balicki 6152763398 Buck, etc. changes that enable persisted, sync settings for DevTools (#35163)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35163

# What

This diff contains all the changes from D40333083 (0fac9817df) (aka https://github.com/facebook/react-native/pull/34964), **except** the change to `setUpReactDevTools.js`, which actually uses the new files.

# Why

* We want to ship the Buck, C++, etc. changes before the JavaScript changes that depend on those files.
* Otherwise, apps can fail at startup with the message:
```
`TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` +
      'Verify that a module by this name is registered in the native binary.',
```
* Note that this only occurs if you are using a previously-built version of the C++, Obj C, etc. files in RN, but a more recent version of the JavaScript files. If you are building from matching sources, this does not occur.
* After a few days, we can land the JS files.

## Changelog

Changelog
[General][Added] Add, but don't use, DevTools Settings Manager.

Reviewed By: NickGerleman

Differential Revision: D40873390

fbshipit-source-id: c7bac6ae65f85666b8616443db278ebb175b691b
2022-11-07 07:40:21 -08:00
Dmitry Rykun bbd432e999 feat: make RCTBlobManager TurboModule-compatible (#35188)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35188

This diff reverts D40716048 (279cfec55f) (https://github.com/facebook/react-native/pull/35047) which breaks RCTImageLoader.
https://pxl.cl/2jKrM
Those files are auto-generated and are not supposed to be edited manually.
Changelog: [iOS] [Fixed] - https://github.com/facebook/react-native/pull/35047 reverted.

Reviewed By: cipolleschi

Differential Revision: D40979350

fbshipit-source-id: ef92cf05636cba818151d4184e0275a3aab56cff
2022-11-03 08:52:34 -07:00
Shawn Dempsey 714b22bb43 Local filenames with colon should be parsed correctly (#35123)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35123

**Context**

On RN Desktop, images can be copy/pasted into text inputs.
When copy/pasting local files w/ semi-colons in the filename (`/downloads/devices:pre-call-IMG_346C38284B2B-1.jpeg`), RN would throw this error.

{F785684529}

The error was due to no having the correct asset loader due to the local file path being parsed incorrectly.

To parse the url, we convert the string URI to a `NSURL` using a custom convertor fn.
The conversion was matching any `:` and assuming it was a network url scheme:
https://www.internalfb.com/code/archon_react_native_macos/[fde4113acd89fb13ee11636c48b59eac49c21bae]/React/Base/RCTConvert.m?lines=97-111

When an image path with `:` in the name was passed to this, it was assuming it was a valid network url and not file path.

Because this is a local filepath, the image path needs to be a filesystem url. Since this was parsed as network url, it did not have the `file://` prefix and would not pass this check, causing the loader to throw.l
https://www.internalfb.com/code/fbsource/%5B60d9d5e67383%5D/xplat/js/react-native-github/Libraries/Image/RCTImageLoader.mm?lines=220-230

## Changelog

[iOS] [Added] -  Add support for parsing files w/ `:` in filename

Reviewed By: christophpurrer, philIip

Differential Revision: D40729963

fbshipit-source-id: 2f3adcabc8f0f1f22cbfca69c3484e72b1d93d25
2022-11-02 19:00:07 -07:00
Ruslan Lesiutin 4de2aaba50 refactor(AsyncStorage): move iOS files from react-native-github
Summary:
## Changelog:
[iOS][Removed] - Removed AsyncStorage module

Reviewed By: lunaleaps

Differential Revision: D40283712

fbshipit-source-id: 5e74c71915c2fbba4363e3fc917555039069038e
2022-10-31 14:39:19 -07:00
Nick Gerleman f3d9f2ea23 Map `accessibilityRole: grid` to `UIAccessibilityTraitNone`
Summary:
D38121921 (5ddb9977e6) added a grid accessibilityRole to Flow typings and RNTester example shared with iOS. It it forwarded on Android, but doesn't have an equivalent UIAccessibilityTrait mapping.`RNTesterSnapshotTests/testScrollViewExample` reports an error:
```
Failure: RedBox errors: (
    "Error setting property 'accessibilityRole' of RCTScrollView with tag #125: Invalid UIAccessibilityTraits 'grid'. should be one of: (
    adjustable,
====================== 38 lines skipped ======================
) (NSInternalInconsistencyException)
Path: <unknown>
Line: 0
```

This adds the grid mapping, which I think should fix this error.

Changelog:
[ios][Fixed] - Map `accessibilityRole: grid` to `UIAccessibilityTraitNone`

Reviewed By: christophpurrer

Differential Revision: D40848904

fbshipit-source-id: 80f72bcd4e4826cc0d535693117a6c1e5fbd1d7d
2022-10-31 04:18:44 -07:00
Christoph Purrer 84737e0069 Remove unused #import <UIKit/UIGestureRecognizerSubclass.h> import which breaks macOS (#35131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35131

Changelog:
[iOS][Fixed] - Remove unused #import <UIKit/UIGestureRecognizerSubclass.h> import which breaks macOS

Reviewed By: cortinico

Differential Revision: D40797971

fbshipit-source-id: 29839913a642247576caba9fe34724129c2bd3ba
2022-10-31 04:17:13 -07:00
Riccardo Cipolleschi ec5a4301a3 Separatedly enable TM/Fabric (#35117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35117

This mimics some behavior we have in Android that allow uesers to turn on selectively TM and Fabric.

Notice that if fabric is enabled, TM must be enabled as well, otherwise the app won't work

## Changelog
[iOS][Added] - Added the possibility to selectively enable TM and Fabric with the new Architecture

Reviewed By: cortinico

Differential Revision: D40794328

fbshipit-source-id: b7fc7bb819d05566dcd335832cab224f80b23346
2022-10-29 04:00:24 -07:00