Skip to content

Commit 757a70b

Browse files
authored
ReactNoop.yield -> Scheduler.yieldValue (#15008)
These used to be different things, but now ReactNoop.yield merely re-exports Scheduler.yieldValue, so let's get rid of it.
1 parent 9d756d9 commit 757a70b

19 files changed

+359
-361
lines changed

packages/create-subscription/src/__tests__/createSubscription-test.internal.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('createSubscription', () => {
6060
ReactNoop.render(
6161
<Subscription source={observable}>
6262
{(value = 'default') => {
63-
ReactNoop.yield(value);
63+
Scheduler.yieldValue(value);
6464
return null;
6565
}}
6666
</Subscription>,
@@ -97,7 +97,7 @@ describe('createSubscription', () => {
9797
});
9898

9999
function render(value = 'default') {
100-
ReactNoop.yield(value);
100+
Scheduler.yieldValue(value);
101101
return null;
102102
}
103103

@@ -126,9 +126,9 @@ describe('createSubscription', () => {
126126

127127
function render(hasLoaded) {
128128
if (hasLoaded === undefined) {
129-
ReactNoop.yield('loading');
129+
Scheduler.yieldValue('loading');
130130
} else {
131-
ReactNoop.yield(hasLoaded ? 'finished' : 'failed');
131+
Scheduler.yieldValue(hasLoaded ? 'finished' : 'failed');
132132
}
133133
return null;
134134
}
@@ -169,7 +169,7 @@ describe('createSubscription', () => {
169169
});
170170

171171
function render(value = 'default') {
172-
ReactNoop.yield(value);
172+
Scheduler.yieldValue(value);
173173
return null;
174174
}
175175

@@ -203,7 +203,7 @@ describe('createSubscription', () => {
203203
});
204204

205205
function render(hasLoaded) {
206-
ReactNoop.yield('rendered');
206+
Scheduler.yieldValue('rendered');
207207
return null;
208208
}
209209

@@ -235,7 +235,7 @@ describe('createSubscription', () => {
235235
});
236236

237237
function render(value = 'default') {
238-
ReactNoop.yield(value);
238+
Scheduler.yieldValue(value);
239239
return null;
240240
}
241241

@@ -268,7 +268,7 @@ describe('createSubscription', () => {
268268
const log = [];
269269

270270
function Child({value}) {
271-
ReactNoop.yield('Child: ' + value);
271+
Scheduler.yieldValue('Child: ' + value);
272272
return null;
273273
}
274274

@@ -305,7 +305,7 @@ describe('createSubscription', () => {
305305
return (
306306
<Subscription source={this.state.observed}>
307307
{(value = 'default') => {
308-
ReactNoop.yield('Subscriber: ' + value);
308+
Scheduler.yieldValue('Subscriber: ' + value);
309309
return <Child value={value} />;
310310
}}
311311
</Subscription>
@@ -355,7 +355,7 @@ describe('createSubscription', () => {
355355
const log = [];
356356

357357
function Child({value}) {
358-
ReactNoop.yield('Child: ' + value);
358+
Scheduler.yieldValue('Child: ' + value);
359359
return null;
360360
}
361361

@@ -392,7 +392,7 @@ describe('createSubscription', () => {
392392
return (
393393
<Subscription source={this.state.observed}>
394394
{(value = 'default') => {
395-
ReactNoop.yield('Subscriber: ' + value);
395+
Scheduler.yieldValue('Subscriber: ' + value);
396396
return <Child value={value} />;
397397
}}
398398
</Subscription>

packages/react-art/src/__tests__/ReactART-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ describe('ReactART', () => {
359359
const CurrentRendererContext = React.createContext(null);
360360

361361
function Yield(props) {
362-
ReactNoop.yield(props.value);
362+
Scheduler.yieldValue(props.value);
363363
return null;
364364
}
365365

packages/react-noop-renderer/src/createReactNoop.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,6 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
696696
return Scheduler.unstable_flushExpired();
697697
},
698698

699-
yield: Scheduler.yieldValue,
700-
701699
batchedUpdates: NoopRenderer.batchedUpdates,
702700

703701
deferredUpdates: NoopRenderer.deferredUpdates,

packages/react-reconciler/src/__tests__/ReactExpiration-test.internal.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ describe('ReactExpiration', () => {
5151
it('two updates of like priority in the same event always flush within the same batch', () => {
5252
class Text extends React.Component {
5353
componentDidMount() {
54-
ReactNoop.yield(`${this.props.text} [commit]`);
54+
Scheduler.yieldValue(`${this.props.text} [commit]`);
5555
}
5656
componentDidUpdate() {
57-
ReactNoop.yield(`${this.props.text} [commit]`);
57+
Scheduler.yieldValue(`${this.props.text} [commit]`);
5858
}
5959
render() {
60-
ReactNoop.yield(`${this.props.text} [render]`);
60+
Scheduler.yieldValue(`${this.props.text} [render]`);
6161
return <span prop={this.props.text} />;
6262
}
6363
}
@@ -116,13 +116,13 @@ describe('ReactExpiration', () => {
116116
() => {
117117
class Text extends React.Component {
118118
componentDidMount() {
119-
ReactNoop.yield(`${this.props.text} [commit]`);
119+
Scheduler.yieldValue(`${this.props.text} [commit]`);
120120
}
121121
componentDidUpdate() {
122-
ReactNoop.yield(`${this.props.text} [commit]`);
122+
Scheduler.yieldValue(`${this.props.text} [commit]`);
123123
}
124124
render() {
125-
ReactNoop.yield(`${this.props.text} [render]`);
125+
Scheduler.yieldValue(`${this.props.text} [render]`);
126126
return <span prop={this.props.text} />;
127127
}
128128
}
@@ -188,13 +188,13 @@ describe('ReactExpiration', () => {
188188
state = {text: store.text};
189189
componentDidMount() {
190190
subscribers.push(this);
191-
ReactNoop.yield(`${this.state.text} [${this.props.label}] [commit]`);
191+
Scheduler.yieldValue(`${this.state.text} [${this.props.label}] [commit]`);
192192
}
193193
componentDidUpdate() {
194-
ReactNoop.yield(`${this.state.text} [${this.props.label}] [commit]`);
194+
Scheduler.yieldValue(`${this.state.text} [${this.props.label}] [commit]`);
195195
}
196196
render() {
197-
ReactNoop.yield(`${this.state.text} [${this.props.label}] [render]`);
197+
Scheduler.yieldValue(`${this.state.text} [${this.props.label}] [render]`);
198198
return <span prop={this.state.text} />;
199199
}
200200
}

0 commit comments

Comments
 (0)