File tree Expand file tree Collapse file tree 3 files changed +14
-27
lines changed
react-dom-bindings/src/client Expand file tree Collapse file tree 3 files changed +14
-27
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,24 @@ import {
16
16
} from 'react-reconciler/src/ReactEventPriorities' ;
17
17
18
18
import ReactDOMSharedInternals from 'shared/ReactDOMSharedInternals' ;
19
- const ReactDOMCurrentUpdatePriority =
20
- ReactDOMSharedInternals . ReactDOMCurrentUpdatePriority ;
21
19
22
- export function setCurrentUpdatePriority ( newPriority : EventPriority ) : void {
23
- ReactDOMCurrentUpdatePriority . current = newPriority ;
20
+ export function setCurrentUpdatePriority (
21
+ newPriority : EventPriority ,
22
+ // Closure will consistently not inline this function when it has arity 1
23
+ // however when it has arity 2 even if the second arg is omitted at every
24
+ // callsite it seems to inline it even when the internal length of the function
25
+ // is much longer. I hope this is consistent enough to rely on across builds
26
+ IntentionallyUnusedArgument ?: empty ,
27
+ ) : void {
28
+ ReactDOMSharedInternals . up = newPriority ;
24
29
}
25
30
26
31
export function getCurrentUpdatePriority ( ) : EventPriority {
27
- return ReactDOMCurrentUpdatePriority . current ;
32
+ return ReactDOMSharedInternals . up ;
28
33
}
29
34
30
35
export function resolveUpdatePriority ( ) : EventPriority {
31
- const updatePriority = ReactDOMCurrentUpdatePriority . current ;
36
+ const updatePriority = ReactDOMSharedInternals . up ;
32
37
if ( updatePriority !== NoEventPriority ) {
33
38
return updatePriority ;
34
39
}
Original file line number Diff line number Diff line change @@ -23,9 +23,7 @@ type InternalsType = {
23
23
| ( (
24
24
componentOrElement : React$Component < any , any > ,
25
25
) => null | Element | Text ) ,
26
- ReactDOMCurrentUpdatePriority : {
27
- current : EventPriority ,
28
- } ,
26
+ up /* currentUpdatePriority */ : EventPriority ,
29
27
} ;
30
28
31
29
function noop ( ) { }
@@ -47,9 +45,7 @@ const Internals: InternalsType = {
47
45
current : DefaultDispatcher ,
48
46
} ,
49
47
findDOMNode : null ,
50
- ReactDOMCurrentUpdatePriority : {
51
- current : NoEventPriority ,
52
- } ,
48
+ up /* currentUpdatePriority */ : NoEventPriority ,
53
49
} ;
54
50
55
51
export default Internals ;
Original file line number Diff line number Diff line change 1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- // TODO: this is special because it gets imported during build.
9
- //
10
- // It exists as a placeholder so that DevTools can support work tag changes between releases.
11
- // When we next publish a release, update the matching TODO in backend/renderer.js
12
- // TODO: This module is used both by the release scripts and to expose a version
13
- // at runtime. We should instead inject the version number as part of the build
14
- // process, and use the ReactVersions.js module as the single source of truth.
15
- export default '19.0.0' ;
1
+ export default '19.0.0-PLACEHOLDER' ;
You can’t perform that action at this time.
0 commit comments