Javascript apps

On the creation and testing of apps based on Javascript and possibly HTML5 technology.

Web app

On the internet

Covered elsewhere. It’s called the web. Except there is a wrinkle of interest to some of us: offline mode ServiceWorker tech allows you to serve a web app even without connectivity. I don’t care enough about this to really understand the API. I just cargo culted enough chunks of code to make it go. Seems to work.

Some of my friends recommend firebase for combo mobile/webapp development. I don’t have opinions about it but is noted here against future need.

Local dev website

You can do a lot by just hosting a webpage somewhere, and even some things with an HTML files on your hard disk, although these are locked down for security reasons.

So you run a localhost dev server.

Runtimes

Node.js

node.js is a famous javascript run-time the brought javascript outside the browser environment. It was arguably the seed of the inflexion point where there was massive uptake of javascript everywhere. Or at least javascript development.

Having used it for some toy projects I can verify that it is awful for toy projects. It leads to gigantic, complicated builds with massive dependencies. Tedious. Probably good for hip dotcoms? I do enjoy the ecosystem of handy utilities that people have built for node.js though, just so long as I do not need to do any myself.

Deno

Deno is a reboot of Node.js by some node.js people who wanted to avoid the horror of [t]he various debilities](https://www.martinmck.com/posts/deno-a-simple-guide/) in what they had created.

Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.

  1. Secure by default. No file, network, or environment access, unless explicitly enabled.
  2. Supports TypeScript out of the box.
  3. Ships only a single executable file.
  4. Has built-in utilities like a dependency inspector (deno info) and a code formatter (deno fmt).
  5. Has a set of reviewed (audited) standard modules that are guaranteed to work with Deno: deno.land/std

Desktop embedded browser

Run a browser attached to your javsacript app which renders all the UI and such. (Can also be made to run with, e.g. python GUIs.) Don’t learn some proprietary GUI framework, build a javascript GUI like everyone else. It’s not-too-hardish.

Now, choose your weapon:

I have no opinion about either of these, having not used either. Other people Compare these two options.

  • left field alternative: plask hosts a full 3d-friendly javascript runtime.

Smartphone/desktop framework apps

AFAICT the hotness here is Flutter

Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.

For tablets etc I should link to phonegap and cordova and titanium, but I am bored now. Build apps using javascript via Cordova or CocoonJS. Cordova takes HTML/JS apps to the mobile phone.

react-native is Facebook’s attempt to generalise to native apps, or something.

ionic builds on cordova with native look-and-feel.

Chrome apps

Run it straight in your Chrome browser.

Cons:

  • Weird script inclusion style that is not quite the native web
  • doesn’t generalise to other browsers

Pros:

  • more powerful than usual web-pages (UDP!)
  • instant web store
  • Can include compiled C++ code vial PNaCl

Howto: