Your SPA doesn’t need a router ↦
So you are building a client-side web app for that next big project and wondering: “Which router should I use?”. Here is the thing: you don’t need any, and you will understand why shortly.
Intriguing!
So you are building a client-side web app for that next big project and wondering: “Which router should I use?”. Here is the thing: you don’t need any, and you will understand why shortly.
Intriguing!
Discussion
Sign in or Join to comment or subscribe
Anders Hovmöller
2020-07-16T05:41:38Z ago
Seems weird. Doesn’t he just describe building your own router? I was hoping for what the title promises: no router.
Jerod Santo
Bennington, Nebraska
Jerod co-hosts The Changelog, crashes JS Party & takes out the trash (his old code) once in awhile.
2020-07-16T11:12:13Z ago
Yeah, I guess a more accurate headline would say your SPA doesn’t need “a general routing solution” vs “a router”. The only way I can imagine not needing any kind of router whatsoever is to have an app so simple that you only have a single route anyhow.
But what he is really advocating for is doing the work of routing from other aspects of your application: do dependency checks in your controller, do component selection in your view, do path/state marshalling with a focused library, etc.
Maybe all of that is just moving the furniture around and doesn’t net you enough wins to be worth the effort, but it’s an intriguing proposition nonetheless.
I see the life of a software developer as living on a continuum somewhere between Dependency Hell and Not Invented Here syndrome. Some lean towards DH, others toward NIH. Different strokes for different folks. In this article, Stanislav is making the case for a little less DH and a little more NIH.
Stanislav Cherenkov
2020-07-24T10:06:15Z ago
Jerod, you are absolutely correct about headline. I feel like I need to apologize for it: the headline is not very accurate to trick frontend developers en masse into reading the article. And there is no better way to do it other than make them indignant.
But actually I came here to thank you for the quality comment. One doesn’t see many of these nowadays.