The simple guide to server-side rendering a styled-components appDecember 12, 2017 at 10:19am
@brotzky just published a great, concise guide on server-side rendering a React + styled-components app 😍
Do you do server-side rendering? If so, what's been the hardest part about it?
December 12, 2017 at 11:20am
I wrote setups to have a single webpack process and config for both the server and client + bundle splitting from scratch mostly
But I’m hosting some of that code as a boilerplate now (no docs sorry) if anyone’s interested :) https://github.com/philpl/micro-gql-react-ssr-boilerplate
Been using S-C SSR within Nextjs. The hardest part has been the Next part :P, however they've been doing an awesome job upgrading it and I am enjoying it. Obviously, I used the setup listed within your docs. https://www.styled-components.com/docs/advanced#nextjs
On the frontend you bundle all your npm dependencies into the bundles, for a Node server you don't want to do that since they can just be required at runtime
Thanks for the feedback @phil, really appreciate the suggestion and link to a resource that implements it! To be honest, I wasn't aware of that process and tried to keep this guide as simple as possible. I tried to keep the focus off Webpack and even thought of using Parcel after it came out. Including a from scratch solution might confuse a few people as it looks like you've got about 6 separate files to build that demo project.
Thanks for taking a look and I learned something new looking through your repo :)!
April 8, 2018 at 2:46pm
April 16, 2018 at 1:40am