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

Improved suspense support in ReactDOMServer #14161

Merged
merged 1 commit into from Nov 9, 2018

Conversation

alexmckenley
Copy link
Contributor

I've updated the support for suspense in the ReactPartialRenderer. Instead of always rendering the fallback, the server renderer will attempt to render the children, and only revert to the fallback if rendering is suspended with a thrown promise.

Let me know what you think.

@sizebot
Copy link

sizebot commented Nov 9, 2018

Details of bundled changes.

Comparing: f9e9913...7483480

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-server.browser.development.js +1.3% +1.1% 119.2 KB 120.8 KB 31.71 KB 32.05 KB UMD_DEV
react-dom-server.browser.production.min.js 🔺+2.0% 🔺+2.0% 16.02 KB 16.34 KB 6.09 KB 6.21 KB UMD_PROD
react-dom-server.browser.development.js +1.4% +1.1% 115.33 KB 116.93 KB 30.76 KB 31.09 KB NODE_DEV
react-dom-server.browser.production.min.js 🔺+2.0% 🔺+1.9% 15.92 KB 16.24 KB 6.09 KB 6.2 KB NODE_PROD
react-dom-server.node.development.js +1.4% +1.1% 117.25 KB 118.85 KB 31.29 KB 31.62 KB NODE_DEV
react-dom-server.node.production.min.js 🔺+2.0% 🔺+1.8% 16.72 KB 17.05 KB 6.39 KB 6.5 KB NODE_PROD
ReactDOMServer-dev.js +1.4% +1.2% 116.43 KB 118.09 KB 30.38 KB 30.74 KB FB_WWW_DEV
ReactDOMServer-prod.js 🔺+3.5% 🔺+2.7% 40.65 KB 42.08 KB 9.58 KB 9.83 KB FB_WWW_PROD

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
scheduler.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD

Generated by 🚫 dangerJS

@alexmckenley alexmckenley force-pushed the ReactDOMServerSuspense branch 4 times, most recently from 993d094 to e7ec765 Compare November 9, 2018 00:50
@alexmckenley
Copy link
Contributor Author

Updated based on recommendations from @sophiebits. 💯

Copy link
Collaborator

@sophiebits sophiebits left a comment

Choose a reason for hiding this comment

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

Thanks! Feel free to squash-and-merge when you're ready.

packages/react-dom/src/server/ReactPartialRenderer.js Outdated Show resolved Hide resolved
packages/react-dom/src/server/ReactPartialRenderer.js Outdated Show resolved Hide resolved
@alexmckenley
Copy link
Contributor Author

@sophiebits Thanks for the review! I pushed up the changes, but I dont see a merge button, seems like I may not have permission.

@alexmckenley alexmckenley merged commit 02e4848 into facebook:master Nov 9, 2018
@Tor01100
Copy link

Tor01100 commented Nov 9, 2018 via email

jetoneza pushed a commit to jetoneza/react that referenced this pull request Jan 23, 2019
n8schloss pushed a commit to n8schloss/react that referenced this pull request Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants