Re:Immutable Web Apps
by jasonhansel on Wednesday December 05, 2018 @09:04AM
(#18608226)
Isn't this incompatible with server side rendering? Rendering the page's contents initially on the server is good for performance, SEO, accessibility, etc.
[ Parent
| on HN ]
Since this page is talking about SPAs, the only "entry point" it considers is `index.html`. I don't see anything against pre-rendering parts of `index.html` on the server-side -- just that the configuration embedded in `index.html` of _which_ static assets to use and _what_ the environment defines must be managed.
In multi-page applications (MPAs?), among the other things that would probably have to be accounted for, you could treat all of your pages as "entry points" in the same way as `index.html`.
Nope - works perfectly. With React/Redux you can inject the initial state into the rendered page. Subsequent calls are then just api.
See https://redux.js.org/recipes/serverrendering#inject-initial-...
for ideas.
Re:Immutable Web Apps
by jugglebird on Friday December 07, 2018 @05:58PM
(#18632481)
There are elements of the article that argue against that though. It argues that the index.html will be small (and thus not an issue to not cache), which will not be the case if you're server-rendering pages.