wq.app 0.8.0
wq.app 0.8.0 brings a long-overdue overhaul of wq/store.js to clean up technical debt and bring it up-to-date with modern browser capabilities. This release also introduces a more extensible click-based wq CLI.
API Changes
- wq/store.js overhaul (#20, #48)
- Use localForage instead of
localStorageto handle offline data storage (#20). This brings the option of usingIndexedDBin browsers that support it. - Switch to an almost entirely asynchronous API (#17), using promises (#5) which are provided with
localForage. - Split
getList()and related functionality into a separate module, wq/model.js (#20). Also split outbox features into separate wq/outbox.js module. - rename
unsavedItems()andobitem.savedtounsyncedItems()andobitem.synced(#27)
- Use localForage instead of
- wq/app.js + wq/store.js
- wq/pages.js
- rename to
wq/router.js(#26) - parts of the internal implementation (related to injecting rendered HTML into the DOM) have been moved to wq/template.js.
- rename to
- wq/map.js:
- Require bounds instead of center+zoom for default extent (#44)
- wq/photos.js:
- Use
URL.createObjectURLrather thanFileReaderfor image previews. (4b05b5a)
- Use
- wq build:
- General API Cleanup
- simplify
init()usage in wq/app.js, wq/store.js, wq/pages.js, wq/template.js (#28) - use namespace for data- properties (#42)
- Code style: enforce curly braces over one-line conditionals
- Add
andas template variable aliases forand, respectively (c500cee)
- simplify
Upgrade Notes
If you are installing wq.app for the first time, you do not need to worry about the notes in this section.
- The core
wqCLI was previously part of wq.app, but is now in a separate package, wq.core. If you are upgrading an existing wq.app installation, we recommend uninstalling and re-installing wq.app. If you don’t do this, the upgrade will likely install wq.core before upgrading wq.app, which will cause the newwqexecutable to be wiped out while uninstalling the old wq.app. If this happens, you may see an error like the following:bash: /usr/local/bin/wq: No such file or directory. The fix is to uninstall both wq.core and wq.app and then install wq.app again. - If you are using wq/store.js directly, note that the API has changed significantly since previous versions. In particular, be sure to read up on the new wq/model.js and wq/outbox.js modules. Also, if you are using wq/store.js together with wq/app.js, you may want to take advantage of the new built-in
app.modelsobject that will contain model API instances for all models listed in the wq configuration. - If you are using wq/app.js, wq/pages.js, wq/store.js, or wq/template.js, note that the configuration structure has been changed so that each module takes a single
init()configuration argument. See the respective module documentation pages for details. - Make sure you have a file called
wq.ymlor specify a filename when running thewq buildprocess. JSON is YAML, so if you have an existingapp.build.jsonyou should be able to rename it towq.ymland use it as-is. - Update your templates to reference all wq-specific attributes as e.g.
data-wq-jsonrather thandata-json.