Show HN: Workflow for front end developers to create desktop applications
github.com
github.com
This particular workflow would be more interesting to me if it was clearer that you could pick and choose your tools. I don't want to use Angular, Jade, or Coffeescript (for example). And (as per another thread) a workflow that included an out-of-box offline data storage option would be nice.
As I understand it, if I don't use tools that have a "compilation" phase, my workflow using node-webkit would be to save my files and restart node-webkit, right?
To generate the final executables, you'll end up hacking together some shell scripts or the like, at least if you do this on a regular basis.
Both points together: an automated asset pipeline and an easy-to-use build tool is included.
+1 for the data storage part, i'd love to hear some deeper thoughts in the github issues part...
about the chosen technologies: these are my preferences. After spreading my app skeleton idea I expect similar stuff to emerge for other personal preferences. But finally: one of my main goals of spreading the word here is to bring the idea of node-webkit to the folks, since this is an awesome open source project and could use some more helping hands.
I think really the holy grail for a lot of people is an app built with web utils and running on node - but having some type of packaging system to create executables that look just like any other desktop app.
I know there's various options out there but it seems like Chromium is the cleanest - Just everything I found wants you to install it as a browser "app" or plugin or whatever.
You'll get a native executable for Windows, OSX and Linux32/64, ready to ship and double-click-able. Isn't this what you want? :)
In general, a web app has to get pretty ridiculously bloated for javascript minification and so forth to impact launch time on a local file system. I'd call this premature optimization. (In my day job we're working on a pretty huge web app and we don't use any build process except -- just recently -- precompiling our LESS files (mainly to handle IE and mobile devices)). For us, the downside of a build-process to the debug cycle is a far bigger hit than the benefit of minification. (Perhaps we were overreacting to another project which used maven and had 2-3 minute builds...)
Of course if you're using coffeescript or clojurescript or whatever there's no avoiding some kind of build process.
It strikes me that automating and simplifying the build process is exactly the kind of thing you could wrap up in a pretty nice node-webkit application!
For the build process: just try it with brunch, e.g.: with my skeleton (a simple todo app is included for playing around). It will take ~4sec to start up initially, but then work close to perceived realtime, taking 50ms or so on my machine to reflect any changes you do, plus: livereload automatically the browser window, so you actually save the "press reload" step in most cases.
And: since i'm using only meta-languages that require a compile-step (!), i have basically a useful error-checking (incl. linting!) on coding time, without time-intensive inspecting the result in-browser. Do not underestimate this. Sure, finally i have to confirm in the browser (and/or testsuite) that everything works, but typos and other common bugs are "growled" as i type.
Absolutely. But don't overestimate it either! Most serious bugs compile perfectly well -- and so you're trading quick detection of simple errors for more difficulty dealing with the hard stuff.
To answer a few questions posed here: 1) It worked great for me, but we were doing a very simple presentation type app
2) grunt-node-webkit-builder is pretty great, saves ~15 minutes for each build, grunt takes a little bit to get going, but is easier than most php / ruby tools I've used
3) You don't have to use Angular, Jade, or Coffescript
4) While I did not take advantage of using a database, I suspect someone else has and it's not a big deal.
Also for anyone interested the same code we ran through node-webkit, worked well with build.phonegap.com, which means it would also work with Cordova (http://cordova.apache.org/) adding mobile device support into the build process would be very impressive, as would a node-webkit GUI build tool.
If I had all the time & attention span in the world, combining a node desktop+mobile build tool with an IDE like light table into a complete package that had a simple installer & GIT integration would be pretty great, and mostly assembling parts instead of re inventing the wheel.
However, I have bills to pay so I need to get back to figuring out how a big corporations's imaginary friends will make purchasing decisions ;)
Cordova is the open source project uses the same code magic that phonegap does, and can be installed on your local machine. I have not mixed it into the grunt built tool yet, but I think the hardest part is installing cordova & ready the documentation
Node-webkit works great. Our build process is simple: minimizing js files and copying files into a release folder. Grunt node-webkit takes care of creating binaries for Mac and Win. Making changes in development is easy. You basically just refresh the page in node-webkit and new version is loaded.
We use the same code base in the desktop app and online [2]. The only difference is that desktop app has additional code for working with local files and native windows.
At first I was doing it with Chrome packaged apps. But the security model there is more complex and working with local files and supporting the ability to open & edit pages from the internet required jumping through many loopholes and passing messages around between frames with different security privileges.
With node-webkit everything simply just worked from the start.
[1] http://pinegrow.com [2] http://pinegrow.com/edit.html?page=index.html
If you want to use a non-embedded database, you have to build your own installer, though.
The solutions offered by the chromium part (localStorage, indexedDB) could be worth a look, too. But i have no experience with them when using bigger amounts of data.
1. The "Trick" of the node-webkit based skeleton is, that frontend-developers must no longer think in terms of "frontend" and "backend", and therefore do not need to use different languages/libraries for different parts of the application. And: python is not that common among frontend developers.
2. NPM is just superior to pip.
3. I can't see any hint on your given links that you have a tech that is aimed at building crossplatform desktop applications without hassle and with maximized productivity. Maybe you should market your project differently.
1) You will always need to think about the backend, whether be it in Javascript or in whatever else. Using the same language helps of course, but Python and Javascript is a nice combo, too.
2) Virtualenv + Pip is pretty magnificient, but I don't have enough experience in npm other than the usual 'npm install ...' so I won't comment on this.
require("fs").readFile("myfile.txt", ...
directly in-place. You can query databases, do requests, and so on without any problem and natively inside your angular app. Everything that node.js could do, which is everything a webserver could do.
And, in combination with NPM, you have everything you ever need just a `npm install ...` away for direct use in you angular app.
Can I just drag the app folder and drag and drop onto any supported desktop?
Or will I have to install a bunch dependencies?
Endusers just have to doubleclick the executable inside this folder to run your app.