Html NW.js、Brackets-Shell 和 Electron 之间的功能区别是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23731517/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 01:49:40  来源:igfitidea点击:

What are the functional differences between NW.js, Brackets-Shell and Electron?

htmlnode-webkitelectronbrackets-shell

提问by Sven Slootweg

Now that TideSDK is effectively dead, I've been looking into alternative 'wrappers' to run HTML/CSS/JS applications as stand-alone desktop applications. The three viable options I have run across so far, are NW.js(formerly node-webkit), brackets-shell, and Electron(formerly atom-shell).

现在 TideSDK 实际上已经死了,我一直在寻找替代的“包装器”来运行 HTML/CSS/JS 应用程序作为独立的桌面应用程序。到目前为止,我遇到的三个可行选项是NW.js(以前称为 node-webkit)、括号外壳Electron(以前称为 atom-shell)。

The problem is that there does not appear to be a sufficiently complete comparison between the three in terms of feature set, compatibility, etc. I'm hoping to turn this into a more-or-less canonical thread on the (objective) differences between the three, in particular regarding:

问题是,在功能集、兼容性等方面,这三者之间似乎没有足够完整的比较。三者,特别是关于:

  • Platform support; operating systems, dependencies, etc.
  • Language feature support, as far as HTML5, CSS3 and JavaScript are concerned. Think things like "does HTML5 video work, and if yes, what codecs are available?"
  • Non-standard extra features, such as tray icons, popup notifications, and OS-rendered menu bars.
  • Extensibility; eg. ability to 'plug in' native code, talk to Node.js, and so on.
  • Architecture; in particular the architectural differences that affect daily usage as a developer.
  • Debugging; included development tools, compatibility with commonly used tools like node-inspector, etc.
  • ... and so on.
  • 平台支持;操作系统、依赖关系等。
  • 语言特性支持,就 HTML5、CSS3 和 JavaScript 而言。想想“HTML5 视频是否有效,如果是,有哪些编解码器可用?”
  • 非标准的额外功能,例如托盘图标、弹出通知和操作系统呈现的菜单栏。
  • 可扩展性;例如。能够“插入”本机代码、与 Node.js 对话等等。
  • 建筑学;特别是影响开发人员日常使用的架构差异。
  • 调试;包括开发工具,与常用工具的兼容性,如node-inspector等。
  • ... 等等。

What are the objective, technical differences that matter when making a choice between them as an application developer?

作为应用程序开发人员在它们之间做出选择时,重要的客观技术差异是什么?

采纳答案by John W. Clark

I did similar research about two months ago, and in the end I went with node-webkit. The biggest upside on node-webkit is node.js and npm. The package management of npm is really nice, and node has well done filesystem access.

大约两个月前我做了类似的研究,最后我选择了 node-webkit。node-webkit 的最大优点是 node.js 和 npm。npm 的包管理真的很好,node 的文件系统访问做得很好。

Brackets-shell looked interesting, but other than a nice IDE I didn't really get what made this one as good or better than the rest. They are very clear that "The brackets-shell is only maintained for use by the Brackets project ", that screams run away to me.

Brackets-shell 看起来很有趣,但除了一个不错的 IDE 之外,我并没有真正明白是什么让这个 IDE 和其他的一样好或更好。他们非常清楚“括号壳只为 Brackets 项目使用而维护”,这让我尖叫起来。

https://github.com/adobe/brackets-shell#overview

https://github.com/adobe/brackets-shell#overview

Atom-shell seems to be recently active, but it seems much like brackets in that they are really writing and editor/IDE that just happens to be attached to a webkit runtime. It also is built on top of node.js. This one has the downside of being difficult to search for stuff online without being reminded of your middle school chemistry.

Atom-shell 似乎最近很活跃,但它看起来很像括号,因为它们实际上是在编写和编辑器/IDE,恰好附加到 webkit 运行时。它也是建立在 node.js 之上的。这个有一个缺点是很难在网上搜索东西而不被提醒你的中学化学。

I really don't want an new editor, and most programmers have their favorite already. For the actual application development, they pretty much work the same, and should, since they all use webkit. You basically write 90-95% of it like a website, and then deal with the native parts, and some config.

我真的不想要一个新的编辑器,大多数程序员已经有了他们最喜欢的编辑器。对于实际的应用程序开发,它们的工作原理几乎相同,而且应该如此,因为它们都使用 webkit。您基本上像网站一样编写 90-95% 的内容,然后处理原生部分和一些配置。

These things are true for all three of them platforms - runs on Windows, Mac, and Linux language support - HTML5, CSS3 and Javascript : since they run javascript you can download and run nearly any library/framework that you want.

