So many frameworks

#1

Once it was easy, you had plain javascript, and you had jQuery.
Nowadays it's like trying to choose one single item in a supermarket, too many choice :smile:

I did search a bit, and found some interesting articles (also on SitePoint), but if someone could advise me I would be really grateful: what framework would you use today if you could choose freely?

I don't want to install anything, just use it in a website (like jQuery).

Please let me know if you need more info to be able to give me an advice.

1 Like
#2

Hey Guido,

Is it just an actual (content-oriented) website, where you're wanting to add a few bells and whistles? Or you're talking about an application, where you're going to be providing more complex functionality, fetching data in the background and re-rendering sections of the UI etc?

#3

this

#4

OK, and another question I forgot to ask.. how far back do you need to go with browser support?

#5

IE11
For other browsers there's no issue, just the latest version

#6

Hmmm, OK.. so probably my recommendation would be either Backbone or Knockout. I'm slightly biased here, as these are the two frameworks/libraries that I've had most exposure to, but I'll explain my reasoning:

Small learning curve: Backbone is relatively simple to get your head around, and sticks close to the traditional way of working with the DOM. Knockout is maybe slightly more complex due to using two-way data bindings and making you declare those bindings directly in the HTML.

No need for additional tooling: Both will run by including the relevant scripts in your page. There's no need for additional build/compile steps, or setting up task runners etc if you'd prefer not to.

Work fine with or without jQuery: Both will happily co-exist with/use jQuery out of the box, although Knockout doesn't need it to function and Backbone can be configured to work without it if you'd prefer to use native DOM methods.

Good support/community: As both have been around for a long time now, there is good documentation, plenty of articles and tutorials available, and many plugins/snippets for doing pretty much anything you might want.

In terms of pros/cons for choosing between them, Knockout is really just a view library and leaves you on your own in terms of application structure. Backbone, on the other hand, provides other components like models, collections, and routers.

3 Likes
#7

As time goes by, I think this will bind your hands more than anything.

In addition to Backbone or Knockout, Angular 1.x works without any extra steps, but Angular 2 will require some building and most everything I've seen has been in TypeScript. You can do React, but you can't use the JSX everything is built in. I don't think Vue.js requires anything extra. Other than that, don't forget about TodoMVC to kinda give you an idea of what's out there and some code samples.


Commit Strip

1 Like
#8

I can install on my local machine, but not on the machine where the website will be deployed, so there it has to be just JS and libraries.

#9

Oh well that's fine then, you're open to just about anything. I think most just need the build step on your local machine then you push the compiled version to the server. I can't think of any off hand that don't work this way, Compiling per request would greatly affect performance.

React is the current juggernaut.

#10

I think I'll start with React. Might as well go for the new kid on the block :wink:

#11

I'm glad we have context here.

2 Likes
#12

??

#13

Maybe it's an American thing, but "go with" can mean "date" as in romance

BTW

Maybe not so much, never heard of MicroSofts flavor - JScript?

https://msdn.microsoft.com/en-us/library/yek4tbz0%28v=vs.84%29.aspx

I personally ran into a "gotcha" or three until I realized there were some differences.

Perhaps not as well known as the MS HTML differences were during the browser wars, but they were there to befuddle my copy-paste younger me.

#14

Always a problem if you needed to support IE3 through IE9 (even though IE9 supported JavaScript as well as JScript)

#15

You might want to get a running start at it then with https://github.com/egoist/feng and fast-start a website with React, Webpack and Hot reload.

That's not the only one out there of course, but it's the latest one that's making it to the This Week in JavaScript update next week.

#16

Good choice, React's tiny API will let you be productive really quickly. Backbone is still an option if you have a handful of views you want to make more dynamic, but React's rendering is much smarter and simpler to reason about.

#17

This article does a pretty good job of comparing three of the most popular: http://smashingboxes.com/ideas/choosing-a-front-end-framework-angular-ember-react

2 Likes
#18

I was at odds whether to mention that or not, and was going to surprise when it arrived in the This Week in JavaScript update. Foiled again!

#19

Aw man! Trying to do a good turn. Now I feel bad : )

#20

Don't :smiley:
Thanks for the article. Now I'm doubting again though. It seems React only takes care of the UI? So for the rest (communication with the server) I should use something else? It would be a pity if I had to use jQuery just for the Ajax part?
Maybe I might as well look into Ember? Or would that be overkill?