Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ function Img({src: maybeSrc, onLoad, useImageLoader, ref}) {

function Yield() {
Scheduler.log('Yield');
Scheduler.unstable_requestPaint();
return null;
}

Expand Down Expand Up @@ -250,7 +249,6 @@ describe('ReactDOMImageLoad', () => {
'load triggered',
'last layout',
]);
Scheduler.unstable_requestPaint();
const img = last(images);
loadImage(img);
assertLog(['actualLoadSpy [default]', 'onLoadSpy [default]']);
Expand Down
5 changes: 0 additions & 5 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {
// Aliased because `act` will override and push to an internal queue
scheduleCallback as Scheduler_scheduleCallback,
shouldYield,
requestPaint,
now,
NormalPriority as NormalSchedulerPriority,
IdlePriority as IdleSchedulerPriority,
Expand Down Expand Up @@ -3428,10 +3427,6 @@ function commitRootImpl(
markLayoutEffectsStopped();
}

// Tell Scheduler to yield at the end of the frame, so the browser has an
// opportunity to paint.
requestPaint();

executionContext = prevExecutionContext;

// Reset the priority to the previous non-sync value.
Expand Down
1 change: 0 additions & 1 deletion packages/react-reconciler/src/Scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import * as Scheduler from 'scheduler';
export const scheduleCallback = Scheduler.unstable_scheduleCallback;
export const cancelCallback = Scheduler.unstable_cancelCallback;
export const shouldYield = Scheduler.unstable_shouldYield;
export const requestPaint = Scheduler.unstable_requestPaint;
export const now = Scheduler.unstable_now;
export const getCurrentPriorityLevel =
Scheduler.unstable_getCurrentPriorityLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ describe(
// This triggers a once-upon-a-time bug in Scheduler that caused
// `shouldYield` to return true even though the current task expired.
Scheduler.unstable_advanceTime(10000);
Scheduler.unstable_requestPaint();
return null;
}

Expand Down
4 changes: 0 additions & 4 deletions packages/scheduler/src/__tests__/Scheduler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ let runtime;
let performance;
let cancelCallback;
let scheduleCallback;
let requestPaint;
let shouldYield;
let NormalPriority;

Expand All @@ -40,7 +39,6 @@ describe('SchedulerBrowser', () => {
cancelCallback = Scheduler.unstable_cancelCallback;
scheduleCallback = Scheduler.unstable_scheduleCallback;
NormalPriority = Scheduler.unstable_NormalPriority;
requestPaint = Scheduler.unstable_requestPaint;
shouldYield = Scheduler.unstable_shouldYield;
});

Expand Down Expand Up @@ -183,8 +181,6 @@ describe('SchedulerBrowser', () => {
it('task with continuation', () => {
scheduleCallback(NormalPriority, () => {
runtime.log('Task');
// Request paint so that we yield at the end of the frame interval
requestPaint();
while (!Scheduler.unstable_shouldYield()) {
runtime.advanceTime(1);
}
Expand Down
3 changes: 0 additions & 3 deletions packages/scheduler/src/forks/Scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ function shouldYieldToHost(): boolean {
return true;
}

function requestPaint() {}

function forceFrameRate(fps: number) {
if (fps < 0 || fps > 125) {
// Using console['error'] to evade Babel and ESLint
Expand Down Expand Up @@ -582,7 +580,6 @@ export {
unstable_wrapCallback,
unstable_getCurrentPriorityLevel,
shouldYieldToHost as unstable_shouldYield,
requestPaint as unstable_requestPaint,
unstable_continueExecution,
unstable_pauseExecution,
unstable_getFirstCallbackNode,
Expand Down
5 changes: 0 additions & 5 deletions packages/scheduler/src/forks/SchedulerMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,10 +661,6 @@ function unstable_advanceTime(ms: number) {
}
}

function requestPaint() {
needsPaint = true;
}

export {
ImmediatePriority as unstable_ImmediatePriority,
UserBlockingPriority as unstable_UserBlockingPriority,
Expand All @@ -678,7 +674,6 @@ export {
unstable_wrapCallback,
unstable_getCurrentPriorityLevel,
shouldYieldToHost as unstable_shouldYield,
requestPaint as unstable_requestPaint,
unstable_continueExecution,
unstable_pauseExecution,
unstable_getFirstCallbackNode,
Expand Down
6 changes: 0 additions & 6 deletions packages/scheduler/src/forks/SchedulerNative.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type NativeSchedulerType = {
unstable_cancelCallback: (task: Task) => void,
unstable_getCurrentPriorityLevel: () => PriorityLevel,
unstable_shouldYield: () => boolean,
unstable_requestPaint: () => void,
unstable_now: () => DOMHighResTimeStamp,
};

Expand Down Expand Up @@ -82,11 +81,6 @@ export const unstable_shouldYield: () => boolean =
? nativeRuntimeScheduler.unstable_shouldYield
: Scheduler.unstable_shouldYield;

export const unstable_requestPaint: () => void =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_requestPaint
: Scheduler.unstable_requestPaint;

export const unstable_now: () => number | DOMHighResTimeStamp =
typeof nativeRuntimeScheduler !== 'undefined'
? nativeRuntimeScheduler.unstable_now
Expand Down
4 changes: 0 additions & 4 deletions packages/scheduler/src/forks/SchedulerPostTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ export function unstable_shouldYield(): boolean {
return getCurrentTime() >= deadline;
}

export function unstable_requestPaint() {
// Since we yield every frame regardless, `requestPaint` has no effect.
}

type SchedulerCallback<T> = (didTimeout_DEPRECATED: boolean) =>
| T
// May return a continuation
Expand Down
Loading