3 ms·
If you use the right tools, SPAs reduce complexity. The problem is that most of the popular frameworks today add unnecessary complexity. I still can't believe
by cryptica 7y ago
If you use the right tools, SPAs reduce complexity.
The problem is that most of the popular frameworks today add unnecessary complexity.
I still can't believe that we live in a world were most developers are OK to coding with a 5 to 15 second build delay and source mapping during development. I find is extremely frustrating. It slows me down and breaks my train of thought.
- tluyben2 7y ago> If you use the right tools, SPAs reduce complexity Like? I am curious: built a few SPAs (quite complex ones) and it sucked; I got the tools/frameworks from HN. If you use the right tools ‘tradional’ websites are not complex either.
- cryptica 7y agoI do think that sometimes you just need a simple static website and then don't need an SPA. I think SPAs are good when you have to handle a lot of dynamic data. Especially realtime data. I built a sample SPA with VueJS, Asyngular and RethinkDB to demo how easy it is. It's a relatively complex app where all the views update in realtime but all the server code is less than 300 lines. The framework does most of the work; on the back end, all you need to do is define the data schema and access control rules on the server side. See https://github.com/SocketCluster/ag-crud-sample/blob/6805499f5e8b241632a703dd1f26eb99b2120872/server.js#L80-L148 https://github.com/SocketCluster/ag-crud-sample/blob/6805499... For the front end, I use VueJS in the simplest possible way without any build step during development. I just define my main app component and setup a component for each page: https://github.com/SocketCluster/ag-crud-sample/blob/master/public/app-inventory.js https://github.com/SocketCluster/ag-crud-sample/blob/master/... For data, I just use my own model and collection components to bind to the server data in real-time: https://github.com/SocketCluster/ag-crud-sample/blob/master/public/pages/page-category-details.js#L17-L26 https://github.com/SocketCluster/ag-crud-sample/blob/master/... The collection component lets you bind to a 'view' which is declared in the schema on the server. It's just CRUD with realtime subscriptions built into the model and collection objects, nothing special. You can achieve a lot more if you just keep things simple (at least conceptually) and use the right tools.
- pier25 7y agoIf you go the SPA route you have to, at the minimum, add some form of routing and manage application state and logic. It doesn't matter how good the tools for doing that are, there is always going to be an overhead to do that.
- davidjnelson 7y agoThat’s a great synopsis of the tricky bits, which I’ve noticed provide the most value to unit test as well.