mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
## Overview This PR adds the `ref` prop to `<Fragment>` in `react@canary`. This means this API is ready for final feedback and prepared for a semver stable release. ## What this means Shipping Fragment refs to canary means they have gone through extensive testing in production, we are confident in the stability of the APIs, and we are preparing to release it in a future semver stable version. Libraries and frameworks following the [Canary Workflow](https://react.dev/blog/2023/05/03/react-canaries) should begin implementing and testing these features. ## Why we follow the Canary Workflow To prepare for semver stable, libraries should test canary features like Fragment refs with `react@canary` to confirm compatibility and prepare for the next semver release in a myriad of environments and configurations used throughout the React ecosystem. This provides libraries with ample time to catch any issues we missed before slamming them with problems in the wider semver release. Since these features have already gone through extensive production testing, and we are confident they are stable, frameworks following the [Canary Workflow](https://react.dev/blog/2023/05/03/react-canaries) can also begin adopting canary features like Fragment refs. This adoption is similar to how different Browsers implement new proposed browser features before they are added to the standard. If a frameworks adopts a canary feature, they are committing to stability for their users by ensuring any API changes before a semver stable release are opaque and non-breaking to their users. Apps not using a framework are also free to adopt canary features like Fragment refs as long as they follow the [Canary Workflow](https://react.dev/blog/2023/05/03/react-canaries), but we generally recommend waiting for a semver stable release unless you have the capacity to commit to following along with the canary changes and debugging library compatibility issues. Waiting for semver stable means you're able to benefit from libraries testing and confirming support, and use semver as signal for which version of a library you can use with support of the feature. ## Docs Check out the ["React Labs: View Transitions, Activity, and more"](https://react.dev/blog/2025/04/23/react-labs-view-transitions-activity-and-more#fragment-refs) blog post, and [the new docs for Fragment refs`](https://react.dev/reference/react/Fragment#fragmentinstance) for more info.
86 lines
4.0 KiB
JavaScript
86 lines
4.0 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
|
|
import typeof * as ExportsType from './ReactFeatureFlags.native-oss';
|
|
|
|
// TODO: Align these flags with canary and delete this file once RN ships from Canary.
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// All flags
|
|
// -----------------------------------------------------------------------------
|
|
export const alwaysThrottleRetries: boolean = false;
|
|
export const disableClientCache: boolean = true;
|
|
export const disableCommentsAsDOMContainers: boolean = true;
|
|
export const disableInputAttributeSyncing: boolean = false;
|
|
export const disableLegacyContext: boolean = true;
|
|
export const disableLegacyContextForFunctionComponents: boolean = true;
|
|
export const disableLegacyMode: boolean = false;
|
|
export const disableSchedulerTimeoutInWorkLoop: boolean = false;
|
|
export const disableTextareaChildren: boolean = false;
|
|
export const enableAsyncDebugInfo: boolean = false;
|
|
export const enableAsyncIterableChildren: boolean = false;
|
|
export const enableCPUSuspense: boolean = false;
|
|
export const enableCreateEventHandleAPI: boolean = false;
|
|
export const enableMoveBefore: boolean = true;
|
|
export const enableFizzExternalRuntime: boolean = true;
|
|
export const enableHalt: boolean = true;
|
|
export const enableHiddenSubtreeInsertionEffectCleanup: boolean = false;
|
|
export const enableInfiniteRenderLoopDetection: boolean = false;
|
|
export const enableLegacyCache: boolean = false;
|
|
export const enableLegacyFBSupport: boolean = false;
|
|
export const enableLegacyHidden: boolean = false;
|
|
export const enableNoCloningMemoCache: boolean = false;
|
|
export const enableObjectFiber: boolean = false;
|
|
export const enablePostpone: boolean = false;
|
|
export const enableReactTestRendererWarning: boolean = false;
|
|
export const enableRetryLaneExpiration: boolean = false;
|
|
export const enableComponentPerformanceTrack: boolean = true;
|
|
export const enableSchedulingProfiler: boolean =
|
|
!enableComponentPerformanceTrack && __PROFILE__;
|
|
export const enableScopeAPI: boolean = false;
|
|
export const enableEagerAlternateStateNodeCleanup: boolean = true;
|
|
export const enableSuspenseAvoidThisFallback: boolean = false;
|
|
export const enableSuspenseCallback: boolean = false;
|
|
export const enableTaint: boolean = true;
|
|
export const enableTransitionTracing: boolean = false;
|
|
export const enableTrustedTypesIntegration: boolean = false;
|
|
export const enableUseEffectEventHook: boolean = true;
|
|
export const passChildrenWhenCloningPersistedNodes: boolean = false;
|
|
export const renameElementSymbol: boolean = true;
|
|
export const retryLaneExpirationMs = 5000;
|
|
export const syncLaneExpirationMs = 250;
|
|
export const transitionLaneExpirationMs = 5000;
|
|
export const enableHydrationLaneScheduling: boolean = true;
|
|
|
|
export const enableYieldingBeforePassive: boolean = false;
|
|
|
|
export const enableThrottledScheduling: boolean = false;
|
|
export const enableViewTransition: boolean = true;
|
|
export const enableGestureTransition: boolean = false;
|
|
export const enableScrollEndPolyfill: boolean = true;
|
|
export const enableSuspenseyImages: boolean = false;
|
|
export const enableFizzBlockingRender: boolean = true;
|
|
export const enableSrcObject: boolean = false;
|
|
export const enableHydrationChangeEvent: boolean = false;
|
|
export const enableDefaultTransitionIndicator: boolean = false;
|
|
export const ownerStackLimit = 1e4;
|
|
|
|
export const enableFragmentRefs: boolean = true;
|
|
export const enableFragmentRefsScrollIntoView: boolean = false;
|
|
|
|
// Profiling Only
|
|
export const enableProfilerTimer: boolean = __PROFILE__;
|
|
export const enableProfilerCommitHooks: boolean = __PROFILE__;
|
|
export const enableProfilerNestedUpdatePhase: boolean = __PROFILE__;
|
|
export const enableUpdaterTracking: boolean = __PROFILE__;
|
|
|
|
// Flow magic to verify the exports of this file match the original version.
|
|
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
|