这些事情对于所有三个平台都是正确的 - 在 Windows、Mac 和 Linux 语言支持上运行 - HTML5、CSS3 和 Javascript:由于它们运行 javascript,您几乎可以下载和运行您想要的任何库/框架。

The big caveat on webkit is codec support. Typically you will have problems with non-free video codecs, unless you rebuild the dll/so to support them. For example the shipped node-webkit won't play mp4 video.

webkit 的一大警告是编解码器支持。通常,您会遇到非自由视频编解码器的问题,除非您重建 dll/so 以支持它们。例如,附带的 node-webkit 不会播放 mp4 视频。

回答by Luke Chavers

I've been playing with Atom-Shellover the last few days, and I am loving it so far.

过去几天我一直在玩Atom-Shell,到目前为止我很喜欢它。

The best part about it is that it's backed by GitHub.. which should allow you to settle into the platform for the long term, especially if it gains a large following. It's also made possible by direct Node.js improvements courtesy of a contract with StrongLoop, who is a major Node.js contributor (they claim to employ more Node.js core developers than any other company, even Joyent).

最好的部分是它得到了 GitHub 的支持......这应该能让你长期适应这个平台,特别是如果它获得了大量的追随者。通过与StrongLoop签订的合同直接对 Node.js 进行改进也使之成为可能,StrongLoop是 Node.js 的主要贡献者(他们声称雇用的 Node.js 核心开发人员比任何其他公司,甚至是 Joyent 都多)。

I've also found it rather comfortable to get started. It took me about a day to learn the structure and get my first proof of concept running. Very cool.

我也发现开始时很舒服。我花了大约一天的时间来学习结构并运行我的第一个概念证明。很酷。



Bullet Points:

