3 ms·
I think your architecture is sound, and I think it's the easiest way to build a site. But there are two aspects I think you're missing: 1. SPA means something
by natecavanaugh 9y ago
I think your architecture is sound, and I think it's the easiest way to build a site.
But there are two aspects I think you're missing:
1. SPA means something different to everyone. I believe the most common definition is a site where the UI is rendered on the client and the server is just a bunch of API end points that return JSON. At least that's where the phrase started coming from however it has grown to include some flavor of what you're doing (returning fragments from the server).
Some people think of SPAs as isomorphic or universal webapps, but those both leverage and suffer from the code sharing aspect.
2. Depending on the flavor of SPA, it's a different kind of hard, and I do think it is hard simply because of how drastically different each architecture is. Even sites that run on Node and share code can use anything from a traditional MVC, to using a Redux architecture, etc. And a new paradigm will always be "hard".
My overall point though, is that of all of the architectures, I do believe that rendering on the server and transporting fragments is by far both the cleanest and easiest to implement and rendering on the client will always suffer in complexity and/or performance.
But, the wealth of options does make everything a lot harder.