Skip to content

Commit

Permalink
Revert "Revert "[Scheduler] Profiling features (facebook#16145)" (fac…
Browse files Browse the repository at this point in the history
…ebook#16392)"

This reverts commit 4ba1412.
  • Loading branch information
gaearon committed Aug 15, 2019
1 parent 868d02d commit 9a3b427
Show file tree
Hide file tree
Showing 18 changed files with 919 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ module.exports = {
],

globals: {
SharedArrayBuffer: true,

spyOnDev: true,
spyOnDevAndProd: true,
spyOnProd: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ describe('ReactDebugFiberPerf', () => {
require('shared/ReactFeatureFlags').enableProfilerTimer = false;
require('shared/ReactFeatureFlags').replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
require('shared/ReactFeatureFlags').debugRenderPhaseSideEffectsForStrictMode = false;
require('scheduler/src/SchedulerFeatureFlags').enableProfiling = false;

// Import after the polyfill is set up:
React = require('react');
Expand Down
20 changes: 20 additions & 0 deletions packages/scheduler/npm/umd/scheduler.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@
);
}

function unstable_startLoggingProfilingEvents() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_startLoggingProfilingEvents.apply(
this,
arguments
);
}

function unstable_stopLoggingProfilingEvents() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_stopLoggingProfilingEvents.apply(
this,
arguments
);
}

return Object.freeze({
unstable_now: unstable_now,
unstable_scheduleCallback: unstable_scheduleCallback,
Expand All @@ -124,6 +138,8 @@
unstable_pauseExecution: unstable_pauseExecution,
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
unstable_forceFrameRate: unstable_forceFrameRate,
unstable_startLoggingProfilingEvents: unstable_startLoggingProfilingEvents,
unstable_stopLoggingProfilingEvents: unstable_stopLoggingProfilingEvents,
get unstable_IdlePriority() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.Scheduler.unstable_IdlePriority;
Expand All @@ -144,5 +160,9 @@
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.Scheduler.unstable_UserBlockingPriority;
},
get unstable_sharedProfilingBuffer() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.Scheduler.unstable_getFirstCallbackNode;
},
});
});
20 changes: 20 additions & 0 deletions packages/scheduler/npm/umd/scheduler.production.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@
);
}

function unstable_startLoggingProfilingEvents() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_startLoggingProfilingEvents.apply(
this,
arguments
);
}

function unstable_stopLoggingProfilingEvents() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_stopLoggingProfilingEvents.apply(
this,
arguments
);
}

return Object.freeze({
unstable_now: unstable_now,
unstable_scheduleCallback: unstable_scheduleCallback,
Expand All @@ -118,6 +132,8 @@
unstable_pauseExecution: unstable_pauseExecution,
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
unstable_forceFrameRate: unstable_forceFrameRate,
unstable_startLoggingProfilingEvents: unstable_startLoggingProfilingEvents,
unstable_stopLoggingProfilingEvents: unstable_stopLoggingProfilingEvents,
get unstable_IdlePriority() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.Scheduler.unstable_IdlePriority;
Expand All @@ -138,5 +154,9 @@
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.Scheduler.unstable_UserBlockingPriority;
},
get unstable_sharedProfilingBuffer() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.Scheduler.unstable_getFirstCallbackNode;
},
});
});
20 changes: 20 additions & 0 deletions packages/scheduler/npm/umd/scheduler.profiling.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@
);
}

function unstable_startLoggingProfilingEvents() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_startLoggingProfilingEvents.apply(
this,
arguments
);
}

function unstable_stopLoggingProfilingEvents() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_stopLoggingProfilingEvents.apply(
this,
arguments
);
}

return Object.freeze({
unstable_now: unstable_now,
unstable_scheduleCallback: unstable_scheduleCallback,
Expand All @@ -118,6 +132,8 @@
unstable_pauseExecution: unstable_pauseExecution,
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
unstable_forceFrameRate: unstable_forceFrameRate,
unstable_startLoggingProfilingEvents: unstable_startLoggingProfilingEvents,
unstable_stopLoggingProfilingEvents: unstable_stopLoggingProfilingEvents,
get unstable_IdlePriority() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.Scheduler.unstable_IdlePriority;
Expand All @@ -138,5 +154,9 @@
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.Scheduler.unstable_UserBlockingPriority;
},
get unstable_sharedProfilingBuffer() {
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.Scheduler.unstable_getFirstCallbackNode;
},
});
});
Loading

0 comments on commit 9a3b427

Please sign in to comment.