-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Background
To show a configuration page, the Pebble SDK offers apps the ability to open a URL pointing to a configuration page, following this pattern:
Pebble.addEventListener('showConfiguration', function() {
var url = 'http://example.com/config.html';
Pebble.openURL(url);
});
Historically, this required developers to host their content somewhere, which required a disproportionate amount of effort.
To rectify this, Pebble later released Clay (https://github.com/pebble/clay). Clay was able to work around the URL-only limitation by encoding the entire configuration page as a data URI, providing developers with a vastly improved experience. However, while Clay offered many improvements, it still has a variety of limitations.
- Debugging is difficult, as the entire app must be rebuilt and reinstalled in order to make any changes to the config page
- Due to limitations of PKJS, Clay is locked to legacy ES5 syntax
- There is no easy way to import custom content (such as preview images)
In addition, modern web technologies may provide devs with a significatnly better experience.
Proposed Solution
The Pebble SDK would provide the ability to host static HTML content directly, possibly in the form of:
src/
pkjs/
c/
html/ ← proposed config page location
Any content in the html directory could be accessed directly via a custom URL schema.
Clay itself could then be adapted to eschew its current data URL encoding in favor of this structure. The removal of the data URL encoding limitation could allow this hypothetical future version of Clay to be far more extensible than the current one.