@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<<3ab224d749aabfd2af41824a03d0c6ce>>
|
|
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 " +
|
|
@@ -2887,7 +2898,6 @@ var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
|
2887
2898
|
var REACT_MEMO_TYPE = 0xead3;
|
|
2888
2899
|
var REACT_LAZY_TYPE = 0xead4;
|
|
2889
2900
|
var REACT_SCOPE_TYPE = 0xead7;
|
|
2890
|
-
var REACT_OPAQUE_ID_TYPE = 0xeae0;
|
|
2891
2901
|
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
2892
2902
|
var REACT_OFFSCREEN_TYPE = 0xeae2;
|
|
2893
2903
|
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
@@ -2908,7 +2918,6 @@ if (typeof Symbol === "function" && Symbol.for) {
|
|
|
2908
2918
|
REACT_MEMO_TYPE = symbolFor("react.memo");
|
|
2909
2919
|
REACT_LAZY_TYPE = symbolFor("react.lazy");
|
|
2910
2920
|
REACT_SCOPE_TYPE = symbolFor("react.scope");
|
|
2911
|
-
REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id");
|
|
2912
2921
|
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode");
|
|
2913
2922
|
REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen");
|
|
2914
2923
|
REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden");
|
|
@@ -3141,12 +3150,13 @@ function getComponentNameFromFiber(fiber) {
|
|
|
3141
3150
|
|
|
3142
3151
|
var enablePersistentOffscreenHostContainer =
|
|
3143
3152
|
dynamicFlags.enablePersistentOffscreenHostContainer; // The rest of the flags are static for better dead code elimination.
|
|
3144
|
-
var enableSchedulingProfiler =
|
|
3153
|
+
var enableSchedulingProfiler = true;
|
|
3145
3154
|
var enableProfilerTimer = true;
|
|
3146
3155
|
var enableProfilerCommitHooks = true;
|
|
3147
3156
|
var enableLazyElements = false;
|
|
3148
3157
|
var warnAboutStringRefs = false;
|
|
3149
3158
|
var warnOnSubscriptionInsideStartTransition = false;
|
|
3159
|
+
var enableSuspenseAvoidThisFallback = false;
|
|
3150
3160
|
var enableNewReconciler = false;
|
|
3151
3161
|
var enableLazyContextPropagation = false;
|
|
3152
3162
|
|
|
@@ -3179,6 +3189,9 @@ var Callback =
|
|
|
3179
3189
|
var DidCapture =
|
|
3180
3190
|
/* */
|
|
3181
3191
|
128;
|
|
3192
|
+
var ForceClientRender =
|
|
3193
|
+
/* */
|
|
3194
|
+
256;
|
|
3182
3195
|
var Ref =
|
|
3183
3196
|
/* */
|
|
3184
3197
|
512;
|
|
@@ -3216,6 +3229,9 @@ var ShouldCapture =
|
|
|
3216
3229
|
var ForceUpdateForLegacySuspense =
|
|
3217
3230
|
/* */
|
|
3218
3231
|
131072;
|
|
3232
|
+
var Forked =
|
|
3233
|
+
/* */
|
|
3234
|
+
1048576; // Static tags describe aspects of a fiber that are not specific to a render,
|
|
3219
3235
|
// e.g. a fiber uses a passive effect (even if there are no updates on this particular render).
|
|
3220
3236
|
// This enables us to defer more work in the unmount case,
|
|
3221
3237
|
// since we can defer traversing the tree during layout to look for Passive effects,
|
|
@@ -3223,22 +3239,22 @@ var ForceUpdateForLegacySuspense =
|
|
|
3223
3239
|
|
|
3224
3240
|
var RefStatic =
|
|
3225
3241
|
/* */
|
|
3226
|
-
|
|
3242
|
+
2097152;
|
|
3227
3243
|
var LayoutStatic =
|
|
3228
3244
|
/* */
|
|
3229
|
-
|
|
3245
|
+
4194304;
|
|
3230
3246
|
var PassiveStatic =
|
|
3231
3247
|
/* */
|
|
3232
|
-
|
|
3248
|
+
8388608; // These flags allow us to traverse to fibers that have effects on mount
|
|
3233
3249
|
// without traversing the entire tree after every commit for
|
|
3234
3250
|
// double invoking
|
|
3235
3251
|
|
|
3236
3252
|
var MountLayoutDev =
|
|
3237
3253
|
/* */
|
|
3238
|
-
|
|
3254
|
+
16777216;
|
|
3239
3255
|
var MountPassiveDev =
|
|
3240
3256
|
/* */
|
|
3241
|
-
|
|
3257
|
+
33554432; // Groups of flags that are used in the commit phase to skip over trees that
|
|
3242
3258
|
// don't contain effects, by checking subtreeFlags.
|
|
3243
3259
|
|
|
3244
3260
|
var BeforeMutationMask = // TODO: Remove Update flag from before mutation phase by re-landing Visibility
|
|
@@ -4236,6 +4252,7 @@ function reenableLogs() {
|
|
|
4236
4252
|
|
|
4237
4253
|
var rendererID = null;
|
|
4238
4254
|
var injectedHook = null;
|
|
4255
|
+
var injectedProfilingHooks = null;
|
|
4239
4256
|
var hasLoggedError = false;
|
|
4240
4257
|
var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined";
|
|
4241
4258
|
function injectInternals(internals) {
|
|
@@ -4266,7 +4283,12 @@ function injectInternals(internals) {
|
|
|
4266
4283
|
}
|
|
4267
4284
|
|
|
4268
4285
|
try {
|
|
4269
|
-
rendererID = hook.inject(
|
|
4286
|
+
rendererID = hook.inject(
|
|
4287
|
+
Object.assign({}, internals, {
|
|
4288
|
+
getLaneLabelMap: getLaneLabelMap,
|
|
4289
|
+
injectProfilingHooks: injectProfilingHooks
|
|
4290
|
+
})
|
|
4291
|
+
); // We have successfully injected, so now it is safe to set up hooks.
|
|
4270
4292
|
|
|
4271
4293
|
injectedHook = hook;
|
|
4272
4294
|
} catch (err) {
|
|
@@ -4393,6 +4415,272 @@ function setIsStrictModeForDevtools(newIsStrictMode) {
|
|
|
4393
4415
|
reenableLogs();
|
|
4394
4416
|
}
|
|
4395
4417
|
}
|
|
4418
|
+
} // Profiler API hooks
|
|
4419
|
+
|
|
4420
|
+
function injectProfilingHooks(profilingHooks) {
|
|
4421
|
+
injectedProfilingHooks = profilingHooks;
|
|
4422
|
+
}
|
|
4423
|
+
|
|
4424
|
+
function getLaneLabelMap() {
|
|
4425
|
+
var map = new Map();
|
|
4426
|
+
var lane = 1;
|
|
4427
|
+
|
|
4428
|
+
for (var index = 0; index < TotalLanes; index++) {
|
|
4429
|
+
var label = getLabelForLane(lane);
|
|
4430
|
+
map.set(lane, label);
|
|
4431
|
+
lane *= 2;
|
|
4432
|
+
}
|
|
4433
|
+
|
|
4434
|
+
return map;
|
|
4435
|
+
}
|
|
4436
|
+
|
|
4437
|
+
function markCommitStarted(lanes) {
|
|
4438
|
+
{
|
|
4439
|
+
if (
|
|
4440
|
+
injectedProfilingHooks !== null &&
|
|
4441
|
+
typeof injectedProfilingHooks.markCommitStarted === "function"
|
|
4442
|
+
) {
|
|
4443
|
+
injectedProfilingHooks.markCommitStarted(lanes);
|
|
4444
|
+
}
|
|
4445
|
+
}
|
|
4446
|
+
}
|
|
4447
|
+
function markCommitStopped() {
|
|
4448
|
+
{
|
|
4449
|
+
if (
|
|
4450
|
+
injectedProfilingHooks !== null &&
|
|
4451
|
+
typeof injectedProfilingHooks.markCommitStopped === "function"
|
|
4452
|
+
) {
|
|
4453
|
+
injectedProfilingHooks.markCommitStopped();
|
|
4454
|
+
}
|
|
4455
|
+
}
|
|
4456
|
+
}
|
|
4457
|
+
function markComponentRenderStarted(fiber) {
|
|
4458
|
+
{
|
|
4459
|
+
if (
|
|
4460
|
+
injectedProfilingHooks !== null &&
|
|
4461
|
+
typeof injectedProfilingHooks.markComponentRenderStarted === "function"
|
|
4462
|
+
) {
|
|
4463
|
+
injectedProfilingHooks.markComponentRenderStarted(fiber);
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4466
|
+
}
|
|
4467
|
+
function markComponentRenderStopped() {
|
|
4468
|
+
{
|
|
4469
|
+
if (
|
|
4470
|
+
injectedProfilingHooks !== null &&
|
|
4471
|
+
typeof injectedProfilingHooks.markComponentRenderStopped === "function"
|
|
4472
|
+
) {
|
|
4473
|
+
injectedProfilingHooks.markComponentRenderStopped();
|
|
4474
|
+
}
|
|
4475
|
+
}
|
|
4476
|
+
}
|
|
4477
|
+
function markComponentPassiveEffectMountStarted(fiber) {
|
|
4478
|
+
{
|
|
4479
|
+
if (
|
|
4480
|
+
injectedProfilingHooks !== null &&
|
|
4481
|
+
typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted ===
|
|
4482
|
+
"function"
|
|
4483
|
+
) {
|
|
4484
|
+
injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber);
|
|
4485
|
+
}
|
|
4486
|
+
}
|
|
4487
|
+
}
|
|
4488
|
+
function markComponentPassiveEffectMountStopped() {
|
|
4489
|
+
{
|
|
4490
|
+
if (
|
|
4491
|
+
injectedProfilingHooks !== null &&
|
|
4492
|
+
typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped ===
|
|
4493
|
+
"function"
|
|
4494
|
+
) {
|
|
4495
|
+
injectedProfilingHooks.markComponentPassiveEffectMountStopped();
|
|
4496
|
+
}
|
|
4497
|
+
}
|
|
4498
|
+
}
|
|
4499
|
+
function markComponentPassiveEffectUnmountStarted(fiber) {
|
|
4500
|
+
{
|
|
4501
|
+
if (
|
|
4502
|
+
injectedProfilingHooks !== null &&
|
|
4503
|
+
typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted ===
|
|
4504
|
+
"function"
|
|
4505
|
+
) {
|
|
4506
|
+
injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber);
|
|
4507
|
+
}
|
|
4508
|
+
}
|
|
4509
|
+
}
|
|
4510
|
+
function markComponentPassiveEffectUnmountStopped() {
|
|
4511
|
+
{
|
|
4512
|
+
if (
|
|
4513
|
+
injectedProfilingHooks !== null &&
|
|
4514
|
+
typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped ===
|
|
4515
|
+
"function"
|
|
4516
|
+
) {
|
|
4517
|
+
injectedProfilingHooks.markComponentPassiveEffectUnmountStopped();
|
|
4518
|
+
}
|
|
4519
|
+
}
|
|
4520
|
+
}
|
|
4521
|
+
function markComponentLayoutEffectMountStarted(fiber) {
|
|
4522
|
+
{
|
|
4523
|
+
if (
|
|
4524
|
+
injectedProfilingHooks !== null &&
|
|
4525
|
+
typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted ===
|
|
4526
|
+
"function"
|
|
4527
|
+
) {
|
|
4528
|
+
injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber);
|
|
4529
|
+
}
|
|
4530
|
+
}
|
|
4531
|
+
}
|
|
4532
|
+
function markComponentLayoutEffectMountStopped() {
|
|
4533
|
+
{
|
|
4534
|
+
if (
|
|
4535
|
+
injectedProfilingHooks !== null &&
|
|
4536
|
+
typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped ===
|
|
4537
|
+
"function"
|
|
4538
|
+
) {
|
|
4539
|
+
injectedProfilingHooks.markComponentLayoutEffectMountStopped();
|
|
4540
|
+
}
|
|
4541
|
+
}
|
|
4542
|
+
}
|
|
4543
|
+
function markComponentLayoutEffectUnmountStarted(fiber) {
|
|
4544
|
+
{
|
|
4545
|
+
if (
|
|
4546
|
+
injectedProfilingHooks !== null &&
|
|
4547
|
+
typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted ===
|
|
4548
|
+
"function"
|
|
4549
|
+
) {
|
|
4550
|
+
injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber);
|
|
4551
|
+
}
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4554
|
+
function markComponentLayoutEffectUnmountStopped() {
|
|
4555
|
+
{
|
|
4556
|
+
if (
|
|
4557
|
+
injectedProfilingHooks !== null &&
|
|
4558
|
+
typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped ===
|
|
4559
|
+
"function"
|
|
4560
|
+
) {
|
|
4561
|
+
injectedProfilingHooks.markComponentLayoutEffectUnmountStopped();
|
|
4562
|
+
}
|
|
4563
|
+
}
|
|
4564
|
+
}
|
|
4565
|
+
function markComponentErrored(fiber, thrownValue, lanes) {
|
|
4566
|
+
{
|
|
4567
|
+
if (
|
|
4568
|
+
injectedProfilingHooks !== null &&
|
|
4569
|
+
typeof injectedProfilingHooks.markComponentErrored === "function"
|
|
4570
|
+
) {
|
|
4571
|
+
injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes);
|
|
4572
|
+
}
|
|
4573
|
+
}
|
|
4574
|
+
}
|
|
4575
|
+
function markComponentSuspended(fiber, wakeable, lanes) {
|
|
4576
|
+
{
|
|
4577
|
+
if (
|
|
4578
|
+
injectedProfilingHooks !== null &&
|
|
4579
|
+
typeof injectedProfilingHooks.markComponentSuspended === "function"
|
|
4580
|
+
) {
|
|
4581
|
+
injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes);
|
|
4582
|
+
}
|
|
4583
|
+
}
|
|
4584
|
+
}
|
|
4585
|
+
function markLayoutEffectsStarted(lanes) {
|
|
4586
|
+
{
|
|
4587
|
+
if (
|
|
4588
|
+
injectedProfilingHooks !== null &&
|
|
4589
|
+
typeof injectedProfilingHooks.markLayoutEffectsStarted === "function"
|
|
4590
|
+
) {
|
|
4591
|
+
injectedProfilingHooks.markLayoutEffectsStarted(lanes);
|
|
4592
|
+
}
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4595
|
+
function markLayoutEffectsStopped() {
|
|
4596
|
+
{
|
|
4597
|
+
if (
|
|
4598
|
+
injectedProfilingHooks !== null &&
|
|
4599
|
+
typeof injectedProfilingHooks.markLayoutEffectsStopped === "function"
|
|
4600
|
+
) {
|
|
4601
|
+
injectedProfilingHooks.markLayoutEffectsStopped();
|
|
4602
|
+
}
|
|
4603
|
+
}
|
|
4604
|
+
}
|
|
4605
|
+
function markPassiveEffectsStarted(lanes) {
|
|
4606
|
+
{
|
|
4607
|
+
if (
|
|
4608
|
+
injectedProfilingHooks !== null &&
|
|
4609
|
+
typeof injectedProfilingHooks.markPassiveEffectsStarted === "function"
|
|
4610
|
+
) {
|
|
4611
|
+
injectedProfilingHooks.markPassiveEffectsStarted(lanes);
|
|
4612
|
+
}
|
|
4613
|
+
}
|
|
4614
|
+
}
|
|
4615
|
+
function markPassiveEffectsStopped() {
|
|
4616
|
+
{
|
|
4617
|
+
if (
|
|
4618
|
+
injectedProfilingHooks !== null &&
|
|
4619
|
+
typeof injectedProfilingHooks.markPassiveEffectsStopped === "function"
|
|
4620
|
+
) {
|
|
4621
|
+
injectedProfilingHooks.markPassiveEffectsStopped();
|
|
4622
|
+
}
|
|
4623
|
+
}
|
|
4624
|
+
}
|
|
4625
|
+
function markRenderStarted(lanes) {
|
|
4626
|
+
{
|
|
4627
|
+
if (
|
|
4628
|
+
injectedProfilingHooks !== null &&
|
|
4629
|
+
typeof injectedProfilingHooks.markRenderStarted === "function"
|
|
4630
|
+
) {
|
|
4631
|
+
injectedProfilingHooks.markRenderStarted(lanes);
|
|
4632
|
+
}
|
|
4633
|
+
}
|
|
4634
|
+
}
|
|
4635
|
+
function markRenderYielded() {
|
|
4636
|
+
{
|
|
4637
|
+
if (
|
|
4638
|
+
injectedProfilingHooks !== null &&
|
|
4639
|
+
typeof injectedProfilingHooks.markRenderYielded === "function"
|
|
4640
|
+
) {
|
|
4641
|
+
injectedProfilingHooks.markRenderYielded();
|
|
4642
|
+
}
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4645
|
+
function markRenderStopped() {
|
|
4646
|
+
{
|
|
4647
|
+
if (
|
|
4648
|
+
injectedProfilingHooks !== null &&
|
|
4649
|
+
typeof injectedProfilingHooks.markRenderStopped === "function"
|
|
4650
|
+
) {
|
|
4651
|
+
injectedProfilingHooks.markRenderStopped();
|
|
4652
|
+
}
|
|
4653
|
+
}
|
|
4654
|
+
}
|
|
4655
|
+
function markRenderScheduled(lane) {
|
|
4656
|
+
{
|
|
4657
|
+
if (
|
|
4658
|
+
injectedProfilingHooks !== null &&
|
|
4659
|
+
typeof injectedProfilingHooks.markRenderScheduled === "function"
|
|
4660
|
+
) {
|
|
4661
|
+
injectedProfilingHooks.markRenderScheduled(lane);
|
|
4662
|
+
}
|
|
4663
|
+
}
|
|
4664
|
+
}
|
|
4665
|
+
function markForceUpdateScheduled(fiber, lane) {
|
|
4666
|
+
{
|
|
4667
|
+
if (
|
|
4668
|
+
injectedProfilingHooks !== null &&
|
|
4669
|
+
typeof injectedProfilingHooks.markForceUpdateScheduled === "function"
|
|
4670
|
+
) {
|
|
4671
|
+
injectedProfilingHooks.markForceUpdateScheduled(fiber, lane);
|
|
4672
|
+
}
|
|
4673
|
+
}
|
|
4674
|
+
}
|
|
4675
|
+
function markStateUpdateScheduled(fiber, lane) {
|
|
4676
|
+
{
|
|
4677
|
+
if (
|
|
4678
|
+
injectedProfilingHooks !== null &&
|
|
4679
|
+
typeof injectedProfilingHooks.markStateUpdateScheduled === "function"
|
|
4680
|
+
) {
|
|
4681
|
+
injectedProfilingHooks.markStateUpdateScheduled(fiber, lane);
|
|
4682
|
+
}
|
|
4683
|
+
}
|
|
4396
4684
|
}
|
|
4397
4685
|
|
|
4398
4686
|
var NoMode =
|
|
@@ -4418,6 +4706,24 @@ var ConcurrentUpdatesByDefaultMode =
|
|
|
4418
4706
|
/* */
|
|
4419
4707
|
32;
|
|
4420
4708
|
|
|
4709
|
+
// TODO: This is pretty well supported by browsers. Maybe we can drop it.
|
|
4710
|
+
var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros.
|
|
4711
|
+
// Based on:
|
|
4712
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
|
|
4713
|
+
|
|
4714
|
+
var log = Math.log;
|
|
4715
|
+
var LN2 = Math.LN2;
|
|
4716
|
+
|
|
4717
|
+
function clz32Fallback(x) {
|
|
4718
|
+
var asUint = x >>> 0;
|
|
4719
|
+
|
|
4720
|
+
if (asUint === 0) {
|
|
4721
|
+
return 32;
|
|
4722
|
+
}
|
|
4723
|
+
|
|
4724
|
+
return (31 - ((log(asUint) / LN2) | 0)) | 0;
|
|
4725
|
+
}
|
|
4726
|
+
|
|
4421
4727
|
// If those values are changed that package should be rebuilt and redeployed.
|
|
4422
4728
|
|
|
4423
4729
|
var TotalLanes = 31;
|
|
@@ -4529,7 +4835,60 @@ var IdleLane =
|
|
|
4529
4835
|
536870912;
|
|
4530
4836
|
var OffscreenLane =
|
|
4531
4837
|
/* */
|
|
4532
|
-
1073741824; // This function is used for the experimental
|
|
4838
|
+
1073741824; // This function is used for the experimental timeline (react-devtools-timeline)
|
|
4839
|
+
// It should be kept in sync with the Lanes values above.
|
|
4840
|
+
|
|
4841
|
+
function getLabelForLane(lane) {
|
|
4842
|
+
{
|
|
4843
|
+
if (lane & SyncLane) {
|
|
4844
|
+
return "Sync";
|
|
4845
|
+
}
|
|
4846
|
+
|
|
4847
|
+
if (lane & InputContinuousHydrationLane) {
|
|
4848
|
+
return "InputContinuousHydration";
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4851
|
+
if (lane & InputContinuousLane) {
|
|
4852
|
+
return "InputContinuous";
|
|
4853
|
+
}
|
|
4854
|
+
|
|
4855
|
+
if (lane & DefaultHydrationLane) {
|
|
4856
|
+
return "DefaultHydration";
|
|
4857
|
+
}
|
|
4858
|
+
|
|
4859
|
+
if (lane & DefaultLane) {
|
|
4860
|
+
return "Default";
|
|
4861
|
+
}
|
|
4862
|
+
|
|
4863
|
+
if (lane & TransitionHydrationLane) {
|
|
4864
|
+
return "TransitionHydration";
|
|
4865
|
+
}
|
|
4866
|
+
|
|
4867
|
+
if (lane & TransitionLanes) {
|
|
4868
|
+
return "Transition";
|
|
4869
|
+
}
|
|
4870
|
+
|
|
4871
|
+
if (lane & RetryLanes) {
|
|
4872
|
+
return "Retry";
|
|
4873
|
+
}
|
|
4874
|
+
|
|
4875
|
+
if (lane & SelectiveHydrationLane) {
|
|
4876
|
+
return "SelectiveHydration";
|
|
4877
|
+
}
|
|
4878
|
+
|
|
4879
|
+
if (lane & IdleHydrationLane) {
|
|
4880
|
+
return "IdleHydration";
|
|
4881
|
+
}
|
|
4882
|
+
|
|
4883
|
+
if (lane & IdleLane) {
|
|
4884
|
+
return "Idle";
|
|
4885
|
+
}
|
|
4886
|
+
|
|
4887
|
+
if (lane & OffscreenLane) {
|
|
4888
|
+
return "Offscreen";
|
|
4889
|
+
}
|
|
4890
|
+
}
|
|
4891
|
+
}
|
|
4533
4892
|
var NoTimestamp = -1;
|
|
4534
4893
|
var nextTransitionLane = TransitionLane1;
|
|
4535
4894
|
var nextRetryLane = RetryLane1;
|
|
@@ -5007,7 +5366,6 @@ function markRootFinished(root, remainingLanes) {
|
|
|
5007
5366
|
root.expiredLanes &= remainingLanes;
|
|
5008
5367
|
root.mutableReadLanes &= remainingLanes;
|
|
5009
5368
|
root.entangledLanes &= remainingLanes;
|
|
5010
|
-
|
|
5011
5369
|
var entanglements = root.entanglements;
|
|
5012
5370
|
var eventTimes = root.eventTimes;
|
|
5013
5371
|
var expirationTimes = root.expirationTimes; // Clear the lanes that no longer have pending work
|
|
@@ -5096,20 +5454,6 @@ function movePendingFibersToMemoized(root, lanes) {
|
|
|
5096
5454
|
lanes &= ~lane;
|
|
5097
5455
|
}
|
|
5098
5456
|
}
|
|
5099
|
-
var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros. Only used on lanes, so assume input is an integer.
|
|
5100
|
-
// Based on:
|
|
5101
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32
|
|
5102
|
-
|
|
5103
|
-
var log = Math.log;
|
|
5104
|
-
var LN2 = Math.LN2;
|
|
5105
|
-
|
|
5106
|
-
function clz32Fallback(lanes) {
|
|
5107
|
-
if (lanes === 0) {
|
|
5108
|
-
return 32;
|
|
5109
|
-
}
|
|
5110
|
-
|
|
5111
|
-
return (31 - ((log(lanes) / LN2) | 0)) | 0;
|
|
5112
|
-
}
|
|
5113
5457
|
|
|
5114
5458
|
var DiscreteEventPriority = SyncLane;
|
|
5115
5459
|
var ContinuousEventPriority = InputContinuousLane;
|
|
@@ -5535,9 +5879,6 @@ function clearContainer(container) {
|
|
|
5535
5879
|
function unhideTextInstance(textInstance, text) {
|
|
5536
5880
|
throw new Error("Not yet implemented.");
|
|
5537
5881
|
}
|
|
5538
|
-
function makeClientIdInDEV(warnOnAccessInDEV) {
|
|
5539
|
-
throw new Error("Not yet implemented");
|
|
5540
|
-
}
|
|
5541
5882
|
function preparePortalMount(portalInstance) {
|
|
5542
5883
|
// noop
|
|
5543
5884
|
}
|
|
@@ -6173,13 +6514,6 @@ function flushSyncCallbacks() {
|
|
|
6173
6514
|
return null;
|
|
6174
6515
|
}
|
|
6175
6516
|
|
|
6176
|
-
var ReactVersion = "18.0.0-afcb9cdc9-20211008";
|
|
6177
|
-
|
|
6178
|
-
function markComponentRenderStopped() {}
|
|
6179
|
-
function markComponentErrored(fiber, thrownValue, lanes) {}
|
|
6180
|
-
|
|
6181
|
-
function markComponentSuspended(fiber, wakeable, lanes) {}
|
|
6182
|
-
|
|
6183
6517
|
var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
6184
6518
|
var NoTransition = 0;
|
|
6185
6519
|
function requestCurrentTransition() {
|
|
@@ -6214,9 +6548,11 @@ function shallowEqual(objA, objB) {
|
|
|
6214
6548
|
} // Test for A's keys different from B.
|
|
6215
6549
|
|
|
6216
6550
|
for (var i = 0; i < keysA.length; i++) {
|
|
6551
|
+
var currentKey = keysA[i];
|
|
6552
|
+
|
|
6217
6553
|
if (
|
|
6218
|
-
!hasOwnProperty.call(objB,
|
|
6219
|
-
!objectIs(objA[
|
|
6554
|
+
!hasOwnProperty.call(objB, currentKey) ||
|
|
6555
|
+
!objectIs(objA[currentKey], objB[currentKey])
|
|
6220
6556
|
) {
|
|
6221
6557
|
return false;
|
|
6222
6558
|
}
|
|
@@ -6323,11 +6659,6 @@ function setIsRendering(rendering) {
|
|
|
6323
6659
|
isRendering = rendering;
|
|
6324
6660
|
}
|
|
6325
6661
|
}
|
|
6326
|
-
function getIsRendering() {
|
|
6327
|
-
{
|
|
6328
|
-
return isRendering;
|
|
6329
|
-
}
|
|
6330
|
-
}
|
|
6331
6662
|
|
|
6332
6663
|
var ReactStrictModeWarnings = {
|
|
6333
6664
|
recordUnsafeLifecycleWarnings: function(fiber, instance) {},
|
|
@@ -6687,7 +7018,6 @@ var ReactStrictModeWarnings = {
|
|
|
6687
7018
|
* of the `value` object).
|
|
6688
7019
|
*/
|
|
6689
7020
|
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
6690
|
-
|
|
6691
7021
|
function typeName(value) {
|
|
6692
7022
|
{
|
|
6693
7023
|
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
@@ -6702,17 +7032,6 @@ function typeName(value) {
|
|
|
6702
7032
|
|
|
6703
7033
|
function willCoercionThrow(value) {
|
|
6704
7034
|
{
|
|
6705
|
-
if (
|
|
6706
|
-
value !== null &&
|
|
6707
|
-
typeof value === "object" &&
|
|
6708
|
-
value.$$typeof === REACT_OPAQUE_ID_TYPE
|
|
6709
|
-
) {
|
|
6710
|
-
// OpaqueID type is expected to throw, so React will handle it. Not sure if
|
|
6711
|
-
// it's expected that string coercion will throw, but we'll assume it's OK.
|
|
6712
|
-
// See https://github.com/facebook/react/issues/20127.
|
|
6713
|
-
return;
|
|
6714
|
-
}
|
|
6715
|
-
|
|
6716
7035
|
try {
|
|
6717
7036
|
testStringCoercion(value);
|
|
6718
7037
|
return false;
|
|
@@ -7789,6 +8108,10 @@ var classComponentUpdater = {
|
|
|
7789
8108
|
if (root !== null) {
|
|
7790
8109
|
entangleTransitions(root, fiber, lane);
|
|
7791
8110
|
}
|
|
8111
|
+
|
|
8112
|
+
{
|
|
8113
|
+
markStateUpdateScheduled(fiber, lane);
|
|
8114
|
+
}
|
|
7792
8115
|
},
|
|
7793
8116
|
enqueueReplaceState: function(inst, payload, callback) {
|
|
7794
8117
|
var fiber = get(inst);
|
|
@@ -7812,6 +8135,10 @@ var classComponentUpdater = {
|
|
|
7812
8135
|
if (root !== null) {
|
|
7813
8136
|
entangleTransitions(root, fiber, lane);
|
|
7814
8137
|
}
|
|
8138
|
+
|
|
8139
|
+
{
|
|
8140
|
+
markStateUpdateScheduled(fiber, lane);
|
|
8141
|
+
}
|
|
7815
8142
|
},
|
|
7816
8143
|
enqueueForceUpdate: function(inst, callback) {
|
|
7817
8144
|
var fiber = get(inst);
|
|
@@ -7834,6 +8161,10 @@ var classComponentUpdater = {
|
|
|
7834
8161
|
if (root !== null) {
|
|
7835
8162
|
entangleTransitions(root, fiber, lane);
|
|
7836
8163
|
}
|
|
8164
|
+
|
|
8165
|
+
{
|
|
8166
|
+
markForceUpdateScheduled(fiber, lane);
|
|
8167
|
+
}
|
|
7837
8168
|
}
|
|
7838
8169
|
};
|
|
7839
8170
|
|
|
@@ -8772,6 +9103,84 @@ function updateClassInstance(
|
|
|
8772
9103
|
return shouldUpdate;
|
|
8773
9104
|
}
|
|
8774
9105
|
|
|
9106
|
+
// TODO: Use the unified fiber stack module instead of this local one?
|
|
9107
|
+
// Intentionally not using it yet to derisk the initial implementation, because
|
|
9108
|
+
// the way we push/pop these values is a bit unusual. If there's a mistake, I'd
|
|
9109
|
+
// rather the ids be wrong than crash the whole reconciler.
|
|
9110
|
+
var forkStack = [];
|
|
9111
|
+
var forkStackIndex = 0;
|
|
9112
|
+
var treeForkProvider = null;
|
|
9113
|
+
var treeForkCount = 0;
|
|
9114
|
+
var idStack = [];
|
|
9115
|
+
var idStackIndex = 0;
|
|
9116
|
+
var treeContextProvider = null;
|
|
9117
|
+
var treeContextId = 1;
|
|
9118
|
+
var treeContextOverflow = "";
|
|
9119
|
+
|
|
9120
|
+
function popTreeContext(workInProgress) {
|
|
9121
|
+
// Restore the previous values.
|
|
9122
|
+
// This is a bit more complicated than other context-like modules in Fiber
|
|
9123
|
+
// because the same Fiber may appear on the stack multiple times and for
|
|
9124
|
+
// different reasons. We have to keep popping until the work-in-progress is
|
|
9125
|
+
// no longer at the top of the stack.
|
|
9126
|
+
while (workInProgress === treeForkProvider) {
|
|
9127
|
+
treeForkProvider = forkStack[--forkStackIndex];
|
|
9128
|
+
forkStack[forkStackIndex] = null;
|
|
9129
|
+
treeForkCount = forkStack[--forkStackIndex];
|
|
9130
|
+
forkStack[forkStackIndex] = null;
|
|
9131
|
+
}
|
|
9132
|
+
|
|
9133
|
+
while (workInProgress === treeContextProvider) {
|
|
9134
|
+
treeContextProvider = idStack[--idStackIndex];
|
|
9135
|
+
idStack[idStackIndex] = null;
|
|
9136
|
+
treeContextOverflow = idStack[--idStackIndex];
|
|
9137
|
+
idStack[idStackIndex] = null;
|
|
9138
|
+
treeContextId = idStack[--idStackIndex];
|
|
9139
|
+
idStack[idStackIndex] = null;
|
|
9140
|
+
}
|
|
9141
|
+
}
|
|
9142
|
+
|
|
9143
|
+
var isHydrating = false;
|
|
9144
|
+
|
|
9145
|
+
function enterHydrationState(fiber) {
|
|
9146
|
+
{
|
|
9147
|
+
return false;
|
|
9148
|
+
}
|
|
9149
|
+
}
|
|
9150
|
+
|
|
9151
|
+
function prepareToHydrateHostInstance(
|
|
9152
|
+
fiber,
|
|
9153
|
+
rootContainerInstance,
|
|
9154
|
+
hostContext
|
|
9155
|
+
) {
|
|
9156
|
+
{
|
|
9157
|
+
throw new Error(
|
|
9158
|
+
"Expected prepareToHydrateHostInstance() to never be called. " +
|
|
9159
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
9160
|
+
);
|
|
9161
|
+
}
|
|
9162
|
+
}
|
|
9163
|
+
|
|
9164
|
+
function prepareToHydrateHostTextInstance(fiber) {
|
|
9165
|
+
{
|
|
9166
|
+
throw new Error(
|
|
9167
|
+
"Expected prepareToHydrateHostTextInstance() to never be called. " +
|
|
9168
|
+
"This error is likely caused by a bug in React. Please file an issue."
|
|
9169
|
+
);
|
|
9170
|
+
}
|
|
9171
|
+
var shouldUpdate = hydrateTextInstance();
|
|
9172
|
+
}
|
|
9173
|
+
|
|
9174
|
+
function popHydrationState(fiber) {
|
|
9175
|
+
{
|
|
9176
|
+
return false;
|
|
9177
|
+
}
|
|
9178
|
+
}
|
|
9179
|
+
|
|
9180
|
+
function getIsHydrating() {
|
|
9181
|
+
return isHydrating;
|
|
9182
|
+
}
|
|
9183
|
+
|
|
8775
9184
|
var didWarnAboutMaps;
|
|
8776
9185
|
var didWarnAboutGenerators;
|
|
8777
9186
|
var didWarnAboutStringRefs;
|
|
@@ -9055,7 +9464,9 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9055
9464
|
newFiber.index = newIndex;
|
|
9056
9465
|
|
|
9057
9466
|
if (!shouldTrackSideEffects) {
|
|
9058
|
-
//
|
|
9467
|
+
// During hydration, the useId algorithm needs to know which fibers are
|
|
9468
|
+
// part of a list of children (arrays, iterators).
|
|
9469
|
+
newFiber.flags |= Forked;
|
|
9059
9470
|
return lastPlacedIndex;
|
|
9060
9471
|
}
|
|
9061
9472
|
|
|
@@ -9184,7 +9595,10 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9184
9595
|
}
|
|
9185
9596
|
|
|
9186
9597
|
function createChild(returnFiber, newChild, lanes) {
|
|
9187
|
-
if (
|
|
9598
|
+
if (
|
|
9599
|
+
(typeof newChild === "string" && newChild !== "") ||
|
|
9600
|
+
typeof newChild === "number"
|
|
9601
|
+
) {
|
|
9188
9602
|
// Text nodes don't have keys. If the previous node is implicitly keyed
|
|
9189
9603
|
// we can continue to replace it without aborting even if it is not a text
|
|
9190
9604
|
// node.
|
|
@@ -9247,7 +9661,10 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9247
9661
|
// Update the fiber if the keys match, otherwise return null.
|
|
9248
9662
|
var key = oldFiber !== null ? oldFiber.key : null;
|
|
9249
9663
|
|
|
9250
|
-
if (
|
|
9664
|
+
if (
|
|
9665
|
+
(typeof newChild === "string" && newChild !== "") ||
|
|
9666
|
+
typeof newChild === "number"
|
|
9667
|
+
) {
|
|
9251
9668
|
// Text nodes don't have keys. If the previous node is implicitly keyed
|
|
9252
9669
|
// we can continue to replace it without aborting even if it is not a text
|
|
9253
9670
|
// node.
|
|
@@ -9304,7 +9721,10 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9304
9721
|
newChild,
|
|
9305
9722
|
lanes
|
|
9306
9723
|
) {
|
|
9307
|
-
if (
|
|
9724
|
+
if (
|
|
9725
|
+
(typeof newChild === "string" && newChild !== "") ||
|
|
9726
|
+
typeof newChild === "number"
|
|
9727
|
+
) {
|
|
9308
9728
|
// Text nodes don't have keys, so we neither have to check the old nor
|
|
9309
9729
|
// new node for the key. If both are text nodes, they match.
|
|
9310
9730
|
var matchedFiber = existingChildren.get(newIdx) || null;
|
|
@@ -9495,6 +9915,7 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9495
9915
|
if (newIdx === newChildren.length) {
|
|
9496
9916
|
// We've reached the end of the new children. We can delete the rest.
|
|
9497
9917
|
deleteRemainingChildren(returnFiber, oldFiber);
|
|
9918
|
+
|
|
9498
9919
|
return resultingFirstChild;
|
|
9499
9920
|
}
|
|
9500
9921
|
|
|
@@ -9701,6 +10122,7 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9701
10122
|
if (step.done) {
|
|
9702
10123
|
// We've reached the end of the new children. We can delete the rest.
|
|
9703
10124
|
deleteRemainingChildren(returnFiber, oldFiber);
|
|
10125
|
+
|
|
9704
10126
|
return resultingFirstChild;
|
|
9705
10127
|
}
|
|
9706
10128
|
|
|
@@ -9987,7 +10409,10 @@ function ChildReconciler(shouldTrackSideEffects) {
|
|
|
9987
10409
|
throwOnInvalidObjectType(returnFiber, newChild);
|
|
9988
10410
|
}
|
|
9989
10411
|
|
|
9990
|
-
if (
|
|
10412
|
+
if (
|
|
10413
|
+
(typeof newChild === "string" && newChild !== "") ||
|
|
10414
|
+
typeof newChild === "number"
|
|
10415
|
+
) {
|
|
9991
10416
|
return placeSingleChild(
|
|
9992
10417
|
reconcileSingleTextNode(
|
|
9993
10418
|
returnFiber,
|
|
@@ -10177,16 +10602,9 @@ function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
|
|
|
10177
10602
|
|
|
10178
10603
|
var props = workInProgress.memoizedProps; // Regular boundaries always capture.
|
|
10179
10604
|
|
|
10180
|
-
|
|
10605
|
+
{
|
|
10181
10606
|
return true;
|
|
10182
10607
|
} // If it's a boundary we should avoid, then we prefer to bubble up to the
|
|
10183
|
-
// parent boundary if it is currently invisible.
|
|
10184
|
-
|
|
10185
|
-
if (hasInvisibleParent) {
|
|
10186
|
-
return false;
|
|
10187
|
-
} // If the parent is not able to handle it, we must handle it.
|
|
10188
|
-
|
|
10189
|
-
return true;
|
|
10190
10608
|
}
|
|
10191
10609
|
function findFirstSuspended(row) {
|
|
10192
10610
|
var node = row;
|
|
@@ -10259,47 +10677,6 @@ var Passive$1 =
|
|
|
10259
10677
|
/* */
|
|
10260
10678
|
8;
|
|
10261
10679
|
|
|
10262
|
-
var isHydrating = false;
|
|
10263
|
-
|
|
10264
|
-
function enterHydrationState(fiber) {
|
|
10265
|
-
{
|
|
10266
|
-
return false;
|
|
10267
|
-
}
|
|
10268
|
-
}
|
|
10269
|
-
|
|
10270
|
-
function prepareToHydrateHostInstance(
|
|
10271
|
-
fiber,
|
|
10272
|
-
rootContainerInstance,
|
|
10273
|
-
hostContext
|
|
10274
|
-
) {
|
|
10275
|
-
{
|
|
10276
|
-
throw new Error(
|
|
10277
|
-
"Expected prepareToHydrateHostInstance() to never be called. " +
|
|
10278
|
-
"This error is likely caused by a bug in React. Please file an issue."
|
|
10279
|
-
);
|
|
10280
|
-
}
|
|
10281
|
-
}
|
|
10282
|
-
|
|
10283
|
-
function prepareToHydrateHostTextInstance(fiber) {
|
|
10284
|
-
{
|
|
10285
|
-
throw new Error(
|
|
10286
|
-
"Expected prepareToHydrateHostTextInstance() to never be called. " +
|
|
10287
|
-
"This error is likely caused by a bug in React. Please file an issue."
|
|
10288
|
-
);
|
|
10289
|
-
}
|
|
10290
|
-
var shouldUpdate = hydrateTextInstance();
|
|
10291
|
-
}
|
|
10292
|
-
|
|
10293
|
-
function popHydrationState(fiber) {
|
|
10294
|
-
{
|
|
10295
|
-
return false;
|
|
10296
|
-
}
|
|
10297
|
-
}
|
|
10298
|
-
|
|
10299
|
-
function getIsHydrating() {
|
|
10300
|
-
return isHydrating;
|
|
10301
|
-
}
|
|
10302
|
-
|
|
10303
10680
|
// and should be reset before starting a new render.
|
|
10304
10681
|
// This tracks which mutable sources need to be reset after a render.
|
|
10305
10682
|
|
|
@@ -10361,11 +10738,9 @@ function getSuspendedCachePool() {
|
|
|
10361
10738
|
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
|
|
10362
10739
|
ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
|
|
10363
10740
|
var didWarnAboutMismatchedHooksForComponent;
|
|
10364
|
-
var didWarnAboutUseOpaqueIdentifier;
|
|
10365
10741
|
var didWarnUncachedGetSnapshot;
|
|
10366
10742
|
|
|
10367
10743
|
{
|
|
10368
|
-
didWarnAboutUseOpaqueIdentifier = {};
|
|
10369
10744
|
didWarnAboutMismatchedHooksForComponent = new Set();
|
|
10370
10745
|
}
|
|
10371
10746
|
|
|
@@ -10389,7 +10764,13 @@ var didScheduleRenderPhaseUpdate = false; // Where an update was scheduled only
|
|
|
10389
10764
|
// TODO: Maybe there's some way to consolidate this with
|
|
10390
10765
|
// `didScheduleRenderPhaseUpdate`. Or with `numberOfReRenders`.
|
|
10391
10766
|
|
|
10392
|
-
var didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
10767
|
+
var didScheduleRenderPhaseUpdateDuringThisPass = false; // Counts the number of useId hooks in this component.
|
|
10768
|
+
|
|
10769
|
+
var localIdCounter = 0; // Used for ids that are generated completely client-side (i.e. not during
|
|
10770
|
+
// hydration). This counter is global, so client ids are not stable across
|
|
10771
|
+
// render attempts.
|
|
10772
|
+
|
|
10773
|
+
var globalClientIdCounter = 0;
|
|
10393
10774
|
var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook
|
|
10394
10775
|
|
|
10395
10776
|
var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.
|
|
@@ -10570,6 +10951,7 @@ function renderWithHooks(
|
|
|
10570
10951
|
// currentHook = null;
|
|
10571
10952
|
// workInProgressHook = null;
|
|
10572
10953
|
// didScheduleRenderPhaseUpdate = false;
|
|
10954
|
+
// localIdCounter = 0;
|
|
10573
10955
|
// TODO Warn if no hooks are used at all during mount, then some are used during update.
|
|
10574
10956
|
// Currently we will identify the update render as a mount because memoizedState === null.
|
|
10575
10957
|
// This is tricky because it's valid for certain types of components (e.g. React.lazy)
|
|
@@ -10601,6 +10983,7 @@ function renderWithHooks(
|
|
|
10601
10983
|
|
|
10602
10984
|
do {
|
|
10603
10985
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
10986
|
+
localIdCounter = 0;
|
|
10604
10987
|
|
|
10605
10988
|
if (numberOfReRenders >= RE_RENDER_LIMIT) {
|
|
10606
10989
|
throw new Error(
|
|
@@ -10669,7 +11052,8 @@ function renderWithHooks(
|
|
|
10669
11052
|
}
|
|
10670
11053
|
}
|
|
10671
11054
|
|
|
10672
|
-
didScheduleRenderPhaseUpdate = false;
|
|
11055
|
+
didScheduleRenderPhaseUpdate = false; // This is reset by checkDidRenderIdHook
|
|
11056
|
+
// localIdCounter = 0;
|
|
10673
11057
|
|
|
10674
11058
|
if (didRenderTooFewHooks) {
|
|
10675
11059
|
throw new Error(
|
|
@@ -10680,6 +11064,14 @@ function renderWithHooks(
|
|
|
10680
11064
|
|
|
10681
11065
|
return children;
|
|
10682
11066
|
}
|
|
11067
|
+
function checkDidRenderIdHook() {
|
|
11068
|
+
// This should be called immediately after every renderWithHooks call.
|
|
11069
|
+
// Conceptually, it's part of the return value of renderWithHooks; it's only a
|
|
11070
|
+
// separate function to avoid using an array tuple.
|
|
11071
|
+
var didRenderIdHook = localIdCounter !== 0;
|
|
11072
|
+
localIdCounter = 0;
|
|
11073
|
+
return didRenderIdHook;
|
|
11074
|
+
}
|
|
10683
11075
|
function bailoutHooks(current, workInProgress, lanes) {
|
|
10684
11076
|
workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the
|
|
10685
11077
|
// complete phase (bubbleProperties).
|
|
@@ -10739,6 +11131,7 @@ function resetHooksAfterThrow() {
|
|
|
10739
11131
|
}
|
|
10740
11132
|
|
|
10741
11133
|
didScheduleRenderPhaseUpdateDuringThisPass = false;
|
|
11134
|
+
localIdCounter = 0;
|
|
10742
11135
|
}
|
|
10743
11136
|
|
|
10744
11137
|
function mountWorkInProgressHook() {
|
|
@@ -11640,13 +12033,6 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
|
|
|
11640
12033
|
}
|
|
11641
12034
|
|
|
11642
12035
|
function mountEffect(create, deps) {
|
|
11643
|
-
{
|
|
11644
|
-
// $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
|
|
11645
|
-
if ("undefined" !== typeof jest) {
|
|
11646
|
-
warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
|
|
11647
|
-
}
|
|
11648
|
-
}
|
|
11649
|
-
|
|
11650
12036
|
if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
|
|
11651
12037
|
return mountEffectImpl(
|
|
11652
12038
|
MountPassiveDev | Passive | PassiveStatic,
|
|
@@ -11660,13 +12046,6 @@ function mountEffect(create, deps) {
|
|
|
11660
12046
|
}
|
|
11661
12047
|
|
|
11662
12048
|
function updateEffect(create, deps) {
|
|
11663
|
-
{
|
|
11664
|
-
// $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
|
|
11665
|
-
if ("undefined" !== typeof jest) {
|
|
11666
|
-
warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
|
|
11667
|
-
}
|
|
11668
|
-
}
|
|
11669
|
-
|
|
11670
12049
|
return updateEffectImpl(Passive, Passive$1, create, deps);
|
|
11671
12050
|
}
|
|
11672
12051
|
|
|
@@ -11972,44 +12351,30 @@ function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
|
|
|
11972
12351
|
}
|
|
11973
12352
|
}
|
|
11974
12353
|
|
|
11975
|
-
function
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
"The object passed back from useOpaqueIdentifier is meant to be " +
|
|
11983
|
-
"passed through to attributes only. Do not read the " +
|
|
11984
|
-
"value directly."
|
|
11985
|
-
);
|
|
12354
|
+
function mountId() {
|
|
12355
|
+
var hook = mountWorkInProgressHook();
|
|
12356
|
+
var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we
|
|
12357
|
+
// should do this in Fiber, too? Deferring this decision for now because
|
|
12358
|
+
// there's no other place to store the prefix except for an internal field on
|
|
12359
|
+
// the public createRoot object, which the fiber tree does not currently have
|
|
12360
|
+
// a reference to.
|
|
11986
12361
|
|
|
11987
|
-
|
|
11988
|
-
|
|
11989
|
-
}
|
|
11990
|
-
}
|
|
11991
|
-
|
|
11992
|
-
function mountOpaqueIdentifier() {
|
|
11993
|
-
var makeId = makeClientIdInDEV.bind(
|
|
11994
|
-
null,
|
|
11995
|
-
warnOnOpaqueIdentifierAccessInDEV.bind(null, currentlyRenderingFiber$1)
|
|
11996
|
-
);
|
|
12362
|
+
var identifierPrefix = root.identifierPrefix;
|
|
12363
|
+
var id;
|
|
11997
12364
|
|
|
11998
12365
|
{
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
return _id;
|
|
12366
|
+
// Use a lowercase r prefix for client-generated ids.
|
|
12367
|
+
var globalClientId = globalClientIdCounter++;
|
|
12368
|
+
id = identifierPrefix + "r:" + globalClientId.toString(32);
|
|
12003
12369
|
}
|
|
12004
|
-
}
|
|
12005
12370
|
|
|
12006
|
-
|
|
12007
|
-
var id = updateState()[0];
|
|
12371
|
+
hook.memoizedState = id;
|
|
12008
12372
|
return id;
|
|
12009
12373
|
}
|
|
12010
12374
|
|
|
12011
|
-
function
|
|
12012
|
-
var
|
|
12375
|
+
function updateId() {
|
|
12376
|
+
var hook = updateWorkInProgressHook();
|
|
12377
|
+
var id = hook.memoizedState;
|
|
12013
12378
|
return id;
|
|
12014
12379
|
}
|
|
12015
12380
|
|
|
@@ -12037,14 +12402,6 @@ function dispatchReducerAction(fiber, queue, action) {
|
|
|
12037
12402
|
enqueueRenderPhaseUpdate(queue, update);
|
|
12038
12403
|
} else {
|
|
12039
12404
|
enqueueUpdate$1(fiber, queue, update);
|
|
12040
|
-
|
|
12041
|
-
{
|
|
12042
|
-
// $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
|
|
12043
|
-
if ("undefined" !== typeof jest) {
|
|
12044
|
-
warnIfNotCurrentlyActingUpdatesInDev(fiber);
|
|
12045
|
-
}
|
|
12046
|
-
}
|
|
12047
|
-
|
|
12048
12405
|
var eventTime = requestEventTime();
|
|
12049
12406
|
var root = scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
12050
12407
|
|
|
@@ -12052,6 +12409,8 @@ function dispatchReducerAction(fiber, queue, action) {
|
|
|
12052
12409
|
entangleTransitionUpdate(root, queue, lane);
|
|
12053
12410
|
}
|
|
12054
12411
|
}
|
|
12412
|
+
|
|
12413
|
+
markUpdateInDevTools(fiber, lane);
|
|
12055
12414
|
}
|
|
12056
12415
|
|
|
12057
12416
|
function dispatchSetState(fiber, queue, action) {
|
|
@@ -12124,13 +12483,6 @@ function dispatchSetState(fiber, queue, action) {
|
|
|
12124
12483
|
}
|
|
12125
12484
|
}
|
|
12126
12485
|
|
|
12127
|
-
{
|
|
12128
|
-
// $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
|
|
12129
|
-
if ("undefined" !== typeof jest) {
|
|
12130
|
-
warnIfNotCurrentlyActingUpdatesInDev(fiber);
|
|
12131
|
-
}
|
|
12132
|
-
}
|
|
12133
|
-
|
|
12134
12486
|
var eventTime = requestEventTime();
|
|
12135
12487
|
var root = scheduleUpdateOnFiber(fiber, lane, eventTime);
|
|
12136
12488
|
|
|
@@ -12138,6 +12490,8 @@ function dispatchSetState(fiber, queue, action) {
|
|
|
12138
12490
|
entangleTransitionUpdate(root, queue, lane);
|
|
12139
12491
|
}
|
|
12140
12492
|
}
|
|
12493
|
+
|
|
12494
|
+
markUpdateInDevTools(fiber, lane);
|
|
12141
12495
|
}
|
|
12142
12496
|
|
|
12143
12497
|
function isRenderPhaseUpdate(fiber) {
|
|
@@ -12216,6 +12570,12 @@ function entangleTransitionUpdate(root, queue, lane) {
|
|
|
12216
12570
|
}
|
|
12217
12571
|
}
|
|
12218
12572
|
|
|
12573
|
+
function markUpdateInDevTools(fiber, lane, action) {
|
|
12574
|
+
{
|
|
12575
|
+
markStateUpdateScheduled(fiber, lane);
|
|
12576
|
+
}
|
|
12577
|
+
}
|
|
12578
|
+
|
|
12219
12579
|
var ContextOnlyDispatcher = {
|
|
12220
12580
|
readContext: readContext,
|
|
12221
12581
|
useCallback: throwInvalidHookError,
|
|
@@ -12233,7 +12593,7 @@ var ContextOnlyDispatcher = {
|
|
|
12233
12593
|
useTransition: throwInvalidHookError,
|
|
12234
12594
|
useMutableSource: throwInvalidHookError,
|
|
12235
12595
|
useSyncExternalStore: throwInvalidHookError,
|
|
12236
|
-
|
|
12596
|
+
useId: throwInvalidHookError,
|
|
12237
12597
|
unstable_isNewReconciler: enableNewReconciler
|
|
12238
12598
|
};
|
|
12239
12599
|
|
|
@@ -12370,10 +12730,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12370
12730
|
mountHookTypesDev();
|
|
12371
12731
|
return mountSyncExternalStore(subscribe, getSnapshot);
|
|
12372
12732
|
},
|
|
12373
|
-
|
|
12374
|
-
currentHookNameInDev = "
|
|
12733
|
+
useId: function() {
|
|
12734
|
+
currentHookNameInDev = "useId";
|
|
12375
12735
|
mountHookTypesDev();
|
|
12376
|
-
return
|
|
12736
|
+
return mountId();
|
|
12377
12737
|
},
|
|
12378
12738
|
unstable_isNewReconciler: enableNewReconciler
|
|
12379
12739
|
};
|
|
@@ -12478,10 +12838,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12478
12838
|
updateHookTypesDev();
|
|
12479
12839
|
return mountSyncExternalStore(subscribe, getSnapshot);
|
|
12480
12840
|
},
|
|
12481
|
-
|
|
12482
|
-
currentHookNameInDev = "
|
|
12841
|
+
useId: function() {
|
|
12842
|
+
currentHookNameInDev = "useId";
|
|
12483
12843
|
updateHookTypesDev();
|
|
12484
|
-
return
|
|
12844
|
+
return mountId();
|
|
12485
12845
|
},
|
|
12486
12846
|
unstable_isNewReconciler: enableNewReconciler
|
|
12487
12847
|
};
|
|
@@ -12586,10 +12946,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12586
12946
|
updateHookTypesDev();
|
|
12587
12947
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
12588
12948
|
},
|
|
12589
|
-
|
|
12590
|
-
currentHookNameInDev = "
|
|
12949
|
+
useId: function() {
|
|
12950
|
+
currentHookNameInDev = "useId";
|
|
12591
12951
|
updateHookTypesDev();
|
|
12592
|
-
return
|
|
12952
|
+
return updateId();
|
|
12593
12953
|
},
|
|
12594
12954
|
unstable_isNewReconciler: enableNewReconciler
|
|
12595
12955
|
};
|
|
@@ -12694,10 +13054,10 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12694
13054
|
updateHookTypesDev();
|
|
12695
13055
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
12696
13056
|
},
|
|
12697
|
-
|
|
12698
|
-
currentHookNameInDev = "
|
|
13057
|
+
useId: function() {
|
|
13058
|
+
currentHookNameInDev = "useId";
|
|
12699
13059
|
updateHookTypesDev();
|
|
12700
|
-
return
|
|
13060
|
+
return updateId();
|
|
12701
13061
|
},
|
|
12702
13062
|
unstable_isNewReconciler: enableNewReconciler
|
|
12703
13063
|
};
|
|
@@ -12818,11 +13178,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12818
13178
|
mountHookTypesDev();
|
|
12819
13179
|
return mountSyncExternalStore(subscribe, getSnapshot);
|
|
12820
13180
|
},
|
|
12821
|
-
|
|
12822
|
-
currentHookNameInDev = "
|
|
13181
|
+
useId: function() {
|
|
13182
|
+
currentHookNameInDev = "useId";
|
|
12823
13183
|
warnInvalidHookAccess();
|
|
12824
13184
|
mountHookTypesDev();
|
|
12825
|
-
return
|
|
13185
|
+
return mountId();
|
|
12826
13186
|
},
|
|
12827
13187
|
unstable_isNewReconciler: enableNewReconciler
|
|
12828
13188
|
};
|
|
@@ -12943,11 +13303,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
12943
13303
|
updateHookTypesDev();
|
|
12944
13304
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
12945
13305
|
},
|
|
12946
|
-
|
|
12947
|
-
currentHookNameInDev = "
|
|
13306
|
+
useId: function() {
|
|
13307
|
+
currentHookNameInDev = "useId";
|
|
12948
13308
|
warnInvalidHookAccess();
|
|
12949
13309
|
updateHookTypesDev();
|
|
12950
|
-
return
|
|
13310
|
+
return updateId();
|
|
12951
13311
|
},
|
|
12952
13312
|
unstable_isNewReconciler: enableNewReconciler
|
|
12953
13313
|
};
|
|
@@ -13068,11 +13428,11 @@ var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
|
|
|
13068
13428
|
updateHookTypesDev();
|
|
13069
13429
|
return updateSyncExternalStore(subscribe, getSnapshot);
|
|
13070
13430
|
},
|
|
13071
|
-
|
|
13072
|
-
currentHookNameInDev = "
|
|
13431
|
+
useId: function() {
|
|
13432
|
+
currentHookNameInDev = "useId";
|
|
13073
13433
|
warnInvalidHookAccess();
|
|
13074
13434
|
updateHookTypesDev();
|
|
13075
|
-
return
|
|
13435
|
+
return updateId();
|
|
13076
13436
|
},
|
|
13077
13437
|
unstable_isNewReconciler: enableNewReconciler
|
|
13078
13438
|
};
|
|
@@ -13534,137 +13894,133 @@ function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
|
|
|
13534
13894
|
}
|
|
13535
13895
|
}
|
|
13536
13896
|
|
|
13537
|
-
function
|
|
13538
|
-
returnFiber
|
|
13539
|
-
sourceFiber,
|
|
13540
|
-
root,
|
|
13541
|
-
rootRenderLanes
|
|
13542
|
-
) {
|
|
13543
|
-
var hasInvisibleParentBoundary = hasSuspenseContext(
|
|
13544
|
-
suspenseStackCursor.current,
|
|
13545
|
-
InvisibleParentSuspenseContext
|
|
13546
|
-
);
|
|
13547
|
-
var node = returnFiber;
|
|
13548
|
-
|
|
13549
|
-
do {
|
|
13550
|
-
if (
|
|
13551
|
-
node.tag === SuspenseComponent &&
|
|
13552
|
-
shouldCaptureSuspense(node, hasInvisibleParentBoundary)
|
|
13553
|
-
) {
|
|
13554
|
-
// Found the nearest boundary.
|
|
13555
|
-
var suspenseBoundary = node; // This marks a Suspense boundary so that when we're unwinding the stack,
|
|
13556
|
-
// it captures the suspended "exception" and does a second (fallback) pass.
|
|
13557
|
-
|
|
13558
|
-
if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
|
|
13559
|
-
// Legacy Mode Suspense
|
|
13560
|
-
//
|
|
13561
|
-
// If the boundary is in legacy mode, we should *not*
|
|
13562
|
-
// suspend the commit. Pretend as if the suspended component rendered
|
|
13563
|
-
// null and keep rendering. When the Suspense boundary completes,
|
|
13564
|
-
// we'll do a second pass to render the fallback.
|
|
13565
|
-
if (suspenseBoundary === returnFiber) {
|
|
13566
|
-
// Special case where we suspended while reconciling the children of
|
|
13567
|
-
// a Suspense boundary's inner Offscreen wrapper fiber. This happens
|
|
13568
|
-
// when a React.lazy component is a direct child of a
|
|
13569
|
-
// Suspense boundary.
|
|
13570
|
-
//
|
|
13571
|
-
// Suspense boundaries are implemented as multiple fibers, but they
|
|
13572
|
-
// are a single conceptual unit. The legacy mode behavior where we
|
|
13573
|
-
// pretend the suspended fiber committed as `null` won't work,
|
|
13574
|
-
// because in this case the "suspended" fiber is the inner
|
|
13575
|
-
// Offscreen wrapper.
|
|
13576
|
-
//
|
|
13577
|
-
// Because the contents of the boundary haven't started rendering
|
|
13578
|
-
// yet (i.e. nothing in the tree has partially rendered) we can
|
|
13579
|
-
// switch to the regular, concurrent mode behavior: mark the
|
|
13580
|
-
// boundary with ShouldCapture and enter the unwind phase.
|
|
13581
|
-
suspenseBoundary.flags |= ShouldCapture;
|
|
13582
|
-
} else {
|
|
13583
|
-
suspenseBoundary.flags |= DidCapture;
|
|
13584
|
-
sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete.
|
|
13585
|
-
// But we shouldn't call any lifecycle methods or callbacks. Remove
|
|
13586
|
-
// all lifecycle effect tags.
|
|
13587
|
-
|
|
13588
|
-
sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
|
|
13589
|
-
|
|
13590
|
-
if (sourceFiber.tag === ClassComponent) {
|
|
13591
|
-
var currentSourceFiber = sourceFiber.alternate;
|
|
13592
|
-
|
|
13593
|
-
if (currentSourceFiber === null) {
|
|
13594
|
-
// This is a new mount. Change the tag so it's not mistaken for a
|
|
13595
|
-
// completed class component. For example, we should not call
|
|
13596
|
-
// componentWillUnmount if it is deleted.
|
|
13597
|
-
sourceFiber.tag = IncompleteClassComponent;
|
|
13598
|
-
} else {
|
|
13599
|
-
// When we try rendering again, we should not reuse the current fiber,
|
|
13600
|
-
// since it's known to be in an inconsistent state. Use a force update to
|
|
13601
|
-
// prevent a bail out.
|
|
13602
|
-
var update = createUpdate(NoTimestamp, SyncLane);
|
|
13603
|
-
update.tag = ForceUpdate;
|
|
13604
|
-
enqueueUpdate(sourceFiber, update);
|
|
13605
|
-
}
|
|
13606
|
-
} // The source fiber did not complete. Mark it with Sync priority to
|
|
13607
|
-
// indicate that it still has pending work.
|
|
13608
|
-
|
|
13609
|
-
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
|
|
13610
|
-
}
|
|
13611
|
-
|
|
13612
|
-
return suspenseBoundary;
|
|
13613
|
-
} // Confirmed that the boundary is in a concurrent mode tree. Continue
|
|
13614
|
-
// with the normal suspend path.
|
|
13615
|
-
//
|
|
13616
|
-
// After this we'll use a set of heuristics to determine whether this
|
|
13617
|
-
// render pass will run to completion or restart or "suspend" the commit.
|
|
13618
|
-
// The actual logic for this is spread out in different places.
|
|
13619
|
-
//
|
|
13620
|
-
// This first principle is that if we're going to suspend when we complete
|
|
13621
|
-
// a root, then we should also restart if we get an update or ping that
|
|
13622
|
-
// might unsuspend it, and vice versa. The only reason to suspend is
|
|
13623
|
-
// because you think you might want to restart before committing. However,
|
|
13624
|
-
// it doesn't make sense to restart only while in the period we're suspended.
|
|
13625
|
-
//
|
|
13626
|
-
// Restarting too aggressively is also not good because it starves out any
|
|
13627
|
-
// intermediate loading state. So we use heuristics to determine when.
|
|
13628
|
-
// Suspense Heuristics
|
|
13629
|
-
//
|
|
13630
|
-
// If nothing threw a Promise or all the same fallbacks are already showing,
|
|
13631
|
-
// then don't suspend/restart.
|
|
13632
|
-
//
|
|
13633
|
-
// If this is an initial render of a new tree of Suspense boundaries and
|
|
13634
|
-
// those trigger a fallback, then don't suspend/restart. We want to ensure
|
|
13635
|
-
// that we can show the initial loading state as quickly as possible.
|
|
13636
|
-
//
|
|
13637
|
-
// If we hit a "Delayed" case, such as when we'd switch from content back into
|
|
13638
|
-
// a fallback, then we should always suspend/restart. Transitions apply
|
|
13639
|
-
// to this case. If none is defined, JND is used instead.
|
|
13640
|
-
//
|
|
13641
|
-
// If we're already showing a fallback and it gets "retried", allowing us to show
|
|
13642
|
-
// another level, but there's still an inner boundary that would show a fallback,
|
|
13643
|
-
// then we suspend/restart for 500ms since the last time we showed a fallback
|
|
13644
|
-
// anywhere in the tree. This effectively throttles progressive loading into a
|
|
13645
|
-
// consistent train of commits. This also gives us an opportunity to restart to
|
|
13646
|
-
// get to the completed state slightly earlier.
|
|
13647
|
-
//
|
|
13648
|
-
// If there's ambiguity due to batching it's resolved in preference of:
|
|
13649
|
-
// 1) "delayed", 2) "initial render", 3) "retry".
|
|
13650
|
-
//
|
|
13651
|
-
// We want to ensure that a "busy" state doesn't get force committed. We want to
|
|
13652
|
-
// ensure that new initial loading states can commit as soon as possible.
|
|
13653
|
-
|
|
13654
|
-
suspenseBoundary.flags |= ShouldCapture; // TODO: I think we can remove this, since we now use `DidCapture` in
|
|
13655
|
-
// the begin phase to prevent an early bailout.
|
|
13897
|
+
function getNearestSuspenseBoundaryToCapture(returnFiber) {
|
|
13898
|
+
var node = returnFiber;
|
|
13656
13899
|
|
|
13657
|
-
|
|
13658
|
-
|
|
13900
|
+
do {
|
|
13901
|
+
if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) {
|
|
13902
|
+
return node;
|
|
13659
13903
|
} // This boundary already captured during this render. Continue to the next
|
|
13660
13904
|
// boundary.
|
|
13661
13905
|
|
|
13662
13906
|
node = node.return;
|
|
13663
|
-
} while (node !== null);
|
|
13907
|
+
} while (node !== null);
|
|
13664
13908
|
|
|
13665
13909
|
return null;
|
|
13666
13910
|
}
|
|
13667
13911
|
|
|
13912
|
+
function markSuspenseBoundaryShouldCapture(
|
|
13913
|
+
suspenseBoundary,
|
|
13914
|
+
returnFiber,
|
|
13915
|
+
sourceFiber,
|
|
13916
|
+
root,
|
|
13917
|
+
rootRenderLanes
|
|
13918
|
+
) {
|
|
13919
|
+
// This marks a Suspense boundary so that when we're unwinding the stack,
|
|
13920
|
+
// it captures the suspended "exception" and does a second (fallback) pass.
|
|
13921
|
+
if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
|
|
13922
|
+
// Legacy Mode Suspense
|
|
13923
|
+
//
|
|
13924
|
+
// If the boundary is in legacy mode, we should *not*
|
|
13925
|
+
// suspend the commit. Pretend as if the suspended component rendered
|
|
13926
|
+
// null and keep rendering. When the Suspense boundary completes,
|
|
13927
|
+
// we'll do a second pass to render the fallback.
|
|
13928
|
+
if (suspenseBoundary === returnFiber) {
|
|
13929
|
+
// Special case where we suspended while reconciling the children of
|
|
13930
|
+
// a Suspense boundary's inner Offscreen wrapper fiber. This happens
|
|
13931
|
+
// when a React.lazy component is a direct child of a
|
|
13932
|
+
// Suspense boundary.
|
|
13933
|
+
//
|
|
13934
|
+
// Suspense boundaries are implemented as multiple fibers, but they
|
|
13935
|
+
// are a single conceptual unit. The legacy mode behavior where we
|
|
13936
|
+
// pretend the suspended fiber committed as `null` won't work,
|
|
13937
|
+
// because in this case the "suspended" fiber is the inner
|
|
13938
|
+
// Offscreen wrapper.
|
|
13939
|
+
//
|
|
13940
|
+
// Because the contents of the boundary haven't started rendering
|
|
13941
|
+
// yet (i.e. nothing in the tree has partially rendered) we can
|
|
13942
|
+
// switch to the regular, concurrent mode behavior: mark the
|
|
13943
|
+
// boundary with ShouldCapture and enter the unwind phase.
|
|
13944
|
+
suspenseBoundary.flags |= ShouldCapture;
|
|
13945
|
+
} else {
|
|
13946
|
+
suspenseBoundary.flags |= DidCapture;
|
|
13947
|
+
sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete.
|
|
13948
|
+
// But we shouldn't call any lifecycle methods or callbacks. Remove
|
|
13949
|
+
// all lifecycle effect tags.
|
|
13950
|
+
|
|
13951
|
+
sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
|
|
13952
|
+
|
|
13953
|
+
if (sourceFiber.tag === ClassComponent) {
|
|
13954
|
+
var currentSourceFiber = sourceFiber.alternate;
|
|
13955
|
+
|
|
13956
|
+
if (currentSourceFiber === null) {
|
|
13957
|
+
// This is a new mount. Change the tag so it's not mistaken for a
|
|
13958
|
+
// completed class component. For example, we should not call
|
|
13959
|
+
// componentWillUnmount if it is deleted.
|
|
13960
|
+
sourceFiber.tag = IncompleteClassComponent;
|
|
13961
|
+
} else {
|
|
13962
|
+
// When we try rendering again, we should not reuse the current fiber,
|
|
13963
|
+
// since it's known to be in an inconsistent state. Use a force update to
|
|
13964
|
+
// prevent a bail out.
|
|
13965
|
+
var update = createUpdate(NoTimestamp, SyncLane);
|
|
13966
|
+
update.tag = ForceUpdate;
|
|
13967
|
+
enqueueUpdate(sourceFiber, update);
|
|
13968
|
+
}
|
|
13969
|
+
} // The source fiber did not complete. Mark it with Sync priority to
|
|
13970
|
+
// indicate that it still has pending work.
|
|
13971
|
+
|
|
13972
|
+
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
|
|
13973
|
+
}
|
|
13974
|
+
|
|
13975
|
+
return suspenseBoundary;
|
|
13976
|
+
} // Confirmed that the boundary is in a concurrent mode tree. Continue
|
|
13977
|
+
// with the normal suspend path.
|
|
13978
|
+
//
|
|
13979
|
+
// After this we'll use a set of heuristics to determine whether this
|
|
13980
|
+
// render pass will run to completion or restart or "suspend" the commit.
|
|
13981
|
+
// The actual logic for this is spread out in different places.
|
|
13982
|
+
//
|
|
13983
|
+
// This first principle is that if we're going to suspend when we complete
|
|
13984
|
+
// a root, then we should also restart if we get an update or ping that
|
|
13985
|
+
// might unsuspend it, and vice versa. The only reason to suspend is
|
|
13986
|
+
// because you think you might want to restart before committing. However,
|
|
13987
|
+
// it doesn't make sense to restart only while in the period we're suspended.
|
|
13988
|
+
//
|
|
13989
|
+
// Restarting too aggressively is also not good because it starves out any
|
|
13990
|
+
// intermediate loading state. So we use heuristics to determine when.
|
|
13991
|
+
// Suspense Heuristics
|
|
13992
|
+
//
|
|
13993
|
+
// If nothing threw a Promise or all the same fallbacks are already showing,
|
|
13994
|
+
// then don't suspend/restart.
|
|
13995
|
+
//
|
|
13996
|
+
// If this is an initial render of a new tree of Suspense boundaries and
|
|
13997
|
+
// those trigger a fallback, then don't suspend/restart. We want to ensure
|
|
13998
|
+
// that we can show the initial loading state as quickly as possible.
|
|
13999
|
+
//
|
|
14000
|
+
// If we hit a "Delayed" case, such as when we'd switch from content back into
|
|
14001
|
+
// a fallback, then we should always suspend/restart. Transitions apply
|
|
14002
|
+
// to this case. If none is defined, JND is used instead.
|
|
14003
|
+
//
|
|
14004
|
+
// If we're already showing a fallback and it gets "retried", allowing us to show
|
|
14005
|
+
// another level, but there's still an inner boundary that would show a fallback,
|
|
14006
|
+
// then we suspend/restart for 500ms since the last time we showed a fallback
|
|
14007
|
+
// anywhere in the tree. This effectively throttles progressive loading into a
|
|
14008
|
+
// consistent train of commits. This also gives us an opportunity to restart to
|
|
14009
|
+
// get to the completed state slightly earlier.
|
|
14010
|
+
//
|
|
14011
|
+
// If there's ambiguity due to batching it's resolved in preference of:
|
|
14012
|
+
// 1) "delayed", 2) "initial render", 3) "retry".
|
|
14013
|
+
//
|
|
14014
|
+
// We want to ensure that a "busy" state doesn't get force committed. We want to
|
|
14015
|
+
// ensure that new initial loading states can commit as soon as possible.
|
|
14016
|
+
|
|
14017
|
+
suspenseBoundary.flags |= ShouldCapture; // TODO: I think we can remove this, since we now use `DidCapture` in
|
|
14018
|
+
// the begin phase to prevent an early bailout.
|
|
14019
|
+
|
|
14020
|
+
suspenseBoundary.lanes = rootRenderLanes;
|
|
14021
|
+
return suspenseBoundary;
|
|
14022
|
+
}
|
|
14023
|
+
|
|
13668
14024
|
function throwException(
|
|
13669
14025
|
root,
|
|
13670
14026
|
returnFiber,
|
|
@@ -13691,14 +14047,17 @@ function throwException(
|
|
|
13691
14047
|
var wakeable = value;
|
|
13692
14048
|
resetSuspendedComponent(sourceFiber);
|
|
13693
14049
|
|
|
13694
|
-
var suspenseBoundary =
|
|
13695
|
-
returnFiber,
|
|
13696
|
-
sourceFiber,
|
|
13697
|
-
root,
|
|
13698
|
-
rootRenderLanes
|
|
13699
|
-
);
|
|
14050
|
+
var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
|
|
13700
14051
|
|
|
13701
14052
|
if (suspenseBoundary !== null) {
|
|
14053
|
+
suspenseBoundary.flags &= ~ForceClientRender;
|
|
14054
|
+
markSuspenseBoundaryShouldCapture(
|
|
14055
|
+
suspenseBoundary,
|
|
14056
|
+
returnFiber,
|
|
14057
|
+
sourceFiber,
|
|
14058
|
+
root,
|
|
14059
|
+
rootRenderLanes
|
|
14060
|
+
);
|
|
13702
14061
|
attachWakeableListeners(
|
|
13703
14062
|
suspenseBoundary,
|
|
13704
14063
|
root,
|
|
@@ -14102,7 +14461,12 @@ function completeSuspendedOffscreenHostContainer(current, workInProgress) {
|
|
|
14102
14461
|
}
|
|
14103
14462
|
|
|
14104
14463
|
function completeWork(current, workInProgress, renderLanes) {
|
|
14105
|
-
var newProps = workInProgress.pendingProps;
|
|
14464
|
+
var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing
|
|
14465
|
+
// to the current tree provider fiber is just as fast and less error-prone.
|
|
14466
|
+
// Ideally we would have a special version of the work loop only
|
|
14467
|
+
// for hydration.
|
|
14468
|
+
|
|
14469
|
+
popTreeContext(workInProgress);
|
|
14106
14470
|
|
|
14107
14471
|
switch (workInProgress.tag) {
|
|
14108
14472
|
case IndeterminateComponent:
|
|
@@ -14154,7 +14518,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
14154
14518
|
// Schedule an effect to clear this container at the start of the next commit.
|
|
14155
14519
|
// This handles the case of React rendering into a container with previous children.
|
|
14156
14520
|
// It's also safe to do for updates too, because current.child would only be null
|
|
14157
|
-
// if the previous render was null (so the
|
|
14521
|
+
// if the previous render was null (so the container would already be empty).
|
|
14158
14522
|
workInProgress.flags |= Snapshot;
|
|
14159
14523
|
}
|
|
14160
14524
|
}
|
|
@@ -14301,7 +14665,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
14301
14665
|
else {
|
|
14302
14666
|
var prevState = current.memoizedState;
|
|
14303
14667
|
prevDidTimeout = prevState !== null;
|
|
14304
|
-
}
|
|
14668
|
+
}
|
|
14305
14669
|
// an effect to toggle the subtree's visibility. When we switch from
|
|
14306
14670
|
// fallback -> primary, the inner Offscreen fiber schedules this effect
|
|
14307
14671
|
// as part of its normal complete phase. But when we switch from
|
|
@@ -14314,8 +14678,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
14314
14678
|
// is active that we have to do anything special.
|
|
14315
14679
|
|
|
14316
14680
|
if (nextDidTimeout && !prevDidTimeout) {
|
|
14317
|
-
var
|
|
14318
|
-
|
|
14681
|
+
var _offscreenFiber = workInProgress.child;
|
|
14682
|
+
_offscreenFiber.flags |= Visibility; // TODO: This will still suspend a synchronous tree if anything
|
|
14319
14683
|
// in the concurrent tree already suspended during this render.
|
|
14320
14684
|
// This is a known bug.
|
|
14321
14685
|
|
|
@@ -14329,7 +14693,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
|
|
14329
14693
|
// should be able to immediately restart from within throwException.
|
|
14330
14694
|
var hasInvisibleChildContext =
|
|
14331
14695
|
current === null &&
|
|
14332
|
-
workInProgress.memoizedProps.unstable_avoidThisFallback !== true
|
|
14696
|
+
(workInProgress.memoizedProps.unstable_avoidThisFallback !== true ||
|
|
14697
|
+
!enableSuspenseAvoidThisFallback);
|
|
14333
14698
|
|
|
14334
14699
|
if (
|
|
14335
14700
|
hasInvisibleChildContext ||
|
|
@@ -14787,8 +15152,13 @@ function updateForwardRef(
|
|
|
14787
15152
|
var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent
|
|
14788
15153
|
|
|
14789
15154
|
var nextChildren;
|
|
15155
|
+
var hasId;
|
|
14790
15156
|
prepareToReadContext(workInProgress, renderLanes);
|
|
14791
15157
|
|
|
15158
|
+
{
|
|
15159
|
+
markComponentRenderStarted(workInProgress);
|
|
15160
|
+
}
|
|
15161
|
+
|
|
14792
15162
|
{
|
|
14793
15163
|
ReactCurrentOwner$1.current = workInProgress;
|
|
14794
15164
|
setIsRendering(true);
|
|
@@ -14800,6 +15170,7 @@ function updateForwardRef(
|
|
|
14800
15170
|
ref,
|
|
14801
15171
|
renderLanes
|
|
14802
15172
|
);
|
|
15173
|
+
hasId = checkDidRenderIdHook();
|
|
14803
15174
|
|
|
14804
15175
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
14805
15176
|
setIsStrictModeForDevtools(true);
|
|
@@ -14813,6 +15184,7 @@ function updateForwardRef(
|
|
|
14813
15184
|
ref,
|
|
14814
15185
|
renderLanes
|
|
14815
15186
|
);
|
|
15187
|
+
hasId = checkDidRenderIdHook();
|
|
14816
15188
|
} finally {
|
|
14817
15189
|
setIsStrictModeForDevtools(false);
|
|
14818
15190
|
}
|
|
@@ -14821,10 +15193,14 @@ function updateForwardRef(
|
|
|
14821
15193
|
setIsRendering(false);
|
|
14822
15194
|
}
|
|
14823
15195
|
|
|
15196
|
+
{
|
|
15197
|
+
markComponentRenderStopped();
|
|
15198
|
+
}
|
|
15199
|
+
|
|
14824
15200
|
if (current !== null && !didReceiveUpdate) {
|
|
14825
15201
|
bailoutHooks(current, workInProgress, renderLanes);
|
|
14826
15202
|
return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
|
|
14827
|
-
}
|
|
15203
|
+
}
|
|
14828
15204
|
|
|
14829
15205
|
workInProgress.flags |= PerformedWork;
|
|
14830
15206
|
reconcileChildren(current, workInProgress, nextChildren, renderLanes);
|
|
@@ -15247,8 +15623,13 @@ function updateFunctionComponent(
|
|
|
15247
15623
|
}
|
|
15248
15624
|
|
|
15249
15625
|
var nextChildren;
|
|
15626
|
+
var hasId;
|
|
15250
15627
|
prepareToReadContext(workInProgress, renderLanes);
|
|
15251
15628
|
|
|
15629
|
+
{
|
|
15630
|
+
markComponentRenderStarted(workInProgress);
|
|
15631
|
+
}
|
|
15632
|
+
|
|
15252
15633
|
{
|
|
15253
15634
|
ReactCurrentOwner$1.current = workInProgress;
|
|
15254
15635
|
setIsRendering(true);
|
|
@@ -15260,6 +15641,7 @@ function updateFunctionComponent(
|
|
|
15260
15641
|
context,
|
|
15261
15642
|
renderLanes
|
|
15262
15643
|
);
|
|
15644
|
+
hasId = checkDidRenderIdHook();
|
|
15263
15645
|
|
|
15264
15646
|
if (workInProgress.mode & StrictLegacyMode) {
|
|
15265
15647
|
setIsStrictModeForDevtools(true);
|
|
@@ -15273,6 +15655,7 @@ function updateFunctionComponent(
|
|
|
15273
15655
|
context,
|
|
15274
15656
|
renderLanes
|
|
15275
15657
|
);
|
|
15658
|
+
hasId = checkDidRenderIdHook();
|
|
15276
15659
|
} finally {
|
|
15277
15660
|
setIsStrictModeForDevtools(false);
|
|
15278
15661
|
}
|
|
@@ -15281,10 +15664,14 @@ function updateFunctionComponent(
|
|
|
15281
15664
|
setIsRendering(false);
|
|
15282
15665
|
}
|
|
15283
15666
|
|
|
15667
|
+
{
|
|
15668
|
+
markComponentRenderStopped();
|
|
15669
|
+
}
|
|
15670
|
+
|
|
15284
15671
|
if (current !== null && !didReceiveUpdate) {
|
|
15285
15672
|
bailoutHooks(current, workInProgress, renderLanes);
|
|
15286
15673
|
return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
|
|
15287
|
-
}
|
|
15674
|
+
}
|
|
15288
15675
|
|
|
15289
15676
|
workInProgress.flags |= PerformedWork;
|
|
15290
15677
|
reconcileChildren(current, workInProgress, nextChildren, renderLanes);
|
|
@@ -15468,6 +15855,10 @@ function finishClassComponent(
|
|
|
15468
15855
|
stopProfilerTimerIfRunning();
|
|
15469
15856
|
}
|
|
15470
15857
|
} else {
|
|
15858
|
+
{
|
|
15859
|
+
markComponentRenderStarted(workInProgress);
|
|
15860
|
+
}
|
|
15861
|
+
|
|
15471
15862
|
{
|
|
15472
15863
|
setIsRendering(true);
|
|
15473
15864
|
nextChildren = instance.render();
|
|
@@ -15484,6 +15875,10 @@ function finishClassComponent(
|
|
|
15484
15875
|
|
|
15485
15876
|
setIsRendering(false);
|
|
15486
15877
|
}
|
|
15878
|
+
|
|
15879
|
+
{
|
|
15880
|
+
markComponentRenderStopped();
|
|
15881
|
+
}
|
|
15487
15882
|
} // React DevTools reads this flag.
|
|
15488
15883
|
|
|
15489
15884
|
workInProgress.flags |= PerformedWork;
|
|
@@ -15813,6 +16208,11 @@ function mountIndeterminateComponent(
|
|
|
15813
16208
|
|
|
15814
16209
|
prepareToReadContext(workInProgress, renderLanes);
|
|
15815
16210
|
var value;
|
|
16211
|
+
var hasId;
|
|
16212
|
+
|
|
16213
|
+
{
|
|
16214
|
+
markComponentRenderStarted(workInProgress);
|
|
16215
|
+
}
|
|
15816
16216
|
|
|
15817
16217
|
{
|
|
15818
16218
|
if (
|
|
@@ -15847,9 +16247,14 @@ function mountIndeterminateComponent(
|
|
|
15847
16247
|
context,
|
|
15848
16248
|
renderLanes
|
|
15849
16249
|
);
|
|
16250
|
+
hasId = checkDidRenderIdHook();
|
|
15850
16251
|
setIsRendering(false);
|
|
15851
16252
|
}
|
|
15852
16253
|
|
|
16254
|
+
{
|
|
16255
|
+
markComponentRenderStopped();
|
|
16256
|
+
} // React DevTools reads this flag.
|
|
16257
|
+
|
|
15853
16258
|
workInProgress.flags |= PerformedWork;
|
|
15854
16259
|
|
|
15855
16260
|
{
|
|
@@ -15953,6 +16358,7 @@ function mountIndeterminateComponent(
|
|
|
15953
16358
|
context,
|
|
15954
16359
|
renderLanes
|
|
15955
16360
|
);
|
|
16361
|
+
hasId = checkDidRenderIdHook();
|
|
15956
16362
|
} finally {
|
|
15957
16363
|
setIsStrictModeForDevtools(false);
|
|
15958
16364
|
}
|
|
@@ -16040,6 +16446,7 @@ function validateFunctionComponentInDev(workInProgress, Component) {
|
|
|
16040
16446
|
|
|
16041
16447
|
var SUSPENDED_MARKER = {
|
|
16042
16448
|
dehydrated: null,
|
|
16449
|
+
treeContext: null,
|
|
16043
16450
|
retryLane: NoLane
|
|
16044
16451
|
};
|
|
16045
16452
|
|
|
@@ -16113,7 +16520,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) {
|
|
|
16113
16520
|
// Mark this subtree context as having at least one invisible parent that could
|
|
16114
16521
|
// handle the fallback state.
|
|
16115
16522
|
// Avoided boundaries are not considered since they cannot handle preferred fallback states.
|
|
16116
|
-
|
|
16523
|
+
{
|
|
16117
16524
|
suspenseContext = addSubtreeSuspenseContext(
|
|
16118
16525
|
suspenseContext,
|
|
16119
16526
|
InvisibleParentSuspenseContext
|
|
@@ -17064,6 +17471,10 @@ function updateContextConsumer(current, workInProgress, renderLanes) {
|
|
|
17064
17471
|
prepareToReadContext(workInProgress, renderLanes);
|
|
17065
17472
|
var newValue = readContext(context);
|
|
17066
17473
|
|
|
17474
|
+
{
|
|
17475
|
+
markComponentRenderStarted(workInProgress);
|
|
17476
|
+
}
|
|
17477
|
+
|
|
17067
17478
|
var newChildren;
|
|
17068
17479
|
|
|
17069
17480
|
{
|
|
@@ -17073,6 +17484,10 @@ function updateContextConsumer(current, workInProgress, renderLanes) {
|
|
|
17073
17484
|
setIsRendering(false);
|
|
17074
17485
|
}
|
|
17075
17486
|
|
|
17487
|
+
{
|
|
17488
|
+
markComponentRenderStopped();
|
|
17489
|
+
} // React DevTools reads this flag.
|
|
17490
|
+
|
|
17076
17491
|
workInProgress.flags |= PerformedWork;
|
|
17077
17492
|
reconcileChildren(current, workInProgress, newChildren, renderLanes);
|
|
17078
17493
|
return workInProgress.child;
|
|
@@ -17620,6 +18035,12 @@ function beginWork(current, workInProgress, renderLanes) {
|
|
|
17620
18035
|
}
|
|
17621
18036
|
|
|
17622
18037
|
function unwindWork(workInProgress, renderLanes) {
|
|
18038
|
+
// Note: This intentionally doesn't check if we're hydrating because comparing
|
|
18039
|
+
// to the current tree provider fiber is just as fast and less error-prone.
|
|
18040
|
+
// Ideally we would have a special version of the work loop only
|
|
18041
|
+
// for hydration.
|
|
18042
|
+
popTreeContext(workInProgress);
|
|
18043
|
+
|
|
17623
18044
|
switch (workInProgress.tag) {
|
|
17624
18045
|
case ClassComponent: {
|
|
17625
18046
|
var Component = workInProgress.type;
|
|
@@ -17715,6 +18136,12 @@ function unwindWork(workInProgress, renderLanes) {
|
|
|
17715
18136
|
}
|
|
17716
18137
|
|
|
17717
18138
|
function unwindInterruptedWork(interruptedWork, renderLanes) {
|
|
18139
|
+
// Note: This intentionally doesn't check if we're hydrating because comparing
|
|
18140
|
+
// to the current tree provider fiber is just as fast and less error-prone.
|
|
18141
|
+
// Ideally we would have a special version of the work loop only
|
|
18142
|
+
// for hydration.
|
|
18143
|
+
popTreeContext(interruptedWork);
|
|
18144
|
+
|
|
17718
18145
|
switch (interruptedWork.tag) {
|
|
17719
18146
|
case ClassComponent: {
|
|
17720
18147
|
var childContextTypes = interruptedWork.type.childContextTypes;
|
|
@@ -18039,7 +18466,23 @@ function commitHookEffectListUnmount(
|
|
|
18039
18466
|
effect.destroy = undefined;
|
|
18040
18467
|
|
|
18041
18468
|
if (destroy !== undefined) {
|
|
18469
|
+
{
|
|
18470
|
+
if ((flags & Passive$1) !== NoFlags$1) {
|
|
18471
|
+
markComponentPassiveEffectUnmountStarted(finishedWork);
|
|
18472
|
+
} else if ((flags & Layout) !== NoFlags$1) {
|
|
18473
|
+
markComponentLayoutEffectUnmountStarted(finishedWork);
|
|
18474
|
+
}
|
|
18475
|
+
}
|
|
18476
|
+
|
|
18042
18477
|
safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy);
|
|
18478
|
+
|
|
18479
|
+
{
|
|
18480
|
+
if ((flags & Passive$1) !== NoFlags$1) {
|
|
18481
|
+
markComponentPassiveEffectUnmountStopped();
|
|
18482
|
+
} else if ((flags & Layout) !== NoFlags$1) {
|
|
18483
|
+
markComponentLayoutEffectUnmountStopped();
|
|
18484
|
+
}
|
|
18485
|
+
}
|
|
18043
18486
|
}
|
|
18044
18487
|
}
|
|
18045
18488
|
|
|
@@ -18048,7 +18491,7 @@ function commitHookEffectListUnmount(
|
|
|
18048
18491
|
}
|
|
18049
18492
|
}
|
|
18050
18493
|
|
|
18051
|
-
function commitHookEffectListMount(
|
|
18494
|
+
function commitHookEffectListMount(flags, finishedWork) {
|
|
18052
18495
|
var updateQueue = finishedWork.updateQueue;
|
|
18053
18496
|
var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
|
|
18054
18497
|
|
|
@@ -18057,11 +18500,26 @@ function commitHookEffectListMount(tag, finishedWork) {
|
|
|
18057
18500
|
var effect = firstEffect;
|
|
18058
18501
|
|
|
18059
18502
|
do {
|
|
18060
|
-
if ((effect.tag &
|
|
18061
|
-
|
|
18503
|
+
if ((effect.tag & flags) === flags) {
|
|
18504
|
+
{
|
|
18505
|
+
if ((flags & Passive$1) !== NoFlags$1) {
|
|
18506
|
+
markComponentPassiveEffectMountStarted(finishedWork);
|
|
18507
|
+
} else if ((flags & Layout) !== NoFlags$1) {
|
|
18508
|
+
markComponentLayoutEffectMountStarted(finishedWork);
|
|
18509
|
+
}
|
|
18510
|
+
} // Mount
|
|
18511
|
+
|
|
18062
18512
|
var create = effect.create;
|
|
18063
18513
|
effect.destroy = create();
|
|
18064
18514
|
|
|
18515
|
+
{
|
|
18516
|
+
if ((flags & Passive$1) !== NoFlags$1) {
|
|
18517
|
+
markComponentPassiveEffectMountStopped();
|
|
18518
|
+
} else if ((flags & Layout) !== NoFlags$1) {
|
|
18519
|
+
markComponentLayoutEffectMountStopped();
|
|
18520
|
+
}
|
|
18521
|
+
}
|
|
18522
|
+
|
|
18065
18523
|
{
|
|
18066
18524
|
var destroy = effect.destroy;
|
|
18067
18525
|
|
|
@@ -18655,10 +19113,13 @@ function commitUnmount(finishedRoot, current, nearestMountedAncestor) {
|
|
|
18655
19113
|
tag = _effect.tag;
|
|
18656
19114
|
|
|
18657
19115
|
if (destroy !== undefined) {
|
|
18658
|
-
if (
|
|
18659
|
-
(
|
|
18660
|
-
|
|
18661
|
-
|
|
19116
|
+
if ((tag & Insertion) !== NoFlags$1) {
|
|
19117
|
+
safelyCallDestroy(current, nearestMountedAncestor, destroy);
|
|
19118
|
+
} else if ((tag & Layout) !== NoFlags$1) {
|
|
19119
|
+
{
|
|
19120
|
+
markComponentLayoutEffectUnmountStarted(current);
|
|
19121
|
+
}
|
|
19122
|
+
|
|
18662
19123
|
if (current.mode & ProfileMode) {
|
|
18663
19124
|
startLayoutEffectTimer();
|
|
18664
19125
|
safelyCallDestroy(current, nearestMountedAncestor, destroy);
|
|
@@ -18666,6 +19127,10 @@ function commitUnmount(finishedRoot, current, nearestMountedAncestor) {
|
|
|
18666
19127
|
} else {
|
|
18667
19128
|
safelyCallDestroy(current, nearestMountedAncestor, destroy);
|
|
18668
19129
|
}
|
|
19130
|
+
|
|
19131
|
+
{
|
|
19132
|
+
markComponentLayoutEffectUnmountStopped();
|
|
19133
|
+
}
|
|
18669
19134
|
}
|
|
18670
19135
|
}
|
|
18671
19136
|
|
|
@@ -19927,11 +20392,46 @@ if (typeof Symbol === "function" && Symbol.for) {
|
|
|
19927
20392
|
TEXT_TYPE = symbolFor$1("selector.text");
|
|
19928
20393
|
}
|
|
19929
20394
|
|
|
20395
|
+
var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
|
|
20396
|
+
function isLegacyActEnvironment(fiber) {
|
|
20397
|
+
{
|
|
20398
|
+
// Legacy mode. We preserve the behavior of React 17's act. It assumes an
|
|
20399
|
+
// act environment whenever `jest` is defined, but you can still turn off
|
|
20400
|
+
// spurious warnings by setting IS_REACT_ACT_ENVIRONMENT explicitly
|
|
20401
|
+
// to false.
|
|
20402
|
+
var isReactActEnvironmentGlobal = // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
|
|
20403
|
+
typeof IS_REACT_ACT_ENVIRONMENT !== "undefined"
|
|
20404
|
+
? IS_REACT_ACT_ENVIRONMENT
|
|
20405
|
+
: undefined; // $FlowExpectedError - Flow doesn't know about jest
|
|
20406
|
+
|
|
20407
|
+
var jestIsDefined = typeof jest !== "undefined";
|
|
20408
|
+
return jestIsDefined && isReactActEnvironmentGlobal !== false;
|
|
20409
|
+
}
|
|
20410
|
+
}
|
|
20411
|
+
function isConcurrentActEnvironment() {
|
|
20412
|
+
{
|
|
20413
|
+
var isReactActEnvironmentGlobal = // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
|
|
20414
|
+
typeof IS_REACT_ACT_ENVIRONMENT !== "undefined"
|
|
20415
|
+
? IS_REACT_ACT_ENVIRONMENT
|
|
20416
|
+
: undefined;
|
|
20417
|
+
|
|
20418
|
+
if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
|
|
20419
|
+
// TODO: Include link to relevant documentation page.
|
|
20420
|
+
error(
|
|
20421
|
+
"The current testing environment is not configured to support " +
|
|
20422
|
+
"act(...)"
|
|
20423
|
+
);
|
|
20424
|
+
}
|
|
20425
|
+
|
|
20426
|
+
return isReactActEnvironmentGlobal;
|
|
20427
|
+
}
|
|
20428
|
+
}
|
|
20429
|
+
|
|
19930
20430
|
var ceil = Math.ceil;
|
|
19931
20431
|
var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher,
|
|
19932
20432
|
ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,
|
|
19933
20433
|
ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig,
|
|
19934
|
-
ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
|
|
20434
|
+
ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue;
|
|
19935
20435
|
var NoContext =
|
|
19936
20436
|
/* */
|
|
19937
20437
|
0;
|
|
@@ -19984,7 +20484,9 @@ var workInProgressRootIncludedLanes = NoLanes; // The work left over by componen
|
|
|
19984
20484
|
|
|
19985
20485
|
var workInProgressRootSkippedLanes = NoLanes; // Lanes that were updated (in an interleaved event) during this render.
|
|
19986
20486
|
|
|
19987
|
-
var
|
|
20487
|
+
var workInProgressRootInterleavedUpdatedLanes = NoLanes; // Lanes that were updated during the render phase (*not* an interleaved event).
|
|
20488
|
+
|
|
20489
|
+
var workInProgressRootRenderPhaseUpdatedLanes = NoLanes; // Lanes that were pinged (in an interleaved event) during this render.
|
|
19988
20490
|
|
|
19989
20491
|
var workInProgressRootPingedLanes = NoLanes; // The most recent time we committed a fallback. This lets us ensure a train
|
|
19990
20492
|
// model where we don't commit new loading states in too quick succession.
|
|
@@ -20011,7 +20513,7 @@ var legacyErrorBoundariesThatAlreadyFailed = null; // Only used when enableProfi
|
|
|
20011
20513
|
var rootDoesHavePassiveEffects = false;
|
|
20012
20514
|
var rootWithPendingPassiveEffects = null;
|
|
20013
20515
|
var pendingPassiveEffectsLanes = NoLanes;
|
|
20014
|
-
var pendingPassiveProfilerEffects = [];
|
|
20516
|
+
var pendingPassiveProfilerEffects = [];
|
|
20015
20517
|
|
|
20016
20518
|
var NESTED_UPDATE_LIMIT = 50;
|
|
20017
20519
|
var nestedUpdateCount = 0;
|
|
@@ -20116,60 +20618,80 @@ function requestRetryLane(fiber) {
|
|
|
20116
20618
|
|
|
20117
20619
|
function scheduleUpdateOnFiber(fiber, lane, eventTime) {
|
|
20118
20620
|
checkForNestedUpdates();
|
|
20119
|
-
warnAboutRenderPhaseUpdatesInDEV(fiber);
|
|
20120
20621
|
var root = markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
20121
20622
|
|
|
20122
20623
|
if (root === null) {
|
|
20123
20624
|
return null;
|
|
20124
|
-
}
|
|
20125
|
-
|
|
20126
|
-
{
|
|
20127
|
-
if (isDevToolsPresent) {
|
|
20128
|
-
addFiberToLanesMap(root, fiber, lane);
|
|
20129
|
-
}
|
|
20130
20625
|
} // Mark that the root has a pending update.
|
|
20131
20626
|
|
|
20132
20627
|
markRootUpdated(root, lane, eventTime);
|
|
20133
20628
|
|
|
20134
|
-
if (
|
|
20135
|
-
|
|
20136
|
-
|
|
20137
|
-
|
|
20138
|
-
//
|
|
20139
|
-
//
|
|
20140
|
-
|
|
20141
|
-
|
|
20142
|
-
|
|
20143
|
-
|
|
20144
|
-
|
|
20629
|
+
if (
|
|
20630
|
+
(executionContext & RenderContext) !== NoLanes &&
|
|
20631
|
+
root === workInProgressRoot
|
|
20632
|
+
) {
|
|
20633
|
+
// This update was dispatched during the render phase. This is a mistake
|
|
20634
|
+
// if the update originates from user space (with the exception of local
|
|
20635
|
+
// hook updates, which are handled differently and don't reach this
|
|
20636
|
+
// function), but there are some internal React features that use this as
|
|
20637
|
+
// an implementation detail, like selective hydration.
|
|
20638
|
+
warnAboutRenderPhaseUpdatesInDEV(fiber); // Track lanes that were updated during the render phase
|
|
20639
|
+
|
|
20640
|
+
workInProgressRootRenderPhaseUpdatedLanes = mergeLanes(
|
|
20641
|
+
workInProgressRootRenderPhaseUpdatedLanes,
|
|
20642
|
+
lane
|
|
20643
|
+
);
|
|
20644
|
+
} else {
|
|
20645
|
+
// This is a normal update, scheduled from outside the render phase. For
|
|
20646
|
+
// example, during an input event.
|
|
20647
|
+
{
|
|
20648
|
+
if (isDevToolsPresent) {
|
|
20649
|
+
addFiberToLanesMap(root, fiber, lane);
|
|
20650
|
+
}
|
|
20145
20651
|
}
|
|
20146
20652
|
|
|
20147
|
-
|
|
20148
|
-
|
|
20149
|
-
|
|
20150
|
-
//
|
|
20151
|
-
//
|
|
20152
|
-
//
|
|
20153
|
-
//
|
|
20154
|
-
|
|
20653
|
+
warnIfUpdatesNotWrappedWithActDEV(fiber);
|
|
20654
|
+
|
|
20655
|
+
if (root === workInProgressRoot) {
|
|
20656
|
+
// Received an update to a tree that's in the middle of rendering. Mark
|
|
20657
|
+
// that there was an interleaved update work on this root. Unless the
|
|
20658
|
+
// `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render
|
|
20659
|
+
// phase update. In that case, we don't treat render phase updates as if
|
|
20660
|
+
// they were interleaved, for backwards compat reasons.
|
|
20661
|
+
if ((executionContext & RenderContext) === NoContext) {
|
|
20662
|
+
workInProgressRootInterleavedUpdatedLanes = mergeLanes(
|
|
20663
|
+
workInProgressRootInterleavedUpdatedLanes,
|
|
20664
|
+
lane
|
|
20665
|
+
);
|
|
20666
|
+
}
|
|
20667
|
+
|
|
20668
|
+
if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
|
|
20669
|
+
// The root already suspended with a delay, which means this render
|
|
20670
|
+
// definitely won't finish. Since we have a new update, let's mark it as
|
|
20671
|
+
// suspended now, right before marking the incoming update. This has the
|
|
20672
|
+
// effect of interrupting the current render and switching to the update.
|
|
20673
|
+
// TODO: Make sure this doesn't override pings that happen while we've
|
|
20674
|
+
// already started rendering.
|
|
20675
|
+
markRootSuspended$1(root, workInProgressRootRenderLanes);
|
|
20676
|
+
}
|
|
20155
20677
|
}
|
|
20156
|
-
}
|
|
20157
20678
|
|
|
20158
|
-
|
|
20679
|
+
ensureRootIsScheduled(root, eventTime);
|
|
20159
20680
|
|
|
20160
|
-
|
|
20161
|
-
|
|
20162
|
-
|
|
20163
|
-
|
|
20164
|
-
|
|
20165
|
-
|
|
20166
|
-
|
|
20167
|
-
|
|
20168
|
-
|
|
20169
|
-
|
|
20170
|
-
|
|
20171
|
-
|
|
20172
|
-
|
|
20681
|
+
if (
|
|
20682
|
+
lane === SyncLane &&
|
|
20683
|
+
executionContext === NoContext &&
|
|
20684
|
+
(fiber.mode & ConcurrentMode) === NoMode && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
|
|
20685
|
+
!ReactCurrentActQueue$1.isBatchingLegacy
|
|
20686
|
+
) {
|
|
20687
|
+
// Flush the synchronous work now, unless we're already working or inside
|
|
20688
|
+
// a batch. This is intentionally inside scheduleUpdateOnFiber instead of
|
|
20689
|
+
// scheduleCallbackForFiber to preserve the ability to schedule a callback
|
|
20690
|
+
// without immediately flushing it. We only do this for user-initiated
|
|
20691
|
+
// updates, to preserve historical behavior of legacy mode.
|
|
20692
|
+
resetRenderTimer();
|
|
20693
|
+
flushSyncCallbacksOnlyInLegacyMode();
|
|
20694
|
+
}
|
|
20173
20695
|
}
|
|
20174
20696
|
|
|
20175
20697
|
return root;
|
|
@@ -20274,7 +20796,7 @@ function ensureRootIsScheduled(root, currentTime) {
|
|
|
20274
20796
|
// Scheduler task, rather than an `act` task, cancel it and re-scheduled
|
|
20275
20797
|
// on the `act` queue.
|
|
20276
20798
|
!(
|
|
20277
|
-
ReactCurrentActQueue.current !== null &&
|
|
20799
|
+
ReactCurrentActQueue$1.current !== null &&
|
|
20278
20800
|
existingCallbackNode !== fakeActCallbackNode
|
|
20279
20801
|
)
|
|
20280
20802
|
) {
|
|
@@ -20306,8 +20828,8 @@ function ensureRootIsScheduled(root, currentTime) {
|
|
|
20306
20828
|
// Special case: Sync React callbacks are scheduled on a special
|
|
20307
20829
|
// internal queue
|
|
20308
20830
|
if (root.tag === LegacyRoot) {
|
|
20309
|
-
if (ReactCurrentActQueue.isBatchingLegacy !== null) {
|
|
20310
|
-
ReactCurrentActQueue.didScheduleLegacyUpdate = true;
|
|
20831
|
+
if (ReactCurrentActQueue$1.isBatchingLegacy !== null) {
|
|
20832
|
+
ReactCurrentActQueue$1.didScheduleLegacyUpdate = true;
|
|
20311
20833
|
}
|
|
20312
20834
|
|
|
20313
20835
|
scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root));
|
|
@@ -20493,11 +21015,28 @@ function recoverFromConcurrentError(root, errorRetryLanes) {
|
|
|
20493
21015
|
{
|
|
20494
21016
|
errorHydratingContainer(root.containerInfo);
|
|
20495
21017
|
}
|
|
21018
|
+
}
|
|
21019
|
+
|
|
21020
|
+
var exitStatus;
|
|
21021
|
+
var MAX_ERROR_RETRY_ATTEMPTS = 50;
|
|
21022
|
+
|
|
21023
|
+
for (var i = 0; i < MAX_ERROR_RETRY_ATTEMPTS; i++) {
|
|
21024
|
+
exitStatus = renderRootSync(root, errorRetryLanes);
|
|
21025
|
+
|
|
21026
|
+
if (
|
|
21027
|
+
exitStatus === RootErrored &&
|
|
21028
|
+
workInProgressRootRenderPhaseUpdatedLanes !== NoLanes
|
|
21029
|
+
) {
|
|
21030
|
+
// There was a render phase update during this render. Some internal React
|
|
21031
|
+
// implementation details may use this as a trick to schedule another
|
|
21032
|
+
// render pass. To protect against an inifinite loop, eventually
|
|
21033
|
+
// we'll give up.
|
|
21034
|
+
continue;
|
|
21035
|
+
}
|
|
20496
21036
|
|
|
20497
|
-
|
|
21037
|
+
break;
|
|
20498
21038
|
}
|
|
20499
21039
|
|
|
20500
|
-
var exitStatus = renderRootSync(root, errorRetryLanes);
|
|
20501
21040
|
executionContext = prevExecutionContext;
|
|
20502
21041
|
return exitStatus;
|
|
20503
21042
|
}
|
|
@@ -20618,7 +21157,7 @@ function finishConcurrentRender(root, exitStatus, lanes) {
|
|
|
20618
21157
|
|
|
20619
21158
|
function isRenderConsistentWithExternalStores(finishedWork) {
|
|
20620
21159
|
// Search the rendered tree for external store reads, and check whether the
|
|
20621
|
-
// stores were mutated in a concurrent event. Intentionally using
|
|
21160
|
+
// stores were mutated in a concurrent event. Intentionally using an iterative
|
|
20622
21161
|
// loop instead of recursion so we can exit early.
|
|
20623
21162
|
var node = finishedWork;
|
|
20624
21163
|
|
|
@@ -20684,7 +21223,10 @@ function markRootSuspended$1(root, suspendedLanes) {
|
|
|
20684
21223
|
// TODO: Lol maybe there's a better way to factor this besides this
|
|
20685
21224
|
// obnoxiously named function :)
|
|
20686
21225
|
suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
|
|
20687
|
-
suspendedLanes = removeLanes(
|
|
21226
|
+
suspendedLanes = removeLanes(
|
|
21227
|
+
suspendedLanes,
|
|
21228
|
+
workInProgressRootInterleavedUpdatedLanes
|
|
21229
|
+
);
|
|
20688
21230
|
markRootSuspended(root, suspendedLanes);
|
|
20689
21231
|
} // This is the entry point for synchronous tasks that don't go
|
|
20690
21232
|
// through Scheduler
|
|
@@ -20710,31 +21252,16 @@ function performSyncWorkOnRoot(root) {
|
|
|
20710
21252
|
var exitStatus = renderRootSync(root, lanes);
|
|
20711
21253
|
|
|
20712
21254
|
if (root.tag !== LegacyRoot && exitStatus === RootErrored) {
|
|
20713
|
-
|
|
20714
|
-
executionContext |= RetryAfterError; // If an error occurred during hydration,
|
|
20715
|
-
// discard server response and fall back to client side render.
|
|
20716
|
-
|
|
20717
|
-
if (root.isDehydrated) {
|
|
20718
|
-
root.isDehydrated = false;
|
|
20719
|
-
|
|
20720
|
-
{
|
|
20721
|
-
errorHydratingContainer(root.containerInfo);
|
|
20722
|
-
}
|
|
20723
|
-
|
|
20724
|
-
clearContainer(root.containerInfo);
|
|
20725
|
-
} // If something threw an error, try rendering one more time. We'll render
|
|
21255
|
+
// If something threw an error, try rendering one more time. We'll render
|
|
20726
21256
|
// synchronously to block concurrent data mutations, and we'll includes
|
|
20727
21257
|
// all pending updates are included. If it still fails after the second
|
|
20728
21258
|
// attempt, we'll give up and commit the resulting tree.
|
|
20729
|
-
|
|
20730
21259
|
var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root);
|
|
20731
21260
|
|
|
20732
21261
|
if (errorRetryLanes !== NoLanes) {
|
|
20733
21262
|
lanes = errorRetryLanes;
|
|
20734
|
-
exitStatus =
|
|
21263
|
+
exitStatus = recoverFromConcurrentError(root, errorRetryLanes);
|
|
20735
21264
|
}
|
|
20736
|
-
|
|
20737
|
-
executionContext = prevExecutionContext;
|
|
20738
21265
|
}
|
|
20739
21266
|
|
|
20740
21267
|
if (exitStatus === RootFatalErrored) {
|
|
@@ -20767,7 +21294,7 @@ function batchedUpdates$1(fn, a) {
|
|
|
20767
21294
|
|
|
20768
21295
|
if (
|
|
20769
21296
|
executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
|
|
20770
|
-
!ReactCurrentActQueue.isBatchingLegacy
|
|
21297
|
+
!ReactCurrentActQueue$1.isBatchingLegacy
|
|
20771
21298
|
) {
|
|
20772
21299
|
resetRenderTimer();
|
|
20773
21300
|
flushSyncCallbacksOnlyInLegacyMode();
|
|
@@ -20855,7 +21382,8 @@ function prepareFreshStack(root, lanes) {
|
|
|
20855
21382
|
workInProgressRootExitStatus = RootIncomplete;
|
|
20856
21383
|
workInProgressRootFatalError = null;
|
|
20857
21384
|
workInProgressRootSkippedLanes = NoLanes;
|
|
20858
|
-
|
|
21385
|
+
workInProgressRootInterleavedUpdatedLanes = NoLanes;
|
|
21386
|
+
workInProgressRootRenderPhaseUpdatedLanes = NoLanes;
|
|
20859
21387
|
workInProgressRootPingedLanes = NoLanes;
|
|
20860
21388
|
enqueueInterleavedUpdates();
|
|
20861
21389
|
|
|
@@ -20997,7 +21525,7 @@ function renderDidSuspendDelayIfPossible() {
|
|
|
20997
21525
|
if (
|
|
20998
21526
|
workInProgressRoot !== null &&
|
|
20999
21527
|
(includesNonIdleWork(workInProgressRootSkippedLanes) ||
|
|
21000
|
-
includesNonIdleWork(
|
|
21528
|
+
includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))
|
|
21001
21529
|
) {
|
|
21002
21530
|
// Mark the current render as suspended so that we switch to working on
|
|
21003
21531
|
// the updates that were skipped. Usually we only suspend at the end of
|
|
@@ -21048,6 +21576,10 @@ function renderRootSync(root, lanes) {
|
|
|
21048
21576
|
prepareFreshStack(root, lanes);
|
|
21049
21577
|
}
|
|
21050
21578
|
|
|
21579
|
+
{
|
|
21580
|
+
markRenderStarted(lanes);
|
|
21581
|
+
}
|
|
21582
|
+
|
|
21051
21583
|
do {
|
|
21052
21584
|
try {
|
|
21053
21585
|
workLoopSync();
|
|
@@ -21069,6 +21601,10 @@ function renderRootSync(root, lanes) {
|
|
|
21069
21601
|
);
|
|
21070
21602
|
}
|
|
21071
21603
|
|
|
21604
|
+
{
|
|
21605
|
+
markRenderStopped();
|
|
21606
|
+
} // Set this to null to indicate there's no in-progress render.
|
|
21607
|
+
|
|
21072
21608
|
workInProgressRoot = null;
|
|
21073
21609
|
workInProgressRootRenderLanes = NoLanes;
|
|
21074
21610
|
return workInProgressRootExitStatus;
|
|
@@ -21110,6 +21646,10 @@ function renderRootConcurrent(root, lanes) {
|
|
|
21110
21646
|
prepareFreshStack(root, lanes);
|
|
21111
21647
|
}
|
|
21112
21648
|
|
|
21649
|
+
{
|
|
21650
|
+
markRenderStarted(lanes);
|
|
21651
|
+
}
|
|
21652
|
+
|
|
21113
21653
|
do {
|
|
21114
21654
|
try {
|
|
21115
21655
|
workLoopConcurrent();
|
|
@@ -21124,8 +21664,18 @@ function renderRootConcurrent(root, lanes) {
|
|
|
21124
21664
|
executionContext = prevExecutionContext;
|
|
21125
21665
|
|
|
21126
21666
|
if (workInProgress !== null) {
|
|
21667
|
+
// Still work remaining.
|
|
21668
|
+
{
|
|
21669
|
+
markRenderYielded();
|
|
21670
|
+
}
|
|
21671
|
+
|
|
21127
21672
|
return RootIncomplete;
|
|
21128
21673
|
} else {
|
|
21674
|
+
// Completed the tree.
|
|
21675
|
+
{
|
|
21676
|
+
markRenderStopped();
|
|
21677
|
+
} // Set this to null to indicate there's no in-progress render.
|
|
21678
|
+
|
|
21129
21679
|
workInProgressRoot = null;
|
|
21130
21680
|
workInProgressRootRenderLanes = NoLanes; // Return the final exit status.
|
|
21131
21681
|
|
|
@@ -21297,7 +21847,15 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
21297
21847
|
var finishedWork = root.finishedWork;
|
|
21298
21848
|
var lanes = root.finishedLanes;
|
|
21299
21849
|
|
|
21850
|
+
{
|
|
21851
|
+
markCommitStarted(lanes);
|
|
21852
|
+
}
|
|
21853
|
+
|
|
21300
21854
|
if (finishedWork === null) {
|
|
21855
|
+
{
|
|
21856
|
+
markCommitStopped();
|
|
21857
|
+
}
|
|
21858
|
+
|
|
21301
21859
|
return null;
|
|
21302
21860
|
} else {
|
|
21303
21861
|
{
|
|
@@ -21346,7 +21904,10 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
21346
21904
|
if (!rootDoesHavePassiveEffects) {
|
|
21347
21905
|
rootDoesHavePassiveEffects = true;
|
|
21348
21906
|
scheduleCallback$1(NormalPriority, function() {
|
|
21349
|
-
flushPassiveEffects();
|
|
21907
|
+
flushPassiveEffects(); // This render triggered passive effects: release the root cache pool
|
|
21908
|
+
// *after* passive effects fire to avoid freeing a cache pool that may
|
|
21909
|
+
// be referenced by a node in the tree (HostRoot, Cache boundary etc)
|
|
21910
|
+
|
|
21350
21911
|
return null;
|
|
21351
21912
|
});
|
|
21352
21913
|
}
|
|
@@ -21400,7 +21961,15 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
21400
21961
|
|
|
21401
21962
|
root.current = finishedWork; // The next phase is the layout phase, where we call effects that read
|
|
21402
21963
|
|
|
21964
|
+
{
|
|
21965
|
+
markLayoutEffectsStarted(lanes);
|
|
21966
|
+
}
|
|
21967
|
+
|
|
21403
21968
|
commitLayoutEffects(finishedWork, root, lanes);
|
|
21969
|
+
|
|
21970
|
+
{
|
|
21971
|
+
markLayoutEffectsStopped();
|
|
21972
|
+
}
|
|
21404
21973
|
// opportunity to paint.
|
|
21405
21974
|
|
|
21406
21975
|
requestPaint();
|
|
@@ -21504,6 +22073,10 @@ function commitRootImpl(root, renderPriorityLevel) {
|
|
|
21504
22073
|
|
|
21505
22074
|
flushSyncCallbacks();
|
|
21506
22075
|
|
|
22076
|
+
{
|
|
22077
|
+
markCommitStopped();
|
|
22078
|
+
}
|
|
22079
|
+
|
|
21507
22080
|
return null;
|
|
21508
22081
|
}
|
|
21509
22082
|
|
|
@@ -21526,7 +22099,7 @@ function flushPassiveEffects() {
|
|
|
21526
22099
|
return flushPassiveEffectsImpl();
|
|
21527
22100
|
} finally {
|
|
21528
22101
|
setCurrentUpdatePriority(previousPriority);
|
|
21529
|
-
ReactCurrentBatchConfig$2.transition = prevTransition;
|
|
22102
|
+
ReactCurrentBatchConfig$2.transition = prevTransition; // Once passive effects have run for the tree - giving components a
|
|
21530
22103
|
}
|
|
21531
22104
|
}
|
|
21532
22105
|
|
|
@@ -21552,6 +22125,7 @@ function flushPassiveEffectsImpl() {
|
|
|
21552
22125
|
}
|
|
21553
22126
|
|
|
21554
22127
|
var root = rootWithPendingPassiveEffects;
|
|
22128
|
+
var lanes = pendingPassiveEffectsLanes;
|
|
21555
22129
|
rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects.
|
|
21556
22130
|
// Figure out why and fix it. It's not causing any known issues (probably
|
|
21557
22131
|
// because it's only used for profiling), but it's a refactor hazard.
|
|
@@ -21562,6 +22136,10 @@ function flushPassiveEffectsImpl() {
|
|
|
21562
22136
|
throw new Error("Cannot flush passive effects while already rendering.");
|
|
21563
22137
|
}
|
|
21564
22138
|
|
|
22139
|
+
{
|
|
22140
|
+
markPassiveEffectsStarted(lanes);
|
|
22141
|
+
}
|
|
22142
|
+
|
|
21565
22143
|
var prevExecutionContext = executionContext;
|
|
21566
22144
|
executionContext |= CommitContext;
|
|
21567
22145
|
commitPassiveUnmountEffects(root.current);
|
|
@@ -21577,6 +22155,10 @@ function flushPassiveEffectsImpl() {
|
|
|
21577
22155
|
}
|
|
21578
22156
|
}
|
|
21579
22157
|
|
|
22158
|
+
{
|
|
22159
|
+
markPassiveEffectsStopped();
|
|
22160
|
+
}
|
|
22161
|
+
|
|
21580
22162
|
{
|
|
21581
22163
|
commitDoubleInvokeEffectsInDEV(root.current, true);
|
|
21582
22164
|
}
|
|
@@ -21707,6 +22289,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) {
|
|
|
21707
22289
|
|
|
21708
22290
|
var eventTime = requestEventTime();
|
|
21709
22291
|
markRootPinged(root, pingedLanes);
|
|
22292
|
+
warnIfSuspenseResolutionNotWrappedWithActDEV(root);
|
|
21710
22293
|
|
|
21711
22294
|
if (
|
|
21712
22295
|
workInProgressRoot === root &&
|
|
@@ -22032,11 +22615,7 @@ var didWarnAboutUpdateInRenderForAnotherComponent;
|
|
|
22032
22615
|
|
|
22033
22616
|
function warnAboutRenderPhaseUpdatesInDEV(fiber) {
|
|
22034
22617
|
{
|
|
22035
|
-
if (
|
|
22036
|
-
isRendering &&
|
|
22037
|
-
(executionContext & RenderContext) !== NoContext &&
|
|
22038
|
-
!getIsUpdatingOpaqueValueInRenderPhaseInDEV()
|
|
22039
|
-
) {
|
|
22618
|
+
if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
|
|
22040
22619
|
switch (fiber.tag) {
|
|
22041
22620
|
case FunctionComponent:
|
|
22042
22621
|
case ForwardRef:
|
|
@@ -22101,7 +22680,7 @@ function scheduleCallback$1(priorityLevel, callback) {
|
|
|
22101
22680
|
{
|
|
22102
22681
|
// If we're currently inside an `act` scope, bypass Scheduler and push to
|
|
22103
22682
|
// the `act` queue instead.
|
|
22104
|
-
var actQueue = ReactCurrentActQueue.current;
|
|
22683
|
+
var actQueue = ReactCurrentActQueue$1.current;
|
|
22105
22684
|
|
|
22106
22685
|
if (actQueue !== null) {
|
|
22107
22686
|
actQueue.push(callback);
|
|
@@ -22122,48 +22701,41 @@ function cancelCallback$1(callbackNode) {
|
|
|
22122
22701
|
|
|
22123
22702
|
function shouldForceFlushFallbacksInDEV() {
|
|
22124
22703
|
// Never force flush in production. This function should get stripped out.
|
|
22125
|
-
return ReactCurrentActQueue.current !== null;
|
|
22704
|
+
return ReactCurrentActQueue$1.current !== null;
|
|
22126
22705
|
}
|
|
22127
22706
|
|
|
22128
|
-
function
|
|
22707
|
+
function warnIfUpdatesNotWrappedWithActDEV(fiber) {
|
|
22129
22708
|
{
|
|
22130
|
-
if (
|
|
22131
|
-
(
|
|
22132
|
-
|
|
22133
|
-
|
|
22134
|
-
|
|
22135
|
-
|
|
22136
|
-
//
|
|
22137
|
-
|
|
22138
|
-
|
|
22139
|
-
|
|
22140
|
-
|
|
22141
|
-
|
|
22142
|
-
|
|
22143
|
-
|
|
22144
|
-
|
|
22145
|
-
|
|
22146
|
-
|
|
22147
|
-
|
|
22148
|
-
|
|
22149
|
-
|
|
22150
|
-
|
|
22151
|
-
|
|
22709
|
+
if (fiber.mode & ConcurrentMode) {
|
|
22710
|
+
if (!isConcurrentActEnvironment()) {
|
|
22711
|
+
// Not in an act environment. No need to warn.
|
|
22712
|
+
return;
|
|
22713
|
+
}
|
|
22714
|
+
} else {
|
|
22715
|
+
// Legacy mode has additional cases where we suppress a warning.
|
|
22716
|
+
if (!isLegacyActEnvironment()) {
|
|
22717
|
+
// Not in an act environment. No need to warn.
|
|
22718
|
+
return;
|
|
22719
|
+
}
|
|
22720
|
+
|
|
22721
|
+
if (executionContext !== NoContext) {
|
|
22722
|
+
// Legacy mode doesn't warn if the update is batched, i.e.
|
|
22723
|
+
// batchedUpdates or flushSync.
|
|
22724
|
+
return;
|
|
22725
|
+
}
|
|
22726
|
+
|
|
22727
|
+
if (
|
|
22728
|
+
fiber.tag !== FunctionComponent &&
|
|
22729
|
+
fiber.tag !== ForwardRef &&
|
|
22730
|
+
fiber.tag !== SimpleMemoComponent
|
|
22731
|
+
) {
|
|
22732
|
+
// For backwards compatibility with pre-hooks code, legacy mode only
|
|
22733
|
+
// warns for updates that originate from a hook.
|
|
22734
|
+
return;
|
|
22735
|
+
}
|
|
22152
22736
|
}
|
|
22153
|
-
}
|
|
22154
|
-
}
|
|
22155
22737
|
|
|
22156
|
-
|
|
22157
|
-
{
|
|
22158
|
-
if (
|
|
22159
|
-
executionContext === NoContext &&
|
|
22160
|
-
ReactCurrentActQueue.current === null && // Our internal tests use a custom implementation of `act` that works by
|
|
22161
|
-
// mocking the Scheduler package. Disable the `act` warning.
|
|
22162
|
-
// TODO: Maybe the warning should be disabled by default, and then turned
|
|
22163
|
-
// on at the testing frameworks layer? Instead of what we do now, which
|
|
22164
|
-
// is check if a `jest` global is defined.
|
|
22165
|
-
ReactCurrentActQueue.disableActWarning === false
|
|
22166
|
-
) {
|
|
22738
|
+
if (ReactCurrentActQueue$1.current === null) {
|
|
22167
22739
|
var previousFiber = current;
|
|
22168
22740
|
|
|
22169
22741
|
try {
|
|
@@ -22193,7 +22765,29 @@ function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
|
|
|
22193
22765
|
}
|
|
22194
22766
|
}
|
|
22195
22767
|
|
|
22196
|
-
|
|
22768
|
+
function warnIfSuspenseResolutionNotWrappedWithActDEV(root) {
|
|
22769
|
+
{
|
|
22770
|
+
if (
|
|
22771
|
+
root.tag !== LegacyRoot &&
|
|
22772
|
+
isConcurrentActEnvironment() &&
|
|
22773
|
+
ReactCurrentActQueue$1.current === null
|
|
22774
|
+
) {
|
|
22775
|
+
error(
|
|
22776
|
+
"A suspended resource finished loading inside a test, but the event " +
|
|
22777
|
+
"was not wrapped in act(...).\n\n" +
|
|
22778
|
+
"When testing, code that resolves suspended data should be wrapped " +
|
|
22779
|
+
"into act(...):\n\n" +
|
|
22780
|
+
"act(() => {\n" +
|
|
22781
|
+
" /* finish loading suspended data */\n" +
|
|
22782
|
+
"});\n" +
|
|
22783
|
+
"/* assert on the output */\n\n" +
|
|
22784
|
+
"This ensures that you're testing the behavior the user would see " +
|
|
22785
|
+
"in the browser." +
|
|
22786
|
+
" Learn more at https://reactjs.org/link/wrap-tests-with-act"
|
|
22787
|
+
);
|
|
22788
|
+
}
|
|
22789
|
+
}
|
|
22790
|
+
}
|
|
22197
22791
|
|
|
22198
22792
|
/* eslint-disable react-internal/prod-error-codes */
|
|
22199
22793
|
var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.
|
|
@@ -23261,7 +23855,7 @@ function assignFiberPropertiesInDEV(target, source) {
|
|
|
23261
23855
|
return target;
|
|
23262
23856
|
}
|
|
23263
23857
|
|
|
23264
|
-
function FiberRootNode(containerInfo, tag, hydrate) {
|
|
23858
|
+
function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix) {
|
|
23265
23859
|
this.tag = tag;
|
|
23266
23860
|
this.containerInfo = containerInfo;
|
|
23267
23861
|
this.pendingChildren = null;
|
|
@@ -23284,6 +23878,7 @@ function FiberRootNode(containerInfo, tag, hydrate) {
|
|
|
23284
23878
|
this.finishedLanes = NoLanes;
|
|
23285
23879
|
this.entangledLanes = NoLanes;
|
|
23286
23880
|
this.entanglements = createLaneMap(NoLanes);
|
|
23881
|
+
this.identifierPrefix = identifierPrefix;
|
|
23287
23882
|
|
|
23288
23883
|
{
|
|
23289
23884
|
this.effectDuration = 0;
|
|
@@ -23318,9 +23913,10 @@ function createFiberRoot(
|
|
|
23318
23913
|
hydrate,
|
|
23319
23914
|
hydrationCallbacks,
|
|
23320
23915
|
isStrictMode,
|
|
23321
|
-
concurrentUpdatesByDefaultOverride
|
|
23916
|
+
concurrentUpdatesByDefaultOverride,
|
|
23917
|
+
identifierPrefix
|
|
23322
23918
|
) {
|
|
23323
|
-
var root = new FiberRootNode(containerInfo, tag, hydrate);
|
|
23919
|
+
var root = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix);
|
|
23324
23920
|
// stateNode is any.
|
|
23325
23921
|
|
|
23326
23922
|
var uninitializedFiber = createHostRootFiber(
|
|
@@ -23342,6 +23938,8 @@ function createFiberRoot(
|
|
|
23342
23938
|
return root;
|
|
23343
23939
|
}
|
|
23344
23940
|
|
|
23941
|
+
var ReactVersion = "18.0.0-rc.0-51947a14b-20220113";
|
|
23942
|
+
|
|
23345
23943
|
function createPortal(
|
|
23346
23944
|
children,
|
|
23347
23945
|
containerInfo, // TODO: figure out the API for cross-renderer implementation.
|
|
@@ -23467,7 +24065,8 @@ function createContainer(
|
|
|
23467
24065
|
hydrate,
|
|
23468
24066
|
hydrationCallbacks,
|
|
23469
24067
|
isStrictMode,
|
|
23470
|
-
concurrentUpdatesByDefaultOverride
|
|
24068
|
+
concurrentUpdatesByDefaultOverride,
|
|
24069
|
+
identifierPrefix
|
|
23471
24070
|
) {
|
|
23472
24071
|
return createFiberRoot(
|
|
23473
24072
|
containerInfo,
|
|
@@ -23475,7 +24074,8 @@ function createContainer(
|
|
|
23475
24074
|
hydrate,
|
|
23476
24075
|
hydrationCallbacks,
|
|
23477
24076
|
isStrictMode,
|
|
23478
|
-
concurrentUpdatesByDefaultOverride
|
|
24077
|
+
concurrentUpdatesByDefaultOverride,
|
|
24078
|
+
identifierPrefix
|
|
23479
24079
|
);
|
|
23480
24080
|
}
|
|
23481
24081
|
function updateContainer(element, container, parentComponent, callback) {
|
|
@@ -23487,6 +24087,10 @@ function updateContainer(element, container, parentComponent, callback) {
|
|
|
23487
24087
|
var eventTime = requestEventTime();
|
|
23488
24088
|
var lane = requestUpdateLane(current$1);
|
|
23489
24089
|
|
|
24090
|
+
{
|
|
24091
|
+
markRenderScheduled(lane);
|
|
24092
|
+
}
|
|
24093
|
+
|
|
23490
24094
|
var context = getContextForSubtree(parentComponent);
|
|
23491
24095
|
|
|
23492
24096
|
if (container.context === null) {
|
|
@@ -24250,7 +24854,15 @@ function render(element, containerTag, callback) {
|
|
|
24250
24854
|
if (!root) {
|
|
24251
24855
|
// TODO (bvaughn): If we decide to keep the wrapper component,
|
|
24252
24856
|
// We could create a wrapper for containerTag as well to reduce special casing.
|
|
24253
|
-
root = createContainer(
|
|
24857
|
+
root = createContainer(
|
|
24858
|
+
containerTag,
|
|
24859
|
+
LegacyRoot,
|
|
24860
|
+
false,
|
|
24861
|
+
null,
|
|
24862
|
+
false,
|
|
24863
|
+
null,
|
|
24864
|
+
""
|
|
24865
|
+
);
|
|
24254
24866
|
roots.set(containerTag, root);
|
|
24255
24867
|
}
|
|
24256
24868
|
|
|
@@ -24323,5 +24935,14 @@ exports.unmountComponentAtNode = unmountComponentAtNode;
|
|
|
24323
24935
|
exports.unmountComponentAtNodeAndRemoveContainer = unmountComponentAtNodeAndRemoveContainer;
|
|
24324
24936
|
exports.unstable_batchedUpdates = batchedUpdates;
|
|
24325
24937
|
|
|
24938
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
24939
|
+
if (
|
|
24940
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
24941
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
24942
|
+
'function'
|
|
24943
|
+
) {
|
|
24944
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
24945
|
+
}
|
|
24946
|
+
|
|
24326
24947
|
})();
|
|
24327
24948
|
}
|