Skip to content

Commit

Permalink
ReactNoop.yield -> Scheduler.yieldValue (#15008)
Browse files Browse the repository at this point in the history
These used to be different things, but now ReactNoop.yield merely
re-exports Scheduler.yieldValue, so let's get rid of it.
  • Loading branch information
acdlite authored Mar 4, 2019
1 parent 9d756d9 commit 757a70b
Show file tree
Hide file tree
Showing 19 changed files with 359 additions and 361 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('createSubscription', () => {
ReactNoop.render(
<Subscription source={observable}>
{(value = 'default') => {
ReactNoop.yield(value);
Scheduler.yieldValue(value);
return null;
}}
</Subscription>,
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('createSubscription', () => {
});

function render(value = 'default') {
ReactNoop.yield(value);
Scheduler.yieldValue(value);
return null;
}

Expand Down Expand Up @@ -126,9 +126,9 @@ describe('createSubscription', () => {

function render(hasLoaded) {
if (hasLoaded === undefined) {
ReactNoop.yield('loading');
Scheduler.yieldValue('loading');
} else {
ReactNoop.yield(hasLoaded ? 'finished' : 'failed');
Scheduler.yieldValue(hasLoaded ? 'finished' : 'failed');
}
return null;
}
Expand Down Expand Up @@ -169,7 +169,7 @@ describe('createSubscription', () => {
});

function render(value = 'default') {
ReactNoop.yield(value);
Scheduler.yieldValue(value);
return null;
}

Expand Down Expand Up @@ -203,7 +203,7 @@ describe('createSubscription', () => {
});

function render(hasLoaded) {
ReactNoop.yield('rendered');
Scheduler.yieldValue('rendered');
return null;
}

Expand Down Expand Up @@ -235,7 +235,7 @@ describe('createSubscription', () => {
});

function render(value = 'default') {
ReactNoop.yield(value);
Scheduler.yieldValue(value);
return null;
}

Expand Down Expand Up @@ -268,7 +268,7 @@ describe('createSubscription', () => {
const log = [];

function Child({value}) {
ReactNoop.yield('Child: ' + value);
Scheduler.yieldValue('Child: ' + value);
return null;
}

Expand Down Expand Up @@ -305,7 +305,7 @@ describe('createSubscription', () => {
return (
<Subscription source={this.state.observed}>
{(value = 'default') => {
ReactNoop.yield('Subscriber: ' + value);
Scheduler.yieldValue('Subscriber: ' + value);
return <Child value={value} />;
}}
</Subscription>
Expand Down Expand Up @@ -355,7 +355,7 @@ describe('createSubscription', () => {
const log = [];

function Child({value}) {
ReactNoop.yield('Child: ' + value);
Scheduler.yieldValue('Child: ' + value);
return null;
}

Expand Down Expand Up @@ -392,7 +392,7 @@ describe('createSubscription', () => {
return (
<Subscription source={this.state.observed}>
{(value = 'default') => {
ReactNoop.yield('Subscriber: ' + value);
Scheduler.yieldValue('Subscriber: ' + value);
return <Child value={value} />;
}}
</Subscription>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-art/src/__tests__/ReactART-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ describe('ReactART', () => {
const CurrentRendererContext = React.createContext(null);

function Yield(props) {
ReactNoop.yield(props.value);
Scheduler.yieldValue(props.value);
return null;
}

Expand Down
2 changes: 0 additions & 2 deletions packages/react-noop-renderer/src/createReactNoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,6 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
return Scheduler.unstable_flushExpired();
},

yield: Scheduler.yieldValue,

batchedUpdates: NoopRenderer.batchedUpdates,

deferredUpdates: NoopRenderer.deferredUpdates,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ describe('ReactExpiration', () => {
it('two updates of like priority in the same event always flush within the same batch', () => {
class Text extends React.Component {
componentDidMount() {
ReactNoop.yield(`${this.props.text} [commit]`);
Scheduler.yieldValue(`${this.props.text} [commit]`);
}
componentDidUpdate() {
ReactNoop.yield(`${this.props.text} [commit]`);
Scheduler.yieldValue(`${this.props.text} [commit]`);
}
render() {
ReactNoop.yield(`${this.props.text} [render]`);
Scheduler.yieldValue(`${this.props.text} [render]`);
return <span prop={this.props.text} />;
}
}
Expand Down Expand Up @@ -116,13 +116,13 @@ describe('ReactExpiration', () => {
() => {
class Text extends React.Component {
componentDidMount() {
ReactNoop.yield(`${this.props.text} [commit]`);
Scheduler.yieldValue(`${this.props.text} [commit]`);
}
componentDidUpdate() {
ReactNoop.yield(`${this.props.text} [commit]`);
Scheduler.yieldValue(`${this.props.text} [commit]`);
}
render() {
ReactNoop.yield(`${this.props.text} [render]`);
Scheduler.yieldValue(`${this.props.text} [render]`);
return <span prop={this.props.text} />;
}
}
Expand Down Expand Up @@ -188,13 +188,13 @@ describe('ReactExpiration', () => {
state = {text: store.text};
componentDidMount() {
subscribers.push(this);
ReactNoop.yield(`${this.state.text} [${this.props.label}] [commit]`);
Scheduler.yieldValue(`${this.state.text} [${this.props.label}] [commit]`);
}
componentDidUpdate() {
ReactNoop.yield(`${this.state.text} [${this.props.label}] [commit]`);
Scheduler.yieldValue(`${this.state.text} [${this.props.label}] [commit]`);
}
render() {
ReactNoop.yield(`${this.state.text} [${this.props.label}] [render]`);
Scheduler.yieldValue(`${this.state.text} [${this.props.label}] [render]`);
return <span prop={this.state.text} />;
}
}
Expand Down
Loading

0 comments on commit 757a70b

Please sign in to comment.