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

37 Коммитов

Автор SHA1 Сообщение Дата
simek 2160377574 remove most of tvOS remnants from the code (#29407)
Summary:
Refs: [0.62 release](https://reactnative.dev/blog/#moving-apple-tv-to-react-native-tvos), https://github.com/facebook/react-native/issues/28706, https://github.com/facebook/react-native/issues/28743, https://github.com/facebook/react-native/issues/29018

This PR removes most of the tvOS remnants in the code. Most of the changes are related to the tvOS platform removal from `.podspec` files, tvOS specific conditionals removal (Obj-C + JS) or tvOS CI/testing pipeline related code.

In addition to the changes listed above I have removed the deprecated `Platform.isTVOS` method. I'm not sure how `Platform.isTV` method is correlated with Android TV devices support which is technically not deprecated in the core so I left this method untouched for now.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

* **[Internal] [Removed]** - remove most of tvOS remnants from the code:
  * `TVEventHandler`, `TVTouchable`, `RCTTVView`, `RCTTVRemoteHandler` and `RCTTVNavigationEventEmitter`
* **[Internal] [Removed]** - remove `TARGET_TV_OS` flag and all the usages
* **[iOS] [Removed]** - remove deprecated `Platform.isTVOS` method
* **[iOS] [Removed]** - remove deprecated and TV related props from View:
  * `isTVSelectable`, `hasTVPreferredFocus` and `tvParallaxProperties`
* **[iOS] [Removed]** - remove `BackHandler` utility implementation

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

Test Plan: Local tests (and iOS CI run) do not yield any errors, but I'm not sure how the CI pipeline would react to those changes. That is the reason why this PR is being posted as Draft. Some tweaks and code adjustment could be required.

Reviewed By: PeteTheHeat

Differential Revision: D22619441

Pulled By: shergin

fbshipit-source-id: 9aaf3840c5e8bd469c2cfcfa7c5b441ef71b30b6
2020-09-28 21:26:41 -07:00
Christoph Nakazawa ad879e50bc Add `RCTDevSplitBundleLoader` native module
Reviewed By: ejanzer

Differential Revision: D21302418

fbshipit-source-id: a868f6dad3306190c7add26e8f9a976866c16aef
2020-06-08 09:07:42 -07:00
Ramanpreet Nara 6a9a76e420 Make RCTDevLoadingView TurboModule-compatible
Summary:
This is a redo of D16969764, with a few extensions.

## Changes
1. Move `RCTDevLoadingView.{h,m}` to `CoreModuels/RCTDevLoadingView.{h,mm}`
2. Extract ObjC API of `RCTDevLodingView` into `RCTDevLoadingViewProtocol` in `ReactInternal`.
3. Create API `RCTDevLoadingViewSetEnabled.h` in `ReactInternal` to enable/disable `RCTDevLoadingView`

Changelog:
[iOS][Added] - Make RCTDevLoadingView TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18642554

fbshipit-source-id: 6b62e27e128d98254b7a6d018399ec1c06e274fc
2020-02-27 17:06:13 -08:00
Rick Hanlon 6b22a4e802 Add NativeLogBox module on iOS
Summary:
This diff adds a NativeLogBox module implementation on iOS to manage rendering LogBox the way we render RedBox, except rendering a React Native component instead of a native view.

The strategy here is:
- initialize: will create a hidden window (the way redbox does) and render the LogBox to it
- show: will show the window
- hide: will hide the window

Most of this is copied from the way RedBox works, the difference here is that we eagerly initialize the window with the `initialize` function so that it's warm by the time LogBox needs to render.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D18750008

fbshipit-source-id: 013e55ded55c8572bb08e0219ff4cd0060ebe0da
2019-12-10 02:31:37 -08:00
Ramanpreet Nara 1ad0862363 Revert D16969764: Make RCTDevLoadingView TurboModule-compatible
Differential Revision:
D16969764

Original commit changeset: 47e6682eea3f

fbshipit-source-id: d95b76eb8e57bbaff840b3d85f3745b13d622ce0
2019-11-21 08:43:12 -08:00
Ramanpreet Nara 294e31b7c2 Make RCTDevLoadingView TurboModule-compatible
Summary:
RCTDevLoadingView wasn't hooked up to the codegen. This diff makes RCTDevLoadingView type-safe and also makes it TurboModule-compatible.

Changelog:
[iOS][Added] - Make RCTDevLoadingView TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D16969764

fbshipit-source-id: 47e6682eea3fc49d3f0448c636b5f616d5bce220
2019-11-20 11:20:12 -08:00
Ramanpreet Nara d73ae1baa3 Make RCTWebSocketModule TurboModule-compatible
Summary:
Changelog:
[iOS][Added] - Make RCTWebSocketModule TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18353766

fbshipit-source-id: fde0f6593dd203ab3dcb8f9cf40012ba4761d6ba
2019-11-08 14:14:46 -08:00
Ramanpreet Nara 3beb8341fd Make RCTTVNavigationEventEmitter TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RCTTVNavigationEventEmitter TurboModule-compatible

Reviewed By: shergin

Differential Revision: D18142252

fbshipit-source-id: c633a5a0abd9e980346379921b34219228153348
2019-11-04 16:07:24 -08:00
Ramanpreet Nara 7e5de4e241 Make RedBox TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RedBox TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18142255

fbshipit-source-id: 2d130aca93a88ac7c983ce0e4848955ffb0be518
2019-11-04 16:07:23 -08:00
Ramanpreet Nara fe3ae9dce8 Make RCTDevMenu and RCTDevSettings TurboModule-compatible
Summary:
Changelog:
[iOS][Added] - Make RCTDevMenu and RCTDevSettings TurboModule-compatible

Reviewed By: shergin

Differential Revision: D18148890

fbshipit-source-id: bd4f0b2797e299cd963e34fa47044a9e1232efe0
2019-11-04 16:07:23 -08:00
Ramanpreet Nara 809d01095e Make RCTPerfMonitor TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RCTPerfMonitor TurboModule-compatible

Reviewed By: shergin

Differential Revision: D18145947

fbshipit-source-id: df2f0d60a4924f094cc4ec311b6bf570fb9fb7e1
2019-11-01 12:06:21 -07:00
Ramanpreet Nara 7233ae4f11 Make RCTAppState TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RCTAppState TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18142253

fbshipit-source-id: 5bd8afa6e3ee98f92aac3b2ebdfe63b9f7afc775
2019-11-01 12:06:21 -07:00
Ramanpreet Nara 6481a124da Make RCTKeyboardObserver TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RCTKeyboardObserver TurboModule-compatible

Reviewed By: shergin

Differential Revision: D18130902

fbshipit-source-id: 79dff2aeede7cb2485d48597a1f80e546c107e7a
2019-11-01 12:06:20 -07:00
Ramanpreet Nara dc12676e3a Make RCTStatusBarManager TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RCTStatusBarManager TurboModule-compatible

Reviewed By: shergin

Differential Revision: D18130374

fbshipit-source-id: 3ec226bcff17e47ffd9eba05e32c1eb68d6135b2
2019-11-01 12:06:20 -07:00
Adam Ernst bdaab3c2e5 Run depslint on fb_plugin_apple_library rules
Summary: Changelog: [Internal]

Differential Revision: D18152380

fbshipit-source-id: f33f6cb2f6baeba0719a91c5189357be33a38f59
2019-10-26 13:47:15 -07:00
Ramanpreet Nara d8fda74c24 Move RCTImage NativeModules back to RCTImage
Summary:
In D16805827, I moved `RCTImageLoader`, `RCTImageStoreManager`, and `RCTImageEditingManager` to `CoreModules`. This was necessary to turn `RCTImageLoader` into a TurboModule. However, after D17671288 landed, it's no longer necessary to have OSS NativeModules in `CoreModules`. Therefore, I'm moving these NativeModules back to `RCTImage`.

Changelog: [iOS][Fixed] Move RCTImage NativeModules back to RCTImage

Reviewed By: shergin

Differential Revision: D17921612

fbshipit-source-id: 8ae36d2dc8deaf704313cbe2479bfa011ebcbfbc
2019-10-21 17:15:32 -07:00
Ramanpreet Nara 2b5f4de7eb Make RCTTiming TurboModule-compatible
Summary: Changelog: [iOS][Added] Make RCTTiming TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D17891665

fbshipit-source-id: e0d36ccfb4f3f1d428668836a8b66698d51bdeaf
2019-10-16 19:00:26 -07:00
Ramanpreet Nara 2b62bd7695 Make RCTAsyncLocalStorage TurboModule-compatible
Summary:
**Note:** This was landed in D17724498 but reverted in D17855088. The revert had nothing to do with this NativeModule.

Changelog: [iOS][Added] Make RCTAsyncLocalStorage TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D17917841

fbshipit-source-id: 0f9dd5f592180d6512ca560007daa531a4da5b59
2019-10-15 09:16:56 -07:00
Ramanpreet Nara da6274ba76 Make RCTAlertManager TurboModule-compatible
Summary:
**Note:** This was landed in D17722913, but reverted in D17855088. The revert had nothing to do with this NativeModule.

Changelog: [iOS][Added] Make RCTAlertManager TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D17917827

fbshipit-source-id: d86ea2cddddd9535d656709296c74aebd6f45793
2019-10-15 09:16:56 -07:00
Ashok Menon df96de78bb Back out D17720575 -- D17724498
Summary: This stack caused FB4A builds to start failing, complaining about `RCTImageApple`.

Reviewed By: RSNara

Differential Revision: D17855088

fbshipit-source-id: 21ecedc3725dde65fab20f414d07b32c3548447c
2019-10-10 09:41:33 -07:00
Ramanpreet Nara 7eb7c84a09 Make RCTAsyncLocalStorage TurboModule-compatible
Summary: See title.

Reviewed By: PeteTheHeat

Differential Revision: D17724498

fbshipit-source-id: 738fdd1e4db3b435029b8300d426cca1242c1587
2019-10-09 12:34:00 -07:00
Ramanpreet Nara 60321a78ad Make RCTAlertManager TurboModule-compatible
Summary: See title.

Reviewed By: PeteTheHeat

Differential Revision: D17722913

fbshipit-source-id: cb78b9ea1bf497d27b19255e48809850e698ba0d
2019-10-09 12:34:00 -07:00
Ramanpreet Nara 3aa8a40659 Move RCTImage NativeModules back to RCTImage
Summary: In D16805827, I moved `RCTImageLoader`, `RCTImageStoreManager`, and `RCTImageEditingManager` to `CoreModules`. This was necessary to turn `RCTImageLoader` into a TurboModule. However, after D17671288 landed, it's no longer necessary to have OSS NativeModules in `CoreModules`. Therefore, I'm moving these NativeModules back to `RCTImage`.

Reviewed By: PeteTheHeat

Differential Revision: D17720575

fbshipit-source-id: 44b07cfa07cbb2b87254132810f86974edc7edab
2019-10-09 12:33:59 -07:00
Ramanpreet Nara 021a63d4da Ensure internal builds don't use plugin stubs
Summary: We generate a stub for plugin system, so that TurboModules can work in OSS. Unless the `RN_DISABLE_OSS_PLUGIN_HEADER` define is seet, TurboModules will use the plugin stub. Therefore, for internal builds, we should set this define.

Reviewed By: fkgozali, mdvacca

Differential Revision: D17789993

fbshipit-source-id: a93735738513457236adb3064b80601053c95dd3
2019-10-07 14:55:39 -07:00
Ramanpreet Nara d7864d20d5 Mark plugin function definitions used
Summary: We need to mark the OSS plugin functions with `__attribute__((used))`, so that the compiler doesn't strip them out.

Reviewed By: fkgozali

Differential Revision: D17742818

fbshipit-source-id: df8055286cace850cea21bb6f09eb5ee6b587c0e
2019-10-03 13:06:06 -07:00
Ramanpreet Nara 101125f891 Make RCTActionSheetManager TurboModule-compatible
Summary: RCTActionSheetManager is now hooked up to the NativeModule codegen. It's also TurboModule-compatible.

Reviewed By: PeteTheHeat

Differential Revision: D16966007

fbshipit-source-id: 8fdd32cf9fa09ccda9f38513bb0ac9896f8af1b0
2019-09-30 14:32:21 -07:00
Ramanpreet Nara f5ab719445 Make RCTClipboard, RCTI18nManager, and RCTSourceCode TurboModule-compatible
Summary: These NativeModules were easy to convert, since no other NativeModules in `React/Modules` depend on them.

Reviewed By: PeteTheHeat

Differential Revision: D16817959

fbshipit-source-id: 1036c2d437e1275776a185bf68c450c6454985df
2019-09-23 15:25:30 -07:00
Héctor Ramos 63fa3f21c5 Add Appearance native module
Summary:
Implements the Appearance native module as discussed in https://github.com/react-native-community/discussions-and-proposals/issues/126.

The purpose of the Appearance native module is to expose the user's appearance preferences. It provides a basic get() API that returns the user's preferred color scheme on iOS 13 devices, also known as Dark Mode. It also provides the ability to subscribe to events whenever an appearance preference changes.

The name, "Appearance", was chosen purposefully to allow for future expansion to cover other appearance preferences such as reduced motion, reduced transparency, or high contrast modes.

Changelog:

[iOS] [Added] - The Appearance native module can be used to prepare your app for Dark Mode on iOS 13.

Reviewed By: yungsters

Differential Revision: D16699954

fbshipit-source-id: 03b4cc5d2a1a69f31f3a6d9bece23f6867b774ea
2019-08-30 17:07:57 -07:00
Peter Argany f229d67498 Make RCTAccessibilityManger a TurboModule
Summary:
Move RCTAccessibilityManager to CoreModules (since that's the only dir that supports TM).

Fixup some variable names to match spec.

Reviewed By: RSNara

Differential Revision: D16861739

fbshipit-source-id: a0a53b221dcc172979d1f2c83851ab92e23f2333
2019-08-23 12:01:52 -07:00
Peter Argany 685c15a955 Make RCTDeviceInfo a TurboModule
Summary: Follow pattern laid out by Kevin in D16001262 to convert a Core OSS native module to use TM generated spec.

Reviewed By: RSNara

Differential Revision: D16016391

fbshipit-source-id: f517777be44c68367d786f04c50cf12f240eed00
2019-08-21 14:31:02 -07:00
Peter Argany 6991e28653 Move RCTExceptionsManager to CoreModules and make it conform to spec
Summary:
`NativeExceptionsManager.js` contains the JS spec for this native module. This diff moves the objc code to CoreModules (since it's the only directory that supports TM at the moment) and makes it conform to the spec.

NOTE: I will update podfiles after this diff is reviewed, before I land. Adding those generated changes makes it really hard to review.

Reviewed By: RSNara

Differential Revision: D16812212

fbshipit-source-id: 38b6e9a20ce15e7e9995df34493b37ed7adb2911
2019-08-15 20:25:23 -07:00
Peter Argany 30c1196d7d Convert RCTImageLoader to TurboModules [4/N]
Summary:
This diff adds a JS spec for RCTImageLoader, and conforms to it in ObjC++. Since RCTImageLoader isn't called from JS, the js spec is empty. Since `/CoreModules/` is the only dir in OSS which supports TM, move the ObjC++ impl there.

The change in `NativeExceptionsManager.js` fixes a weird bug I was hitting in codegen, where the codegen cpp file wouldn't compile due to unused variable.

Reviewed By: JoshuaGross

Differential Revision: D16495674

fbshipit-source-id: 191897b87730a6b0b96022eedc6412551fae04a6
2019-08-15 11:33:37 -07:00
Kevin Gozali 987e5197f0 TM iOS: autogenerate plugins map based on FB build system
Summary: This adds internal script to automatically sync the plugins definition. For github consumption, the CoreModulesPlugins.* will stay checked in, nothing change.

Reviewed By: RSNara

Differential Revision: D16102352

fbshipit-source-id: 8f74ea9dde046183ae620682fd7e181b4cc95a94
2019-07-04 11:21:56 -07:00
Kevin Gozali 9c56be2721 TM iOS: Introduce OSS-compatible RCTCoreModulesClassProvider()
Summary: To look up TurboModule Class based on its name, this new function `RCTCoreModulesClassProvider()` can be used to find a TurboModule impl in the app. For now this is manually maintained and sync'ed with FB internal version. Only modules that live under React/CoreModules/ should be handled here.

Reviewed By: PeteTheHeat

Differential Revision: D16100291

fbshipit-source-id: 6b7556dec1fa83d1e081c7e8c0fe295187934274
2019-07-04 11:21:55 -07:00
Kevin Gozali e883197807 Reland: [RN] iOS OSS: define plugin entries for OSS NativeModules
Summary: A reland of f26ffbf561

Reviewed By: sammy-SC

Differential Revision: D16091073

fbshipit-source-id: 09660ba987c3035333eac55e6bb94373fad9252b
2019-07-02 10:35:18 -07:00
Ben Blackburne b476ad78b5 Revert D16082484: [RN] iOS OSS: define plugin entries for OSS NativeModules
Differential Revision:
D16082484

Original commit changeset: 81d9f20b2041

fbshipit-source-id: 682476fccff7320de9ffd541b9a9ff3cae4da3bd
2019-07-02 00:14:26 -07:00
Kevin Gozali f26ffbf561 iOS OSS: define plugin entries for OSS NativeModules
Summary: This is an attempt to use internal iOS plugin system for NativeModules in github.

Reviewed By: RSNara

Differential Revision: D16082484

fbshipit-source-id: 81d9f20b20419e9613a2babdd56d0e037705bf4e
2019-07-01 20:33:34 -07:00