
Ask HN: Which JavaScript libraries do you use for non single page applications? - Draiken
Hi there.<p>When you have a project that is clearly a SPA there&#x27;s a plethora of articles and questions about the best tool for the job. Personally I&#x27;ve worked before with Backbone, Ember (really early days) and very little AngularJS.<p>More often than not, I prefer to not use a library. Not even because of size or page load times, just to avoid having to deal with dependencies, all the build environment around it and sometimes the learning curve.<p>Almost inevitably after some period on a project, I see myself wasting a lot of time on JS-related work. Maybe it&#x27;s one page with an interactive form or it&#x27;s a bundle of components that are complex. But at the end of the day I catch myself thinking I&#x27;d have been better off using some kind of framework. The general overhead of writing it all myself (re-inventing the wheel I guess) when complex components come into play makes me doubt my earlier decision of not using something. We know it&#x27;s all about trade-offs.<p>Taking all that into account plus the ever-growing number of JS libraries that are available today it made me wonder if there are libraries that stand in the middle that I never heard of? Certainly HN can answer that.<p>If you were building a non single page application today with maybe some complex interactive pages. What libraries would you use?
======
bwackwat
Vanilla JavaScript; no libraries except XMLHttpRequest, WebSocket,
LocalStorage, etc.

~~~
Draiken
So you write `el.innerHtml = "<div>stuff</div>";`?

Can't remember the last time I did that. Probably back when I used PHP on my
first internship.

Don't you think it's a lot of added overhead rewriting the same over and over?
Things like data binding, validation, etc. If you do two projects with vanilla
JS you'd end up with a bunch of similar functions for this basic stuff.

~~~
bwackwat
Perfect! A no nonsense, innerHTML modification. Hah!

I transform my data into a JSON object, suited for the front end. So the only
Controller -> View boilerplate is a "call the api" JavaScript function.

My comment is primarily a criticism of the JavaScript world where folks can
NPM their entire server infrastructure (containing plenty of needless
files)...

