erikras / erikras/react-redux-universal-hot-example

Practical applications

Open
#678 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.1k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

I've been parsing through and reading all the code, getting a sense for the architecture, for about a week. And after deciphering line after line, I keep coming back to one fundamental question: "What's the point of having a javascript app that can be run on both the client and the server?" Or more to the point, what's the _practical_ application of an app like that?

I can understand the need for things like webpack to be universal, it's easy to imagine a scenario where one is building a web application with a both a user interface and a server component. In that case, having tools like webpack is incredibly useful seeing as you can change Sass styles and api routes in the same application. When it comes for the need for the application to be run both on the server and on the client, I'm at a loss for why. To me, it makes no sense to give a web application that ability, and here's why:

**Everything on the client can be done by the server**

When talking about isomorphic or universal apps, one is talking about an application running independent of its environment. While I do think this is a noble and worthwhile goal, in practice it doesn't make sense. If you're building a website with no server-side needs, you can simply build it on the client. If you do need the server, then you can build it on the server, render to the client, and make use of tools like `webpack-isomorphic-tools`.

**Added complexity**

There's an enormous amount of added complexity to the application. The structure blew me away (not in a good way). The staggering amount of code needed to ensure that the application could run smoothly in either environment stuck me as simply unnecessary. Why not just build a server-side rendering app? It took me a very long time to chase down every single piece of functionality and that was solely due to abstractions used to encompass client vs server functionality such as the `ApiClient`.

Is there something I'm missing? As an engineer, I can't ever see myself needing a javascript application that runs both via a browser and via a server since everything that can be achieved client side can be achieved server side (and more). As I said, I do agree with having certain _tools_ be isomorphic but an entire application? The endeavor seems to be nothing more than a fun exercise.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.