带有node.js的前端JavaScript框架 [英] Frontend javascript frameworks with node.js

查看:141
本文介绍了带有node.js的前端JavaScript框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始学习前端JavaScript框架,如Backbone.js或Embers.js,我想在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.

我还想知道是否在服务器和客户端都使用JavaScript,因为我使用相同的语言,如果有任何类型的功能,我可以使用在他们之间共享一些代码,如果任何前端框架更适合Node.js,因为这样。

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.

推荐答案

t真的指出了一个适合NodeJS应用程序和Frontend两者的前端框架。

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

A 。 NodeJS本质上是服务器端。但它的JavaScript。这意味着所有好的功能实用程序,如 underscore.js uglify.js ,您自己的功能(像您可能已经开发的用于在基于Web的JavaScript中查找数组中的项目的逻辑)等可以在后端。

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 。前端已经发展,JavaScript应用也是如此。根据您的问题,当您想开发一个页面的应用程序时,您可能需要查看MVC,MVVM,MVW,MVP 设计模式。例如BackboneJS可帮助您构建MVC应用程序。虽然有像jQuery的图书馆在Rich应用程序中处理DOM,ajax和其他内容,但大多数情况下,您将发现应用程序是多种功能的组合。

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


  • 单页MVC应用程序还需要动态视图,因此,模板化。例如,Ember使用 Handlebars 。 Backbone使用下划线等。

  • 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 。当您想要选择应用程序前端的框架时, TodoMVC 是最好的选择 - http://todomvc.com/

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

D 。当您想要选择后端框架(在您的情况下,NodeJS)时,您可能需要查看 Express Geddy

如果NodeJS是普通浏览器JavaScript,Express和Geddy将是骨干 - MVC

此外,对于NodeJS应用程序, NPM注册表有很多实用程序列表,其中大部分是您已经在浏览器JavaScript中使用的事物的端口

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

<强>电子即可。一个服务器简单地提供页面和资源。因此,即使您在后台和前端都使用JavaScript,您也需要单独的努力和文件/脚本。您唯一可以从共同的 中获得的是,相同的前端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

这篇关于带有node.js的前端JavaScript框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