blog.codecarrot.net

How Developing SPA Influenced Me & My Code

11/9/2017Updated 11/25/2025

Excerpt

Of course, it wasn’t always pretty and shiny. In the past, I was skeptical about SPAs. The argument of productivity in rails appealed to me. I must admit, the new way of doing things and learning a javascript framework has been a steep learning curve. You won’t be moving as fast as with rails in the beginning. JavaScript can feel less familiar than ruby and testing can be awkward: they are different tools, created for different environments and purposes. The change of paradigm also brings a whole suite of new challenges. For example, the lifecycle of a page is longer: you can expect the user to have an application open in a tab for hours! That’s why you need to be extra careful about memory management by removing references and bindings to unused objects, so that JavaScript’s GC can sweep them. Memory leaks can cause deterioration of responsiveness or even crash the browser tab. The back button is a common trouble spot in SPAs. You need to make sure it works as expected (check if the framework can handle it for you). Moreover, in most cases, refreshing the page should bring up the same view (this applies to links shared with others too).

Source URL

https://blog.codecarrot.net/how-developing-spa-influenced-me-and-my-code/

Related Pain Points