This video was me just 2 years ago at ng-conf talking about how Isomorphic JavaScript was going to take the world by fire. At that time, the idea of duplicating code in two places (i.e. once on the server for search engines and another on the client for rich user interfaces) made me sick. DRY rules!
Well…a lot has happened since then. Specifically, a few specific things have drastically affected the way I view the concept of Isomorphic JavaScript:
I talk a little about all of this in one of my latest talks on code management at AngularConnect:
For all of these reasons, I truly believe that Isomorphic JavaScript is dead. Well…at the very least the concept of Isomorphic JavaScript where you could just take an app build for the client and then just let it magically work on the server. I don’t buy into that at all anymore.
Instead, I believe the future is all about authoring your platform-specific code in one place (i.e. you can have your SEO code together with your rich client code in the same repo), but then having different parts of your app specialized for only one or the other. In other words:
These two can live on the same domain with the same website (and in many cases should). For example, check out the United Airlines Phone Number page on GetHuman.com. It is only server rendered with no client side JavaScript. However, if you click on a link (for example, the “Skip Waiting on Hold Button”) you will start to interact with a series of pages that are client loaded and have some rich features.
Oh, and one more thing…when you start to go down this path there is an added bonus. The server-only landing pages you create should be very close to the AMP specification. It shouldn’t take you too much work to “AMPify” you pages which should yield even more benefits for the user experience during initial load. I am going to be talking a lot more about this at ng-conf 2018 with my talk, Super-Powered, Server-Rendered Progressive Native Apps.