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

Disable <div hidden /> API in old fork, too #18917

Merged
merged 1 commit into from
May 14, 2020

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented May 14, 2020

The motivation for doing this is to make it impossible for additional uses of pre-rendering to sneak into www without going through the LegacyHidden abstraction. Since this feature was already disabled in the new fork, this brings the two closer to parity.

The LegacyHidden abstraction itself still needs to opt into pre-rendering somehow, so rather than totally disabling the feature, I updated the hidden prop check to be obnoxiously specific. Before, you could set it to any truthy value; now, you must set it to the string "unstable-do-not-use-legacy-hidden".

The node will still be hidden in the DOM, since any truthy value will cause the browser to apply a style of display: none.

I will have to update the LegacyHidden component in www to use the obnoxious string prop. This doesn't block merge, though, since the behavior is gated by a dynamic flag. I will update the component before I enable the flag.

The motivation for doing this is to make it impossible for additional
uses of pre-rendering to sneak into www without going through the
LegacyHidden abstraction. Since this feature was already disabled in
the new fork, this brings the two closer to parity.

The LegacyHidden abstraction itself still needs to opt into
pre-rendering somehow, so rather than totally disabling the feature, I
updated the `hidden` prop check to be obnoxiously specific. Before, you
could set it to any truthy value; now, you must set it to the string
"unstable-do-not-use-legacy-hidden".

The node will still be hidden in the DOM, since any truthy value will
cause the browser to apply a style of `display: none`.

I will have to update the LegacyHidden component in www to use the
obnoxious string prop. This doesn't block merge, though, since the
behavior is gated by a dynamic flag. I will update the component before
I enable the flag.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels May 14, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented May 14, 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 cd78e48:

Sandbox Source
bold-monad-d1sk8 Configuration

@acdlite acdlite force-pushed the disable-hidden-prop-api branch 2 times, most recently from ec8ad72 to cd78e48 Compare May 14, 2020 02:08
@sizebot
Copy link

sizebot commented May 14, 2020

Details of bundled changes.

Comparing: 9e5b2c9...cd78e48

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactDOM-profiling.js +0.1% +0.1% 454.24 KB 454.61 KB 80.28 KB 80.39 KB FB_WWW_PROFILING
react-dom-server.browser.development.js 0.0% 0.0% 136.15 KB 136.15 KB 34.84 KB 34.84 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 19.84 KB 19.84 KB 7.42 KB 7.43 KB UMD_PROD
ReactDOMForked-dev.js -0.0% -0.1% 1.03 MB 1.03 MB 237.53 KB 237.4 KB FB_WWW_DEV
ReactDOMForked-prod.js 0.0% 0.0% 440.81 KB 440.81 KB 79.45 KB 79.45 KB FB_WWW_PROD
react-dom.development.js 0.0% +0.1% 911.26 KB 911.52 KB 200.24 KB 200.35 KB UMD_DEV
ReactDOMForked-profiling.js 0.0% 0.0% 450.57 KB 450.57 KB 81.1 KB 81.1 KB FB_WWW_PROFILING
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 119.88 KB 119.95 KB 38.46 KB 38.48 KB UMD_PROD
react-dom.profiling.min.js +0.1% 0.0% 123.65 KB 123.72 KB 39.63 KB 39.65 KB UMD_PROFILING
ReactDOMTesting-dev.js 0.0% +0.1% 956.91 KB 957.15 KB 213.71 KB 213.82 KB FB_WWW_DEV
react-dom.development.js 0.0% +0.1% 867.4 KB 867.64 KB 197.73 KB 197.85 KB NODE_DEV
ReactDOMTesting-prod.js 0.0% 0.0% 404.93 KB 405.02 KB 74.59 KB 74.61 KB FB_WWW_PROD
react-dom-server.node.development.js 0.0% 0.0% 130.42 KB 130.42 KB 34.65 KB 34.66 KB NODE_DEV
react-dom.production.min.js 🔺+0.1% 0.0% 120 KB 120.07 KB 37.56 KB 37.57 KB NODE_PROD
react-dom-server.node.production.min.js 0.0% 0.0% 20.18 KB 20.18 KB 7.57 KB 7.57 KB NODE_PROD
react-dom.profiling.min.js +0.1% +0.1% 123.89 KB 123.96 KB 38.77 KB 38.8 KB NODE_PROFILING
ReactDOM-dev.js -0.0% -0.0% 1.03 MB 1.03 MB 235.31 KB 235.29 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.1% 🔺+0.1% 443.28 KB 443.64 KB 78.45 KB 78.56 KB FB_WWW_PROD
ReactTestUtils-dev.js 0.0% 0.0% 65.33 KB 65.35 KB 17.62 KB 17.62 KB FB_WWW_DEV
react-dom-server.browser.development.js 0.0% 0.0% 129.15 KB 129.15 KB 34.4 KB 34.4 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 19.76 KB 19.76 KB 7.41 KB 7.41 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.2% 5.35 KB 5.35 KB 1.79 KB 1.8 KB UMD_DEV
ReactDOMServer-dev.js 0.0% 0.0% 147.13 KB 147.15 KB 37.38 KB 37.38 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% 0.0% 47.39 KB 47.39 KB 11.07 KB 11.07 KB FB_WWW_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1 KB 1 KB 609 B 610 B NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-dev.js -0.1% -0.1% 613.02 KB 612.6 KB 129.11 KB 128.95 KB FB_WWW_DEV
react-art.development.js 0.0% 0.0% 638.84 KB 638.91 KB 134.96 KB 134.99 KB UMD_DEV
react-art.production.min.js 0.0% 0.0% 107.56 KB 107.56 KB 32.63 KB 32.63 KB UMD_PROD
react-art.development.js 0.0% 0.0% 542.93 KB 543 KB 117.38 KB 117.4 KB NODE_DEV
react-art.production.min.js 0.0% 0.0% 72.55 KB 72.55 KB 21.8 KB 21.8 KB NODE_PROD

