Comparison between NW.js and Windows wrapper

6

Stats

335 visits, 380 views

Translations

This tutorial hasn't been translated.

Tools

Construct provides two export options that can provide a traditional Windows desktop app: NW.js, and the Windows wrapper (based on WebView2). See the tutorials Exporting desktop apps with NW.js and Exporting to Windows with the WebView2 wrapper to learn more about each. This tutorial covers the differences between the two.

Platform support

The NW.js export option provides macOS and Linux apps. Currently there is only a lightweight wrapper available for Windows.

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).

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 wrapper does 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 Windows wrapper. 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 both.

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.
  • The WebView2 runtime used by the Windows wrapper includes the proprietary features of Microsoft Edge, 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 Windows wrapper but don't work in NW.js. This includes the fact that YouTube videos can play in the Windows wrapper, but not NW.js.
  • Steam integration is currently available for NW.js (via Greenworks), but is not currently available in the Windows wrapper.

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 wrapper has fewer features, largely matching what is available in browsers, but is a more lightweight option with a low file size overhead
  • 3 Comments

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