mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 00:20:28 +01:00
* Merged interaction-tracking package into react-scheduler * Add tracking API to FB+www builds * Added Rollup plugin to strip no-side-effect imports from Rollup bundles * Re-bundle tracking and scheduling APIs on SECRET_INTERNALS object for UMD build (and provide lazy forwarding methods) * Added some additional tests and fixtures * Fixed broken UMD fixture in master (#13512)
30 lines
725 B
JavaScript
30 lines
725 B
JavaScript
/* eslint-disable */
|
|
|
|
const NODE_ENV = process.env.NODE_ENV;
|
|
if (NODE_ENV !== 'development' && NODE_ENV !== 'production') {
|
|
throw new Error('NODE_ENV must either be set to development or production.');
|
|
}
|
|
global.__DEV__ = NODE_ENV === 'development';
|
|
global.__PROFILE__ = NODE_ENV === 'development';
|
|
global.__UMD__ = false;
|
|
|
|
if (typeof window !== 'undefined') {
|
|
global.requestAnimationFrame = function(callback) {
|
|
setTimeout(callback);
|
|
};
|
|
|
|
global.requestIdleCallback = function(callback) {
|
|
return setTimeout(() => {
|
|
callback({
|
|
timeRemaining() {
|
|
return Infinity;
|
|
},
|
|
});
|
|
});
|
|
};
|
|
|
|
global.cancelIdleCallback = function(callbackID) {
|
|
clearTimeout(callbackID);
|
|
};
|
|
}
|