ReactDOM: size: 0.0%, gzip: 0.0%

Size changes (stable)

Generated by 🚫 dangerJS against cd78e48

@sizebot
Copy link

sizebot commented May 14, 2020

Details of bundled changes.

Comparing: 9e5b2c9...cd78e48

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-test-utils.development.js 0.0% 0.0% 75.29 KB 75.29 KB 20.19 KB 20.19 KB UMD_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.2% 5.36 KB 5.36 KB 1.8 KB 1.8 KB UMD_DEV
ReactDOMTesting-dev.js 0.0% +0.1% 931.12 KB 931.36 KB 208.04 KB 208.15 KB FB_WWW_DEV
react-dom.development.js 0.0% +0.1% 945.13 KB 945.39 KB 206.73 KB 206.83 KB UMD_DEV
react-dom-server.browser.development.js 0.0% 0.0% 143.5 KB 143.5 KB 36.61 KB 36.61 KB UMD_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 124.66 KB 124.74 KB 39.94 KB 39.96 KB UMD_PROD
ReactDOMForked-dev.js -0.0% -0.1% 1.01 MB 1.01 MB 231.7 KB 231.56 KB FB_WWW_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 20.3 KB 20.3 KB 7.5 KB 7.5 KB UMD_PROD
react-dom.profiling.min.js +0.1% +0.1% 128.54 KB 128.62 KB 41.09 KB 41.11 KB UMD_PROFILING
react-dom.development.js 0.0% +0.1% 899.83 KB 900.07 KB 204.17 KB 204.28 KB NODE_DEV
react-dom-server.browser.development.js 0.0% 0.0% 136.13 KB 136.13 KB 36.16 KB 36.16 KB NODE_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 124.85 KB 124.92 KB 39 KB 39.02 KB NODE_PROD
react-dom.profiling.min.js +0.1% +0.1% 128.88 KB 128.96 KB 40.29 KB 40.32 KB NODE_PROFILING
ReactDOM-dev.js -0.0% -0.0% 1.01 MB 1.01 MB 229.61 KB 229.59 KB FB_WWW_DEV
ReactDOMServer-dev.js 0.0% 0.0% 143.68 KB 143.7 KB 36.49 KB 36.5 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.1% 🔺+0.1% 432.2 KB 432.57 KB 76.6 KB 76.7 KB FB_WWW_PROD
ReactDOMServer-prod.js 0.0% 0.0% 46.52 KB 46.52 KB 10.87 KB 10.88 KB FB_WWW_PROD
ReactDOM-profiling.js +0.1% +0.1% 443.11 KB 443.47 KB 78.42 KB 78.52 KB FB_WWW_PROFILING
react-dom-unstable-fizz.node.production.min.js 0.0% -0.1% 1.17 KB 1.17 KB 668 B 667 B NODE_PROD
ReactDOMTesting-prod.js 0.0% 0.0% 393.07 KB 393.17 KB 72.68 KB 72.7 KB FB_WWW_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1.02 KB 1.02 KB 617 B 618 B NODE_PROD
ReactTestUtils-dev.js 0.0% 0.0% 65.33 KB 65.34 KB 17.62 KB 17.63 KB FB_WWW_DEV
react-dom-server.node.development.js 0.0% 0.0% 137.4 KB 137.4 KB 36.42 KB 36.42 KB NODE_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js 0.0% 0.0% 663.23 KB 663.3 KB 139.86 KB 139.88 KB UMD_DEV
react-art.development.js 0.0% 0.0% 566.32 KB 566.38 KB 122.33 KB 122.35 KB NODE_DEV
ReactART-dev.js -0.1% -0.1% 603.01 KB 602.58 KB 127.08 KB 126.93 KB FB_WWW_DEV

Size changes (experimental)

Generated by 🚫 dangerJS against cd78e48

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