This change marks the end of hosting the configuration page on GitHub Pages.
A Pebble configuration page is an HTML document shown in a webview in the Pebble app. The JS must provide a URL to this document. Traditionally, the page is hosted on a server (in Urchin's case, on GitHub Pages), and the current settings are passed by adding to the URL's hash or query string.
With this change, the entire HTML document for the config page is represented as a data URI, with the current settings substituted for placeholder strings within the page contents. This brings a few advantages:
The config page is available offline. Not relevant if you're using Urchin for remote monitoring, but for "camping mode" applications (Loop, OpenAPS, xDrip+, etc.), the whole point is a fully-offline monitoring setup. When you're off the grid for days or weeks at a time, still being able to change Urchin settings is critical.
The config page always matches the version of the app with which it is packaged. Adding a new feature to the app is no longer coupled to releasing a new public version of the configuration page. If a developer adds a new feature to the configuration page, it is available on his/her phone immediately.
Sensitive data such as Nightscout URLs and Dexcom passwords are not sent to a 3rd-party server. It was this concern which first led me to host the Urchin config page on GitHub (it's a static page, necessarily open-source, served over SSL, and it's impossible for me to see the logs), but even that has its risks. As far as I can tell, privately-hosted config pages remain a concern with some other Nightscout watchfaces.
This change adds build steps to inline JS, CSS, and images in the config HTML, minify the result, and make it available to the PebbleKit JS app. (Pebble's new Clay framework uses a similar process.) To aid development, the config page can still be viewed un-inlined by passing BUILD_ENV=development to pebble build.
This change marks the end of hosting the configuration page on GitHub Pages.
A Pebble configuration page is an HTML document shown in a webview in the Pebble app. The JS must provide a URL to this document. Traditionally, the page is hosted on a server (in Urchin's case, on GitHub Pages), and the current settings are passed by adding to the URL's hash or query string.
With this change, the entire HTML document for the config page is represented as a data URI, with the current settings substituted for placeholder strings within the page contents. This brings a few advantages:
This change adds build steps to inline JS, CSS, and images in the config HTML, minify the result, and make it available to the PebbleKit JS app. (Pebble's new Clay framework uses a similar process.) To aid development, the config page can still be viewed un-inlined by passing
BUILD_ENV=development
topebble build
.