Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Don't unmount siblings of deleted node #19516

Merged
merged 3 commits into from Aug 3, 2020

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Aug 2, 2020

A deleted fiber is passed to flushPassiveUnmountEffectsInsideOfDeletedTree, but the code is written as if it accepts the first node of a child list. This is likely because the function was based on similar functions like flushPassiveUnmountEffects, which do accept a child list.

Unfortunately, types don't help here because we use the first node in the list to represent the whole list, so in both cases, the type is Fiber. Might be worth changing the other functions to also accept individual fibers instead of a child list, to help avoid confusion.

Adds a failing regression test. Will fix in the next commit.
A deleted fiber is passed to
flushPassiveUnmountEffectsInsideOfDeletedTree, but the code is written
as if it accepts the first node of a child list. This is likely because
the function was based on similar functions like
`flushPassiveUnmountEffects`, which do accept a child list.

Unfortunately, types don't help here because we use the first node
in the list to represent the whole list, so in both cases, the type
is Fiber.

Might be worth changing the other functions to also accept individual
fibers instead of a child list, to help avoid confusion.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Aug 2, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 2, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 09e7145:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Aug 2, 2020

Details of bundled changes.

Comparing: 93a0c28...09e7145

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js 0.0% -0.0% 879.78 KB 879.78 KB 201.84 KB 201.84 KB NODE_DEV
ReactDOMForked-prod.js -0.0% -0.0% 410.07 KB 409.9 KB 75.66 KB 75.65 KB FB_WWW_PROD
react-dom-server.node.development.js 0.0% 0.0% 137.36 KB 137.36 KB 36.5 KB 36.5 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 119.4 KB 119.4 KB 38.4 KB 38.4 KB NODE_PROD
ReactDOMForked-profiling.js -0.0% -0.0% 425.46 KB 425.28 KB 78.38 KB 78.37 KB FB_WWW_PROFILING
react-dom-server.browser.development.js 0.0% 0.0% 143.48 KB 143.48 KB 36.71 KB 36.72 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% 0.0% 20.26 KB 20.26 KB 7.6 KB 7.6 KB NODE_PROD
react-dom-test-utils.production.min.js 0.0% -0.0% 12.84 KB 12.84 KB 5.03 KB 5.03 KB UMD_PROD
ReactDOMTesting-dev.js 0.0% 0.0% 980.31 KB 980.31 KB 219.05 KB 219.05 KB FB_WWW_DEV
react-dom-test-utils.development.js 0.0% -0.0% 60.88 KB 60.88 KB 17.65 KB 17.65 KB NODE_DEV
ReactDOMTesting-prod.js 0.0% -0.0% 414.73 KB 414.73 KB 77.68 KB 77.68 KB FB_WWW_PROD
react-dom-test-utils.production.min.js 0.0% -0.0% 12.7 KB 12.7 KB 4.96 KB 4.96 KB NODE_PROD
react-dom.development.js 0.0% 0.0% 924.34 KB 924.34 KB 204.34 KB 204.34 KB UMD_DEV
ReactDOMForked-dev.js -0.0% -0.0% 1019.91 KB 1019.48 KB 226.07 KB 226.04 KB FB_WWW_DEV
react-dom.profiling.min.js 0.0% 0.0% 123.46 KB 123.46 KB 39.65 KB 39.65 KB NODE_PROFILING
react-dom-server.browser.production.min.js 0.0% 0.0% 19.92 KB 19.92 KB 7.46 KB 7.46 KB UMD_PROD
ReactDOM-dev.js 0.0% 0.0% 1012.29 KB 1012.29 KB 225.03 KB 225.03 KB FB_WWW_DEV
ReactDOM-prod.js 0.0% -0.0% 406.27 KB 406.27 KB 75.03 KB 75.03 KB FB_WWW_PROD
react-dom-server.browser.development.js 0.0% 0.0% 136.09 KB 136.09 KB 36.25 KB 36.26 KB NODE_DEV
ReactDOM-profiling.js 0.0% -0.0% 420.73 KB 420.73 KB 77.66 KB 77.66 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js 0.0% 0.0% 19.84 KB 19.84 KB 7.44 KB 7.44 KB NODE_PROD
ReactDOMServer-dev.js 0.0% 0.0% 147.47 KB 147.47 KB 37.48 KB 37.48 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% 0.0% 47.54 KB 47.54 KB 11.14 KB 11.14 KB FB_WWW_PROD
react-dom-test-utils.development.js 0.0% 0.0% 65.9 KB 65.9 KB 18.18 KB 18.18 KB UMD_DEV

ReactDOM: size: 0.0%, gzip: -0.0%

Size changes (stable)

Generated by 🚫 dangerJS against 09e7145

@sizebot
Copy link

sizebot commented Aug 2, 2020

Details of bundled changes.

Comparing: 93a0c28...09e7145

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js 0.0% 0.0% 916.89 KB 916.89 KB 208.6 KB 208.6 KB NODE_DEV
ReactDOMForked-prod.js -0.0% -0.0% 398.94 KB 398.76 KB 73.99 KB 73.98 KB FB_WWW_PROD
ReactDOMForked-profiling.js -0.0% -0.0% 414.26 KB 414.08 KB 76.74 KB 76.74 KB FB_WWW_PROFILING
react-dom-server.node.production.min.js 0.0% 0.0% 20.72 KB 20.72 KB 7.67 KB 7.68 KB NODE_PROD
react-dom-test-utils.production.min.js 0.0% -0.0% 12.86 KB 12.86 KB 5.04 KB 5.04 KB UMD_PROD
ReactDOMTesting-prod.js 0.0% -0.0% 402.49 KB 402.49 KB 75.83 KB 75.83 KB FB_WWW_PROD
react-dom-unstable-fizz.node.development.js 0.0% -0.1% 5.61 KB 5.61 KB 1.87 KB 1.86 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 12.71 KB 12.71 KB 4.97 KB 4.97 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.2% 5.36 KB 5.36 KB 1.81 KB 1.8 KB UMD_DEV
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 4.87 KB 4.87 KB 1.71 KB 1.7 KB NODE_DEV
react-dom.development.js 0.0% 0.0% 963.25 KB 963.25 KB 211.22 KB 211.23 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.2% 1.01 KB 1.01 KB 617 B 616 B NODE_PROD
react-dom.production.min.js 0.0% 0.0% 124.06 KB 124.06 KB 40.54 KB 40.55 KB UMD_PROD
react-dom.profiling.min.js 0.0% 0.0% 129.25 KB 129.25 KB 42.18 KB 42.18 KB UMD_PROFILING
ReactDOMForked-dev.js -0.0% -0.0% 994.36 KB 993.94 KB 221.35 KB 221.32 KB FB_WWW_DEV
react-dom.profiling.min.js 0.0% 0.0% 129.57 KB 129.57 KB 41.48 KB 41.48 KB NODE_PROFILING
react-dom-server.browser.production.min.js 0.0% 0.0% 20.38 KB 20.38 KB 7.54 KB 7.55 KB UMD_PROD
ReactDOM-prod.js 0.0% 0.0% 395.14 KB 395.14 KB 73.38 KB 73.39 KB FB_WWW_PROD

ReactDOM: size: 0.0%, gzip: -0.0%

Size changes (experimental)

Generated by 🚫 dangerJS against 09e7145

@acdlite acdlite merged commit 5f1890f into facebook:master Aug 3, 2020
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.

None yet

4 participants