RRU 082: Progressive SSR with Dinesh Pandiyan




React Round Up show

Summary: <p dir="ltr"><strong>Dinesh Pandiyan is a developer from India. He started as a backend engineer and then moved to frontend. Currently he is working for ThinkMill in Sidney, Australia. Today Dinesh and the panel are talking about devtools and progressive SSR.</strong></p> <p dir="ltr"><strong>Dinesh got started with React Redux. The panelists talk about their experiences using primarily Redux for projects. Dinesh talks about his transition from backend to frontend and how it’s a totally different world. On the backend he was working in Java and it ran on a server, but on the frontend, code runs in a browser and the browser is very different for each user. Frontend development is tricky because you don’t know where your code is going to run.</strong></p> <p dir="ltr"><strong>One of the trickiest parts of frontend development is debugging something in production. Unless you have good logging tools, you won’t know what’s going on. Debugging this stuff when it’s running on client browsers is hard, but when you’re in development mode your own browser you’ve got handy tools. </strong></p> <p dir="ltr"><strong>They talk about some of the tools in React, and agree that console.log is the greatest debugging tool of all time. Dinesh talks about some of the most surprising features about React dev tools. You can benchmark your preferences and identify weaklings in your project, which are things that slow down your application or things that might slow it down. On an application level, you have to build a mental model of how the data flows from the top, where things change, etc, and dev tools can help you build that pretty easily. They talk about how things had to be done before great React tools. In fact, Dinesh chose React just for the devtools. They talk about how the dev tools for React compare to Java. The most important thing is that you have a good debugger that can stop where you want it to. </strong></p> <p dir="ltr"><strong>They transition to talking about the differences between SSR and progressive SSR For SSR (Server Side Rendering), rendering happens on the server and you send it to the client. CSSR (Client Server Side Rendering) is when all the rendering happens on the client’s side. PSSR (Progressive Server Side Rendering) is where you render small chunks on the server and then send it to the client bit by bit. They talk about how this has been occurring from the beginning of the internet. This concept is similar to microfrontends. </strong></p> <p dir="ltr"><strong>Dinesh gives advice on how to implement PSSR. He says that when you surver render, it loads on differently. Your framework has to do one complete pass of the histiema, so this means you cannot send things to the client until the whole histema is designated. To beat this they’ve been doing a mix of SSR and CSR, with the header, body, and non critical content rendering on the client side. PSSR bridges the gap between SSR and CSSR.</strong></p> <p dir="ltr"><strong>How do we make it real and how do we use it?</strong></p> <p dir="ltr"><strong>The panel discusses ways to make PSSR a reality. Dinesh has been experimenting with it with extra services, and he gives his method for doing it, emphasizing the importance of where you divide your code is very important, it has to be in sequence. CSS Grid solves this problem, so you could render things out of order and the browser puts it in the right spot. They talk about other ways to get around it. Lucas shares some of the difficulties he’s encountered with streaming and rendering. They talk about the new feature for the Phoenix framework for Elixir, Live View Now. For this feature, you don’t need client side frameworks to generate dynamic content and it enables two way streaming. However, it does not scale well for extremely large apps. They talk about some of the tradeoffs for using this feature. They conclude by discussing the gap between website optimization and device performance. </strong></p> <p dir="ltr"><strong>Panelists</strong></p> <ul> <li dir="ltr"> <p dir="ltr"><strong>Thomas Aylott</strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong>Dave Ceddia</strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong>Lucas Reis</strong></p> </li> </ul> <p dir="ltr"><strong>With special guest: Dinesh Pandiyan</strong></p> <h2 dir="ltr"><strong>Sponsors</strong></h2> <ul> <li dir="ltr"> <p dir="ltr"><span style="font-size:14px;"><a href="https://www.telerik.com/kendo-react-ui/campaigns/free-trial-react-8/?utm_medium=cpm&amp;utm_source=reactroundup&amp;utm_campaign=kendo-ui-react-trial-oct-8" target="_blank">​</a></span><span style="font-size:12px;"><a href="https://www.telerik.com/kendo-react-ui/campaigns/free-trial-react-8/?utm_medium=cpm&amp;utm_source=reactroundup&amp;utm_campaign=kendo-ui-react-trial-oct-8" target="_blank">Progress KendoReact</a> | Try now for FREE: <a href="https://www.telerik.com/kendo-react-ui/campaigns/free-trial-react-8/?utm_medium=cpm&amp;utm_source=reactroundup&amp;utm_campaign=kendo-ui-react-trial-oct-8" target="_blank">kendoreact.com/reactroundup</a> </span></p> </li> <li dir="ltr"> <p dir="ltr"><span style="font-size:12px;"><strong><a href="http://sentry.io/">Sentry</a> use the code “devchat” for 2 months free on Sentry’s small plan</strong></span></p> </li> <li dir="ltr"> <p dir="ltr"><span style="font-size:12px;"><strong><a href="https://devchat.tv/my-javascript-story/">My JavaScript Story</a></strong></span></p> </li> </ul> <p dir="ltr"><strong>Links</strong></p> <ul> <li dir="ltr"> <p dir="ltr"><strong><a href="https://react-redux.js.org/">React Redux</a></strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong><a href="https://developer.mozilla.org/en/docs/Web/API/Console/log">Console.log</a> </strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong><a href="https://developers.google.com/web/tools/puppeteer">Puppeteer</a></strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong><a href="https://webpack.js.org/">Webpack</a></strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong><a href="https://www.datadoghq.com/">Datadog</a> </strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong><a href="https://css-tricks.com/snippets/css/complete-guide-grid/">CSS Grid</a></strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong><a href="https://www.ibm.com/support/knowledgecenter/en/SS9H2Y_7.7.0/com.ibm.dp.doc/transport-headers_js.html">Transport headers</a></strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong><a href="https://phoenixframework.org/">Phoenix</a></strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong><a href="https://elixir-lang.org/">Elixir</a></strong></p> </li> </ul> <p dir="ltr"><strong>Follow DevChatTV on <a href="https://www.facebook.com/DevChattv/?__tn__=%2Cd%2CP-R&amp;eid=ARDBDrBnK71PDmx_8gE_IeIEo5SnM7cyzylVBjAwfaOo1ck_6q3GXuRBfaUQZaWVvFGyEVjrhDwnS_tV">Facebook</a> and <a href="https://twitter.com/devchattv?lang=en">Twitter</a></strong></p> <h3 dir="ltr"><strong>Picks</strong></h3> <p dir="ltr"><strong>Lucas Reis:</strong></p> <ul> <li dir="ltr"> <p dir="ltr"><strong><a href="https://benhoyt.com/writings/learning-elm/">Ben Hoyt Wholesome Learning Elm</a></strong></p> </li> <li dir="ltr"> <p dir="ltr"><strong><a href="https://shop.lodgemfg.com/prodcat/skillets-and-covers.asp">Cast iron skillet</a></strong></p> </li> </ul> <p dir="ltr"><strong>Thomas Aylott:</strong></p> <ul> <li dir="ltr"> <p dir="ltr"><strong><a href="https://www.jw.org/en/publications/magazines/awake-no2-2019-jul-aug/">6 Lessons Children Need to Learn</a></strong></p> </li> </ul> <p dir="ltr"><strong>Dinesh Pandiyan:</strong></p> <ul> <li dir="ltr"> <p dir="ltr"><strong><a href="https://todoist.com/?lang=en">To-Do List app</a></strong></p> </li> </ul> <p dir="ltr"><strong>David Ceddia: </strong></p> <ul> <li dir="ltr"> <p dir="ltr"><strong><a href="https://jclem.net/posts/on-the-utility-of-phoenix-liveview">On the Utility of Phoenix Live View</a></strong></p> </li> </ul>