How Cappuccino Apps Go From Web to Desktop With No Code Changes
Join the DZone community and get the full member experience.Join For Free
NativeHost packages web apps for the desktop by creating a lightweight wrapper around the WebKit engine. In most cases, developers will use it within the Atlas application for Cappuccino development. Currently in beta, Atlas manages project files and facilitates code editing. It's other main feature is a powerful visual layout tool for designing a UI without coding. Once the app is complete, all you have to do is click a button to create both web and desktop applications from your Cappuccino app.
That one-click deployment was made possible by NativeHost, which is now available by itself on GitHub. In fact, one of the first apps to showcase NativeHost is the GitHub Issues App. It uses several interesting new technologies including node.js running on Heroku's Node beta (for the web version). It also integrates markdown and mustache.js.
To get started with NativeHost, you'll probably want to download Atlas. Once you have your application completed, you'll select “Native Desktop” from the “Platform” menu, and then press “Build and Run”. This builds and launches the app for desktop distribution using NativeHost. NativeHost also has additional features such as the ability to start a webserver in the background, allowing it to handle tasks with APIs that are not exposed to WebKit. NativeHost only supports Mac OS X right now, but more OS support is coming.
The Cappuccino framework developers strive to provide tools that make applications work well for both the web and the desktop, while many of the other frameworks, they believe, don't accomplish this. Many require difficult modifications to make a web app work on the desktop. Some target the desktop with with web technologies, but aren't focused on making them work deeply with the OS, so they end up being less "native" than regular desktop apps. Other web apps deploy to the desktop with very thin layers around them that also don't feel native. Cappuccino apps feel very native because they integrate into the OS windows, have secure access to the native file system with methods like XMLHttpRequest (no API), and integrate their document architecture into the OS.
The Cappuccino team believes that more and more application development will move towards the web platform, but there are still valid use cases in which you would distribute an .exe for the desktop, they say. For example, a user may need their application to have access to the local filesystem or other native APIs not available to a web app running in the browser. Atlas, a Cappuccino app itself, was originally intended to be a cloud-based IDE, but it turns out that customers were more comfortable running it on their desktops. NativeHost gives web developers convenient versatility in the way they deploy their applications.