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

Simplify Continuous Hydration Targets #17952

Merged

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Feb 1, 2020

Let’s use a constant priority for this. This helps us avoid restarting a render when switching targets and simplifies the model.

The downside is that now we're not down-prioritizing the previous hover target. However, we think that's ok because it'll only do one level too much and then stop.

I also add test meant to show why it's tricky to merge both hydration levels. Having both levels co-exist works. However, if we deprioritize hydration using a single level, we might deprioritize the wrong thing.

It also tests that we don't down-prioritize if we're changing the hover in the middle of doing continuous priority work. We don't do the -1 trick for these and so we don't have to consider that in the new model. Just that we shouldn't start doing that.

Let's use a constant priority for this. This helps us avoid restarting
a render when switching targets and simplifies the model.

The downside is that now we're not down-prioritizing the previous hover
target. However, we think that's ok because it'll only do one level too
much and then stop.
Having both levels co-exist works. However, if we deprioritize hydration
using a single level, we might deprioritize the wrong thing.

This adds a test that catches it if we ever try a naive deprioritization
in the future.

It also tests that we don't down-prioritize if we're changing the hover
in the middle of doing continuous priority work.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 1, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 1, 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 d92aea6:

Sandbox Source
nifty-wright-2suj9 Configuration

@sizebot
Copy link

sizebot commented Feb 1, 2020

Details of bundled changes.

Comparing: 38cd758...d92aea6

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler-persistent.production.min.js -0.0% -0.0% 72.52 KB 72.5 KB 21.31 KB 21.31 KB NODE_PROD
react-reconciler.development.js -0.1% -0.1% 610.19 KB 609.77 KB 127.76 KB 127.64 KB NODE_DEV
react-reconciler.production.min.js -0.0% -0.0% 72.51 KB 72.48 KB 21.31 KB 21.3 KB NODE_PROD
react-reconciler-reflection.development.js 0.0% -0.0% 19.58 KB 19.58 KB 6.42 KB 6.42 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% -0.1% 2.85 KB 2.85 KB 1.24 KB 1.24 KB NODE_PROD
react-reconciler-persistent.development.js -0.1% -0.1% 607.32 KB 606.9 KB 126.55 KB 126.43 KB NODE_DEV

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-server.browser.production.min.js 0.0% -0.0% 19.93 KB 19.93 KB 7.39 KB 7.39 KB NODE_PROD
react-dom-test-utils.development.js 0.0% -0.0% 53.12 KB 53.12 KB 15.1 KB 15.1 KB NODE_DEV
react-dom.production.min.js -0.0% 0.0% 115.91 KB 115.89 KB 37.3 KB 37.3 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.59 KB 60.59 KB 15.99 KB 15.99 KB NODE_DEV
react-dom.profiling.min.js -0.0% -0.0% 119.44 KB 119.42 KB 38.43 KB 38.43 KB UMD_PROFILING
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 9.96 KB 9.96 KB 3.37 KB 3.36 KB NODE_PROD
react-dom.development.js -0.0% -0.1% 955.09 KB 954.67 KB 214.07 KB 213.95 KB NODE_DEV
react-dom.production.min.js -0.0% 0.0% 115.98 KB 115.95 KB 36.63 KB 36.63 KB NODE_PROD
react-dom.profiling.min.js -0.0% -0.0% 119.65 KB 119.62 KB 37.74 KB 37.74 KB NODE_PROFILING
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.87 KB 3.87 KB 1.54 KB 1.54 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.1% 1.2 KB 1.2 KB 703 B 702 B UMD_PROD
react-dom-server.browser.development.js 0.0% -0.0% 138.95 KB 138.95 KB 36.81 KB 36.81 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 20 KB 20 KB 7.4 KB 7.4 KB UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.2% 3.7 KB 3.7 KB 1.5 KB 1.49 KB NODE_DEV
react-dom-test-utils.development.js 0.0% -0.0% 54.84 KB 54.84 KB 15.43 KB 15.42 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.2% 1.04 KB 1.04 KB 634 B 633 B NODE_PROD
react-dom-test-utils.production.min.js 0.0% -0.0% 11.17 KB 11.17 KB 4.14 KB 4.14 KB UMD_PROD
react-dom-server.browser.development.js 0.0% -0.0% 134.88 KB 134.88 KB 35.78 KB 35.78 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.94 KB 10.94 KB 4.08 KB 4.08 KB NODE_PROD
react-dom-unstable-fizz.node.development.js 0.0% -0.1% 4.4 KB 4.4 KB 1.64 KB 1.64 KB NODE_DEV
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.89 KB 60.89 KB 16.07 KB 16.06 KB UMD_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.1% 1.2 KB 1.2 KB 690 B 689 B NODE_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 10.22 KB 10.22 KB 3.47 KB 3.47 KB UMD_PROD
react-dom-server.node.development.js 0.0% -0.0% 135.99 KB 135.99 KB 36.02 KB 36.01 KB NODE_DEV
react-dom.development.js -0.0% -0.1% 961.03 KB 960.61 KB 215.75 KB 215.63 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 20.34 KB 20.34 KB 7.54 KB 7.54 KB NODE_PROD

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

