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 packages/react-dom/src/__tests__/ReactDOM-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ describe('ReactDOM', () => {
global.requestAnimationFrame = undefined;
jest.resetModules();
expect(() => require('react-dom')).toWarnDev(
'React depends on requestAnimationFrame.',
"This browser doesn't support requestAnimationFrame.",
);
} finally {
global.requestAnimationFrame = previousRAF;
Expand Down
38 changes: 16 additions & 22 deletions packages/react-scheduler/src/ReactScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,24 @@ type CallbackConfigType = {|

export type CallbackIdType = CallbackConfigType;

import requestAnimationFrameForReact from 'shared/requestAnimationFrameForReact';
import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment';
import invariant from 'fbjs/lib/invariant';
import warning from 'fbjs/lib/warning';

if (__DEV__) {
if (
ExecutionEnvironment.canUseDOM &&
typeof requestAnimationFrame !== 'function'
) {
warning(
false,
// TODO: reword this when schedule is a stand-alone module
"This browser doesn't support requestAnimationFrame. " +
'Make sure that you load a ' +
'polyfill in older browsers. https://fb.me/react-polyfills',
);
}
}

// We capture a local reference to any global, in case it gets polyfilled after
// this module is initially evaluated.
// We want to be using a consistent implementation.
Expand Down Expand Up @@ -106,26 +119,7 @@ if (!ExecutionEnvironment.canUseDOM) {
localClearTimeout(timeoutId);
};
} else {
if (__DEV__) {
if (typeof requestAnimationFrameForReact !== 'function') {
warning(
false,
'React depends on requestAnimationFrame. Make sure that you load a ' +
'polyfill in older browsers. https://fb.me/react-polyfills',
);
}
}

let localRequestAnimationFrame =
typeof requestAnimationFrameForReact === 'function'
? requestAnimationFrameForReact
: function(callback: Function) {
invariant(
false,
'React depends on requestAnimationFrame. Make sure that you load a ' +
'polyfill in older browsers. https://fb.me/react-polyfills',
);
};
const localRequestAnimationFrame = requestAnimationFrame;

let headOfPendingCallbacksLinkedList: CallbackConfigType | null = null;
let tailOfPendingCallbacksLinkedList: CallbackConfigType | null = null;
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/__tests__/ReactDOMFrameScheduling-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('ReactDOMFrameScheduling', () => {
global.requestAnimationFrame = undefined;
jest.resetModules();
expect(() => require('react-dom')).toWarnDev(
'React depends on requestAnimationFrame.',
"This browser doesn't support requestAnimationFrame.",
);
} finally {
global.requestAnimationFrame = previousRAF;
Expand Down
10 changes: 0 additions & 10 deletions packages/shared/forks/requestAnimationFrameForReact.www.js

This file was deleted.

24 changes: 0 additions & 24 deletions packages/shared/requestAnimationFrameForReact.js

This file was deleted.

12 changes: 0 additions & 12 deletions scripts/rollup/forks.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,6 @@ const forks = Object.freeze({
return null;
},

// This logic is forked on www to use the 'acrossTransitions' version.
// This will be removed soon, see internal task T29442940
'shared/requestAnimationFrameForReact': (bundleType, entry) => {
switch (bundleType) {
case FB_WWW_DEV:
case FB_WWW_PROD:
return 'shared/forks/requestAnimationFrameForReact.www.js';
default:
return null;
}
},

'shared/ReactScheduler': (bundleType, entry) => {
switch (bundleType) {
case FB_WWW_DEV:
Expand Down