react-native-macos/BUCK

1473 строки
56 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",
"HERMES_BYTECODE_VERSION",
"IOS",
"RCT_IMAGE_DATA_DECODER_SOCKET",
"RCT_IMAGE_URL_LOADER_SOCKET",
"RCT_URL_REQUEST_HANDLER_SOCKET",
"YOGA_CXX_TARGET",
"get_react_native_ios_target_sdk_version",
"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_extra_build_flags",
"rn_xplat_cxx_library2",
"subdir_glob",
)
load("//tools/build_defs/third_party:yarn_defs.bzl", "yarn_workspace")
RCTCXXBRIDGE_PUBLIC_HEADERS = {
"React/" + x: "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(
[
"Libraries/**/*NativeComponent.js",
"jest/**/*NativeComponent.js",
"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_xplat_cxx_library2(
name = "RCTCxxBridge",
srcs = glob([
"React/CxxBridge/*.mm",
]),
headers = subdir_glob(
[
(
"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",
"supermodule:xplat/default/public.react_native.infra",
],
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("React/CoreModules:CoreModules"),
react_native_xplat_target("cxxreact:bridge"),
react_native_xplat_target("cxxreact:jsbigstring"),
react_native_xplat_target("jsi:JSCRuntime"),
react_native_xplat_target("jsiexecutor:jsiexecutor"),
react_native_xplat_target("reactperflogger:reactperflogger"),
],
)
RCTCXXMODULE_PUBLIC_HEADERS = {
"React/" + x: "React/CxxModule/" + x
for x in [
"RCTCxxMethod.h",
"RCTCxxModule.h",
"RCTCxxUtils.h",
]
}
rn_xplat_cxx_library2(
name = "RCTCxxModule",
srcs = glob([
"React/CxxModule/*.mm",
]),
headers = subdir_glob(
[
(
"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",
"supermodule:xplat/default/public.react_native.infra",
],
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_xplat_cxx_library2(
name = "RCTCxxUtils",
srcs = glob([
"React/CxxUtils/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"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",
"supermodule:xplat/default/public.react_native.infra",
],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode(),
visibility = ["PUBLIC"],
deps = [
"//xplat/folly:dynamic",
],
)
rn_xplat_cxx_library2(
name = "RCTCxxLogUtils",
srcs = glob([
"React/CxxLogUtils/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"React/CxxLogUtils",
"*.h",
),
],
prefix = "React",
),
contacts = ["oncall+react_native@xmail.facebook.com"],
fbobjc_enable_exceptions = True,
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"supermodule:xplat/default/public.react_native.infra",
],
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 = "Libraries/"
RCTBASE_PATH = "React/Base/"
RCTDEVSUPPORT_PATH = "React/DevSupport/"
RCTMODULES_PATH = "React/Modules/"
RCTVIEWS_PATH = "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",
"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": "React/Inspector/RCTInspector.h",
"React/RCTInspectorDevServerHelper.h": RCTDEVSUPPORT_PATH + "RCTInspectorDevServerHelper.h",
"React/RCTInspectorPackagerConnection.h": "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": "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/RCTSRWebSocket.h": RCTLIB_PATH + "WebSocket/RCTSRWebSocket.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": "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/RCTWeakProxy.h": RCTBASE_PATH + "RCTWeakProxy.h",
"React/RCTWrapperViewController.h": RCTVIEWS_PATH + "RCTWrapperViewController.h",
"React/UIView+React.h": RCTVIEWS_PATH + "UIView+React.h",
}
REACT_COMPONENTVIEWS_BASE_FILES = [
"React/Fabric/Mounting/ComponentViews/Image/*.mm",
"React/Fabric/RCTImageResponseObserverProxy.mm",
"React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm",
]
rn_xplat_cxx_library2(
name = "ReactInternal",
srcs = glob(
[
"React/Base/**/*.m",
"React/Base/**/*.mm",
"React/DevSupport/**/*.m",
"React/DevSupport/**/*.mm",
"React/Inspector/**/*.m",
"React/Inspector/**/*.mm",
"React/Modules/**/*.m",
"React/Modules/**/*.mm",
"React/Profiler/**/*.m",
"React/Profiler/**/*.mm",
"React/Profiler/**/*.S",
"React/UIUtils/*.m",
"React/Views/**/*.m",
"React/Views/**/*.mm",
"Libraries/ActionSheetIOS/*.m",
"Libraries/WebSocket/*.m",
],
),
headers = glob(
[
"React/Base/**/*.h",
"React/DevSupport/**/*.h",
"React/Inspector/**/*.h",
"React/Modules/**/*.h",
"React/Profiler/**/*.h",
"React/Views/**/*.h",
"React/UIUtils/**/*.h",
"Libraries/ActionSheetIOS/*.h",
"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_linker_flags = [
"-weak_framework",
"UserNotifications",
"-weak_framework",
"WebKit",
],
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",
],
labels = [
"depslint_never_add",
"depslint_never_remove", # Some old NativeModule still relies on +load unfortunately.
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"supermodule:xplat/default/public.react_native.infra",
],
platform_preprocessor_flags = [(
"linux",
["-D PIC_MODIFIER=@PLT"],
)],
preprocessor_flags = get_objc_arc_preprocessor_flags() + get_preprocessor_flags_for_build_mode() + [
"-DHERMES_BYTECODE_VERSION={}".format(HERMES_BYTECODE_VERSION),
] + 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/React/...",
"//xplat/js/react-native-github/ReactCommon/react/nativemodule/core:",
"//xplat/js/react-native-github/ReactCommon/react/nativemodule/samples:",
"//xplat/js/react-native-github/packages/rn-tester:",
"//xplat/rtc/manul/...",
],
deps = [
YOGA_CXX_TARGET,
react_native_xplat_target("cxxreact:bridge"),
react_native_xplat_target("reactperflogger:reactperflogger"),
],
)
rn_xplat_cxx_library2(
name = "RCTFabric",
srcs = glob(
[
"React/Fabric/**/*.cpp",
"React/Fabric/**/*.m",
"React/Fabric/**/*.mm",
],
exclude = glob(REACT_COMPONENTVIEWS_BASE_FILES),
),
headers = glob(
[
"React/Fabric/**/*.h",
],
),
header_namespace = "",
exported_headers = {
"React/RCTComponentViewDescriptor.h": "React/Fabric/Mounting/RCTComponentViewDescriptor.h",
"React/RCTComponentViewFactory.h": "React/Fabric/Mounting/RCTComponentViewFactory.h",
"React/RCTComponentViewRegistry.h": "React/Fabric/Mounting/RCTComponentViewRegistry.h",
"React/RCTFabricSurface.h": "React/Fabric/Surface/RCTFabricSurface.h",
"React/RCTFabricSurfaceHostingProxyRootView.h": "React/Fabric/Surface/RCTFabricSurfaceHostingProxyRootView.h",
"React/RCTGenericDelegateSplitter.h": "React/Fabric/Utils/RCTGenericDelegateSplitter.h",
"React/RCTLegacyViewManagerInteropComponentView.h": "React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h",
"React/RCTLocalizationProvider.h": "React/Fabric/RCTLocalizationProvider.h",
"React/RCTModalHostViewComponentView.h": "React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h",
"React/RCTMountingManager.h": "React/Fabric/Mounting/RCTMountingManager.h",
"React/RCTMountingManagerDelegate.h": "React/Fabric/Mounting/RCTMountingManagerDelegate.h",
"React/RCTMountingTransactionObserving.h": "React/Fabric/Mounting/RCTMountingTransactionObserving.h",
"React/RCTParagraphComponentAccessibilityProvider.h": "React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h",
"React/RCTParagraphComponentView.h": "React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h",
"React/RCTPrimitives.h": "React/Fabric/RCTPrimitives.h",
"React/RCTRootComponentView.h": "React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h",
"React/RCTScheduler.h": "React/Fabric/RCTScheduler.h",
"React/RCTScrollViewComponentView.h": "React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h",
"React/RCTSurfacePresenter.h": "React/Fabric/RCTSurfacePresenter.h",
"React/RCTSurfacePresenterBridgeAdapter.h": "React/Fabric/RCTSurfacePresenterBridgeAdapter.h",
"React/RCTSurfaceRegistry.h": "React/Fabric/RCTSurfaceRegistry.h",
"React/RCTSurfaceTouchHandler.h": "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",
"supermodule:xplat/default/public.react_native.infra",
],
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("Slider", "RCTSliderCls"),
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/slider:slider"),
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([
"Libraries/TypeSafety/**/*.mm",
]),
exported_headers = glob(
[
"Libraries/TypeSafety/**/*.h",
],
),
autoglob = False,
complete_nullability = True,
contacts = ["oncall+react_native@xmail.facebook.com"],
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",
"supermodule: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/Libraries/FBLazyVector:FBLazyVector",
],
)
yarn_workspace(
name = "yarn-workspace",
srcs = [
"package.json",
],
visibility = ["PUBLIC"],
)
fb_apple_test(
name = "TextTestsApple",
srcs = ["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/ReactCommon/react/renderer/attributedstring:attributedstringApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/componentregistry:componentregistryApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/components/legacyviewmanagerinterop:legacyviewmanagerinteropApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/components/text:textApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/components/textinput/iostextinput:iostextinputApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/scheduler:schedulerApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/textlayoutmanager:textlayoutmanagerApple",
"//xplat/js/react-native-github/ReactCommon/runtimeexecutor:runtimeexecutorApple",
],
)
fb_apple_test(
name = "MountingTestsApple",
srcs = ["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/ReactCommon/react/renderer/attributedstring:attributedstringApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/componentregistry:componentregistryApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/components/legacyviewmanagerinterop:legacyviewmanagerinteropApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/components/textinput/iostextinput:iostextinputApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/scheduler:schedulerApple",
"//xplat/js/react-native-github/ReactCommon/react/renderer/textlayoutmanager:textlayoutmanagerApple",
"//xplat/js/react-native-github/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",
"supermodule:xplat/default/public.react_native.infra",
],
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_xplat_cxx_library2(
name = "RCTFabricComponentViewsBase",
srcs = glob(REACT_COMPONENTVIEWS_BASE_FILES),
header_namespace = "",
exported_headers = {
"React/RCTComponentViewProtocol.h": "React/Fabric/Mounting/RCTComponentViewProtocol.h",
"React/RCTConversions.h": "React/Fabric/RCTConversions.h",
"React/RCTImageComponentView.h": "React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h",
"React/RCTImageResponseDelegate.h": "React/Fabric/RCTImageResponseDelegate.h",
"React/RCTImageResponseObserverProxy.h": "React/Fabric/RCTImageResponseObserverProxy.h",
"React/RCTTouchableComponentViewProtocol.h": "React/Fabric/RCTTouchableComponentViewProtocol.h",
"React/RCTViewComponentView.h": "React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h",
"React/UIView+ComponentViewProtocol.h": "React/Fabric/Mounting/UIView+ComponentViewProtocol.h",
},
compiler_flags = ["-Wall"],
contacts = ["oncall+react_native@xmail.facebook.com"],
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"supermodule:xplat/default/public.react_native.infra",
],
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 = [
"package.json",
"index.js",
] + glob(
[
"Libraries/**/*.js",
"Libraries/NewAppScreen/**/*.png",
"Libraries/LogBox/**/*.png",
],
exclude = [
"**/__*__/**",
"**/gulpfile.js",
"Libraries/Components/Switch/SwitchSchema.js",
"**/*._reactvr.js",
],
),
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"supermodule:xplat/default/public.react_native.core",
],
visibility = ["PUBLIC"],
deps = [
"//xplat/js:node_modules__abort_19controller",
"//xplat/js:node_modules__anser",
"//xplat/js:node_modules__base64_19js",
"//xplat/js:node_modules__event_19target_19shim",
"//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__use_19sync_19external_19store",
"//xplat/js:node_modules__whatwg_19fetch",
"//xplat/js/RKJSModules/Libraries/Polyfills:Polyfills",
"//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 = [
"supermodule:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
native_module_spec_name = "FBReactNativeSpec",
src_prefix = "Libraries/",
)
# TODO: Merge this into FBReactNativeSpec
rn_codegen(
name = "FBReactNativeComponentSpec",
codegen_components = True,
ios_assume_nonnull = False,
library_labels = [
"supermodule:xplat/default/public.react_native.infra",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
],
src_prefix = "Libraries/",
)
rn_apple_library(
name = "RCTAnimationApple",
srcs = glob([
"Libraries/NativeAnimation/**/*.m",
"Libraries/NativeAnimation/**/*.mm",
]),
headers = glob(
[
"Libraries/NativeAnimation/**/*.h",
],
),
header_namespace = "",
exported_headers = glob(
[
"Libraries/NativeAnimation/*.h",
"Libraries/NativeAnimation/Drivers/*.h",
"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",
"supermodule: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([
"Libraries/Blob/*.m",
"Libraries/Blob/*.mm",
]),
headers = glob(
[
"Libraries/Blob/*.h",
],
),
exported_headers = glob(
[
"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",
"supermodule:xplat/default/public.react_native.infra",
],
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/React/CoreModules:CoreModulesApple",
"//xplat/jsi:jsiApple",
],
)
rn_apple_library(
name = "RCTLinkingApple",
srcs = glob([
"Libraries/LinkingIOS/*.m",
"Libraries/LinkingIOS/*.mm",
]),
headers = glob(
[
"Libraries/LinkingIOS/*.h",
],
),
exported_headers = glob(
[
"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",
"supermodule: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([
"Libraries/PushNotificationIOS/*.m",
"Libraries/PushNotificationIOS/*.mm",
]),
headers = glob(
[
"Libraries/PushNotificationIOS/*.h",
],
),
exported_headers = glob(
[
"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",
"supermodule: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([
"Libraries/Image/*.m",
"Libraries/Image/*.mm",
]),
headers = glob(
[
"Libraries/Image/*.h",
],
),
exported_headers = glob(
[
"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",
"supermodule: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 = [
"Libraries/Network/RCTNetworkTask.h",
"Libraries/Network/RCTNetworking.h",
]
rn_apple_library(
name = "RCTNetworkApple",
srcs = glob([
"Libraries/Network/*.m",
"Libraries/Network/*.mm",
]),
headers = glob(
[
"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",
"supermodule: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([
"Libraries/Settings/*.m",
"Libraries/Settings/*.mm",
]),
exported_headers = glob(
[
"Libraries/Settings/*.h",
],
),
autoglob = False,
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_xplat_cxx_library2(
name = "RCTText",
srcs = glob([
"Libraries/Text/**/*.m",
"Libraries/Text/**/*.mm",
]),
headers = glob(
[
"Libraries/Text/**/*.h",
],
),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"Libraries/Text",
"*.h",
),
(
"Libraries/Text/BaseText",
"*.h",
),
(
"Libraries/Text/RawText",
"*.h",
),
(
"Libraries/Text/Text",
"*.h",
),
(
"Libraries/Text/TextInput",
"*.h",
),
(
"Libraries/Text/TextInput/Multiline",
"*.h",
),
(
"Libraries/Text/TextInput/Singleline",
"*.h",
),
(
"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",
"supermodule:xplat/default/public.react_native.infra",
],
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([
"Libraries/Vibration/**/*.m",
"Libraries/Vibration/**/*.mm",
]),
exported_headers = glob(
[
"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",
"supermodule:xplat/default/public.react_native.infra",
],
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_xplat_cxx_library2(
name = "RCTWrapper",
srcs = glob([
"Libraries/Wrapper/*.m",
"Libraries/Wrapper/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"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",
"supermodule:xplat/default/public.react_native.infra",
],
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_xplat_cxx_library2(
name = "RCTWrapperExample",
srcs = glob([
"Libraries/Wrapper/Example/*.m",
"Libraries/Wrapper/Example/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"Libraries/Wrapper/Example",
"*.h",
),
],
prefix = "RCTWrapperExample",
),
frameworks = [
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
],
labels = [
"depslint_never_remove",
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"supermodule:xplat/default/public.react_native.infra",
],
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_xplat_cxx_library2(
name = "RCTSurfaceHostingComponent",
srcs = glob([
"Libraries/SurfaceHostingComponent/**/*.m",
"Libraries/SurfaceHostingComponent/**/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"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",
"supermodule:xplat/default/public.react_native.infra",
],
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_xplat_cxx_library2(
name = "RCTSurfaceBackedComponent",
srcs = glob([
"Libraries/SurfaceBackedComponent/**/*.m",
"Libraries/SurfaceBackedComponent/**/*.mm",
]),
header_namespace = "",
exported_headers = subdir_glob(
[
(
"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",
"supermodule:xplat/default/public.react_native.infra",
],
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_xplat_cxx_library2(
name = "RCTMapView_RNHeader",
header_namespace = "",
exported_headers = {
"React/RCTConvert+CoreLocation.h": RCTVIEWS_PATH + "RCTConvert+CoreLocation.h",
},
labels = [
"pfh:ReactNative_CommonInfrastructurePlaceholder",
"supermodule:xplat/default/public.react_native.infra",
],
visibility = [
"//fbobjc/Libraries/FBReactKit:RCTMapView",
"//fbobjc/VendorLib/react-native-maps:react-native-maps",
],
)