@@ -665,7 +665,7 @@ describe(`onRender`, () => {
}
}, [didMount, didMountAndUpdate]);
- Scheduler.unstable_yieldValue(`${didMount}:${didMountAndUpdate}`);
+ Scheduler.log(`${didMount}:${didMountAndUpdate}`);
return null;
}
@@ -698,7 +698,7 @@ describe(`onRender`, () => {
React.useLayoutEffect(() => {
setDidMount(true);
}, []);
- Scheduler.unstable_yieldValue(didMount);
+ Scheduler.log(didMount);
return didMount;
}
@@ -735,7 +735,7 @@ describe(`onRender`, () => {
const Yield = ({renderTime}) => {
Scheduler.unstable_advanceTime(renderTime);
- Scheduler.unstable_yieldValue('Yield:' + renderTime);
+ Scheduler.log('Yield:' + renderTime);
return null;
};
@@ -771,7 +771,7 @@ describe(`onRender`, () => {
const Yield = ({renderTime}) => {
Scheduler.unstable_advanceTime(renderTime);
- Scheduler.unstable_yieldValue('Yield:' + renderTime);
+ Scheduler.log('Yield:' + renderTime);
return null;
};
@@ -823,7 +823,7 @@ describe(`onRender`, () => {
const Yield = ({renderTime}) => {
Scheduler.unstable_advanceTime(renderTime);
- Scheduler.unstable_yieldValue('Yield:' + renderTime);
+ Scheduler.log('Yield:' + renderTime);
return null;
};
@@ -879,7 +879,7 @@ describe(`onRender`, () => {
const Yield = ({renderTime}) => {
Scheduler.unstable_advanceTime(renderTime);
- Scheduler.unstable_yieldValue('Yield:' + renderTime);
+ Scheduler.log('Yield:' + renderTime);
return null;
};
@@ -962,7 +962,7 @@ describe(`onRender`, () => {
const Yield = ({renderTime}) => {
Scheduler.unstable_advanceTime(renderTime);
- Scheduler.unstable_yieldValue('Yield:' + renderTime);
+ Scheduler.log('Yield:' + renderTime);
return null;
};
@@ -972,9 +972,7 @@ describe(`onRender`, () => {
render() {
first = this;
Scheduler.unstable_advanceTime(this.state.renderTime);
- Scheduler.unstable_yieldValue(
- 'FirstComponent:' + this.state.renderTime,
- );
+ Scheduler.log('FirstComponent:' + this.state.renderTime);
return
;
}
}
@@ -984,9 +982,7 @@ describe(`onRender`, () => {
render() {
second = this;
Scheduler.unstable_advanceTime(this.state.renderTime);
- Scheduler.unstable_yieldValue(
- 'SecondComponent:' + this.state.renderTime,
- );
+ Scheduler.log('SecondComponent:' + this.state.renderTime);
return
;
}
}
@@ -2375,7 +2371,7 @@ describe(`onNestedUpdateScheduled`, () => {
React.useLayoutEffect(() => {
setDidMount(true);
}, []);
- Scheduler.unstable_yieldValue(`Component:${didMount}`);
+ Scheduler.log(`Component:${didMount}`);
return didMount;
}
@@ -2404,7 +2400,7 @@ describe(`onNestedUpdateScheduled`, () => {
setDidMount(true);
});
}, []);
- Scheduler.unstable_yieldValue(`Component:${didMount}`);
+ Scheduler.log(`Component:${didMount}`);
return didMount;
}
@@ -2435,7 +2431,7 @@ describe(`onNestedUpdateScheduled`, () => {
React.useLayoutEffect(() => {
setDidMount(true);
}, []);
- Scheduler.unstable_yieldValue(`Component:${didMount}`);
+ Scheduler.log(`Component:${didMount}`);
return didMount;
}
const onNestedUpdateScheduledOne = jest.fn();
@@ -2476,7 +2472,7 @@ describe(`onNestedUpdateScheduled`, () => {
function ComponentRootOne() {
const [state, setState] = React.useState(false);
setStateRef.current = setState;
- Scheduler.unstable_yieldValue(`ComponentRootOne:${state}`);
+ Scheduler.log(`ComponentRootOne:${state}`);
return state;
}
@@ -2484,7 +2480,7 @@ describe(`onNestedUpdateScheduled`, () => {
React.useLayoutEffect(() => {
setStateRef.current(true);
}, []);
- Scheduler.unstable_yieldValue('ComponentRootTwo');
+ Scheduler.log('ComponentRootTwo');
return null;
}
@@ -2524,7 +2520,7 @@ describe(`onNestedUpdateScheduled`, () => {
React.useEffect(() => {
setDidMount(true);
}, []);
- Scheduler.unstable_yieldValue(`Component:${didMount}`);
+ Scheduler.log(`Component:${didMount}`);
return didMount;
}
@@ -2550,7 +2546,7 @@ describe(`onNestedUpdateScheduled`, () => {
function Component() {
const [state, setState] = React.useState(false);
updateFnRef.current = () => setState(true);
- Scheduler.unstable_yieldValue(`Component:${state}`);
+ Scheduler.log(`Component:${state}`);
return state;
}
@@ -2580,7 +2576,7 @@ describe(`onNestedUpdateScheduled`, () => {
if (state === false) {
setState(true);
}
- Scheduler.unstable_yieldValue(`Component:${state}`);
+ Scheduler.log(`Component:${state}`);
return state;
}
@@ -2611,7 +2607,7 @@ describe(`onNestedUpdateScheduled`, () => {
setRefDetached(true);
}
}, []);
- Scheduler.unstable_yieldValue(`Component:${refAttached}:${refDetached}`);
+ Scheduler.log(`Component:${refAttached}:${refDetached}`);
return mountChild ?
: null;
}
@@ -2656,7 +2652,7 @@ describe(`onNestedUpdateScheduled`, () => {
}
render() {
const {value} = this.state;
- Scheduler.unstable_yieldValue(`Component:${value}`);
+ Scheduler.log(`Component:${value}`);
return value;
}
}
@@ -2694,7 +2690,7 @@ describe(`onNestedUpdateScheduled`, () => {
render() {
const {scheduleNestedUpdate} = this.props;
const {nestedUpdateSheduled} = this.state;
- Scheduler.unstable_yieldValue(
+ Scheduler.log(
`Component:${scheduleNestedUpdate}:${nestedUpdateSheduled}`,
);
return nestedUpdateSheduled;
@@ -2740,7 +2736,7 @@ describe(`onNestedUpdateScheduled`, () => {
render() {
const {value} = this.state;
updateFnRef.current = () => this.setState({value: true});
- Scheduler.unstable_yieldValue(`Component:${value}`);
+ Scheduler.log(`Component:${value}`);
return value;
}
}
diff --git a/packages/react/src/__tests__/ReactProfilerDevToolsIntegration-test.internal.js b/packages/react/src/__tests__/ReactProfilerDevToolsIntegration-test.internal.js
index 9cbc30704a305..d28e2ad8de64a 100644
--- a/packages/react/src/__tests__/ReactProfilerDevToolsIntegration-test.internal.js
+++ b/packages/react/src/__tests__/ReactProfilerDevToolsIntegration-test.internal.js
@@ -146,7 +146,7 @@ describe('ReactProfiler DevTools integration', () => {
it('regression test: #17159', async () => {
function Text({text}) {
- Scheduler.unstable_yieldValue(text);
+ Scheduler.log(text);
return text;
}
diff --git a/packages/react/src/__tests__/forwardRef-test.internal.js b/packages/react/src/__tests__/forwardRef-test.internal.js
index f7a6b7c2b06aa..6da58ee051fc4 100644
--- a/packages/react/src/__tests__/forwardRef-test.internal.js
+++ b/packages/react/src/__tests__/forwardRef-test.internal.js
@@ -32,7 +32,7 @@ describe('forwardRef', () => {
it('should work without a ref to be forwarded', async () => {
class Child extends React.Component {
render() {
- Scheduler.unstable_yieldValue(this.props.value);
+ Scheduler.log(this.props.value);
return null;
}
}
@@ -52,7 +52,7 @@ describe('forwardRef', () => {
it('should forward a ref for a single child', async () => {
class Child extends React.Component {
render() {
- Scheduler.unstable_yieldValue(this.props.value);
+ Scheduler.log(this.props.value);
return null;
}
}
@@ -75,7 +75,7 @@ describe('forwardRef', () => {
it('should forward a ref for multiple children', async () => {
class Child extends React.Component {
render() {
- Scheduler.unstable_yieldValue(this.props.value);
+ Scheduler.log(this.props.value);
return null;
}
}
@@ -107,7 +107,7 @@ describe('forwardRef', () => {
super(props);
}
render() {
- Scheduler.unstable_yieldValue(this.props.value);
+ Scheduler.log(this.props.value);
return null;
}
}
@@ -142,29 +142,29 @@ describe('forwardRef', () => {
class ErrorBoundary extends React.Component {
state = {error: null};
componentDidCatch(error) {
- Scheduler.unstable_yieldValue('ErrorBoundary.componentDidCatch');
+ Scheduler.log('ErrorBoundary.componentDidCatch');
this.setState({error});
}
render() {
if (this.state.error) {
- Scheduler.unstable_yieldValue('ErrorBoundary.render: catch');
+ Scheduler.log('ErrorBoundary.render: catch');
return null;
}
- Scheduler.unstable_yieldValue('ErrorBoundary.render: try');
+ Scheduler.log('ErrorBoundary.render: try');
return this.props.children;
}
}
class BadRender extends React.Component {
render() {
- Scheduler.unstable_yieldValue('BadRender throw');
+ Scheduler.log('BadRender throw');
throw new Error('oops!');
}
}
function Wrapper(props) {
const forwardedRef = props.forwardedRef;
- Scheduler.unstable_yieldValue('Wrapper');
+ Scheduler.log('Wrapper');
return
;
}
@@ -201,24 +201,24 @@ describe('forwardRef', () => {
class Inner extends React.Component {
render() {
- Scheduler.unstable_yieldValue('Inner');
+ Scheduler.log('Inner');
inst = this;
return
;
}
}
function Middle(props) {
- Scheduler.unstable_yieldValue('Middle');
+ Scheduler.log('Middle');
return
;
}
const Forward = React.forwardRef((props, ref) => {
- Scheduler.unstable_yieldValue('Forward');
+ Scheduler.log('Forward');
return
;
});
function App() {
- Scheduler.unstable_yieldValue('App');
+ Scheduler.log('App');
return
;
}
diff --git a/packages/scheduler/src/__tests__/SchedulerMock-test.js b/packages/scheduler/src/__tests__/SchedulerMock-test.js
index 309456cafc052..d71957ef3ebae 100644
--- a/packages/scheduler/src/__tests__/SchedulerMock-test.js
+++ b/packages/scheduler/src/__tests__/SchedulerMock-test.js
@@ -53,10 +53,10 @@ describe('Scheduler', () => {
});
it('flushes work incrementally', async () => {
- scheduleCallback(NormalPriority, () => Scheduler.unstable_yieldValue('A'));
- scheduleCallback(NormalPriority, () => Scheduler.unstable_yieldValue('B'));
- scheduleCallback(NormalPriority, () => Scheduler.unstable_yieldValue('C'));
- scheduleCallback(NormalPriority, () => Scheduler.unstable_yieldValue('D'));
+ scheduleCallback(NormalPriority, () => Scheduler.log('A'));
+ scheduleCallback(NormalPriority, () => Scheduler.log('B'));
+ scheduleCallback(NormalPriority, () => Scheduler.log('C'));
+ scheduleCallback(NormalPriority, () => Scheduler.log('D'));
await waitFor(['A', 'B']);
await waitFor(['C']);
@@ -64,11 +64,11 @@ describe('Scheduler', () => {
});
it('cancels work', async () => {
- scheduleCallback(NormalPriority, () => Scheduler.unstable_yieldValue('A'));
+ scheduleCallback(NormalPriority, () => Scheduler.log('A'));
const callbackHandleB = scheduleCallback(NormalPriority, () =>
- Scheduler.unstable_yieldValue('B'),
+ Scheduler.log('B'),
);
- scheduleCallback(NormalPriority, () => Scheduler.unstable_yieldValue('C'));
+ scheduleCallback(NormalPriority, () => Scheduler.log('C'));
cancelCallback(callbackHandleB);
@@ -80,18 +80,14 @@ describe('Scheduler', () => {
});
it('executes the highest priority callbacks first', async () => {
- scheduleCallback(NormalPriority, () => Scheduler.unstable_yieldValue('A'));
- scheduleCallback(NormalPriority, () => Scheduler.unstable_yieldValue('B'));
+ scheduleCallback(NormalPriority, () => Scheduler.log('A'));
+ scheduleCallback(NormalPriority, () => Scheduler.log('B'));
// Yield before B is flushed
await waitFor(['A']);
- scheduleCallback(UserBlockingPriority, () =>
- Scheduler.unstable_yieldValue('C'),
- );
- scheduleCallback(UserBlockingPriority, () =>
- Scheduler.unstable_yieldValue('D'),
- );
+ scheduleCallback(UserBlockingPriority, () => Scheduler.log('C'));
+ scheduleCallback(UserBlockingPriority, () => Scheduler.log('D'));
// C and D should come first, because they are higher priority
await waitForAll(['C', 'D', 'B']);
@@ -100,15 +96,15 @@ describe('Scheduler', () => {
it('expires work', async () => {
scheduleCallback(NormalPriority, didTimeout => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue(`A (did timeout: ${didTimeout})`);
+ Scheduler.log(`A (did timeout: ${didTimeout})`);
});
scheduleCallback(UserBlockingPriority, didTimeout => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue(`B (did timeout: ${didTimeout})`);
+ Scheduler.log(`B (did timeout: ${didTimeout})`);
});
scheduleCallback(UserBlockingPriority, didTimeout => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue(`C (did timeout: ${didTimeout})`);
+ Scheduler.log(`C (did timeout: ${didTimeout})`);
});
// Advance time, but not by enough to expire any work
@@ -118,11 +114,11 @@ describe('Scheduler', () => {
// Schedule a few more callbacks
scheduleCallback(NormalPriority, didTimeout => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue(`D (did timeout: ${didTimeout})`);
+ Scheduler.log(`D (did timeout: ${didTimeout})`);
});
scheduleCallback(NormalPriority, didTimeout => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue(`E (did timeout: ${didTimeout})`);
+ Scheduler.log(`E (did timeout: ${didTimeout})`);
});
// Advance by just a bit more to expire the user blocking callbacks
@@ -138,7 +134,7 @@ describe('Scheduler', () => {
});
it('has a default expiration of ~5 seconds', () => {
- scheduleCallback(NormalPriority, () => Scheduler.unstable_yieldValue('A'));
+ scheduleCallback(NormalPriority, () => Scheduler.log('A'));
Scheduler.unstable_advanceTime(4999);
assertLog([]);
@@ -151,11 +147,11 @@ describe('Scheduler', () => {
it('continues working on same task after yielding', async () => {
scheduleCallback(NormalPriority, () => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue('A');
+ Scheduler.log('A');
});
scheduleCallback(NormalPriority, () => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue('B');
+ Scheduler.log('B');
});
let didYield = false;
@@ -168,7 +164,7 @@ describe('Scheduler', () => {
while (tasks.length > 0) {
const [label, ms] = tasks.shift();
Scheduler.unstable_advanceTime(ms);
- Scheduler.unstable_yieldValue(label);
+ Scheduler.log(label);
if (shouldYield()) {
didYield = true;
return C;
@@ -180,11 +176,11 @@ describe('Scheduler', () => {
scheduleCallback(NormalPriority, () => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue('D');
+ Scheduler.log('D');
});
scheduleCallback(NormalPriority, () => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue('E');
+ Scheduler.log('E');
});
// Flush, then yield while in the middle of C.
@@ -207,7 +203,7 @@ describe('Scheduler', () => {
while (tasks.length > 0) {
const [label, ms] = tasks.shift();
Scheduler.unstable_advanceTime(ms);
- Scheduler.unstable_yieldValue(label);
+ Scheduler.log(label);
if (shouldYield()) {
return work;
}
@@ -237,7 +233,7 @@ describe('Scheduler', () => {
while (tasks.length > 0) {
const [label, ms] = tasks.shift();
Scheduler.unstable_advanceTime(ms);
- Scheduler.unstable_yieldValue(label);
+ Scheduler.log(label);
if (tasks.length > 0 && shouldYield()) {
return work;
}
@@ -248,7 +244,7 @@ describe('Scheduler', () => {
scheduleCallback(UserBlockingPriority, () => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue('High pri');
+ Scheduler.log('High pri');
});
await waitForAll(['High pri', 'B', 'C', 'D']);
@@ -269,13 +265,13 @@ describe('Scheduler', () => {
const task = tasks.shift();
const [label, ms] = task;
Scheduler.unstable_advanceTime(ms);
- Scheduler.unstable_yieldValue(label);
+ Scheduler.log(label);
if (label === 'B') {
// Schedule high pri work from inside another callback
- Scheduler.unstable_yieldValue('Schedule high pri');
+ Scheduler.log('Schedule high pri');
scheduleCallback(UserBlockingPriority, () => {
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue('High pri');
+ Scheduler.log('High pri');
});
}
if (tasks.length > 0) {
@@ -301,9 +297,9 @@ describe('Scheduler', () => {
it('cancelling a continuation', async () => {
const task = scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('Yield');
+ Scheduler.log('Yield');
return () => {
- Scheduler.unstable_yieldValue('Continuation');
+ Scheduler.log('Continuation');
};
});
@@ -313,18 +309,10 @@ describe('Scheduler', () => {
});
it('top-level immediate callbacks fire in a subsequent task', () => {
- scheduleCallback(ImmediatePriority, () =>
- Scheduler.unstable_yieldValue('A'),
- );
- scheduleCallback(ImmediatePriority, () =>
- Scheduler.unstable_yieldValue('B'),
- );
- scheduleCallback(ImmediatePriority, () =>
- Scheduler.unstable_yieldValue('C'),
- );
- scheduleCallback(ImmediatePriority, () =>
- Scheduler.unstable_yieldValue('D'),
- );
+ scheduleCallback(ImmediatePriority, () => Scheduler.log('A'));
+ scheduleCallback(ImmediatePriority, () => Scheduler.log('B'));
+ scheduleCallback(ImmediatePriority, () => Scheduler.log('C'));
+ scheduleCallback(ImmediatePriority, () => Scheduler.log('D'));
// Immediate callback hasn't fired, yet.
assertLog([]);
// They all flush immediately within the subsequent task.
@@ -333,19 +321,13 @@ describe('Scheduler', () => {
});
it('nested immediate callbacks are added to the queue of immediate callbacks', () => {
- scheduleCallback(ImmediatePriority, () =>
- Scheduler.unstable_yieldValue('A'),
- );
+ scheduleCallback(ImmediatePriority, () => Scheduler.log('A'));
scheduleCallback(ImmediatePriority, () => {
- Scheduler.unstable_yieldValue('B');
+ Scheduler.log('B');
// This callback should go to the end of the queue
- scheduleCallback(ImmediatePriority, () =>
- Scheduler.unstable_yieldValue('C'),
- );
+ scheduleCallback(ImmediatePriority, () => Scheduler.log('C'));
});
- scheduleCallback(ImmediatePriority, () =>
- Scheduler.unstable_yieldValue('D'),
- );
+ scheduleCallback(ImmediatePriority, () => Scheduler.log('D'));
assertLog([]);
// C should flush at the end
Scheduler.unstable_flushExpired();
@@ -360,7 +342,7 @@ describe('Scheduler', () => {
it('wrapped callbacks inherit the current priority', () => {
const wrappedCallback = runWithPriority(NormalPriority, () =>
wrapCallback(() => {
- Scheduler.unstable_yieldValue(getCurrentPriorityLevel());
+ Scheduler.log(getCurrentPriorityLevel());
}),
);
@@ -368,7 +350,7 @@ describe('Scheduler', () => {
UserBlockingPriority,
() =>
wrapCallback(() => {
- Scheduler.unstable_yieldValue(getCurrentPriorityLevel());
+ Scheduler.log(getCurrentPriorityLevel());
}),
);
@@ -385,11 +367,11 @@ describe('Scheduler', () => {
runWithPriority(NormalPriority, () => {
wrappedCallback = wrapCallback(() => {
- Scheduler.unstable_yieldValue(getCurrentPriorityLevel());
+ Scheduler.log(getCurrentPriorityLevel());
});
wrappedUserBlockingCallback = runWithPriority(UserBlockingPriority, () =>
wrapCallback(() => {
- Scheduler.unstable_yieldValue(getCurrentPriorityLevel());
+ Scheduler.log(getCurrentPriorityLevel());
}),
);
});
@@ -403,14 +385,14 @@ describe('Scheduler', () => {
it("immediate callbacks fire even if there's an error", () => {
scheduleCallback(ImmediatePriority, () => {
- Scheduler.unstable_yieldValue('A');
+ Scheduler.log('A');
throw new Error('Oops A');
});
scheduleCallback(ImmediatePriority, () => {
- Scheduler.unstable_yieldValue('B');
+ Scheduler.log('B');
});
scheduleCallback(ImmediatePriority, () => {
- Scheduler.unstable_yieldValue('C');
+ Scheduler.log('C');
throw new Error('Oops C');
});
@@ -436,16 +418,16 @@ describe('Scheduler', () => {
});
it('exposes the current priority level', () => {
- Scheduler.unstable_yieldValue(getCurrentPriorityLevel());
+ Scheduler.log(getCurrentPriorityLevel());
runWithPriority(ImmediatePriority, () => {
- Scheduler.unstable_yieldValue(getCurrentPriorityLevel());
+ Scheduler.log(getCurrentPriorityLevel());
runWithPriority(NormalPriority, () => {
- Scheduler.unstable_yieldValue(getCurrentPriorityLevel());
+ Scheduler.log(getCurrentPriorityLevel());
runWithPriority(UserBlockingPriority, () => {
- Scheduler.unstable_yieldValue(getCurrentPriorityLevel());
+ Scheduler.log(getCurrentPriorityLevel());
});
});
- Scheduler.unstable_yieldValue(getCurrentPriorityLevel());
+ Scheduler.log(getCurrentPriorityLevel());
});
assertLog([
@@ -495,25 +477,19 @@ describe('Scheduler', () => {
}
scheduleCallback(ImmediatePriority, () =>
- Scheduler.unstable_yieldValue(
- 'Immediate: ' + inferPriorityFromCallstack(),
- ),
+ Scheduler.log('Immediate: ' + inferPriorityFromCallstack()),
);
scheduleCallback(UserBlockingPriority, () =>
- Scheduler.unstable_yieldValue(
- 'UserBlocking: ' + inferPriorityFromCallstack(),
- ),
+ Scheduler.log('UserBlocking: ' + inferPriorityFromCallstack()),
);
scheduleCallback(NormalPriority, () =>
- Scheduler.unstable_yieldValue(
- 'Normal: ' + inferPriorityFromCallstack(),
- ),
+ Scheduler.log('Normal: ' + inferPriorityFromCallstack()),
);
scheduleCallback(LowPriority, () =>
- Scheduler.unstable_yieldValue('Low: ' + inferPriorityFromCallstack()),
+ Scheduler.log('Low: ' + inferPriorityFromCallstack()),
);
scheduleCallback(IdlePriority, () =>
- Scheduler.unstable_yieldValue('Idle: ' + inferPriorityFromCallstack()),
+ Scheduler.log('Idle: ' + inferPriorityFromCallstack()),
);
await waitForAll([
@@ -528,13 +504,9 @@ describe('Scheduler', () => {
describe('delayed tasks', () => {
it('schedules a delayed task', async () => {
- scheduleCallback(
- NormalPriority,
- () => Scheduler.unstable_yieldValue('A'),
- {
- delay: 1000,
- },
- );
+ scheduleCallback(NormalPriority, () => Scheduler.log('A'), {
+ delay: 1000,
+ });
// Should flush nothing, because delay hasn't elapsed
await waitForAll([]);
@@ -552,37 +524,21 @@ describe('Scheduler', () => {
});
it('schedules multiple delayed tasks', async () => {
- scheduleCallback(
- NormalPriority,
- () => Scheduler.unstable_yieldValue('C'),
- {
- delay: 300,
- },
- );
+ scheduleCallback(NormalPriority, () => Scheduler.log('C'), {
+ delay: 300,
+ });
- scheduleCallback(
- NormalPriority,
- () => Scheduler.unstable_yieldValue('B'),
- {
- delay: 200,
- },
- );
+ scheduleCallback(NormalPriority, () => Scheduler.log('B'), {
+ delay: 200,
+ });
- scheduleCallback(
- NormalPriority,
- () => Scheduler.unstable_yieldValue('D'),
- {
- delay: 400,
- },
- );
+ scheduleCallback(NormalPriority, () => Scheduler.log('D'), {
+ delay: 400,
+ });
- scheduleCallback(
- NormalPriority,
- () => Scheduler.unstable_yieldValue('A'),
- {
- delay: 100,
- },
- );
+ scheduleCallback(NormalPriority, () => Scheduler.log('A'), {
+ delay: 100,
+ });
// Should flush nothing, because delay hasn't elapsed
await waitForAll([]);
@@ -601,32 +557,28 @@ describe('Scheduler', () => {
it('interleaves normal tasks and delayed tasks', async () => {
// Schedule some high priority callbacks with a delay. When their delay
// elapses, they will be the most important callback in the queue.
- scheduleCallback(
- UserBlockingPriority,
- () => Scheduler.unstable_yieldValue('Timer 2'),
- {delay: 300},
- );
- scheduleCallback(
- UserBlockingPriority,
- () => Scheduler.unstable_yieldValue('Timer 1'),
- {delay: 100},
- );
+ scheduleCallback(UserBlockingPriority, () => Scheduler.log('Timer 2'), {
+ delay: 300,
+ });
+ scheduleCallback(UserBlockingPriority, () => Scheduler.log('Timer 1'), {
+ delay: 100,
+ });
// Schedule some tasks at default priority.
scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('A');
+ Scheduler.log('A');
Scheduler.unstable_advanceTime(100);
});
scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('B');
+ Scheduler.log('B');
Scheduler.unstable_advanceTime(100);
});
scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('C');
+ Scheduler.log('C');
Scheduler.unstable_advanceTime(100);
});
scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('D');
+ Scheduler.log('D');
Scheduler.unstable_advanceTime(100);
});
@@ -638,16 +590,12 @@ describe('Scheduler', () => {
it('interleaves delayed tasks with time-sliced tasks', async () => {
// Schedule some high priority callbacks with a delay. When their delay
// elapses, they will be the most important callback in the queue.
- scheduleCallback(
- UserBlockingPriority,
- () => Scheduler.unstable_yieldValue('Timer 2'),
- {delay: 300},
- );
- scheduleCallback(
- UserBlockingPriority,
- () => Scheduler.unstable_yieldValue('Timer 1'),
- {delay: 100},
- );
+ scheduleCallback(UserBlockingPriority, () => Scheduler.log('Timer 2'), {
+ delay: 300,
+ });
+ scheduleCallback(UserBlockingPriority, () => Scheduler.log('Timer 1'), {
+ delay: 100,
+ });
// Schedule a time-sliced task at default priority.
const tasks = [
@@ -661,7 +609,7 @@ describe('Scheduler', () => {
const task = tasks.shift();
const [label, ms] = task;
Scheduler.unstable_advanceTime(ms);
- Scheduler.unstable_yieldValue(label);
+ Scheduler.log(label);
if (tasks.length > 0) {
return work;
}
@@ -678,19 +626,15 @@ describe('Scheduler', () => {
// Schedule several tasks with the same delay
const options = {delay: 100};
- scheduleCallback(
- NormalPriority,
- () => Scheduler.unstable_yieldValue('A'),
- options,
- );
+ scheduleCallback(NormalPriority, () => Scheduler.log('A'), options);
const taskB = scheduleCallback(
NormalPriority,
- () => Scheduler.unstable_yieldValue('B'),
+ () => Scheduler.log('B'),
options,
);
const taskC = scheduleCallback(
NormalPriority,
- () => Scheduler.unstable_yieldValue('C'),
+ () => Scheduler.log('C'),
options,
);
@@ -722,11 +666,11 @@ describe('Scheduler', () => {
it('toFlushUntilNextPaint stops if a continuation is returned', async () => {
scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('Original Task');
- Scheduler.unstable_yieldValue('shouldYield: ' + shouldYield());
- Scheduler.unstable_yieldValue('Return a continuation');
+ Scheduler.log('Original Task');
+ Scheduler.log('shouldYield: ' + shouldYield());
+ Scheduler.log('Return a continuation');
return () => {
- Scheduler.unstable_yieldValue('Continuation Task');
+ Scheduler.log('Continuation Task');
};
});
@@ -749,11 +693,11 @@ describe('Scheduler', () => {
it("toFlushAndYield keeps flushing even if there's a continuation", async () => {
scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('Original Task');
- Scheduler.unstable_yieldValue('shouldYield: ' + shouldYield());
- Scheduler.unstable_yieldValue('Return a continuation');
+ Scheduler.log('Original Task');
+ Scheduler.log('shouldYield: ' + shouldYield());
+ Scheduler.log('Return a continuation');
return () => {
- Scheduler.unstable_yieldValue('Continuation Task');
+ Scheduler.log('Continuation Task');
};
});
diff --git a/packages/scheduler/src/__tests__/SchedulerProfiling-test.js b/packages/scheduler/src/__tests__/SchedulerProfiling-test.js
index f6f89a4aa07a0..f0a88cead2334 100644
--- a/packages/scheduler/src/__tests__/SchedulerProfiling-test.js
+++ b/packages/scheduler/src/__tests__/SchedulerProfiling-test.js
@@ -270,19 +270,19 @@ describe('Scheduler', () => {
NormalPriority,
() => {
Scheduler.unstable_advanceTime(300);
- Scheduler.unstable_yieldValue('Yield 1');
+ Scheduler.log('Yield 1');
scheduleCallback(
UserBlockingPriority,
() => {
- Scheduler.unstable_yieldValue('Yield 2');
+ Scheduler.log('Yield 2');
Scheduler.unstable_advanceTime(300);
},
{label: 'Bar'},
);
Scheduler.unstable_advanceTime(100);
- Scheduler.unstable_yieldValue('Yield 3');
+ Scheduler.log('Yield 3');
return () => {
- Scheduler.unstable_yieldValue('Yield 4');
+ Scheduler.log('Yield 4');
Scheduler.unstable_advanceTime(300);
};
},
@@ -305,11 +305,11 @@ Task 1 [Normal] │ ████████░░░░░░░
Scheduler.unstable_Profiling.startLoggingProfilingEvents();
const task = scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('Yield 1');
+ Scheduler.log('Yield 1');
Scheduler.unstable_advanceTime(300);
- Scheduler.unstable_yieldValue('Yield 2');
+ Scheduler.log('Yield 2');
return () => {
- Scheduler.unstable_yieldValue('Continuation');
+ Scheduler.log('Continuation');
Scheduler.unstable_advanceTime(200);
};
});
@@ -354,20 +354,20 @@ Task 1 [Normal] │██████🡐 errored
Scheduler.unstable_Profiling.startLoggingProfilingEvents();
const task1 = scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('Yield 1');
+ Scheduler.log('Yield 1');
Scheduler.unstable_advanceTime(300);
- Scheduler.unstable_yieldValue('Yield 2');
+ Scheduler.log('Yield 2');
return () => {
- Scheduler.unstable_yieldValue('Continuation');
+ Scheduler.log('Continuation');
Scheduler.unstable_advanceTime(200);
};
});
const task2 = scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('Yield 3');
+ Scheduler.log('Yield 3');
Scheduler.unstable_advanceTime(300);
- Scheduler.unstable_yieldValue('Yield 4');
+ Scheduler.log('Yield 4');
return () => {
- Scheduler.unstable_yieldValue('Continuation');
+ Scheduler.log('Continuation');
Scheduler.unstable_advanceTime(200);
};
});
@@ -397,7 +397,7 @@ Task 2 [Normal] │░░░░░░░░🡐 canceled
Scheduler.unstable_Profiling.startLoggingProfilingEvents();
const task = scheduleCallback(NormalPriority, () => {
- Scheduler.unstable_yieldValue('A');
+ Scheduler.log('A');
Scheduler.unstable_advanceTime(1000);
});
await waitForAll(['A']);
@@ -416,7 +416,7 @@ Task 1 [Normal] │████████████████
scheduleCallback(
NormalPriority,
() => {
- Scheduler.unstable_yieldValue('A');
+ Scheduler.log('A');
Scheduler.unstable_advanceTime(1000);
},
{label: 'A'},
@@ -425,7 +425,7 @@ Task 1 [Normal] │████████████████
const task = scheduleCallback(
NormalPriority,
() => {
- Scheduler.unstable_yieldValue('B');
+ Scheduler.log('B');
Scheduler.unstable_advanceTime(1000);
},
{label: 'B'},
@@ -450,7 +450,7 @@ Task 2 [Normal] │ ░░░░░░░░🡐 canceled
NormalPriority,
() => {
Scheduler.unstable_advanceTime(1000);
- Scheduler.unstable_yieldValue('A');
+ Scheduler.log('A');
},
{
delay: 1000,
@@ -472,11 +472,9 @@ Task 1 [Normal] │ █████████
it('handles cancelling a delayed task', async () => {
Scheduler.unstable_Profiling.startLoggingProfilingEvents();
- const task = scheduleCallback(
- NormalPriority,
- () => Scheduler.unstable_yieldValue('A'),
- {delay: 1000},
- );
+ const task = scheduleCallback(NormalPriority, () => Scheduler.log('A'), {
+ delay: 1000,
+ });
cancelCallback(task);
await waitForAll([]);
expect(stopProfilingAndPrintFlamegraph()).toEqual(
diff --git a/packages/scheduler/src/forks/SchedulerMock.js b/packages/scheduler/src/forks/SchedulerMock.js
index 512ea1f10dd12..7f148c45be3e4 100644
--- a/packages/scheduler/src/forks/SchedulerMock.js
+++ b/packages/scheduler/src/forks/SchedulerMock.js
@@ -606,7 +606,7 @@ function unstable_flushAllWithoutAsserting(): boolean {
}
}
-function unstable_clearYields(): Array
{
+function unstable_clearLog(): Array {
if (yieldedValues === null) {
return [];
}
@@ -632,7 +632,7 @@ function unstable_flushAll(): void {
}
}
-function unstable_yieldValue(value: mixed): void {
+function log(value: mixed): void {
// eslint-disable-next-line react-internal/no-production-logging
if (console.log.name === 'disabledLog' || disableYieldValue) {
// If console.log has been patched, we assume we're in render
@@ -687,11 +687,11 @@ export {
unstable_flushAllWithoutAsserting,
unstable_flushNumberOfYields,
unstable_flushExpired,
- unstable_clearYields,
+ unstable_clearLog,
unstable_flushUntilNextPaint,
unstable_hasPendingWork,
unstable_flushAll,
- unstable_yieldValue,
+ log,
unstable_advanceTime,
reset,
setDisableYieldValue as unstable_setDisableYieldValue,
diff --git a/packages/shared/forks/Scheduler.umd.js b/packages/shared/forks/Scheduler.umd.js
index 89a8b0557a301..0c6480fcf0c82 100644
--- a/packages/shared/forks/Scheduler.umd.js
+++ b/packages/shared/forks/Scheduler.umd.js
@@ -34,7 +34,7 @@ const {
// on scheduler/unstable_mock, which we'll need inside act()
// and for internal testing
unstable_flushAllWithoutAsserting,
- unstable_yieldValue,
+ log,
unstable_setDisableYieldValue,
} = ReactInternals.Scheduler;
@@ -57,6 +57,6 @@ export {
unstable_IdlePriority,
unstable_forceFrameRate,
unstable_flushAllWithoutAsserting,
- unstable_yieldValue,
+ log,
unstable_setDisableYieldValue,
};
diff --git a/packages/use-subscription/src/__tests__/useSubscription-test.js b/packages/use-subscription/src/__tests__/useSubscription-test.js
index a4b73eaa819d3..89bf30a7fa2b5 100644
--- a/packages/use-subscription/src/__tests__/useSubscription-test.js
+++ b/packages/use-subscription/src/__tests__/useSubscription-test.js
@@ -59,7 +59,7 @@ describe('useSubscription', () => {
it('supports basic subscription pattern', async () => {
function Child({value = 'default'}) {
- Scheduler.unstable_yieldValue(value);
+ Scheduler.log(value);
return null;
}
@@ -103,7 +103,7 @@ describe('useSubscription', () => {
it('should support observable types like RxJS ReplaySubject', async () => {
function Child({value = 'default'}) {
- Scheduler.unstable_yieldValue(value);
+ Scheduler.log(value);
return null;
}
@@ -153,7 +153,7 @@ describe('useSubscription', () => {
it('should unsubscribe from old sources and subscribe to new sources when memoized props change', async () => {
function Child({value = 'default'}) {
- Scheduler.unstable_yieldValue(value);
+ Scheduler.log(value);
return null;
}
@@ -214,7 +214,7 @@ describe('useSubscription', () => {
it('should unsubscribe from old sources and subscribe to new sources when useCallback functions change', async () => {
function Child({value = 'default'}) {
- Scheduler.unstable_yieldValue(value);
+ Scheduler.log(value);
return null;
}
@@ -274,12 +274,12 @@ describe('useSubscription', () => {
const log = [];
function Grandchild({value}) {
- Scheduler.unstable_yieldValue('Grandchild: ' + value);
+ Scheduler.log('Grandchild: ' + value);
return null;
}
function Child({value = 'default'}) {
- Scheduler.unstable_yieldValue('Child: ' + value);
+ Scheduler.log('Child: ' + value);
return ;
}
@@ -377,12 +377,12 @@ describe('useSubscription', () => {
const log = [];
function Grandchild({value}) {
- Scheduler.unstable_yieldValue('Grandchild: ' + value);
+ Scheduler.log('Grandchild: ' + value);
return null;
}
function Child({value = 'default'}) {
- Scheduler.unstable_yieldValue('Child: ' + value);
+ Scheduler.log('Child: ' + value);
return ;
}
@@ -481,7 +481,7 @@ describe('useSubscription', () => {
it('should guard against updates that happen after unmounting', () => {
function Child({value = 'default'}) {
- Scheduler.unstable_yieldValue(value);
+ Scheduler.log(value);
return null;
}
@@ -593,7 +593,7 @@ describe('useSubscription', () => {
const Subscriber = ({id}) => {
const value = useSubscription(subscription);
- Scheduler.unstable_yieldValue(`render:${id}:${value}`);
+ Scheduler.log(`render:${id}:${value}`);
return value;
};
diff --git a/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreNative-test.js b/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreNative-test.js
index 88665188342fe..ac4c0b8f4bb08 100644
--- a/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreNative-test.js
+++ b/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreNative-test.js
@@ -77,7 +77,7 @@ describe('useSyncExternalStore (userspace shim, server rendering)', () => {
});
function Text({text}) {
- Scheduler.unstable_yieldValue(text);
+ Scheduler.log(text);
return text;
}
diff --git a/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js b/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js
index 7abe12bd5e65f..4c4bee7c05d45 100644
--- a/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js
+++ b/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js
@@ -84,7 +84,7 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
});
function Text({text}) {
- Scheduler.unstable_yieldValue(text);
+ Scheduler.log(text);
return text;
}
@@ -288,7 +288,7 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
function App() {
const value = useSyncExternalStore(store.subscribe, store.getState);
useEffect(() => {
- Scheduler.unstable_yieldValue('Passive effect: ' + value);
+ Scheduler.log('Passive effect: ' + value);
}, [value]);
return ;
}
@@ -337,7 +337,7 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
// that changed the getSnapshot in Child2. Child2's effects haven't
// fired yet, so it doesn't have access to the latest getSnapshot. So
// it can't use the getSnapshot to bail out.
- Scheduler.unstable_yieldValue('Update B in commit phase');
+ Scheduler.log('Update B in commit phase');
store.set({a: value.a, b: 2});
}
}, [step]);
@@ -397,7 +397,7 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
// that changed the getSnapshot in Child2. Child2's effects haven't
// fired yet, so it doesn't have access to the latest getSnapshot. So
// it can't use the getSnapshot to bail out.
- Scheduler.unstable_yieldValue('Update B in commit phase');
+ Scheduler.log('Update B in commit phase');
store.set({a: value.a, b: 2});
}
}, [step]);
@@ -449,7 +449,7 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
const value = useSyncExternalStore(store.subscribe, store.getState);
useLayoutEffect(() => {
if (value === 1) {
- Scheduler.unstable_yieldValue('Reset back to 0');
+ Scheduler.log('Reset back to 0');
store.set(0);
}
}, [value]);
@@ -629,12 +629,12 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
const store = createExternalStore({a: 0, b: 0});
function selector(state) {
- Scheduler.unstable_yieldValue('Selector');
+ Scheduler.log('Selector');
return state.a;
}
function App() {
- Scheduler.unstable_yieldValue('App');
+ Scheduler.log('App');
const a = useSyncExternalStoreWithSelector(
store.subscribe,
store.getState,
@@ -738,7 +738,7 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
() => 'server',
);
useEffect(() => {
- Scheduler.unstable_yieldValue('Passive effect: ' + text);
+ Scheduler.log('Passive effect: ' + text);
}, [text]);
return (
@@ -838,7 +838,7 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
function App({step}) {
const inlineSelector = state => {
- Scheduler.unstable_yieldValue('Inline selector');
+ Scheduler.log('Inline selector');
return [...state.items, 'C'];
};
const items = useSyncExternalStoreWithSelector(
diff --git a/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShimServer-test.js b/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShimServer-test.js
index f5202852c68fc..6eacb9a99c606 100644
--- a/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShimServer-test.js
+++ b/packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShimServer-test.js
@@ -54,7 +54,7 @@ describe('useSyncExternalStore (userspace shim, server rendering)', () => {
});
function Text({text}) {
- Scheduler.unstable_yieldValue(text);
+ Scheduler.log(text);
return text;
}
diff --git a/scripts/jest/matchers/reactTestMatchers.js b/scripts/jest/matchers/reactTestMatchers.js
index fa44543672259..ecf0329a0407d 100644
--- a/scripts/jest/matchers/reactTestMatchers.js
+++ b/scripts/jest/matchers/reactTestMatchers.js
@@ -1,7 +1,8 @@
'use strict';
const JestReact = require('jest-react');
-const SchedulerMatchers = require('./schedulerTestMatchers');
+
+// TODO: Move to ReactInternalTestUtils
function captureAssertion(fn) {
// Trick to use a Jest matcher inside another Jest matcher. `fn` contains an
@@ -20,12 +21,13 @@ function captureAssertion(fn) {
}
function assertYieldsWereCleared(Scheduler) {
- const actualYields = Scheduler.unstable_clearYields();
+ const actualYields = Scheduler.unstable_clearLog();
if (actualYields.length !== 0) {
- throw new Error(
- 'Log of yielded values is not empty. ' +
- 'Call expect(Scheduler).toHaveYielded(...) first.'
+ const error = Error(
+ 'The event log is not empty. Call assertLog(...) first.'
);
+ Error.captureStackTrace(error, assertYieldsWereCleared);
+ throw error;
}
}
@@ -41,6 +43,5 @@ function toMatchRenderedOutput(ReactNoop, expectedJSX) {
}
module.exports = {
- ...SchedulerMatchers,
toMatchRenderedOutput,
};
diff --git a/scripts/jest/matchers/schedulerTestMatchers.js b/scripts/jest/matchers/schedulerTestMatchers.js
deleted file mode 100644
index 645d8a58cc59f..0000000000000
--- a/scripts/jest/matchers/schedulerTestMatchers.js
+++ /dev/null
@@ -1,96 +0,0 @@
-'use strict';
-
-function captureAssertion(fn) {
- // Trick to use a Jest matcher inside another Jest matcher. `fn` contains an
- // assertion; if it throws, we capture the error and return it, so the stack
- // trace presented to the user points to the original assertion in the
- // test file.
- try {
- fn();
- } catch (error) {
- return {
- pass: false,
- message: () => error.message,
- };
- }
- return {pass: true};
-}
-
-function assertYieldsWereCleared(Scheduler) {
- const actualYields = Scheduler.unstable_clearYields();
-
- if (actualYields.length !== 0) {
- const error = Error(
- 'Log of yielded values is not empty. ' +
- 'Call expect(Scheduler).toHaveYielded(...) first.'
- );
- Error.captureStackTrace(error, assertYieldsWereCleared);
- throw error;
- }
-}
-
-function toFlushAndYield(Scheduler, expectedYields) {
- assertYieldsWereCleared(Scheduler);
- Scheduler.unstable_flushAllWithoutAsserting();
- const actualYields = Scheduler.unstable_clearYields();
- return captureAssertion(() => {
- expect(actualYields).toEqual(expectedYields);
- });
-}
-
-function toFlushAndYieldThrough(Scheduler, expectedYields) {
- assertYieldsWereCleared(Scheduler);
- Scheduler.unstable_flushNumberOfYields(expectedYields.length);
- const actualYields = Scheduler.unstable_clearYields();
- return captureAssertion(() => {
- expect(actualYields).toEqual(expectedYields);
- });
-}
-
-function toFlushUntilNextPaint(Scheduler, expectedYields) {
- assertYieldsWereCleared(Scheduler);
- Scheduler.unstable_flushUntilNextPaint();
- const actualYields = Scheduler.unstable_clearYields();
- return captureAssertion(() => {
- expect(actualYields).toEqual(expectedYields);
- });
-}
-
-function toFlushWithoutYielding(Scheduler) {
- return toFlushAndYield(Scheduler, []);
-}
-
-function toFlushExpired(Scheduler, expectedYields) {
- assertYieldsWereCleared(Scheduler);
- Scheduler.unstable_flushExpired();
- const actualYields = Scheduler.unstable_clearYields();
- return captureAssertion(() => {
- expect(actualYields).toEqual(expectedYields);
- });
-}
-
-function toHaveYielded(Scheduler, expectedYields) {
- return captureAssertion(() => {
- const actualYields = Scheduler.unstable_clearYields();
- expect(actualYields).toEqual(expectedYields);
- });
-}
-
-function toFlushAndThrow(Scheduler, ...rest) {
- assertYieldsWereCleared(Scheduler);
- return captureAssertion(() => {
- expect(() => {
- Scheduler.unstable_flushAllWithoutAsserting();
- }).toThrow(...rest);
- });
-}
-
-module.exports = {
- toFlushAndYield,
- toFlushAndYieldThrough,
- toFlushUntilNextPaint,
- toFlushWithoutYielding,
- toFlushExpired,
- toHaveYielded,
- toFlushAndThrow,
-};
diff --git a/scripts/release/snapshot-test.snapshot b/scripts/release/snapshot-test.snapshot
index 78f95b065cb45..a8482b39fc5a0 100644
--- a/scripts/release/snapshot-test.snapshot
+++ b/scripts/release/snapshot-test.snapshot
@@ -73,12 +73,12 @@ Index: build/node_modules/react/umd/react.development.js
*
@@ -16,9 +16,9 @@
}(this, (function () { 'use strict';
-
+
// TODO: this is special because it gets imported during build.
-
+
-var ReactVersion = '16.6.1-canary-b3d1a81a9';
+var ReactVersion = '1.2.3';
-
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
@@ -132,12 +132,12 @@ Index: build/node_modules/react/cjs/react.development.js
*
@@ -19,9 +19,9 @@
var checkPropTypes = require('prop-types/checkPropTypes');
-
+
// TODO: this is special because it gets imported during build.
-
+
-var ReactVersion = '16.6.1-canary-b3d1a81a9';
+var ReactVersion = '1.2.3';
-
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
@@ -154,12 +154,12 @@ Index: build/node_modules/react-art/umd/react-art.development.js
*
@@ -20,9 +20,9 @@
var _assign = ReactInternals.assign;
-
+
// TODO: this is special because it gets imported during build.
-
+
-var ReactVersion = '16.6.1-canary-b3d1a81a9';
+var ReactVersion = '1.2.3';
-
+
/**
* Use invariant() to assert state which your program assumes to be true.
*
@@ -194,12 +194,12 @@ Index: build/node_modules/react-art/cjs/react-art.development.js
*
@@ -25,9 +25,9 @@
var FastNoSideEffects = require('art/modes/fast-noSideEffects');
-
+
// TODO: this is special because it gets imported during build.
-
+
-var ReactVersion = '16.6.1-canary-b3d1a81a9';
+var ReactVersion = '1.2.3';
-
+
/**
* Use invariant() to assert state which your program assumes to be true.
*
@@ -246,14 +246,14 @@ Index: build/node_modules/react-dom/umd/react-dom-server.browser.development.js
*
@@ -61,9 +61,9 @@
// preserve the format and params in the www builds.
-
+
// TODO: this is special because it gets imported during build.
-
+
-var ReactVersion = '16.6.1-canary-b3d1a81a9';
+var ReactVersion = '1.2.3';
-
+
var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
-
+
var _assign = ReactInternals.assign;
Index: build/node_modules/react-dom/umd/react-dom.production.min.js
===================================================================
@@ -327,12 +327,12 @@ Index: build/node_modules/react-dom/umd/react-dom.development.js
*
@@ -19471,9 +19471,9 @@
}
-
+
// TODO: this is special because it gets imported during build.
-
+
-var ReactVersion = '16.6.1-canary-b3d1a81a9';
+var ReactVersion = '1.2.3';
-
+
// TODO: This type is shared between the reconciler and ReactDOM, but will
// eventually be lifted out to the renderer.
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
@@ -407,12 +407,12 @@ Index: build/node_modules/react-dom/cjs/react-dom-server.browser.development.js
*
@@ -65,9 +65,9 @@
// preserve the format and params in the www builds.
-
+
// TODO: this is special because it gets imported during build.
-
+
-var ReactVersion = '16.6.1-canary-b3d1a81a9';
+var ReactVersion = '1.2.3';
-
+
/**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
@@ -467,12 +467,12 @@ Index: build/node_modules/react-dom/cjs/react-dom-server.node.development.js
*
@@ -21,9 +21,9 @@
var stream = require('stream');
-
+
// TODO: this is special because it gets imported during build.
-
+
-var ReactVersion = '16.6.1-canary-b3d1a81a9';
+var ReactVersion = '1.2.3';
-
+
/**
* Use invariant() to assert state which your program assumes to be true.
*
@@ -511,12 +511,12 @@ Index: build/node_modules/react-dom/cjs/react-dom.development.js
*
@@ -19347,9 +19347,9 @@
}
-
+
// TODO: this is special because it gets imported during build.
-
+
-var ReactVersion = '16.6.1-canary-b3d1a81a9';
+var ReactVersion = '1.2.3';
-
+
// TODO: This type is shared between the reconciler and ReactDOM, but will
// eventually be lifted out to the renderer.
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
@@ -694,14 +694,14 @@ Index: build/node_modules/react-test-renderer/umd/react-test-renderer.developmen
*
@@ -11622,9 +11622,9 @@
}
-
+
// TODO: this is special because it gets imported during build.
-
+
-var ReactVersion = '16.6.1-canary-b3d1a81a9';
+var ReactVersion = '1.2.3';
-
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
Index: build/node_modules/react-test-renderer/umd/react-test-renderer.production.min.js
===================================================================
@@ -717,8 +717,8 @@ Index: build/node_modules/react-test-renderer/umd/react-test-renderer.production
@@ -117,5 +117,5 @@
!0===b.unstable_isConcurrent&&(d=!0));var e={children:[],createNodeMock:c,tag:"CONTAINER"},g=Gd(e,d,!1);null==g?n("215"):void 0;ac(a,g,null,null);a={root:void 0,toJSON:function(){if(null==g||null==g.current||null==e||0===e.children.length)return null;if(1===e.children.length)return bc(e.children[0]);var a=null;if(e.children&&e.children.length)for(var b=0;b