Building a cross-platform desktop app with NW.js, React and Flux
meetfinch.com
meetfinch.com
* Using v8 snapshots - https://github.com/nwjs/nw.js/wiki/Protect-JavaScript-source...
* Electron thread about source code protection - https://github.com/atom/electron/issues/3041
The second link has a lot of comments with useful information. One of them mentions that v8 snapshot format is documented and also that the actual code is shipped with the snapshot for future optimizations. nw.js just removes the sourcecode from the snapshot.
I'm curious if there is any reliable means of source code protection for Electron or NW.js apps.
Benefits of Electron:
* Much more active development, more frequent releases, more quickly addressed bugs (this is huge)
* More active ecosystem
* Lower level API that requires you to perhaps do a bit more work to achieve the same cross-platform behavior but gives more control and fewer weird issues
* Much better documentation
* Much better error reporting. It may have just been me, but when I had a JS error in NW.js, the process would simply crash with no feedback whatsoever (which as you can imagine is infuriating). I opened a couple issues about it and never got any help or feedback. Electron pops up a dialog with a stack trace.
Edit:
* Another major difference is that NW.js uses a shared global object for communicating between the main process and renderer (BrowserWindow) processes. Electron uses evented message passing using an `ipc` (inter-process communication) module that makes for more robust code.
* Besides being lower-level, the API is just (IMO) a lot better/more powerful in general
You could probably send messages to a log instead of the developer tools (might require editing the nw.js source code).
Regular JS in the renderer processes showed errors in the console as usual. However, if I tried using one of the NW.js APIs incorrectly in the renderer, or there was any error at all in the main process (which doesn't have devtools) it would just crash.
Okay enough for something enterprise-y, but once your fancy new IRC/Slack/Twitter client takes up a gig of RAM...
Very full guide though, down to release.
I've been using it for the past several months working on two fairly large-scale apps. Thanks Trevor and team.
Edit: looks like the tint framework linked above actually isolates the webview from the node runtime. Nice.
https://www.relisoft.com/resource/libs.html
The author likens MFC to a specialized Lego set for building a pirate ship, whereas the Win32 API is a general Lego set. I think the analogy is much stronger if one replaces MFC with web tech in a native wrapper, and Win32 with any OS native toolkit.
I noticed that they discarded the C++ option due to being unfamiliar with the language, but there might be an alternative: Qt's QML is a declarative language that's designed for easily creating interactive UIs and I think it's a great fit for a custom UI like the one in the article. The interesting part - one can embed and include JavaScript in a QML file (http://doc.qt.io/qt-5/qtqml-index.html).
[1]https://gumroad.com/l/ADWm/tasktopus [2]http://imgur.com/gallery/NZzEFKX
[1] http://doc.qt.io/qt-5/qtquick-deployment.html#managing-resou...
nw.js is backwards compatible, so if your app works now, it will probably work in future versions too!
If you do not care about Windows 7 you could use cardova instead.
> This isn’t a tutorial on using either library [React and Flux] but if you’d like to see one by all means let us know.
"let us know" is a link that directs you to https://meetfinch.com/contact