Cool Single Page Apps and advice on creating them
I'm looking for opinions and advice on creating a single page app. I'm currently thinking of using Backbone.js but I've got a while before I have to make a decision. If anyone has made a single page app It would be cool if you give a demo link and/or some insights. Again any advice would be helpful. I want to make the right decision for my job and my team.
Posted Dec 28, 2016, 4:57 PM UTC
It really depends on your needs.
Different patterns make sense to different people. If you want to simply get the benefits of virtual dom and move away from things like jQuery and direct dom querying/manip, you may be quite comfortable with a fast vdom view layer and handle the rest of the architecture yourself. Many vdom libs use hyperscript and don't need any tooling setup or compilation steps. They are also very fast to pick up and understand. Mithril, Dio, vidom, snabbdom, domvm [1] are examples. If you want to benefit from large ecosystems and just use ready-made components, then the big frameworks are better, though typically require more learning, tooling, etc.
Look around, see what clicks.
[1] https://github.com/leeoniya/domvm (disclaimer: my own)
Yep I've been researching for about 2 weeks so not really looking for "the answer" just looking for pitfalls or success stories of single page apps you've worked on.
The SPAs I usually work on are internal back-office type stuff and manufacturing interfaces, so it's not something that can be made public. However, if you're looking for something a bit more fleshed out than Hello World, you can look through
/demos[1], particularly ThreaditJS [2] which is an implementation of [3] that forces app implementations to handle routing, error responses, network timeouts, slow replys, throttling, etc.It's rather difficult to evaluate frameworks without dedicating at least some time to implementing a widget of some sort. For me, React seemed like a no brainer (hype and all) until I ran into its performance implications and the officially sanctioned workarounds that were "par for the course". It didn't impress me, though I do understand its philosophy and the trade-offs it brings to the table. Mithril and domchanger were much closer, but still either had performance issues or surprising gotchas. In the end I wrote domvm which was a mix of Mithril and domchanger with the performance and API for the type of code I wanted to write.
The hype train moves too fast for me :/ I'm quite content with letting the dust settle in 1 year cycles to see what survives.
I just recently moved to a Rollup -> Buble -> GCC dev cycle from a basic IIFE -> concat > minify cycle. Typescript might be next :)
[1] https://github.com/leeoniya/domvm/tree/2.x-dev/demos
[2] http://cdn.rawgit.com/leeoniya/domvm/2.x-dev/demos/ThreaditJS/index.html
[3] http://threaditjs.com/