Size changes (stable)

Generated by 🚫 dangerJS against d92aea6

@sizebot
Copy link

sizebot commented Feb 1, 2020

Details of bundled changes.

Comparing: 38cd758...d92aea6

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js -0.0% -0.1% 123.69 KB 123.66 KB 38.79 KB 38.76 KB NODE_PROFILING
react-dom-server.browser.development.js 0.0% -0.0% 138.97 KB 138.97 KB 36.81 KB 36.81 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 20.46 KB 20.46 KB 7.5 KB 7.5 KB UMD_PROD
react-dom-test-utils.development.js 0.0% -0.0% 54.86 KB 54.86 KB 15.43 KB 15.43 KB UMD_DEV
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.88 KB 3.88 KB 1.55 KB 1.55 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 11.18 KB 11.18 KB 4.15 KB 4.15 KB UMD_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.1% 1.21 KB 1.21 KB 711 B 710 B UMD_PROD
react-dom-test-utils.development.js 0.0% -0.0% 53.13 KB 53.13 KB 15.11 KB 15.11 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% -0.2% 3.71 KB 3.71 KB 1.5 KB 1.5 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.95 KB 10.95 KB 4.09 KB 4.09 KB NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.2% 1.05 KB 1.05 KB 642 B 641 B NODE_PROD
react-dom.development.js -0.0% -0.1% 961.05 KB 960.63 KB 215.77 KB 215.65 KB UMD_DEV
react-dom.production.min.js -0.0% -0.0% 119.81 KB 119.79 KB 38.43 KB 38.42 KB UMD_PROD
react-dom.profiling.min.js -0.0% -0.0% 123.45 KB 123.43 KB 39.58 KB 39.58 KB UMD_PROFILING
react-dom.development.js -0.0% -0.1% 955.11 KB 954.69 KB 214.09 KB 213.98 KB NODE_DEV
react-dom-server.node.development.js 0.0% -0.0% 136.01 KB 136.01 KB 36.02 KB 36.02 KB NODE_DEV
react-dom.production.min.js -0.0% -0.0% 119.91 KB 119.88 KB 37.67 KB 37.66 KB NODE_PROD
react-dom-server.node.production.min.js 0.0% -0.0% 20.79 KB 20.79 KB 7.62 KB 7.62 KB NODE_PROD
react-dom-server.browser.development.js 0.0% -0.0% 134.9 KB 134.9 KB 35.79 KB 35.78 KB NODE_DEV
ReactDOM-dev.js -0.0% -0.1% 982.87 KB 982.44 KB 216.94 KB 216.83 KB FB_WWW_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 20.39 KB 20.39 KB 7.47 KB 7.47 KB NODE_PROD
ReactDOM-prod.js -0.0% -0.0% 392.26 KB 392.13 KB 71.63 KB 71.63 KB FB_WWW_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.91 KB 60.91 KB 16.07 KB 16.07 KB UMD_DEV
ReactDOM-profiling.js -0.0% -0.0% 403.47 KB 403.35 KB 73.76 KB 73.76 KB FB_WWW_PROFILING
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.1% 10.23 KB 10.23 KB 3.48 KB 3.47 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.61 KB 60.61 KB 16 KB 15.99 KB NODE_DEV
react-dom-unstable-fizz.node.development.js 0.0% -0.1% 4.42 KB 4.42 KB 1.65 KB 1.65 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 9.97 KB 9.97 KB 3.37 KB 3.37 KB NODE_PROD
ReactDOMServer-dev.js 0.0% -0.0% 140.24 KB 140.24 KB 35.49 KB 35.49 KB FB_WWW_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.1% 1.21 KB 1.21 KB 698 B 697 B NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler-persistent.development.js -0.1% -0.1% 607.33 KB 606.91 KB 126.56 KB 126.44 KB NODE_DEV
react-reconciler-reflection.development.js 0.0% -0.0% 19.59 KB 19.59 KB 6.42 KB 6.42 KB NODE_DEV
react-reconciler-persistent.production.min.js -0.0% -0.0% 72.53 KB 72.51 KB 21.32 KB 21.32 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% -0.2% 2.86 KB 2.86 KB 1.24 KB 1.24 KB NODE_PROD
react-reconciler.development.js -0.1% -0.1% 610.2 KB 609.78 KB 127.76 KB 127.64 KB NODE_DEV
react-reconciler.production.min.js -0.0% 0.0% 75.29 KB 75.26 KB 21.96 KB 21.97 KB NODE_PROD

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

Size changes (experimental)

Generated by 🚫 dangerJS against d92aea6

@acdlite
Copy link
Collaborator

acdlite commented Feb 3, 2020

Thanks!

@sebmarkbage sebmarkbage merged commit ace9e81 into facebook:master Feb 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.

4 participants