diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js index 2f47b2a..a6fa392 100644 --- a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js +++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js @@ -12,7 +12,7 @@ */ 'use strict'; - +import defrost from '@d11/de-frost' if (__DEV__) { (function() { @@ -30,6 +30,11 @@ if ( var React = require("react"); require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); +var updatedComponents = []; +var updatedComponentForProfiler = null; +function insertUpdateComponents(componentName, flags, key) { + updatedComponents.push({componentName, flags, key}); +} var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"); var Scheduler = require("scheduler"); @@ -17250,7 +17255,12 @@ function completeWork(current, workInProgress, renderLanes) { // for hydration. popTreeContext(workInProgress); - + if (workInProgress.flags & 1&& (workInProgress.type?.displayName || workInProgress.type?.name) !=="View") + insertUpdateComponents( + getComponentNameFromFiber(workInProgress), + workInProgress.flags, + workInProgress.key, + ); switch (workInProgress.tag) { case IndeterminateComponent: case LazyComponent: @@ -20053,6 +20063,10 @@ function requestRetryLane(fiber) { } function scheduleUpdateOnFiber(root, fiber, lane, eventTime) { + updatedComponentForProfiler = { + name: getComponentNameFromFiber(fiber), + key: fiber.key, + }; checkForNestedUpdates(); { @@ -21257,7 +21271,9 @@ function commitRoot(root, recoverableErrors, transitions) { // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig$2.transition; - + defrost.writeInLogFiles(Date.now()+"",{list:updatedComponents, change:updatedComponentForProfiler}) + updatedComponents=[] + updatedComponentForProfiler=null try { ReactCurrentBatchConfig$2.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js index 7821c74..ede61a2 100644 --- a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js +++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js @@ -13,9 +13,15 @@ "use strict"; require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); +import defrost from '@d11/de-frost' var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"), React = require("react"), Scheduler = require("scheduler"); + var updatedComponents = []; + var updatedComponentForProfiler = null; + function insertUpdateComponents(componentName, flags, key) { + updatedComponents.push({componentName, flags, key}); + } function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) { var funcArgs = Array.prototype.slice.call(arguments, 3); try { @@ -5550,6 +5556,12 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); + if (workInProgress.flags & 1&& (workInProgress.type?.displayName || workInProgress.type?.name) !=="View") + insertUpdateComponents( + getComponentNameFromFiber(workInProgress), + workInProgress.flags, + workInProgress.key, + ); switch (workInProgress.tag) { case 2: case 16: @@ -6465,6 +6477,10 @@ function requestUpdateLane(fiber) { return fiber; } function scheduleUpdateOnFiber(root, fiber, lane, eventTime) { + updatedComponentForProfiler = { + name: getComponentNameFromFiber(fiber), + key: fiber.key, + }; if (50 < nestedUpdateCount) throw ((nestedUpdateCount = 0), (rootWithNestedUpdates = null), @@ -7182,6 +7198,9 @@ function completeUnitOfWork(unitOfWork) { 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } function commitRoot(root, recoverableErrors, transitions) { + defrost.writeInLogFiles(Date.now()+"",{list:updatedComponents, change:updatedComponentForProfiler}) + updatedComponents=[] + updatedComponentForProfiler=null var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig$2.transition; try { diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js index 6c7116e..819c24d 100644 --- a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js @@ -12,7 +12,7 @@ */ 'use strict'; - +import defrost from '@d11/de-frost' if (__DEV__) { (function() { @@ -30,6 +30,11 @@ if ( var React = require("react"); require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); +var updatedComponents = []; +var updatedComponentForProfiler = null; +function insertUpdateComponents(componentName, flags, key) { + updatedComponents.push({componentName, flags, key}); +} var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"); var Scheduler = require("scheduler"); @@ -17172,7 +17177,12 @@ function completeWork(current, workInProgress, renderLanes) { // to the current tree provider fiber is just as fast and less error-prone. // Ideally we would have a special version of the work loop only // for hydration. - + if (workInProgress.flags & 1&& (workInProgress.type?.displayName || workInProgress.type?.name) !=="View") + insertUpdateComponents( + getComponentNameFromFiber(workInProgress), + workInProgress.flags, + workInProgress.key, + ); popTreeContext(workInProgress); switch (workInProgress.tag) { @@ -20382,6 +20392,10 @@ function requestRetryLane(fiber) { } function scheduleUpdateOnFiber(root, fiber, lane, eventTime) { + updatedComponentForProfiler = { + name: getComponentNameFromFiber(fiber), + key: fiber.key, + }; checkForNestedUpdates(); { @@ -21586,7 +21600,9 @@ function commitRoot(root, recoverableErrors, transitions) { // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig$2.transition; - + defrost.writeInLogFiles(Date.now()+"",{list:updatedComponents, change:updatedComponentForProfiler}) + updatedComponents=[] + updatedComponentForProfiler=null try { ReactCurrentBatchConfig$2.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js index 2bdbbc1..cce6e46 100644 --- a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js @@ -12,10 +12,16 @@ */ "use strict"; +import defrost from '@d11/de-frost' require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore"); var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"), React = require("react"), Scheduler = require("scheduler"); +var updatedComponents = []; +var updatedComponentForProfiler = null; +function insertUpdateComponents(componentName, flags, key) { + updatedComponents.push({componentName, flags, key}); +} function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) { var funcArgs = Array.prototype.slice.call(arguments, 3); try { @@ -5381,6 +5387,12 @@ function bubbleProperties(completedWork) { function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; popTreeContext(workInProgress); + if (workInProgress.flags & 1&& (workInProgress.type?.displayName || workInProgress.type?.name) !=="View") + insertUpdateComponents( + getComponentNameFromFiber(workInProgress), + workInProgress.flags, + workInProgress.key, + ); switch (workInProgress.tag) { case 2: case 16: @@ -5515,9 +5527,6 @@ function completeWork(current, workInProgress, renderLanes) { throw Error( "A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React." ); - throw Error( - "Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue." - ); } 0 === (workInProgress.flags & 128) && (workInProgress.memoizedState = null); @@ -6629,6 +6638,10 @@ function requestUpdateLane(fiber) { return 0 !== fiber ? fiber : 16; } function scheduleUpdateOnFiber(root, fiber, lane, eventTime) { + updatedComponentForProfiler = { + name: getComponentNameFromFiber(fiber), + key: fiber.key, + }; if (50 < nestedUpdateCount) throw ((nestedUpdateCount = 0), (rootWithNestedUpdates = null), @@ -7346,6 +7359,9 @@ function completeUnitOfWork(unitOfWork) { 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } function commitRoot(root, recoverableErrors, transitions) { + defrost.writeInLogFiles(Date.now()+"",{list:updatedComponents, change:updatedComponentForProfiler}) + updatedComponents=[] + updatedComponentForProfiler=null var previousUpdateLanePriority = currentUpdatePriority, prevTransition = ReactCurrentBatchConfig$2.transition; try { diff --git a/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m b/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m index 2929f2d..f53a620 100644 --- a/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m +++ b/node_modules/react-native/React/Views/ScrollView/RCTScrollView.m @@ -272,6 +272,8 @@ @implementation RCTScrollView { uint16_t _coalescingKey; NSString *_lastEmittedEventName; NSHashTable *_scrollListeners; + BOOL _isScrollBeginFired; + BOOL _isScrollEndFired; } - (void)_registerKeyboardListener @@ -379,6 +381,9 @@ - (instancetype)initWithEventDispatcher:(id)eventDis _cachedChildFrames = [NSMutableArray new]; _scrollListeners = [NSHashTable weakObjectsHashTable]; + _isScrollBeginFired = NO; + _isScrollEndFired = NO; + [self addSubview:_scrollView]; } @@ -629,7 +634,6 @@ -(void)delegateMethod : (UIScrollView *)scrollView \ RCT_FORWARD_SCROLL_EVENT(delegateMethod : scrollView); \ } -RCT_SCROLL_EVENT_HANDLER(scrollViewWillBeginDecelerating, onMomentumScrollBegin) RCT_SCROLL_EVENT_HANDLER(scrollViewDidZoom, onScroll) RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop) @@ -673,6 +677,27 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView RCT_FORWARD_SCROLL_EVENT(scrollViewWillBeginDragging : scrollView); } +- (void)didMoveToWindow { + [super didMoveToWindow]; + if (self.window == nil) { + if(_isScrollBeginFired == YES && _isScrollEndFired == NO) { + // Fire the end deceleration event + RCT_SEND_SCROLL_EVENT(onMomentumScrollEnd, nil); + RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndDecelerating : _scrollView); + _isScrollEndFired = YES; + _isScrollBeginFired = NO; + } + } +} + +- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView +{ + _isScrollBeginFired = YES; + _isScrollEndFired = NO; + RCT_SEND_SCROLL_EVENT(onMomentumScrollBegin, nil); + RCT_FORWARD_SCROLL_EVENT(scrollViewWillBeginDecelerating : scrollView); +} + - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset @@ -833,7 +858,10 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView _allowNextScrollNoMatterWhat = YES; [self scrollViewDidScroll:scrollView]; - // Fire the end deceleration event + _isScrollEndFired = YES; + _isScrollBeginFired = NO; + +// Fire the end deceleration event RCT_SEND_SCROLL_EVENT(onMomentumScrollEnd, nil); RCT_FORWARD_SCROLL_EVENT(scrollViewDidEndDecelerating : scrollView); } diff --git a/node_modules/react-native/scripts/react_native_pods.rb b/node_modules/react-native/scripts/react_native_pods.rb index 0c28e68..32af320 100644 --- a/node_modules/react-native/scripts/react_native_pods.rb +++ b/node_modules/react-native/scripts/react_native_pods.rb @@ -246,7 +246,7 @@ def react_native_post_install( ReactNativePodsUtils.update_search_paths(installer) ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path) ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled) - ReactNativePodsUtils.apply_xcode_15_patch(installer) + # ReactNativePodsUtils.apply_xcode_15_patch(installer) ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer) NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)