diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 0ced5888f91..60d0362722f 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -260,13 +260,11 @@ turboModuleEnabled:self.turboModuleEnabled bridgelessEnabled:self.bridgelessEnabled]; - configuration.createRootViewWithBridge = ^UIView *(RCTBridge *bridge, NSString *moduleName, NSDictionary *initProps) - { + configuration.createRootViewWithBridge = ^UIView *(RCTBridge *bridge, NSString *moduleName, NSDictionary *initProps) { return [weakSelf createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps]; }; - configuration.createBridgeWithDelegate = ^RCTBridge *(id delegate, NSDictionary *launchOptions) - { + configuration.createBridgeWithDelegate = ^RCTBridge *(id delegate, NSDictionary *launchOptions) { return [weakSelf createBridgeWithDelegate:delegate launchOptions:launchOptions]; }; diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm index 9cc4e2c63a5..d33fd071d89 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm @@ -62,32 +62,31 @@ id RCTAppSetupDefaultModuleFromClass(Class moduleClass) { // private block used to filter out modules depending on protocol conformance NSArray * (^extractModuleConformingToProtocol)(RCTModuleRegistry *, Protocol *) = - ^NSArray *(RCTModuleRegistry *moduleRegistry, Protocol *protocol) - { - NSArray *classNames = @[]; + ^NSArray *(RCTModuleRegistry *moduleRegistry, Protocol *protocol) { + NSArray *classNames = @[]; #if USE_OSS_CODEGEN - if (protocol == @protocol(RCTImageURLLoader)) { - classNames = [RCTModulesConformingToProtocolsProvider imageURLLoaderClassNames]; - } else if (protocol == @protocol(RCTImageDataDecoder)) { - classNames = [RCTModulesConformingToProtocolsProvider imageDataDecoderClassNames]; - } else if (protocol == @protocol(RCTURLRequestHandler)) { - classNames = [RCTModulesConformingToProtocolsProvider URLRequestHandlerClassNames]; - } + if (protocol == @protocol(RCTImageURLLoader)) { + classNames = [RCTModulesConformingToProtocolsProvider imageURLLoaderClassNames]; + } else if (protocol == @protocol(RCTImageDataDecoder)) { + classNames = [RCTModulesConformingToProtocolsProvider imageDataDecoderClassNames]; + } else if (protocol == @protocol(RCTURLRequestHandler)) { + classNames = [RCTModulesConformingToProtocolsProvider URLRequestHandlerClassNames]; + } #endif - NSMutableArray *modules = [NSMutableArray new]; + NSMutableArray *modules = [NSMutableArray new]; - for (NSString *className in classNames) { - const char *cModuleName = [className cStringUsingEncoding:NSUTF8StringEncoding]; - id moduleFromLibrary = [moduleRegistry moduleForName:cModuleName]; - if (![moduleFromLibrary conformsToProtocol:protocol]) { - continue; - } - [modules addObject:moduleFromLibrary]; - } - return modules; - }; + for (NSString *className in classNames) { + const char *cModuleName = [className cStringUsingEncoding:NSUTF8StringEncoding]; + id moduleFromLibrary = [moduleRegistry moduleForName:cModuleName]; + if (![moduleFromLibrary conformsToProtocol:protocol]) { + continue; + } + [modules addObject:moduleFromLibrary]; + } + return modules; + }; // Set up the default RCTImageLoader and RCTNetworking modules. if (moduleClass == RCTImageLoader.class) { diff --git a/packages/react-native/React/Base/RCTBridgeModule.h b/packages/react-native/React/Base/RCTBridgeModule.h index 9446059be48..a77f7abd229 100644 --- a/packages/react-native/React/Base/RCTBridgeModule.h +++ b/packages/react-native/React/Base/RCTBridgeModule.h @@ -283,12 +283,10 @@ RCT_EXTERN_C_END /** * Like RCT_EXTERN_MODULE, but allows setting a custom JavaScript name. */ -#define RCT_EXTERN_REMAP_MODULE(js_name, objc_name, objc_supername) \ - objc_name: \ - objc_supername @ \ - end @interface objc_name(RCTExternModule) \ - @end \ - @implementation objc_name (RCTExternModule) \ +#define RCT_EXTERN_REMAP_MODULE(js_name, objc_name, objc_supername) \ + objc_name : objc_supername @end @interface objc_name(RCTExternModule) \ + @end \ + @implementation objc_name (RCTExternModule) \ RCT_EXPORT_MODULE_NO_LOAD(js_name, objc_name) /** diff --git a/packages/react-native/React/Base/RCTModuleData.mm b/packages/react-native/React/Base/RCTModuleData.mm index 1be7a2af25e..8f03a0c9058 100644 --- a/packages/react-native/React/Base/RCTModuleData.mm +++ b/packages/react-native/React/Base/RCTModuleData.mm @@ -31,7 +31,7 @@ int32_t getUniqueId() static std::atomic counter{0}; return counter++; } -} +} // namespace @implementation RCTModuleData { NSDictionary *_constantsToExport; diff --git a/packages/react-native/React/Base/RCTModuleRegistry.m b/packages/react-native/React/Base/RCTModuleRegistry.m index 1ebc5a14c77..21fbfd66277 100644 --- a/packages/react-native/React/Base/RCTModuleRegistry.m +++ b/packages/react-native/React/Base/RCTModuleRegistry.m @@ -36,7 +36,7 @@ RCTBridge *bridge = _bridge; if (bridge) { - module = [bridge moduleForName:[NSString stringWithUTF8String:moduleName] lazilyLoadIfNecessary:lazilyLoad]; + module = [bridge moduleForName: [NSString stringWithUTF8String:moduleName] lazilyLoadIfNecessary:lazilyLoad]; } id turboModuleRegistry = _turboModuleRegistry; diff --git a/packages/react-native/React/Base/RCTRootView.h b/packages/react-native/React/Base/RCTRootView.h index 2903273639d..81195a05993 100644 --- a/packages/react-native/React/Base/RCTRootView.h +++ b/packages/react-native/React/Base/RCTRootView.h @@ -40,7 +40,7 @@ extern NS_ASSUME_NONNULL_BEGIN - NSString *const RCTContentDidAppearNotification; + NSString *const RCTContentDidAppearNotification; /** * Native view used to host React-managed views within the app. Can be used just diff --git a/packages/react-native/React/Base/RCTUtils.h b/packages/react-native/React/Base/RCTUtils.h index e03e412fa2a..5d145e3928f 100644 --- a/packages/react-native/React/Base/RCTUtils.h +++ b/packages/react-native/React/Base/RCTUtils.h @@ -71,13 +71,13 @@ RCT_EXTERN BOOL RCTClassOverridesClassMethod(Class cls, SEL selector); RCT_EXTERN BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector); // Creates a standardized error object to return in callbacks -RCT_EXTERN NSDictionary - *RCTMakeError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); +RCT_EXTERN NSDictionary * +RCTMakeError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); RCT_EXTERN NSDictionary * RCTMakeAndLogError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); RCT_EXTERN NSDictionary *RCTJSErrorFromNSError(NSError *error); -RCT_EXTERN NSDictionary - *RCTJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error); +RCT_EXTERN NSDictionary * +RCTJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error); // The default error code to use as the `code` property for callback error objects RCT_EXTERN NSString *const RCTErrorUnspecified; diff --git a/packages/react-native/React/Base/RCTUtils.m b/packages/react-native/React/Base/RCTUtils.m index 716b5439ad0..291d0e89cc8 100644 --- a/packages/react-native/React/Base/RCTUtils.m +++ b/packages/react-native/React/Base/RCTUtils.m @@ -468,8 +468,8 @@ BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector) return NO; } -NSDictionary - *RCTMakeError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData) +NSDictionary * +RCTMakeError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData) { if (toStringify) { message = [message stringByAppendingString:[toStringify description]]; @@ -496,8 +496,8 @@ NSDictionary *RCTJSErrorFromNSError(NSError *error) } // TODO: Can we just replace RCTMakeError with this function instead? -NSDictionary - *RCTJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error) +NSDictionary * +RCTJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error) { NSString *errorMessage; NSArray *stackTrace = [NSThread callStackSymbols]; diff --git a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm index 39377fe8b6f..b14e74ea77e 100644 --- a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +++ b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm @@ -112,8 +112,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) - (void)setLoadingView:(UIView *)loadingView { - super.activityIndicatorViewFactory = ^UIView *(void) - { + super.activityIndicatorViewFactory = ^UIView *(void) { return loadingView; }; } diff --git a/packages/react-native/React/CoreModules/RCTAccessibilityManager+Internal.h b/packages/react-native/React/CoreModules/RCTAccessibilityManager+Internal.h index e1b8a597f6d..6e180007fdc 100644 --- a/packages/react-native/React/CoreModules/RCTAccessibilityManager+Internal.h +++ b/packages/react-native/React/CoreModules/RCTAccessibilityManager+Internal.h @@ -16,7 +16,7 @@ RCT_EXTERN_C_BEGIN // Only to be used for testing and internal tooling. Do not use this in // production. void RCTAccessibilityManagerSetIsVoiceOverEnabled( - RCTAccessibilityManager* accessibilityManager, + RCTAccessibilityManager *accessibilityManager, BOOL isVoiceOverEnabled); RCT_EXTERN_C_END diff --git a/packages/react-native/React/CoreModules/RCTPlatform.mm b/packages/react-native/React/CoreModules/RCTPlatform.mm index a908677a3c6..f357100b71e 100644 --- a/packages/react-native/React/CoreModules/RCTPlatform.mm +++ b/packages/react-native/React/CoreModules/RCTPlatform.mm @@ -69,18 +69,20 @@ RCT_EXPORT_MODULE(PlatformConstants) UIDevice *device = [UIDevice currentDevice]; auto versions = RCTGetReactNativeVersion(); constants = typedConstants({ - .forceTouchAvailable = RCTForceTouchAvailable() ? true : false, .osVersion = [device systemVersion], - .systemName = [device systemName], .interfaceIdiom = interfaceIdiom([device userInterfaceIdiom]), - .isTesting = RCTRunningInTestEnvironment() ? true : false, - .reactNativeVersion = JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder( - {.minor = [versions[@"minor"] doubleValue], - .major = [versions[@"major"] doubleValue], - .patch = [versions[@"patch"] doubleValue], - .prerelease = [versions[@"prerelease"] isKindOfClass:[NSNull class]] - ? std::optional{} - : [versions[@"prerelease"] doubleValue]}), + .forceTouchAvailable = RCTForceTouchAvailable() ? true : false, + .osVersion = [device systemVersion], + .systemName = [device systemName], + .interfaceIdiom = interfaceIdiom([device userInterfaceIdiom]), + .isTesting = RCTRunningInTestEnvironment() ? true : false, + .reactNativeVersion = JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder( + {.minor = [versions[@"minor"] doubleValue], + .major = [versions[@"major"] doubleValue], + .patch = [versions[@"patch"] doubleValue], + .prerelease = [versions[@"prerelease"] isKindOfClass:[NSNull class]] + ? std::optional{} + : [versions[@"prerelease"] doubleValue]}), #if TARGET_OS_MACCATALYST - .isMacCatalyst = true, + .isMacCatalyst = true, #else .isMacCatalyst = false, #endif diff --git a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm index 34fa43f8856..4d33f024081 100644 --- a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm +++ b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm @@ -107,7 +107,7 @@ class GetDescAdapter : public JSExecutorFactory { std::shared_ptr factory_; }; -} +} // namespace static void mapReactMarkerToPerformanceLogger( const ReactMarker::ReactMarkerId markerId, diff --git a/packages/react-native/React/CxxBridge/RCTObjcExecutor.mm b/packages/react-native/React/CxxBridge/RCTObjcExecutor.mm index 0aa453803cf..e018ac17df9 100644 --- a/packages/react-native/React/CxxBridge/RCTObjcExecutor.mm +++ b/packages/react-native/React/CxxBridge/RCTObjcExecutor.mm @@ -129,7 +129,7 @@ class RCTObjcExecutor : public JSExecutor { RCTJavaScriptCallback m_jsCallback; }; -} +} // namespace RCTObjcExecutorFactory::RCTObjcExecutorFactory(id jse, RCTJavaScriptCompleteBlock errorBlock) : m_jse(jse), m_errorBlock(errorBlock) diff --git a/packages/react-native/React/CxxModule/RCTCxxModule.h b/packages/react-native/React/CxxModule/RCTCxxModule.h index 093aafee890..2c70e2952bc 100644 --- a/packages/react-native/React/CxxModule/RCTCxxModule.h +++ b/packages/react-native/React/CxxModule/RCTCxxModule.h @@ -13,7 +13,7 @@ namespace facebook::xplat::module { class CxxModule; -} // namespace facebook::react::module +} // namespace facebook::xplat::module /** * Subclass RCTCxxModule to use cross-platform CxxModule on iOS. diff --git a/packages/react-native/React/Fabric/RCTImageResponseObserverProxy.h b/packages/react-native/React/Fabric/RCTImageResponseObserverProxy.h index a7d4cce45a2..9184adc59c3 100644 --- a/packages/react-native/React/Fabric/RCTImageResponseObserverProxy.h +++ b/packages/react-native/React/Fabric/RCTImageResponseObserverProxy.h @@ -19,7 +19,7 @@ class RCTImageResponseObserverProxy final : public ImageResponseObserver { public: RCTImageResponseObserverProxy(id delegate = nil); - void didReceiveImage(const ImageResponse& imageResponse) const override; + void didReceiveImage(const ImageResponse &imageResponse) const override; void didReceiveProgress(float progress) const override; void didReceiveFailure() const override; diff --git a/packages/react-native/React/Inspector/RCTCxxInspectorWebSocketAdapter.mm b/packages/react-native/React/Inspector/RCTCxxInspectorWebSocketAdapter.mm index ad4d1f6fb98..46cfb11fa1c 100644 --- a/packages/react-native/React/Inspector/RCTCxxInspectorWebSocketAdapter.mm +++ b/packages/react-native/React/Inspector/RCTCxxInspectorWebSocketAdapter.mm @@ -24,7 +24,7 @@ NSString *NSStringFromUTF8StringView(std::string_view view) { return [[NSString alloc] initWithBytes:(const char *)view.data() length:view.size() encoding:NSUTF8StringEncoding]; } -} +} // namespace @interface RCTCxxInspectorWebSocketAdapter () { std::weak_ptr _delegate; SRWebSocket *_webSocket; diff --git a/packages/react-native/React/Tests/Text/RCTParagraphComponentViewTests.mm b/packages/react-native/React/Tests/Text/RCTParagraphComponentViewTests.mm index f23f353e121..0a595eddf82 100644 --- a/packages/react-native/React/Tests/Text/RCTParagraphComponentViewTests.mm +++ b/packages/react-native/React/Tests/Text/RCTParagraphComponentViewTests.mm @@ -35,50 +35,50 @@ using namespace facebook; using namespace facebook::react; -//┌── RootShadowNode ─────────────────────────────┐ -//│ │ -//│┌─── ParagraphShadowNodeA ─────────────────────────┐ │ -//││ ┌─AA(AAA) ─────────┐ ┌─AB(ABA) ─┐ ┌─AC(ACA)────┐ │ │ -//││ │ Please check out │ │ Facebook │ │ and │ │ │ -//││ └──────────────────┘ └──────────┘ └────────────┘ │ │ -//││ ┌─AD(ADA) ──┐ ┌──AE(AEA) ──────────────────────┐ │ │ -//││ │ Instagram │ │ for a full description. │ │ │ -//││ └───────────┘ └────────────────────────────────┘ │ │ -//│└──────────────────────────────────────────────────┘ │ -//│ │ -//│ │ -//│┌── ParagraphShadowNodeB ──────────────────────────┐ │ -//││ ┌───BA(BAA) ───────────────────────────────────┐ │ │ -//││ │ Lorem ipsum dolor sit amet, consectetur │ │ │ -//││ │ adipiscing elit. Maecenas ut risus et sapien │ │ │ -//││ │ bibendum volutpat. Nulla facilisi. Cras │ │ │ -//││ │ imperdiet gravida tincidunt. │ │ │ -//││ └──────────────────────────────────────────────┘ │ │ -//││ ┌─BB(BBA) ─────────────────────────────────────┐ │ │ -//││ │ In tempor, tellus et vestibulum venenatis, │ │ │ -//││ │ lorem nunc eleifend lectus, a consectetur │ │ │ -//││ │ magna augue at arcu. │ │ │ -//││ └──────────────────────────────────────────────┘ │ │ -//│└──────────────────────────────────────────────────┘ │ -//│ │ -//│┌── ParagraphShadowNodeC ──────────────────────────┐ │ -//││ ┌─CA(CAA) ────────┐ │ │ -//││ │ Lorem ipsum │ │ │ -//││ └─────────────────┘ │ │ -//││ ┌─CB(CBA) ─────────────────────────────────────┐ │ │ -//││ │ dolor sit amet, consectetur adipiscing elit. │ │ │ -//││ │Maecenas ut risus et sapien bibendum volutpat.│ │ │ -//││ │ Nulla facilisi. Cras imperdiet gravida │ │ │ -//││ │ tincidunt. In tempor, tellus et vestibulum │ │ │ -//││ │ venenatis, lorem nunc eleifend lectus, a │ │ │ -//││ │ consectetur magna augue at arcu. │ │ │ -//││ └──────────────────────────────────────────────┘ │ │ -//││ ┌─CC(CCA) ────────┐ │ │ -//││ │ See Less │ │ │ -//││ └─────────────────┘ │ │ -//│└──────────────────────────────────────────────────┘ │ -//│ │ -//└─────────────────────────────────────────────────────┘ +// ┌── RootShadowNode ─────────────────────────────┐ +// │ │ +// │┌─── ParagraphShadowNodeA ─────────────────────────┐ │ +// ││ ┌─AA(AAA) ─────────┐ ┌─AB(ABA) ─┐ ┌─AC(ACA)────┐ │ │ +// ││ │ Please check out │ │ Facebook │ │ and │ │ │ +// ││ └──────────────────┘ └──────────┘ └────────────┘ │ │ +// ││ ┌─AD(ADA) ──┐ ┌──AE(AEA) ──────────────────────┐ │ │ +// ││ │ Instagram │ │ for a full description. │ │ │ +// ││ └───────────┘ └────────────────────────────────┘ │ │ +// │└──────────────────────────────────────────────────┘ │ +// │ │ +// │ │ +// │┌── ParagraphShadowNodeB ──────────────────────────┐ │ +// ││ ┌───BA(BAA) ───────────────────────────────────┐ │ │ +// ││ │ Lorem ipsum dolor sit amet, consectetur │ │ │ +// ││ │ adipiscing elit. Maecenas ut risus et sapien │ │ │ +// ││ │ bibendum volutpat. Nulla facilisi. Cras │ │ │ +// ││ │ imperdiet gravida tincidunt. │ │ │ +// ││ └──────────────────────────────────────────────┘ │ │ +// ││ ┌─BB(BBA) ─────────────────────────────────────┐ │ │ +// ││ │ In tempor, tellus et vestibulum venenatis, │ │ │ +// ││ │ lorem nunc eleifend lectus, a consectetur │ │ │ +// ││ │ magna augue at arcu. │ │ │ +// ││ └──────────────────────────────────────────────┘ │ │ +// │└──────────────────────────────────────────────────┘ │ +// │ │ +// │┌── ParagraphShadowNodeC ──────────────────────────┐ │ +// ││ ┌─CA(CAA) ────────┐ │ │ +// ││ │ Lorem ipsum │ │ │ +// ││ └─────────────────┘ │ │ +// ││ ┌─CB(CBA) ─────────────────────────────────────┐ │ │ +// ││ │ dolor sit amet, consectetur adipiscing elit. │ │ │ +// ││ │Maecenas ut risus et sapien bibendum volutpat.│ │ │ +// ││ │ Nulla facilisi. Cras imperdiet gravida │ │ │ +// ││ │ tincidunt. In tempor, tellus et vestibulum │ │ │ +// ││ │ venenatis, lorem nunc eleifend lectus, a │ │ │ +// ││ │ consectetur magna augue at arcu. │ │ │ +// ││ └──────────────────────────────────────────────┘ │ │ +// ││ ┌─CC(CCA) ────────┐ │ │ +// ││ │ See Less │ │ │ +// ││ └─────────────────┘ │ │ +// │└──────────────────────────────────────────────────┘ │ +// │ │ +// └─────────────────────────────────────────────────────┘ @implementation RCTParagraphComponentAccessibilityProviderTests { std::shared_ptr builder_; diff --git a/packages/react-native/ReactAndroid/src/main/jni/first-party/fb/include/fb/log.h b/packages/react-native/ReactAndroid/src/main/jni/first-party/fb/include/fb/log.h index 06e043615ba..0185c7c21a8 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/first-party/fb/include/fb/log.h +++ b/packages/react-native/ReactAndroid/src/main/jni/first-party/fb/include/fb/log.h @@ -264,7 +264,7 @@ int __android_log_print(int prio, const char* tag, const char* fmt, ...) * Stripped out of release builds. Uses the current LOG_TAG. */ #define FBLOG_ASSERT(cond, ...) FBLOG_FATAL_IF(!(cond), __VA_ARGS__) -//#define LOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond) +// #define LOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond) // --------------------------------------------------------------------- diff --git a/packages/react-native/ReactCommon/jsi/jsi/jsi-inl.h b/packages/react-native/ReactCommon/jsi/jsi/jsi-inl.h index f3955815e41..111a4702881 100644 --- a/packages/react-native/ReactCommon/jsi/jsi/jsi-inl.h +++ b/packages/react-native/ReactCommon/jsi/jsi/jsi-inl.h @@ -319,7 +319,7 @@ inline std::vector PropNameID::names( template inline std::vector PropNameID::names( - PropNameID(&&propertyNames)[N]) { + PropNameID (&&propertyNames)[N]) { std::vector result; result.reserve(N); for (auto& name : propertyNames) { diff --git a/packages/react-native/ReactCommon/jsi/jsi/jsi.h b/packages/react-native/ReactCommon/jsi/jsi/jsi.h index d77255f61a8..532a723ba0f 100644 --- a/packages/react-native/ReactCommon/jsi/jsi/jsi.h +++ b/packages/react-native/ReactCommon/jsi/jsi/jsi.h @@ -494,7 +494,7 @@ class JSI_EXPORT PropNameID : public Pointer { // Creates a vector of given PropNameIDs. template - static std::vector names(PropNameID(&&propertyNames)[N]); + static std::vector names(PropNameID (&&propertyNames)[N]); /// Copies the data in a PropNameID as utf8 into a C++ string. std::string utf8(Runtime& runtime) const { diff --git a/packages/react-native/ReactCommon/jsinspector-modern/CdpJson.cpp b/packages/react-native/ReactCommon/jsinspector-modern/CdpJson.cpp index d91d3f3678a..f9a0a2fc9dc 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/CdpJson.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/CdpJson.cpp @@ -40,8 +40,8 @@ std::string jsonError( } return folly::toJson( (id ? folly::dynamic::object("id", *id) - : folly::dynamic::object( - "id", nullptr))("error", std::move(dynamicError))); + : folly::dynamic::object("id", nullptr))( + "error", std::move(dynamicError))); } std::string jsonResult(RequestId id, const folly::dynamic& result) { diff --git a/packages/react-native/ReactCommon/jsinspector-modern/FallbackRuntimeAgentDelegate.cpp b/packages/react-native/ReactCommon/jsinspector-modern/FallbackRuntimeAgentDelegate.cpp index 5cab36048b6..e46712f72be 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/FallbackRuntimeAgentDelegate.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/FallbackRuntimeAgentDelegate.cpp @@ -62,8 +62,8 @@ void FallbackRuntimeAgentDelegate::sendWarningLogEntry(std::string_view text) { "timestamp", duration_cast( system_clock::now().time_since_epoch()) - .count())("source", "other")( - "level", "warning")("text", text)))); + .count())("source", "other")("level", "warning")( + "text", text)))); } } // namespace facebook::react::jsinspector_modern diff --git a/packages/react-native/ReactCommon/jsinspector-modern/HostAgent.cpp b/packages/react-native/ReactCommon/jsinspector-modern/HostAgent.cpp index bbbe14edf76..6ccb8100a13 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/HostAgent.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/HostAgent.cpp @@ -191,8 +191,8 @@ void HostAgent::sendInfoLogEntry( "timestamp", duration_cast( system_clock::now().time_since_epoch()) - .count())("source", "other")( - "level", "info")("text", text)("args", std::move(argsArray))))); + .count())("source", "other")("level", "info")("text", text)( + "args", std::move(argsArray))))); } void HostAgent::setCurrentInstanceAgent( diff --git a/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.cpp b/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.cpp index 551e59799ef..2d77e948538 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/InstanceAgent.cpp @@ -132,11 +132,14 @@ void InstanceAgent::sendConsoleMessageImmediately( "Runtime.consoleAPICalled", folly::dynamic::object("type", consoleMessageTypeName(message.type))( "timestamp", message.timestamp)("args", std::move(argsParam))( - "executionContextId", runtimeAgent_->getExecutionContextDescription().id)( - // We use the @cdp Runtime.consoleAPICalled `context` parameter to - // mark synthetic messages generated by the backend, i.e. not originating - // in a real `console.*` API call. - "context", runtimeAgent_->getExecutionContextDescription().name + "#InstanceAgent"))); + "executionContextId", + runtimeAgent_->getExecutionContextDescription().id)( + // We use the @cdp Runtime.consoleAPICalled `context` parameter to + // mark synthetic messages generated by the backend, i.e. not + // originating in a real `console.*` API call. + "context", + runtimeAgent_->getExecutionContextDescription().name + + "#InstanceAgent"))); } void InstanceAgent::maybeSendPendingConsoleMessages() { diff --git a/packages/react-native/ReactCommon/react/bridging/tests/ClassTest.cpp b/packages/react-native/ReactCommon/react/bridging/tests/ClassTest.cpp index 8f03d752cc5..dfcf9f29ec5 100644 --- a/packages/react-native/ReactCommon/react/bridging/tests/ClassTest.cpp +++ b/packages/react-native/ReactCommon/react/bridging/tests/ClassTest.cpp @@ -69,8 +69,7 @@ TEST_F(BridgingTest, callFromJsTest) { then.callWithThis( rt, promise, - bridging::toJs( - rt, [&](std::string res) { result = res; }, invoker)); + bridging::toJs(rt, [&](std::string res) { result = res; }, invoker)); flushQueue(); EXPECT_EQ("hi"s, result); @@ -84,8 +83,7 @@ TEST_F(BridgingTest, callFromJsTest) { .utf8(rt)); bool called = false; - func = bridging::toJs( - rt, [&] { called = true; }, invoker); + func = bridging::toJs(rt, [&] { called = true; }, invoker); bridging::callFromJs( rt, &TestClass::callAsync, invoker, &instance, func); diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h index b5e47efec6c..97348d06416 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h @@ -31,7 +31,7 @@ class Instance; namespace TurboModuleConvertUtils { jsi::Value convertObjCObjectToJSIValue(jsi::Runtime &runtime, id value); id convertJSIValueToObjCObject(jsi::Runtime &runtime, const jsi::Value &value, std::shared_ptr jsInvoker); -} +} // namespace TurboModuleConvertUtils /** * ObjC++ specific TurboModule base class. diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm index 2c9ae0bbf91..4abb7fca9be 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm @@ -227,7 +227,7 @@ static jsi::Value convertJSErrorDetailsToJSRuntimeError(jsi::Runtime &runtime, N return jsError; } -} +} // namespace TurboModuleConvertUtils jsi::Value ObjCTurboModule::createPromise(jsi::Runtime &runtime, std::string methodName, PromiseInvocationBlock invoke) { @@ -813,5 +813,5 @@ void ObjCTurboModule::setMethodArgConversionSelector(NSString *methodName, size_ methodArgConversionSelectors_[methodName][argIndex] = selectorValue; } -} -} // namespace facebook::react +} // namespace react +} // namespace facebook diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm index 6599c1295fe..79fbfb38ba3 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm @@ -165,7 +165,7 @@ bool isTurboModuleInstance(id module) { return isTurboModuleClass([module class]); } -} +} // namespace // Fallback lookup since RCT class prefix is sometimes stripped in the existing NativeModule system. // This will be removed in the future. @@ -578,9 +578,8 @@ typedef struct { if (!strongSelf) { return; } - module = [strongSelf _createAndSetUpObjCModule:moduleClass - moduleName:moduleName - moduleId:moduleHolder->getModuleId()]; + module = [strongSelf _createAndSetUpObjCModule:moduleClass moduleName:moduleName moduleId:moduleHolder + ->getModuleId()]; }; if ([self _requiresMainQueueSetup:moduleClass]) { diff --git a/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp b/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp index db99dd64fd1..4c128b5db8d 100644 --- a/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp @@ -186,7 +186,7 @@ LayoutAnimationKeyFrameManager::pullTransaction( }; #endif - // DEBUG ONLY: list existing inflight animations + // DEBUG ONLY: list existing inflight animations #ifdef LAYOUT_ANIMATION_VERBOSE_LOGGING LOG(ERROR) << "BEGINNING DISPLAYING ONGOING inflightAnimations_!"; int i = 0; diff --git a/packages/react-native/ReactCommon/react/renderer/core/PropsMacros.h b/packages/react-native/ReactCommon/react/renderer/core/PropsMacros.h index 4190b17a135..c3c352526b6 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/PropsMacros.h +++ b/packages/react-native/ReactCommon/react/renderer/core/PropsMacros.h @@ -21,7 +21,7 @@ // Get hash at compile-time. sizeof(str) - 1 == strlen #define CONSTEXPR_RAW_PROPS_KEY_HASH(s) \ - ([]() constexpr->RawPropsPropNameHash { \ + ([]() constexpr -> RawPropsPropNameHash { \ CLANG_PRAGMA("clang diagnostic push") \ CLANG_PRAGMA("clang diagnostic ignored \"-Wshadow\"") \ return RAW_PROPS_KEY_HASH(s); \ diff --git a/packages/react-native/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp b/packages/react-native/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp index ea9e657a428..5326feafad9 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp @@ -240,10 +240,9 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypes) { ContextContainer contextContainer{}; PropsParserContext parserContext{-1, contextContainer}; - auto raw = RawProps( - folly::dynamic::object("intValue", (int)42)("doubleValue", (double)17.42)( - "floatValue", - (float)66.67)("stringValue", "helloworld")("boolValue", true)); + auto raw = RawProps(folly::dynamic::object("intValue", (int)42)( + "doubleValue", (double)17.42)("floatValue", (float)66.67)( + "stringValue", "helloworld")("boolValue", true)); auto parser = RawPropsParser(); parser.prepare(); @@ -262,10 +261,9 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesGetTwice) { ContextContainer contextContainer{}; PropsParserContext parserContext{-1, contextContainer}; - auto raw = RawProps( - folly::dynamic::object("intValue", (int)42)("doubleValue", (double)17.42)( - "floatValue", - (float)66.67)("stringValue", "helloworld")("boolValue", true)); + auto raw = RawProps(folly::dynamic::object("intValue", (int)42)( + "doubleValue", (double)17.42)("floatValue", (float)66.67)( + "stringValue", "helloworld")("boolValue", true)); auto parser = RawPropsParser(); parser.prepare(); @@ -292,10 +290,9 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesGetOutOfOrder) { ContextContainer contextContainer{}; PropsParserContext parserContext{-1, contextContainer}; - auto raw = RawProps( - folly::dynamic::object("intValue", (int)42)("doubleValue", (double)17.42)( - "floatValue", - (float)66.67)("stringValue", "helloworld")("boolValue", true)); + auto raw = RawProps(folly::dynamic::object("intValue", (int)42)( + "doubleValue", (double)17.42)("floatValue", (float)66.67)( + "stringValue", "helloworld")("boolValue", true)); auto parser = RawPropsParser(); parser.prepare(); diff --git a/packages/react-native/ReactCommon/react/renderer/css/CSSKeywords.h b/packages/react-native/ReactCommon/react/renderer/css/CSSKeywords.h index 7279c36c7fd..64f306e27b3 100644 --- a/packages/react-native/ReactCommon/react/renderer/css/CSSKeywords.h +++ b/packages/react-native/ReactCommon/react/renderer/css/CSSKeywords.h @@ -83,8 +83,9 @@ enum class CSSKeyword : uint8_t { * Represents a contrained set of CSS keywords. */ template -concept CSSKeywordSet = std::is_enum_v && std:: - is_same_v, std::underlying_type_t>; +concept CSSKeywordSet = std::is_enum_v && + std::is_same_v, + std::underlying_type_t>; /** * CSS-wide keywords. diff --git a/packages/react-native/ReactCommon/react/renderer/css/CSSValue.h b/packages/react-native/ReactCommon/react/renderer/css/CSSValue.h index afe7d436c43..fd7dfb3575c 100644 --- a/packages/react-native/ReactCommon/react/renderer/css/CSSValue.h +++ b/packages/react-native/ReactCommon/react/renderer/css/CSSValue.h @@ -120,7 +120,8 @@ class CSSValueVariant { public: using Keyword = typename PackedKeywordSet::Type; - constexpr CSSValueVariant() requires(canRepresent()) + constexpr CSSValueVariant() + requires(canRepresent()) : CSSValueVariant(CSSValueType::CSSWideKeyword, CSSWideKeyword::Unset) {} static constexpr CSSValueVariant cssWideKeyword(CSSWideKeyword keyword) { @@ -129,30 +130,33 @@ class CSSValueVariant { } template - static constexpr CSSValueVariant keyword(KeywordT keyword) requires( - canRepresent()) { + static constexpr CSSValueVariant keyword(KeywordT keyword) + requires(canRepresent()) + { return CSSValueVariant(CSSValueType::Keyword, KeywordT{keyword}); } - static constexpr CSSValueVariant length( - float value, - CSSLengthUnit unit) requires(canRepresent()) { + static constexpr CSSValueVariant length(float value, CSSLengthUnit unit) + requires(canRepresent()) + { return CSSValueVariant(CSSValueType::Length, CSSLength{value, unit}); } - static constexpr CSSValueVariant number(float value) requires( - canRepresent()) { + static constexpr CSSValueVariant number(float value) + requires(canRepresent()) + { return CSSValueVariant(CSSValueType::Number, CSSNumber{value}); } - static constexpr CSSValueVariant percentage(float value) requires( - canRepresent()) { + static constexpr CSSValueVariant percentage(float value) + requires(canRepresent()) + { return CSSValueVariant(CSSValueType::Percentage, CSSPercentage{value}); } - static constexpr CSSValueVariant ratio( - float numerator, - float denominator) requires(canRepresent()) { + static constexpr CSSValueVariant ratio(float numerator, float denominator) + requires(canRepresent()) + { return CSSValueVariant( CSSValueType::Ratio, CSSRatio{numerator, denominator}); } @@ -162,33 +166,44 @@ class CSSValueVariant { } constexpr CSSWideKeyword getCSSWideKeyword() const - requires(canRepresent()) { + requires(canRepresent()) + { return getIf(); } constexpr Keyword getKeyword() const - requires(hasKeywordSet()) { + requires(hasKeywordSet()) + { return getIf(); } - constexpr CSSLength getLength() const requires(canRepresent()) { + constexpr CSSLength getLength() const + requires(canRepresent()) + { return getIf(); } - constexpr CSSNumber getNumber() const requires(canRepresent()) { + constexpr CSSNumber getNumber() const + requires(canRepresent()) + { return getIf(); } constexpr CSSPercentage getPercentage() const - requires(canRepresent()) { + requires(canRepresent()) + { return getIf(); } - constexpr CSSRatio getRatio() const requires(canRepresent()) { + constexpr CSSRatio getRatio() const + requires(canRepresent()) + { return getIf(); } - constexpr operator bool() const requires(canRepresent()) { + constexpr operator bool() const + requires(canRepresent()) + { return type() != CSSValueType::CSSWideKeyword || getCSSWideKeyword() != CSSWideKeyword::Unset; } diff --git a/packages/react-native/ReactCommon/react/renderer/debug/flags.h b/packages/react-native/ReactCommon/react/renderer/debug/flags.h index cc16f03e547..f7e2002f920 100644 --- a/packages/react-native/ReactCommon/react/renderer/debug/flags.h +++ b/packages/react-native/ReactCommon/react/renderer/debug/flags.h @@ -17,11 +17,11 @@ // // Enables verbose logging for the LayoutAnimations subsystem. -//#define LAYOUT_ANIMATION_VERBOSE_LOGGING 1 +// #define LAYOUT_ANIMATION_VERBOSE_LOGGING 1 // Logs information before running `assert` in LayoutAnimations. More useful on // Android vs other platforms. -//#define VERBOSE_LAYOUT_ANIMATION_ASSERTS 1 +// #define VERBOSE_LAYOUT_ANIMATION_ASSERTS 1 // Enables some Shadow Tree introspection features (maintains a StubViewTree, // and logs prev/next tree and mutations if there are any discrepancies). If you @@ -38,9 +38,9 @@ // Enables *very* verbose, noisy logs in the differ. Useful for debugging // specifically the differ, but not much else. -//#define DEBUG_LOGS_DIFFER +// #define DEBUG_LOGS_DIFFER // Uncomment to enable verbose StubViewTree debug logs. This ensures that errors // are logged to console before the `assert` is fired. More useful on Android vs // other platforms. -//#define STUB_VIEW_TREE_VERBOSE 1 +// #define STUB_VIEW_TREE_VERBOSE 1 diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.cpp index 162ffac0bb1..f05a4137b90 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -1087,8 +1087,8 @@ static void calculateShadowViewMutationsV2( DEBUG_LOGS({ LOG(ERROR) << "Differ Branch 1.1: Tags Different: [" << oldChildPair.shadowView.tag << "] [" - << newChildPair.shadowView.tag << "]" - << " with parent: [" << parentShadowView.tag << "]"; + << newChildPair.shadowView.tag << "]" << " with parent: [" + << parentShadowView.tag << "]"; }); // Totally different nodes, updating is impossible. @@ -1152,8 +1152,8 @@ static void calculateShadowViewMutationsV2( DEBUG_LOGS({ LOG(ERROR) << "Differ Branch 2: Deleting Tag/Tree: [" - << oldChildPair.shadowView.tag << "]" - << " with parent: [" << parentShadowView.tag << "]"; + << oldChildPair.shadowView.tag << "]" << " with parent: [" + << parentShadowView.tag << "]"; }); if (!oldChildPair.isConcreteView) { @@ -1214,8 +1214,8 @@ static void calculateShadowViewMutationsV2( DEBUG_LOGS({ LOG(ERROR) << "Differ Branch 3: Creating Tag/Tree: [" - << newChildPair.shadowView.tag << "]" - << " with parent: [" << parentShadowView.tag << "]"; + << newChildPair.shadowView.tag << "]" << " with parent: [" + << parentShadowView.tag << "]"; }); if (!newChildPair.isConcreteView) { diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp index 332c5e5aa49..b97e656213c 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp @@ -160,8 +160,7 @@ static void testShadowNodeTreeLifeCycle( << getDebugDescription( rebuiltViewTree.getRootStubView(), {}); - LOG(ERROR) << "Mutations:" - << "\n" + LOG(ERROR) << "Mutations:" << "\n" << getDebugDescription(mutations, {}); #endif @@ -312,8 +311,7 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( << getDebugDescription( rebuiltViewTree.getRootStubView(), {}); - LOG(ERROR) << "Mutations:" - << "\n" + LOG(ERROR) << "Mutations:" << "\n" << getDebugDescription(mutations, {}); #endif diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/tests/StateReconciliationTest.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/tests/StateReconciliationTest.cpp index 006b5936e3a..956c219d632 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/tests/StateReconciliationTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/tests/StateReconciliationTest.cpp @@ -49,7 +49,7 @@ class DummyShadowTreeDelegate : public ShadowTreeDelegate { void shadowTreeDidFinishTransaction( MountingCoordinator::Shared mountingCoordinator, - bool mountSynchronously) const override{}; + bool mountSynchronously) const override {}; }; namespace { diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.h b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.h index 5a37f1f6f99..ad4d7af3dd9 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.h +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.h @@ -14,6 +14,6 @@ NS_ASSUME_NONNULL_BEGIN /** * Returns UIFont instance corresponded to given font properties. */ -UIFont* RCTFontWithFontProperties(RCTFontProperties fontProperties); +UIFont *RCTFontWithFontProperties(RCTFontProperties fontProperties); NS_ASSUME_NONNULL_END diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp index d3b8d6dfce7..73ce6f5e381 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp @@ -141,22 +141,23 @@ void UIManagerBinding::dispatchEventToJS( return; } - auto instanceHandle = eventTarget != nullptr - ? [&]() { - auto instanceHandle = eventTarget->getInstanceHandle(runtime); - if (instanceHandle.isUndefined()) { - return jsi::Value::null(); - } + auto instanceHandle = eventTarget != nullptr ? [&]() { + auto instanceHandle = eventTarget->getInstanceHandle(runtime); + if (instanceHandle.isUndefined()) { + return jsi::Value::null(); + } - // Mixing `target` into `payload`. - if (!payload.isObject()) { - LOG(ERROR) << "payload for dispatchEvent is not an object: " << eventTarget->getTag(); - } - react_native_assert(payload.isObject()); - payload.asObject(runtime).setProperty(runtime, "target", eventTarget->getTag()); - return instanceHandle; - }() - : jsi::Value::null(); + // Mixing `target` into `payload`. + if (!payload.isObject()) { + LOG(ERROR) << "payload for dispatchEvent is not an object: " + << eventTarget->getTag(); + } + react_native_assert(payload.isObject()); + payload.asObject(runtime).setProperty( + runtime, "target", eventTarget->getTag()); + return instanceHandle; + }() + : jsi::Value::null(); if (instanceHandle.isNull()) { // Do not log all missing instanceHandles to avoid log spam diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm index b72949a52f9..f3219f2e080 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm @@ -115,8 +115,7 @@ class RCTHostHostTargetDelegate : public facebook::react::jsinspector_modern::Ho _launchOptions = [launchOptions copy]; __weak RCTHost *weakSelf = self; - auto bundleURLGetter = ^NSURL *() - { + auto bundleURLGetter = ^NSURL *() { RCTHost *strongSelf = weakSelf; if (!strongSelf) { return nil; @@ -129,8 +128,7 @@ class RCTHostHostTargetDelegate : public facebook::react::jsinspector_modern::Ho [weakSelf _setBundleURL:bundleURL_]; }; - auto defaultBundleURLGetter = ^NSURL *() - { + auto defaultBundleURLGetter = ^NSURL *() { RCTHost *strongSelf = weakSelf; if (!strongSelf || !strongSelf->_bundleURLProvider) { return nil; diff --git a/packages/react-native/ReactCommon/react/utils/ManagedObjectWrapper.h b/packages/react-native/ReactCommon/react/utils/ManagedObjectWrapper.h index 5da5fe702bb..6d4f7e7d1c6 100644 --- a/packages/react-native/ReactCommon/react/utils/ManagedObjectWrapper.h +++ b/packages/react-native/ReactCommon/react/utils/ManagedObjectWrapper.h @@ -34,7 +34,7 @@ namespace detail { */ void wrappedManagedObjectDeleter(void *cfPointer) noexcept; -} +} // namespace detail /* * `wrapManagedObject` and `unwrapManagedObject` are wrapper functions that diff --git a/packages/rn-tester/RNTesterUnitTests/RCTModuleInitTests.m b/packages/rn-tester/RNTesterUnitTests/RCTModuleInitTests.m index 94c5ae9ca13..5b410c221a9 100644 --- a/packages/rn-tester/RNTesterUnitTests/RCTModuleInitTests.m +++ b/packages/rn-tester/RNTesterUnitTests/RCTModuleInitTests.m @@ -208,7 +208,7 @@ RCT_EXPORT_MODULE() __block RCTTestCustomSetBridgeModule *module; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - module = [self->_bridge moduleForClass:[RCTTestCustomSetBridgeModule class]]; + module = [self->_bridge moduleForClass: [RCTTestCustomSetBridgeModule class]]; }); RCT_RUN_RUNLOOP_WHILE(!module); @@ -236,7 +236,7 @@ RCT_EXPORT_MODULE() __block RCTLazyInitModule *module; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - module = [self->_bridge moduleForClass:[RCTLazyInitModule class]]; + module = [self->_bridge moduleForClass: [RCTLazyInitModule class]]; }); RCT_RUN_RUNLOOP_WHILE(!module);