Ember Quine - An Ember Addon

A quine is a computer program which takes no input and produces a copy of its own source code as its only output.

Quine (computing) - Wikipedia

Ember Quine is an Ember addon that enables an Ember app to be self downloaded as a single HTML file that runs offline (via the file:// URI).

To use this addon jump to the documentation section.

Demo

This application is a quine. It means you can download an offline fully working copy by clicking this button:

This will save an HTML file to your Downloads folder which you can open in another tab. Try it and you will have a fully working exact copy of what you see here in the new tab; CSS and JS included!

This addon is split into three key pieces:

  1. Bundling the entire Ember app assets into one HTML file
  2. Provide a method of data storage that writes to the HTML DOM
  3. Provide a method to download the current DOM into a stand alone HTML file

You can experiment with the app with de facto standard of TodoMVC. Or visualize the Underlying DOM storage.

Why would you use this?

If the idea of being able to carry a fully fledged Ember app in one self running/saving HTML file on a thumb drive or static web hosting fancies you.

An example might be this addon where you manage todos and save when done. Replacing the master version on disk each time. Maybe that todo list sits on Dropbox or in a secret encrypted USB thumb drive.

Or an interactive app for visualizing data that can be shared over FTP, Bitorrent, Tor, Sneakernet, etc.

Another example of a use case could be the following situation. A company has a large scale Ember app which has a component to visualize some data they can store on physical media. The customer would like to have a downloadable file of that data. To offer a fleshed out interactive visualization of that data in a single file an Ember Quine app is used to house the one component and the static data is baked into the downloaded output.

Maybe a WebGL viewer of a 3D model. In non quine versions the 3D model data (maybe JSON) would be saved and some viewer would need to be constructed and installed. But with a Quine the Ember app inside can view the 3d data and provide interactivity all in one HTML file that can be saved offline.

After understanding the power of this concept what ideas can you come up with?