Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Apr 3, 2025

This fixes two bugs with commit phase effect tracking.

I missed, or messed up the rebase for, deletion effects when a subtree was deleted and for passive disconnects when a subtree was hidden.

The other bug is that when I started using self time (componentEffectDuration) for color and for determining whether to bother logging an entry, I didn't consider that the component with effects can have children which end up resetting this duration before we log. Which lead to most effects not having their components logged since they almost always have children.

We don't necessarily have to push/pop but we have to store at least one thing on the stack unfortunately. That's because we have to do the actual log after the children to get the right end time. So might as well use the push/pop strategy like the rest of them.

@react-sizebot
Copy link

react-sizebot commented Apr 3, 2025

Comparing: b10cb4c...8d69468

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB +0.11% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 515.56 kB 515.56 kB = 91.84 kB 91.84 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 616.30 kB 616.30 kB = 109.03 kB 109.03 kB
facebook-www/ReactDOM-prod.classic.js = 650.16 kB 650.16 kB = 114.89 kB 114.89 kB
facebook-www/ReactDOM-prod.modern.js = 640.44 kB 640.44 kB = 113.33 kB 113.33 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js +0.52% 516.69 kB 519.37 kB +0.18% 82.38 kB 82.53 kB
oss-experimental/react-art/cjs/react-art.development.js +0.41% 641.18 kB 643.81 kB +0.12% 102.37 kB 102.48 kB
facebook-www/ReactART-dev.modern.js +0.39% 693.97 kB 696.69 kB +0.10% 109.23 kB 109.34 kB
facebook-www/ReactART-dev.classic.js +0.39% 703.46 kB 706.18 kB +0.09% 111.09 kB 111.19 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js +0.38% 672.43 kB 675.00 kB +0.16% 117.95 kB 118.14 kB
facebook-www/ReactDOM-profiling.modern.js +0.38% 705.16 kB 707.84 kB +0.08% 122.64 kB 122.75 kB
facebook-www/ReactDOM-profiling.classic.js +0.38% 713.20 kB 715.88 kB +0.08% 123.99 kB 124.09 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js +0.36% 763.12 kB 765.87 kB +0.10% 120.49 kB 120.61 kB
facebook-www/ReactReconciler-dev.modern.js +0.36% 802.56 kB 805.41 kB +0.03% 126.06 kB 126.10 kB
facebook-www/ReactReconciler-dev.classic.js +0.35% 811.76 kB 814.61 kB +0.03% 127.75 kB 127.78 kB
oss-experimental/react-dom/cjs/react-dom-client.development.js +0.25% 1,107.82 kB 1,110.64 kB +0.08% 185.45 kB 185.61 kB
facebook-www/ReactDOM-dev.modern.js +0.25% 1,165.73 kB 1,168.66 kB +0.02% 194.13 kB 194.17 kB
oss-experimental/react-dom/cjs/react-dom-profiling.development.js +0.25% 1,124.22 kB 1,127.03 kB +0.08% 188.28 kB 188.44 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js +0.25% 1,124.37 kB 1,127.18 kB +0.08% 189.12 kB 189.27 kB
facebook-www/ReactDOM-dev.classic.js +0.25% 1,174.87 kB 1,177.80 kB +0.02% 195.86 kB 195.91 kB
facebook-www/ReactDOMTesting-dev.modern.js +0.25% 1,182.26 kB 1,185.20 kB +0.02% 197.91 kB 197.96 kB
facebook-www/ReactDOMTesting-dev.classic.js +0.25% 1,191.40 kB 1,194.34 kB +0.03% 199.71 kB 199.76 kB

Generated by 🚫 dangerJS against 8d69468

Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

push pop push pop

@sebmarkbage sebmarkbage merged commit c0f08ae into facebook:main Apr 4, 2025
241 checks passed
sebmarkbage added a commit that referenced this pull request Apr 4, 2025
Stacked on #32815.

To be able to differentiate mounted subtrees from updated subtrees. This
adds a yellow entry above the component subtree that mounted. This is
added both to the render phase, mutation effect phase, layout effect
phase and passive effect phase.

<img width="962" alt="Screenshot 2025-04-03 at 10 41 02 PM"
src="https://github.com/user-attachments/assets/13777347-07e8-458c-9127-8675ef08b54f"
/>

Ideally we could probably give an annotation to the component instead of
adding a whole other line which is also a color that's kind of
distracting. However, not all components are included and keeping track
of which one is the first one below is kind of annoying. Adding a marker
to all components is kind of noisy. So this is a compromise. It's only
one per depth so it won't make it too deep even on larger trees.

If this is an unmount, those are added to the mutation effect phase for
the layout unmounts and passive unmount effect phase. Since these never
have a render, they're not in the render phase.

<img width="1010" alt="Screenshot 2025-04-03 at 11 05 57 PM"
src="https://github.com/user-attachments/assets/ab39f27e-13be-4281-94fa-9391bb293fd2"
/>

For showing / hiding `<Activity>` the terminology "Reconnect" and
"Disconnect" is used instead.
github-actions bot pushed a commit that referenced this pull request Apr 4, 2025
This fixes two bugs with commit phase effect tracking.

I missed, or messed up the rebase for, deletion effects when a subtree
was deleted and for passive disconnects when a subtree was hidden.

The other bug is that when I started using self time
(componentEffectDuration) for color and for determining whether to
bother logging an entry, I didn't consider that the component with
effects can have children which end up resetting this duration before we
log. Which lead to most effects not having their components logged since
they almost always have children.

We don't necessarily have to push/pop but we have to store at least one
thing on the stack unfortunately. That's because we have to do the
actual log after the children to get the right end time. So might as
well use the push/pop strategy like the rest of them.

DiffTrain build for [c0f08ae](c0f08ae)
github-actions bot pushed a commit that referenced this pull request Apr 4, 2025
This fixes two bugs with commit phase effect tracking.

I missed, or messed up the rebase for, deletion effects when a subtree
was deleted and for passive disconnects when a subtree was hidden.

The other bug is that when I started using self time
(componentEffectDuration) for color and for determining whether to
bother logging an entry, I didn't consider that the component with
effects can have children which end up resetting this duration before we
log. Which lead to most effects not having their components logged since
they almost always have children.

We don't necessarily have to push/pop but we have to store at least one
thing on the stack unfortunately. That's because we have to do the
actual log after the children to get the right end time. So might as
well use the push/pop strategy like the rest of them.

DiffTrain build for [c0f08ae](c0f08ae)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants