How to build a desktop application with AppJS (http://appjs.org/)

edited August 2012 in Packaging Apps

It's easy!

Assumptions

  • You got the binary distribution from http://dists.appjs.org
  • I use the enyo.js bootplate from Github or from the enyo.js zip as an example app

Howto

  1. Unpack the AppJS distribution to your hard diskinto an empty folder, say appjs
  2. Go to the tools folder of your bootplate app and run the deploy script
  3. Replace the contents of appjs/app/content with the deploy version of your app, i.e. the contents of yourapp/deploy/yourapp-<timestamp>/
  4. Adapt var window = app.createWindow({... in appjs/data/app.js to match your requirements, i.e. screen width and heigth
  5. Run appjs/app.sh or appjs\app.exe
  6. Enyjoy!
If you decide to use the whole development tree of the bootplate app then copy debug.html to index.html. I further suggest that you change the following in appjs/data/app.js:
window.on('ready', function(){
  console.log("Window Ready");
  window.require = require;
  window.process = process;
  window.module = module;
// add this for easy invocation of dev tools:
  window.addEventListener('keydown', function(e){
    if (e.keyIdentifier === 'F12') {
      window.frame.openDevTools();
    }
// end of addition
  });
});
Then you can invoke the development tools of the Chromium engine with F12.

Findings

  • I tried this with the enyo-sampler app. The 'deploy' version does not show the source. The pane just stays empty and the dev tools report a '500' server error. The 'debug' version does show the source.
  • Both versions are quite laggy. Esp. choosing from the menu pane on the left seems to depend on where the click goes to, text or empty space.
Hope this helps
Christian

Comments

  • Yes, "View Source" isn't going to work on the "built" version of the application, because the JS files get combined into a single file. I'll have to take a closer look at AppJS to see how it works.
  • [facepalm]
    Totally true. Should have thought a bit more thoroughly. ;-)

    Thanks for the hint.
Sign In or Register to comment.