Akshell 0.2
Akshell 0.2 is out! Akshell is is intended for rapid development of web applications in JavaScript and problem-free hosting them in the cloud. It features an online IDE; so the only tool required for development is a web browser. Akshell runtime environment enables applications to interact with each other; so they can be really modular and social.
In the 0.2 version the engine has been changed significantly. The framework has been ported to new infrastructure. And the new screencast has been recorded (thanks to Oleg Podsechin for narrating it).
Because there are a number of backward incompatible changes, the 0.1 support is not going to be dropped any time soon. All 0.1 applications are unaffected by this release.
In this post I'll describe the significant 0.2 features and migration from 0.1.
require()
Instead of the custom include() function of 0.1, the 0.2 release features require() compatible with the CommonJS Modules 1.1.1 proposal. It should make Akshell applications more portable and enable you to export existing CommonJS libraries to Akshell.
Binary
Now Akshell supports handling of binary data through the Binary class. It's a mutable fixed-length numeric byte storage type. The CommonJS Binary/F proposal inspired its interface.
fs.File
The new fs.open() function opens a file and return an fs.File object. It supports common reading, writing, and positioning file stream operations. The uploaded files are also represented by fs.File instances (these ones are read-only).
Proxy
The Proxy class brings simple means of metaprogramming to JavaScript. Proxy objects intercept property access and react accordingly. For example, the rv object is an instance of Proxy. It transparently maps database relation variables to JavaScript object properties.
JSGI
The core library has been decoupled from the basic Akshell library. The ak framework is no longer required for development in Akshell; only the core library is a must. It wraps the engine APIs and provides a JSGI interface to request handling. You can bring a JSGI compatible framework or middleware to Akshell or create your own.
Migration
If you have an Akshell application, you need to migrate it to 0.2 to experience these new features. Here are some basic steps to perform.
Replace all include() and use() by require(). Require the 0.2 version of the ak framework. Substitute:
ak.use('ak', '0.1'); ak.update(this, ak);... by:
require('ak', '0.2').setup();All module variables declared by var are now module-local; so you can remove anonymous functions wrapping modules.
Replace the __root__ global variable by exports.root.
Replace the __main__ global variable by exports.main. exports.main defaults to the defaultServe() function; so you can just remove a line like this:
var __main__ = defaultServe;
Rename __main__.js to main.js.
Change the engine version in the Administrate tab and test the application.
Enjoy!