react-native-macos/BUCK

1512 строки
60 KiB
Python
Исходник Обычный вид История

load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
load("//tools/build_defs/apple:fb_apple_test.bzl", "fb_apple_test")
load("//tools/build_defs/apple:flag_defs.bzl", "get_objc_arc_preprocessor_flags", "get_preprocessor_flags_for_build_mode", "get_static_library_ios_flags")
load("//tools/build_defs/apple/plugins:plugin_defs.bzl", "plugin")
load("//tools/build_defs/oss:metro_defs.bzl", "rn_library")
load(
"//tools/build_defs/oss:rn_codegen_defs.bzl",
"rn_codegen",
"rn_codegen_components",
)
load(
"//tools/build_defs/oss:rn_defs.bzl",
"ANDROID",
"APPLE",
"IOS",
"RCT_IMAGE_DATA_DECODER_SOCKET",
"RCT_IMAGE_URL_LOADER_SOCKET",
"RCT_URL_REQUEST_HANDLER_SOCKET",
"YOGA_CXX_TARGET",
"fb_xplat_cxx_test",
"get_react_native_ios_target_sdk_version",
"react_cxx_module_plugin_provider",
"react_fabric_component_plugin_provider",
"react_module_plugin_providers",
"react_native_root_target",
"react_native_xplat_dep",
"react_native_xplat_target",
"rn_apple_library",
"rn_apple_xplat_cxx_library",
"rn_extra_build_flags",
"rn_xplat_cxx_library",
"subdir_glob",
)
load("//tools/build_defs/third_party:yarn_defs.bzl", "yarn_workspace")
RCTCXXBRIDGE_PUBLIC_HEADERS = {
"React/" + x: "packages/react-native/React/CxxBridge/" + x
for x in [
"JSCExecutorFactory.h",
"NSDataBigString.h",
"RCTCxxBridgeDelegate.h",
"RCTJSIExecutorRuntimeInstaller.h",
"RCTMessageThread.h",
]
}
fb_native.genrule(
name = "codegen_rn_components_schema_rncore",
srcs = glob(
[
"packages/**/*NativeComponent.js",
],
exclude = [
"**/__*__/**",
# Subfolders with their own BUCK files, referenced below
"packages/rn-tester/**",
],
) + [
react_native_root_target("packages/rn-tester:nativecomponent-srcs"),
],
out = "schema-rncore.json",
cmd = "$(exe {}) $OUT $SRCS".format(react_native_root_target("packages/react-native-codegen:write_to_json")),
labels = ["uses_hg"],
)
rn_codegen_components(
name = "rncore",
schema_target = ":codegen_rn_components_schema_rncore",
)
rn_apple_xplat_cxx_library(
name = "RCTCxxBridge",
srcs = glob([
"packages/react-native/React/CxxBridge/*.mm",
]),
headers = subdir_glob(
[
(
"packages/react-native/React/CxxBridge",
"*.h",
),
],
exclude = RCTCXXBRIDGE_PUBLIC_HEADERS.values(),
prefix = "React",
),
header_namespace = "",
exported_headers = RCTCXXBRIDGE_PUBLIC_HEADERS,
compiler_flags = [
"-fobjc-arc-exceptions",
],
contacts = ["oncall+react_native@xmail.facebook.com"],
exported_preprocessor_flags = rn_extra_build_flags(),
fbobjc_enable_exceptions = True,
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
],
# Used via objc_lookupClass in RCTBridge. Semantics are meant to be "if
# it's linked in your app, transparently use it".
labels = [
"depslint_never_remove",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + [
"-DWITH_FBSYSTRACE=1",
"-DRCT_USE_HERMES=0", # This is the default.
],
visibility = ["PUBLIC"],
deps = [
":RCTCxxModule",
":RCTCxxUtils",
":ReactInternal",
"//fbobjc/Libraries/FBReactKit:RCTFBSystrace",
react_native_root_target("packages/react-native/React/CoreModules:CoreModules"),
react_native_xplat_target("cxxreact:bridge"),
react_native_xplat_target("cxxreact:jsbigstring"),
react_native_xplat_target("jsc:JSCRuntime"),
react_native_xplat_target("jsiexecutor:jsiexecutor"),
react_native_xplat_target("reactperflogger:reactperflogger"),
],
)
RCTCXXMODULE_PUBLIC_HEADERS = {
"React/" + x: "packages/react-native/React/CxxModule/" + x
for x in [
"RCTCxxMethod.h",
"RCTCxxModule.h",
"RCTCxxUtils.h",
]
}
rn_apple_xplat_cxx_library(
name = "RCTCxxModule",
srcs = glob([
"packages/react-native/React/CxxModule/*.mm",
]),
headers = subdir_glob(
[
(
"packages/react-native/React/CxxModule",
"*.h",
),
],
exclude = RCTCXXMODULE_PUBLIC_HEADERS.values(),
prefix = "React",
),
header_namespace = "",
exported_headers = RCTCXXMODULE_PUBLIC_HEADERS,
compiler_flags = [
"-fobjc-arc-exceptions",
],
contacts = ["oncall+react_native@xmail.facebook.com"],
fbobjc_enable_exceptions = True,
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + ["-DWITH_FBSYSTRACE=1"],
visibility = ["PUBLIC"],
deps = [
":RCTCxxUtils",
":ReactInternal",
"//xplat/fbsystrace:fbsystrace",
react_native_xplat_target("cxxreact:module"),
react_native_xplat_target("cxxreact:bridge"),
react_native_xplat_target("reactperflogger:reactperflogger"),
react_native_xplat_dep("jsi:jsi"),
],
)
rn_apple_xplat_cxx_library(
name = "RCTCxxUtils",
srcs = glob([
"packages/react-native/React/CxxUtils/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"packages/react-native/React/CxxUtils",
"*.h",
),
],
exclude = RCTCXXMODULE_PUBLIC_HEADERS.values(),
prefix = "React",
),
apple_sdks = (IOS,),
contacts = ["oncall+react_native@xmail.facebook.com"],
fbobjc_enable_exceptions = True,
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
"//xplat/folly:dynamic",
],
)
rn_apple_xplat_cxx_library(
name = "RCTCxxLogUtils",
srcs = glob([
"packages/react-native/React/CxxLogUtils/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"packages/react-native/React/CxxLogUtils",
"*.h",
),
],
prefix = "React",
),
contacts = ["oncall+react_native@xmail.facebook.com"],
fbobjc_enable_exceptions = True,
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:ReactInternal",
react_native_xplat_target("logger:logger"),
],
)
RCTLIB_PATH = "packages/react-native/Libraries/"
RCTBASE_PATH = "packages/react-native/React/Base/"
RCTDEVSUPPORT_PATH = "packages/react-native/React/DevSupport/"
RCTMODULES_PATH = "packages/react-native/React/Modules/"
RCTVIEWS_PATH = "packages/react-native/React/Views/"
REACT_PUBLIC_HEADERS = {
"React/RCTAnimationType.h": RCTVIEWS_PATH + "RCTAnimationType.h",
"React/RCTAssert.h": RCTBASE_PATH + "RCTAssert.h",
"React/RCTAutoInsetsProtocol.h": RCTVIEWS_PATH + "RCTAutoInsetsProtocol.h",
Added border curve style prop ("Squircle" effect - iOS only) (#33783) Summary: <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> NOTE: PR is based on https://github.com/facebook/react-native/pull/32017 which went stale for quite a long time but can now safely be closed ![](https://preview.redd.it/nuvl4746ys471.png?width=960&crop=smart&auto=webp&s=084a517a645364ac246b70b7fa8e0f2470cc7af3) Since iOS 13+, it is possible to change the corner curve property on iOS in order to smoothen border radius and make it more "rounded" (also called "squircle") Here's an [article](https://medium.com/arthurofbabylon/a-smooth-corner-radius-in-ios-54b80aa2d372) explaining in details what it is. This property is also built in figma, but currently there is no way to implement this directly with react-native despite it being available natively on iOS. Many open source react-native libraries were created in order to simulate this behaviour: [react-native-super-ellipse-mask](https://github.com/everdrone/react-native-super-ellipse-mask) [react-native-squircle-view](https://github.com/everdrone/react-native-squircle-view) [react-native-figma-squircle](https://github.com/tienphaw/react-native-figma-squircle) But they rely on creating an SVG shape with the smoothed corners and masking the view behind. This makes it not very performant (flickering on mounting was a common side-effect) This PR aims at implementing the property natively. PR for the docs update: https://github.com/facebook/react-native-website/pull/2785 ## 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 --> [iOS] [Added] - Added `borderCurve` style prop for smooth border radius (squircle effect) Pull Request resolved: https://github.com/facebook/react-native/pull/33783 Test Plan: We used the RNTester app and added an example with `cornerCurve ` set to `'continuous'` (only on iOS). As the difference is quite subtle, we also made some more tests to better illustrate the difference (these are not in the RN-tester app): ![IMG_0810](https://user-images.githubusercontent.com/19872411/133893536-26207c53-aade-4583-9eef-7a1739b6907b.PNG) We overlapped two views with `position: absolute`, the one in the background has a red background and has `cornerRadius` set to `false`, and the one in the foreground is set to `true`. We can clearly see where the borders differs on the corners. Reviewed By: sammy-SC Differential Revision: D37883631 Pulled By: cipolleschi fbshipit-source-id: 09f06de9628fa326323eba63875de30102c4a59e
2022-07-21 14:11:30 +03:00
"React/RCTBorderCurve.h": RCTVIEWS_PATH + "RCTBorderCurve.h",
"React/RCTBorderDrawing.h": RCTVIEWS_PATH + "RCTBorderDrawing.h",
"React/RCTBorderStyle.h": RCTVIEWS_PATH + "RCTBorderStyle.h",
"React/RCTBridge+Private.h": RCTBASE_PATH + "RCTBridge+Private.h",
"React/RCTBridge.h": RCTBASE_PATH + "RCTBridge.h",
"React/RCTBridgeConstants.h": RCTBASE_PATH + "RCTBridgeConstants.h",
"React/RCTBridgeDelegate.h": RCTBASE_PATH + "RCTBridgeDelegate.h",
"React/RCTBridgeMethod.h": RCTBASE_PATH + "RCTBridgeMethod.h",
"React/RCTBridgeModule.h": RCTBASE_PATH + "RCTBridgeModule.h",
"React/RCTBridgeModuleDecorator.h": RCTBASE_PATH + "RCTBridgeModuleDecorator.h",
"React/RCTBundleManager.h": RCTBASE_PATH + "RCTBundleManager.h",
"React/RCTBundleURLProvider.h": RCTBASE_PATH + "RCTBundleURLProvider.h",
"React/RCTComponent.h": RCTVIEWS_PATH + "RCTComponent.h",
"React/RCTComponentData.h": RCTVIEWS_PATH + "RCTComponentData.h",
"React/RCTComponentEvent.h": RCTBASE_PATH + "RCTComponentEvent.h",
"React/RCTConstants.h": RCTBASE_PATH + "RCTConstants.h",
"React/RCTConvert.h": RCTBASE_PATH + "RCTConvert.h",
"React/RCTCxxConvert.h": RCTBASE_PATH + "RCTCxxConvert.h",
"React/RCTDefines.h": RCTBASE_PATH + "RCTDefines.h",
"React/RCTDevLoadingViewProtocol.h": RCTDEVSUPPORT_PATH + "RCTDevLoadingViewProtocol.h",
"React/RCTDevLoadingViewSetEnabled.h": RCTDEVSUPPORT_PATH + "RCTDevLoadingViewSetEnabled.h",
"React/RCTDisplayLink.h": RCTBASE_PATH + "RCTDisplayLink.h",
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`](https://github.com/facebook/react-native/blob/afb124dcf0cdf0db525acc7cfd2cea2742c64068/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-16 06:03:37 +03:00
"React/RCTDynamicTypeRamp.h": RCTLIB_PATH + "Text/Text/RCTDynamicTypeRamp.h",
"React/RCTErrorCustomizer.h": RCTBASE_PATH + "RCTErrorCustomizer.h",
"React/RCTErrorInfo.h": RCTBASE_PATH + "RCTErrorInfo.h",
# NOTE: RCTEventDispatcher.h is exported from CoreModules:CoreModulesApple
"React/RCTEventDispatcherProtocol.h": RCTBASE_PATH + "RCTEventDispatcherProtocol.h",
"React/RCTEventEmitter.h": RCTMODULES_PATH + "RCTEventEmitter.h",
"React/RCTFont.h": RCTVIEWS_PATH + "RCTFont.h",
"React/RCTFrameUpdate.h": RCTBASE_PATH + "RCTFrameUpdate.h",
"React/RCTI18nUtil.h": RCTMODULES_PATH + "RCTI18nUtil.h",
"React/RCTImageSource.h": RCTBASE_PATH + "RCTImageSource.h",
"React/RCTInitializing.h": RCTBASE_PATH + "RCTInitializing.h",
"React/RCTInspector.h": "packages/react-native/React/Inspector/RCTInspector.h",
"React/RCTInspectorDevServerHelper.h": RCTDEVSUPPORT_PATH + "RCTInspectorDevServerHelper.h",
"React/RCTInspectorPackagerConnection.h": "packages/react-native/React/Inspector/RCTInspectorPackagerConnection.h",
"React/RCTInvalidating.h": RCTBASE_PATH + "RCTInvalidating.h",
"React/RCTJSScriptLoaderModule.h": RCTBASE_PATH + "RCTJSScriptLoaderModule.h",
"React/RCTJSStackFrame.h": RCTBASE_PATH + "RCTJSStackFrame.h",
Ensure RCTJSThread is initialized in Bridgeless mode Summary: ## Context When Venice is enabled app-wide, we won't be creating/initializing the bridge. This means that RCTBridge +(void)initialize; won't execute: https://www.internalfb.com/code/fbsource/[d8b25a1907ee55baa21e02a69ecab0f7a9442b8e]/xplat/js/react-native-github/React/Base/RCTBridge.m?lines=167%2C171-180 ## Problem When RCTBridge initialize isn't executed, we won't initialize RCTJSThread to kCFNull. RCTJSThread will be nil. NativeModules like RCTEventDispatcher use RCTJSThread to indicate that their methods must be executed on the JavaScript thread: https://www.internalfb.com/code/fbsource/[44976912ae618619a394f063c4c942ef020b86e8]/xplat/js/react-native-github/React/CoreModules/RCTEventDispatcher.mm?lines=198-201 If RCTJSThread is nil, these NativeModules will fail to initialize w/ the TurboModule system: https://www.internalfb.com/code/fbsource/[f6a04f529ac1354b2973bd3553d12aef28ff24f2][blame]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm?lines=584-589%2C595%2C599%2C610-618 How: 1. The TurboModuleManager will see that each of these NativeModules has a methodQueue getter (line 587 above). 2. It'll invoke that getter (line 588), and get a nil methodQueue out, when **that methodQueue should be kCFNull**. 3. Because the TurboModuleManager gets a nil method queue from the getter, !methodQueue will pass (line 595). 4. So, TurboModuleManager try to create and assign a method queue to these modules (line 611), which'll raise an error (line 613), because none of these modules synthesize the methodQueue (b/c they expose a getter to methodQueue instead). ## Changes We need to initialize RCTJSThread to kCFNull in all cases, to prevent this breakage. So, I moved RCTJSThread into its own header: RCTJSThread.h. RCTJSThread.h exports a function that initializes the RCTJSThread constant: _RCTInitializeJSThreadConstantInternal. This function gets invoked inside RCTHost initialize, and RCTBridge initialize. Created from CodeHub with https://fburl.com/edit-in-codehub Changelog: [Internal] Reviewed By: p-sun, mdvacca Differential Revision: D30910515 fbshipit-source-id: 2dd9b0cfcda92c497bb497f12f9fb847da563f47
2021-09-20 01:44:23 +03:00
"React/RCTJSThread.h": RCTBASE_PATH + "RCTJSThread.h",
"React/RCTJavaScriptExecutor.h": RCTBASE_PATH + "RCTJavaScriptExecutor.h",
"React/RCTJavaScriptLoader.h": RCTBASE_PATH + "RCTJavaScriptLoader.h",
"React/RCTKeyCommands.h": RCTBASE_PATH + "RCTKeyCommands.h",
"React/RCTLayout.h": RCTVIEWS_PATH + "RCTLayout.h",
"React/RCTLayoutAnimation.h": RCTMODULES_PATH + "RCTLayoutAnimation.h",
"React/RCTLayoutAnimationGroup.h": RCTMODULES_PATH + "RCTLayoutAnimationGroup.h",
"React/RCTLog.h": RCTBASE_PATH + "RCTLog.h",
"React/RCTManagedPointer.h": RCTBASE_PATH + "RCTManagedPointer.h",
"React/RCTMockDef.h": RCTBASE_PATH + "RCTMockDef.h",
"React/RCTModalHostViewController.h": RCTVIEWS_PATH + "RCTModalHostViewController.h",
"React/RCTModalHostViewManager.h": RCTVIEWS_PATH + "RCTModalHostViewManager.h",
"React/RCTModalManager.h": RCTVIEWS_PATH + "RCTModalManager.h",
"React/RCTModuleData.h": RCTBASE_PATH + "RCTModuleData.h",
"React/RCTModuleMethod.h": RCTBASE_PATH + "RCTModuleMethod.h",
"React/RCTMultipartStreamReader.h": RCTBASE_PATH + "RCTMultipartStreamReader.h",
"React/RCTNullability.h": RCTBASE_PATH + "RCTNullability.h",
"React/RCTPLTag.h": RCTBASE_PATH + "RCTPLTag.h",
"React/RCTPackagerClient.h": RCTDEVSUPPORT_PATH + "RCTPackagerClient.h",
"React/RCTPackagerConnection.h": RCTDEVSUPPORT_PATH + "RCTPackagerConnection.h",
"React/RCTPerformanceLogger.h": RCTBASE_PATH + "RCTPerformanceLogger.h",
"React/RCTPerformanceLoggerLabels.h": RCTBASE_PATH + "RCTPerformanceLoggerLabels.h",
"React/RCTPointerEvents.h": RCTVIEWS_PATH + "RCTPointerEvents.h",
"React/RCTProfile.h": "packages/react-native/React/Profiler/RCTProfile.h",
"React/RCTPushNotificationManager.h": RCTLIB_PATH + "PushNotificationIOS/RCTPushNotificationManager.h",
"React/RCTReconnectingWebSocket.h": RCTLIB_PATH + "WebSocket/RCTReconnectingWebSocket.h",
"React/RCTRedBoxExtraDataViewController.h": RCTMODULES_PATH + "RCTRedBoxExtraDataViewController.h",
"React/RCTRedBoxSetEnabled.h": RCTBASE_PATH + "RCTRedBoxSetEnabled.h",
"React/RCTRefreshableProtocol.h": RCTVIEWS_PATH + "RefreshControl/RCTRefreshableProtocol.h",
"React/RCTReloadCommand.h": RCTBASE_PATH + "RCTReloadCommand.h",
"React/RCTRootContentView.h": RCTBASE_PATH + "RCTRootContentView.h",
"React/RCTRootShadowView.h": RCTVIEWS_PATH + "RCTRootShadowView.h",
"React/RCTRootView.h": RCTBASE_PATH + "RCTRootView.h",
"React/RCTRootViewDelegate.h": RCTBASE_PATH + "RCTRootViewDelegate.h",
"React/RCTScrollEvent.h": RCTVIEWS_PATH + "ScrollView/RCTScrollEvent.h",
"React/RCTScrollView.h": RCTVIEWS_PATH + "ScrollView/RCTScrollView.h",
"React/RCTScrollableProtocol.h": RCTVIEWS_PATH + "ScrollView/RCTScrollableProtocol.h",
"React/RCTShadowView+Layout.h": RCTVIEWS_PATH + "RCTShadowView+Layout.h",
"React/RCTShadowView.h": RCTVIEWS_PATH + "RCTShadowView.h",
"React/RCTSurface.h": RCTBASE_PATH + "Surface/RCTSurface.h",
"React/RCTSurfaceDelegate.h": RCTBASE_PATH + "Surface/RCTSurfaceDelegate.h",
"React/RCTSurfaceHostingProxyRootView.h": RCTBASE_PATH + "Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h",
"React/RCTSurfaceHostingView.h": RCTBASE_PATH + "Surface/SurfaceHostingView/RCTSurfaceHostingView.h",
"React/RCTSurfacePresenterStub.h": RCTMODULES_PATH + "RCTSurfacePresenterStub.h",
"React/RCTSurfaceProtocol.h": RCTBASE_PATH + "Surface/RCTSurfaceProtocol.h",
"React/RCTSurfaceRootShadowView.h": RCTBASE_PATH + "Surface/RCTSurfaceRootShadowView.h",
"React/RCTSurfaceRootShadowViewDelegate.h": RCTBASE_PATH + "Surface/RCTSurfaceRootShadowViewDelegate.h",
"React/RCTSurfaceRootView.h": RCTBASE_PATH + "Surface/RCTSurfaceRootView.h",
"React/RCTSurfaceSizeMeasureMode.h": RCTBASE_PATH + "Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.h",
"React/RCTSurfaceStage.h": RCTBASE_PATH + "Surface/RCTSurfaceStage.h",
"React/RCTSurfaceView+Internal.h": RCTBASE_PATH + "Surface/RCTSurfaceView+Internal.h",
"React/RCTSurfaceView.h": RCTBASE_PATH + "Surface/RCTSurfaceView.h",
"React/RCTTextDecorationLineType.h": RCTVIEWS_PATH + "RCTTextDecorationLineType.h",
"React/RCTTouchHandler.h": RCTBASE_PATH + "RCTTouchHandler.h",
"React/RCTTurboModuleRegistry.h": RCTBASE_PATH + "RCTTurboModuleRegistry.h",
"React/RCTUIManager.h": RCTMODULES_PATH + "RCTUIManager.h",
"React/RCTUIManagerObserverCoordinator.h": RCTMODULES_PATH + "RCTUIManagerObserverCoordinator.h",
"React/RCTUIManagerUtils.h": RCTMODULES_PATH + "RCTUIManagerUtils.h",
"React/RCTUIUtils.h": "packages/react-native/React/UIUtils/RCTUIUtils.h",
"React/RCTURLRequestDelegate.h": RCTBASE_PATH + "RCTURLRequestDelegate.h",
"React/RCTURLRequestHandler.h": RCTBASE_PATH + "RCTURLRequestHandler.h",
"React/RCTUtils.h": RCTBASE_PATH + "RCTUtils.h",
"React/RCTUtilsUIOverride.h": RCTBASE_PATH + "RCTUtilsUIOverride.h",
"React/RCTVersion.h": RCTBASE_PATH + "RCTVersion.h",
"React/RCTView.h": RCTVIEWS_PATH + "RCTView.h",
"React/RCTViewManager.h": RCTVIEWS_PATH + "RCTViewManager.h",
"React/RCTViewUtils.h": RCTVIEWS_PATH + "RCTViewUtils.h",
"React/RCTWrapperViewController.h": RCTVIEWS_PATH + "RCTWrapperViewController.h",
"React/UIView+React.h": RCTVIEWS_PATH + "UIView+React.h",
}
REACT_COMPONENTVIEWS_BASE_FILES = [
"packages/react-native/React/Fabric/Mounting/ComponentViews/Image/*.mm",
"packages/react-native/React/Fabric/RCTImageResponseObserverProxy.mm",
"packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm",
]
rn_apple_xplat_cxx_library(
name = "ReactInternal",
srcs = glob(
[
"packages/react-native/React/Base/**/*.m",
"packages/react-native/React/Base/**/*.mm",
"packages/react-native/React/DevSupport/**/*.m",
"packages/react-native/React/DevSupport/**/*.mm",
"packages/react-native/React/Inspector/**/*.m",
"packages/react-native/React/Inspector/**/*.mm",
"packages/react-native/React/Modules/**/*.m",
"packages/react-native/React/Modules/**/*.mm",
"packages/react-native/React/Profiler/**/*.m",
"packages/react-native/React/Profiler/**/*.mm",
"packages/react-native/React/Profiler/**/*.S",
"packages/react-native/React/UIUtils/*.m",
"packages/react-native/React/Views/**/*.m",
"packages/react-native/React/Views/**/*.mm",
"packages/react-native/Libraries/ActionSheetIOS/*.m",
"packages/react-native/Libraries/WebSocket/*.m",
],
),
headers = glob(
[
"packages/react-native/React/Base/**/*.h",
"packages/react-native/React/DevSupport/**/*.h",
"packages/react-native/React/Inspector/**/*.h",
"packages/react-native/React/Modules/**/*.h",
"packages/react-native/React/Profiler/**/*.h",
"packages/react-native/React/Views/**/*.h",
"packages/react-native/React/UIUtils/**/*.h",
"packages/react-native/Libraries/ActionSheetIOS/*.h",
"packages/react-native/Libraries/WebSocket/*.h",
],
),
header_namespace = "",
exported_headers = REACT_PUBLIC_HEADERS,
compiler_flags = [
"-Wno-error=unguarded-availability-new",
"-Wno-unknown-warning-option",
"-Wno-global-constructors",
],
contacts = ["oncall+react_native@xmail.facebook.com"],
exported_preprocessor_flags = rn_extra_build_flags(),
fbobjc_enable_exceptions = True,
frameworks = [
"$SDKROOT/System/Library/Frameworks/CFNetwork.framework",
"$SDKROOT/System/Library/Frameworks/CoreGraphics.framework",
"$SDKROOT/System/Library/Frameworks/CoreLocation.framework",
Optimize font handling on iOS (#31764) Summary: Few issues I saw when profiling RNTester: - Repeatedly calling `-lowercaseString` during `weightOfFont` causes a TON of extra memory traffic, for no reason. - `NSCache` is thread-safe, so no need for a mutex. - Using `stringWithFormat:` for the cache key is slow. Use `NSValue` to store the data directly instead. - Calling `-fontDescriptor` in `isItalicFont` and `isCondensedFont` is overly expensive and unnecessary. - `+fontNamesForFamilyName:` is insanely expensive. Wrap it in a cache. Unscientific test on RNTester iPhone 11 Pro, memory & time. Before: <img width="1656" alt="Screen Shot 2021-06-23 at 7 40 06 AM" src="https://user-images.githubusercontent.com/2466893/123092882-f4f55100-d3f8-11eb-906f-d25086049a18.png"> <img width="1656" alt="Screen Shot 2021-06-23 at 7 41 30 AM" src="https://user-images.githubusercontent.com/2466893/123092886-f6267e00-d3f8-11eb-89f6-cfd2cae9f7b6.png"> After: <img width="1455" alt="Screen Shot 2021-06-23 at 9 02 54 AM" src="https://user-images.githubusercontent.com/2466893/123101899-7d2c2400-d402-11eb-97f8-2ee97ee69ec4.png"> <img width="1455" alt="Screen Shot 2021-06-23 at 8 59 44 AM" src="https://user-images.githubusercontent.com/2466893/123101892-7bfaf700-d402-11eb-9a10-def46b37b87f.png"> Changelog: [iOS][Changed] - Optimized font handling Pull Request resolved: https://github.com/facebook/react-native/pull/31764 Reviewed By: appden Differential Revision: D30241725 Pulled By: yungsters fbshipit-source-id: 342e4f6e5492926acd2afc7d645e6878846369fc
2021-08-27 08:40:03 +03:00
"$SDKROOT/System/Library/Frameworks/CoreText.framework",
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
"$SDKROOT/System/Library/Frameworks/MapKit.framework",
"$SDKROOT/System/Library/Frameworks/QuartzCore.framework",
"$SDKROOT/System/Library/Frameworks/Security.framework",
"$SDKROOT/System/Library/Frameworks/SystemConfiguration.framework",
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
"$SDKROOT/System/Library/Frameworks/UserNotifications.framework",
"$SDKROOT/System/Library/Frameworks/WebKit.framework",
],
labels = [
"depslint_never_add",
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
platform_preprocessor_flags = [(
"linux",
["-D PIC_MODIFIER=@PLT"],
)],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + rn_extra_build_flags(),
visibility = [
"//fbobjc/Apps/Internal/SparkLabs/...",
"//fbobjc/Apps/Internal/Venice/...",
"//fbobjc/Apps/Wilde/FBMarketplaceModule/...",
"//fbobjc/Apps/Wilde/FBReactModule2/...",
"//fbobjc/Libraries/FBQPLMetadataProviders/...",
"//fbobjc/Libraries/FBReactKit/...",
"//fbobjc/Libraries/FBiOSSecurityUtils/...",
"//fbobjc/Libraries/RCTPrerendering/...",
"//fbobjc/VendorLib/react-native-maps:react-native-maps",
"//xplat/js:",
"//xplat/js/react-native-github/packages/react-native/React/...",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/nativemodule/core:",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/nativemodule/samples:",
"//xplat/js/react-native-github/packages/rn-tester:",
"//xplat/rtc/manul/...",
],
deps = [
YOGA_CXX_TARGET,
"//fbobjc/VendorLib/SocketRocket:SocketRocket",
react_native_xplat_target("cxxreact:bridge"),
react_native_xplat_target("reactperflogger:reactperflogger"),
],
)
rn_apple_xplat_cxx_library(
name = "RCTFabric",
srcs = glob(
[
"packages/react-native/React/Fabric/**/*.cpp",
"packages/react-native/React/Fabric/**/*.m",
"packages/react-native/React/Fabric/**/*.mm",
],
exclude = glob(REACT_COMPONENTVIEWS_BASE_FILES),
),
headers = glob(
[
"packages/react-native/React/Fabric/**/*.h",
],
),
header_namespace = "",
exported_headers = {
"React/RCTComponentViewDescriptor.h": "packages/react-native/React/Fabric/Mounting/RCTComponentViewDescriptor.h",
"React/RCTComponentViewFactory.h": "packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.h",
"React/RCTComponentViewRegistry.h": "packages/react-native/React/Fabric/Mounting/RCTComponentViewRegistry.h",
"React/RCTFabricSurface.h": "packages/react-native/React/Fabric/Surface/RCTFabricSurface.h",
"React/RCTFabricSurfaceHostingProxyRootView.h": "packages/react-native/React/Fabric/Surface/RCTFabricSurfaceHostingProxyRootView.h",
"React/RCTGenericDelegateSplitter.h": "packages/react-native/React/Fabric/Utils/RCTGenericDelegateSplitter.h",
"React/RCTLegacyViewManagerInteropComponentView.h": "packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h",
"React/RCTLocalizationProvider.h": "packages/react-native/React/Fabric/RCTLocalizationProvider.h",
"React/RCTModalHostViewComponentView.h": "packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h",
"React/RCTMountingManager.h": "packages/react-native/React/Fabric/Mounting/RCTMountingManager.h",
"React/RCTMountingManagerDelegate.h": "packages/react-native/React/Fabric/Mounting/RCTMountingManagerDelegate.h",
"React/RCTMountingTransactionObserving.h": "packages/react-native/React/Fabric/Mounting/RCTMountingTransactionObserving.h",
"React/RCTParagraphComponentAccessibilityProvider.h": "packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h",
"React/RCTParagraphComponentView.h": "packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h",
"React/RCTPrimitives.h": "packages/react-native/React/Fabric/RCTPrimitives.h",
"React/RCTRootComponentView.h": "packages/react-native/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h",
"React/RCTScheduler.h": "packages/react-native/React/Fabric/RCTScheduler.h",
"React/RCTScrollViewComponentView.h": "packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h",
"React/RCTSurfacePresenter.h": "packages/react-native/React/Fabric/RCTSurfacePresenter.h",
"React/RCTSurfacePresenterBridgeAdapter.h": "packages/react-native/React/Fabric/RCTSurfacePresenterBridgeAdapter.h",
"React/RCTSurfaceRegistry.h": "packages/react-native/React/Fabric/RCTSurfaceRegistry.h",
"React/RCTSurfaceTouchHandler.h": "packages/react-native/React/Fabric/RCTSurfaceTouchHandler.h",
},
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++17",
"-Wall",
],
contacts = ["oncall+react_native@xmail.facebook.com"],
fbobjc_enable_exceptions = True,
fbobjc_target_sdk_version = get_react_native_ios_target_sdk_version(),
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
"$SDKROOT/System/Library/Frameworks/QuartzCore.framework",
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
],
header_path_prefix = "React",
labels = [
"disable_plugins_only_validation",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
plugins = [
react_fabric_component_plugin_provider("SafeAreaView", "RCTSafeAreaViewCls"),
react_fabric_component_plugin_provider("ScrollView", "RCTScrollViewCls"),
react_fabric_component_plugin_provider("PullToRefreshView", "RCTPullToRefreshViewCls"),
react_fabric_component_plugin_provider("ActivityIndicatorView", "RCTActivityIndicatorViewCls"),
react_fabric_component_plugin_provider("Switch", "RCTSwitchCls"),
react_fabric_component_plugin_provider("UnimplementedNativeView", "RCTUnimplementedNativeViewCls"),
react_fabric_component_plugin_provider("Paragraph", "RCTParagraphCls"),
react_fabric_component_plugin_provider("TextInput", "RCTTextInputCls"),
react_fabric_component_plugin_provider("InputAccessoryView", "RCTInputAccessoryCls"),
react_fabric_component_plugin_provider("View", "RCTViewCls"),
],
plugins_header = "FBRCTFabricComponentsPlugins.h",
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + [
"-DWITH_FBSYSTRACE=1",
"-DLOG_TAG=\"ReactNative\"",
"-DRN_DISABLE_OSS_PLUGIN_HEADER",
] + rn_extra_build_flags(),
tests = [
":MountingTests",
":TextTests",
],
visibility = ["PUBLIC"],
deps = [
":RCTFabricComponentViewsBase",
"//fbobjc/Libraries/FBReactKit/RCTFabricComponent/RCTFabricComponentPlugin:RCTFabricComponentPlugin",
"//xplat/js/react-native-github:RCTCxxBridge",
"//xplat/js/react-native-github:RCTCxxLogUtils",
"//xplat/js/react-native-github:RCTCxxUtils",
"//xplat/js/react-native-github:RCTImage",
"//xplat/js/react-native-github:RCTPushNotification",
"//xplat/js/react-native-github:RCTText",
"//xplat/js/react-native-github:ReactInternal",
react_native_xplat_target("react/renderer/attributedstring:attributedstring"),
react_native_xplat_target("react/renderer/componentregistry:componentregistry"),
react_native_xplat_target("react/renderer/componentregistry/native:native"),
react_native_xplat_target("react/renderer/textlayoutmanager:textlayoutmanager"),
react_native_xplat_target("runtimeexecutor:runtimeexecutor"),
YOGA_CXX_TARGET,
react_native_xplat_target("react/config:config"),
react_native_xplat_target("cxxreact:bridge"),
],
exported_deps = [
react_native_xplat_target("react/renderer/animations:animations"),
react_native_xplat_target("react/renderer/components/scrollview:scrollview"),
react_native_xplat_target("react/renderer/components/safeareaview:safeareaview"),
react_native_xplat_target("react/renderer/components/modal:modal"),
react_native_xplat_target("react/renderer/components/unimplementedview:unimplementedview"),
react_native_xplat_target("react/renderer/components/text:text"),
react_native_xplat_target("react/renderer/components/legacyviewmanagerinterop:legacyviewmanagerinterop"),
react_native_xplat_target("react/renderer/components/textinput/iostextinput:iostextinput"),
react_native_xplat_target("react/renderer/components/inputaccessory:inputaccessory"),
react_native_xplat_target("react/renderer/core:core"),
react_native_xplat_target("react/renderer/debug:debug"),
react_native_xplat_target("react/renderer/scheduler:scheduler"),
react_native_xplat_target("react/renderer/uimanager:uimanager"),
"//xplat/js/react-native-github:generated_components-rncore",
],
)
rn_apple_library(
name = "RCTTypeSafety",
srcs = glob([
"packages/react-native/Libraries/TypeSafety/**/*.mm",
]),
exported_headers = glob(
[
"packages/react-native/Libraries/TypeSafety/**/*.h",
],
),
autoglob = False,
complete_nullability = True,
contacts = ["oncall+react_native@xmail.facebook.com"],
disable_infer_precompiled_header = True,
extension_api_only = True,
frameworks = [
Use an SDKRoot based Foundation framework Summary: When building `igios-no-extensions` with buck2 on linux, we the following analysis error: ``` When running analysis for `fbsource//fbobjc/Apps/Instagram/Instagram:InstagramNoExtensions (fbsource//tools/build_defs/config/platform/apple:Instagram-125ae32099392ce8)` Caused by: 0: When running analysis for `fbsource//fbobjc/Apps/Instagram/Instagram:InstagramARVRFrameworkDylibFramework (fbsource//tools/build_defs/config/platform/apple:Instagram-125ae32099392ce8)` 1: When running analysis for `fbsource//fbobjc/Apps/Instagram/Instagram:InstagramDependencyPoolForLinkGroupsFramework (fbsource//tools/build_defs/config/platform/apple:Instagram-125ae32099392ce8)` 2: When running analysis for `fbsource//fbobjc/Libraries/FBReactKit:RCTNetInfo (fbsource//tools/build_defs/config/platform/apple:Instagram-125ae32099392ce8)` 3: When running analysis for `fbsource//xplat/js/RKJSModules/Libraries/NetInfo:FBReactNativeNetInfoSpecApple (fbsource//tools/build_defs/config/platform/apple:Instagram-125ae32099392ce8)` 4: When running analysis for `fbsource//xplat/js/react-native-github:RCTTypeSafety (fbsource//tools/build_defs/config/platform/apple:Instagram-125ae32099392ce8)` 5: Traceback (most recent call last): * fbcode/buck2/prelude/apple/apple_library.bzl:48, in <module> constructor_params, swift_providers = apple_library_rule_constructor_params_a... * fbcode/buck2/prelude/apple/apple_library.bzl:111, in apple_library_rule_constructor_params_and_swift_providers args = [cmd_args(get_framework_search_path_flags(ctx))], * fbcode/buck2/prelude/apple/apple_frameworks.bzl:46, in get_framework_search_path_flags return _get_framework_search_path_flags(_get_non_sdk_framework_directories(ct... * fbcode/buck2/prelude/apple/apple_frameworks.bzl:59, in _get_non_sdk_framework_directories return dedupe(filter(None, [_non_sdk_framework_directory(ctx, x) for x in fra... * fbcode/buck2/prelude/apple/apple_frameworks.bzl:95, in _non_sdk_framework_directory expanded_framework_path = _expand_sdk_framework_path(ctx, framework_path) * fbcode/buck2/prelude/apple/apple_frameworks.bzl:81, in _expand_sdk_framework_path expanded_path = expanded_path.replace(path_variable, path_value) error: Type of parameter `new` doesn't match, expected `str`, actual `artifact` --> fbcode/buck2/prelude/apple/apple_frameworks.bzl:81:25 | 81 | expanded_path = expanded_path.replace(path_variable, path_value) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ``` This is related to running on Linux with buck2 and how we get the framework paths for linux/pika toolchains for non SDK frameworks. However, Foundation is an SDK framework, and updating it to be as such allows us to build, both with buck1 and buck2. Differential Revision: D38080376 fbshipit-source-id: b226c3511e3312d0bf0ddb792dbe4ca99768cad1
2022-07-23 01:19:12 +03:00
"Foundation",
],
inherited_buck_flags = get_static_library_ios_flags(),
labels = [
"fbios_link_group:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"talkios_link_group:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
reexport_all_header_dependencies = True,
deps = [
":ReactInternalApple",
"//xplat/folly:optionalApple",
"//xplat/js/react-native-github/packages/react-native/Libraries/FBLazyVector:FBLazyVector",
],
)
yarn_workspace(
name = "yarn-workspace",
srcs = [
"package.json",
],
visibility = ["PUBLIC"],
)
fb_apple_test(
name = "TextTestsApple",
srcs = ["packages/react-native/React/Tests/Text/RCTParagraphComponentViewTests.mm"],
frameworks = [
"$PLATFORM_DIR/Developer/Library/Frameworks/XCTest.framework",
],
oncall = "react_native",
deps = [
":RCTFabricApple",
react_native_xplat_target("react/renderer/element:elementApple"),
"//xplat/js/react-native-github:RCTFabricComponentViewsBaseApple",
"//xplat/js/react-native-github:RCTTextApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/attributedstring:attributedstringApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/componentregistry:componentregistryApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop:legacyviewmanagerinteropApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/text:textApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput:iostextinputApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/scheduler:schedulerApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/textlayoutmanager:textlayoutmanagerApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/runtimeexecutor:runtimeexecutorApple",
],
)
fb_apple_test(
name = "MountingTestsApple",
srcs = ["packages/react-native/React/Tests/Mounting/RCTComponentViewRegistryTests.mm"],
frameworks = [
"$PLATFORM_DIR/Developer/Library/Frameworks/XCTest.framework",
],
oncall = "react_native",
deps = [
":ImageView",
":RCTFabricApple",
"//xplat/js/react-native-github:RCTFabricComponentViewsBaseApple",
"//xplat/js/react-native-github:RCTTextApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/attributedstring:attributedstringApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/componentregistry:componentregistryApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop:legacyviewmanagerinteropApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput:iostextinputApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/scheduler:schedulerApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/textlayoutmanager:textlayoutmanagerApple",
"//xplat/js/react-native-github/packages/react-native/ReactCommon/runtimeexecutor:runtimeexecutorApple",
],
)
rn_apple_library(
name = "ImageView",
autoglob = False,
compiler_flags = ["-Wall"],
contacts = ["oncall+react_native@xmail.facebook.com"],
labels = [
"disable_plugins_only_validation",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
plugins = [react_fabric_component_plugin_provider("Image", "RCTImageCls")],
visibility = ["PUBLIC"],
exported_deps = [
":RCTFabricComponentViewsBaseApple",
],
)
# Reduce the RCTFabric target by moving OSS RCTViewComponentViews here, so that
# eventually we can move all of React/Fabric/Mounting/ComponentViews/* here.
# Ideally, each component view gets its own target, and each target uses react_fabric_component_plugin_provider.
# For each component, an app can import the base component view, or an app-specific subclass.
# i.e. Apps depend on "ImageView" target for RCTImageComponentView.h, and "FBReactImageView" target for FBReactImageComponentView.h
rn_apple_xplat_cxx_library(
name = "RCTFabricComponentViewsBase",
srcs = glob(REACT_COMPONENTVIEWS_BASE_FILES),
header_namespace = "",
exported_headers = {
"React/RCTComponentViewProtocol.h": "packages/react-native/React/Fabric/Mounting/RCTComponentViewProtocol.h",
"React/RCTConversions.h": "packages/react-native/React/Fabric/RCTConversions.h",
"React/RCTImageComponentView.h": "packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h",
"React/RCTImageResponseDelegate.h": "packages/react-native/React/Fabric/RCTImageResponseDelegate.h",
"React/RCTImageResponseObserverProxy.h": "packages/react-native/React/Fabric/RCTImageResponseObserverProxy.h",
"React/RCTTouchableComponentViewProtocol.h": "packages/react-native/React/Fabric/RCTTouchableComponentViewProtocol.h",
"React/RCTViewComponentView.h": "packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h",
"React/UIView+ComponentViewProtocol.h": "packages/react-native/React/Fabric/Mounting/UIView+ComponentViewProtocol.h",
},
compiler_flags = ["-Wall"],
contacts = ["oncall+react_native@xmail.facebook.com"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:RCTImage",
"//xplat/js/react-native-github:RCTLinking",
react_native_xplat_target("react/renderer/imagemanager:imagemanager"),
react_native_xplat_target("react/renderer/components/image:image"),
react_native_xplat_target("react/renderer/components/view:view"),
react_native_xplat_target("react/renderer/componentregistry:componentregistry"),
],
)
rn_library(
name = "react-native",
srcs = [
"packages/react-native/package.json",
"packages/react-native/index.js",
] + glob(
[
"packages/react-native/Libraries/**/*.js",
"packages/react-native/Libraries/NewAppScreen/**/*.png",
"packages/react-native/Libraries/LogBox/**/*.png",
"packages/virtualized-lists/**/*.js",
"packages/virtualized-lists/**/*.json",
],
exclude = [
"**/__*__/**",
"**/gulpfile.js",
"packages/react-native/Libraries/Components/Switch/SwitchSchema.js",
"**/*._reactvr.js",
],
),
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js:node_modules__abort_19controller",
"//xplat/js:node_modules__anser",
"//xplat/js:node_modules__base64_19js",
Add back deprecated prop-types Summary: In 2017, React published v15.5 which extracted the built-in `prop types` to a separate package to reflect the fact that not everybody uses them. In 2018, React Native started to remove `PropTypes` from React Native for the same reason. In 0.68 React Native introduced a deprecation warning which notified users that the change was coming, and in 0.69 we removed the PropTypes entirely. The feedback we've received from the community is that there has not been enough time to migrate libraries off of PropTypes. This has resulted in users needing to patch the React Native package `index.js` file directly to add back the PropTypes, instead of migrating off of them. We can empathize with this fix short term (it unblocks the upgrade) but long term this patch will cause users to miss important changes to `index.js`, and add a maintenance cost for users. Part of the reason there was not enough time is that we didn't do a good job surfacing libraries that were using PropTypes. This means, when you got a deprecation warning, it wasn't clear where the source of the usage was (either in your code or in a library). So even if you wanted to migrate, it was difficult to know where to actually make the change. In the next release, we've made it easier to find call sites using deprecated types by [fixing the code frame in errors](https://github.com/react-native-community/cli/pull/1699) reporting in LogBox, and ensuring that [the app doesn't crash without a warning](https://github.com/facebook/react-native/pull/34650). This should make it easier to identify exactly where the deprecated usage is, so you can migrate it. To help users get off of the patch, and allow more time to migrate, we're walking back the removal of PropTypes, and keeping it as a deprecation for a couple more versions. We ask that you either migrate off PropTypes to a type system like TypeScript, or migrate to the `deprecated-react-native-prop-types` package. Once we feel more confident that the community has migrated and will not need to patch React Native in order to fix this issue, we'll remove the PropTypes again. **If you have any trouble finding the source of the PropType usage, please file an issue so we can help track it down with you.** Changelog: [General][Changed] - Add back deprecated PropTypes Reviewed By: yungsters Differential Revision: D40725705 fbshipit-source-id: 8ce61be30343827efd6dc89a012eeef0b6676deb
2022-10-27 08:03:19 +03:00
"//xplat/js:node_modules__deprecated_19react_19native_19prop_19types",
"//xplat/js:node_modules__event_19target_19shim",
"//xplat/js:node_modules__flow_19enums_19runtime",
"//xplat/js:node_modules__invariant",
"//xplat/js:node_modules__memoize_19one",
"//xplat/js:node_modules__nullthrows",
"//xplat/js:node_modules__pretty_19format",
"//xplat/js:node_modules__promise",
"//xplat/js:node_modules__react_19devtools_19core",
"//xplat/js:node_modules__react_19refresh",
"//xplat/js:node_modules__react_19shallow_19renderer",
"//xplat/js:node_modules__regenerator_19runtime",
"//xplat/js:node_modules__stacktrace_19parser",
"//xplat/js:node_modules__whatwg_19fetch",
"//xplat/js/RKJSModules/Libraries/Polyfills:Polyfills",
React Native sync for revisions 0cac4d5...fd31724 Summary: - **[9fb581c7c](https://github.com/facebook/react/commit/9fb581c7c )**: Refactor: merge duplicate imports ([#25489](https://github.com/facebook/react/pull/25489)) //<c0dedance>// - **[bc358362a](https://github.com/facebook/react/commit/bc358362a )**: [Flight] Improve Error Messages when Invalid Object is Passed to Client/Host Components ([#25492](https://github.com/facebook/react/pull/25492)) //<Sebastian Markbåge>// - **[780eacd40](https://github.com/facebook/react/commit/780eacd40 )**: Flow upgrade to 0.190 ([#25483](https://github.com/facebook/react/pull/25483)) //<Jan Kassens>// - **[54f0e0f73](https://github.com/facebook/react/commit/54f0e0f73 )**: Scaffolding for react-dom/unstable_external-server-runtime ([#25482](https://github.com/facebook/react/pull/25482)) //<Andrew Clark>// - **[0eaca3756](https://github.com/facebook/react/commit/0eaca3756 )**: Add script to generate inline Fizz runtime ([#25481](https://github.com/facebook/react/pull/25481)) //<Andrew Clark>// - **[69c7246d9](https://github.com/facebook/react/commit/69c7246d9 )**: Initialize useMemoCache with sentinel values ([#25465](https://github.com/facebook/react/pull/25465)) //<Joseph Savona>// - **[3b814327e](https://github.com/facebook/react/commit/3b814327e )**: Allow Async Functions to be used in Server Components ([#25479](https://github.com/facebook/react/pull/25479)) //<Sebastian Markbåge>// - **[a6bf46689](https://github.com/facebook/react/commit/a6bf46689 )**: Extract Fizz instruction set to build macro ([#25457](https://github.com/facebook/react/pull/25457)) //<Andrew Clark>// - **[ea5bc6bac](https://github.com/facebook/react/commit/ea5bc6bac )**: [React Native FB] dynamic feature flag for ref access warning ([#25471](https://github.com/facebook/react/pull/25471)) //<Jan Kassens>// - **[08d035bc8](https://github.com/facebook/react/commit/08d035bc8 )**: Remove Shallow Renderer Tests ([#25475](https://github.com/facebook/react/pull/25475)) //<Sebastian Markbåge>// - **[a8c16a004](https://github.com/facebook/react/commit/a8c16a004 )**: Split Cache into its own Dispatcher ([#25474](https://github.com/facebook/react/pull/25474)) //<Sebastian Markbåge>// - **[2cf4352e1](https://github.com/facebook/react/commit/2cf4352e1 )**: Implement HostSingleton Fiber type ([#25426](https://github.com/facebook/react/pull/25426)) //<Josh Story>// - **[aa9988e5e](https://github.com/facebook/react/commit/aa9988e5e )**: Server render fork for react-dom ([#25436](https://github.com/facebook/react/pull/25436)) //<Josh Story>// - **[513417d69](https://github.com/facebook/react/commit/513417d69 )**: Return lastNonHostInstance in getInspectorDataForInstance for devtools ([#25441](https://github.com/facebook/react/pull/25441)) //<Tianyu Yao>// - **[5d60a0b84](https://github.com/facebook/react/commit/5d60a0b84 )**: Bugfix: LegacyHidden shouldn't defer effects ([#25442](https://github.com/facebook/react/pull/25442)) //<Andrew Clark>// - **[618388bc3](https://github.com/facebook/react/commit/618388bc3 )**: [Float] Support script preloads ([#25432](https://github.com/facebook/react/pull/25432)) //<Josh Story>// - **[2872a26e1](https://github.com/facebook/react/commit/2872a26e1 )**: track resources in different roots separately ([#25388](https://github.com/facebook/react/pull/25388)) //<Josh Story>// - **[ea04a486a](https://github.com/facebook/react/commit/ea04a486a )**: Flow: remove unused suppressions ([#25424](https://github.com/facebook/react/pull/25424)) //<Jan Kassens>// - **[9813edef2](https://github.com/facebook/react/commit/9813edef2 )**: Flow upgrade to 0.188 //<Jan Kassens>// - **[3b6826ed9](https://github.com/facebook/react/commit/3b6826ed9 )**: Flow: inference_mode=constrain_writes //<Jan Kassens>// - **[aed33a49c](https://github.com/facebook/react/commit/aed33a49c )**: Flow upgrade to 0.185 //<Jan Kassens>// - **[f02a5f5c7](https://github.com/facebook/react/commit/f02a5f5c7 )**: Flow upgrade to 0.182 //<Jan Kassens>// - **[72593f008](https://github.com/facebook/react/commit/72593f008 )**: Flow upgrade to 0.176 //<Jan Kassens>// - **[46d40f306](https://github.com/facebook/react/commit/46d40f306 )**: Flow upgrade to 0.175 //<Jan Kassens>// - **[1089faf0d](https://github.com/facebook/react/commit/1089faf0d )**: Flow: run codemod to remove existential type //<Jan Kassens>// - **[3fd9bd8e7](https://github.com/facebook/react/commit/3fd9bd8e7 )**: Add RulesOfHooks support for `use` //<Lauren Tan>// - **[338e6a967](https://github.com/facebook/react/commit/338e6a967 )**: Flow upgrade to 0.155 //<Jan Kassens>// - **[8bc95bb3c](https://github.com/facebook/react/commit/8bc95bb3c )**: Flow upgrade to 0.154 //<Jan Kassens>// - **[9f8a98a39](https://github.com/facebook/react/commit/9f8a98a39 )**: Flow upgrade to 0.153 //<Jan Kassens>// - **[64fe791be](https://github.com/facebook/react/commit/64fe791be )**: Flow upgrade to 0.146 //<Jan Kassens>// - **[d3c6c16a0](https://github.com/facebook/react/commit/d3c6c16a0 )**: Flow upgrade to 0.145 //<Jan Kassens>// - **[00a2f8150](https://github.com/facebook/react/commit/00a2f8150 )**: Flow upgrade to 0.143 //<Jan Kassens>// - **[0a3072278](https://github.com/facebook/react/commit/0a3072278 )**: Flow: complete types first migration ([#25389](https://github.com/facebook/react/pull/25389)) //<Jan Kassens>// - **[bcc05671f](https://github.com/facebook/react/commit/bcc05671f )**: Flow: types first in shared ([#25343](https://github.com/facebook/react/pull/25343)) //<Jan Kassens>// - **[b1f34aa30](https://github.com/facebook/react/commit/b1f34aa30 )**: Flow: types first in react-native-renderer ([#25363](https://github.com/facebook/react/pull/25363)) //<Jan Kassens>// - **[9143864ae](https://github.com/facebook/react/commit/9143864ae )**: Flow: well formed exports for smaller packages ([#25361](https://github.com/facebook/react/pull/25361)) //<Jan Kassens>// - **[21a851e03](https://github.com/facebook/react/commit/21a851e03 )**: Fix devtools typos and grammar ([#24587](https://github.com/facebook/react/pull/24587)) //<Alexandru Tasica>// - **[cfafeb685](https://github.com/facebook/react/commit/cfafeb685 )**: Remove extra space in Wedge.js ([#24611](https://github.com/facebook/react/pull/24611)) //<Kerim Büyükakyüz>// - **[9c3de25e1](https://github.com/facebook/react/commit/9c3de25e1 )**: Flow: types first in reconciler ([#25362](https://github.com/facebook/react/pull/25362)) //<Jan Kassens>// - **[7b25b961d](https://github.com/facebook/react/commit/7b25b961d )**: [Fizz/Float] Float for stylesheet resources ([#25243](https://github.com/facebook/react/pull/25243)) //<Josh Story>// - **[4c016e7aa](https://github.com/facebook/react/commit/4c016e7aa )**: Refactor: use property shorthand ([#25366](https://github.com/facebook/react/pull/25366)) //<zhangrenyang>// - **[06066c1a5](https://github.com/facebook/react/commit/06066c1a5 )**: Make RulesOfHooks-test more consistent with ExhaustiveDeps-test //<Lauren Tan>// - **[49ae0fad8](https://github.com/facebook/react/commit/49ae0fad8 )**: Fix RulesOfHooks test case indentation //<Lauren Tan>// - **[abbbdf4ce](https://github.com/facebook/react/commit/abbbdf4ce )**: Put modern StrictMode behind a feature flag ([#25365](https://github.com/facebook/react/pull/25365)) //<Samuel Susla>// - **[434110390](https://github.com/facebook/react/commit/434110390 )**: ReactHooks.js - delete emptyObject ([#25031](https://github.com/facebook/react/pull/25031)) //<Igor Berlenko>// - **[31400ce29](https://github.com/facebook/react/commit/31400ce29 )**: Refactor: merge duplicate imports ([#25364](https://github.com/facebook/react/pull/25364)) //<jerry-lllman>// - **[3517bd9f7](https://github.com/facebook/react/commit/3517bd9f7 )**: Refactor useEvent ([#25336](https://github.com/facebook/react/pull/25336)) //<Lauren Tan>// - **[6cf06a929](https://github.com/facebook/react/commit/6cf06a929 )**: Remove outdated comments. ([#24464](https://github.com/facebook/react/pull/24464)) //<zhangenming>// - **[20a257c25](https://github.com/facebook/react/commit/20a257c25 )**: Refactor: more word doubles removed ([#25352](https://github.com/facebook/react/pull/25352)) //<Vic Graf>// - **[8cadcffd5](https://github.com/facebook/react/commit/8cadcffd5 )**: Fix typo: reconcilation -> reconciliation ([#25355](https://github.com/facebook/react/pull/25355)) //<zhangrenyang>// - **[ebbe599a2](https://github.com/facebook/react/commit/ebbe599a2 )**: Fix EventListener fork ([#25347](https://github.com/facebook/react/pull/25347)) //<Sebastian Markbåge>// - **[97d75c9c8](https://github.com/facebook/react/commit/97d75c9c8 )**: Move react-dom implementation files to react-dom-bindings ([#25345](https://github.com/facebook/react/pull/25345)) //<Sebastian Markbåge>// - **[3de926449](https://github.com/facebook/react/commit/3de926449 )**: [Fizz] experimental_useEvent ([#25325](https://github.com/facebook/react/pull/25325)) //<dan>// - **[5b59dd640](https://github.com/facebook/react/commit/5b59dd640 )**: Fix duplicate words tests ([#25333](https://github.com/facebook/react/pull/25333)) //<Vic Graf>// - **[cb5084d1c](https://github.com/facebook/react/commit/cb5084d1c )**: [ESLint] Check useEvent references instead ([#25319](https://github.com/facebook/react/pull/25319)) //<Lauren Tan>// - **[c89a83695](https://github.com/facebook/react/commit/c89a83695 )**: Update RulesOfHooks with useEvent rules ([#25285](https://github.com/facebook/react/pull/25285)) //<Lauren Tan>// - **[efc6a08e9](https://github.com/facebook/react/commit/efc6a08e9 )**: [Flight] Implement error digests for Flight runtime and expose errorInfo in getDerivedStateFromError ([#25302](https://github.com/facebook/react/pull/25302)) //<Josh Story>// - **[c1d414d75](https://github.com/facebook/react/commit/c1d414d75 )**: Add ref to Offscreen component ([#25254](https://github.com/facebook/react/pull/25254)) //<Samuel Susla>// - **[135e33c95](https://github.com/facebook/react/commit/135e33c95 )**: Flow: typing of Scheduler ([#25317](https://github.com/facebook/react/pull/25317)) //<Jan Kassens>// - **[cc8cb145f](https://github.com/facebook/react/commit/cc8cb145f )**: Flow: add some missing types in react-reconciler ([#25316](https://github.com/facebook/react/pull/25316)) //<Jan Kassens>// - **[112d0498c](https://github.com/facebook/react/commit/112d0498c )**: [Fizz] Move digest from errorInfo to Error instance ([#25313](https://github.com/facebook/react/pull/25313)) //<Josh Story>// - **[d1bb1c586](https://github.com/facebook/react/commit/d1bb1c586 )**: Fix memory leak after repeated setState bailouts ([#25309](https://github.com/facebook/react/pull/25309)) //<Andrew Clark>// Changelog: [General][Changed] - React Native sync for revisions 0cac4d5...9fb581c jest_e2e[run_all_tests] Reviewed By: yungsters Differential Revision: D40383219 fbshipit-source-id: dc2a44bd05df041e0c7f2e1060640b1d2c372187
2022-10-17 19:52:15 +03:00
"//xplat/js/RKJSModules/Libraries/React:React",
"//xplat/js/RKJSModules/vendor/react:react",
"//xplat/js/RKJSModules/vendor/react-test-renderer:react-test-renderer",
"//xplat/js/RKJSModules/vendor/scheduler:scheduler",
"//xplat/js/react-native-github/packages/assets:assets",
"//xplat/js/react-native-github/packages/normalize-color:normalize-color",
"//xplat/js/react-native-github/packages/polyfills:polyfills",
"//xplat/js/tools/metro/packages/metro-runtime/src/modules:modules",
"//xplat/js/tools/metro/packages/metro-runtime/src/polyfills:polyfills",
],
)
rn_codegen(
name = "FBReactNativeSpec",
android_package_name = "com.facebook.fbreact.specs",
codegen_modules = True,
ios_assume_nonnull = False,
library_labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
native_module_spec_name = "FBReactNativeSpec",
src_prefix = "packages/react-native/Libraries/",
)
# TODO: Merge this into FBReactNativeSpec
rn_codegen(
name = "FBReactNativeComponentSpec",
codegen_components = True,
ios_assume_nonnull = False,
library_labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
src_prefix = "packages/react-native/Libraries/",
)
rn_apple_library(
name = "RCTAnimationApple",
srcs = glob([
"packages/react-native/Libraries/NativeAnimation/**/*.m",
"packages/react-native/Libraries/NativeAnimation/**/*.mm",
]),
headers = glob(
[
"packages/react-native/Libraries/NativeAnimation/**/*.h",
],
),
header_namespace = "",
exported_headers = glob(
[
"packages/react-native/Libraries/NativeAnimation/*.h",
"packages/react-native/Libraries/NativeAnimation/Drivers/*.h",
"packages/react-native/Libraries/NativeAnimation/Nodes/*.h",
],
),
autoglob = False,
frameworks = [
"Foundation",
"QuartzCore",
"UIKit",
],
header_path_prefix = "React",
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"extension_api_allow_unsafe_unavailable_usages",
"fbios_link_group:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"talkios_link_group:xplat/default/public.react_native.infra",
],
plugins =
react_module_plugin_providers(
name = "NativeAnimatedModule",
native_class_func = "RCTNativeAnimatedModuleCls",
) + react_module_plugin_providers(
name = "NativeAnimatedTurboModule",
native_class_func = "RCTNativeAnimatedTurboModuleCls",
),
plugins_header = "FBRCTAnimationPlugins.h",
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + rn_extra_build_flags() + [
"-DRN_DISABLE_OSS_PLUGIN_HEADER",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:FBReactNativeSpecApple",
"//xplat/js/react-native-github:RCTLinkingApple",
"//xplat/js/react-native-github:RCTPushNotificationApple",
"//xplat/js/react-native-github:ReactInternalApple",
],
)
rn_apple_library(
name = "RCTBlobApple",
srcs = glob([
"packages/react-native/Libraries/Blob/*.m",
"packages/react-native/Libraries/Blob/*.mm",
]),
headers = glob(
[
"packages/react-native/Libraries/Blob/*.h",
],
),
exported_headers = glob(
[
"packages/react-native/Libraries/Blob/*.h",
],
),
autoglob = False,
enable_exceptions = True,
frameworks = [
"Foundation",
"UIKit",
],
header_path_prefix = "React",
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"fbios_link_group:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
plugins =
react_module_plugin_providers(
name = "FileReaderModule",
native_class_func = "RCTFileReaderModuleCls",
) + react_module_plugin_providers(
name = "BlobModule",
native_class_func = "RCTBlobManagerCls",
) + [
plugin(
RCT_URL_REQUEST_HANDLER_SOCKET,
name = "BlobModule",
),
],
plugins_header = "FBRCTBlobPlugins.h",
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + rn_extra_build_flags() + [
"-DRN_DISABLE_OSS_PLUGIN_HEADER",
],
visibility = ["PUBLIC"],
deps = [
":RCTNetworkApple",
"//xplat/js/react-native-github:FBReactNativeSpecApple",
"//xplat/js/react-native-github:RCTLinkingApple",
"//xplat/js/react-native-github:RCTPushNotificationApple",
"//xplat/js/react-native-github:ReactInternalApple",
"//xplat/js/react-native-github/packages/react-native/React/CoreModules:CoreModulesApple",
"//xplat/jsi:jsiApple",
],
)
rn_apple_library(
name = "RCTLinkingApple",
srcs = glob([
"packages/react-native/Libraries/LinkingIOS/*.m",
"packages/react-native/Libraries/LinkingIOS/*.mm",
]),
headers = glob(
[
"packages/react-native/Libraries/LinkingIOS/*.h",
],
),
exported_headers = glob(
[
"packages/react-native/Libraries/LinkingIOS/*.h",
],
),
autoglob = False,
enable_exceptions = True,
frameworks = [
"Foundation",
"UIKit",
],
header_path_prefix = "React",
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"extension_api_allow_unsafe_unavailable_usages",
"fbios_link_group:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"talkios_link_group:xplat/default/public.react_native.infra",
],
plugins =
react_module_plugin_providers(
name = "LinkingManager",
native_class_func = "RCTLinkingManagerCls",
),
plugins_header = "FBRCTLinkingPlugins.h",
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + rn_extra_build_flags() + [
"-DRN_DISABLE_OSS_PLUGIN_HEADER",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:FBReactNativeSpecApple",
"//xplat/js/react-native-github:RCTPushNotificationApple",
"//xplat/js/react-native-github:ReactInternalApple",
"//xplat/jsi:jsiApple",
],
)
rn_apple_library(
name = "RCTPushNotificationApple",
srcs = glob([
"packages/react-native/Libraries/PushNotificationIOS/*.m",
"packages/react-native/Libraries/PushNotificationIOS/*.mm",
]),
headers = glob(
[
"packages/react-native/Libraries/PushNotificationIOS/*.h",
],
),
exported_headers = glob(
[
"packages/react-native/Libraries/PushNotificationIOS/*.h",
],
),
autoglob = False,
enable_exceptions = True,
frameworks = [
"Foundation",
"UIKit",
],
header_path_prefix = "React",
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"extension_api_allow_unsafe_unavailable_usages",
"fbios_link_group:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"talkios_link_group:xplat/default/public.react_native.infra",
],
plugins =
react_module_plugin_providers(
name = "PushNotificationManager",
native_class_func = "RCTPushNotificationManagerCls",
),
plugins_header = "FBRCTPushNotificationPlugins.h",
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + rn_extra_build_flags() + [
"-DRN_DISABLE_OSS_PLUGIN_HEADER",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:FBReactNativeSpecApple",
"//xplat/js/react-native-github:ReactInternalApple",
"//xplat/jsi:jsiApple",
],
)
rn_apple_library(
name = "RCTImageApple",
srcs = glob([
"packages/react-native/Libraries/Image/*.m",
"packages/react-native/Libraries/Image/*.mm",
]),
headers = glob(
[
"packages/react-native/Libraries/Image/*.h",
],
),
exported_headers = glob(
[
"packages/react-native/Libraries/Image/*.h",
],
),
autoglob = False,
frameworks = [
"AVFoundation",
"Accelerate",
"CoreMedia",
"Foundation",
"ImageIO",
"MobileCoreServices",
"QuartzCore",
"UIKit",
],
header_path_prefix = "React",
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"extension_api_allow_unsafe_unavailable_usages",
"fbios_link_group:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"talkios_link_group:xplat/default/public.react_native.infra",
],
plugins =
react_module_plugin_providers(
name = "GIFImageDecoder",
native_class_func = "RCTGIFImageDecoderCls",
) + react_module_plugin_providers(
name = "ImageEditingManager",
native_class_func = "RCTImageEditingManagerCls",
) + react_module_plugin_providers(
name = "ImageLoader",
native_class_func = "RCTImageLoaderCls",
) + react_module_plugin_providers(
name = "ImageStoreManager",
native_class_func = "RCTImageStoreManagerCls",
) + react_module_plugin_providers(
name = "LocalAssetImageLoader",
native_class_func = "RCTLocalAssetImageLoaderCls",
) + [
plugin(
RCT_IMAGE_DATA_DECODER_SOCKET,
name = "GIFImageDecoder",
),
plugin(
RCT_IMAGE_URL_LOADER_SOCKET,
name = "LocalAssetImageLoader",
),
plugin(
RCT_URL_REQUEST_HANDLER_SOCKET,
name = "ImageLoader",
),
plugin(
RCT_URL_REQUEST_HANDLER_SOCKET,
name = "ImageStoreManager",
),
],
plugins_header = "FBRCTImagePlugins.h",
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + rn_extra_build_flags() + [
"-DRN_DISABLE_OSS_PLUGIN_HEADER",
],
visibility = ["PUBLIC"],
deps = [
":RCTNetworkApple",
"//xplat/js/react-native-github:FBReactNativeSpecApple",
"//xplat/js/react-native-github:RCTLinkingApple",
"//xplat/js/react-native-github:RCTPushNotificationApple",
"//xplat/js/react-native-github:ReactInternalApple",
],
)
RCTNETWORK_PUBLIC_HEADERS = [
"packages/react-native/Libraries/Network/RCTNetworkTask.h",
"packages/react-native/Libraries/Network/RCTNetworking.h",
]
rn_apple_library(
name = "RCTNetworkApple",
srcs = glob([
"packages/react-native/Libraries/Network/*.m",
"packages/react-native/Libraries/Network/*.mm",
]),
headers = glob(
[
"packages/react-native/Libraries/Network/*.h",
],
exclude = RCTNETWORK_PUBLIC_HEADERS,
),
exported_headers = RCTNETWORK_PUBLIC_HEADERS,
autoglob = False,
enable_exceptions = True,
frameworks = [
"CoreTelephony",
"Foundation",
"MobileCoreServices",
],
header_path_prefix = "React",
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
"extension_api_allow_unsafe_unavailable_usages",
"fbios_link_group:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"talkios_link_group:xplat/default/public.react_native.infra",
],
plugins =
react_module_plugin_providers(
name = "Networking",
native_class_func = "RCTNetworkingCls",
) + react_module_plugin_providers(
name = "DataRequestHandler",
native_class_func = "RCTDataRequestHandlerCls",
) + react_module_plugin_providers(
name = "FileRequestHandler",
native_class_func = "RCTFileRequestHandlerCls",
) + react_module_plugin_providers(
name = "HTTPRequestHandler",
native_class_func = "RCTHTTPRequestHandlerCls",
) + [
plugin(
RCT_URL_REQUEST_HANDLER_SOCKET,
name = "DataRequestHandler",
),
plugin(
RCT_URL_REQUEST_HANDLER_SOCKET,
name = "FileRequestHandler",
),
plugin(
RCT_URL_REQUEST_HANDLER_SOCKET,
name = "HTTPRequestHandler",
),
],
plugins_header = "FBRCTNetworkPlugins.h",
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + rn_extra_build_flags() + [
"-DRN_DISABLE_OSS_PLUGIN_HEADER",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:FBReactNativeSpecApple",
"//xplat/js/react-native-github:RCTLinkingApple",
"//xplat/js/react-native-github:RCTPushNotificationApple",
"//xplat/js/react-native-github:ReactInternalApple",
],
)
rn_apple_library(
name = "RCTSettingsApple",
srcs = glob([
"packages/react-native/Libraries/Settings/*.m",
"packages/react-native/Libraries/Settings/*.mm",
]),
exported_headers = glob(
[
"packages/react-native/Libraries/Settings/*.h",
],
),
autoglob = False,
extension_api_only = True,
frameworks = [
"Foundation",
],
header_path_prefix = "React",
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"disable_plugins_only_validation",
],
plugins = react_module_plugin_providers(
name = "SettingsManager",
native_class_func = "RCTSettingsManagerCls",
),
plugins_header = "FBRCTSettingsPlugins.h",
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + rn_extra_build_flags() + [
"-DRN_DISABLE_OSS_PLUGIN_HEADER",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:FBReactNativeSpecApple",
"//xplat/js/react-native-github:RCTLinkingApple",
"//xplat/js/react-native-github:RCTPushNotificationApple",
"//xplat/js/react-native-github:ReactInternalApple",
],
)
rn_apple_xplat_cxx_library(
name = "RCTText",
srcs = glob([
"packages/react-native/Libraries/Text/**/*.m",
"packages/react-native/Libraries/Text/**/*.mm",
]),
headers = glob(
[
"packages/react-native/Libraries/Text/**/*.h",
],
),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"packages/react-native/Libraries/Text",
"*.h",
),
(
"packages/react-native/Libraries/Text/BaseText",
"*.h",
),
(
"packages/react-native/Libraries/Text/RawText",
"*.h",
),
(
"packages/react-native/Libraries/Text/Text",
"*.h",
),
(
"packages/react-native/Libraries/Text/TextInput",
"*.h",
),
(
"packages/react-native/Libraries/Text/TextInput/Multiline",
"*.h",
),
(
"packages/react-native/Libraries/Text/TextInput/Singleline",
"*.h",
),
(
"packages/react-native/Libraries/Text/VirtualText",
"*.h",
),
],
prefix = "React",
),
frameworks = [
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
],
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:RCTLinking",
"//xplat/js/react-native-github:RCTPushNotification",
"//xplat/js/react-native-github:ReactInternal",
YOGA_CXX_TARGET,
],
)
rn_apple_library(
name = "RCTVibrationApple",
srcs = glob([
"packages/react-native/Libraries/Vibration/**/*.m",
"packages/react-native/Libraries/Vibration/**/*.mm",
]),
exported_headers = glob(
[
"packages/react-native/Libraries/Vibration/*.h",
],
),
autoglob = False,
frameworks = [
"AudioToolbox",
"Foundation",
],
header_path_prefix = "React",
labels = [
"depslint_never_remove",
"disable_plugins_only_validation",
"fbios_link_group:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
plugins = react_module_plugin_providers(
name = "Vibration",
native_class_func = "RCTVibrationCls",
),
plugins_header = "FBRCTVibrationPlugins.h",
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + rn_extra_build_flags() + [
"-DRN_DISABLE_OSS_PLUGIN_HEADER",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:FBReactNativeSpecApple",
"//xplat/js/react-native-github:RCTLinkingApple",
"//xplat/js/react-native-github:RCTPushNotificationApple",
"//xplat/js/react-native-github:ReactInternalApple",
],
)
rn_apple_xplat_cxx_library(
name = "RCTWrapper",
srcs = glob([
"packages/react-native/Libraries/Wrapper/*.m",
"packages/react-native/Libraries/Wrapper/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"packages/react-native/Libraries/Wrapper",
"*.h",
),
],
prefix = "RCTWrapper",
),
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
],
labels = [
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
"//xplat/js/react-native-github:RCTLinking",
"//xplat/js/react-native-github:RCTPushNotification",
"//xplat/js/react-native-github:ReactInternal",
],
)
rn_apple_xplat_cxx_library(
name = "RCTWrapperExample",
srcs = glob([
"packages/react-native/Libraries/Wrapper/Example/*.m",
"packages/react-native/Libraries/Wrapper/Example/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"packages/react-native/Libraries/Wrapper/Example",
"*.h",
),
],
prefix = "RCTWrapperExample",
),
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
],
labels = [
"depslint_never_remove",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
":RCTWrapper",
"//xplat/js/react-native-github:RCTLinking",
"//xplat/js/react-native-github:RCTPushNotification",
"//xplat/js/react-native-github:ReactInternal",
],
)
rn_apple_xplat_cxx_library(
name = "RCTSurfaceHostingComponent",
srcs = glob([
"packages/react-native/Libraries/SurfaceHostingComponent/**/*.m",
"packages/react-native/Libraries/SurfaceHostingComponent/**/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"packages/react-native/Libraries/SurfaceHostingComponent",
"*.h",
),
],
prefix = "RCTSurfaceHostingComponent",
),
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
],
labels = [
"depslint_never_remove",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
"//fbobjc/Libraries/MobileUI/ComponentKit:ComponentKit",
"//xplat/js/react-native-github:RCTFabric",
"//xplat/js/react-native-github:RCTLinking",
"//xplat/js/react-native-github:RCTPushNotification",
"//xplat/js/react-native-github:ReactInternal",
],
)
rn_apple_xplat_cxx_library(
name = "RCTSurfaceBackedComponent",
srcs = glob([
"packages/react-native/Libraries/SurfaceBackedComponent/**/*.m",
"packages/react-native/Libraries/SurfaceBackedComponent/**/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"packages/react-native/Libraries/SurfaceBackedComponent",
"*.h",
),
],
prefix = "RCTSurfaceBackedComponent",
),
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
],
labels = [
"depslint_never_remove",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
":RCTSurfaceHostingComponent",
"//fbobjc/Libraries/MobileUI/ComponentKit:ComponentKit",
"//xplat/js/react-native-github:RCTFabric",
"//xplat/js/react-native-github:RCTLinking",
"//xplat/js/react-native-github:RCTPushNotification",
"//xplat/js/react-native-github:ReactInternal",
],
)
rn_apple_xplat_cxx_library(
name = "RCTMapView_RNHeader",
header_namespace = "",
exported_headers = {
"React/RCTConvert+CoreLocation.h": RCTVIEWS_PATH + "RCTConvert+CoreLocation.h",
},
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
visibility = [
"//fbobjc/Libraries/FBReactKit:RCTMapView",
"//fbobjc/VendorLib/react-native-maps:react-native-maps",
],
)
rn_xplat_cxx_library(
name = "RCTWebPerformance",
srcs = glob(
[
"packages/react-native/Libraries/WebPerformance/**/*.cpp",
],
exclude = ["packages/react-native/Libraries/WebPerformance/__tests__/*"],
),
header_namespace = "",
exported_headers = subdir_glob(
[("packages/react-native/Libraries/WebPerformance", "*.h")],
prefix = "RCTWebPerformance",
),
compiler_flags_enable_exceptions = True,
compiler_flags_enable_rtti = True,
labels = [
"depslint_never_remove",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
platforms = (ANDROID, APPLE),
plugins = [
react_cxx_module_plugin_provider(
name = "NativePerformanceCxx",
function = "NativePerformanceModuleProvider",
),
react_cxx_module_plugin_provider(
name = "NativePerformanceObserverCxx",
function = "NativePerformanceObserverModuleProvider",
),
],
visibility = ["PUBLIC"],
deps = [
":FBReactNativeSpecJSI",
react_native_xplat_target("react/renderer/core:core"),
react_native_xplat_target("cxxreact:bridge"),
],
)
fb_xplat_cxx_test(
name = "RCTWebPerformance_tests",
srcs = glob([
"Libraries/WebPerformance/__tests__/*.cpp",
]),
headers = glob(["Libraries/WebPerformance/__tests__/*.h"]),
header_namespace = "",
compiler_flags = [
"-fexceptions",
"-frtti",
"-std=c++17",
"-Wall",
],
platforms = (ANDROID, APPLE),
deps = [
":RCTWebPerformance",
"//xplat/third-party/gmock:gmock",
"//xplat/third-party/gmock:gtest",
],
)