Skip to content

Commit 3ff6cd6

Browse files
committed
Revert "Revert "[Scheduler] Profiling features (facebook#16145)" (facebook#16392)"
This reverts commit 4ba1412.
1 parent 8a01b50 commit 3ff6cd6

18 files changed

Lines changed: 919 additions & 35 deletions

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ module.exports = {
142142
],
143143

144144
globals: {
145+
SharedArrayBuffer: true,
146+
145147
spyOnDev: true,
146148
spyOnDevAndProd: true,
147149
spyOnProd: true,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ describe('ReactDebugFiberPerf', () => {
136136
require('shared/ReactFeatureFlags').enableProfilerTimer = false;
137137
require('shared/ReactFeatureFlags').replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
138138
require('shared/ReactFeatureFlags').debugRenderPhaseSideEffectsForStrictMode = false;
139+
require('scheduler/src/SchedulerFeatureFlags').enableProfiling = false;
139140

140141
// Import after the polyfill is set up:
141142
React = require('react');

packages/scheduler/npm/umd/scheduler.development.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,20 @@
110110
);
111111
}
112112

113+
function unstable_startLoggingProfilingEvents() {
114+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_startLoggingProfilingEvents.apply(
115+
this,
116+
arguments
117+
);
118+
}
119+
120+
function unstable_stopLoggingProfilingEvents() {
121+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_stopLoggingProfilingEvents.apply(
122+
this,
123+
arguments
124+
);
125+
}
126+
113127
return Object.freeze({
114128
unstable_now: unstable_now,
115129
unstable_scheduleCallback: unstable_scheduleCallback,
@@ -124,6 +138,8 @@
124138
unstable_pauseExecution: unstable_pauseExecution,
125139
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
126140
unstable_forceFrameRate: unstable_forceFrameRate,
141+
unstable_startLoggingProfilingEvents: unstable_startLoggingProfilingEvents,
142+
unstable_stopLoggingProfilingEvents: unstable_stopLoggingProfilingEvents,
127143
get unstable_IdlePriority() {
128144
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
129145
.Scheduler.unstable_IdlePriority;
@@ -144,5 +160,9 @@
144160
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
145161
.Scheduler.unstable_UserBlockingPriority;
146162
},
163+
get unstable_sharedProfilingBuffer() {
164+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
165+
.Scheduler.unstable_getFirstCallbackNode;
166+
},
147167
});
148168
});

packages/scheduler/npm/umd/scheduler.production.min.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@
104104
);
105105
}
106106

107+
function unstable_startLoggingProfilingEvents() {
108+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_startLoggingProfilingEvents.apply(
109+
this,
110+
arguments
111+
);
112+
}
113+
114+
function unstable_stopLoggingProfilingEvents() {
115+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_stopLoggingProfilingEvents.apply(
116+
this,
117+
arguments
118+
);
119+
}
120+
107121
return Object.freeze({
108122
unstable_now: unstable_now,
109123
unstable_scheduleCallback: unstable_scheduleCallback,
@@ -118,6 +132,8 @@
118132
unstable_pauseExecution: unstable_pauseExecution,
119133
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
120134
unstable_forceFrameRate: unstable_forceFrameRate,
135+
unstable_startLoggingProfilingEvents: unstable_startLoggingProfilingEvents,
136+
unstable_stopLoggingProfilingEvents: unstable_stopLoggingProfilingEvents,
121137
get unstable_IdlePriority() {
122138
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
123139
.Scheduler.unstable_IdlePriority;
@@ -138,5 +154,9 @@
138154
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
139155
.Scheduler.unstable_UserBlockingPriority;
140156
},
157+
get unstable_sharedProfilingBuffer() {
158+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
159+
.Scheduler.unstable_getFirstCallbackNode;
160+
},
141161
});
142162
});

packages/scheduler/npm/umd/scheduler.profiling.min.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,20 @@
104104
);
105105
}
106106

107+
function unstable_startLoggingProfilingEvents() {
108+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_startLoggingProfilingEvents.apply(
109+
this,
110+
arguments
111+
);
112+
}
113+
114+
function unstable_stopLoggingProfilingEvents() {
115+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_stopLoggingProfilingEvents.apply(
116+
this,
117+
arguments
118+
);
119+
}
120+
107121
return Object.freeze({
108122
unstable_now: unstable_now,
109123
unstable_scheduleCallback: unstable_scheduleCallback,
@@ -118,6 +132,8 @@
118132
unstable_pauseExecution: unstable_pauseExecution,
119133
unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
120134
unstable_forceFrameRate: unstable_forceFrameRate,
135+
unstable_startLoggingProfilingEvents: unstable_startLoggingProfilingEvents,
136+
unstable_stopLoggingProfilingEvents: unstable_stopLoggingProfilingEvents,
121137
get unstable_IdlePriority() {
122138
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
123139
.Scheduler.unstable_IdlePriority;
@@ -138,5 +154,9 @@
138154
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
139155
.Scheduler.unstable_UserBlockingPriority;
140156
},
157+
get unstable_sharedProfilingBuffer() {
158+
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
159+
.Scheduler.unstable_getFirstCallbackNode;
160+
},
141161
});
142162
});

0 commit comments

Comments
 (0)