@office-iss/react-native-win32 0.67.0-preview.2 → 0.68.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -1
- package/.flowconfig +9 -2
- package/CHANGELOG.json +387 -17
- package/CHANGELOG.md +148 -12
- package/IntegrationTests/AccessibilityManagerTest.js +1 -1
- package/IntegrationTests/AppEventsTest.js +2 -1
- package/IntegrationTests/AsyncStorageTest.js +8 -6
- package/IntegrationTests/GlobalEvalWithSourceUrlTest.js +1 -1
- package/IntegrationTests/ImageCachePolicyTest.js +1 -1
- package/IntegrationTests/ImageSnapshotTest.js +1 -1
- package/IntegrationTests/IntegrationTestHarnessTest.js +8 -6
- package/IntegrationTests/IntegrationTestsApp.js +3 -9
- package/IntegrationTests/LayoutEventsTest.js +1 -1
- package/IntegrationTests/LoggingTestModule.js +8 -8
- package/IntegrationTests/PromiseTest.js +1 -1
- package/IntegrationTests/PropertiesUpdateTest.js +1 -1
- package/IntegrationTests/RCTRootViewIntegrationTestApp.js +3 -9
- package/IntegrationTests/ReactContentSizeUpdateTest.js +1 -1
- package/IntegrationTests/SimpleSnapshotTest.js +1 -1
- package/IntegrationTests/SizeFlexibilityUpdateTest.js +1 -1
- package/IntegrationTests/SyncMethodTest.js +1 -1
- package/IntegrationTests/TimersTest.js +1 -1
- package/IntegrationTests/WebSocketTest.js +2 -2
- package/IntegrationTests/launchWebSocketServer.command +1 -1
- package/IntegrationTests/websocket_integration_test_server.js +1 -1
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +4 -4
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -1
- package/Libraries/Alert/Alert.js +4 -4
- package/Libraries/Alert/Alert.win32.js +3 -3
- package/Libraries/Alert/NativeAlertManager.js +1 -1
- package/Libraries/Alert/RCTAlertManager.android.js +2 -2
- package/Libraries/Alert/RCTAlertManager.ios.js +1 -1
- package/Libraries/Animated/Animated.js +1 -1
- package/Libraries/Animated/AnimatedEvent.js +11 -6
- package/Libraries/Animated/AnimatedImplementation.js +116 -85
- package/Libraries/Animated/AnimatedMock.js +65 -22
- package/Libraries/{Components/Touchable/__mocks__/ensureComponentIsNative.js → Animated/AnimatedPlatformConfig.js} +3 -2
- package/Libraries/Animated/AnimatedWeb.js +1 -1
- package/Libraries/Animated/Easing.js +38 -40
- package/Libraries/Animated/NativeAnimatedHelper.js +24 -21
- package/Libraries/Animated/NativeAnimatedModule.js +1 -1
- package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -1
- package/Libraries/Animated/SpringConfig.js +11 -11
- package/Libraries/Animated/animations/Animation.js +6 -4
- package/Libraries/Animated/animations/DecayAnimation.js +6 -1
- package/Libraries/Animated/animations/SpringAnimation.js +16 -1
- package/Libraries/Animated/animations/TimingAnimation.js +15 -2
- package/Libraries/Animated/bezier.js +20 -9
- package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
- package/Libraries/Animated/components/AnimatedImage.js +1 -1
- package/Libraries/Animated/components/AnimatedScrollView.js +1 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +1 -1
- package/Libraries/Animated/components/AnimatedText.js +1 -1
- package/Libraries/Animated/components/AnimatedView.js +1 -1
- package/Libraries/Animated/createAnimatedComponent.js +4 -4
- package/Libraries/Animated/createAnimatedComponentInjection.js +1 -1
- package/Libraries/Animated/createAnimatedComponent_EXPERIMENTAL.js +1 -1
- package/Libraries/Animated/nodes/AnimatedAddition.js +6 -5
- package/Libraries/Animated/nodes/AnimatedColor.js +266 -0
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +5 -4
- package/Libraries/Animated/nodes/AnimatedDivision.js +6 -5
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +8 -6
- package/Libraries/Animated/nodes/AnimatedModulo.js +5 -4
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +6 -5
- package/Libraries/Animated/nodes/AnimatedNode.js +31 -18
- package/Libraries/Animated/nodes/AnimatedProps.js +12 -4
- package/Libraries/Animated/nodes/AnimatedStyle.js +9 -7
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +6 -5
- package/Libraries/Animated/nodes/AnimatedTracking.js +8 -6
- package/Libraries/Animated/nodes/AnimatedTransform.js +6 -4
- package/Libraries/Animated/nodes/AnimatedValue.js +21 -12
- package/Libraries/Animated/nodes/AnimatedValueXY.js +14 -14
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +6 -5
- package/Libraries/Animated/useAnimatedProps.js +1 -1
- package/Libraries/AppState/AppState.js +9 -8
- package/Libraries/AppState/NativeAppState.js +1 -1
- package/Libraries/BatchedBridge/BatchedBridge.js +1 -1
- package/Libraries/BatchedBridge/MessageQueue.js +7 -9
- package/Libraries/BatchedBridge/NativeModules.js +1 -1
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js +1 -1
- package/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js +3 -3
- package/Libraries/Blob/Blob.js +1 -1
- package/Libraries/Blob/BlobManager.js +1 -1
- package/Libraries/Blob/BlobRegistry.js +1 -1
- package/Libraries/Blob/BlobTypes.js +1 -1
- package/Libraries/Blob/File.js +1 -1
- package/Libraries/Blob/FileReader.js +1 -1
- package/Libraries/Blob/NativeBlobModule.js +1 -1
- package/Libraries/Blob/NativeFileReaderModule.js +1 -1
- package/Libraries/Blob/URL.js +26 -21
- package/Libraries/Blob/__mocks__/BlobModule.js +1 -1
- package/Libraries/Blob/__mocks__/FileReaderModule.js +1 -1
- package/Libraries/BugReporting/BugReporting.js +1 -1
- package/Libraries/BugReporting/NativeBugReporting.js +1 -1
- package/Libraries/BugReporting/dumpReactTree.js +1 -1
- package/Libraries/BugReporting/getReactData.js +15 -6
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +89 -29
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +95 -35
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js +4 -1
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js +5 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.android.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.ios.js +1 -1
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.win32.js +1 -1
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +1 -1
- package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +5 -5
- package/Libraries/Components/Button.js +1 -1
- package/Libraries/Components/Clipboard/Clipboard.js +1 -1
- package/Libraries/Components/Clipboard/NativeClipboard.js +1 -1
- package/Libraries/Components/DatePicker/DatePickerIOS.android.js +1 -1
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +18 -2
- package/Libraries/Components/DatePicker/DatePickerIOS.win32.js +1 -1
- package/Libraries/Components/DatePicker/RCTDatePickerNativeComponent.js +1 -1
- package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +1 -1
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +3 -3
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +5 -4
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +1 -1
- package/Libraries/Components/Keyboard/Keyboard.js +9 -8
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +11 -6
- package/Libraries/Components/Keyboard/NativeKeyboardObserver.js +1 -1
- package/Libraries/Components/MaskedView/MaskedViewIOS.android.js +1 -1
- package/Libraries/Components/MaskedView/MaskedViewIOS.ios.js +1 -1
- package/Libraries/Components/MaskedView/MaskedViewIOS.win32.js +1 -1
- package/Libraries/Components/MaskedView/RCTMaskedViewNativeComponent.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +38 -2
- package/Libraries/Components/Pressable/Pressable.win32.js +384 -0
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +1 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +6 -5
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios.js +1 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +1 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +1 -1
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js +1 -1
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +3 -2
- package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.win32.js +1 -1
- package/Libraries/Components/ProgressViewIOS/RCTProgressViewNativeComponent.js +1 -1
- package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +1 -2
- package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +1 -1
- package/Libraries/Components/RefreshControl/RefreshControl.js +3 -8
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +3 -4
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -1
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +3 -3
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +3 -1
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +16 -6
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +4 -6
- package/Libraries/Components/ScrollView/ScrollView.js +22 -15
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewContext.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +135 -71
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +2 -1
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +2 -2
- package/Libraries/Components/ScrollView/ScrollViewViewConfig.js +2 -1
- package/Libraries/Components/ScrollView/processDecelerationRate.js +1 -1
- package/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +1 -1
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +1 -1
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +3 -9
- package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.js +1 -1
- package/Libraries/Components/Slider/Slider.js +1 -1
- package/Libraries/Components/Slider/SliderNativeComponent.js +3 -3
- package/Libraries/Components/Sound/NativeSoundManager.js +1 -1
- package/Libraries/Components/Sound/SoundManager.js +2 -2
- package/Libraries/Components/StaticRenderer.js +1 -1
- package/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js +1 -1
- package/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +1 -1
- package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +1 -1
- package/Libraries/Components/Switch/Switch.js +1 -1
- package/Libraries/Components/Switch/SwitchNativeComponent.js +1 -1
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +175 -14
- package/Libraries/Components/TextInput/InputAccessoryView.js +1 -1
- package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +1 -1
- package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +10 -5
- package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +6 -5
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +32 -11
- package/Libraries/Components/TextInput/TextInput.js +131 -31
- package/Libraries/Components/TextInput/TextInputNativeCommands.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
- package/Libraries/Components/ToastAndroid/NativeToastAndroid.js +1 -1
- package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +4 -4
- package/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +4 -4
- package/Libraries/Components/ToastAndroid/ToastAndroid.win32.js +4 -4
- package/Libraries/Components/Touchable/BoundingDimensions.js +3 -3
- package/Libraries/Components/Touchable/PooledClass.js +12 -12
- package/Libraries/Components/Touchable/Position.js +2 -2
- package/Libraries/Components/Touchable/Touchable.js +27 -40
- package/Libraries/Components/Touchable/TouchableBounce.js +3 -6
- package/Libraries/Components/Touchable/TouchableHighlight.js +3 -6
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +5 -12
- package/Libraries/Components/Touchable/TouchableOpacity.js +3 -7
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +3 -6
- package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +1 -1
- package/Libraries/Components/UnimplementedViews/UnimplementedView.js +1 -1
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -1
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -1
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -1
- package/Libraries/Components/View/ReactNativeViewViewConfig.js +13 -2
- package/Libraries/Components/View/ReactNativeViewViewConfig.win32.js +13 -2
- package/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +1 -1
- package/Libraries/Components/View/View.js +1 -1
- package/Libraries/Components/View/View.win32.js +60 -4
- package/Libraries/Components/View/ViewAccessibility.js +1 -1
- package/Libraries/Components/View/ViewNativeComponent.js +4 -5
- package/Libraries/Components/View/ViewPropTypes.js +38 -31
- package/Libraries/Components/View/ViewPropTypes.win32.js +553 -0
- package/Libraries/Core/Devtools/getDevServer.js +1 -1
- package/Libraries/Core/Devtools/openFileInEditor.js +1 -1
- package/Libraries/Core/Devtools/openURLInBrowser.js +1 -1
- package/Libraries/Core/Devtools/parseErrorStack.js +1 -1
- package/Libraries/Core/Devtools/parseHermesStack.js +3 -2
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +3 -3
- package/Libraries/Core/ExtendedError.js +1 -1
- package/Libraries/Core/InitializeCore.js +1 -3
- package/Libraries/Core/NativeExceptionsManager.js +3 -4
- package/Libraries/Core/ReactFiberErrorDialog.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/ReactNativeVersionCheck.js +12 -2
- package/Libraries/Core/ReactNativeVersionCheck.win32.js +12 -2
- package/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js +1 -1
- package/Libraries/Core/Timers/JSTimers.js +35 -42
- package/Libraries/Core/Timers/NativeTiming.js +1 -1
- package/Libraries/Core/Timers/immediateShim.js +1 -1
- package/Libraries/Core/Timers/queueMicrotask.js +1 -1
- package/Libraries/Core/__mocks__/ErrorUtils.js +1 -1
- package/Libraries/Core/checkNativeVersion.js +1 -1
- package/Libraries/Core/polyfillPromise.js +1 -1
- package/Libraries/Core/setUpAlert.js +2 -2
- package/Libraries/Core/setUpBatchedBridge.js +15 -3
- package/Libraries/Core/setUpDeveloperTools.js +2 -2
- package/Libraries/Core/setUpErrorHandling.js +2 -2
- package/Libraries/Core/setUpGlobals.js +1 -1
- package/Libraries/Core/setUpNavigator.js +1 -1
- package/Libraries/Core/setUpPerformance.js +2 -2
- package/Libraries/Core/setUpReactDevTools.js +1 -1
- package/Libraries/Core/setUpReactRefresh.js +1 -1
- package/Libraries/Core/setUpRegeneratorRuntime.js +2 -2
- package/Libraries/Core/setUpSegmentFetcher.js +5 -5
- package/Libraries/Core/setUpSystrace.js +1 -1
- package/Libraries/Core/setUpTimers.js +12 -2
- package/Libraries/Core/setUpXHR.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +3 -2
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +1 -1
- package/Libraries/EventEmitter/RCTEventEmitter.js +1 -1
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +1 -1
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -2
- package/Libraries/HeapCapture/HeapCapture.js +2 -2
- package/Libraries/HeapCapture/NativeJSCHeapCapture.js +1 -1
- package/Libraries/Image/AssetRegistry.js +1 -1
- package/Libraries/Image/AssetSourceResolver.js +3 -5
- package/Libraries/Image/AssetUtils.js +1 -1
- package/Libraries/Image/Image.android.js +38 -30
- package/Libraries/Image/Image.ios.js +17 -20
- package/Libraries/Image/Image.win32.js +19 -22
- package/Libraries/Image/ImageAnalyticsTagContext.js +3 -4
- package/Libraries/Image/ImageBackground.js +11 -2
- package/Libraries/Image/ImageInjection.js +1 -1
- package/Libraries/Image/ImagePickerIOS.js +7 -7
- package/Libraries/Image/ImageProps.js +18 -18
- package/Libraries/Image/ImageResizeMode.js +1 -1
- package/Libraries/Image/ImageSource.js +1 -1
- package/Libraries/Image/ImageViewNativeComponent.js +96 -61
- package/Libraries/Image/NativeImageEditor.js +1 -1
- package/Libraries/Image/NativeImageLoaderAndroid.js +2 -4
- package/Libraries/Image/NativeImageLoaderIOS.js +1 -1
- package/Libraries/Image/NativeImageLoaderWin32.js +1 -1
- package/Libraries/Image/NativeImagePickerIOS.js +1 -1
- package/Libraries/Image/NativeImageStoreAndroid.js +1 -1
- package/Libraries/Image/NativeImageStoreIOS.js +1 -1
- package/Libraries/Image/RelativeImageStub.js +1 -1
- package/Libraries/Image/TextInlineImageNativeComponent.js +14 -74
- package/Libraries/Image/nativeImageSource.js +3 -3
- package/Libraries/Image/resolveAssetSource.js +1 -1
- package/Libraries/Image/resolveAssetSource.win32.js +1 -1
- package/Libraries/Inspector/BorderBox.js +1 -1
- package/Libraries/Inspector/BoxInspector.js +1 -1
- package/Libraries/Inspector/ElementBox.js +1 -1
- package/Libraries/Inspector/ElementProperties.js +1 -1
- package/Libraries/Inspector/Inspector.js +2 -2
- package/Libraries/Inspector/Inspector.win32.js +7 -7
- package/Libraries/Inspector/InspectorOverlay.js +1 -1
- package/Libraries/Inspector/InspectorOverlay.win32.js +1 -1
- package/Libraries/Inspector/InspectorPanel.js +1 -1
- package/Libraries/Inspector/NetworkOverlay.js +3 -6
- package/Libraries/Inspector/PerformanceOverlay.js +1 -1
- package/Libraries/Inspector/StyleInspector.js +1 -1
- package/Libraries/Inspector/resolveBoxStyle.js +1 -1
- package/Libraries/Interaction/Batchinator.js +1 -1
- package/Libraries/Interaction/BridgeSpyStallHandler.js +2 -2
- package/Libraries/Interaction/FrameRateLogger.js +3 -3
- package/Libraries/Interaction/InteractionManager.js +3 -5
- package/Libraries/Interaction/InteractionStallDebugger.js +1 -1
- package/Libraries/Interaction/JSEventLoopWatchdog.js +5 -5
- package/Libraries/Interaction/NativeFrameRateLogger.js +1 -1
- package/Libraries/Interaction/PanResponder.js +4 -5
- package/Libraries/Interaction/TaskQueue.js +1 -1
- package/Libraries/Interaction/TouchHistoryMath.js +8 -8
- package/Libraries/JSInspector/InspectorAgent.js +1 -1
- package/Libraries/JSInspector/JSInspector.js +1 -1
- package/Libraries/JSInspector/NetworkAgent.js +2 -7
- package/Libraries/LayoutAnimation/LayoutAnimation.js +4 -4
- package/Libraries/Linking/Linking.js +8 -8
- package/Libraries/Linking/NativeIntentAndroid.js +1 -1
- package/Libraries/Linking/NativeLinkingManager.js +1 -1
- package/Libraries/Lists/CellRenderMask.js +1 -1
- package/Libraries/Lists/FillRateHelper.js +5 -4
- package/Libraries/Lists/FlatList.js +4 -5
- package/Libraries/Lists/SectionList.js +4 -4
- package/Libraries/Lists/SectionListModern.js +4 -4
- package/Libraries/Lists/ViewabilityHelper.js +5 -11
- package/Libraries/Lists/VirtualizeUtils.js +3 -7
- package/Libraries/Lists/VirtualizedList.js +23 -33
- package/Libraries/Lists/VirtualizedListContext.js +3 -4
- package/Libraries/Lists/VirtualizedSectionList.js +54 -63
- package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +1 -1
- package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
- package/Libraries/Lists/__tests__/CellRenderMask-test.js +1 -1
- package/Libraries/Lists/__tests__/{FillRateHelper-test.js → FillRateHelper-test.windows.js} +8 -8
- package/Libraries/Lists/__tests__/{FlatList-test.js → FlatList-test.windows.js} +3 -3
- package/Libraries/Lists/__tests__/{SectionList-test.js → SectionList-test.windows.js} +15 -15
- package/Libraries/Lists/__tests__/ViewabilityHelper-test.js +15 -15
- package/Libraries/Lists/__tests__/{VirtualizeUtils-test.js → VirtualizeUtils-test.windows.js} +19 -22
- package/Libraries/Lists/__tests__/{VirtualizedList-test.js → VirtualizedList-test.windows.js} +32 -32
- package/Libraries/Lists/__tests__/{VirtualizedSectionList-test.js → VirtualizedSectionList-test.windows.js} +15 -15
- package/Libraries/LogBox/Data/LogBoxData.js +2 -2
- package/Libraries/LogBox/Data/LogBoxLog.js +1 -1
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +13 -24
- package/Libraries/LogBox/LogBox.js +4 -4
- package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
- package/Libraries/LogBox/LogBoxNotificationContainer.js +1 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +10 -5
- package/Libraries/LogBox/UI/LogBoxButton.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspector.js +4 -2
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorSection.js +1 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +1 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.win32.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +4 -2
- package/Libraries/LogBox/UI/LogBoxMessage.js +7 -3
- package/Libraries/LogBox/UI/LogBoxNotification.js +7 -4
- package/Libraries/LogBox/UI/LogBoxStyle.js +1 -1
- package/Libraries/LogBox/UI/LogBoxStyle.win32.js +1 -1
- package/Libraries/Modal/Modal.js +15 -14
- package/Libraries/Modal/ModalInjection.js +1 -1
- package/Libraries/Modal/NativeModalManager.js +1 -1
- package/Libraries/Modal/RCTModalHostViewNativeComponent.js +12 -12
- package/Libraries/NativeComponent/NativeComponentRegistry.js +30 -33
- package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +27 -0
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +198 -0
- package/Libraries/NativeComponent/ViewConfig.js +1 -1
- package/Libraries/NativeModules/specs/NativeAnimationsDebugModule.js +1 -1
- package/Libraries/NativeModules/specs/NativeDevMenu.js +1 -1
- package/Libraries/NativeModules/specs/NativeDevSettings.js +1 -1
- package/Libraries/NativeModules/specs/NativeDeviceEventManager.js +1 -1
- package/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js +1 -1
- package/Libraries/NativeModules/specs/NativeLogBox.js +1 -1
- package/Libraries/NativeModules/specs/NativeRedBox.js +1 -1
- package/Libraries/NativeModules/specs/NativeSourceCode.js +1 -1
- package/Libraries/Network/FormData.js +1 -1
- package/Libraries/Network/NativeNetworkingAndroid.js +1 -1
- package/Libraries/Network/NativeNetworkingIOS.js +1 -1
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.win32.js +2 -2
- package/Libraries/Network/XHRInterceptor.js +6 -7
- package/Libraries/Network/XMLHttpRequest.js +44 -8
- package/Libraries/Network/convertRequestBody.js +1 -1
- package/Libraries/Network/fetch.js +1 -1
- package/Libraries/NewAppScreen/components/Colors.js +1 -1
- package/Libraries/NewAppScreen/components/DebugInstructions.js +1 -1
- package/Libraries/NewAppScreen/components/Header.js +1 -1
- package/Libraries/NewAppScreen/components/HermesBadge.js +1 -1
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +1 -1
- package/Libraries/NewAppScreen/components/ReloadInstructions.js +1 -1
- package/Libraries/NewAppScreen/index.js +1 -1
- package/Libraries/Performance/NativeJSCSamplingProfiler.js +1 -1
- package/Libraries/Performance/PureComponentDebug.js +1 -1
- package/Libraries/Performance/QuickPerformanceLogger.js +18 -1
- package/Libraries/Performance/SamplingProfiler.js +4 -4
- package/Libraries/Performance/Systrace.js +9 -2
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +7 -2
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +20 -9
- package/Libraries/Pressability/HoverState.js +1 -1
- package/Libraries/Pressability/HoverState.win32.js +60 -0
- package/Libraries/Pressability/Pressability.js +3 -3
- package/Libraries/Pressability/Pressability.win32.js +962 -0
- package/Libraries/Pressability/PressabilityDebug.js +15 -12
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +5 -3
- package/Libraries/Pressability/PressabilityTypes.js +1 -1
- package/Libraries/Pressability/usePressability.js +1 -1
- package/Libraries/Promise.js +1 -1
- package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -1
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +33 -32
- package/Libraries/ReactNative/AppContainer.js +3 -3
- package/Libraries/ReactNative/AppRegistry.js +15 -13
- package/Libraries/ReactNative/DisplayMode.js +1 -1
- package/Libraries/ReactNative/DummyUIManager.js +13 -6
- package/Libraries/ReactNative/FabricUIManager.js +1 -1
- package/Libraries/ReactNative/HeadlessJsTaskError.js +1 -1
- package/Libraries/ReactNative/I18nManager.js +3 -6
- package/Libraries/ReactNative/NativeHeadlessJsTaskSupport.js +1 -1
- package/Libraries/ReactNative/NativeI18nManager.js +1 -1
- package/Libraries/ReactNative/NativeUIManager.js +1 -1
- package/Libraries/ReactNative/PaperUIManager.js +3 -4
- package/Libraries/ReactNative/PaperUIManager.win32.js +8 -9
- package/Libraries/ReactNative/ReactFabricInternals.js +1 -1
- package/Libraries/ReactNative/RootTag.js +3 -4
- package/Libraries/ReactNative/UIManager.js +5 -7
- package/Libraries/ReactNative/UIManagerInjection.js +4 -2
- package/Libraries/ReactNative/UIManagerProperties.js +1 -1
- package/Libraries/ReactNative/getCachedComponentWithDebugName.js +4 -2
- package/Libraries/ReactNative/getNativeComponentAttributes.js +21 -9
- package/Libraries/ReactNative/renderApplication.js +1 -1
- package/Libraries/ReactNative/requireNativeComponent.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInitializeCore.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
- package/Libraries/Reliability/UserFlow.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +1134 -426
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +265 -236
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +538 -302
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1 -1
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +1084 -463
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +1 -1
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +251 -224
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1 -1
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +519 -281
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1 -1
- package/Libraries/Renderer/shims/ReactFabric.js +2 -2
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
- package/Libraries/Renderer/shims/ReactNative.js +2 -2
- package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -2
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -4
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
- package/Libraries/Settings/NativeSettingsManager.js +1 -1
- package/Libraries/Settings/Settings.android.js +1 -1
- package/Libraries/Settings/Settings.ios.js +1 -1
- package/Libraries/Share/NativeShareModule.js +1 -1
- package/Libraries/Share/Share.js +1 -1
- package/Libraries/Storage/AsyncStorage.js +34 -35
- package/Libraries/Storage/NativeAsyncLocalStorage.js +1 -1
- package/Libraries/Storage/NativeAsyncSQLiteDBStorage.js +1 -1
- package/Libraries/StyleSheet/EdgeInsetsPropType.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypesIOS.js +1 -1
- package/Libraries/StyleSheet/PointPropType.js +1 -1
- package/Libraries/StyleSheet/Rect.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.js +3 -2
- package/Libraries/StyleSheet/StyleSheet.win32.js +3 -2
- package/Libraries/StyleSheet/StyleSheetTypes.js +2 -2
- package/Libraries/StyleSheet/__flowtests__/StyleSheet-flowtest.js +1 -1
- package/Libraries/StyleSheet/flattenStyle.js +1 -1
- package/Libraries/StyleSheet/normalizeColor.js +1 -1
- package/Libraries/StyleSheet/processColor.js +3 -3
- package/Libraries/StyleSheet/processColorArray.js +1 -1
- package/Libraries/StyleSheet/processTransform.js +21 -2
- package/Libraries/StyleSheet/setNormalizedColorAlpha.js +1 -1
- package/Libraries/StyleSheet/splitLayoutProps.js +2 -4
- package/Libraries/Text/Text.js +11 -12
- package/Libraries/Text/TextAncestor.js +1 -1
- package/Libraries/Text/TextNativeComponent.js +10 -8
- package/Libraries/Text/TextNativeComponent.win32.js +9 -7
- package/Libraries/Text/TextProps.js +19 -19
- package/Libraries/TurboModule/RCTExport.js +1 -1
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
- package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +1 -1
- package/Libraries/Types/CodegenTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.win32.js +191 -0
- package/Libraries/Types/RootTagTypes.js +1 -1
- package/Libraries/UTFSequence.js +1 -1
- package/Libraries/Utilities/Appearance.js +7 -6
- package/Libraries/Utilities/BackHandler.android.js +5 -5
- package/Libraries/Utilities/BackHandler.ios.js +1 -1
- package/Libraries/Utilities/BackHandler.win32.js +5 -5
- package/Libraries/Utilities/DebugEnvironment.js +1 -1
- package/Libraries/Utilities/DevSettings.js +1 -1
- package/Libraries/Utilities/DeviceInfo.js +1 -1
- package/Libraries/Utilities/Dimensions.js +1 -1
- package/Libraries/Utilities/FeatureDetection.js +1 -1
- package/Libraries/Utilities/GlobalPerformanceLogger.js +1 -1
- package/Libraries/Utilities/HMRClient.js +3 -3
- package/Libraries/Utilities/HMRClientProdShim.js +1 -1
- package/Libraries/Utilities/JSDevSupportModule.js +4 -5
- package/Libraries/Utilities/LoadingView.android.js +1 -1
- package/Libraries/Utilities/LoadingView.ios.js +1 -1
- package/Libraries/Utilities/LoadingView.js +1 -1
- package/Libraries/Utilities/MatrixMath.js +20 -20
- package/Libraries/Utilities/NativeAppearance.js +1 -1
- package/Libraries/Utilities/NativeDevLoadingView.js +1 -1
- package/Libraries/Utilities/NativeDevSplitBundleLoader.js +1 -1
- package/Libraries/Utilities/NativeDeviceInfo.js +1 -1
- package/Libraries/Utilities/NativeJSDevSupport.js +1 -1
- package/Libraries/Utilities/NativePlatformConstantsAndroid.js +1 -1
- package/Libraries/Utilities/NativePlatformConstantsIOS.js +1 -1
- package/Libraries/Utilities/PerformanceLoggerContext.js +3 -4
- package/Libraries/Utilities/PixelRatio.js +1 -1
- package/Libraries/Utilities/Platform.android.js +1 -1
- package/Libraries/Utilities/Platform.ios.js +1 -1
- package/Libraries/Utilities/PolyfillFunctions.js +1 -1
- package/Libraries/Utilities/RCTLog.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +8 -12
- package/Libraries/Utilities/SceneTracker.js +5 -4
- package/Libraries/Utilities/__mocks__/BackHandler.js +4 -4
- package/Libraries/Utilities/__mocks__/GlobalPerformanceLogger.js +1 -1
- package/Libraries/Utilities/__mocks__/PixelRatio.js +1 -1
- package/Libraries/Utilities/binaryToBase64.js +1 -1
- package/Libraries/Utilities/buildStyleInterpolator.js +10 -10
- package/Libraries/Utilities/clamp.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +1 -1
- package/Libraries/Utilities/codegenNativeComponent.js +4 -3
- package/Libraries/Utilities/createPerformanceLogger.js +1 -1
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +3 -3
- package/Libraries/Utilities/defineLazyObjectProperty.js +1 -1
- package/Libraries/Utilities/deprecatedPropType.js +1 -1
- package/Libraries/Utilities/differ/deepDiffer.js +2 -2
- package/Libraries/Utilities/differ/insetsDiffer.js +2 -2
- package/Libraries/Utilities/differ/matricesDiffer.js +6 -2
- package/Libraries/Utilities/differ/pointsDiffer.js +2 -2
- package/Libraries/Utilities/differ/sizesDiffer.js +11 -5
- package/Libraries/Utilities/dismissKeyboard.js +1 -1
- package/Libraries/Utilities/groupByEveryN.js +1 -1
- package/Libraries/Utilities/infoLog.js +1 -1
- package/Libraries/Utilities/logError.js +2 -2
- package/Libraries/Utilities/mapWithSeparator.js +1 -1
- package/Libraries/Utilities/mergeIntoFast.js +2 -2
- package/Libraries/Utilities/setAndForwardRef.js +1 -1
- package/Libraries/Utilities/stringifySafe.js +1 -1
- package/Libraries/Utilities/truncate.js +2 -2
- package/Libraries/Utilities/useColorScheme.js +1 -1
- package/Libraries/Utilities/useMergeRefs.js +1 -1
- package/Libraries/Utilities/useRefEffect.js +1 -1
- package/Libraries/Utilities/useWindowDimensions.js +6 -2
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +4 -2
- package/Libraries/Utilities/warnOnce.js +1 -1
- package/Libraries/Vibration/NativeVibration.js +1 -1
- package/Libraries/Vibration/Vibration.js +6 -6
- package/Libraries/WebSocket/NativeWebSocketModule.js +1 -1
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/WebSocket/WebSocketEvent.js +1 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +7 -7
- package/Libraries/WebSocket/__mocks__/event-target-shim.js +1 -1
- package/Libraries/YellowBox/YellowBoxDeprecated.js +1 -1
- package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +2 -2
- package/Libraries/vendor/core/ErrorUtils.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +1 -1
- package/Libraries/vendor/emitter/EventSubscription.js +1 -1
- package/Libraries/vendor/emitter/_EmitterSubscription.js +3 -2
- package/Libraries/vendor/emitter/_EventEmitter.js +3 -2
- package/Libraries/vendor/emitter/_EventSubscription.js +3 -2
- package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +2 -2
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +1 -1
- package/flow/HermesInternalType.js +1 -1
- package/flow/Position.js +1 -1
- package/flow/Promise.js +1 -1
- package/flow/Stringish.js +1 -1
- package/flow/console.js +1 -1
- package/flow/global.js +2 -6
- package/flow/jest.js +1 -1
- package/flow/use-subscription.js +1 -1
- package/flow-typed/npm/glob_v7.x.x.js +79 -0
- package/index.js +26 -17
- package/index.win32.js +26 -20
- package/interface.js +1 -1
- package/jest/MockNativeMethods.js +1 -1
- package/jest/assetFileTransformer.js +3 -3
- package/jest/mockComponent.js +1 -1
- package/jest/mockModal.js +3 -3
- package/jest/mockNativeComponent.js +5 -1
- package/jest/mockScrollView.js +1 -1
- package/jest/preprocessor.js +10 -78
- package/jest/renderer.js +1 -1
- package/jest/setup.js +5 -4
- package/overrides.json +98 -63
- package/package.json +24 -23
- package/rn-get-polyfills.js +1 -1
- package/rntypes/globals.d.ts +6 -5
- package/rntypes/index.d.ts +89 -312
- package/rntypes/legacy-properties.d.ts +0 -28
- package/src/rntypes/globals.d.ts +6 -5
- package/src/rntypes/index.d.ts +89 -312
- package/src/rntypes/legacy-properties.d.ts +0 -28
- package/Libraries/Components/TextInput/AndroidTextInputViewConfig.js +0 -116
- package/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js +0 -76
- package/Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType.js +0 -28
- package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.android.js +0 -131
- package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.ios.js +0 -82
- package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.win32.js +0 -82
- package/Libraries/DeprecatedPropTypes/DeprecatedImageSourcePropType.js +0 -40
- package/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js +0 -76
- package/Libraries/DeprecatedPropTypes/DeprecatedLayoutPropTypes.js +0 -233
- package/Libraries/DeprecatedPropTypes/DeprecatedPointPropType.js +0 -24
- package/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js +0 -30
- package/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js +0 -32
- package/Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js +0 -622
- package/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js +0 -158
- package/Libraries/DeprecatedPropTypes/DeprecatedTextStylePropTypes.js +0 -157
- package/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js +0 -99
- package/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js +0 -46
- package/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js +0 -408
- package/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js +0 -68
- package/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js +0 -86
- package/flow-typed/npm/prop-types_v15.x.x.js +0 -42
- package/src/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap +0 -427
- package/src/Libraries/Lists/__tests__/__snapshots__/SectionList-test.js.snap +0 -391
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizeUtils-test.js.snap +0 -3
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap +0 -4634
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedSectionList-test.js.snap +0 -1153
|
@@ -7,14 +7,25 @@
|
|
|
7
7
|
* @noflow
|
|
8
8
|
* @nolint
|
|
9
9
|
* @preventMunge
|
|
10
|
-
* @generated SignedSource<<
|
|
10
|
+
* @generated SignedSource<<10efd73d5435b5750183622476c68681>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
15
|
if (__DEV__) {
|
|
16
16
|
(function() {
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
|
|
20
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
21
|
+
if (
|
|
22
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
23
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
24
|
+
'function'
|
|
25
|
+
) {
|
|
26
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
27
|
+
}
|
|
28
|
+
"use strict";
|
|
18
29
|
|
|
19
30
|
var React = require("react");
|
|
20
31
|
require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore");
|
|
@@ -145,7 +156,7 @@ var invokeGuardedCallbackImpl = invokeGuardedCallbackProd;
|
|
|
145
156
|
// when we call document.createEvent(). However this can cause confusing
|
|
146
157
|
// errors: https://github.com/facebook/create-react-app/issues/3482
|
|
147
158
|
// So we preemptively throw with a better message instead.
|
|
148
|
-
if (typeof document === "undefined") {
|
|
159
|
+
if (typeof document === "undefined" || document === null) {
|
|
149
160
|
throw new Error(
|
|
150
161
|
"The `document` global was defined when React was initialized, but is not " +
|
|
151
162
|
"defined anymore. This can happen in a test environment if a component " +
|
|
@@ -2599,7 +2610,6 @@ var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
|
2599
2610
|
var REACT_MEMO_TYPE = 0xead3;
|
|
2600
2611
|
var REACT_LAZY_TYPE = 0xead4;
|
|
2601
2612
|
var REACT_SCOPE_TYPE = 0xead7;
|
|
2602
|
-
var REACT_OPAQUE_ID_TYPE = 0xeae0;
|
|
2603
2613
|
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
2604
2614
|
var REACT_OFFSCREEN_TYPE = 0xeae2;
|
|
2605
2615
|
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
@@ -2620,7 +2630,6 @@ if (typeof Symbol === "function" && Symbol.for) {
|
|
|
2620
2630
|
REACT_MEMO_TYPE = symbolFor("react.memo");
|
|
2621
2631
|
REACT_LAZY_TYPE = symbolFor("react.lazy");
|
|
2622
2632
|
REACT_SCOPE_TYPE = symbolFor("react.scope");
|
|
2623
|
-
REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
|
|
2624
2633
|
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
|
|
2625
2634
|
REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
|
|
2626
2635
|
REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
|
|
@@ -2853,12 +2862,13 @@ function getComponentNameFromFiber(fiber) {
|
|
|
2853
2862
|
|
|
2854
2863
|
var enablePersistentOffscreenHostContainer =
|
|
2855
2864
|
dynamicFlags.enablePersistentOffscreenHostContainer; // The rest of the flags are static for better dead code elimination.
|
|
2856
|
-
var enableSchedulingProfiler =
|
|
2865
|
+
var enableSchedulingProfiler = true;
|
|
2857
2866
|
var enableProfilerTimer = true;
|
|
2858
2867
|
var enableProfilerCommitHooks = true;
|
|
2859
2868
|
var enableLazyElements = false;
|
|
2860
2869
|
var warnAboutStringRefs = false;
|
|
2861
2870
|
var warnOnSubscriptionInsideStartTransition = false;
|
|
2871
|
+
var enableSuspenseAvoidThisFallback = false;
|
|
2862
2872
|
var enableNewReconciler = false;
|
|
2863
2873
|
var enableLazyContextPropagation = false;
|
|
2864
2874
|
|
|
@@ -2891,6 +2901,9 @@ var Callback =
|
|
|
2891
2901
|
var DidCapture =
|
|
2892
2902
|
/* */
|
|
2893
2903
|
128;
|
|
2904
|
+
var ForceClientRender =
|
|
2905
|
+
/* */
|
|
2906
|
+
256;
|
|
2894
2907
|
var Ref =
|
|
2895
2908
|
/* */
|
|
2896
2909
|
512;
|
|
@@ -2928,6 +2941,9 @@ var ShouldCapture =
|
|
|
2928
2941
|
var ForceUpdateForLegacySuspense =
|
|
2929
2942
|
/* */
|
|
2930
2943
|
131072;
|
|
2944
|
+
var Forked =
|
|
2945
|
+
/* */
|
|
2946
|
+
1048576; // Static tags describe aspects of a fiber that are not specific to a render,
|
|
2931
2947
|
// e.g. a fiber uses a passive effect (even if there are no updates on this particular render).
|
|
2932
2948
|
// This enables us to defer more work in the unmount case,
|
|
2933
2949
|
// since we can defer traversing the tree during layout to look for Passive effects,
|
|
@@ -2935,22 +2951,22 @@ var ForceUpdateForLegacySuspense =
|
|
|
2935
2951
|
|
|
2936
2952
|
var RefStatic =
|
|
2937
2953
|
/* */
|
|
2938
|
-
|
|
2954
|
+
2097152;
|
|
2939
2955
|
var LayoutStatic =
|
|
2940
2956
|
/* */
|
|
2941
|
-
|
|
2957
|
+
4194304;
|
|
2942
2958
|
var PassiveStatic =
|
|
2943
2959
|
/* */
|
|
2944
|
-
|
|
2960
|
+
8388608; // These flags allow us to traverse to fibers that have effects on mount
|
|
2945
2961
|
// without traversing the entire tree after every commit for
|
|
2946
2962
|
// double invoking
|
|
2947
2963
|
|
|
2948
2964
|
var MountLayoutDev =
|
|
2949
2965
|
/* */
|
|
2950
|
-
|
|
2966
|
+
16777216;
|
|
2951
2967
|
var MountPassiveDev =
|
|
2952
2968
|
/* */
|
|
2953
|
-
|
|
2969
|
+
33554432; // Groups of flags that are used in the commit phase to skip over trees that
|
|
2954
2970
|
// don't contain effects, by checking subtreeFlags.
|
|
2955
2971
|
|
|
2956
2972
|
var BeforeMutationMask = // TODO: Remove Update flag from before mutation phase by re-landing Visibility
|
|
@@ -3993,6 +4009,7 @@ function reenableLogs() {
|
|
|
3993
4009
|
|
|
3994
4010
|
var rendererID = null;
|
|
3995
4011
|
var injectedHook = null;
|
|
4012
|
+
var injectedProfilingHooks = null;
|
|
3996
4013
|
var hasLoggedError = false;
|
|
3997
4014
|
var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined";
|
|
3998
4015
|
function injectInternals(internals) {
|
|
@@ -4023,7 +4040,12 @@ function injectInternals(internals) {
|
|
|
4023
4040
|
}
|
|
4024
4041
|
|
|
4025
4042
|
try {
|
|
4026
|
-
rendererID = hook.inject(
|
|
4043
|
+
rendererID = hook.inject(
|
|
4044
|
+
Object.assign({}, internals, {
|
|
4045
|
+
getLaneLabelMap: getLaneLabelMap,
|
|
4046
|
+
injectProfilingHooks: injectProfilingHooks
|
|
4047
|
+
})
|
|
4048
|
+
); // We have successfully injected, so now it is safe to set up hooks.
|
|
4027
4049
|
|
|
4028
4050
|
injectedHook = hook;
|
|
4029
4051
|
} catch (err) {
|
|
@@ -4150,6 +4172,272 @@ function setIsStrictModeForDevtools(newIsStrictMode) {
|
|
|
4150
4172
|
reenableLogs();
|
|
4151
4173
|
}
|
|
4152
4174
|
}
|
|
4175
|
+
} // Profiler API hooks
|
|
4176
|
+
|
|
4177
|
+
function injectProfilingHooks(profilingHooks) {
|
|
4178
|
+
injectedProfilingHooks = profilingHooks;
|
|
4179
|
+
}
|
|
4180
|
+
|
|
4181
|
+
function getLaneLabelMap() {
|
|
4182
|
+
var map = new Map();
|
|
4183
|
+
var lane = 1;
|
|
4184
|
+
|
|
4185
|
+
for (var index = 0; index < TotalLanes; index++) {
|
|
4186
|
+
var label = getLabelForLane(lane);
|
|
4187
|
+
map.set(lane, label);
|
|
4188
|
+
lane *= 2;
|
|
4189
|
+
}
|
|
4190
|
+
|
|
4191
|
+
return map;
|
|
4192
|
+
}
|
|
4193
|
+
|
|
4194
|
+
function markCommitStarted(lanes) {
|
|
4195
|
+
{
|
|
4196
|
+
if (
|
|
4197
|
+
injectedProfilingHooks !== null &&
|
|
4198
|
+
typeof injectedProfilingHooks.markCommitStarted === "function"
|
|
4199
|
+
) {
|
|
4200
|
+
injectedProfilingHooks.markCommitStarted(lanes);
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
}
|
|
4204
|
+
function markCommitStopped() {
|
|
4205
|
+
{
|
|
4206
|
+
if (
|
|
4207
|
+
injectedProfilingHooks !== null &&
|
|
4208
|
+
typeof injectedProfilingHooks.markCommitStopped === "function"
|
|
4209
|
+
) {
|
|
4210
|
+
injectedProfilingHooks.markCommitStopped();
|
|
4211
|
+
}
|
|
4212
|
+
}
|
|
4213
|
+
}
|
|
4214
|
+
function markComponentRenderStarted(fiber) {
|
|
4215
|
+
{
|
|
4216
|
+
if (
|
|
4217
|
+
injectedProfilingHooks !== null &&
|
|
4218
|
+
typeof injectedProfilingHooks.markComponentRenderStarted === "function"
|
|
4219
|
+
) {
|
|
4220
|
+
injectedProfilingHooks.markComponentRenderStarted(fiber);
|
|
4221
|
+
}
|
|
4222
|
+
}
|
|
4223
|
+
}
|
|
4224
|
+
function markComponentRenderStopped() {
|
|
4225
|
+
{
|
|
4226
|
+
if (
|
|
4227
|
+
injectedProfilingHooks !== null &&
|
|
4228
|
+
typeof injectedProfilingHooks.markComponentRenderStopped === "function"
|
|
4229
|
+
) {
|
|
4230
|
+
injectedProfilingHooks.markComponentRenderStopped();
|
|
4231
|
+
}
|
|
4232
|
+
}
|
|
4233
|
+
}
|
|
4234
|
+
function markComponentPassiveEffectMountStarted(fiber) {
|
|
4235
|
+
{
|
|
4236
|
+
if (
|
|
4237
|
+
injectedProfilingHooks !== null &&
|
|
4238
|
+
typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted ===
|
|
4239
|
+
"function"
|
|
4240
|
+
) {
|
|
4241
|
+
injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber);
|
|
4242
|
+
}
|
|
4243
|
+
}
|
|
4244
|
+
}
|
|
4245
|
+
function markComponentPassiveEffectMountStopped() {
|
|
4246
|
+
{
|
|
4247
|
+
if (
|
|
4248
|
+
injectedProfilingHooks !== null &&
|
|
4249
|
+
typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped ===
|
|
4250
|
+
"function"
|
|
4251
|
+
) {
|
|
4252
|
+
injectedProfilingHooks.markComponentPassiveEffectMountStopped();
|
|
4253
|
+
}
|
|
4254
|
+
}
|
|
4255
|
+
}
|
|
4256
|
+
function markComponentPassiveEffectUnmountStarted(fiber) {
|
|
4257
|
+
{
|
|
4258
|
+
if (
|
|
4259
|
+
injectedProfilingHooks !== null &&
|
|
4260
|
+
typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted ===
|
|
4261
|
+
"function"
|
|
4262
|
+
) {
|
|
4263
|
+
injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber);
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
function markComponentPassiveEffectUnmountStopped() {
|
|
4268
|
+
{
|
|
4269
|
+
if (
|
|
4270
|
+
injectedProfilingHooks !== null &&
|
|
4271
|
+
typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped ===
|
|
4272
|
+
"function"
|
|
4273
|
+
) {
|
|
4274
|
+
injectedProfilingHooks.markComponentPassiveEffectUnmountStopped();
|
|
4275
|
+
}
|
|
4276
|
+
}
|
|
4277
|
+
}
|
|
4278
|
+
function markComponentLayoutEffectMountStarted(fiber) {
|
|
4279
|
+
{
|
|
4280
|
+
if (
|
|
4281
|
+
injectedProfilingHooks !== null &&
|
|
4282
|
+
typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted ===
|
|
4283
|
+
"function"
|
|
4284
|
+
) {
|
|
4285
|
+
injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber);
|
|
4286
|
+
}
|
|
4287
|
+
}
|
|
4288
|
+
}
|
|
4289
|
+
function markComponentLayoutEffectMountStopped() {
|
|
4290
|
+
{
|
|
4291
|
+
if (
|
|
4292
|
+
injectedProfilingHooks !== null &&
|
|
4293
|
+
typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped ===
|
|
4294
|
+
"function"
|
|
4295
|
+
) {
|
|
4296
|
+
injectedProfilingHooks.markComponentLayoutEffectMountStopped();
|
|
4297
|
+
}
|
|
4298
|
+
}
|
|
4299
|
+
}
|
|
4300
|
+
function markComponentLayoutEffectUnmountStarted(fiber) {
|
|
4301
|
+
{
|
|
4302
|
+
if (
|
|
4303
|
+
injectedProfilingHooks !== null &&
|
|
4304
|
+
typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted ===
|
|
4305
|
+
"function"
|
|
4306
|
+
) {
|
|
4307
|
+
injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber);
|
|
4308
|
+
}
|
|
4309
|
+
}
|
|
4310
|
+
}
|
|
4311
|
+
function markComponentLayoutEffectUnmountStopped() {
|
|
4312
|
+
{
|
|
4313
|
+
if (
|
|
4314
|
+
injectedProfilingHooks !== null &&
|
|
4315
|
+
typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped ===
|
|
4316
|
+
"function"
|
|
4317
|
+
) {
|
|
4318
|
+
injectedProfilingHooks.markComponentLayoutEffectUnmountStopped();
|
|
4319
|
+
}
|
|
4320
|
+
}
|
|
4321
|
+
}
|
|
4322
|
+
function markComponentErrored(fiber, thrownValue, lanes) {
|
|
4323
|
+
{
|
|
4324
|
+
if (
|
|
4325
|
+
injectedProfilingHooks !== null &&
|
|
4326
|
+
typeof injectedProfilingHooks.markComponentErrored === "function"
|
|
4327
|
+
) {
|
|
4328
|
+
injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes);
|
|
4329
|
+
}
|
|
4330
|
+
}
|
|
4331
|
+
}
|
|
4332
|
+
function markComponentSuspended(fiber, wakeable, lanes) {
|
|
4333
|
+
{
|
|
4334
|
+
if (
|
|
4335
|
+
injectedProfilingHooks !== null &&
|
|
4336
|
+
typeof injectedProfilingHooks.markComponentSuspended === "function"
|
|
4337
|
+
) {
|
|
4338
|
+
injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes);
|
|
4339
|
+
}
|
|
4340
|
+
}
|
|
4341
|
+
}
|
|
4342
|
+
function markLayoutEffectsStarted(lanes) {
|
|
4343
|
+
{
|
|
4344
|
+
if (
|
|
4345
|
+
injectedProfilingHooks !== null &&
|
|
4346
|
+
typeof injectedProfilingHooks.markLayoutEffectsStarted === "function"
|
|
4347
|
+
) {
|
|
4348
|
+
injectedProfilingHooks.markLayoutEffectsStarted(lanes);
|
|
4349
|
+
}
|
|
4350
|
+
}
|
|
4351
|
+
}
|
|
4352
|
+
function markLayoutEffectsStopped() {
|
|
4353
|
+
{
|
|
4354
|
+
if (
|
|
4355
|
+
injectedProfilingHooks !== null &&
|
|
4356
|
+
typeof injectedProfilingHooks.markLayoutEffectsStopped === "function"
|
|
4357
|
+
) {
|
|
4358
|
+
injectedProfilingHooks.markLayoutEffectsStopped();
|
|
4359
|
+
}
|
|
4360
|
+
}
|
|
4361
|
+
}
|
|
4362
|
+
function markPassiveEffectsStarted(lanes) {
|
|
4363
|
+
{
|
|
4364
|
+
if (
|
|
4365
|
+
injectedProfilingHooks !== null &&
|
|
4366
|
+
typeof injectedProfilingHooks.markPassiveEffectsStarted === "function"
|
|
4367
|
+
) {
|
|
4368
|
+
injectedProfilingHooks.markPassiveEffectsStarted(lanes);
|
|
4369
|
+
}
|
|
4370
|
+
}
|
|
4371
|
+
}
|
|
4372
|
+
function markPassiveEffectsStopped() {
|
|
4373
|
+
{
|
|
4374
|
+
if (
|
|
4375
|
+
injectedProfilingHooks !== null &&
|
|
4376
|
+
typeof injectedProfilingHooks.markPassiveEffectsStopped === "function"
|
|
4377
|
+
) {
|
|
4378
|
+
injectedProfilingHooks.markPassiveEffectsStopped();
|
|
4379
|
+
}
|
|
4380
|
+
}
|
|
4381
|
+
}
|
|
4382
|
+
function markRenderStarted(lanes) {
|
|
4383
|
+
{
|
|
4384
|
+
if (
|
|
4385
|
+
injectedProfilingHooks !== null &&
|
|
4386
|
+
typeof injectedProfilingHooks.markRenderStarted === "function"
|
|
4387
|
+
) {
|
|
4388
|
+
injectedProfilingHooks.markRenderStarted(lanes);
|
|
4389
|
+
}
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4392
|
+
function markRenderYielded() {
|
|
4393
|
+
{
|
|
4394
|
+
if (
|
|
4395
|
+
injectedProfilingHooks !== null &&
|
|
4396
|
+
typeof injectedProfilingHooks.markRenderYielded === "function"
|
|
4397
|
+
) {
|
|
4398
|
+
injectedProfilingHooks.markRenderYielded();
|
|
4399
|
+
}
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4402
|
+
function markRenderStopped() {
|
|
4403
|
+
{
|
|
4404
|
+
if (
|
|
4405
|
+
injectedProfilingHooks !== null &&
|
|
4406
|
+
typeof injectedProfilingHooks.markRenderStopped === "function"
|
|
4407
|
+
) {
|
|
4408
|
+
injectedProfilingHooks.markRenderStopped();
|
|
4409
|
+
}
|
|
4410
|
+
}
|
|
4411
|
+
}
|
|
4412
|
+
function markRenderScheduled(lane) {
|
|
4413
|
+
{
|
|
4414
|
+
if (
|
|
4415
|
+
injectedProfilingHooks !== null &&
|
|
4416
|
+
typeof injectedProfilingHooks.markRenderScheduled === "function"
|
|
4417
|
+
) {
|
|
4418
|
+
injectedProfilingHooks.markRenderScheduled(lane);
|
|
4419
|
+
}
|
|
4420
|
+
}
|
|
4421
|
+
}
|
|
4422
|
+
function markForceUpdateScheduled(fiber, lane) {
|
|
4423
|
+
{
|
|
4424
|
+
if (
|
|
4425
|
+
injectedProfilingHooks !== null &&
|
|
4426
|
+
typeof injectedProfilingHooks.markForceUpdateScheduled === "function"
|
|
4427
|
+
) {
|
|
4428
|
+
injectedProfilingHooks.markForceUpdateScheduled(fiber, lane);
|
|
4429
|
+
}
|
|
4430
|
+
}
|
|
4431
|
+
}
|
|
4432
|
+
function markStateUpdateScheduled(fiber, lane) {
|
|
4433
|
+
{
|
|
4434
|
+
if (
|
|
4435
|
+
injectedProfilingHooks !== null &&
|
|
4436
|
+
typeof injectedProfilingHooks.markStateUpdateScheduled === "function"
|
|
4437
|
+
) {
|
|
4438
|
+
injectedProfilingHooks.markStateUpdateScheduled(fiber, lane);
|
|
4439
|
+
}
|
|
4440
|
+
}
|
|
4153
4441
|
}
|
|
4154
4442
|
|
|
4155
4443
|
var NoMode =
|
|
@@ -4175,6 +4463,24 @@ var ConcurrentUpdatesByDefaultMode =
|
|
|
4175
4463
|
/* */
|
|
4176
4464
|
32;
|
|
4177
4465
|
|
|
4466
|
+
// TODO: This is pretty well supported by browsers. Maybe we can drop it.
|
|
4467
|
+
var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros.
|
|
4468
|
+
// Based on:
|
|
4469
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
|
|
4470
|
+
|
|
4471
|
+
var log = Math.log;
|
|
4472
|
+
var LN2 = Math.LN2;
|
|
4473
|
+
|
|
4474
|
+
function clz32Fallback(x) {
|
|
4475
|
+
var asUint = x >>> 0;
|
|
4476
|
+
|
|
4477
|
+
if (asUint === 0) {
|
|
4478
|
+
return 32;
|
|
4479
|
+
}
|
|
4480
|
+
|
|
4481
|
+
return (31 - ((log(asUint) / LN2) | 0)) | 0;
|
|
4482
|
+
}
|
|
4483
|
+
|
|
4178
4484
|
// If those values are changed that package should be rebuilt and redeployed.
|
|
4179
4485
|
|
|
4180
4486
|
var TotalLanes = 31;
|
|
@@ -4286,7 +4592,60 @@ var IdleLane =
|
|
|
4286
4592
|
536870912;
|
|
4287
4593
|
var OffscreenLane =
|
|
4288
4594
|
/* */
|
|
4289
|
-
1073741824; // This function is used for the experimental
|
|
4595
|
+
1073741824; // This function is used for the experimental timeline (react-devtools-timeline)
|
|
4596
|
+
// It should be kept in sync with the Lanes values above.
|
|
4597
|
+
|
|
4598
|
+
function getLabelForLane(lane) {
|
|
4599
|
+
{
|
|
4600
|
+
if (lane & SyncLane) {
|
|
4601
|
+
return "Sync";
|
|
4602
|
+
}
|
|
4603
|
+
|
|
4604
|
+
if (lane & InputContinuousHydrationLane) {
|
|
4605
|
+
return "InputContinuousHydration";
|
|
4606
|
+
}
|
|
4607
|
+
|
|
4608
|
+
if (lane & InputContinuousLane) {
|
|
4609
|
+
return "InputContinuous";
|
|
4610
|
+
}
|
|
4611
|
+
|
|
4612
|
+
if (lane & DefaultHydrationLane) {
|
|
4613
|
+
return "DefaultHydration";
|
|
4614
|
+
}
|
|
4615
|
+
|
|
4616
|
+
if (lane & DefaultLane) {
|
|
4617
|
+
return "Default";
|
|
4618
|
+
}
|
|
4619
|
+
|
|
4620
|
+
if (lane & TransitionHydrationLane) {
|
|
4621
|
+
return "TransitionHydration";
|
|
4622
|
+
}
|
|
4623
|
+
|
|
4624
|
+
if (lane & TransitionLanes) {
|
|
4625
|
+
return "Transition";
|
|
4626
|
+
}
|
|
4627
|
+
|
|
4628
|
+
if (lane & RetryLanes) {
|
|
4629
|
+
return "Retry";
|
|
4630
|
+
}
|
|
4631
|
+
|
|
4632
|
+
if (lane & SelectiveHydrationLane) {
|
|
4633
|
+
return "SelectiveHydration";
|
|
4634
|
+
}
|
|
4635
|
+
|
|
4636
|
+
if (lane & IdleHydrationLane) {
|
|
4637
|
+
return "IdleHydration";
|
|
4638
|
+
}
|
|
4639
|
+
|
|
4640
|
+
if (lane & IdleLane) {
|
|
4641
|
+
return "Idle";
|
|
4642
|
+
}
|
|
4643
|
+
|
|
4644
|
+
if (lane & OffscreenLane) {
|
|
4645
|
+
return "Offscreen";
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
}
|
|
4290
4649
|
var NoTimestamp = -1;
|
|
4291
4650
|
var nextTransitionLane = TransitionLane1;
|
|
4292
4651
|
var nextRetryLane = RetryLane1;
|
|
@@ -4764,7 +5123,6 @@ function markRootFinished(root, remainingLanes) {
|
|
|
4764
5123
|
root.expiredLanes &= remainingLanes;
|
|
4765
5124
|
root.mutableReadLanes &= remainingLanes;
|
|
4766
5125
|
root.entangledLanes &= remainingLanes;
|
|
4767
|
-
|
|
4768
5126
|
var entanglements = root.entanglements;
|
|
4769
5127
|
var eventTimes = root.eventTimes;
|
|
4770
5128
|
var expirationTimes = root.expirationTimes; // Clear the lanes that no longer have pending work
|
|
@@ -4853,20 +5211,6 @@ function movePendingFibersToMemoized(root, lanes) {
|
|
|
4853
5211
|
lanes &= ~lane;
|
|
4854
5212
|
}
|
|
4855
5213
|
}
|
|
4856
|
-
var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros. Only used on lanes, so assume input is an integer.
|
|
4857
|
-
// Based on:
|
|
4858
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
|
|
4859
|
-
|
|
4860
|
-
var log = Math.log;
|
|
4861
|
-
var LN2 = Math.LN2;
|
|
4862
|
-
|
|
4863
|
-
function clz32Fallback(lanes) {
|
|
4864
|
-
if (lanes === 0) {
|
|
4865
|
-
return 32;
|
|
4866
|
-
}
|
|
4867
|
-
|
|
4868
|
-
return (31 - ((log(lanes) / LN2) | 0)) | 0;
|
|
4869
|
-
}
|
|
4870
5214
|
|
|
4871
5215
|
var DiscreteEventPriority = SyncLane;
|
|
4872
5216
|
var ContinuousEventPriority = InputContinuousLane;
|
|
@@ -4918,7 +5262,6 @@ function shim() {
|
|
|
4918
5262
|
|
|
4919
5263
|
var supportsMutation = false;
|
|
4920
5264
|
var commitMount = shim;
|
|
4921
|
-
var clearContainer = shim;
|
|
4922
5265
|
|
|
4923
5266
|
// Renderers that don't support hydration
|
|
4924
5267
|
// can re-export everything from this module.
|
|
@@ -5205,6 +5548,8 @@ function getCurrentEventPriority() {
|
|
|
5205
5548
|
|
|
5206
5549
|
return DefaultEventPriority;
|
|
5207
5550
|
} // The Fabric renderer is secondary to the existing React Native renderer.
|
|
5551
|
+
|
|
5552
|
+
var warnsIfNotActing = false;
|
|
5208
5553
|
var scheduleTimeout = setTimeout;
|
|
5209
5554
|
var cancelTimeout = clearTimeout;
|
|
5210
5555
|
var noTimeout = -1; // -------------------
|
|
@@ -5300,9 +5645,6 @@ function appendChildToContainerChildSet(childSet, child) {
|
|
|
5300
5645
|
function finalizeContainerChildren(container, newChildren) {
|
|
5301
5646
|
completeRoot(container, newChildren);
|
|
5302
5647
|
}
|
|
5303
|
-
function makeClientIdInDEV(warnOnAccessInDEV) {
|
|
5304
|
-
throw new Error("Not yet implemented");
|
|
5305
|
-
}
|
|
5306
5648
|
function preparePortalMount(portalInstance) {
|
|
5307
5649
|
// noop
|
|
5308
5650
|
}
|
|
@@ -5938,13 +6280,6 @@ function flushSyncCallbacks() {
|
|
|
5938
6280
|
return null;
|
|
5939
6281
|
}
|
|
5940
6282
|
|
|
5941
|
-
var ReactVersion = "18.0.0-afcb9cdc9-20211008";
|
|
5942
|
-
|
|
5943
|
-
function markComponentRenderStopped() {}
|
|
5944
|
-
function markComponentErrored(fiber, thrownValue, lanes) {}
|
|
5945
|
-
|
|
5946
|
-
function markComponentSuspended(fiber, wakeable, lanes) {}
|
|
5947
|
-
|
|
5948
6283
|
var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
5949
6284
|
var NoTransition = 0;
|
|
5950
6285
|
function requestCurrentTransition() {
|
|
@@ -5979,9 +6314,11 @@ function shallowEqual(objA, objB) {
|
|
|
5979
6314
|
} // Test for A's keys different from B.
|
|
5980
6315
|
|
|
5981
6316
|
for (var i = 0; i < keysA.length; i++) {
|
|
6317
|
+
var currentKey = keysA[i];
|
|
6318
|
+
|
|
5982
6319
|
if (
|
|
5983
|
-
!hasOwnProperty.call(objB,
|
|
5984
|
-
!objectIs(objA[
|
|
6320
|
+
!hasOwnProperty.call(objB, currentKey) ||
|
|
6321
|
+
!objectIs(objA[currentKey], objB[currentKey])
|
|
5985
6322
|
) {
|
|
5986
6323
|
return false;
|
|
5987
6324
|
}
|
|
@@ -6088,11 +6425,6 @@ function setIsRendering(rendering) {
|
|
|
6088
6425
|
isRendering = rendering;
|
|
6089
6426
|
}
|
|
6090
6427
|
}
|
|
6091
|
-
function getIsRendering() {
|
|
6092
|
-
{
|
|
6093
|
-
return isRendering;
|
|
6094
|
-
}
|
|
6095
|
-
}
|
|
6096
6428
|
|
|
6097
6429
|
var ReactStrictModeWarnings = {
|
|
6098
6430
|
recordUnsafeLifecycleWarnings: function(fiber, instance) {},
|
|
@@ -6452,7 +6784,6 @@ var ReactStrictModeWarnings = {
|
|
|
6452
6784
|
* of the `value` object).
|
|
6453
6785
|
*/
|
|
6454
6786
|
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
6455
|
-
|
|
6456
6787
|
function typeName(value) {
|
|
6457
6788
|
{
|
|
6458
6789
|
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
@@ -6467,17 +6798,6 @@ function typeName(value) {
|
|
|
6467
6798
|
|
|
6468
6799
|
function willCoercionThrow(value) {
|
|
6469
6800
|
{
|
|
6470
|
-
if (
|
|
6471
|
-
value !== null &&
|
|
6472
|
-
typeof value === "object" &&
|
|
6473
|
-
value.$$typeof === REACT_OPAQUE_ID_TYPE
|
|
6474
|
-
) {
|
|
6475
|
-
// OpaqueID type is expected to throw, so React will handle it. Not sure if
|
|
6476
|
-
// it's expected that string coercion will throw, but we'll assume it's OK.
|
|
6477
|
-
// See https://github.com/facebook/react/issues/20127.
|
|
6478
|
-
return;
|
|
6479
|
-
}
|
|
6480
|
-
|
|
6481
6801
|
try {
|
|
6482
6802
|
testStringCoercion(value);
|
|
6483
6803
|
return false;
|
|
@@ -7554,6 +7874,10 @@ var classComponentUpdater = {
|
|
|
7554
7874
|
if (root !== null) {
|
|
7555
7875
|
entangleTransitions(root, fiber, lane);
|
|
7556
7876
|
}
|
|
7877
|
+
|
|
7878
|
+
{
|
|
7879
|
+
markStateUpdateScheduled(fiber, lane);
|
|
7880
|
+
}
|
|
7557
7881
|
},
|
|
7558
7882
|
enqueueReplaceState: function(inst, payload, callback) {
|
|
7559
7883
|
var fiber = get(inst);
|
|
@@ -7577,6 +7901,10 @@ var classComponentUpdater = {
|
|
|
7577
7901
|
if (root !== null) {
|
|
7578
7902
|
entangleTransitions(root, fiber, lane);
|
|
7579
7903
|
}
|
|
7904
|
+
|
|
7905
|
+
{
|
|
7906
|
+
markStateUpdateScheduled(fiber, lane);
|
|
7907
|
+
}
|
|
7580
7908
|
},
|
|
7581
7909
|
enqueueForceUpdate: function(inst, callback) {
|
|
7582
7910
|
var fiber = get(inst);
|
|
@@ -7599,6 +7927,10 @@ var classComponentUpdater = {
|
|
|
7599
7927
|
if (root !== null) {
|
|
7600
7928
|
entangleTransitions(root, fiber, lane);
|
|
7601
7929
|
}
|
|
7930
|
+
|
|
7931
|
+
{
|
|
7932
|
+
markForceUpdateScheduled(fiber, lane);
|
|
7933
|
+
}
|
|
7602
7934
|
}
|
|
7603
7935
|
};
|
|
7604
7936
|
|
|
@@ -8537,6 +8869,84 @@ function updateClassInstance(
|
|
|
8537
8869
|
return shouldUpdate;
|
|
8538
8870
|
}
|
|
8539
8871
|
|
|
8872
|
+
// TODO: Use the unified fiber stack module instead of this local one?
|
|
8873
|
+
// Intentionally not using it yet to derisk the initial implementation, because
|
|
8874
|
+
// the way we push/pop these values is a bit unusual. If there's a mistake, I'd
|
|
8875
|
+
// rather the ids be wrong than crash the whole reconciler.
|
|
8876
|
+
var forkStack = [];
|
|
8877
|
+
var forkStackIndex = 0;
|
|
8878
|
+
var treeForkProvider = null;
|
|
8879
|
+
var treeForkCount = 0;
|
|
8880
|
+
var idStack = [];
|
|
8881
|
+
var idStackIndex = 0;
|
|
8882
|
+
var treeContextProvider = null;
|
|
8883
|
+
var treeContextId = 1;
|
|
8884
|
+
var treeContextOverflow = "";
|
|
8885
|
+
|
|
8886
|
+
function popTreeContext(workInProgress) {
|
|
8887
|
+
// Restore the previous values.
|
|
8888
|
+
// This is a bit more complicated than other context-like modules in Fiber
|
|
8889
|
+
// because the same Fiber may appear on the stack multiple times and for
|
|
8890
|
+
// different reasons. We have to keep popping until the work-in-progress is
|
|
8891
|
+
// no longer at the top of the stack.
|
|
8892
|
+
while (workInProgress === treeForkProvider) {
|
|
8893
|
+
treeForkProvider = forkStack[--forkStackIndex];
|
|
8894
|
+
forkStack[forkStackIndex] = null;
|
|
8895
|
+
treeForkCount = forkStack[--forkStackIndex];
|
|
8896
|
+
forkStack[forkStackIndex] = null;
|
|
8897
|
+
}
|
|
8898
|
+
|
|
8899
|
+
while (workInProgress === treeContextProvider) {
|
|
8900
|
+
treeContextProvider = idStack[--idStackIndex];
|
|
8901
|
+
idStack[idStackIndex] = null;
|
|
8902
|
+
treeContextOverflow = idStack[--idStackIndex];
|
|
8903
|
+
idStack[idStackIndex] = null;
|
|
8904
|
+
treeContextId = idStack[--idStackIndex];
|
|
8905
|
+
idStack[idStackIndex] = null;
|
|
8906
|
+
}
|
|
8907
|
+
}
|
|
8908
|
+
|
|
8909
|
+
var isHydrating = false;
|
|
8910
|
+
|
|
8911
|
+
function enterHydrationState(fiber) {
|
|
8912
|
+
{
|
|
8913
|
+
return false;
|
|
8914
|
+
}
|
|
8915
|
+
}
|
|
8916
|
+
|
|
8917
|
+
function prepareToHydrateHostInstance(
|
|
8918
|
+
fiber,
|
|
8919
|
+
rootContainerInstance,
|
|
8920
|
+
hostContext
|
|
8921
|
+
) {
|
|
8922
|
+
{
|
|
8923
|
+
throw new Error(
|
|
8924
|
+
"Expected prepareToHydrateHostInstance() to never be called. " +
|
|
8925
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
8926
|
+
);
|
|
8927
|
+
}
|
|
8928
|
+
}
|
|
8929
|
+
|
|
8930
|
+
function prepareToHydrateHostTextInstance(fiber) {
|
|
8931
|
+
{
|
|
8932
|
+
throw new Error(
|
|
8933
|
+
"Expected prepareToHydrateHostTextInstance() to never be called. " +
|
|
8934
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
8935
|
+
);
|
|
8936
|
+
}
|
|
8937
|
+
var shouldUpdate = hydrateTextInstance();
|
|
8938
|
+
}
|
|
8939
|
+
|
|
8940
|
+
function popHydrationState(fiber) {
|
|
8941
|
+
{
|
|
8942
|
+
return false;
|
|
8943
|
+
}
|
|
8944
|
+
}
|
|
8945
|
+
|
|
8946
|
+
function getIsHydrating() {
|
|
8947
|
+
return isHydrating;
|
|
8948
|
+
}
|
|
8949
|
+
|
|
8540
8950
|
var didWarnAboutMaps;
|
|
8541
8951
|
var didWarnAboutGenerators;
|
|
8542
8952
|
var didWarnAboutStringRefs;
|
|
@@ -8820,7 +9230,9 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
8820
9230
|
newFiber.index = newIndex;
|
|
8821
9231
|
|
|
8822
9232
|
if (!shouldTrackSideEffects) {
|
|
8823
|
-
//
|
|
9233
|
+
// During hydration, the useId algorithm needs to know which fibers are
|
|
9234
|
+
// part of a list of children (arrays, iterators).
|
|
9235
|
+
newFiber.flags |= Forked;
|
|
8824
9236
|
return lastPlacedIndex;
|
|
8825
9237
|
}
|
|
8826
9238
|
|
|
@@ -8949,7 +9361,10 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
8949
9361
|
}
|
|
8950
9362
|
|
|
8951
9363
|
function createChild(returnFiber, newChild, lanes) {
|
|
8952
|
-
if (
|
|
9364
|
+
if (
|
|
9365
|
+
(typeof newChild === "string" && newChild !== "") ||
|
|
9366
|
+
typeof newChild === "number"
|
|
9367
|
+
) {
|
|
8953
9368
|
// Text nodes don't have keys. If the previous node is implicitly keyed
|
|
8954
9369
|
// we can continue to replace it without aborting even if it is not a text
|
|
8955
9370
|
// node.
|
|
@@ -9012,7 +9427,10 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9012
9427
|
// Update the fiber if the keys match, otherwise return null.
|
|
9013
9428
|
var key = oldFiber !== null ? oldFiber.key : null;
|
|
9014
9429
|
|
|
9015
|
-
if (
|
|
9430
|
+
if (
|
|
9431
|
+
(typeof newChild === "string" && newChild !== "") ||
|
|
9432
|
+
typeof newChild === "number"
|
|
9433
|
+
) {
|
|
9016
9434
|
// Text nodes don't have keys. If the previous node is implicitly keyed
|
|
9017
9435
|
// we can continue to replace it without aborting even if it is not a text
|
|
9018
9436
|
// node.
|
|
@@ -9069,7 +9487,10 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9069
9487
|
newChild,
|
|
9070
9488
|
lanes
|
|
9071
9489
|
) {
|
|
9072
|
-
if (
|
|
9490
|
+
if (
|
|
9491
|
+
(typeof newChild === "string" && newChild !== "") ||
|
|
9492
|
+
typeof newChild === "number"
|
|
9493
|
+
) {
|
|
9073
9494
|
// Text nodes don't have keys, so we neither have to check the old nor
|
|
9074
9495
|
// new node for the key. If both are text nodes, they match.
|
|
9075
9496
|
var matchedFiber = existingChildren.get(newIdx) || null;
|
|
@@ -9260,6 +9681,7 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9260
9681
|
if (newIdx === newChildren.length) {
|
|
9261
9682
|
// We've reached the end of the new children. We can delete the rest.
|
|
9262
9683
|
deleteRemainingChildren(returnFiber, oldFiber);
|
|
9684
|
+
|
|
9263
9685
|
return resultingFirstChild;
|
|
9264
9686
|
}
|
|
9265
9687
|
|
|
@@ -9466,6 +9888,7 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9466
9888
|
if (step.done) {
|
|
9467
9889
|
// We've reached the end of the new children. We can delete the rest.
|
|
9468
9890
|
deleteRemainingChildren(returnFiber, oldFiber);
|
|
9891
|
+
|
|
9469
9892
|
return resultingFirstChild;
|
|
9470
9893
|
}
|
|
9471
9894
|
|
|
@@ -9752,7 +10175,10 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9752
10175
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
9753
10176
|
}
|
|
9754
10177
|
|
|
9755
|
-
if (
|
|
10178
|
+
if (
|
|
10179
|
+
(typeof newChild === "string" && newChild !== "") ||
|
|
10180
|
+
typeof newChild === "number"
|
|
10181
|
+
) {
|
|
9756
10182
|
return placeSingleChild(
|
|
9757
10183
|
reconcileSingleTextNode(
|
|
9758
10184
|
returnFiber,
|
|
@@ -9942,16 +10368,9 @@ function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
|
|
|
9942
10368
|
|
|
9943
10369
|
var props = workInProgress.memoizedProps; // Regular boundaries always capture.
|
|
9944
10370
|
|
|
9945
|
-
|
|
10371
|
+
{
|
|
9946
10372
|
return true;
|
|
9947
10373
|
} // If it's a boundary we should avoid, then we prefer to bubble up to the
|
|
9948
|
-
// parent boundary if it is currently invisible.
|
|
9949
|
-
|
|
9950
|
-
if (hasInvisibleParent) {
|
|
9951
|
-
return false;
|
|
9952
|
-
} // If the parent is not able to handle it, we must handle it.
|
|
9953
|
-
|
|
9954
|
-
return true;
|
|
9955
10374
|
}
|
|
9956
10375
|
function findFirstSuspended(row) {
|
|
9957
10376
|
var node = row;
|
|
@@ -10024,47 +10443,6 @@ var Passive$1 =
|
|
|
10024
10443
|
/* */
|
|
10025
10444
|
8;
|
|
10026
10445
|
|
|
10027
|
-
var isHydrating = false;
|
|
10028
|
-
|
|
10029
|
-
function enterHydrationState(fiber) {
|
|
10030
|
-
{
|
|
10031
|
-
return false;
|
|
10032
|
-
}
|
|
10033
|
-
}
|
|
10034
|
-
|
|
10035
|
-
function prepareToHydrateHostInstance(
|
|
10036
|
-
fiber,
|
|
10037
|
-
rootContainerInstance,
|
|
10038
|
-
hostContext
|
|
10039
|
-
) {
|
|
10040
|
-
{
|
|
10041
|
-
throw new Error(
|
|
10042
|
-
"Expected prepareToHydrateHostInstance() to never be called. " +
|
|
10043
|
-
"This error is likely caused by a bug in React. Please file an issue."
|
|
10044
|
-
);
|
|
10045
|
-
}
|
|
10046
|
-
}
|
|
10047
|
-
|
|
10048
|
-
function prepareToHydrateHostTextInstance(fiber) {
|
|
10049
|
-
{
|
|
10050
|
-
throw new Error(
|
|
10051
|
-
"Expected prepareToHydrateHostTextInstance() to never be called. " +
|
|
10052
|
-
"This error is likely caused by a bug in React. Please file an issue."
|
|
10053
|
-
);
|
|
10054
|
-
}
|
|
10055
|
-
var shouldUpdate = hydrateTextInstance();
|
|
10056
|
-
}
|
|
10057
|
-
|
|
10058
|
-
function popHydrationState(fiber) {
|
|
10059
|
-
{
|
|
10060
|
-
return false;
|
|
10061
|
-
}
|
|
10062
|
-
}
|
|
10063
|
-
|
|
10064
|
-
function getIsHydrating() {
|
|
10065
|
-
return isHydrating;
|
|
10066
|
-
}
|
|
10067
|
-
|
|
10068
10446
|
// and should be reset before starting a new render.
|
|
10069
10447
|
// This tracks which mutable sources need to be reset after a render.
|
|
10070
10448
|
|
|
@@ -10126,11 +10504,9 @@ function getSuspendedCachePool() {
|
|
|
10126
10504
|
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
|
10127
10505
|
ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
10128
10506
|
var didWarnAboutMismatchedHooksForComponent;
|
|
10129
|
-
var didWarnAboutUseOpaqueIdentifier;
|
|
10130
10507
|
var didWarnUncachedGetSnapshot;
|
|
10131
10508
|
|
|
10132
10509
|
{
|
|
10133
|
-
didWarnAboutUseOpaqueIdentifier = {};
|
|
10134
10510
|
didWarnAboutMismatchedHooksForComponent = new Set();
|
|
10135
10511
|
}
|
|
10136
10512
|
|
|
@@ -10154,7 +10530,13 @@ var didScheduleRenderPhaseUpdate = false; // Where an update was scheduled only
|
|
|
10154
10530
|
// TODO: Maybe there's some way to consolidate this with
|
|
10155
10531
|
// `didScheduleRenderPhaseUpdate`. Or with `numberOfReRenders`.
|
|
10156
10532
|
|
|
10157
|
-
var didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
10533
|
+
var didScheduleRenderPhaseUpdateDuringThisPass = false; // Counts the number of useId hooks in this component.
|
|
10534
|
+
|
|
10535
|
+
var localIdCounter = 0; // Used for ids that are generated completely client-side (i.e. not during
|
|
10536
|
+
// hydration). This counter is global, so client ids are not stable across
|
|
10537
|
+
// render attempts.
|
|
10538
|
+
|
|
10539
|
+
var globalClientIdCounter = 0;
|
|
10158
10540
|
var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook
|
|
10159
10541
|
|
|
10160
10542
|
var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.
|
|
@@ -10335,6 +10717,7 @@ function renderWithHooks(
|
|
|
10335
10717
|
// currentHook = null;
|
|
10336
10718
|
// workInProgressHook = null;
|
|
10337
10719
|
// didScheduleRenderPhaseUpdate = false;
|
|
10720
|
+
// localIdCounter = 0;
|
|
10338
10721
|
// TODO Warn if no hooks are used at all during mount, then some are used during update.
|
|
10339
10722
|
// Currently we will identify the update render as a mount because memoizedState === null.
|
|
10340
10723
|
// This is tricky because it's valid for certain types of components (e.g. React.lazy)
|
|
@@ -10366,6 +10749,7 @@ function renderWithHooks(
|
|
|
10366
10749
|
|
|
10367
10750
|
do {
|
|
10368
10751
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
10752
|
+
localIdCounter = 0;
|
|
10369
10753
|
|
|
10370
10754
|
if (numberOfReRenders >= RE_RENDER_LIMIT) {
|
|
10371
10755
|
throw new Error(
|
|
@@ -10434,7 +10818,8 @@ function renderWithHooks(
|
|
|
10434
10818
|
}
|
|
10435
10819
|
}
|
|
10436
10820
|
|
|
10437
|
-
didScheduleRenderPhaseUpdate = false;
|
|
10821
|
+
didScheduleRenderPhaseUpdate = false; // This is reset by checkDidRenderIdHook
|
|
10822
|
+
// localIdCounter = 0;
|
|
10438
10823
|
|
|
10439
10824
|
if (didRenderTooFewHooks) {
|
|
10440
10825
|
throw new Error(
|
|
@@ -10445,6 +10830,14 @@ function renderWithHooks(
|
|
|
10445
10830
|
|
|
10446
10831
|
return children;
|
|
10447
10832
|
}
|
|
10833
|
+
function checkDidRenderIdHook() {
|
|
10834
|
+
// This should be called immediately after every renderWithHooks call.
|
|
10835
|
+
// Conceptually, it's part of the return value of renderWithHooks; it's only a
|
|
10836
|
+
// separate function to avoid using an array tuple.
|
|
10837
|
+
var didRenderIdHook = localIdCounter !== 0;
|
|
10838
|
+
localIdCounter = 0;
|
|
10839
|
+
return didRenderIdHook;
|
|
10840
|
+
}
|
|
10448
10841
|
function bailoutHooks(current, workInProgress, lanes) {
|
|
10449
10842
|
workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the
|
|
10450
10843
|
// complete phase (bubbleProperties).
|
|
@@ -10504,6 +10897,7 @@ function resetHooksAfterThrow() {
|
|
|
10504
10897
|
}
|
|
10505
10898
|
|
|
10506
10899
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
10900
|
+
localIdCounter = 0;
|
|
10507
10901
|
}
|
|
10508
10902
|
|
|
10509
10903
|
function mountWorkInProgressHook() {
|
|
@@ -11723,44 +12117,30 @@ function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
|
|
|
11723
12117
|
}
|
|
11724
12118
|
}
|
|
11725
12119
|
|
|
11726
|
-
function
|
|
11727
|
-
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
"The object passed back from useOpaqueIdentifier is meant to be " +
|
|
11734
|
-
"passed through to attributes only. Do not read the " +
|
|
11735
|
-
"value directly."
|
|
11736
|
-
);
|
|
11737
|
-
|
|
11738
|
-
didWarnAboutUseOpaqueIdentifier[name] = true;
|
|
11739
|
-
}
|
|
11740
|
-
}
|
|
11741
|
-
}
|
|
12120
|
+
function mountId() {
|
|
12121
|
+
var hook = mountWorkInProgressHook();
|
|
12122
|
+
var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we
|
|
12123
|
+
// should do this in Fiber, too? Deferring this decision for now because
|
|
12124
|
+
// there's no other place to store the prefix except for an internal field on
|
|
12125
|
+
// the public createRoot object, which the fiber tree does not currently have
|
|
12126
|
+
// a reference to.
|
|
11742
12127
|
|
|
11743
|
-
|
|
11744
|
-
var
|
|
11745
|
-
null,
|
|
11746
|
-
warnOnOpaqueIdentifierAccessInDEV.bind(null, currentlyRenderingFiber$1)
|
|
11747
|
-
);
|
|
12128
|
+
var identifierPrefix = root.identifierPrefix;
|
|
12129
|
+
var id;
|
|
11748
12130
|
|
|
11749
12131
|
{
|
|
11750
|
-
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
return _id;
|
|
12132
|
+
// Use a lowercase r prefix for client-generated ids.
|
|
12133
|
+
var globalClientId = globalClientIdCounter++;
|
|
12134
|
+
id = identifierPrefix + "r:" + globalClientId.toString(32);
|
|
11754
12135
|
}
|
|
11755
|
-
}
|
|
11756
12136
|
|
|
11757
|
-
|
|
11758
|
-
var id = updateState()[0];
|
|
12137
|
+
hook.memoizedState = id;
|
|
11759
12138
|
return id;
|
|
11760
12139
|
}
|
|
11761
12140
|
|
|
11762
|
-
function
|
|
11763
|
-
var
|
|
12141
|
+
function updateId() {
|
|
12142
|
+
var hook = updateWorkInProgressHook();
|
|
12143
|
+
var id = hook.memoizedState;
|
|
11764
12144
|
return id;
|
|
11765
12145
|
}
|
|
11766
12146
|
|
|
@@ -11788,7 +12168,6 @@ function dispatchReducerAction(fiber, queue, action) {
|
|
|
11788
12168
|
enqueueRenderPhaseUpdate(queue, update);
|
|
11789
12169
|
} else {
|
|
11790
12170
|
enqueueUpdate$1(fiber, queue, update);
|
|
11791
|
-
|
|
11792
12171
|
var eventTime = requestEventTime();
|
|
11793
12172
|
var root = scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
11794
12173
|
|
|
@@ -11796,6 +12175,8 @@ function dispatchReducerAction(fiber, queue, action) {
|
|
|
11796
12175
|
entangleTransitionUpdate(root, queue, lane);
|
|
11797
12176
|
}
|
|
11798
12177
|
}
|
|
12178
|
+
|
|
12179
|
+
markUpdateInDevTools(fiber, lane);
|
|
11799
12180
|
}
|
|
11800
12181
|
|
|
11801
12182
|
function dispatchSetState(fiber, queue, action) {
|
|
@@ -11875,6 +12256,8 @@ function dispatchSetState(fiber, queue, action) {
|
|
|
11875
12256
|
entangleTransitionUpdate(root, queue, lane);
|
|
11876
12257
|
}
|
|
11877
12258
|
}
|
|
12259
|
+
|
|
12260
|
+
markUpdateInDevTools(fiber, lane);
|
|
11878
12261
|
}
|
|
11879
12262
|
|
|
11880
12263
|
function isRenderPhaseUpdate(fiber) {
|
|
@@ -11953,6 +12336,12 @@ function entangleTransitionUpdate(root, queue, lane) {
|
|
|
11953
12336
|
}
|
|
11954
12337
|
}
|
|
11955
12338
|
|
|
12339
|
+
function markUpdateInDevTools(fiber, lane, action) {
|
|
12340
|
+
{
|
|
12341
|
+
markStateUpdateScheduled(fiber, lane);
|
|
12342
|
+
}
|
|
12343
|
+
}
|
|
12344
|
+
|
|
11956
12345
|
var ContextOnlyDispatcher = {
|
|
11957
12346
|
readContext: readContext,
|
|
11958
12347
|
useCallback: throwInvalidHookError,
|
|
@@ -11970,7 +12359,7 @@ var ContextOnlyDispatcher = {
|
|
|
11970
12359
|
useTransition: throwInvalidHookError,
|
|
11971
12360
|
useMutableSource: throwInvalidHookError,
|
|
11972
12361
|
useSyncExternalStore: throwInvalidHookError,
|
|
11973
|
-
|
|
12362
|
+
useId: throwInvalidHookError,
|
|
11974
12363
|
unstable_isNewReconciler: enableNewReconciler
|
|
11975
12364
|
};
|
|
11976
12365
|
|
|
@@ -12107,10 +12496,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12107
12496
|
mountHookTypesDev();
|
|
12108
12497
|
return mountSyncExternalStore(subscribe, getSnapshot);
|
|
12109
12498
|
},
|
|
12110
|
-
|
|
12111
|
-
currentHookNameInDev = "
|
|
12499
|
+
useId: function() {
|
|
12500
|
+
currentHookNameInDev = "useId";
|
|
12112
12501
|
mountHookTypesDev();
|
|
12113
|
-
return
|
|
12502
|
+
return mountId();
|
|
12114
12503
|
},
|
|
12115
12504
|
unstable_isNewReconciler: enableNewReconciler
|
|
12116
12505
|
};
|
|
@@ -12215,10 +12604,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12215
12604
|
updateHookTypesDev();
|
|
12216
12605
|
return mountSyncExternalStore(subscribe, getSnapshot);
|
|
12217
12606
|
},
|
|
12218
|
-
|
|
12219
|
-
currentHookNameInDev = "
|
|
12607
|
+
useId: function() {
|
|
12608
|
+
currentHookNameInDev = "useId";
|
|
12220
12609
|
updateHookTypesDev();
|
|
12221
|
-
return
|
|
12610
|
+
return mountId();
|
|
12222
12611
|
},
|
|
12223
12612
|
unstable_isNewReconciler: enableNewReconciler
|
|
12224
12613
|
};
|
|
@@ -12323,10 +12712,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12323
12712
|
updateHookTypesDev();
|
|
12324
12713
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
12325
12714
|
},
|
|
12326
|
-
|
|
12327
|
-
currentHookNameInDev = "
|
|
12715
|
+
useId: function() {
|
|
12716
|
+
currentHookNameInDev = "useId";
|
|
12328
12717
|
updateHookTypesDev();
|
|
12329
|
-
return
|
|
12718
|
+
return updateId();
|
|
12330
12719
|
},
|
|
12331
12720
|
unstable_isNewReconciler: enableNewReconciler
|
|
12332
12721
|
};
|
|
@@ -12431,10 +12820,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12431
12820
|
updateHookTypesDev();
|
|
12432
12821
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
12433
12822
|
},
|
|
12434
|
-
|
|
12435
|
-
currentHookNameInDev = "
|
|
12823
|
+
useId: function() {
|
|
12824
|
+
currentHookNameInDev = "useId";
|
|
12436
12825
|
updateHookTypesDev();
|
|
12437
|
-
return
|
|
12826
|
+
return updateId();
|
|
12438
12827
|
},
|
|
12439
12828
|
unstable_isNewReconciler: enableNewReconciler
|
|
12440
12829
|
};
|
|
@@ -12555,11 +12944,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12555
12944
|
mountHookTypesDev();
|
|
12556
12945
|
return mountSyncExternalStore(subscribe, getSnapshot);
|
|
12557
12946
|
},
|
|
12558
|
-
|
|
12559
|
-
currentHookNameInDev = "
|
|
12947
|
+
useId: function() {
|
|
12948
|
+
currentHookNameInDev = "useId";
|
|
12560
12949
|
warnInvalidHookAccess();
|
|
12561
12950
|
mountHookTypesDev();
|
|
12562
|
-
return
|
|
12951
|
+
return mountId();
|
|
12563
12952
|
},
|
|
12564
12953
|
unstable_isNewReconciler: enableNewReconciler
|
|
12565
12954
|
};
|
|
@@ -12680,11 +13069,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12680
13069
|
updateHookTypesDev();
|
|
12681
13070
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
12682
13071
|
},
|
|
12683
|
-
|
|
12684
|
-
currentHookNameInDev = "
|
|
13072
|
+
useId: function() {
|
|
13073
|
+
currentHookNameInDev = "useId";
|
|
12685
13074
|
warnInvalidHookAccess();
|
|
12686
13075
|
updateHookTypesDev();
|
|
12687
|
-
return
|
|
13076
|
+
return updateId();
|
|
12688
13077
|
},
|
|
12689
13078
|
unstable_isNewReconciler: enableNewReconciler
|
|
12690
13079
|
};
|
|
@@ -12805,11 +13194,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12805
13194
|
updateHookTypesDev();
|
|
12806
13195
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
12807
13196
|
},
|
|
12808
|
-
|
|
12809
|
-
currentHookNameInDev = "
|
|
13197
|
+
useId: function() {
|
|
13198
|
+
currentHookNameInDev = "useId";
|
|
12810
13199
|
warnInvalidHookAccess();
|
|
12811
13200
|
updateHookTypesDev();
|
|
12812
|
-
return
|
|
13201
|
+
return updateId();
|
|
12813
13202
|
},
|
|
12814
13203
|
unstable_isNewReconciler: enableNewReconciler
|
|
12815
13204
|
};
|
|
@@ -13265,165 +13654,158 @@ function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
|
|
|
13265
13654
|
sourceFiber.memoizedState = currentSource.memoizedState;
|
|
13266
13655
|
sourceFiber.lanes = currentSource.lanes;
|
|
13267
13656
|
} else {
|
|
13268
|
-
sourceFiber.updateQueue = null;
|
|
13269
|
-
sourceFiber.memoizedState = null;
|
|
13270
|
-
}
|
|
13271
|
-
}
|
|
13272
|
-
}
|
|
13273
|
-
|
|
13274
|
-
function markNearestSuspenseBoundaryShouldCapture(
|
|
13275
|
-
returnFiber,
|
|
13276
|
-
sourceFiber,
|
|
13277
|
-
root,
|
|
13278
|
-
rootRenderLanes
|
|
13279
|
-
) {
|
|
13280
|
-
var hasInvisibleParentBoundary = hasSuspenseContext(
|
|
13281
|
-
suspenseStackCursor.current,
|
|
13282
|
-
InvisibleParentSuspenseContext
|
|
13283
|
-
);
|
|
13284
|
-
var node = returnFiber;
|
|
13285
|
-
|
|
13286
|
-
do {
|
|
13287
|
-
if (
|
|
13288
|
-
node.tag === SuspenseComponent &&
|
|
13289
|
-
shouldCaptureSuspense(node, hasInvisibleParentBoundary)
|
|
13290
|
-
) {
|
|
13291
|
-
// Found the nearest boundary.
|
|
13292
|
-
var suspenseBoundary = node; // This marks a Suspense boundary so that when we're unwinding the stack,
|
|
13293
|
-
// it captures the suspended "exception" and does a second (fallback) pass.
|
|
13294
|
-
|
|
13295
|
-
if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
|
|
13296
|
-
// Legacy Mode Suspense
|
|
13297
|
-
//
|
|
13298
|
-
// If the boundary is in legacy mode, we should *not*
|
|
13299
|
-
// suspend the commit. Pretend as if the suspended component rendered
|
|
13300
|
-
// null and keep rendering. When the Suspense boundary completes,
|
|
13301
|
-
// we'll do a second pass to render the fallback.
|
|
13302
|
-
if (suspenseBoundary === returnFiber) {
|
|
13303
|
-
// Special case where we suspended while reconciling the children of
|
|
13304
|
-
// a Suspense boundary's inner Offscreen wrapper fiber. This happens
|
|
13305
|
-
// when a React.lazy component is a direct child of a
|
|
13306
|
-
// Suspense boundary.
|
|
13307
|
-
//
|
|
13308
|
-
// Suspense boundaries are implemented as multiple fibers, but they
|
|
13309
|
-
// are a single conceptual unit. The legacy mode behavior where we
|
|
13310
|
-
// pretend the suspended fiber committed as `null` won't work,
|
|
13311
|
-
// because in this case the "suspended" fiber is the inner
|
|
13312
|
-
// Offscreen wrapper.
|
|
13313
|
-
//
|
|
13314
|
-
// Because the contents of the boundary haven't started rendering
|
|
13315
|
-
// yet (i.e. nothing in the tree has partially rendered) we can
|
|
13316
|
-
// switch to the regular, concurrent mode behavior: mark the
|
|
13317
|
-
// boundary with ShouldCapture and enter the unwind phase.
|
|
13318
|
-
suspenseBoundary.flags |= ShouldCapture;
|
|
13319
|
-
} else {
|
|
13320
|
-
suspenseBoundary.flags |= DidCapture;
|
|
13321
|
-
sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete.
|
|
13322
|
-
// But we shouldn't call any lifecycle methods or callbacks. Remove
|
|
13323
|
-
// all lifecycle effect tags.
|
|
13324
|
-
|
|
13325
|
-
sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
|
|
13326
|
-
|
|
13327
|
-
if (enablePersistentOffscreenHostContainer) {
|
|
13328
|
-
// Another legacy Suspense quirk. In persistent mode, if this is the
|
|
13329
|
-
// initial mount, override the props of the host container to hide
|
|
13330
|
-
// its contents.
|
|
13331
|
-
var currentSuspenseBoundary = suspenseBoundary.alternate;
|
|
13332
|
-
|
|
13333
|
-
if (currentSuspenseBoundary === null) {
|
|
13334
|
-
var offscreenFiber = suspenseBoundary.child;
|
|
13335
|
-
var offscreenContainer = offscreenFiber.child;
|
|
13336
|
-
|
|
13337
|
-
if (offscreenContainer !== null) {
|
|
13338
|
-
var children = offscreenContainer.memoizedProps.children;
|
|
13339
|
-
var containerProps = getOffscreenContainerProps(
|
|
13340
|
-
"hidden",
|
|
13341
|
-
children
|
|
13342
|
-
);
|
|
13343
|
-
offscreenContainer.pendingProps = containerProps;
|
|
13344
|
-
offscreenContainer.memoizedProps = containerProps;
|
|
13345
|
-
}
|
|
13346
|
-
}
|
|
13347
|
-
}
|
|
13348
|
-
|
|
13349
|
-
if (sourceFiber.tag === ClassComponent) {
|
|
13350
|
-
var currentSourceFiber = sourceFiber.alternate;
|
|
13351
|
-
|
|
13352
|
-
if (currentSourceFiber === null) {
|
|
13353
|
-
// This is a new mount. Change the tag so it's not mistaken for a
|
|
13354
|
-
// completed class component. For example, we should not call
|
|
13355
|
-
// componentWillUnmount if it is deleted.
|
|
13356
|
-
sourceFiber.tag = IncompleteClassComponent;
|
|
13357
|
-
} else {
|
|
13358
|
-
// When we try rendering again, we should not reuse the current fiber,
|
|
13359
|
-
// since it's known to be in an inconsistent state. Use a force update to
|
|
13360
|
-
// prevent a bail out.
|
|
13361
|
-
var update = createUpdate(NoTimestamp, SyncLane);
|
|
13362
|
-
update.tag = ForceUpdate;
|
|
13363
|
-
enqueueUpdate(sourceFiber, update);
|
|
13364
|
-
}
|
|
13365
|
-
} // The source fiber did not complete. Mark it with Sync priority to
|
|
13366
|
-
// indicate that it still has pending work.
|
|
13367
|
-
|
|
13368
|
-
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
|
|
13369
|
-
}
|
|
13370
|
-
|
|
13371
|
-
return suspenseBoundary;
|
|
13372
|
-
} // Confirmed that the boundary is in a concurrent mode tree. Continue
|
|
13373
|
-
// with the normal suspend path.
|
|
13374
|
-
//
|
|
13375
|
-
// After this we'll use a set of heuristics to determine whether this
|
|
13376
|
-
// render pass will run to completion or restart or "suspend" the commit.
|
|
13377
|
-
// The actual logic for this is spread out in different places.
|
|
13378
|
-
//
|
|
13379
|
-
// This first principle is that if we're going to suspend when we complete
|
|
13380
|
-
// a root, then we should also restart if we get an update or ping that
|
|
13381
|
-
// might unsuspend it, and vice versa. The only reason to suspend is
|
|
13382
|
-
// because you think you might want to restart before committing. However,
|
|
13383
|
-
// it doesn't make sense to restart only while in the period we're suspended.
|
|
13384
|
-
//
|
|
13385
|
-
// Restarting too aggressively is also not good because it starves out any
|
|
13386
|
-
// intermediate loading state. So we use heuristics to determine when.
|
|
13387
|
-
// Suspense Heuristics
|
|
13388
|
-
//
|
|
13389
|
-
// If nothing threw a Promise or all the same fallbacks are already showing,
|
|
13390
|
-
// then don't suspend/restart.
|
|
13391
|
-
//
|
|
13392
|
-
// If this is an initial render of a new tree of Suspense boundaries and
|
|
13393
|
-
// those trigger a fallback, then don't suspend/restart. We want to ensure
|
|
13394
|
-
// that we can show the initial loading state as quickly as possible.
|
|
13395
|
-
//
|
|
13396
|
-
// If we hit a "Delayed" case, such as when we'd switch from content back into
|
|
13397
|
-
// a fallback, then we should always suspend/restart. Transitions apply
|
|
13398
|
-
// to this case. If none is defined, JND is used instead.
|
|
13399
|
-
//
|
|
13400
|
-
// If we're already showing a fallback and it gets "retried", allowing us to show
|
|
13401
|
-
// another level, but there's still an inner boundary that would show a fallback,
|
|
13402
|
-
// then we suspend/restart for 500ms since the last time we showed a fallback
|
|
13403
|
-
// anywhere in the tree. This effectively throttles progressive loading into a
|
|
13404
|
-
// consistent train of commits. This also gives us an opportunity to restart to
|
|
13405
|
-
// get to the completed state slightly earlier.
|
|
13406
|
-
//
|
|
13407
|
-
// If there's ambiguity due to batching it's resolved in preference of:
|
|
13408
|
-
// 1) "delayed", 2) "initial render", 3) "retry".
|
|
13409
|
-
//
|
|
13410
|
-
// We want to ensure that a "busy" state doesn't get force committed. We want to
|
|
13411
|
-
// ensure that new initial loading states can commit as soon as possible.
|
|
13657
|
+
sourceFiber.updateQueue = null;
|
|
13658
|
+
sourceFiber.memoizedState = null;
|
|
13659
|
+
}
|
|
13660
|
+
}
|
|
13661
|
+
}
|
|
13412
13662
|
|
|
13413
|
-
|
|
13414
|
-
|
|
13663
|
+
function getNearestSuspenseBoundaryToCapture(returnFiber) {
|
|
13664
|
+
var node = returnFiber;
|
|
13415
13665
|
|
|
13416
|
-
|
|
13417
|
-
|
|
13666
|
+
do {
|
|
13667
|
+
if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) {
|
|
13668
|
+
return node;
|
|
13418
13669
|
} // This boundary already captured during this render. Continue to the next
|
|
13419
13670
|
// boundary.
|
|
13420
13671
|
|
|
13421
13672
|
node = node.return;
|
|
13422
|
-
} while (node !== null);
|
|
13673
|
+
} while (node !== null);
|
|
13423
13674
|
|
|
13424
13675
|
return null;
|
|
13425
13676
|
}
|
|
13426
13677
|
|
|
13678
|
+
function markSuspenseBoundaryShouldCapture(
|
|
13679
|
+
suspenseBoundary,
|
|
13680
|
+
returnFiber,
|
|
13681
|
+
sourceFiber,
|
|
13682
|
+
root,
|
|
13683
|
+
rootRenderLanes
|
|
13684
|
+
) {
|
|
13685
|
+
// This marks a Suspense boundary so that when we're unwinding the stack,
|
|
13686
|
+
// it captures the suspended "exception" and does a second (fallback) pass.
|
|
13687
|
+
if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
|
|
13688
|
+
// Legacy Mode Suspense
|
|
13689
|
+
//
|
|
13690
|
+
// If the boundary is in legacy mode, we should *not*
|
|
13691
|
+
// suspend the commit. Pretend as if the suspended component rendered
|
|
13692
|
+
// null and keep rendering. When the Suspense boundary completes,
|
|
13693
|
+
// we'll do a second pass to render the fallback.
|
|
13694
|
+
if (suspenseBoundary === returnFiber) {
|
|
13695
|
+
// Special case where we suspended while reconciling the children of
|
|
13696
|
+
// a Suspense boundary's inner Offscreen wrapper fiber. This happens
|
|
13697
|
+
// when a React.lazy component is a direct child of a
|
|
13698
|
+
// Suspense boundary.
|
|
13699
|
+
//
|
|
13700
|
+
// Suspense boundaries are implemented as multiple fibers, but they
|
|
13701
|
+
// are a single conceptual unit. The legacy mode behavior where we
|
|
13702
|
+
// pretend the suspended fiber committed as `null` won't work,
|
|
13703
|
+
// because in this case the "suspended" fiber is the inner
|
|
13704
|
+
// Offscreen wrapper.
|
|
13705
|
+
//
|
|
13706
|
+
// Because the contents of the boundary haven't started rendering
|
|
13707
|
+
// yet (i.e. nothing in the tree has partially rendered) we can
|
|
13708
|
+
// switch to the regular, concurrent mode behavior: mark the
|
|
13709
|
+
// boundary with ShouldCapture and enter the unwind phase.
|
|
13710
|
+
suspenseBoundary.flags |= ShouldCapture;
|
|
13711
|
+
} else {
|
|
13712
|
+
suspenseBoundary.flags |= DidCapture;
|
|
13713
|
+
sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete.
|
|
13714
|
+
// But we shouldn't call any lifecycle methods or callbacks. Remove
|
|
13715
|
+
// all lifecycle effect tags.
|
|
13716
|
+
|
|
13717
|
+
sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
|
|
13718
|
+
|
|
13719
|
+
if (enablePersistentOffscreenHostContainer) {
|
|
13720
|
+
// Another legacy Suspense quirk. In persistent mode, if this is the
|
|
13721
|
+
// initial mount, override the props of the host container to hide
|
|
13722
|
+
// its contents.
|
|
13723
|
+
var currentSuspenseBoundary = suspenseBoundary.alternate;
|
|
13724
|
+
|
|
13725
|
+
if (currentSuspenseBoundary === null) {
|
|
13726
|
+
var offscreenFiber = suspenseBoundary.child;
|
|
13727
|
+
var offscreenContainer = offscreenFiber.child;
|
|
13728
|
+
|
|
13729
|
+
if (offscreenContainer !== null) {
|
|
13730
|
+
var children = offscreenContainer.memoizedProps.children;
|
|
13731
|
+
var containerProps = getOffscreenContainerProps("hidden", children);
|
|
13732
|
+
offscreenContainer.pendingProps = containerProps;
|
|
13733
|
+
offscreenContainer.memoizedProps = containerProps;
|
|
13734
|
+
}
|
|
13735
|
+
}
|
|
13736
|
+
}
|
|
13737
|
+
|
|
13738
|
+
if (sourceFiber.tag === ClassComponent) {
|
|
13739
|
+
var currentSourceFiber = sourceFiber.alternate;
|
|
13740
|
+
|
|
13741
|
+
if (currentSourceFiber === null) {
|
|
13742
|
+
// This is a new mount. Change the tag so it's not mistaken for a
|
|
13743
|
+
// completed class component. For example, we should not call
|
|
13744
|
+
// componentWillUnmount if it is deleted.
|
|
13745
|
+
sourceFiber.tag = IncompleteClassComponent;
|
|
13746
|
+
} else {
|
|
13747
|
+
// When we try rendering again, we should not reuse the current fiber,
|
|
13748
|
+
// since it's known to be in an inconsistent state. Use a force update to
|
|
13749
|
+
// prevent a bail out.
|
|
13750
|
+
var update = createUpdate(NoTimestamp, SyncLane);
|
|
13751
|
+
update.tag = ForceUpdate;
|
|
13752
|
+
enqueueUpdate(sourceFiber, update);
|
|
13753
|
+
}
|
|
13754
|
+
} // The source fiber did not complete. Mark it with Sync priority to
|
|
13755
|
+
// indicate that it still has pending work.
|
|
13756
|
+
|
|
13757
|
+
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
|
|
13758
|
+
}
|
|
13759
|
+
|
|
13760
|
+
return suspenseBoundary;
|
|
13761
|
+
} // Confirmed that the boundary is in a concurrent mode tree. Continue
|
|
13762
|
+
// with the normal suspend path.
|
|
13763
|
+
//
|
|
13764
|
+
// After this we'll use a set of heuristics to determine whether this
|
|
13765
|
+
// render pass will run to completion or restart or "suspend" the commit.
|
|
13766
|
+
// The actual logic for this is spread out in different places.
|
|
13767
|
+
//
|
|
13768
|
+
// This first principle is that if we're going to suspend when we complete
|
|
13769
|
+
// a root, then we should also restart if we get an update or ping that
|
|
13770
|
+
// might unsuspend it, and vice versa. The only reason to suspend is
|
|
13771
|
+
// because you think you might want to restart before committing. However,
|
|
13772
|
+
// it doesn't make sense to restart only while in the period we're suspended.
|
|
13773
|
+
//
|
|
13774
|
+
// Restarting too aggressively is also not good because it starves out any
|
|
13775
|
+
// intermediate loading state. So we use heuristics to determine when.
|
|
13776
|
+
// Suspense Heuristics
|
|
13777
|
+
//
|
|
13778
|
+
// If nothing threw a Promise or all the same fallbacks are already showing,
|
|
13779
|
+
// then don't suspend/restart.
|
|
13780
|
+
//
|
|
13781
|
+
// If this is an initial render of a new tree of Suspense boundaries and
|
|
13782
|
+
// those trigger a fallback, then don't suspend/restart. We want to ensure
|
|
13783
|
+
// that we can show the initial loading state as quickly as possible.
|
|
13784
|
+
//
|
|
13785
|
+
// If we hit a "Delayed" case, such as when we'd switch from content back into
|
|
13786
|
+
// a fallback, then we should always suspend/restart. Transitions apply
|
|
13787
|
+
// to this case. If none is defined, JND is used instead.
|
|
13788
|
+
//
|
|
13789
|
+
// If we're already showing a fallback and it gets "retried", allowing us to show
|
|
13790
|
+
// another level, but there's still an inner boundary that would show a fallback,
|
|
13791
|
+
// then we suspend/restart for 500ms since the last time we showed a fallback
|
|
13792
|
+
// anywhere in the tree. This effectively throttles progressive loading into a
|
|
13793
|
+
// consistent train of commits. This also gives us an opportunity to restart to
|
|
13794
|
+
// get to the completed state slightly earlier.
|
|
13795
|
+
//
|
|
13796
|
+
// If there's ambiguity due to batching it's resolved in preference of:
|
|
13797
|
+
// 1) "delayed", 2) "initial render", 3) "retry".
|
|
13798
|
+
//
|
|
13799
|
+
// We want to ensure that a "busy" state doesn't get force committed. We want to
|
|
13800
|
+
// ensure that new initial loading states can commit as soon as possible.
|
|
13801
|
+
|
|
13802
|
+
suspenseBoundary.flags |= ShouldCapture; // TODO: I think we can remove this, since we now use `DidCapture` in
|
|
13803
|
+
// the begin phase to prevent an early bailout.
|
|
13804
|
+
|
|
13805
|
+
suspenseBoundary.lanes = rootRenderLanes;
|
|
13806
|
+
return suspenseBoundary;
|
|
13807
|
+
}
|
|
13808
|
+
|
|
13427
13809
|
function throwException(
|
|
13428
13810
|
root,
|
|
13429
13811
|
returnFiber,
|
|
@@ -13450,14 +13832,17 @@ function throwException(
|
|
|
13450
13832
|
var wakeable = value;
|
|
13451
13833
|
resetSuspendedComponent(sourceFiber);
|
|
13452
13834
|
|
|
13453
|
-
var suspenseBoundary =
|
|
13454
|
-
returnFiber,
|
|
13455
|
-
sourceFiber,
|
|
13456
|
-
root,
|
|
13457
|
-
rootRenderLanes
|
|
13458
|
-
);
|
|
13835
|
+
var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
|
|
13459
13836
|
|
|
13460
13837
|
if (suspenseBoundary !== null) {
|
|
13838
|
+
suspenseBoundary.flags &= ~ForceClientRender;
|
|
13839
|
+
markSuspenseBoundaryShouldCapture(
|
|
13840
|
+
suspenseBoundary,
|
|
13841
|
+
returnFiber,
|
|
13842
|
+
sourceFiber,
|
|
13843
|
+
root,
|
|
13844
|
+
rootRenderLanes
|
|
13845
|
+
);
|
|
13461
13846
|
attachWakeableListeners(
|
|
13462
13847
|
suspenseBoundary,
|
|
13463
13848
|
root,
|
|
@@ -14045,7 +14430,12 @@ function completeSuspendedOffscreenHostContainer(current, workInProgress) {
|
|
|
14045
14430
|
}
|
|
14046
14431
|
|
|
14047
14432
|
function completeWork(current, workInProgress, renderLanes) {
|
|
14048
|
-
var newProps = workInProgress.pendingProps;
|
|
14433
|
+
var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing
|
|
14434
|
+
// to the current tree provider fiber is just as fast and less error-prone.
|
|
14435
|
+
// Ideally we would have a special version of the work loop only
|
|
14436
|
+
// for hydration.
|
|
14437
|
+
|
|
14438
|
+
popTreeContext(workInProgress);
|
|
14049
14439
|
|
|
14050
14440
|
switch (workInProgress.tag) {
|
|
14051
14441
|
case IndeterminateComponent:
|
|
@@ -14097,7 +14487,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
14097
14487
|
// Schedule an effect to clear this container at the start of the next commit.
|
|
14098
14488
|
// This handles the case of React rendering into a container with previous children.
|
|
14099
14489
|
// It's also safe to do for updates too, because current.child would only be null
|
|
14100
|
-
// if the previous render was null (so the
|
|
14490
|
+
// if the previous render was null (so the container would already be empty).
|
|
14101
14491
|
workInProgress.flags |= Snapshot;
|
|
14102
14492
|
}
|
|
14103
14493
|
}
|
|
@@ -14238,7 +14628,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
14238
14628
|
else {
|
|
14239
14629
|
var prevState = current.memoizedState;
|
|
14240
14630
|
prevDidTimeout = prevState !== null;
|
|
14241
|
-
}
|
|
14631
|
+
}
|
|
14242
14632
|
// an effect to toggle the subtree's visibility. When we switch from
|
|
14243
14633
|
// fallback -> primary, the inner Offscreen fiber schedules this effect
|
|
14244
14634
|
// as part of its normal complete phase. But when we switch from
|
|
@@ -14251,8 +14641,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
14251
14641
|
// is active that we have to do anything special.
|
|
14252
14642
|
|
|
14253
14643
|
if (nextDidTimeout && !prevDidTimeout) {
|
|
14254
|
-
var
|
|
14255
|
-
|
|
14644
|
+
var _offscreenFiber = workInProgress.child;
|
|
14645
|
+
_offscreenFiber.flags |= Visibility; // TODO: This will still suspend a synchronous tree if anything
|
|
14256
14646
|
// in the concurrent tree already suspended during this render.
|
|
14257
14647
|
// This is a known bug.
|
|
14258
14648
|
|
|
@@ -14266,7 +14656,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
14266
14656
|
// should be able to immediately restart from within throwException.
|
|
14267
14657
|
var hasInvisibleChildContext =
|
|
14268
14658
|
current === null &&
|
|
14269
|
-
workInProgress.memoizedProps.unstable_avoidThisFallback !== true
|
|
14659
|
+
(workInProgress.memoizedProps.unstable_avoidThisFallback !== true ||
|
|
14660
|
+
!enableSuspenseAvoidThisFallback);
|
|
14270
14661
|
|
|
14271
14662
|
if (
|
|
14272
14663
|
hasInvisibleChildContext ||
|
|
@@ -14711,8 +15102,13 @@ function updateForwardRef(
|
|
|
14711
15102
|
var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent
|
|
14712
15103
|
|
|
14713
15104
|
var nextChildren;
|
|
15105
|
+
var hasId;
|
|
14714
15106
|
prepareToReadContext(workInProgress, renderLanes);
|
|
14715
15107
|
|
|
15108
|
+
{
|
|
15109
|
+
markComponentRenderStarted(workInProgress);
|
|
15110
|
+
}
|
|
15111
|
+
|
|
14716
15112
|
{
|
|
14717
15113
|
ReactCurrentOwner$1.current = workInProgress;
|
|
14718
15114
|
setIsRendering(true);
|
|
@@ -14724,6 +15120,7 @@ function updateForwardRef(
|
|
|
14724
15120
|
ref,
|
|
14725
15121
|
renderLanes
|
|
14726
15122
|
);
|
|
15123
|
+
hasId = checkDidRenderIdHook();
|
|
14727
15124
|
|
|
14728
15125
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
14729
15126
|
setIsStrictModeForDevtools(true);
|
|
@@ -14737,6 +15134,7 @@ function updateForwardRef(
|
|
|
14737
15134
|
ref,
|
|
14738
15135
|
renderLanes
|
|
14739
15136
|
);
|
|
15137
|
+
hasId = checkDidRenderIdHook();
|
|
14740
15138
|
} finally {
|
|
14741
15139
|
setIsStrictModeForDevtools(false);
|
|
14742
15140
|
}
|
|
@@ -14745,10 +15143,14 @@ function updateForwardRef(
|
|
|
14745
15143
|
setIsRendering(false);
|
|
14746
15144
|
}
|
|
14747
15145
|
|
|
15146
|
+
{
|
|
15147
|
+
markComponentRenderStopped();
|
|
15148
|
+
}
|
|
15149
|
+
|
|
14748
15150
|
if (current !== null && !didReceiveUpdate) {
|
|
14749
15151
|
bailoutHooks(current, workInProgress, renderLanes);
|
|
14750
15152
|
return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
|
|
14751
|
-
}
|
|
15153
|
+
}
|
|
14752
15154
|
|
|
14753
15155
|
workInProgress.flags |= PerformedWork;
|
|
14754
15156
|
reconcileChildren(current, workInProgress, nextChildren, renderLanes);
|
|
@@ -15181,8 +15583,13 @@ function updateFunctionComponent(
|
|
|
15181
15583
|
}
|
|
15182
15584
|
|
|
15183
15585
|
var nextChildren;
|
|
15586
|
+
var hasId;
|
|
15184
15587
|
prepareToReadContext(workInProgress, renderLanes);
|
|
15185
15588
|
|
|
15589
|
+
{
|
|
15590
|
+
markComponentRenderStarted(workInProgress);
|
|
15591
|
+
}
|
|
15592
|
+
|
|
15186
15593
|
{
|
|
15187
15594
|
ReactCurrentOwner$1.current = workInProgress;
|
|
15188
15595
|
setIsRendering(true);
|
|
@@ -15194,6 +15601,7 @@ function updateFunctionComponent(
|
|
|
15194
15601
|
context,
|
|
15195
15602
|
renderLanes
|
|
15196
15603
|
);
|
|
15604
|
+
hasId = checkDidRenderIdHook();
|
|
15197
15605
|
|
|
15198
15606
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
15199
15607
|
setIsStrictModeForDevtools(true);
|
|
@@ -15207,6 +15615,7 @@ function updateFunctionComponent(
|
|
|
15207
15615
|
context,
|
|
15208
15616
|
renderLanes
|
|
15209
15617
|
);
|
|
15618
|
+
hasId = checkDidRenderIdHook();
|
|
15210
15619
|
} finally {
|
|
15211
15620
|
setIsStrictModeForDevtools(false);
|
|
15212
15621
|
}
|
|
@@ -15215,10 +15624,14 @@ function updateFunctionComponent(
|
|
|
15215
15624
|
setIsRendering(false);
|
|
15216
15625
|
}
|
|
15217
15626
|
|
|
15627
|
+
{
|
|
15628
|
+
markComponentRenderStopped();
|
|
15629
|
+
}
|
|
15630
|
+
|
|
15218
15631
|
if (current !== null && !didReceiveUpdate) {
|
|
15219
15632
|
bailoutHooks(current, workInProgress, renderLanes);
|
|
15220
15633
|
return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
|
|
15221
|
-
}
|
|
15634
|
+
}
|
|
15222
15635
|
|
|
15223
15636
|
workInProgress.flags |= PerformedWork;
|
|
15224
15637
|
reconcileChildren(current, workInProgress, nextChildren, renderLanes);
|
|
@@ -15402,6 +15815,10 @@ function finishClassComponent(
|
|
|
15402
15815
|
stopProfilerTimerIfRunning();
|
|
15403
15816
|
}
|
|
15404
15817
|
} else {
|
|
15818
|
+
{
|
|
15819
|
+
markComponentRenderStarted(workInProgress);
|
|
15820
|
+
}
|
|
15821
|
+
|
|
15405
15822
|
{
|
|
15406
15823
|
setIsRendering(true);
|
|
15407
15824
|
nextChildren = instance.render();
|
|
@@ -15418,6 +15835,10 @@ function finishClassComponent(
|
|
|
15418
15835
|
|
|
15419
15836
|
setIsRendering(false);
|
|
15420
15837
|
}
|
|
15838
|
+
|
|
15839
|
+
{
|
|
15840
|
+
markComponentRenderStopped();
|
|
15841
|
+
}
|
|
15421
15842
|
} // React DevTools reads this flag.
|
|
15422
15843
|
|
|
15423
15844
|
workInProgress.flags |= PerformedWork;
|
|
@@ -15747,6 +16168,11 @@ function mountIndeterminateComponent(
|
|
|
15747
16168
|
|
|
15748
16169
|
prepareToReadContext(workInProgress, renderLanes);
|
|
15749
16170
|
var value;
|
|
16171
|
+
var hasId;
|
|
16172
|
+
|
|
16173
|
+
{
|
|
16174
|
+
markComponentRenderStarted(workInProgress);
|
|
16175
|
+
}
|
|
15750
16176
|
|
|
15751
16177
|
{
|
|
15752
16178
|
if (
|
|
@@ -15781,9 +16207,14 @@ function mountIndeterminateComponent(
|
|
|
15781
16207
|
context,
|
|
15782
16208
|
renderLanes
|
|
15783
16209
|
);
|
|
16210
|
+
hasId = checkDidRenderIdHook();
|
|
15784
16211
|
setIsRendering(false);
|
|
15785
16212
|
}
|
|
15786
16213
|
|
|
16214
|
+
{
|
|
16215
|
+
markComponentRenderStopped();
|
|
16216
|
+
} // React DevTools reads this flag.
|
|
16217
|
+
|
|
15787
16218
|
workInProgress.flags |= PerformedWork;
|
|
15788
16219
|
|
|
15789
16220
|
{
|
|
@@ -15887,6 +16318,7 @@ function mountIndeterminateComponent(
|
|
|
15887
16318
|
context,
|
|
15888
16319
|
renderLanes
|
|
15889
16320
|
);
|
|
16321
|
+
hasId = checkDidRenderIdHook();
|
|
15890
16322
|
} finally {
|
|
15891
16323
|
setIsStrictModeForDevtools(false);
|
|
15892
16324
|
}
|
|
@@ -15974,6 +16406,7 @@ function validateFunctionComponentInDev(workInProgress, Component) {
|
|
|
15974
16406
|
|
|
15975
16407
|
var SUSPENDED_MARKER = {
|
|
15976
16408
|
dehydrated: null,
|
|
16409
|
+
treeContext: null,
|
|
15977
16410
|
retryLane: NoLane
|
|
15978
16411
|
};
|
|
15979
16412
|
|
|
@@ -16047,7 +16480,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
|
|
|
16047
16480
|
// Mark this subtree context as having at least one invisible parent that could
|
|
16048
16481
|
// handle the fallback state.
|
|
16049
16482
|
// Avoided boundaries are not considered since they cannot handle preferred fallback states.
|
|
16050
|
-
|
|
16483
|
+
{
|
|
16051
16484
|
suspenseContext = addSubtreeSuspenseContext(
|
|
16052
16485
|
suspenseContext,
|
|
16053
16486
|
InvisibleParentSuspenseContext
|
|
@@ -17006,6 +17439,10 @@ function updateContextConsumer(current, workInProgress, renderLanes) {
|
|
|
17006
17439
|
prepareToReadContext(workInProgress, renderLanes);
|
|
17007
17440
|
var newValue = readContext(context);
|
|
17008
17441
|
|
|
17442
|
+
{
|
|
17443
|
+
markComponentRenderStarted(workInProgress);
|
|
17444
|
+
}
|
|
17445
|
+
|
|
17009
17446
|
var newChildren;
|
|
17010
17447
|
|
|
17011
17448
|
{
|
|
@@ -17015,6 +17452,10 @@ function updateContextConsumer(current, workInProgress, renderLanes) {
|
|
|
17015
17452
|
setIsRendering(false);
|
|
17016
17453
|
}
|
|
17017
17454
|
|
|
17455
|
+
{
|
|
17456
|
+
markComponentRenderStopped();
|
|
17457
|
+
} // React DevTools reads this flag.
|
|
17458
|
+
|
|
17018
17459
|
workInProgress.flags |= PerformedWork;
|
|
17019
17460
|
reconcileChildren(current, workInProgress, newChildren, renderLanes);
|
|
17020
17461
|
return workInProgress.child;
|
|
@@ -17562,6 +18003,12 @@ function beginWork(current, workInProgress, renderLanes) {
|
|
|
17562
18003
|
}
|
|
17563
18004
|
|
|
17564
18005
|
function unwindWork(workInProgress, renderLanes) {
|
|
18006
|
+
// Note: This intentionally doesn't check if we're hydrating because comparing
|
|
18007
|
+
// to the current tree provider fiber is just as fast and less error-prone.
|
|
18008
|
+
// Ideally we would have a special version of the work loop only
|
|
18009
|
+
// for hydration.
|
|
18010
|
+
popTreeContext(workInProgress);
|
|
18011
|
+
|
|
17565
18012
|
switch (workInProgress.tag) {
|
|
17566
18013
|
case ClassComponent: {
|
|
17567
18014
|
var Component = workInProgress.type;
|
|
@@ -17657,6 +18104,12 @@ function unwindWork(workInProgress, renderLanes) {
|
|
|
17657
18104
|
}
|
|
17658
18105
|
|
|
17659
18106
|
function unwindInterruptedWork(interruptedWork, renderLanes) {
|
|
18107
|
+
// Note: This intentionally doesn't check if we're hydrating because comparing
|
|
18108
|
+
// to the current tree provider fiber is just as fast and less error-prone.
|
|
18109
|
+
// Ideally we would have a special version of the work loop only
|
|
18110
|
+
// for hydration.
|
|
18111
|
+
popTreeContext(interruptedWork);
|
|
18112
|
+
|
|
17660
18113
|
switch (interruptedWork.tag) {
|
|
17661
18114
|
case ClassComponent: {
|
|
17662
18115
|
var childContextTypes = interruptedWork.type.childContextTypes;
|
|
@@ -17976,7 +18429,23 @@ function commitHookEffectListUnmount(
|
|
|
17976
18429
|
effect.destroy = undefined;
|
|
17977
18430
|
|
|
17978
18431
|
if (destroy !== undefined) {
|
|
18432
|
+
{
|
|
18433
|
+
if ((flags & Passive$1) !== NoFlags$1) {
|
|
18434
|
+
markComponentPassiveEffectUnmountStarted(finishedWork);
|
|
18435
|
+
} else if ((flags & Layout) !== NoFlags$1) {
|
|
18436
|
+
markComponentLayoutEffectUnmountStarted(finishedWork);
|
|
18437
|
+
}
|
|
18438
|
+
}
|
|
18439
|
+
|
|
17979
18440
|
safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy);
|
|
18441
|
+
|
|
18442
|
+
{
|
|
18443
|
+
if ((flags & Passive$1) !== NoFlags$1) {
|
|
18444
|
+
markComponentPassiveEffectUnmountStopped();
|
|
18445
|
+
} else if ((flags & Layout) !== NoFlags$1) {
|
|
18446
|
+
markComponentLayoutEffectUnmountStopped();
|
|
18447
|
+
}
|
|
18448
|
+
}
|
|
17980
18449
|
}
|
|
17981
18450
|
}
|
|
17982
18451
|
|
|
@@ -17985,7 +18454,7 @@ function commitHookEffectListUnmount(
|
|
|
17985
18454
|
}
|
|
17986
18455
|
}
|
|
17987
18456
|
|
|
17988
|
-
function commitHookEffectListMount(
|
|
18457
|
+
function commitHookEffectListMount(flags, finishedWork) {
|
|
17989
18458
|
var updateQueue = finishedWork.updateQueue;
|
|
17990
18459
|
var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
|
|
17991
18460
|
|
|
@@ -17994,11 +18463,26 @@ function commitHookEffectListMount(tag, finishedWork) {
|
|
|
17994
18463
|
var effect = firstEffect;
|
|
17995
18464
|
|
|
17996
18465
|
do {
|
|
17997
|
-
if ((effect.tag &
|
|
17998
|
-
|
|
18466
|
+
if ((effect.tag & flags) === flags) {
|
|
18467
|
+
{
|
|
18468
|
+
if ((flags & Passive$1) !== NoFlags$1) {
|
|
18469
|
+
markComponentPassiveEffectMountStarted(finishedWork);
|
|
18470
|
+
} else if ((flags & Layout) !== NoFlags$1) {
|
|
18471
|
+
markComponentLayoutEffectMountStarted(finishedWork);
|
|
18472
|
+
}
|
|
18473
|
+
} // Mount
|
|
18474
|
+
|
|
17999
18475
|
var create = effect.create;
|
|
18000
18476
|
effect.destroy = create();
|
|
18001
18477
|
|
|
18478
|
+
{
|
|
18479
|
+
if ((flags & Passive$1) !== NoFlags$1) {
|
|
18480
|
+
markComponentPassiveEffectMountStopped();
|
|
18481
|
+
} else if ((flags & Layout) !== NoFlags$1) {
|
|
18482
|
+
markComponentLayoutEffectMountStopped();
|
|
18483
|
+
}
|
|
18484
|
+
}
|
|
18485
|
+
|
|
18002
18486
|
{
|
|
18003
18487
|
var destroy = effect.destroy;
|
|
18004
18488
|
|
|
@@ -18524,10 +19008,13 @@ function commitUnmount(finishedRoot, current, nearestMountedAncestor) {
|
|
|
18524
19008
|
tag = _effect.tag;
|
|
18525
19009
|
|
|
18526
19010
|
if (destroy !== undefined) {
|
|
18527
|
-
if (
|
|
18528
|
-
(
|
|
18529
|
-
|
|
18530
|
-
|
|
19011
|
+
if ((tag & Insertion) !== NoFlags$1) {
|
|
19012
|
+
safelyCallDestroy(current, nearestMountedAncestor, destroy);
|
|
19013
|
+
} else if ((tag & Layout) !== NoFlags$1) {
|
|
19014
|
+
{
|
|
19015
|
+
markComponentLayoutEffectUnmountStarted(current);
|
|
19016
|
+
}
|
|
19017
|
+
|
|
18531
19018
|
if (current.mode & ProfileMode) {
|
|
18532
19019
|
startLayoutEffectTimer();
|
|
18533
19020
|
safelyCallDestroy(current, nearestMountedAncestor, destroy);
|
|
@@ -18535,6 +19022,10 @@ function commitUnmount(finishedRoot, current, nearestMountedAncestor) {
|
|
|
18535
19022
|
} else {
|
|
18536
19023
|
safelyCallDestroy(current, nearestMountedAncestor, destroy);
|
|
18537
19024
|
}
|
|
19025
|
+
|
|
19026
|
+
{
|
|
19027
|
+
markComponentLayoutEffectUnmountStopped();
|
|
19028
|
+
}
|
|
18538
19029
|
}
|
|
18539
19030
|
}
|
|
18540
19031
|
|
|
@@ -19487,11 +19978,44 @@ if (typeof Symbol === "function" && Symbol.for) {
|
|
|
19487
19978
|
TEXT_TYPE = symbolFor$1("selector.text");
|
|
19488
19979
|
}
|
|
19489
19980
|
|
|
19981
|
+
var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
|
|
19982
|
+
function isLegacyActEnvironment(fiber) {
|
|
19983
|
+
{
|
|
19984
|
+
// Legacy mode. We preserve the behavior of React 17's act. It assumes an
|
|
19985
|
+
// act environment whenever `jest` is defined, but you can still turn off
|
|
19986
|
+
// spurious warnings by setting IS_REACT_ACT_ENVIRONMENT explicitly
|
|
19987
|
+
// to false.
|
|
19988
|
+
var isReactActEnvironmentGlobal = // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
|
|
19989
|
+
typeof IS_REACT_ACT_ENVIRONMENT !== "undefined"
|
|
19990
|
+
? IS_REACT_ACT_ENVIRONMENT
|
|
19991
|
+
: undefined; // $FlowExpectedError - Flow doesn't know about jest
|
|
19992
|
+
return warnsIfNotActing;
|
|
19993
|
+
}
|
|
19994
|
+
}
|
|
19995
|
+
function isConcurrentActEnvironment() {
|
|
19996
|
+
{
|
|
19997
|
+
var isReactActEnvironmentGlobal = // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
|
|
19998
|
+
typeof IS_REACT_ACT_ENVIRONMENT !== "undefined"
|
|
19999
|
+
? IS_REACT_ACT_ENVIRONMENT
|
|
20000
|
+
: undefined;
|
|
20001
|
+
|
|
20002
|
+
if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
|
|
20003
|
+
// TODO: Include link to relevant documentation page.
|
|
20004
|
+
error(
|
|
20005
|
+
"The current testing environment is not configured to support " +
|
|
20006
|
+
"act(...)"
|
|
20007
|
+
);
|
|
20008
|
+
}
|
|
20009
|
+
|
|
20010
|
+
return isReactActEnvironmentGlobal;
|
|
20011
|
+
}
|
|
20012
|
+
}
|
|
20013
|
+
|
|
19490
20014
|
var ceil = Math.ceil;
|
|
19491
20015
|
var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher,
|
|
19492
20016
|
ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,
|
|
19493
20017
|
ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig,
|
|
19494
|
-
ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
|
|
20018
|
+
ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue;
|
|
19495
20019
|
var NoContext =
|
|
19496
20020
|
/* */
|
|
19497
20021
|
0;
|
|
@@ -19544,7 +20068,9 @@ var workInProgressRootIncludedLanes = NoLanes; // The work left over by componen
|
|
|
19544
20068
|
|
|
19545
20069
|
var workInProgressRootSkippedLanes = NoLanes; // Lanes that were updated (in an interleaved event) during this render.
|
|
19546
20070
|
|
|
19547
|
-
var
|
|
20071
|
+
var workInProgressRootInterleavedUpdatedLanes = NoLanes; // Lanes that were updated during the render phase (*not* an interleaved event).
|
|
20072
|
+
|
|
20073
|
+
var workInProgressRootRenderPhaseUpdatedLanes = NoLanes; // Lanes that were pinged (in an interleaved event) during this render.
|
|
19548
20074
|
|
|
19549
20075
|
var workInProgressRootPingedLanes = NoLanes; // The most recent time we committed a fallback. This lets us ensure a train
|
|
19550
20076
|
// model where we don't commit new loading states in too quick succession.
|
|
@@ -19571,7 +20097,7 @@ var legacyErrorBoundariesThatAlreadyFailed = null; // Only used when enableProfi
|
|
|
19571
20097
|
var rootDoesHavePassiveEffects = false;
|
|
19572
20098
|
var rootWithPendingPassiveEffects = null;
|
|
19573
20099
|
var pendingPassiveEffectsLanes = NoLanes;
|
|
19574
|
-
var pendingPassiveProfilerEffects = [];
|
|
20100
|
+
var pendingPassiveProfilerEffects = [];
|
|
19575
20101
|
|
|
19576
20102
|
var NESTED_UPDATE_LIMIT = 50;
|
|
19577
20103
|
var nestedUpdateCount = 0;
|
|
@@ -19676,60 +20202,80 @@ function requestRetryLane(fiber) {
|
|
|
19676
20202
|
|
|
19677
20203
|
function scheduleUpdateOnFiber(fiber, lane, eventTime) {
|
|
19678
20204
|
checkForNestedUpdates();
|
|
19679
|
-
warnAboutRenderPhaseUpdatesInDEV(fiber);
|
|
19680
20205
|
var root = markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
19681
20206
|
|
|
19682
20207
|
if (root === null) {
|
|
19683
20208
|
return null;
|
|
19684
|
-
}
|
|
19685
|
-
|
|
19686
|
-
{
|
|
19687
|
-
if (isDevToolsPresent) {
|
|
19688
|
-
addFiberToLanesMap(root, fiber, lane);
|
|
19689
|
-
}
|
|
19690
20209
|
} // Mark that the root has a pending update.
|
|
19691
20210
|
|
|
19692
20211
|
markRootUpdated(root, lane, eventTime);
|
|
19693
20212
|
|
|
19694
|
-
if (
|
|
19695
|
-
|
|
19696
|
-
|
|
19697
|
-
|
|
19698
|
-
//
|
|
19699
|
-
//
|
|
19700
|
-
|
|
19701
|
-
|
|
19702
|
-
|
|
19703
|
-
|
|
19704
|
-
|
|
20213
|
+
if (
|
|
20214
|
+
(executionContext & RenderContext) !== NoLanes &&
|
|
20215
|
+
root === workInProgressRoot
|
|
20216
|
+
) {
|
|
20217
|
+
// This update was dispatched during the render phase. This is a mistake
|
|
20218
|
+
// if the update originates from user space (with the exception of local
|
|
20219
|
+
// hook updates, which are handled differently and don't reach this
|
|
20220
|
+
// function), but there are some internal React features that use this as
|
|
20221
|
+
// an implementation detail, like selective hydration.
|
|
20222
|
+
warnAboutRenderPhaseUpdatesInDEV(fiber); // Track lanes that were updated during the render phase
|
|
20223
|
+
|
|
20224
|
+
workInProgressRootRenderPhaseUpdatedLanes = mergeLanes(
|
|
20225
|
+
workInProgressRootRenderPhaseUpdatedLanes,
|
|
20226
|
+
lane
|
|
20227
|
+
);
|
|
20228
|
+
} else {
|
|
20229
|
+
// This is a normal update, scheduled from outside the render phase. For
|
|
20230
|
+
// example, during an input event.
|
|
20231
|
+
{
|
|
20232
|
+
if (isDevToolsPresent) {
|
|
20233
|
+
addFiberToLanesMap(root, fiber, lane);
|
|
20234
|
+
}
|
|
19705
20235
|
}
|
|
19706
20236
|
|
|
19707
|
-
|
|
19708
|
-
|
|
19709
|
-
|
|
19710
|
-
//
|
|
19711
|
-
//
|
|
19712
|
-
//
|
|
19713
|
-
//
|
|
19714
|
-
|
|
20237
|
+
warnIfUpdatesNotWrappedWithActDEV(fiber);
|
|
20238
|
+
|
|
20239
|
+
if (root === workInProgressRoot) {
|
|
20240
|
+
// Received an update to a tree that's in the middle of rendering. Mark
|
|
20241
|
+
// that there was an interleaved update work on this root. Unless the
|
|
20242
|
+
// `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render
|
|
20243
|
+
// phase update. In that case, we don't treat render phase updates as if
|
|
20244
|
+
// they were interleaved, for backwards compat reasons.
|
|
20245
|
+
if ((executionContext & RenderContext) === NoContext) {
|
|
20246
|
+
workInProgressRootInterleavedUpdatedLanes = mergeLanes(
|
|
20247
|
+
workInProgressRootInterleavedUpdatedLanes,
|
|
20248
|
+
lane
|
|
20249
|
+
);
|
|
20250
|
+
}
|
|
20251
|
+
|
|
20252
|
+
if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
|
|
20253
|
+
// The root already suspended with a delay, which means this render
|
|
20254
|
+
// definitely won't finish. Since we have a new update, let's mark it as
|
|
20255
|
+
// suspended now, right before marking the incoming update. This has the
|
|
20256
|
+
// effect of interrupting the current render and switching to the update.
|
|
20257
|
+
// TODO: Make sure this doesn't override pings that happen while we've
|
|
20258
|
+
// already started rendering.
|
|
20259
|
+
markRootSuspended$1(root, workInProgressRootRenderLanes);
|
|
20260
|
+
}
|
|
19715
20261
|
}
|
|
19716
|
-
}
|
|
19717
20262
|
|
|
19718
|
-
|
|
20263
|
+
ensureRootIsScheduled(root, eventTime);
|
|
19719
20264
|
|
|
19720
|
-
|
|
19721
|
-
|
|
19722
|
-
|
|
19723
|
-
|
|
19724
|
-
|
|
19725
|
-
|
|
19726
|
-
|
|
19727
|
-
|
|
19728
|
-
|
|
19729
|
-
|
|
19730
|
-
|
|
19731
|
-
|
|
19732
|
-
|
|
20265
|
+
if (
|
|
20266
|
+
lane === SyncLane &&
|
|
20267
|
+
executionContext === NoContext &&
|
|
20268
|
+
(fiber.mode & ConcurrentMode) === NoMode && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
|
|
20269
|
+
!ReactCurrentActQueue$1.isBatchingLegacy
|
|
20270
|
+
) {
|
|
20271
|
+
// Flush the synchronous work now, unless we're already working or inside
|
|
20272
|
+
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
|
20273
|
+
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
|
20274
|
+
// without immediately flushing it. We only do this for user-initiated
|
|
20275
|
+
// updates, to preserve historical behavior of legacy mode.
|
|
20276
|
+
resetRenderTimer();
|
|
20277
|
+
flushSyncCallbacksOnlyInLegacyMode();
|
|
20278
|
+
}
|
|
19733
20279
|
}
|
|
19734
20280
|
|
|
19735
20281
|
return root;
|
|
@@ -19834,7 +20380,7 @@ function ensureRootIsScheduled(root, currentTime) {
|
|
|
19834
20380
|
// Scheduler task, rather than an `act` task, cancel it and re-scheduled
|
|
19835
20381
|
// on the `act` queue.
|
|
19836
20382
|
!(
|
|
19837
|
-
ReactCurrentActQueue.current !== null &&
|
|
20383
|
+
ReactCurrentActQueue$1.current !== null &&
|
|
19838
20384
|
existingCallbackNode !== fakeActCallbackNode
|
|
19839
20385
|
)
|
|
19840
20386
|
) {
|
|
@@ -19866,8 +20412,8 @@ function ensureRootIsScheduled(root, currentTime) {
|
|
|
19866
20412
|
// Special case: Sync React callbacks are scheduled on a special
|
|
19867
20413
|
// internal queue
|
|
19868
20414
|
if (root.tag === LegacyRoot) {
|
|
19869
|
-
if (ReactCurrentActQueue.isBatchingLegacy !== null) {
|
|
19870
|
-
ReactCurrentActQueue.didScheduleLegacyUpdate = true;
|
|
20415
|
+
if (ReactCurrentActQueue$1.isBatchingLegacy !== null) {
|
|
20416
|
+
ReactCurrentActQueue$1.didScheduleLegacyUpdate = true;
|
|
19871
20417
|
}
|
|
19872
20418
|
|
|
19873
20419
|
scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root));
|
|
@@ -20053,11 +20599,28 @@ function recoverFromConcurrentError(root, errorRetryLanes) {
|
|
|
20053
20599
|
{
|
|
20054
20600
|
errorHydratingContainer(root.containerInfo);
|
|
20055
20601
|
}
|
|
20602
|
+
}
|
|
20603
|
+
|
|
20604
|
+
var exitStatus;
|
|
20605
|
+
var MAX_ERROR_RETRY_ATTEMPTS = 50;
|
|
20606
|
+
|
|
20607
|
+
for (var i = 0; i < MAX_ERROR_RETRY_ATTEMPTS; i++) {
|
|
20608
|
+
exitStatus = renderRootSync(root, errorRetryLanes);
|
|
20609
|
+
|
|
20610
|
+
if (
|
|
20611
|
+
exitStatus === RootErrored &&
|
|
20612
|
+
workInProgressRootRenderPhaseUpdatedLanes !== NoLanes
|
|
20613
|
+
) {
|
|
20614
|
+
// There was a render phase update during this render. Some internal React
|
|
20615
|
+
// implementation details may use this as a trick to schedule another
|
|
20616
|
+
// render pass. To protect against an inifinite loop, eventually
|
|
20617
|
+
// we'll give up.
|
|
20618
|
+
continue;
|
|
20619
|
+
}
|
|
20056
20620
|
|
|
20057
|
-
|
|
20621
|
+
break;
|
|
20058
20622
|
}
|
|
20059
20623
|
|
|
20060
|
-
var exitStatus = renderRootSync(root, errorRetryLanes);
|
|
20061
20624
|
executionContext = prevExecutionContext;
|
|
20062
20625
|
return exitStatus;
|
|
20063
20626
|
}
|
|
@@ -20178,7 +20741,7 @@ function finishConcurrentRender(root, exitStatus, lanes) {
|
|
|
20178
20741
|
|
|
20179
20742
|
function isRenderConsistentWithExternalStores(finishedWork) {
|
|
20180
20743
|
// Search the rendered tree for external store reads, and check whether the
|
|
20181
|
-
// stores were mutated in a concurrent event. Intentionally using
|
|
20744
|
+
// stores were mutated in a concurrent event. Intentionally using an iterative
|
|
20182
20745
|
// loop instead of recursion so we can exit early.
|
|
20183
20746
|
var node = finishedWork;
|
|
20184
20747
|
|
|
@@ -20244,7 +20807,10 @@ function markRootSuspended$1(root, suspendedLanes) {
|
|
|
20244
20807
|
// TODO: Lol maybe there's a better way to factor this besides this
|
|
20245
20808
|
// obnoxiously named function :)
|
|
20246
20809
|
suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
|
|
20247
|
-
suspendedLanes = removeLanes(
|
|
20810
|
+
suspendedLanes = removeLanes(
|
|
20811
|
+
suspendedLanes,
|
|
20812
|
+
workInProgressRootInterleavedUpdatedLanes
|
|
20813
|
+
);
|
|
20248
20814
|
markRootSuspended(root, suspendedLanes);
|
|
20249
20815
|
} // This is the entry point for synchronous tasks that don't go
|
|
20250
20816
|
// through Scheduler
|
|
@@ -20270,31 +20836,16 @@ function performSyncWorkOnRoot(root) {
|
|
|
20270
20836
|
var exitStatus = renderRootSync(root, lanes);
|
|
20271
20837
|
|
|
20272
20838
|
if (root.tag !== LegacyRoot && exitStatus === RootErrored) {
|
|
20273
|
-
|
|
20274
|
-
executionContext |= RetryAfterError; // If an error occurred during hydration,
|
|
20275
|
-
// discard server response and fall back to client side render.
|
|
20276
|
-
|
|
20277
|
-
if (root.isDehydrated) {
|
|
20278
|
-
root.isDehydrated = false;
|
|
20279
|
-
|
|
20280
|
-
{
|
|
20281
|
-
errorHydratingContainer(root.containerInfo);
|
|
20282
|
-
}
|
|
20283
|
-
|
|
20284
|
-
clearContainer(root.containerInfo);
|
|
20285
|
-
} // If something threw an error, try rendering one more time. We'll render
|
|
20839
|
+
// If something threw an error, try rendering one more time. We'll render
|
|
20286
20840
|
// synchronously to block concurrent data mutations, and we'll includes
|
|
20287
20841
|
// all pending updates are included. If it still fails after the second
|
|
20288
20842
|
// attempt, we'll give up and commit the resulting tree.
|
|
20289
|
-
|
|
20290
20843
|
var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root);
|
|
20291
20844
|
|
|
20292
20845
|
if (errorRetryLanes !== NoLanes) {
|
|
20293
20846
|
lanes = errorRetryLanes;
|
|
20294
|
-
exitStatus =
|
|
20847
|
+
exitStatus = recoverFromConcurrentError(root, errorRetryLanes);
|
|
20295
20848
|
}
|
|
20296
|
-
|
|
20297
|
-
executionContext = prevExecutionContext;
|
|
20298
20849
|
}
|
|
20299
20850
|
|
|
20300
20851
|
if (exitStatus === RootFatalErrored) {
|
|
@@ -20327,7 +20878,7 @@ function batchedUpdates$1(fn, a) {
|
|
|
20327
20878
|
|
|
20328
20879
|
if (
|
|
20329
20880
|
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
|
|
20330
|
-
!ReactCurrentActQueue.isBatchingLegacy
|
|
20881
|
+
!ReactCurrentActQueue$1.isBatchingLegacy
|
|
20331
20882
|
) {
|
|
20332
20883
|
resetRenderTimer();
|
|
20333
20884
|
flushSyncCallbacksOnlyInLegacyMode();
|
|
@@ -20415,7 +20966,8 @@ function prepareFreshStack(root, lanes) {
|
|
|
20415
20966
|
workInProgressRootExitStatus = RootIncomplete;
|
|
20416
20967
|
workInProgressRootFatalError = null;
|
|
20417
20968
|
workInProgressRootSkippedLanes = NoLanes;
|
|
20418
|
-
|
|
20969
|
+
workInProgressRootInterleavedUpdatedLanes = NoLanes;
|
|
20970
|
+
workInProgressRootRenderPhaseUpdatedLanes = NoLanes;
|
|
20419
20971
|
workInProgressRootPingedLanes = NoLanes;
|
|
20420
20972
|
enqueueInterleavedUpdates();
|
|
20421
20973
|
|
|
@@ -20557,7 +21109,7 @@ function renderDidSuspendDelayIfPossible() {
|
|
|
20557
21109
|
if (
|
|
20558
21110
|
workInProgressRoot !== null &&
|
|
20559
21111
|
(includesNonIdleWork(workInProgressRootSkippedLanes) ||
|
|
20560
|
-
includesNonIdleWork(
|
|
21112
|
+
includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))
|
|
20561
21113
|
) {
|
|
20562
21114
|
// Mark the current render as suspended so that we switch to working on
|
|
20563
21115
|
// the updates that were skipped. Usually we only suspend at the end of
|
|
@@ -20608,6 +21160,10 @@ function renderRootSync(root, lanes) {
|
|
|
20608
21160
|
prepareFreshStack(root, lanes);
|
|
20609
21161
|
}
|
|
20610
21162
|
|
|
21163
|
+
{
|
|
21164
|
+
markRenderStarted(lanes);
|
|
21165
|
+
}
|
|
21166
|
+
|
|
20611
21167
|
do {
|
|
20612
21168
|
try {
|
|
20613
21169
|
workLoopSync();
|
|
@@ -20629,6 +21185,10 @@ function renderRootSync(root, lanes) {
|
|
|
20629
21185
|
);
|
|
20630
21186
|
}
|
|
20631
21187
|
|
|
21188
|
+
{
|
|
21189
|
+
markRenderStopped();
|
|
21190
|
+
} // Set this to null to indicate there's no in-progress render.
|
|
21191
|
+
|
|
20632
21192
|
workInProgressRoot = null;
|
|
20633
21193
|
workInProgressRootRenderLanes = NoLanes;
|
|
20634
21194
|
return workInProgressRootExitStatus;
|
|
@@ -20670,6 +21230,10 @@ function renderRootConcurrent(root, lanes) {
|
|
|
20670
21230
|
prepareFreshStack(root, lanes);
|
|
20671
21231
|
}
|
|
20672
21232
|
|
|
21233
|
+
{
|
|
21234
|
+
markRenderStarted(lanes);
|
|
21235
|
+
}
|
|
21236
|
+
|
|
20673
21237
|
do {
|
|
20674
21238
|
try {
|
|
20675
21239
|
workLoopConcurrent();
|
|
@@ -20684,8 +21248,18 @@ function renderRootConcurrent(root, lanes) {
|
|
|
20684
21248
|
executionContext = prevExecutionContext;
|
|
20685
21249
|
|
|
20686
21250
|
if (workInProgress !== null) {
|
|
21251
|
+
// Still work remaining.
|
|
21252
|
+
{
|
|
21253
|
+
markRenderYielded();
|
|
21254
|
+
}
|
|
21255
|
+
|
|
20687
21256
|
return RootIncomplete;
|
|
20688
21257
|
} else {
|
|
21258
|
+
// Completed the tree.
|
|
21259
|
+
{
|
|
21260
|
+
markRenderStopped();
|
|
21261
|
+
} // Set this to null to indicate there's no in-progress render.
|
|
21262
|
+
|
|
20689
21263
|
workInProgressRoot = null;
|
|
20690
21264
|
workInProgressRootRenderLanes = NoLanes; // Return the final exit status.
|
|
20691
21265
|
|
|
@@ -20857,7 +21431,15 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
20857
21431
|
var finishedWork = root.finishedWork;
|
|
20858
21432
|
var lanes = root.finishedLanes;
|
|
20859
21433
|
|
|
21434
|
+
{
|
|
21435
|
+
markCommitStarted(lanes);
|
|
21436
|
+
}
|
|
21437
|
+
|
|
20860
21438
|
if (finishedWork === null) {
|
|
21439
|
+
{
|
|
21440
|
+
markCommitStopped();
|
|
21441
|
+
}
|
|
21442
|
+
|
|
20861
21443
|
return null;
|
|
20862
21444
|
} else {
|
|
20863
21445
|
{
|
|
@@ -20906,7 +21488,10 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
20906
21488
|
if (!rootDoesHavePassiveEffects) {
|
|
20907
21489
|
rootDoesHavePassiveEffects = true;
|
|
20908
21490
|
scheduleCallback$1(NormalPriority, function() {
|
|
20909
|
-
flushPassiveEffects();
|
|
21491
|
+
flushPassiveEffects(); // This render triggered passive effects: release the root cache pool
|
|
21492
|
+
// *after* passive effects fire to avoid freeing a cache pool that may
|
|
21493
|
+
// be referenced by a node in the tree (HostRoot, Cache boundary etc)
|
|
21494
|
+
|
|
20910
21495
|
return null;
|
|
20911
21496
|
});
|
|
20912
21497
|
}
|
|
@@ -20960,7 +21545,15 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
20960
21545
|
|
|
20961
21546
|
root.current = finishedWork; // The next phase is the layout phase, where we call effects that read
|
|
20962
21547
|
|
|
21548
|
+
{
|
|
21549
|
+
markLayoutEffectsStarted(lanes);
|
|
21550
|
+
}
|
|
21551
|
+
|
|
20963
21552
|
commitLayoutEffects(finishedWork, root, lanes);
|
|
21553
|
+
|
|
21554
|
+
{
|
|
21555
|
+
markLayoutEffectsStopped();
|
|
21556
|
+
}
|
|
20964
21557
|
// opportunity to paint.
|
|
20965
21558
|
|
|
20966
21559
|
requestPaint();
|
|
@@ -21064,6 +21657,10 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
21064
21657
|
|
|
21065
21658
|
flushSyncCallbacks();
|
|
21066
21659
|
|
|
21660
|
+
{
|
|
21661
|
+
markCommitStopped();
|
|
21662
|
+
}
|
|
21663
|
+
|
|
21067
21664
|
return null;
|
|
21068
21665
|
}
|
|
21069
21666
|
|
|
@@ -21086,7 +21683,7 @@ function flushPassiveEffects() {
|
|
|
21086
21683
|
return flushPassiveEffectsImpl();
|
|
21087
21684
|
} finally {
|
|
21088
21685
|
setCurrentUpdatePriority(previousPriority);
|
|
21089
|
-
ReactCurrentBatchConfig$2.transition = prevTransition;
|
|
21686
|
+
ReactCurrentBatchConfig$2.transition = prevTransition; // Once passive effects have run for the tree - giving components a
|
|
21090
21687
|
}
|
|
21091
21688
|
}
|
|
21092
21689
|
|
|
@@ -21112,6 +21709,7 @@ function flushPassiveEffectsImpl() {
|
|
|
21112
21709
|
}
|
|
21113
21710
|
|
|
21114
21711
|
var root = rootWithPendingPassiveEffects;
|
|
21712
|
+
var lanes = pendingPassiveEffectsLanes;
|
|
21115
21713
|
rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects.
|
|
21116
21714
|
// Figure out why and fix it. It's not causing any known issues (probably
|
|
21117
21715
|
// because it's only used for profiling), but it's a refactor hazard.
|
|
@@ -21122,6 +21720,10 @@ function flushPassiveEffectsImpl() {
|
|
|
21122
21720
|
throw new Error("Cannot flush passive effects while already rendering.");
|
|
21123
21721
|
}
|
|
21124
21722
|
|
|
21723
|
+
{
|
|
21724
|
+
markPassiveEffectsStarted(lanes);
|
|
21725
|
+
}
|
|
21726
|
+
|
|
21125
21727
|
var prevExecutionContext = executionContext;
|
|
21126
21728
|
executionContext |= CommitContext;
|
|
21127
21729
|
commitPassiveUnmountEffects(root.current);
|
|
@@ -21137,6 +21739,10 @@ function flushPassiveEffectsImpl() {
|
|
|
21137
21739
|
}
|
|
21138
21740
|
}
|
|
21139
21741
|
|
|
21742
|
+
{
|
|
21743
|
+
markPassiveEffectsStopped();
|
|
21744
|
+
}
|
|
21745
|
+
|
|
21140
21746
|
{
|
|
21141
21747
|
commitDoubleInvokeEffectsInDEV(root.current, true);
|
|
21142
21748
|
}
|
|
@@ -21267,6 +21873,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) {
|
|
|
21267
21873
|
|
|
21268
21874
|
var eventTime = requestEventTime();
|
|
21269
21875
|
markRootPinged(root, pingedLanes);
|
|
21876
|
+
warnIfSuspenseResolutionNotWrappedWithActDEV(root);
|
|
21270
21877
|
|
|
21271
21878
|
if (
|
|
21272
21879
|
workInProgressRoot === root &&
|
|
@@ -21592,11 +22199,7 @@ var didWarnAboutUpdateInRenderForAnotherComponent;
|
|
|
21592
22199
|
|
|
21593
22200
|
function warnAboutRenderPhaseUpdatesInDEV(fiber) {
|
|
21594
22201
|
{
|
|
21595
|
-
if (
|
|
21596
|
-
isRendering &&
|
|
21597
|
-
(executionContext & RenderContext) !== NoContext &&
|
|
21598
|
-
!getIsUpdatingOpaqueValueInRenderPhaseInDEV()
|
|
21599
|
-
) {
|
|
22202
|
+
if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
|
|
21600
22203
|
switch (fiber.tag) {
|
|
21601
22204
|
case FunctionComponent:
|
|
21602
22205
|
case ForwardRef:
|
|
@@ -21661,7 +22264,7 @@ function scheduleCallback$1(priorityLevel, callback) {
|
|
|
21661
22264
|
{
|
|
21662
22265
|
// If we're currently inside an `act` scope, bypass Scheduler and push to
|
|
21663
22266
|
// the `act` queue instead.
|
|
21664
|
-
var actQueue = ReactCurrentActQueue.current;
|
|
22267
|
+
var actQueue = ReactCurrentActQueue$1.current;
|
|
21665
22268
|
|
|
21666
22269
|
if (actQueue !== null) {
|
|
21667
22270
|
actQueue.push(callback);
|
|
@@ -21682,7 +22285,92 @@ function cancelCallback$1(callbackNode) {
|
|
|
21682
22285
|
|
|
21683
22286
|
function shouldForceFlushFallbacksInDEV() {
|
|
21684
22287
|
// Never force flush in production. This function should get stripped out.
|
|
21685
|
-
return ReactCurrentActQueue.current !== null;
|
|
22288
|
+
return ReactCurrentActQueue$1.current !== null;
|
|
22289
|
+
}
|
|
22290
|
+
|
|
22291
|
+
function warnIfUpdatesNotWrappedWithActDEV(fiber) {
|
|
22292
|
+
{
|
|
22293
|
+
if (fiber.mode & ConcurrentMode) {
|
|
22294
|
+
if (!isConcurrentActEnvironment()) {
|
|
22295
|
+
// Not in an act environment. No need to warn.
|
|
22296
|
+
return;
|
|
22297
|
+
}
|
|
22298
|
+
} else {
|
|
22299
|
+
// Legacy mode has additional cases where we suppress a warning.
|
|
22300
|
+
if (!isLegacyActEnvironment()) {
|
|
22301
|
+
// Not in an act environment. No need to warn.
|
|
22302
|
+
return;
|
|
22303
|
+
}
|
|
22304
|
+
|
|
22305
|
+
if (executionContext !== NoContext) {
|
|
22306
|
+
// Legacy mode doesn't warn if the update is batched, i.e.
|
|
22307
|
+
// batchedUpdates or flushSync.
|
|
22308
|
+
return;
|
|
22309
|
+
}
|
|
22310
|
+
|
|
22311
|
+
if (
|
|
22312
|
+
fiber.tag !== FunctionComponent &&
|
|
22313
|
+
fiber.tag !== ForwardRef &&
|
|
22314
|
+
fiber.tag !== SimpleMemoComponent
|
|
22315
|
+
) {
|
|
22316
|
+
// For backwards compatibility with pre-hooks code, legacy mode only
|
|
22317
|
+
// warns for updates that originate from a hook.
|
|
22318
|
+
return;
|
|
22319
|
+
}
|
|
22320
|
+
}
|
|
22321
|
+
|
|
22322
|
+
if (ReactCurrentActQueue$1.current === null) {
|
|
22323
|
+
var previousFiber = current;
|
|
22324
|
+
|
|
22325
|
+
try {
|
|
22326
|
+
setCurrentFiber(fiber);
|
|
22327
|
+
|
|
22328
|
+
error(
|
|
22329
|
+
"An update to %s inside a test was not wrapped in act(...).\n\n" +
|
|
22330
|
+
"When testing, code that causes React state updates should be " +
|
|
22331
|
+
"wrapped into act(...):\n\n" +
|
|
22332
|
+
"act(() => {\n" +
|
|
22333
|
+
" /* fire events that update state */\n" +
|
|
22334
|
+
"});\n" +
|
|
22335
|
+
"/* assert on the output */\n\n" +
|
|
22336
|
+
"This ensures that you're testing the behavior the user would see " +
|
|
22337
|
+
"in the browser." +
|
|
22338
|
+
" Learn more at https://reactjs.org/link/wrap-tests-with-act",
|
|
22339
|
+
getComponentNameFromFiber(fiber)
|
|
22340
|
+
);
|
|
22341
|
+
} finally {
|
|
22342
|
+
if (previousFiber) {
|
|
22343
|
+
setCurrentFiber(fiber);
|
|
22344
|
+
} else {
|
|
22345
|
+
resetCurrentFiber();
|
|
22346
|
+
}
|
|
22347
|
+
}
|
|
22348
|
+
}
|
|
22349
|
+
}
|
|
22350
|
+
}
|
|
22351
|
+
|
|
22352
|
+
function warnIfSuspenseResolutionNotWrappedWithActDEV(root) {
|
|
22353
|
+
{
|
|
22354
|
+
if (
|
|
22355
|
+
root.tag !== LegacyRoot &&
|
|
22356
|
+
isConcurrentActEnvironment() &&
|
|
22357
|
+
ReactCurrentActQueue$1.current === null
|
|
22358
|
+
) {
|
|
22359
|
+
error(
|
|
22360
|
+
"A suspended resource finished loading inside a test, but the event " +
|
|
22361
|
+
"was not wrapped in act(...).\n\n" +
|
|
22362
|
+
"When testing, code that resolves suspended data should be wrapped " +
|
|
22363
|
+
"into act(...):\n\n" +
|
|
22364
|
+
"act(() => {\n" +
|
|
22365
|
+
" /* finish loading suspended data */\n" +
|
|
22366
|
+
"});\n" +
|
|
22367
|
+
"/* assert on the output */\n\n" +
|
|
22368
|
+
"This ensures that you're testing the behavior the user would see " +
|
|
22369
|
+
"in the browser." +
|
|
22370
|
+
" Learn more at https://reactjs.org/link/wrap-tests-with-act"
|
|
22371
|
+
);
|
|
22372
|
+
}
|
|
22373
|
+
}
|
|
21686
22374
|
}
|
|
21687
22375
|
|
|
21688
22376
|
/* eslint-disable react-internal/prod-error-codes */
|
|
@@ -22755,7 +23443,7 @@ function assignFiberPropertiesInDEV(target, source) {
|
|
|
22755
23443
|
return target;
|
|
22756
23444
|
}
|
|
22757
23445
|
|
|
22758
|
-
function FiberRootNode(containerInfo, tag, hydrate) {
|
|
23446
|
+
function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix) {
|
|
22759
23447
|
this.tag = tag;
|
|
22760
23448
|
this.containerInfo = containerInfo;
|
|
22761
23449
|
this.pendingChildren = null;
|
|
@@ -22778,6 +23466,7 @@ function FiberRootNode(containerInfo, tag, hydrate) {
|
|
|
22778
23466
|
this.finishedLanes = NoLanes;
|
|
22779
23467
|
this.entangledLanes = NoLanes;
|
|
22780
23468
|
this.entanglements = createLaneMap(NoLanes);
|
|
23469
|
+
this.identifierPrefix = identifierPrefix;
|
|
22781
23470
|
|
|
22782
23471
|
{
|
|
22783
23472
|
this.effectDuration = 0;
|
|
@@ -22812,9 +23501,10 @@ function createFiberRoot(
|
|
|
22812
23501
|
hydrate,
|
|
22813
23502
|
hydrationCallbacks,
|
|
22814
23503
|
isStrictMode,
|
|
22815
|
-
concurrentUpdatesByDefaultOverride
|
|
23504
|
+
concurrentUpdatesByDefaultOverride,
|
|
23505
|
+
identifierPrefix
|
|
22816
23506
|
) {
|
|
22817
|
-
var root = new FiberRootNode(containerInfo, tag, hydrate);
|
|
23507
|
+
var root = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix);
|
|
22818
23508
|
// stateNode is any.
|
|
22819
23509
|
|
|
22820
23510
|
var uninitializedFiber = createHostRootFiber(
|
|
@@ -22836,6 +23526,8 @@ function createFiberRoot(
|
|
|
22836
23526
|
return root;
|
|
22837
23527
|
}
|
|
22838
23528
|
|
|
23529
|
+
var ReactVersion = "18.0.0-rc.0-51947a14b-20220113";
|
|
23530
|
+
|
|
22839
23531
|
function createPortal(
|
|
22840
23532
|
children,
|
|
22841
23533
|
containerInfo, // TODO: figure out the API for cross-renderer implementation.
|
|
@@ -22961,7 +23653,8 @@ function createContainer(
|
|
|
22961
23653
|
hydrate,
|
|
22962
23654
|
hydrationCallbacks,
|
|
22963
23655
|
isStrictMode,
|
|
22964
|
-
concurrentUpdatesByDefaultOverride
|
|
23656
|
+
concurrentUpdatesByDefaultOverride,
|
|
23657
|
+
identifierPrefix
|
|
22965
23658
|
) {
|
|
22966
23659
|
return createFiberRoot(
|
|
22967
23660
|
containerInfo,
|
|
@@ -22969,7 +23662,8 @@ function createContainer(
|
|
|
22969
23662
|
hydrate,
|
|
22970
23663
|
hydrationCallbacks,
|
|
22971
23664
|
isStrictMode,
|
|
22972
|
-
concurrentUpdatesByDefaultOverride
|
|
23665
|
+
concurrentUpdatesByDefaultOverride,
|
|
23666
|
+
identifierPrefix
|
|
22973
23667
|
);
|
|
22974
23668
|
}
|
|
22975
23669
|
function updateContainer(element, container, parentComponent, callback) {
|
|
@@ -22981,6 +23675,10 @@ function updateContainer(element, container, parentComponent, callback) {
|
|
|
22981
23675
|
var eventTime = requestEventTime();
|
|
22982
23676
|
var lane = requestUpdateLane(current$1);
|
|
22983
23677
|
|
|
23678
|
+
{
|
|
23679
|
+
markRenderScheduled(lane);
|
|
23680
|
+
}
|
|
23681
|
+
|
|
22984
23682
|
var context = getContextForSubtree(parentComponent);
|
|
22985
23683
|
|
|
22986
23684
|
if (container.context === null) {
|
|
@@ -23759,7 +24457,8 @@ function render(element, containerTag, callback, concurrentRoot) {
|
|
|
23759
24457
|
false,
|
|
23760
24458
|
null,
|
|
23761
24459
|
false,
|
|
23762
|
-
null
|
|
24460
|
+
null,
|
|
24461
|
+
""
|
|
23763
24462
|
);
|
|
23764
24463
|
roots.set(containerTag, root);
|
|
23765
24464
|
}
|
|
@@ -23815,5 +24514,14 @@ exports.sendAccessibilityEvent = sendAccessibilityEvent;
|
|
|
23815
24514
|
exports.stopSurface = stopSurface;
|
|
23816
24515
|
exports.unmountComponentAtNode = unmountComponentAtNode;
|
|
23817
24516
|
|
|
24517
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
24518
|
+
if (
|
|
24519
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
24520
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
24521
|
+
'function'
|
|
24522
|
+
) {
|
|
24523
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
24524
|
+
}
|
|
24525
|
+
|
|
23818
24526
|
})();
|
|
23819
24527
|
}
|