dillon1000/react
Commit
Browse files SSR fixture (#9547)
Adds a server-rendering fixture based on create-react-app without ejecting. This is using the full-page strategy because I wanted to flush out any issues with it. Turns out there's a lot of little things that are fixable and some non-fixable. This actually surfaced some differences between the current strategy and the one I had in mind. This uses the asset manifest from webpack to pass the final URLs to the client. This ensures that we can render the same exact mark up on the client - including the URL to our own script that we're running in. Doing full document renders work with 15.x as long as the checksum matches. However, with the patch up reviving strategy I had in mind it would end up removing the CSS tags that webpack injects before running our render call. This is a behavior change. In dev mode the server runs a proxy in front of the normal CRA webpack server so that we can replace the HTML request for the root page. I don't know what the best way to link in the react and react-dom packages. Each fixture has a different strategy so here's another one. Just add NODE_PATH=../../build/packages in front of all commands.
Changed paths13 files
First-parent comparisonfixtures/ssr/README.md AddedA fixtures/ssr/package.json AddedA fixtures/ssr/public/favicon.ico AddedA fixtures/ssr/public/index.html AddedA fixtures/ssr/server/index.js AddedA fixtures/ssr/server/render.js AddedA fixtures/ssr/src/components/App.js AddedA fixtures/ssr/src/components/Chrome.css AddedA fixtures/ssr/src/components/Chrome.js AddedA fixtures/ssr/src/components/Page.css AddedA fixtures/ssr/src/components/Page.js AddedA fixtures/ssr/src/index.js AddedA fixtures/ssr/yarn.lock AddedPatch
Files changed
Rendering syntax-highlighted changes…