From c0e8522ec0b835eee20bc13648b26e007a3cae13 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Thu, 22 Dec 2022 13:13:58 -0600 Subject: [PATCH 01/11] Bump to 68 --- .ado/apple-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ado/apple-integration.yml b/.ado/apple-integration.yml index b6537f977b7476..7f53c5f1c6189a 100644 --- a/.ado/apple-integration.yml +++ b/.ado/apple-integration.yml @@ -50,7 +50,7 @@ jobs: set -eo pipefail cat package.json | jq '.devDependencies["react"] = $(react_version)' | - jq '.devDependencies["react-native"] = "^0.64"' | + jq '.devDependencies["react-native"] = "^0.68"' | jq '.devDependencies["react-native-macos"] = "../react-native-macos-$(package_version).tgz"' | jq 'del(.devDependencies["@react-native-community/cli"])' | jq 'del(.devDependencies["@react-native-community/cli-platform-android"])' | From 10b751772fbaafffc9c6364d8aae6e43ff9c7990 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 3 Jan 2023 11:48:21 -0600 Subject: [PATCH 02/11] Add audited regions --- React/Base/RCTUIKit.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/React/Base/RCTUIKit.h b/React/Base/RCTUIKit.h index 8e920dccd5beda..5787bd5270da40 100644 --- a/React/Base/RCTUIKit.h +++ b/React/Base/RCTUIKit.h @@ -15,6 +15,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + // // functionally equivalent types // @@ -116,10 +118,14 @@ UIKIT_STATIC_INLINE CGFloat UIFontLineHeight(UIFont *font) return [font lineHeight]; } +NS_ASSUME_NONNULL_END + #else // TARGET_OS_OSX [ #import +NS_ASSUME_NONNULL_BEGIN + // // semantically equivalent constants // @@ -467,6 +473,8 @@ NS_INLINE CGRect CGRectValue(NSValue *value) return rect; } +NS_ASSUME_NONNULL_END + #endif // ] TARGET_OS_OSX // From 7cc53aff75b626133ebaf9ad555058dd496cfcef Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 3 Jan 2023 11:57:17 -0600 Subject: [PATCH 03/11] Fix some more warnings --- React/Base/RCTUIKit.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/React/Base/RCTUIKit.h b/React/Base/RCTUIKit.h index 5787bd5270da40..07b26be0990245 100644 --- a/React/Base/RCTUIKit.h +++ b/React/Base/RCTUIKit.h @@ -374,7 +374,7 @@ CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *path); @property (nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled; -- (NSView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event; +- (NSView *)hitTest:(CGPoint)point withEvent:(UIEvent *_Nullable)event; - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event; - (void)insertSubview:(NSView *)view atIndex:(NSInteger)index; @@ -391,7 +391,7 @@ CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *path); // An override of an undocumented API that controls the layer's masksToBounds property @property (nonatomic) BOOL clipsToBounds; @property (nonatomic, copy) NSColor *backgroundColor; -@property (nonatomic, readwrite, getter=isOpaque) BOOL opaque; +@property (nonatomic, getter=isOpaque) BOOL opaque; @property (nonatomic) CGAffineTransform transform; /** From a5485b4a3171c0b8d428722039da84f6b5578b12 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 3 Jan 2023 13:05:02 -0600 Subject: [PATCH 04/11] More nonnull --- React/Base/RCTUIKit.h | 5 +++ packages/rn-tester/Podfile.lock | 62 ++++++++++++++++----------------- 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/React/Base/RCTUIKit.h b/React/Base/RCTUIKit.h index 07b26be0990245..771a234860b1d2 100644 --- a/React/Base/RCTUIKit.h +++ b/React/Base/RCTUIKit.h @@ -481,6 +481,8 @@ NS_ASSUME_NONNULL_END // fabric component types // +NS_ASSUME_NONNULL_BEGIN + // RCTUISlider #if !TARGET_OS_OSX // [TODO(macOS GH#774) @@ -529,4 +531,7 @@ typedef UISwitch RCTUISwitch; - (void)stopAnimating; @end + +NS_ASSUME_NONNULL_END + #endif // ]TODO(macOS GH#774) diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index e12cef18ace7d3..42fa186c2728c6 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -563,8 +563,8 @@ SPEC CHECKSUMS: boost: 613e39eac4239cc72b15421247b5ab05361266a2 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: ed15e075aa758ac0e4c1f8b830bd4e4d40d669e8 - FBLazyVector: 60b63b875d9a3efc175d0c9e400ca47c434bc6d1 - FBReactNativeSpec: 62b8a10066cc7741c1876ef3abb859fc90faaaca + FBLazyVector: 4f7dec9b06e2161bdc7451b81285b955e44120f2 + FBReactNativeSpec: 884fc2c1ae9aac805b5b1683556539017f128e30 Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c @@ -575,42 +575,42 @@ SPEC CHECKSUMS: Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - glog: 42c4bf47024808486e90b25ea9e5ac3959047641 + glog: 20113a0d46931b6f096cf8302c68691d75a456ff libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OCMock: 9491e4bec59e0b267d52a9184ff5605995e74be8 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c - RCT-Folly: 43adc9ce880eb76792f88c011773cb5c664c1419 - RCTRequired: 711af33fea12120e1e2cd9575de500b1163e0215 - RCTTypeSafety: b68c55552c09b131e99ccffd4394945c6e153e14 - React: 8c7b6cbe6834cdb7eba35d92eb85eab9b8381d03 - React-callinvoker: d4b0c66588902f0ba389c5bef7c014e18a571d7d + RCT-Folly: 24c6da766832002a4a2aac5f79ee0ca50fbe8507 + RCTRequired: 9b3b3dd4bec7ff068b05da2f77a4ce87b79056ce + RCTTypeSafety: 0a550fe20009fbdb80b750bd92d8476b4fbcfd4b + React: a7ba329278133e1d7b0d57eac0f455cb53c484ef + React-callinvoker: a7973d14f10e7bfa72fe0cf97264dba48d49cc5c React-Codegen: 61a79489c164568e1575cc662fa7c9a167215dcc - React-Core: ef10b29be647e9fe6541bee92945c052a2227be7 - React-CoreModules: 43dadecdb2b2c83ef74443941cdf869b429c835c - React-cxxreact: 1d3662e60451049d10bbdcc172d1360e3af4e7f1 - React-jsi: 19eb9069d3f323ac5ffc941707f3f6739f48f2b9 - React-jsiexecutor: 3e39bb047dfbe02d37b6144ca149f0c880bd9ec6 - React-jsinspector: ce7b508215e9f720c345ccd48353c8e426604c09 - React-logger: f624f2cf83c69f2455874ae6f5521475611c5a4f - React-perflogger: a9a9d7a5f9f47c5b56193e3c114fb16ba3a184d2 - React-RCTActionSheet: 1c27530aba6834d35e2005570e96a97c18eb445f - React-RCTAnimation: 73d2ed8c8eecf9dde97c5e4be05d2adbbda58f2c - React-RCTBlob: 43eb87c4b2d788197ffad01c70bfc17e4a1ac6ea - React-RCTImage: 40867075e9927fe2c913e3a852043850ce8d5d6d - React-RCTLinking: 565e4d6fdfd2271935c9d3e2510b6bd2fa372b8f - React-RCTNetwork: 9a0cbc84ba053d739aca05faa3568d366262bdd0 - React-RCTPushNotification: c53e9e576b49a01f63e9649bd7a6203c0c03d6d8 - React-RCTSettings: 7195a08c20f21c0efa71aeacd488485ea80a44d3 - React-RCTTest: 271b54801041f7c9b2a0dbe71827550e84a5bdbb - React-RCTText: b8a9723313c024ca592fa46b040fbb372722525c - React-RCTVibration: 2b44f706a45a1a82458b5d05f394cb601e07da2a - React-runtimeexecutor: 3010cca0a32b0b0ae87e0aae3265f86c4676f501 + React-Core: 83f76a9e553370910f7dd036c227ae3728514e4c + React-CoreModules: 956c5003b1f393ecdf01cac81b9abd61c53cb897 + React-cxxreact: 0d26fe3e743964ec28be7480781b33669d7edcb2 + React-jsi: 0fe864a1e1ab4089ae7361cb768bda8f20350ad8 + React-jsiexecutor: 80621468529516b8f1164685d8e62d72c78f7551 + React-jsinspector: f1d9ed916336a72ec377fb8c0a1d784a7a0085ae + React-logger: 7dfa0e98931f90b501143d2cf5fbbd3fbb03a5c1 + React-perflogger: 6470780013040448a52bdab0e668573ad6da047c + React-RCTActionSheet: 7a120b18673235b7bec8c6b7f45ffe6103a80c45 + React-RCTAnimation: e380831ab78e2e6e41fb21d99c2515b61ded67b2 + React-RCTBlob: ef1b52b27841714d8e77e65a3f46ae37ab5c0286 + React-RCTImage: 73f3c9efc611c90eb57fa8ffd8390f748cd12163 + React-RCTLinking: 862a74f8b690f080fbbb071d6c9ee9f918d85abf + React-RCTNetwork: 0ad181f3eccebc98acd5aae88668ec8b977ada4f + React-RCTPushNotification: 2f6d6c013536e7381517a89854b2e0dec3ccaea0 + React-RCTSettings: 69dc88fa59c154c0f020de20af286e1f18ecaf08 + React-RCTTest: c4409159d6602fac7ea0c77dd78edbfd87451003 + React-RCTText: e76719accaa721a86ef10fd26418c632364865cc + React-RCTVibration: b13450dceee3922928d5f2ba626f13a8c8a41592 + React-runtimeexecutor: efede3b2374f6eea50a485f042f7f8c13e3b4d80 React-TurboModuleCxx-RNW: 881411415eafe818f9cc3c4016167cc3d219402b - React-TurboModuleCxx-WinRTPort: 1fd3447c284a28a6073bfb5c3ec7e12079209fc1 - ReactCommon: 545c27c21c516ab8c40af635cdcc0e20591d5c8c + React-TurboModuleCxx-WinRTPort: 07e0f59bfaa337933c7b114d374d0e2a93b4b5e8 + ReactCommon: 3199785c30e1efcce92ca7da5038c7a248124aa3 ScreenshotManager: b378292226c78474e70b139ba2e19f584836c520 SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: 8d41f98023fe4d9e60d4283ec1ac3a3ae4e7f863 + Yoga: 9899fd558a01665e4acf7e28f02f2090942e829c YogaKit: f782866e155069a2cca2517aafea43200b01fd5a PODFILE CHECKSUM: cbf4f9be33910397d5f84dd4fcbe56d3d61d42fa From 68cb6669dcf9ce85120f363d959347d9ca37f4a7 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 3 Jan 2023 14:07:00 -0600 Subject: [PATCH 05/11] don't audit fabric types --- React/Base/RCTUIKit.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/React/Base/RCTUIKit.h b/React/Base/RCTUIKit.h index 771a234860b1d2..428360881c6903 100644 --- a/React/Base/RCTUIKit.h +++ b/React/Base/RCTUIKit.h @@ -481,8 +481,6 @@ NS_ASSUME_NONNULL_END // fabric component types // -NS_ASSUME_NONNULL_BEGIN - // RCTUISlider #if !TARGET_OS_OSX // [TODO(macOS GH#774) @@ -490,7 +488,7 @@ NS_ASSUME_NONNULL_BEGIN #else @interface RCTUISlider : NSSlider @end -#endif // ]TODO(macOS GH#774)n +#endif // ]TODO(macOS GH#774) // RCTUILabel @@ -532,6 +530,4 @@ typedef UISwitch RCTUISwitch; @end -NS_ASSUME_NONNULL_END - #endif // ]TODO(macOS GH#774) From cfda8ac2691e20660aed027da3c0e47110b79058 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 3 Jan 2023 14:24:54 -0600 Subject: [PATCH 06/11] Audit just the macOS Fabric regions --- React/Base/RCTUIKit.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/React/Base/RCTUIKit.h b/React/Base/RCTUIKit.h index 428360881c6903..a886187852227e 100644 --- a/React/Base/RCTUIKit.h +++ b/React/Base/RCTUIKit.h @@ -507,9 +507,11 @@ typedef UISwitch RCTUISwitch; @interface RCTUISwitch : NSSwitch @property (nonatomic, assign, getter=isOn) BOOL on; +NS_ASSUME_NONNULL_BEGIN - (void)setOn:(BOOL)on animated:(BOOL)animated; +NS_ASSUME_NONNULL_END @end #endif // ]TODO(macOS GH#774) @@ -519,7 +521,7 @@ typedef UISwitch RCTUISwitch; #define RCTUIActivityIndicatorView UIActivityIndicatorView #else @interface RCTUIActivityIndicatorView : NSProgressIndicator - +NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorViewStyle; @property (nonatomic, assign) BOOL hidesWhenStopped; @property (nullable, readwrite, nonatomic, strong) RCTUIColor *color; @@ -527,7 +529,7 @@ typedef UISwitch RCTUISwitch; - (void)startAnimating; - (void)stopAnimating; - +NS_ASSUME_NONNULL_END @end #endif // ]TODO(macOS GH#774) From 43e0f46c6864fc8d832470cb5a803518190a2f95 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 3 Jan 2023 14:49:04 -0600 Subject: [PATCH 07/11] Add to RCTSlider --- React/Views/RCTSlider.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/React/Views/RCTSlider.h b/React/Views/RCTSlider.h index 069fee8b341ffb..ff082c02d48467 100644 --- a/React/Views/RCTSlider.h +++ b/React/Views/RCTSlider.h @@ -9,6 +9,8 @@ #import +NS_ASSUME_NONNULL_BEGIN + #if TARGET_OS_OSX // [TODO(macOS GH#774) @protocol RCTSliderDelegate; #endif @@ -50,3 +52,5 @@ - (void)slider:(RCTSlider *)slider didPress:(BOOL)press; @end #endif // ]TODO(macOS GH#774) + +NS_ASSUME_NONNULL_END From b3226ac6845c4ff6867d3f53a5e5c5f10541238f Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Mon, 9 Jan 2023 15:46:51 -0800 Subject: [PATCH 08/11] More warning fixes --- React/Base/RCTTouchHandler.m | 4 ++-- React/Base/RCTUIKit.h | 15 +++++++-------- React/Modules/RCTUIManager.h | 2 +- React/Modules/RCTUIManager.m | 8 ++++---- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/React/Base/RCTTouchHandler.m b/React/Base/RCTTouchHandler.m index b1b23b9c79a5a2..63809638b189be 100644 --- a/React/Base/RCTTouchHandler.m +++ b/React/Base/RCTTouchHandler.m @@ -40,7 +40,7 @@ @implementation RCTTouchHandler { NSMutableArray *_reactTouches; NSMutableArray *_touchViews; // TODO(macOS GH#774) - __weak RCTUIView *_cachedRootView; // TODO(macOS GH#774) + __weak RCTPlatformView *_cachedRootView; // TODO(macOS GH#774) uint16_t _coalescingKey; #if TARGET_OS_OSX// [TODO(macOS GH#774) @@ -363,7 +363,7 @@ - (void)_updateAndDispatchTouches:(NSSet *)touches eventName:(NSStrin */ - (void)_cacheRootView { - RCTUIView *rootView = self.view; // TODO(macOS ISS#3536887) + RCTPlatformView *rootView = self.view; // TODO(macOS ISS#3536887) while (rootView.superview && ![rootView isReactRootView] && ![rootView isKindOfClass:[RCTSurfaceView class]]) { rootView = rootView.superview; } diff --git a/React/Base/RCTUIKit.h b/React/Base/RCTUIKit.h index 21542db4866d67..9dc0c24cf4787c 100644 --- a/React/Base/RCTUIKit.h +++ b/React/Base/RCTUIKit.h @@ -67,7 +67,7 @@ UIKIT_STATIC_INLINE CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *path) #define RCTPlatformWindow UIWindow -UIKIT_STATIC_INLINE RCTPlatformView *RCTUIViewHitTestWithEvent(RCTPlatformView *view, CGPoint point, UIEvent *event) +UIKIT_STATIC_INLINE RCTPlatformView *RCTUIViewHitTestWithEvent(RCTPlatformView *view, CGPoint point, __unused UIEvent *__nullable event) { return [view hitTest:point withEvent:event]; } @@ -443,7 +443,7 @@ CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *path); @end // ]TODO(macOS GH#774) -NS_INLINE RCTPlatformView *RCTUIViewHitTestWithEvent(RCTPlatformView *view, CGPoint point, __unused UIEvent *event) +NS_INLINE RCTPlatformView *RCTUIViewHitTestWithEvent(RCTPlatformView *view, CGPoint point, __unused UIEvent *__nullable event) { return [view hitTest:point]; } @@ -491,7 +491,7 @@ NS_ASSUME_NONNULL_END typedef UISlider RCTUISlider; #else @interface RCTUISlider : NSSlider - +NS_ASSUME_NONNULL_BEGIN @property (nonatomic, readonly) BOOL pressed; @property (nonatomic, assign) float value; @property (nonatomic, assign) float minimumValue; @@ -500,14 +500,14 @@ typedef UISlider RCTUISlider; @property (nonatomic, strong) NSColor *maximumTrackTintColor; - (void)setValue:(float)value animated:(BOOL)animated; - +NS_ASSUME_NONNULL_END @end #endif // ]TODO(macOS GH#774) // RCTUILabel #if !TARGET_OS_OSX // [TODO(macOS GH#774) -#define RCTUILabel UILabel +typedef UILabel RCTUILabel; #else @interface RCTUILabel : NSTextField @end @@ -519,9 +519,8 @@ typedef UISlider RCTUISlider; typedef UISwitch RCTUISwitch; #else @interface RCTUISwitch : NSSwitch - -@property (nonatomic, assign, getter=isOn) BOOL on; NS_ASSUME_NONNULL_BEGIN +@property (nonatomic, assign, getter=isOn) BOOL on; - (void)setOn:(BOOL)on animated:(BOOL)animated; @@ -532,7 +531,7 @@ NS_ASSUME_NONNULL_END // RCTUIActivityIndicatorView #if !TARGET_OS_OSX // [TODO(macOS GH#774) -#define RCTUIActivityIndicatorView UIActivityIndicatorView +typedef UIActivityIndicatorView RCTUIActivityIndicatorView; #else @interface RCTUIActivityIndicatorView : NSProgressIndicator NS_ASSUME_NONNULL_BEGIN diff --git a/React/Modules/RCTUIManager.h b/React/Modules/RCTUIManager.h index 5955bbe953fed7..e228957479706c 100644 --- a/React/Modules/RCTUIManager.h +++ b/React/Modules/RCTUIManager.h @@ -134,7 +134,7 @@ void RCTTraverseViewNodes(id view, void (^block)(id) * @param nativeID the id reference to native component relative to root view. * @param rootTag the react tag of root view hierarchy from which to find the view. */ -- (RCTUIView *)viewForNativeID:(NSString *)nativeID withRootTag:(NSNumber *)rootTag; // TODO(macOS ISS#3536887) +- (RCTPlatformView *)viewForNativeID:(NSString *)nativeID withRootTag:(NSNumber *)rootTag; // TODO(macOS ISS#3536887) /** * Register a view that is tagged with nativeID as its nativeID prop diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index 8f2d54849baff9..2acd5bd99c35b9 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -111,7 +111,7 @@ - (void)invalidate RCTExecuteOnMainQueue(^{ RCT_PROFILE_BEGIN_EVENT(RCTProfileTagAlways, @"UIManager invalidate", nil); for (NSNumber *rootViewTag in self->_rootViewTags) { - RCTUIView *rootView = self->_viewRegistry[rootViewTag]; // TODO(macOS ISS#3536887) + RCTPlatformView *rootView = self->_viewRegistry[rootViewTag]; // TODO(macOS ISS#3536887) if ([rootView conformsToProtocol:@protocol(RCTInvalidating)]) { [(id)rootView invalidate]; } @@ -455,12 +455,12 @@ - (void)setLocalData:(NSObject *)localData forView:(RCTUIView *)view // TODO(mac forTag:view.reactTag]; } -- (RCTUIView *)viewForNativeID:(NSString *)nativeID withRootTag:(NSNumber *)rootTag +- (RCTPlatformView *)viewForNativeID:(NSString *)nativeID withRootTag:(NSNumber *)rootTag { if (!nativeID || !rootTag) { return nil; } - RCTUIView *view; // TODO(macOS ISS#3536887) + RCTPlatformView *view; // TODO(macOS ISS#3536887) @synchronized(self) { view = [_nativeIDRegistry objectForKey:RCTNativeIDRegistryKey(nativeID, rootTag)]; } @@ -1101,7 +1101,7 @@ - (void)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag viewName:(NSStrin { RCTAssertMainQueue(); RCTComponentData *componentData = _componentDataByName[viewName]; - RCTUIView *view = _viewRegistry[reactTag]; // TODO(macOS ISS#3536887) + RCTPlatformView *view = _viewRegistry[reactTag]; // TODO(macOS ISS#3536887) [componentData setProps:props forView:view]; } From 3f542f0967aa5f469d8d8f543b9ebc07e705180a Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Mon, 9 Jan 2023 18:02:18 -0800 Subject: [PATCH 09/11] More warning fixes --- Libraries/Text/Text/RCTTextView.h | 2 +- Libraries/Text/Text/RCTTextView.m | 4 ++-- React/Base/RCTRootContentView.m | 4 ++-- React/Base/RCTUIKit.h | 2 +- React/Views/RCTView.m | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Libraries/Text/Text/RCTTextView.h b/Libraries/Text/Text/RCTTextView.h index b562b0f889a65a..3b7bb9053c5fac 100644 --- a/Libraries/Text/Text/RCTTextView.h +++ b/Libraries/Text/Text/RCTTextView.h @@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN @interface RCTTextView : RCTUIView // TODO(macOS ISS#3536887) -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; // TODO(OSS Candidate ISS#2710739) +- (instancetype)initWithEventDispatcher:(id)eventDispatcher; // TODO(OSS Candidate ISS#2710739) @property (nonatomic, assign) BOOL selectable; diff --git a/Libraries/Text/Text/RCTTextView.m b/Libraries/Text/Text/RCTTextView.m index 56973f2305fa29..e65c64ac6f5537 100644 --- a/Libraries/Text/Text/RCTTextView.m +++ b/Libraries/Text/Text/RCTTextView.m @@ -51,14 +51,14 @@ @implementation RCTTextView NSTextView *_textView; #endif // ]TODO(macOS GH#774) - RCTEventDispatcher *_eventDispatcher; // TODO(OSS Candidate ISS#2710739) + id _eventDispatcher; // TODO(OSS Candidate ISS#2710739) NSArray *_Nullable _descendantViews; // TODO(macOS ISS#3536887) NSTextStorage *_Nullable _textStorage; CGRect _contentFrame; } // [TODO(OSS Candidate ISS#2710739) -- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher +- (instancetype)initWithEventDispatcher:(id)eventDispatcher { if ((self = [self initWithFrame:CGRectZero])) { _eventDispatcher = eventDispatcher; diff --git a/React/Base/RCTRootContentView.m b/React/Base/RCTRootContentView.m index 09ce4eb76a8e0f..aad3c4343c129e 100644 --- a/React/Base/RCTRootContentView.m +++ b/React/Base/RCTRootContentView.m @@ -132,10 +132,10 @@ - (void)updateAvailableSize [_bridge.uiManager setAvailableSize:self.availableSize forRootView:self]; } -- (RCTUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS ISS#3536887) +- (RCTPlatformView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(macOS ISS#3536887) { // The root content view itself should never receive touches - RCTUIView *hitView = [super hitTest:point withEvent:event]; // TODO(macOS ISS#3536887) + RCTPlatformView *hitView = [super hitTest:point withEvent:event]; // TODO(macOS ISS#3536887) if (_passThroughTouches && hitView == self) { return nil; } diff --git a/React/Base/RCTUIKit.h b/React/Base/RCTUIKit.h index 9dc0c24cf4787c..f5e465af304256 100644 --- a/React/Base/RCTUIKit.h +++ b/React/Base/RCTUIKit.h @@ -395,7 +395,7 @@ CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *path); // An override of an undocumented API that controls the layer's masksToBounds property @property (nonatomic) BOOL clipsToBounds; @property (nonatomic, copy) NSColor *backgroundColor; -@property (nonatomic, getter=isOpaque) BOOL opaque; +@property (nonatomic, readwrite, getter=isOpaque) BOOL opaque; @property (nonatomic) CGAffineTransform transform; /** diff --git a/React/Views/RCTView.m b/React/Views/RCTView.m index e0b9a904aa6d84..850d3186dbd021 100644 --- a/React/Views/RCTView.m +++ b/React/Views/RCTView.m @@ -227,7 +227,7 @@ - (RCTPlatformView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event // TODO(m BOOL needsHitSubview = !(_pointerEvents == RCTPointerEventsNone || _pointerEvents == RCTPointerEventsBoxOnly); if (needsHitSubview && (![self clipsToBounds] || isPointInside)) { // Take z-index into account when calculating the touch target. - NSArray *sortedSubviews = [self reactZIndexSortedSubviews]; // TODO(macOS ISS#3536887) + NSArray *sortedSubviews = [self reactZIndexSortedSubviews]; // TODO(macOS ISS#3536887) // The default behaviour of UIKit is that if a view does not contain a point, // then no subviews will be returned from hit testing, even if they contain From 0bd10270785d5445bbf6b6ad81970912ab23b6e2 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Mon, 9 Jan 2023 18:53:28 -0800 Subject: [PATCH 10/11] Fix up opaque --- Libraries/Text/Text/RCTTextView.m | 2 +- React/Base/RCTUIKit.h | 1 - .../Mounting/ComponentViews/Text/RCTParagraphComponentView.mm | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Libraries/Text/Text/RCTTextView.m b/Libraries/Text/Text/RCTTextView.m index e65c64ac6f5537..a529681390db36 100644 --- a/Libraries/Text/Text/RCTTextView.m +++ b/Libraries/Text/Text/RCTTextView.m @@ -73,6 +73,7 @@ - (instancetype)initWithFrame:(CGRect)frame #if !TARGET_OS_OSX // TODO(macOS GH#774) self.isAccessibilityElement = YES; self.accessibilityTraits |= UIAccessibilityTraitStaticText; + self.opaque = NO; #else // [TODO(macOS GH#774) self.accessibilityRole = NSAccessibilityStaticTextRole; // Fix blurry text on non-retina displays. @@ -90,7 +91,6 @@ - (instancetype)initWithFrame:(CGRect)frame _textStorage = _textView.textStorage; [self addSubview:_textView]; #endif // ]TODO(macOS GH#774) - self.opaque = NO; RCTUIViewSetContentModeRedraw(self); // TODO(macOS GH#774) and TODO(macOS ISS#3536887) } return self; diff --git a/React/Base/RCTUIKit.h b/React/Base/RCTUIKit.h index f5e465af304256..5037b4684b2466 100644 --- a/React/Base/RCTUIKit.h +++ b/React/Base/RCTUIKit.h @@ -395,7 +395,6 @@ CGPathRef UIBezierPathCreateCGPathRef(UIBezierPath *path); // An override of an undocumented API that controls the layer's masksToBounds property @property (nonatomic) BOOL clipsToBounds; @property (nonatomic, copy) NSColor *backgroundColor; -@property (nonatomic, readwrite, getter=isOpaque) BOOL opaque; @property (nonatomic) CGAffineTransform transform; /** diff --git a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm index f17342d9af4239..35b0a85f6d7dfb 100644 --- a/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm @@ -43,9 +43,9 @@ - (instancetype)initWithFrame:(CGRect)frame static const auto defaultProps = std::make_shared(); _props = defaultProps; - self.opaque = NO; #if !TARGET_OS_OSX // TODO(macOS GH#774) self.contentMode = UIViewContentModeRedraw; + self.opaque = NO; #endif // TODO(macOS GH#774) } From 97a2d10b23359ce60f8fad50c7cb528959df9d89 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Mon, 9 Jan 2023 19:04:06 -0800 Subject: [PATCH 11/11] Remove override of opaque --- React/Base/macOS/RCTUIKit.m | 6 ------ 1 file changed, 6 deletions(-) diff --git a/React/Base/macOS/RCTUIKit.m b/React/Base/macOS/RCTUIKit.m index c54f879a0ec50e..2388ba7c9b72b4 100644 --- a/React/Base/macOS/RCTUIKit.m +++ b/React/Base/macOS/RCTUIKit.m @@ -207,7 +207,6 @@ @implementation RCTUIView // TODO(macOS ISS#3536887) @private NSColor *_backgroundColor; BOOL _clipsToBounds; - BOOL _opaque; BOOL _userInteractionEnabled; } @@ -287,11 +286,6 @@ - (BOOL)isFlipped return YES; } -- (BOOL)isOpaque -{ - return _opaque; -} - - (CGFloat)alpha { return self.alphaValue;