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

[Flight] Move around the Server side a bit #17251

Merged
merged 3 commits into from
Nov 2, 2019

Conversation

sebmarkbage
Copy link
Collaborator

Builds on top of #17234.

Just some clean up before I add more stuff.

This will need to use a variant of Fizz to do inline SSR in Flight.
However, I don't want to build the whole impl right now but also don't
want to exclude the use case yet. So I outsource it to the existing
renderer. Ofc, this doesn't work with Suspense atm.
@sizebot
Copy link

sizebot commented Nov 1, 2019

Size changes (experimental)

Details of bundled changes.

Comparing: fadc971...b36dfdf

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.54 KB 123.54 KB 38.79 KB 38.79 KB NODE_PROFILING
react-dom-unstable-flight-server.browser.development.js -13.5% -10.6% 5.15 KB 4.45 KB 2.01 KB 1.79 KB UMD_DEV
react-dom-unstable-flight-server.browser.production.min.js -22.4% -21.4% 1.71 KB 1.33 KB 977 B 768 B UMD_PROD
react-dom-test-utils.development.js 0.0% -0.0% 56.27 KB 56.27 KB 15.58 KB 15.58 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
ReactDOMServer-dev.js 0.0% -0.0% 139.64 KB 139.64 KB 35.41 KB 35.41 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 48.79 KB 48.79 KB 11.13 KB 11.13 KB FB_WWW_PROD
react-dom-unstable-flight-client.development.js 0.0% -0.1% 4.67 KB 4.67 KB 1.55 KB 1.55 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.development.js 0.0% -0.0% 951.45 KB 951.45 KB 215.02 KB 215.02 KB UMD_DEV
react-dom-unstable-flight-server.node.development.js -11.9% -7.2% 5.12 KB 4.51 KB 1.92 KB 1.78 KB NODE_DEV
react-dom.production.min.js 0.0% -0.0% 119.74 KB 119.74 KB 37.73 KB 37.73 KB NODE_PROD
react-dom-server.node.production.min.js 0.0% -0.0% 20.72 KB 20.72 KB 7.61 KB 7.61 KB NODE_PROD
react-dom-unstable-flight-server.node.production.min.js -22.6% -17.5% 1.55 KB 1.2 KB 874 B 721 B NODE_PROD
react-dom-unstable-flight-server.browser.development.js -12.6% -8.2% 4.85 KB 4.25 KB 1.89 KB 1.74 KB NODE_DEV
react-dom-unstable-flight-server.browser.production.min.js -23.6% -19.0% 1.48 KB 1.13 KB 849 B 688 B NODE_PROD
ReactFlightDOMServer-dev.js -12.0% -6.9% 5.05 KB 4.44 KB 1.88 KB 1.75 KB FB_WWW_DEV
react-dom-unstable-fizz.node.development.js 0.0% -0.1% 3.97 KB 3.97 KB 1.53 KB 1.53 KB NODE_DEV
ReactFlightDOMServer-prod.js -21.2% -16.4% 2.94 KB 2.32 KB 1.1 KB 940 B FB_WWW_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 10.48 KB 10.48 KB 3.58 KB 3.57 KB NODE_PROD
react-dom-unstable-fizz.node.production.min.js 0.0% -0.1% 1.12 KB 1.12 KB 676 B 675 B NODE_PROD

react-server

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-server-flight.development.js -12.6% -10.5% 6.01 KB 5.25 KB 2.16 KB 1.93 KB NODE_DEV
react-server-flight.production.min.js -18.7% -16.4% 1.72 KB 1.4 KB 908 B 759 B NODE_PROD
react-server.development.js +1.5% +0.7% 4.77 KB 4.85 KB 1.76 KB 1.77 KB NODE_DEV

Generated by 🚫 dangerJS against b36dfdf

@sizebot
Copy link

sizebot commented Nov 1, 2019

Size changes (stable)

Details of bundled changes.

Comparing: fadc971...b36dfdf

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 10.46 KB 10.46 KB 3.57 KB 3.57 KB NODE_PROD
react-dom-unstable-flight-server.browser.production.min.js -23.8% -19.2% 1.46 KB 1.12 KB 840 B 679 B NODE_PROD
react-dom-unstable-flight-server.node.development.js -11.9% -7.3% 5.1 KB 4.49 KB 1.91 KB 1.77 KB NODE_DEV
react-dom.development.js 0.0% -0.0% 951.42 KB 951.42 KB 215 KB 215 KB UMD_DEV
react-dom-unstable-flight-server.node.production.min.js -22.7% -17.9% 1.53 KB 1.18 KB 866 B 711 B NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.1% 1.2 KB 1.2 KB 702 B 701 B UMD_PROD
react-dom.development.js 0.0% -0.0% 945.53 KB 945.53 KB 213.41 KB 213.41 KB NODE_DEV
react-dom.production.min.js 0.0% -0.0% 116.3 KB 116.3 KB 36.79 KB 36.79 KB NODE_PROD
react-dom-unstable-flight-server.browser.development.js -13.5% -10.6% 5.13 KB 4.44 KB 2 KB 1.79 KB UMD_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 10.72 KB 10.72 KB 3.67 KB 3.67 KB UMD_PROD
react-dom-unstable-flight-server.browser.production.min.js -22.6% -21.6% 1.7 KB 1.32 KB 969 B 760 B UMD_PROD
react-dom-unstable-flight-server.browser.development.js -12.6% -8.0% 4.84 KB 4.23 KB 1.88 KB 1.73 KB NODE_DEV
react-dom-server.node.development.js 0.0% 0.0% 137.39 KB 137.39 KB 36.08 KB 36.09 KB NODE_DEV
react-dom-test-utils.development.js 0.0% -0.0% 56.26 KB 56.26 KB 15.57 KB 15.57 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 20.26 KB 20.26 KB 7.53 KB 7.53 KB NODE_PROD
react-dom-unstable-flight-client.production.min.js 0.0% 🔺+0.1% 1.61 KB 1.61 KB 790 B 791 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-test-utils.development.js 0.0% -0.0% 54.53 KB 54.53 KB 15.24 KB 15.24 KB NODE_DEV

react-server

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-server-flight.development.js -12.6% -10.5% 5.99 KB 5.24 KB 2.15 KB 1.92 KB NODE_DEV
react-server-flight.production.min.js -18.9% -16.6% 1.71 KB 1.39 KB 900 B 751 B NODE_PROD
react-server.development.js +1.5% +0.6% 4.76 KB 4.83 KB 1.76 KB 1.77 KB NODE_DEV

Generated by 🚫 dangerJS against b36dfdf

await waitForSuspense(() => {
expect(result.model).toEqual({
html: '<div><span>hello</span><span>world</span></div>',
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Mind asserting we actually eventually got here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There’s going to be a hundred of these. I’m not going to assert in each one that the testing environment works.

Jest fails it the promise to the test never resolves.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean the promise could resolve without the inner expect actually having run successfully. If there’s a bug in waitForSuspense.

await waitForSuspense(() => {
expect(result.model).toEqual({
html: '<div><span>hello</span><span>world</span></div>',
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

sure

@sebmarkbage sebmarkbage merged commit f4148b2 into facebook:master Nov 2, 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.

4 participants