要点:

  • Platform support:Windows, Linux, Mac OSX (More Info Here)
  • Language feature support:HTML5, CSS3, JS via Chromium - so far, zero issues, but I have not tested video specifically.
  • Native Features:Native App Menus, Task Tray Support, Global Hotkeys, Protocol Handler Support (that I've seen so far)
  • Extensibility:Excellent Node.js integration, both the client and server can "require" Node.js modules and natives. I've also successfully tested Bowerlibraries (incl jQuery) without issue.
  • Architecture:Covered in the other points, but in general its very smooth.
  • 平台支持:Windows、Linux、Mac OSX(更多信息在这里
  • 语言功能支持:HTML5、CSS3、JS 通过 Chromium - 到目前为止,零问题,但我还没有专门测试视频。
  • 本机功能:本机应用程序菜单、任务托盘支持、全局热键、协议处理程序支持(到目前为止我已经看到了)
  • 可扩展性:优秀的 Node.js 集成,客户端和服务器都可以“需要”Node.js 模块和原生模块。我还成功地测试了Bower库(包括 jQuery),没有问题。
  • 架构:涵盖了其他点,但总体来说非常流畅。


Update (11/25/14):I've not yet found use case for Atom-Shell in any official capacity, but I have used it to build a few small apps for my own use, the most complex being an app that pulls my time logs from my PM software and creates Paypal invoices.

更新(2014 年 11 月 25 日):我还没有找到任何官方身份的 Atom-Shell 用例,但我已经用它构建了一些小应用程序供我自己使用,最复杂的是一个应用程序我的时间从我的 PM 软件记录并创建 Paypal 发票。

My opinion of the platform remains positive. It's pretty awesome.

我对该平台的看法仍然是积极的。真是太棒了。

On my time invoicing app I successfully brought in Bootstrap 3's Dashboard Example Templateand a few node modules (bluebird, Paypal SDK, Teamwork PM Client) to create a mildly complex app. It took me a few days and does its job well.

在我的时间发票应用程序中,我成功地引入了 Bootstrap 3 的仪表板示例模板和一些节点模块(bluebird、Paypal SDK、Teamwork PM Client)来创建一个稍微复杂的应用程序。我花了几天时间,并且做得很好。

I really cannot think of anything negative to say about Atom-Shell, its solid, stable, fast, and easy to code for. I hope this helps someone.

我真的想不出对 Atom-Shell 有什么负面评价,它可靠、稳定、快速且易于编码。我希望这可以帮助别人。

回答by Roger Wang

Besides fully support Web standards, NW.js supports a list of non-standard features for native app development including:

除了完全支持 Web 标准之外,NW.js 还支持用于原生应用程序开发的一系列非标准功能,包括:

There is much more to see in the wiki including Menu, Tray, etc.

在 wiki 中还有更多内容可查看,包括菜单、托盘等。

回答by Karel Braeckman

I've been working with brackets-shell for some time now, here are some of my findings:

我已经使用括号外壳一段时间了,以下是我的一些发现:

  • brackets-shell is primarily developed as a shell under the brackets IDE project, but the project can run any web application. You just need to point it to your own html page. Clint Berry wrote an excellent tutorial about doing just this: http://clintberry.com/2013/html5-desktop-apps-with-brackets-shell/
  • The project is backed by Adobe and has a lot of activity
  • Documentation could be better

  • platform supportThey support Windows, Mac and Linux. An installer package can also be created. I only tested it on Win and Mac, it works great.

  • feature supporthtml5, css3, js. Html5 video does not work out of the box, but is very easy to enable (by default the ffmpegsumo.dll is not copied into the installer, if you change the script to copy it it will work).
  • native featuresmenu bar, 'open file with', file system access. I am not using any of these, as all I need is the communication with the node process.
  • extensibilitya nodejs is built in, and you can communicate with node from your web application. In this way, you can use node to access the filesystem etc.
  • architectureThe project is well set up, keeping a nice separation between the shell project and your own web app running inside it. In your own application, a global appshell object is available which gives you access to the brackets functionality (filesystem access, communication with node process, ...).
  • 括号壳主要是作为括号IDE项目下的壳开发的,但该项目可以运行任何Web应用程序。您只需要将其指向您自己的 html 页面。克林特贝瑞写了一个关于这样做的优秀教程:http: //clintberry.com/2013/html5-desktop-apps-with-brackets-shell/
  • 该项目得到了 Adob​​e 的支持,并且有很多活动
  • 文档可能会更好

  • 平台支持它们支持 Windows、Mac 和 Linux。也可以创建安装程序包。我只在 Win 和 Mac 上测试过,效果很好。

  • 功能支持html5、css3、js。Html5 视频不能开箱即用,但很容易启用(默认情况下,ffmpegsumo.dll 不会复制到安装程序中,如果您更改脚本以复制它,它将起作用)。
  • 本机功能菜单栏,“打开文件”,文件系统访问。我没有使用任何这些,因为我需要的是与节点进程的通信。
  • 内置 nodejs 的可扩展性,您可以从 Web 应用程序与 node 通信。通过这种方式,您可以使用 node 访问文件系统等。
  • 架构该项目设置良好,在 shell 项目和在其中运行的您自己的 Web 应用程序之间保持良好的分离。在您自己的应用程序中,有一个全局 appshell 对象可用,它使您可以访问括号功能(文件系统访问、与节点进程通信等)。

回答by Jaredcheeda

One thing to note (if you care), is that the Electron officially does not support Windows Vista. Vista's market share is about halfway between OSX 10.9 and 10.10(both of which are fully supported by Electron). Vista is also still supported by Microsoft until 2017.

需要注意的一件事(如果您关心的话)是 Electron 正式不支持 Windows Vista。Vista 的市场份额大约介于 OSX 10.9 和 10.10 之间(Electron 完全支持两者)。直到 2017 年,微软仍然支持 Vista。

NW.js works fine in Vista, as well as OSX 10.9+. NW.js works on Ubuntu, Debian, Zorin, Manjaro, Arch, and most other Debian based Linux OS's. Electron has refused PR's to fix Ubuntu specific bugs on their platform which is concerning.

NW.js 在 Vista 和 OSX 10.9+ 中运行良好。NW.js 适用于 Ubuntu、Debian、Zorin、Manjaro、Arch 和大多数其他基于 Debian 的 Linux 操作系统。Electron 拒绝 PR 修复其平台上的 Ubuntu 特定错误,这令人担忧。

NW.js works in XP too. Currently 18% of the market is still on XP. So if you're desktop application is more general purpose or wants to have access to the late adopters still on XP, you're probably better off with NW.js (0.14.7) as Electron only supports Win 7 and up.

NW.js 也适用于 XP。目前 18% 的市场仍然使用 XP。因此,如果您的桌面应用程序更通用,或者想要访问仍在使用 XP 的后期采用者,那么使用 NW.js (0.14.7) 可能会更好,因为 Electron 仅支持 Win 7 及更高版本。

If you use NW.js 0.12.3 you can also support OSX 10.6+ and very old versions of Debian based Linux OS's like Ubuntu, and Win XP+. It is recommended that you do special builds just for those legacy systems though and use the newer versions of NW.js for newer OS's.

如果您使用 NW.js 0.12.3,您还可以支持 OSX 10.6+ 和基于 Debian 的非常旧版本的 Linux 操作系统,如 Ubuntu 和 Win XP+。建议您只为那些遗留系统进行特殊构建,并为较新的操作系统使用较新版本的 NW.js。