Comparison between NW.js and Windows/macOS wrappers

6

Features on these Courses

Stats

2,785 visits, 3,669 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 23 Feb, 2021. Last updated 8 Jun, 2021

Construct provides two export options for both Windows and macOS. The NW.js export option can provide Windows and macOS desktop apps. There are also lightweight Windows wrapper (based on WebView2) and macOS wrapper (based on WKWebView) export options. See the tutorials Exporting desktop apps with NW.js, Exporting to Windows with the WebView2 wrapper and Exporting to macOS with the WKWebView wrapper to learn more about each. This tutorial covers the differences between them.

Platform support

The NW.js export option can also provide Linux apps. Currently there are only lightweight wrappers available for Windows and macOS.

Browser engine

One of the main differences is when exporting to NW.js, your project is bundled with a full copy of the Chromium browser engine. This adds about 80-90mb to the download size. This is also a fixed version of the browser engine: it will never update unless you publish an update to your app using a newer version of NW.js.

On the other hand, the Windows wrapper is based on the WebView2 runtime, which is part of Windows. You don't need to ship a full copy of a browser engine with the app, which means it has a much smaller file size overhead (under 1mb). The WebView2 runtime also auto-updates so you don't need to publish updates to your app just to update the browser engine. Note the WebView2 runtime is also based on the Chromium browser engine (which is used by both Microsoft Edge and Google Chrome).

The macOS wrapper is based on WKWebView, which is based on Safari's browser engine (WebKit). This updates with macOS system updates. The version available is based on the version of Safari that originally shipped with macOS. For example on macOS 10.14, WKWebView is based on Safari 12, on macOS 10.15 it's based on Safari 13, and so on. Note updating the Safari app does not affect this: only updating the entire macOS system will update the version of WKWebView in use.

Node.js features

NW.js comes with a full copy of the node.js framework. This provides additional features that browsers can't normally do, which also further increases the file size overhead. The Windows and macOS wrappers do not include node.js at all. The NW.js plugin uses the node.js framework to provide additional features; these will work in NW.js but are not supported in the wrappers. There may be alternative features you can use though: for example instead of writing data to a local file, it could be saved using the Local Storage plugin, which works in all export options.

Other features

There are a few more feature differences between the two:

  • The Windows wrapper includes a download interface, so the Browser 'Invoke download' action works similarly to in the browser. In NW.js it activates a "save as" dialog. Downloading is not currently supported in the macOS wrapper.
  • The Windows and macOS wrappers include the proprietary features of their browser engines, whereas NW.js is based on just the open-source features of the Chromium browser engine. This means some proprietary media formats can play in the wrappers but don't work in NW.js. This includes the fact that YouTube videos can play in the wrappers, but not NW.js.
  • Steam integration is currently available for NW.js (via Greenworks), but is not currently available in the wrappers.

Conclusion

In short, each option can be characterized as the following:

  • NW.js has more features, but is also a "heavyweight" option with a high file size overhead
  • The Windows and macOS wrappers have fewer features, largely matching what is available in browsers, but is a more lightweight option with a low file size overhead
  • 4 Comments

  • Order by
Want to leave a comment? Login or Register an account!