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 — Profiler onNestedUpdateScheduled accepts id as first param (#20293) · react/react@a81c02a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • react-reconciler/src
      • ReactFiberWorkLoop.new.js
      • ReactFiberWorkLoop.old.js
    • react/src/__tests__
      • ReactProfiler-test.internal.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-reconciler/src/ReactFiberWorkLoop.new.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.new.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,12 @@ export function scheduleUpdateOnFiber(
549549
let current = fiber;
550550
while (current !== null) {
551551
if (current.tag === Profiler) {
552-
const {onNestedUpdateScheduled} = current.memoizedProps;
552+
const {id, onNestedUpdateScheduled} = current.memoizedProps;
553553
if (typeof onNestedUpdateScheduled === 'function') {
554554
if (enableSchedulerTracing) {
555-
onNestedUpdateScheduled(root.memoizedInteractions);
555+
onNestedUpdateScheduled(id, root.memoizedInteractions);
556556
} else {
557-
onNestedUpdateScheduled();
557+
onNestedUpdateScheduled(id);
558558
}
559559
}
560560
}
Collapse file

‎packages/react-reconciler/src/ReactFiberWorkLoop.old.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.old.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,12 @@ export function scheduleUpdateOnFiber(
549549
let current = fiber;
550550
while (current !== null) {
551551
if (current.tag === Profiler) {
552-
const {onNestedUpdateScheduled} = current.memoizedProps;
552+
const {id, onNestedUpdateScheduled} = current.memoizedProps;
553553
if (typeof onNestedUpdateScheduled === 'function') {
554554
if (enableSchedulerTracing) {
555-
onNestedUpdateScheduled(root.memoizedInteractions);
555+
onNestedUpdateScheduled(id, root.memoizedInteractions);
556556
} else {
557-
onNestedUpdateScheduled();
557+
onNestedUpdateScheduled(id);
558558
}
559559
}
560560
}
Collapse file

‎packages/react/src/__tests__/ReactProfiler-test.internal.js‎

Copy file name to clipboardExpand all lines: packages/react/src/__tests__/ReactProfiler-test.internal.js
+12-5Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,7 +2583,8 @@ describe('Profiler', () => {
25832583
expect(Scheduler).toHaveYielded(['Component:false', 'Component:true']);
25842584
expect(onNestedUpdateScheduled).toHaveBeenCalledTimes(1);
25852585
if (ReactFeatureFlags.enableSchedulerTracing) {
2586-
expect(onNestedUpdateScheduled.mock.calls[0][0]).toMatchInteractions([
2586+
expect(onNestedUpdateScheduled.mock.calls[0][0]).toBe('test');
2587+
expect(onNestedUpdateScheduled.mock.calls[0][1]).toMatchInteractions([
25872588
interactionCreation,
25882589
]);
25892590
}
@@ -2624,7 +2625,9 @@ describe('Profiler', () => {
26242625

26252626
expect(Scheduler).toHaveYielded(['Component:false', 'Component:true']);
26262627
expect(onNestedUpdateScheduledOne).toHaveBeenCalledTimes(1);
2628+
expect(onNestedUpdateScheduledOne.mock.calls[0][0]).toBe('one');
26272629
expect(onNestedUpdateScheduledTwo).toHaveBeenCalledTimes(1);
2630+
expect(onNestedUpdateScheduledTwo.mock.calls[0][0]).toBe('two');
26282631
expect(onNestedUpdateScheduledThree).not.toHaveBeenCalled();
26292632
});
26302633

@@ -2817,7 +2820,8 @@ describe('Profiler', () => {
28172820
]);
28182821
expect(onNestedUpdateScheduled).toHaveBeenCalledTimes(1);
28192822
if (ReactFeatureFlags.enableSchedulerTracing) {
2820-
expect(onNestedUpdateScheduled.mock.calls[0][0]).toMatchInteractions([
2823+
expect(onNestedUpdateScheduled.mock.calls[0][0]).toBe('test');
2824+
expect(onNestedUpdateScheduled.mock.calls[0][1]).toMatchInteractions([
28212825
interactionCreation,
28222826
]);
28232827
}
@@ -2850,7 +2854,8 @@ describe('Profiler', () => {
28502854
]);
28512855
expect(onNestedUpdateScheduled).toHaveBeenCalledTimes(2);
28522856
if (ReactFeatureFlags.enableSchedulerTracing) {
2853-
expect(onNestedUpdateScheduled.mock.calls[1][0]).toMatchInteractions([
2857+
expect(onNestedUpdateScheduled.mock.calls[1][0]).toBe('test');
2858+
expect(onNestedUpdateScheduled.mock.calls[1][1]).toMatchInteractions([
28542859
interactionUpdate,
28552860
]);
28562861
}
@@ -2898,7 +2903,8 @@ describe('Profiler', () => {
28982903
expect(Scheduler).toHaveYielded(['Component:false', 'Component:true']);
28992904
expect(onNestedUpdateScheduled).toHaveBeenCalledTimes(1);
29002905
if (ReactFeatureFlags.enableSchedulerTracing) {
2901-
expect(onNestedUpdateScheduled.mock.calls[0][0]).toMatchInteractions([
2906+
expect(onNestedUpdateScheduled.mock.calls[0][0]).toBe('test');
2907+
expect(onNestedUpdateScheduled.mock.calls[0][1]).toMatchInteractions([
29022908
interactionCreation,
29032909
]);
29042910
}
@@ -2969,7 +2975,8 @@ describe('Profiler', () => {
29692975
]);
29702976
expect(onNestedUpdateScheduled).toHaveBeenCalledTimes(1);
29712977
if (ReactFeatureFlags.enableSchedulerTracing) {
2972-
expect(onNestedUpdateScheduled.mock.calls[0][0]).toMatchInteractions([
2978+
expect(onNestedUpdateScheduled.mock.calls[0][0]).toBe('test');
2979+
expect(onNestedUpdateScheduled.mock.calls[0][1]).toMatchInteractions([
29732980
interactionCreation,
29742981
]);
29752982
}

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.