@@ -55,14 +55,18 @@ import {
55
55
DefaultLanePriority as DefaultLanePriority_old ,
56
56
getCurrentUpdateLanePriority as getCurrentUpdateLanePriority_old ,
57
57
setCurrentUpdateLanePriority as setCurrentUpdateLanePriority_old ,
58
+ schedulerPriorityToLanePriority as schedulerPriorityToLanePriority_old ,
58
59
} from 'react-reconciler/src/ReactFiberLane.old' ;
59
60
import {
60
61
InputDiscreteLanePriority as InputDiscreteLanePriority_new ,
61
62
InputContinuousLanePriority as InputContinuousLanePriority_new ,
62
63
DefaultLanePriority as DefaultLanePriority_new ,
63
64
getCurrentUpdateLanePriority as getCurrentUpdateLanePriority_new ,
64
65
setCurrentUpdateLanePriority as setCurrentUpdateLanePriority_new ,
66
+ schedulerPriorityToLanePriority as schedulerPriorityToLanePriority_new ,
65
67
} from 'react-reconciler/src/ReactFiberLane.new' ;
68
+ import { getCurrentPriorityLevel as getCurrentPriorityLevel_old } from 'react-reconciler/src/SchedulerWithReactIntegration.old' ;
69
+ import { getCurrentPriorityLevel as getCurrentPriorityLevel_new } from 'react-reconciler/src/SchedulerWithReactIntegration.new' ;
66
70
67
71
const InputDiscreteLanePriority = enableNewReconciler
68
72
? InputDiscreteLanePriority_new
@@ -79,6 +83,12 @@ const getCurrentUpdateLanePriority = enableNewReconciler
79
83
const setCurrentUpdateLanePriority = enableNewReconciler
80
84
? setCurrentUpdateLanePriority_new
81
85
: setCurrentUpdateLanePriority_old ;
86
+ const schedulerPriorityToLanePriority = enableNewReconciler
87
+ ? schedulerPriorityToLanePriority_new
88
+ : schedulerPriorityToLanePriority_old ;
89
+ const getCurrentPriorityLevel = enableNewReconciler
90
+ ? getCurrentPriorityLevel_new
91
+ : getCurrentPriorityLevel_old ;
82
92
83
93
const {
84
94
unstable_UserBlockingPriority : UserBlockingPriority ,
@@ -428,6 +438,15 @@ export function getEventPriority(domEventName: DOMEventName): * {
428
438
case 'mouseenter' :
429
439
case 'mouseleave' :
430
440
return InputContinuousLanePriority ;
441
+ case 'message' : {
442
+ // We might be in the Scheduler callback.
443
+ // Eventually this mechanism will be replaced by a check
444
+ // of the current priority on the native scheduler.
445
+ const schedulerPriority = getCurrentPriorityLevel ( ) ;
446
+ // TODO: Inline schedulerPriorityToLanePriority into this file
447
+ // when we delete the enableNativeEventPriorityInference flag.
448
+ return schedulerPriorityToLanePriority ( schedulerPriority ) ;
449
+ }
431
450
default :
432
451
return DefaultLanePriority ;
433
452
}
0 commit comments