简体   繁体   English

Ember.js服务器端或客户端或两者兼而有之?

[英]Ember.js server side or client side or both?

I'm a little confuse with Ember.js, I don't understand some basic concepts related to Ember. 我和Ember.js有点混淆,我不了解与Ember相关的一些基本概念。 I see on the official page that Ember is a client side framework. 我在官方页面上看到Ember是一个客户端框架。

The reason for this difference is due to Ruby on Rails being a server-side framework, whereas Ember is a client-side framework. 造成这种差异的原因是Ruby on Rails是一个服务器端框架,而Ember是一个客户端框架。

Ember Doc. 恩伯博士

But at the same time, I know that Ember run under Node.js which is a server side framework. 但与此同时,我知道Ember在Node.js下运行,这是一个服务器端框架。

It is also true that with Ember I can build the views and components for the user's interfaces. 使用Ember我也可以为用户界面构建视图和组件。

So, I'm very confused, is Ember a server side framework, client framework or both? 所以,我很困惑,Ember是服务器端框架,客户端框架还是两者兼而有之?

Thanks. 谢谢。

Server-side rendering is different than server-side framework . 服务器端呈现服务器端框架不同

What we have generally in a server-side framework : 我们通常在服务器端框架中拥有的内容

  • Data source access (database access) 数据源访问(数据库访问)
  • Transaction management 交易管理
  • Security management 安全管理
  • Scheduled tasks 计划任务

What we have generally in a client-side framework : 我们通常在客户端框架中拥有的内容

  • Displaying data 显示数据
  • Dealing with user input 处理用户输入

So as a result, Ember.js is client-side framework. 因此, Ember.js是客户端框架。

Of course, you can access data sources (such as pouchdb) from ember.js or you need to implement a security policy in client-side. 当然,您可以从ember.js访问数据源(例如pouchdb),或者您需要在客户端实现安全策略。 But those are not the case, core implementation for a security has to be done in server-side. 但事实并非如此,安全性的核心实现必须在服务器端完成。

Ember.js has two options about rendering UI : Ember.js有两个关于渲染UI的选项:

  • Client-side rendering : rendering are placed in user's browser. 客户端呈现 :呈现放置在用户的浏览器中。
  • Server-side rendering : rendering are placed in a server than results are send to the client's browser. 服务器端呈现 :呈现放置在服务器中,而不是将结果发送到客户端的浏览器。 (via fastboot) (通过fastboot)

Ember is a client side framework , primarily used to write Single Page Applications for the Web platform. Ember是一个客户端框架 ,主要用于为Web平台编写单页应用程序

Ember uses Node as a tool to improve the development process and developer productivity with NPM and an accompanying CLI tool called Ember-CLI . Ember使用Node作为工具,通过NPM和随附的名为Ember-CLI的CLI工具来改善开发过程和开发人员的工作效率。 This tool includes things like building the application scripts, installing dependencies, combining resources, using a live-reloading development server etc. That being said, you could build an Ember application without ever using Node, it's just more work you would need to do on your own. 这个工具包括构建应用程序脚本,安装依赖项,组合资源,使用实时重新加载开发服务器等等。也就是说,你可以在不使用Node的情况下构建Ember应用程序,这只是你需要做的更多工作。你自己。

Ember also supports rendering its views on the server via Fastboot . Ember还支持通过Fastboot在服务器上呈现其视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM