Hacker News new | ask | show | jobs
What you should know before starting node-webkit (yedingding.com)
76 points by yehanyin 4336 days ago
6 comments

I like node-webkit.

One of the ironies about the "Write once, Run many" mantra for HTML5 is that it's mostly applied to phones, where the runtime presents numerous challenges. On the desktop, however, HTML5 runtimes are faster and more feature-rich, so this is really where the portable aspect of HTML5 can excel. Adding Node to the mix makes it powerful too, going beyond regular browser capabilities.

Totally agree. Desktop app is more fit place for HTML5 than mobile. node-webkit is awesome and it can also benefit from the improvement of node and chromium.
Conversely I've been a little unimpressed by some of the standout node-webkit applications. LightTable in particular just doesn't seem very smooth or easy to use when I actually sit down and use it.
As smooth and easy to use compared to what?

cough lags-and-stops-responsonding-if-you-sneeze-too-hard-on-a-24GB-ram-machine-visual-studio-2013? cough

cough spazzes-out-randomly-when-you-type-characters-xcode? cough

sublime text? (which to be fair, is pretty amazing)

It's all relative. I've used plenty of really shit 'native graphics' applications (especially cross platform ones); on the other hand, plenty of stuff in the list (https://github.com/rogerwang/node-webkit/wiki/List-of-apps-a...) work just great for me.

shrug

I don't think you can discount the entire run time just one the basis of one app.

Light Table and Atom both run on node and they're pretty slow/jerky for me. Slow enough where I'd rather use IntelliJ for general purpose editing, intellij has a decent startup time compared to those two but it's way faster after that. Plus I always have it open when I'm working anyway so another tab doesn't really make a difference.
I run LightTable and PyCharm both side by side throughout the day as of a almost a year ago and I definitely feel the opposite. LightTable is much more responsive for me.

Although switching to an SSD made PyCharm a lot faster.

That may be the case honestly, I tried LightTable for a few weeks about a year ago and it was somewhat slow, it may well have gotten better.

I tried atom a week ago and it was extremely slow, much slower than LightTable. Almost 30s startup times and it was extremely slow at opening large files and even slower when trying to scroll through them.

Have you used Popcorn Time? I would say the interface is very slick and easy to use.
I haven't but at a guess I'd say it's probably because Popcorn Time is a media app which makes it closer to any number of conventional HTML5 websites.

Whereas LightTable is an IDE, but the limitations of windowing and feature layout were showing heavily in it's interface. node-webkit to me, seems like it's good for a particular type of application interface, rather then something very general purpose.

Game Dev Tycoon uses node-webkit and I find it runs extremely well!
We used node-webkit with a portable launcher (to contain registry entries and keep settings with the app on Windows) to make 2048 Portable over at PortableApps.com: http://portableapps.com/apps/games/2048-portable

It was a bit of an experiment to see how well it worked... and IF it worked. We compressed some of node-webkit with UPX to shrink it down without compressing all of it and sacrificing performance. It works pretty well though is a bit buggy. We already have a couple web games that are planning to use it to reach a wider audience (since we have a few millions users).

Can you elaborate on compressing node-webkit with UPX? I've got a nw app which feels somewhat fat at ~70mb and shaving some of that down would be of interest to me.
Sure. Our release of 2048 Portable 2.1 has node-webkit 0.9.2 slimmed down from about 59MB to about 23MB. We'd originally tried packing it to maximum using brute since it's so large for the purpose but found that nrv2e worked best with everything. It's not surprising as we usually recommend that for most purposes. It's the best balance of size, speed, and decreased false positives in antivirus apps (LZMA seems to increase false positives).

You can use our PortableApps.com AppCompactor to compress all DLLs and EXEs in a directory and sub-directories with your choice of UPX levels easily without needing to use the command line on them all. As a bonus, it runs UPX with -t after each compression to test it and ensure it works properly. As always, you'll need to double check that it runs properly as some DLLs don't like being UPX compressed. But node-webkit seems to run quite happily. Grab AppCompactor here: http://portableapps.com/apps/utilities/portableapps.com_appc...

We also experimented a bit with compression level of the .nw file but I can't recall exactly what compression level in 7-Zip we wound up settling on at the moment.

I've built a few apps using node-webkit for myself and, being a web developer, found it pretty awesome. One of the challenges that I think atom-shell handles better is background tasks/jobs. In node-webkit, my understanding is if you want to be able to background tasks using a node worker (not a webworker), then you have to bundle another node runtime with your app and use node's execute/spawn. This works OK, but bundling another version of node is kind of a pain. atom-shell works this way out of the box which is awesome if you need it.

Both projects are great ways of developing apps using web technologies though.

I've tried migrating a pair of fairly lightweight desktop applications to node-webkit from Realbasic/Xojo (which is essentially a cross-platform Visual Basic, only nicer) with some success (in once case the new application is far faster, while I haven't finished the second, but so far so good).

This is the first (simpler) application (really of interest only to Cheetah 3D users).

http://loewald.com/c3dbook/Misc-Resources/C3D-Buddy/

There's no attempt to produce a "native" UI (indeed, it's not using any frameworks) but it works very well.

I'd like to see a node-webkit-based IDE for creating node-webkit applications (I've considered trying to write one, but I do NOT have the time).

Isn't that what Intel's XDK does?
Oh right, I forgot about that. Maybe it's the "Intel" part :-)
Is node-webkit going to be renamed to node-blink at some point? It seems misleading to continue using WebKit in the name when it's not been based on WebKit for quite some time.
I've done a bit of node-webkit but I what I really didn't like was the speed at which a node-webkit app launches itself. It's pretty slow.
You can mitigate some of the perceived speed issues by defaulting to show: false in package.json and manually opening your first window after the full runtime environment loads. More info here: https://github.com/rogerwang/node-webkit/issues/1962#issueco...
What I've found, from my development, is that if you use the node-webkit executable to run the folder without packing/unpacking the app, it's faster. Also, killing the application before launching a new instance/using the already launched instance is faster.