One of the most difficult problems in web development today is the need to use the same views to render HTML on a web server and to update DOM nodes to reflect changes that occur on the client.
This desire comes down the need to server render for SEO, performance, and fallback reasons, while additionally needing complex, interactive applications.
Most frameworks today have consolidated on the idea of Isomorphic JavaScript, sometimes also called Universal JavaScript, as a solution to this problem.
I find isomorphism to be an inadequate solution to the use-case stated above. Isomorphism has the following problems:
The abstraction used to enable isomorphism is the component model. In a component model UI is built up self-contained "components", objects that represent what should be rendered and some state.
However this abstraction is client-centric and that fact often leaks. This manifests in problems such as:
- Memory leaks - Caused by assuming a single-user and a relatively short lifespan of the application. One example of a memory leak would be storing state in an array in some global scope.
- Security issues - Again caused by single-user assumption, things like a
session
might be stored in some global state and then accessed by another user's request by mistake. - Environment dependent code - Use of code that is not isomorphic but instead depends on one environment's APIs; ie use of
window.getComputedStyle()
. Since component frameworks are client-centric you often have to work around their use on the server by avoiding running the non-compatible code on the server (or attempt to shim the environment).