MickCoelho / react-isomorphic

A base platform for you to build an isomorphic JS website
3 stars 1 forks source link

Just curious... #2

Open oliverox opened 8 years ago

oliverox commented 8 years ago

Great job in coming up with a very simple react-isomorphic boilerplate. I was just curious to know why this hasn't become more popular than I think it should have. Are you using this technique still? Or have there been newer ways of doing this? I'm particularly interested in how you are able to get CSS requires on both frontend and backend.

MickCoelho commented 8 years ago

Thanks! I've been struggling to get the css on both frontend and backend, this was the main reason why I created this repo. It's actually been a while that I didn't work on it (so dependencies may not be up to date at all), the project isn't fresh anymore in my mind, but the important part is being done here: https://github.com/MickCoelho/react-isomorphic/blob/master/src/server.js#L113

Also, I think numerous people are working on new ways to do that. It may not been the greatest boilerplate, but that styling thing was working pretty well. Also, critical stylesheet was dynamically generated by the server based on the client's device dimension. So, basically, if you're browsing the app using an iPhone, the critical stylesheet displayed before the content will contain only the styles relative to mobile phones (and so, the other styles for tablet/desktop will be loaded at the end of the page and won't block the render)