DEV Community

Cover image for Do I really need a SPA framework?

Do I really need a SPA framework?

Chris Noring on October 10, 2019

If you work with frontend and unless you haven't been living under a rock, then you might have heard terms like SPA or React, Angular or even Vue....
Collapse
 
john_papa profile image
John Papa

I built my own a few years back. I did not intend to, but when I was done I realized how much code I had written, how it STILL was not as good as the existing options (backbone, knockout, angular, dojo, etc at the time), and nobody but me really knew how to use it.

However - it was a great experience and I learned a lot about Web programming in a much deeper level than I had previously. So it was worth my time.

I absolutely recommend trying pure vanilla js/html/css and the DOM to understand the web world. But Highly recommend using incredible tools like React, Vue, Angular and Svelte.

Collapse
 
softchris profile image
Chris Noring

100% agree :) Yea that's one of the perils, who can use this library but me. Yea there's a lot of learning in building things yourself, for the appreciation of other peoples work but also understand the architecture behind

Collapse
 
learnwithparam profile image
Paramanantham Harrison

Hi Chris,

Is there a github link for complete example for this article?

And thanks for this article. It’s really helpful

Collapse
 
softchris profile image
Chris Noring

yes here github.com/softchris/vanilla-spa it's using a backend that uses json-server to simulate a rest API. Start backend first then frontend.

Collapse
 
learnwithparam profile image
Paramanantham Harrison

Thanks chris

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

There is an interesting way to pretender using Chrome headless only for crawlers, you send the browser to load content before it's served to a crawler. developers.google.com/web/tools/pu...

The technique works well if you didn't initially build the platform in some prerenderer like nuxt, next and so on.

Collapse
 
yerac profile image
Rich

I really like articles like these. People are obsessed with frameworks and although they know the inner workings of Vue/React/Angular etc, they don't know how to solve vanilla issues without several NPM packages! Your right that this won't solve a lot of issues, but for a static portfolio for example, this would be much more suitable and also working with pure vanilla JS is a great way to improve skill

Collapse
 
softchris profile image
Chris Noring

Thanks Rich :)

Collapse
 
danjou profile image
Max Ludwig
Collapse
 
johnlobster profile image
John Webster

Hi, excellent article. I was just thinking about doing something similar and wondering how the routing might work. It had never occurred to me that handlebars could be used in the client

Why is the script with the template not executed? Is it because the type is set to handlebars?

Collapse
 
softchris profile image
Chris Noring • Edited

Thanks John. Yea, precisely :)