Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fixtures/view-transition/src/components/Page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {
unstable_addTransitionType as addTransitionType,
unstable_ViewTransition as ViewTransition,
unstable_Activity as Activity,
Activity,
useLayoutEffect,
useEffect,
useState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe('Store component filters', () => {
});

it('should filter Activity', async () => {
const Activity = React.unstable_Activity;
const Activity = React.Activity || React.unstable_Activity;

if (Activity != null) {
await actAsync(async () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('FragmentRefs', () => {
jest.resetModules();
React = require('react');
Fragment = React.Fragment;
Activity = React.unstable_Activity;
Activity = React.Activity;
ReactDOMClient = require('react-dom/client');
ReactDOM = require('react-dom');
createPortal = ReactDOM.createPortal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('ReactDOMServerPartialHydration', () => {
act = require('internal-test-utils').act;
ReactDOMServer = require('react-dom/server');
Scheduler = require('scheduler');
Activity = React.unstable_Activity;
Activity = React.Activity;
Suspense = React.Suspense;
useSyncExternalStore = React.useSyncExternalStore;
if (gate(flags => flags.enableSuspenseList)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('ReactDOMServerPartialHydrationActivity', () => {
act = require('internal-test-utils').act;
ReactDOMServer = require('react-dom/server');
Scheduler = require('scheduler');
Activity = React.unstable_Activity;
Activity = React.Activity;
Suspense = React.Suspense;
useSyncExternalStore = React.useSyncExternalStore;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe('ReactDOMServerSelectiveHydrationActivity', () => {
ReactDOMServer = require('react-dom/server');
act = require('internal-test-utils').act;
Scheduler = require('scheduler');
Activity = React.unstable_Activity;
Activity = React.Activity;

const InternalTestUtils = require('internal-test-utils');
assertLog = InternalTestUtils.assertLog;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-reconciler/src/__tests__/Activity-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Activity', () => {
Scheduler = require('scheduler');
act = require('internal-test-utils').act;
LegacyHidden = React.unstable_LegacyHidden;
Activity = React.unstable_Activity;
Activity = React.Activity;
useState = React.useState;
useInsertionEffect = React.useInsertionEffect;
useLayoutEffect = React.useLayoutEffect;
Expand Down Expand Up @@ -280,7 +280,7 @@ describe('Activity', () => {

// @gate enableActivity
it('nested offscreen does not call componentWillUnmount when hidden', async () => {
// This is a bug that appeared during production test of <unstable_Activity />.
// This is a bug that appeared during production test of <Activity />.
// It is a very specific scenario with nested Offscreens. The inner offscreen
// goes from visible to hidden in synchronous update.
class ClassComponent extends React.Component {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Activity Suspense', () => {
Scheduler = require('scheduler');
act = require('internal-test-utils').act;
LegacyHidden = React.unstable_LegacyHidden;
Activity = React.unstable_Activity;
Activity = React.Activity;
Suspense = React.Suspense;
useState = React.useState;
useEffect = React.useEffect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Activity StrictMode', () => {
log = [];

React = require('react');
Activity = React.unstable_Activity;
Activity = React.Activity;
ReactNoop = require('react-noop-renderer');
act = require('internal-test-utils').act;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Activity Suspense', () => {
Scheduler = require('scheduler');
act = require('internal-test-utils').act;
LegacyHidden = React.unstable_LegacyHidden;
Activity = React.unstable_Activity;
Activity = React.Activity;
Suspense = React.Suspense;
useState = React.useState;
useEffect = React.useEffect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('ReactDeferredValue', () => {
useMemo = React.useMemo;
useState = React.useState;
Suspense = React.Suspense;
Activity = React.unstable_Activity;
Activity = React.Activity;

const InternalTestUtils = require('internal-test-utils');
assertLog = InternalTestUtils.assertLog;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('ReactFragment', () => {

React = require('react');
Suspense = React.Suspense;
Activity = React.unstable_Activity;
Activity = React.Activity;
ViewTransition = React.unstable_ViewTransition;
ReactNoop = require('react-noop-renderer');
const InternalTestUtils = require('internal-test-utils');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('ReactHooksWithNoopRenderer', () => {
useTransition = React.useTransition;
useDeferredValue = React.useDeferredValue;
Suspense = React.Suspense;
Activity = React.unstable_Activity;
Activity = React.Activity;
ContinuousEventPriority =
require('react-reconciler/constants').ContinuousEventPriority;
if (gate(flags => flags.enableSuspenseList)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ describe('ReactLazy', () => {

// @gate enableActivity
it('throws with a useful error when wrapping Activity with lazy()', async () => {
const BadLazy = lazy(() => fakeImport(React.unstable_Activity));
const BadLazy = lazy(() => fakeImport(React.Activity));

const root = ReactTestRenderer.create(
<Suspense fallback={<Text text="Loading..." />}>
Expand All @@ -981,7 +981,7 @@ describe('ReactLazy', () => {

await waitForAll(['Loading...']);

await resolveFakeImport(React.unstable_Activity);
await resolveFakeImport(React.Activity);
root.update(
<Suspense fallback={<Text text="Loading..." />}>
<BadLazy />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('ReactSiblingPrerendering', () => {
waitForAll = require('internal-test-utils').waitForAll;
startTransition = React.startTransition;
Suspense = React.Suspense;
Activity = React.unstable_Activity;
Activity = React.Activity;

textCache = new Map();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('ReactSuspenseyCommitPhase', () => {
if (gate(flags => flags.enableSuspenseList)) {
SuspenseList = React.unstable_SuspenseList;
}
Activity = React.unstable_Activity;
Activity = React.Activity;
useMemo = React.useMemo;
startTransition = React.startTransition;
resolveSuspenseyThing = ReactNoop.resolveSuspenseyThing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('ReactInteractionTracing', () => {
useState = React.useState;
startTransition = React.startTransition;
Suspense = React.Suspense;
Activity = React.unstable_Activity;
Activity = React.Activity;

getCacheForType = React.unstable_getCacheForType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ describe('ReactFreshIntegration', () => {
// @gate __DEV__ && enableActivity
it('ignores ref for class component in hidden subtree', async () => {
const code = `
import {unstable_Activity as Activity} from 'react';
import {Activity} from 'react';

// Avoid creating a new class on Fast Refresh.
global.A = global.A ?? class A extends React.Component {
Expand Down Expand Up @@ -338,7 +338,7 @@ describe('ReactFreshIntegration', () => {
// @gate __DEV__ && enableActivity
it('ignores ref for hoistable resource in hidden subtree', async () => {
const code = `
import {unstable_Activity as Activity} from 'react';
import {Activity} from 'react';

function hiddenRef() {
throw new Error('Unexpected hiddenRef() invocation.');
Expand All @@ -360,7 +360,7 @@ describe('ReactFreshIntegration', () => {
// @gate __DEV__ && enableActivity
it('ignores ref for host component in hidden subtree', async () => {
const code = `
import {unstable_Activity as Activity} from 'react';
import {Activity} from 'react';

function hiddenRef() {
throw new Error('Unexpected hiddenRef() invocation.');
Expand All @@ -382,7 +382,7 @@ describe('ReactFreshIntegration', () => {
// @gate __DEV__ && enableActivity
it('ignores ref for Activity in hidden subtree', async () => {
const code = `
import {unstable_Activity as Activity} from 'react';
import {Activity} from 'react';

function hiddenRef(value) {
throw new Error('Unexpected hiddenRef() invocation.');
Expand All @@ -407,7 +407,7 @@ describe('ReactFreshIntegration', () => {
it('ignores ref for Scope in hidden subtree', async () => {
const code = `
import {
unstable_Activity as Activity,
Activity,
unstable_Scope as Scope,
} from 'react';

Expand All @@ -433,7 +433,7 @@ describe('ReactFreshIntegration', () => {
// @gate __DEV__ && enableActivity
it('ignores ref for functional component in hidden subtree', async () => {
const code = `
import {unstable_Activity as Activity} from 'react';
import {Activity} from 'react';

// Avoid creating a new component on Fast Refresh.
global.A = global.A ?? function A() {
Expand Down Expand Up @@ -463,7 +463,7 @@ describe('ReactFreshIntegration', () => {
const code = `
import {
forwardRef,
unstable_Activity as Activity,
Activity,
} from 'react';

// Avoid creating a new component on Fast Refresh.
Expand Down Expand Up @@ -494,7 +494,7 @@ describe('ReactFreshIntegration', () => {
const code = `
import {
memo,
unstable_Activity as Activity,
Activity,
} from 'react';

// Avoid creating a new component on Fast Refresh.
Expand Down Expand Up @@ -526,7 +526,7 @@ describe('ReactFreshIntegration', () => {
const code = `
import {
memo,
unstable_Activity as Activity,
Activity,
} from 'react';

// Avoid creating a new component on Fast Refresh.
Expand Down
2 changes: 1 addition & 1 deletion packages/react/index.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export {
cacheSignal,
startTransition,
unstable_LegacyHidden,
unstable_Activity,
Activity,
unstable_Scope,
unstable_SuspenseList,
unstable_TracingMarker,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/index.experimental.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export {
cache,
cacheSignal,
startTransition,
unstable_Activity,
Activity,
unstable_postpone,
unstable_getCacheForType,
unstable_SuspenseList,
Expand Down
3 changes: 2 additions & 1 deletion packages/react/index.experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export {
cache,
cacheSignal,
startTransition,
unstable_Activity,
Activity,
Activity as unstable_Activity,
unstable_postpone,
unstable_getCacheForType,
unstable_SuspenseList,
Expand Down
3 changes: 2 additions & 1 deletion packages/react/index.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export {
startTransition,
StrictMode,
Suspense,
unstable_Activity,
Activity,
Activity as unstable_Activity,
unstable_getCacheForType,
unstable_LegacyHidden,
unstable_Scope,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export {
cacheSignal,
startTransition,
unstable_LegacyHidden,
unstable_Activity,
Activity,
unstable_Scope,
unstable_SuspenseList,
unstable_TracingMarker,
Expand Down
1 change: 1 addition & 0 deletions packages/react/index.stable.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
export {
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
__COMPILER_RUNTIME,
Activity,
Children,
Component,
Fragment,
Expand Down
1 change: 1 addition & 0 deletions packages/react/index.stable.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
export {
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
__COMPILER_RUNTIME,
Activity,
Children,
Component,
Fragment,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/ReactClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export {
useDeferredValue,
REACT_SUSPENSE_LIST_TYPE as unstable_SuspenseList,
REACT_LEGACY_HIDDEN_TYPE as unstable_LegacyHidden,
REACT_ACTIVITY_TYPE as unstable_Activity,
REACT_ACTIVITY_TYPE as Activity,
getCacheForType as unstable_getCacheForType,
useCacheRefresh as unstable_useCacheRefresh,
use,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/ReactServer.experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,5 @@ export {
// Experimental
REACT_SUSPENSE_LIST_TYPE as unstable_SuspenseList,
REACT_VIEW_TRANSITION_TYPE as unstable_ViewTransition,
REACT_ACTIVITY_TYPE as unstable_Activity,
REACT_ACTIVITY_TYPE as Activity,
};
3 changes: 2 additions & 1 deletion scripts/jest/TestFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ function getTestFlags() {
fb: www || xplat,

// These aren't flags, just a useful aliases for tests.
enableActivity: releaseChannel === 'experimental' || www || xplat,
// TODO: Clean this up.
enableActivity: true,
enableSuspenseList: releaseChannel === 'experimental' || www || xplat,
enableLegacyHidden: www,
// TODO: Suspending the work loop during the render phase is currently
Expand Down
Loading