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 — Try shorter property name to get inlining · react/react@5d28591

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • react-dom-bindings/src/client
      • ReactDOMUpdatePriority.js
    • react-dom/src
      • ReactDOMSharedInternals.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-dom-bindings/src/client/ReactDOMUpdatePriority.js‎

Copy file name to clipboardExpand all lines: packages/react-dom-bindings/src/client/ReactDOMUpdatePriority.js
+11-6Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,24 @@ import {
1616
} from 'react-reconciler/src/ReactEventPriorities';
1717

1818
import ReactDOMSharedInternals from 'shared/ReactDOMSharedInternals';
19-
const ReactDOMCurrentUpdatePriority =
20-
ReactDOMSharedInternals.ReactDOMCurrentUpdatePriority;
2119

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;
2429
}
2530

2631
export function getCurrentUpdatePriority(): EventPriority {
27-
return ReactDOMCurrentUpdatePriority.current;
32+
return ReactDOMSharedInternals.up;
2833
}
2934

3035
export function resolveUpdatePriority(): EventPriority {
31-
const updatePriority = ReactDOMCurrentUpdatePriority.current;
36+
const updatePriority = ReactDOMSharedInternals.up;
3237
if (updatePriority !== NoEventPriority) {
3338
return updatePriority;
3439
}
Collapse file

‎packages/react-dom/src/ReactDOMSharedInternals.js‎

Copy file name to clipboardExpand all lines: packages/react-dom/src/ReactDOMSharedInternals.js
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ type InternalsType = {
2323
| ((
2424
componentOrElement: React$Component<any, any>,
2525
) => null | Element | Text),
26-
ReactDOMCurrentUpdatePriority: {
27-
current: EventPriority,
28-
},
26+
up /* currentUpdatePriority */: EventPriority,
2927
};
3028

3129
function noop() {}
@@ -47,9 +45,7 @@ const Internals: InternalsType = {
4745
current: DefaultDispatcher,
4846
},
4947
findDOMNode: null,
50-
ReactDOMCurrentUpdatePriority: {
51-
current: NoEventPriority,
52-
},
48+
up /* currentUpdatePriority */: NoEventPriority,
5349
};
5450

5551
export default Internals;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — 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.