GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Decrease expiration time of input updates (#19772) · react/react@708fa77

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-reconciler/src
    • ReactFiberLane.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-reconciler/src/ReactFiberLane.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberLane.js
+15-1Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,21 @@ function computeExpirationTime(lane: Lane, currentTime: number) {
384384
const priority = return_highestLanePriority;
385385
if (priority >= InputContinuousLanePriority) {
386386
// User interactions should expire slightly more quickly.
387-
return currentTime + 1000;
387+
//
388+
// NOTE: This is set to the corresponding constant as in Scheduler.js. When
389+
// we made it larger, a product metric in www regressed, suggesting there's
390+
// a user interaction that's being starved by a series of synchronous
391+
// updates. If that theory is correct, the proper solution is to fix the
392+
// starvation. However, this scenario supports the idea that expiration
393+
// times are an important safeguard when starvation does happen.
394+
//
395+
// Also note that, in the case of user input specifically, this will soon no
396+
// longer be an issue because we plan to make user input synchronous by
397+
// default (until you enter `startTransition`, of course.)
398+
//
399+
// If weren't planning to make these updates synchronous soon anyway, I
400+
// would probably make this number a configurable parameter.
401+
return currentTime + 250;
388402
} else if (priority >= TransitionPriority) {
389403
return currentTime + 5000;
390404
} else {

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.