Frontend javascript frameworks with node.js


I am starting to learn frontend JavaScript frameworks like Backbone.js or Embers.js and I wanted to do some projects in Node.js. I have been reading some documentation and it seems these frameworks are used when you create an application in a single page. I'm used to developing apps which are divided into several pages and I wonder if those frameworks would be more a help or a burden to the project in my case.

I also wanted to know if as JavaScript is used both in the server and the client, as I use the same language if there is any kind of feature I can use to share some code between them, and if any frontend framework is more suitable for Node.js because of this.

1/23/2015 9:50:16 PM

We can't really point out a frontend framework suitable simultaneously for NodeJS applications and Frontend both.

A. NodeJS is essentially server side. But its JavaScript. This means all the good functional utilities like underscore.js, uglify.js, your own stuff for functionality (like a logic you might have developed for finding an item in an array in web based JavaScript), etc. can be used at the backend.

B. Frontend has evolved, and so have JavaScript Applications. Per your question, when you want to develop one page applications, you might want to look at MVC, MVVM, MVW, MVP Design Patterns. For eg. BackboneJS helps you build MVC Applications. While there are libraries like jQuery taking care of DOM, ajax and other stuff in Rich Applications, most of the time you will find the application is a combination of multiple things

  • A one-page MVC application also requires Dynamic views, and so, templating comes into picture. For eg., Ember uses Handlebars. Backbone uses underscore, etc.

C. When you want to choose a framework for Frontend of your application, TodoMVC is the best to decide -

D. When you want to choose a framework for Back-end (in your case, NodeJS), you might want to look at Express and Geddy.
If NodeJS were Plain Browser JavaScript, Express and Geddy would be Backbone - for MVC
Additionally, for NodeJS apps, the NPM registry has enormous list of utilities, most of which are port of things you have already used in Browser JavaScript

E. A server simply serves pages and resources. As per my little knowledge therefore, even if you are using JavaScript both at backend and frontend, you would need individual efforts and files / scripts at both. The only thing you would benefit in common is that the same frontend JavaScript developers can work on the backend with a smaller learning curve.

I have seen experts dropping the idea of a framework due to burden of a learning curve. At the end of the day, therefore, some research must be performed specially for an application that uses multiple technologies, and the efforts involved to learn and implement those

10/29/2015 10:31:32 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow