Something went wrong. Try again.
Mirror — see github.com/blacksky-algorithms/blacksky.community
Something went wrong. Try again.
12 kB · 259 lines
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260diff --git a/React/Base/Surface/RCTSurface.mm b/React/Base/Surface/RCTSurface.mmindex 14f88de1f3ddadc39ca53c9e8944d7d2eeb60268..cee524b67823be6e4d10adb882a88e3bcb38efd4 100644--- a/React/Base/Surface/RCTSurface.mm+++ b/React/Base/Surface/RCTSurface.mm@@ -465,7 +465,7 @@ // right after the semaphore signals. // Atomic variant of `_waitingForMountingStageOnMainQueue = YES;`- atomic_fetch_or(&_waitingForMountingStageOnMainQueue, 1);+ atomic_exchange(&_waitingForMountingStageOnMainQueue, 1); } dispatch_semaphore_t semaphore;@@ -488,7 +488,7 @@ auto timeoutOccurred = dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, timeout * NSEC_PER_SEC)); // Atomic equivalent of `_waitingForMountingStageOnMainQueue = NO;`.- atomic_fetch_and(&_waitingForMountingStageOnMainQueue, 0);+ atomic_exchange(&_waitingForMountingStageOnMainQueue, 0); if (!timeoutOccurred) { // Balancing the semaphore.@@ -546,7 +546,7 @@ { if (atomic_load(&_waitingForMountingStageOnMainQueue) && (self.stage & RCTSurfaceStageSurfaceDidInitialLayout)) { // Atomic equivalent of `_waitingForMountingStageOnMainQueue = NO;`.- atomic_fetch_and(&_waitingForMountingStageOnMainQueue, 0);+ atomic_exchange(&_waitingForMountingStageOnMainQueue, 0); { std::lock_guard<std::mutex> lock(_mutex);diff --git a/React/DevSupport/RCTPackagerConnection.mm b/React/DevSupport/RCTPackagerConnection.mmindex 39419d60e1203673e9cafb71c6932a6b9200bf18..b252a4976f7ad3b430d97c2bc94b781dd93dbd0a 100644--- a/React/DevSupport/RCTPackagerConnection.mm+++ b/React/DevSupport/RCTPackagerConnection.mm@@ -9,6 +9,7 @@ #import <objc/runtime.h> #import <algorithm>+#import <mutex> #import <vector> #import <React/RCTAssert.h>diff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.hindex 914a2494a57923fbf185644b7e2bb8aca8848e56..0deac55f22350f5e8377d8963fb1c2434bf6abfd 100644--- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h+++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h@@ -19,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN */ @interface RCTPullToRefreshViewComponentView : RCTViewComponentView <RCTCustomPullToRefreshViewProtocol> +- (void)beginRefreshingProgrammatically;+ @end NS_ASSUME_NONNULL_ENDdiff --git a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mmindex 1494fd225aff1fa0429e917404d6b4ca5fc961c5..df643f5c844ad2e684de5161528eba17f4a188d0 100644--- a/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm+++ b/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm@@ -1038,6 +1038,11 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu } } ++ (BOOL)shouldBeRecycled+{+ return NO;+}+ @end Class<RCTComponentViewProtocol> RCTScrollViewCls(void)diff --git a/React/Profiler/RCTProfile.m b/React/Profiler/RCTProfile.mindex 994e8ad6c107cb87274200849c204dee48e1f565..287b93403adb8554b2952f21bc56f1d02999636e 100644--- a/React/Profiler/RCTProfile.m+++ b/React/Profiler/RCTProfile.m@@ -445,7 +445,7 @@ BOOL RCTProfileIsProfiling(void) void RCTProfileInit(RCTBridge *bridge) { // TODO: enable assert JS thread from any file (and assert here)- BOOL wasProfiling = atomic_fetch_or(&RCTProfileProfiling, 1);+ BOOL wasProfiling = atomic_exchange(&RCTProfileProfiling, 1); if (wasProfiling) { return; }@@ -492,7 +492,7 @@ void RCTProfileInit(RCTBridge *bridge) void RCTProfileEnd(RCTBridge *bridge, void (^callback)(NSString *)) { // assert JavaScript thread here again- BOOL wasProfiling = atomic_fetch_and(&RCTProfileProfiling, 0);+ BOOL wasProfiling = atomic_exchange(&RCTProfileProfiling, 0); if (!wasProfiling) { return; }diff --git a/React/Views/RefreshControl/RCTRefreshControl.h b/React/Views/RefreshControl/RCTRefreshControl.hindex e9b330fa7c29c42653a3b0191d0f8a1b13b2d3de..ec5f58c887bfd949f1279ef1c31352e0b465e9ec 100644--- a/React/Views/RefreshControl/RCTRefreshControl.h+++ b/React/Views/RefreshControl/RCTRefreshControl.h@@ -15,5 +15,8 @@ @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) RCTDirectEventBlock onRefresh; @property (nonatomic, weak) UIScrollView *scrollView;+@property (nonatomic, copy) UIColor *customTintColor;++- (void)forwarderBeginRefreshing; @enddiff --git a/React/Views/RefreshControl/RCTRefreshControl.m b/React/Views/RefreshControl/RCTRefreshControl.mindex 53bfd04703502d5b8e932c47a528bb03cd79d330..ff1b1ed5e060bcf0d91528c6d3c2c5c8acf24967 100644--- a/React/Views/RefreshControl/RCTRefreshControl.m+++ b/React/Views/RefreshControl/RCTRefreshControl.m@@ -23,6 +23,7 @@ UIColor *_titleColor; CGFloat _progressViewOffset; BOOL _hasMovedToWindow;+ UIColor *_customTintColor; } - (instancetype)init@@ -58,6 +59,12 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) _isInitialRender = false; } +- (void)didMoveToSuperview+{+ [super didMoveToSuperview];+ [self setTintColor:_customTintColor];+}+ - (void)didMoveToWindow { [super didMoveToWindow];@@ -221,4 +228,50 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) } } +// Fix for https://github.com/facebook/react-native/issues/43388+// A bug in iOS 17.4 causes the haptic to not play when refreshing if the tintColor+// is set before the refresh control gets added to the scrollview. We'll call this+// function whenever the superview changes. We'll also call it if the value of customTintColor+// changes.+- (void)setTintColor:(UIColor *)tintColor+{+ if ([self.superview isKindOfClass:[UIScrollView class]] && self.tintColor != tintColor) {+ [super setTintColor:tintColor];+ }+}++// This method is used by Bluesky's ExpoScrollForwarder. This allows other React Native+// libraries to perform a refresh of a scrollview and access the refresh control's onRefresh+// function.+- (void)forwarderBeginRefreshing+{+ _refreshingProgrammatically = NO;++ [self sizeToFit];++ if (!self.scrollView) {+ return;+ }++ UIScrollView *scrollView = (UIScrollView *)self.scrollView;++ [UIView animateWithDuration:0.3+ delay:0+ options:UIViewAnimationOptionBeginFromCurrentState+ animations:^(void) {+ // Whenever we call this method, the scrollview will always be at a position of+ // -130 or less. Scrolling back to -65 simulates the default behavior of RCTRefreshControl+ [scrollView setContentOffset:CGPointMake(0, -65)];+ }+ completion:^(__unused BOOL finished) {+ [super beginRefreshing];+ [self setCurrentRefreshingState:super.refreshing];++ if (self->_onRefresh) {+ self->_onRefresh(nil);+ }+ }+ ];+}+ @enddiff --git a/React/Views/RefreshControl/RCTRefreshControlManager.m b/React/Views/RefreshControl/RCTRefreshControlManager.mindex 40aaf9c51ebda9fedb1d1db2e9aacec84b4c39c8..1c60164b69762997b3369b46609a07768a06bad3 100644--- a/React/Views/RefreshControl/RCTRefreshControlManager.m+++ b/React/Views/RefreshControl/RCTRefreshControlManager.m@@ -22,11 +22,12 @@ RCT_EXPORT_MODULE() RCT_EXPORT_VIEW_PROPERTY(onRefresh, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(refreshing, BOOL)-RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor) RCT_EXPORT_VIEW_PROPERTY(title, NSString) RCT_EXPORT_VIEW_PROPERTY(titleColor, UIColor) RCT_EXPORT_VIEW_PROPERTY(progressViewOffset, CGFloat) +RCT_REMAP_VIEW_PROPERTY(tintColor, customTintColor, UIColor)+ RCT_EXPORT_METHOD(setNativeRefreshing : (nonnull NSNumber *)viewTag toRefreshing : (BOOL)refreshing) { [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt b/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.ktindex 8b6571698fc5dd091a0d8980a33bb40295faf305..27c97bfeb6f13907c89f1d85f2bb8b8af7bdfb43 100644--- a/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt+++ b/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt@@ -313,8 +313,9 @@ public open class JavaTimerManager( // We also capture the idleCallbackRunnable to tentatively fix: // https://github.com/facebook/react-native/issues/44842 currentIdleCallbackRunnable?.cancel()- currentIdleCallbackRunnable = IdleCallbackRunnable(frameTimeNanos)- reactApplicationContext.runOnJSQueueThread(currentIdleCallbackRunnable)+ val idleCallbackRunnable = IdleCallbackRunnable(frameTimeNanos)+ currentIdleCallbackRunnable = idleCallbackRunnable+ reactApplicationContext.runOnJSQueueThread(idleCallbackRunnable) reactChoreographer.postFrameCallback(ReactChoreographer.CallbackType.IDLE_EVENT, this) } }diff --git a/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeAgentDelegate.cpp b/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeAgentDelegate.cppindex 66a91c91c6463e133342d33aa054e750bb32c047..021084bffe1b2e9f0ca4e7932dca2ea25904ffd7 100644--- a/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeAgentDelegate.cpp+++ b/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeAgentDelegate.cpp@@ -111,6 +111,8 @@ HermesRuntimeAgentDelegate::HermesRuntimeAgentDelegate( runtimeTargetDelegate, std::move(runtimeExecutor))) {} +HermesRuntimeAgentDelegate::~HermesRuntimeAgentDelegate() = default;+ bool HermesRuntimeAgentDelegate::handleRequest( const cdp::PreparsedRequest& req) { return impl_->handleRequest(req);diff --git a/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeAgentDelegate.h b/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeAgentDelegate.hindex d38e86358ca2266de08bedcb4629a7ca9ada8ac6..735802995e4bf51a3bc45b3a38a99098a60b915a 100644--- a/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeAgentDelegate.h+++ b/ReactCommon/hermes/inspector-modern/chrome/HermesRuntimeAgentDelegate.h@@ -56,6 +56,8 @@ class HermesRuntimeAgentDelegate : public RuntimeAgentDelegate { HermesRuntimeTargetDelegate& runtimeTargetDelegate, RuntimeExecutor runtimeExecutor); + ~HermesRuntimeAgentDelegate() override;+ /** * Handle a CDP request. The response will be sent over the provided * \c FrontendChannel synchronously or asynchronously.diff --git a/third-party-podspecs/fmt.podspec b/third-party-podspecs/fmt.podspecindex 2f38990e226c13f483aaf1b986302d4094243814..9b02e481e290299be20a6f09c42056ff51695e9b 100644--- a/third-party-podspecs/fmt.podspec+++ b/third-party-podspecs/fmt.podspec@@ -26,4 +26,11 @@ Pod::Spec.new do |spec| spec.public_header_files = "include/fmt/*.h" spec.header_mappings_dir = "include" spec.source_files = ["include/fmt/*.h", "src/format.cc"]++ # TODO: Remove after upgrading React Native past 0.83.x+ # Fix fmt 11.0.2 consteval build error with Xcode 26.4 (facebook/react-native#55601)+ # Fixed in RN 0.84+ which bumps fmt to a compatible version.+ spec.prepare_command = <<~SCRIPT+ perl -i -pe 's/^# define FMT_USE_CONSTEVAL 1$/# define FMT_USE_CONSTEVAL 0/' include/fmt/base.h+ SCRIPT end