mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
## Overview This PR ships the View Transition APIs to `react@canary`: - [`<ViewTransition />`](https://react.dev/reference/react/ViewTransition) - [`addTransitionType`](https://react.dev/reference/react/addTransitionType) This means these APIs are ready for final feedback and prepare for semver stable release. ## What this means Shipping `<ViewTransition />` and `addTransitionType` 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 `<ViewTransition />` 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 `<ViewTransition />`. 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 `<ViewTransition>` 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#view-transitions) blog post, and [the new docs for `<ViewTransition />`](https://react.dev/reference/react/ViewTransition) and [`addTransitionType`](https://react.dev/reference/react/addTransitionType) for more info.
75 lines
1.7 KiB
JavaScript
75 lines
1.7 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
|
|
*/
|
|
|
|
// Keep in sync with https://github.com/facebook/flow/blob/main/lib/react.js
|
|
export type ElementType = React$ElementType;
|
|
export type Element<+C> = React$Element<C>;
|
|
export type MixedElement = React$Element<ElementType>;
|
|
export type Key = React$Key;
|
|
export type Node = React$Node;
|
|
export type Context<T> = React$Context<T>;
|
|
export type Portal = React$Portal;
|
|
export type RefSetter<-I> = React$RefSetter<I>;
|
|
export type ElementProps<C> = React$ElementProps<C>;
|
|
export type ElementConfig<C> = React$ElementConfig<C>;
|
|
export type ElementRef<C> = React$ElementRef<C>;
|
|
export type ChildrenArray<+T> = $ReadOnlyArray<ChildrenArray<T>> | T;
|
|
|
|
export {
|
|
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
__COMPILER_RUNTIME,
|
|
Children,
|
|
Component,
|
|
Fragment,
|
|
Profiler,
|
|
PureComponent,
|
|
StrictMode,
|
|
Suspense,
|
|
cloneElement,
|
|
createContext,
|
|
createElement,
|
|
createRef,
|
|
use,
|
|
forwardRef,
|
|
isValidElement,
|
|
lazy,
|
|
memo,
|
|
cache,
|
|
cacheSignal,
|
|
startTransition,
|
|
unstable_LegacyHidden,
|
|
Activity,
|
|
unstable_Scope,
|
|
unstable_SuspenseList,
|
|
unstable_TracingMarker,
|
|
ViewTransition,
|
|
addTransitionType,
|
|
unstable_getCacheForType,
|
|
unstable_useCacheRefresh,
|
|
useId,
|
|
useCallback,
|
|
useContext,
|
|
useDebugValue,
|
|
useDeferredValue,
|
|
useEffect,
|
|
useEffectEvent,
|
|
useImperativeHandle,
|
|
useInsertionEffect,
|
|
useLayoutEffect,
|
|
useMemo,
|
|
useOptimistic,
|
|
useSyncExternalStore,
|
|
useReducer,
|
|
useRef,
|
|
useState,
|
|
useTransition,
|
|
useActionState,
|
|
version,
|
|
} from './src/ReactClient';
|