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

Add unstable_renderSubtreeIntoContainer and unstable_createPortal feature flags #17880

Merged
merged 2 commits into from Jan 21, 2020

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Jan 21, 2020

This PR adds two feature flags:

  • disableUnstableRenderSubtreeIntoContainer for ReactDOM.unstable_renderSubtreeIntoContainer
  • disableUnstableCreatePortal for ReactDOM.unstable_createPortal

These disable the relevant unstable/deprecated ReactDOM APIs. Additionally ReactDOM.unstable_renderSubtreeIntoContainer has a deprecation warning message as follows:

The ReactDOM.unstable_renderSubtreeIntoContainer() is deprecated and will be removed in a future major release. Consider using React Portals instead.

I also changed the flowconfig to have the follow config, otherwise CI fails on this PR:

server.max_workers=4

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 21, 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 46cee59:

Sandbox Source
async-mountain-c7xyj Configuration

@sizebot
Copy link

sizebot commented Jan 21, 2020

Details of bundled changes.

Comparing: 0c04aca...46cee59

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js 0.0% 0.0% 123.67 KB 123.72 KB 38.77 KB 38.78 KB NODE_PROFILING
react-dom-server.browser.development.js +0.1% +0.1% 137.89 KB 137.99 KB 36.65 KB 36.67 KB UMD_DEV
react-dom-test-utils.development.js +0.2% +0.2% 54.65 KB 54.76 KB 15.36 KB 15.39 KB UMD_DEV
ReactDOMServer-prod.js 0.0% 0.0% 49.02 KB 49.02 KB 11.19 KB 11.19 KB FB_WWW_PROD
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-test-utils.development.js +0.2% +0.2% 52.93 KB 53.03 KB 15.04 KB 15.06 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 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 640 B 641 B NODE_PROD
react-dom.development.js +0.1% +0.1% 956.28 KB 957 KB 214.9 KB 215.01 KB UMD_DEV
react-dom.production.min.js 0.0% 0.0% 119.69 KB 119.74 KB 38.37 KB 38.38 KB UMD_PROD
react-dom.profiling.min.js 0.0% -0.0% 123.42 KB 123.47 KB 39.57 KB 39.56 KB UMD_PROFILING
react-dom.development.js +0.1% +0.1% 950.34 KB 951.07 KB 213.19 KB 213.3 KB NODE_DEV
react-dom-server.node.development.js +0.1% +0.1% 134.93 KB 135.03 KB 35.85 KB 35.88 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 119.79 KB 119.84 KB 37.64 KB 37.65 KB NODE_PROD
react-dom-server.node.production.min.js 0.0% 0.0% 20.8 KB 20.8 KB 7.63 KB 7.63 KB NODE_PROD
react-dom-server.browser.development.js +0.1% +0.1% 133.82 KB 133.92 KB 35.62 KB 35.65 KB NODE_DEV
ReactDOM-dev.js +0.1% 0.0% 978 KB 978.67 KB 216.12 KB 216.22 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% 394.21 KB 394.29 KB 72.07 KB 72.07 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% 405.5 KB 405.58 KB 74.22 KB 74.23 KB FB_WWW_PROFILING
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 10.23 KB 10.23 KB 3.47 KB 3.47 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.61 KB 60.61 KB 15.99 KB 16 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.1% 9.97 KB 9.97 KB 3.37 KB 3.37 KB NODE_PROD
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.3% 1.21 KB 1.21 KB 696 B 698 B NODE_PROD

Size changes (experimental)

Generated by 🚫 dangerJS against 46cee59

@sizebot
Copy link

sizebot commented Jan 21, 2020

Details of bundled changes.

Comparing: 0c04aca...46cee59

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.94 KB 19.94 KB 7.39 KB 7.4 KB NODE_PROD
react-dom-test-utils.development.js +0.2% +0.2% 52.91 KB 53.02 KB 15.03 KB 15.06 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 115.85 KB 115.9 KB 37.25 KB 37.26 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.47 KB 119.52 KB 38.39 KB 38.4 KB UMD_PROFILING
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 9.96 KB 9.96 KB 3.36 KB 3.37 KB NODE_PROD
react-dom.development.js +0.1% +0.1% 950.32 KB 951.04 KB 213.17 KB 213.28 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 115.92 KB 115.97 KB 36.59 KB 36.6 KB NODE_PROD
react-dom.profiling.min.js 0.0% 0.0% 119.69 KB 119.73 KB 37.71 KB 37.72 KB NODE_PROFILING
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.3% 1.2 KB 1.2 KB 701 B 703 B UMD_PROD
react-dom-server.browser.development.js +0.1% +0.1% 137.86 KB 137.96 KB 36.64 KB 36.67 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 20.01 KB 20.01 KB 7.41 KB 7.41 KB UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.7 KB 3.7 KB 1.49 KB 1.49 KB NODE_DEV
react-dom-test-utils.development.js +0.2% +0.2% 54.64 KB 54.74 KB 15.35 KB 15.38 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1.04 KB 1.04 KB 633 B 634 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.1% +0.1% 133.79 KB 133.9 KB 35.62 KB 35.65 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.06 KB 16.06 KB UMD_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.1% 1.2 KB 1.2 KB 688 B 689 B NODE_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10.22 KB 10.22 KB 3.46 KB 3.47 KB UMD_PROD
react-dom-server.node.development.js +0.1% +0.1% 134.9 KB 135.01 KB 35.85 KB 35.88 KB NODE_DEV
react-dom.development.js +0.1% +0.1% 956.25 KB 956.98 KB 214.88 KB 214.99 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% 0.0% 20.34 KB 20.34 KB 7.55 KB 7.55 KB NODE_PROD

ReactDOM: size: 0.0%, gzip: 0.0%

Size changes (stable)

Generated by 🚫 dangerJS against 46cee59

packages/react-dom/src/client/ReactDOM.js Outdated Show resolved Hide resolved
@trueadm trueadm force-pushed the react-dom-unstable-flags branch 2 times, most recently from 0a96835 to 0447b41 Compare January 21, 2020 20:44
…ture flags

Add flags to other files

address feedback

Fix The ReactDOM.unstable_createPortal()

Trigger build

Make message same as before
@mzedeler
Copy link

mzedeler commented May 6, 2020

Just a question: does this mean that portals will be deprecated in the future?

@threepointone
Copy link
Contributor

No, in fact the opposite. It means the unstable_ prefixed version for createPortal is removed. Use just createPortal instead.

kassens added a commit to kassens/react that referenced this pull request Sep 29, 2022
This was added back in facebook#17880 to make CI pass for an unrelated change.

Submitting this PR to see if this is still needed to pass on CI. A lot of things have changed since.
kassens added a commit to kassens/react that referenced this pull request Sep 29, 2022
This was added back in facebook#17880 to make CI pass for an unrelated change.

Submitting this PR to see if this is still needed to pass on CI. A lot of things have changed since.
kassens added a commit to kassens/react that referenced this pull request Sep 29, 2022
This was added back in facebook#17880 to make CI pass for an unrelated change.

Submitting this PR to see if this is still needed to pass on CI. A lot of things have changed since.
kassens added a commit that referenced this pull request Sep 29, 2022
This was added back in #17880 to make CI pass for an unrelated change.

This limits the max worker setting to CI environments as removing the setting completely still seems to break on CircleCI.
rickhanlonii pushed a commit that referenced this pull request Oct 5, 2022
This was added back in #17880 to make CI pass for an unrelated change.

This limits the max worker setting to CI environments as removing the setting completely still seems to break on CircleCI.
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

7 participants