Releases: wq/wq.app
wq.app 1.0 alpha
wq.app 1.0.0a1 is an alpha release of the upcoming 1.0 version of wq.app. A number of components and configuration options were refactored as part of the overall "patterns API cleanup" discussed in the wq.db 0.8 release notes.
wq.db.patterns
API Refactor
- Update to support the new XLSForm-style configuration object generated by the serializers in wq.db 1.0.0a1 (#38)
- Remove references to
wq.db.patterns
models (wq/wq.db#35) - Better handling of nested forms/attachments in outbox (#56)
API Cleanup
wq.app 0.8.2
wq.app 0.8.2 brings a couple of enhancements to wq/chart.js and bugfixes to the other modules.
- wq/chart.js
- Show units for y axis (#8)
- Show values when hovering on lines (#18)
- Update boxplot value accessors to match DRP 0.4 field names (see wq/django-rest-pandas#17). The accessors can now be overridden if needed.
- wq/map.js:
- Don't autoZoom to hidden layers
- Break out GeoJSON
FeatureCollections
for better compatibility with marker cluster plugin - Make marker clusters JSON-configurable
- Update wq/autocomplete.js and
wq/owl.js
to new wq/app.js plugin structure - Better fallback in case of wq/store.js errors
- wq/outbox.js: Simple
validate()
hook when saving items to outbox
wq.app 0.8.1
wq.app 0.8.1 builds on 0.8.0 to add a number of new features and enhancements, in particular to wq/map.js and wq/photos.js.
New Plugin API
wq/map.js is now a formal "plugin" for wq/app.js. This means instead of the following:
define(['wq/app', 'wq/map', './config'], function(app, map, config) {
app.init(config).then(function() {
map.init(config.map);
});
});
The following is preferred:
define(['wq/app', 'wq/map', './config'], function(app, map, config) {
app.use(map);
app.init(config);
});
A wq/app.js plugin is essentially just an object with three properties:
name
: An identifier for the plugininit()
: A function to call duringapp.init()
run()
: A function to call onpageshow
event.
See the documentation for wq/app.js for more information on the new plugin API.
Map Configuration & Layer Editing (#41, #36)
wq/map.js is now more easily configured via pure JSON. The JSON configuration can be specified within the wq configuration object for a page by creating the map
property as an object instead of a boolean. The old JavaScript-based configuration still works, but is mostly deprecated and parts will be removed in 1.0.
As part of this change, basemaps and overlays can now have custom types in addition to the default TileLayer
and GeoJSON
formats. The types need to be registered via JavaScript but the actual layers can be registered via JSON configuration.
The layer configuration can now be different for list, detail, and edit views. Edit view layers can also be configured as editable with a new edit
property. The new map editing tools are powered by Leaflet.Draw (#36).
See the documentation for wq/map.js for more information on the new JSON-based configuration and drawing tools.
PhoneGap (Cordova) Camera Integration
wq/photos.js has finally been fully updated to integrate with the new wq/store.js API. Specifically, photos.take()
and photos.pick()
store PhoneGap-requested photos as Blob
s for later retrieval. wq/app.js and wq/outbox.js have been updated to upload these Blob
s during an outbox sync. This makes fully-offline file storage and sync (#22) possible, even when using the PhoneGap Camera API. (In wq wq.app 0.8.0, this feature only worked for files selected via <input type=file>
).
Like wq/map.js, wq/photos.js has also been updated to work as a wq/app.js plugin. A number of data-wq-
attributes can be used to indicate which buttons and inputs to use with wq/photos.js.
See the Species Tracker templates and the new documentation for wq/photos.js for more information.
Bug Fixes
- Ensure wq/store.js doesn't break if offline storage is disabled (#50)
- Fix race condition during CSRF token loading (a916aa1)
- Fix outbox model updating bug (c0d1cc2)
- Don't use unreliable
navigator.onLine
when determining whether to sync in background (#33) - Ensure multiple files can be submitted via the same input (or via inputs with the same name)
- Check for existence of
FormData
before using it (2c34f05) - Fix bug in
router_info.params
calculation (c1a1722) - Fix list view filter bug (05ce964)
- Fix SCSS build paths on Windows (085a7dc)
Minor Improvements
- Better detection of the path to Leaflet image assets (#23)
- Include reference to model config in
info()
for wq/model.js - Ensure
page_config
is set on all template context variants; preserve non-page attributes onwq_config
(42685a6) - Add
app.emptyOutbox()
shortcut function - Add ability to display nested object errors (0c28fd2)
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
localStorage
to handle offline data storage (#20). This brings the option of usingIndexedDB
in 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.saved
tounsyncedItems()
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.createObjectURL
rather thanFileReader
for 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
{{rt}}
and{{svc}}
as template variable aliases for{{router_info.base_url}}
and{{app_config.store.service}}
, 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
wq
CLI 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 newwq
executable 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.models
object 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.yml
or specify a filename when running thewq build
process. JSON is YAML, so if you have an existingapp.build.json
you should be able to rename it towq.yml
and use it as-is. - Update your templates to reference all wq-specific attributes as e.g.
data-wq-json
rather thandata-json
.
wq.app 0.7.4
wq.app 0.7.4 brings a couple of minor changes to wq/app.js for forward compatibility with wq.db 0.8.0. This version of wq.app is still compatible with wq.db 0.7.x.
Changes:
- Added
{{csrf_token}}
context variable in addition to existing{{csrftoken}}
(the latter will be removed in wq.app 0.8.0). - Added
{{@index}}
context variable to facilitate rendering inputs with array subscripts (see wq/wq.db#33)
wq.app 0.7.3
This release of wq.app brings an important bug fix and a couple new features:
Bug Fixes
- wq/store.js: Avoid application crash when
localStorage
is accessed on an iOS device that has cookies disabled (#37)
New Features
- The wq command line tool now supports YAML configuration files by default. The default filename is accordingly changed from
app.build.json
towq.yml
. Support forapp.build.json
is preserved for now but will be removed in future versions (#29). - Added a new wq mustache command for generating static HTML pages from Mustache templates. (d98e19f)
wq appcache
now has an option to ignore paths found in CSS - in particular theicons-png/
folder referenced by jQuery Mobile's CSS but not needed by most modern browsers (#35)
wq.app 0.7.2
wq.app 0.7.2 brings a number of enhancements to SCSS theme support, including:
- A new wq/swatches.scss with a number of useful pre-defined theme swatches (including an approximation of jQuery Mobile 1.3's default theme)
- Compass and PySCSS are now automatically installed with wq.app so you don't need to download them separately (#34).
Check out the Swatch Preview Tool to play around with the new themes.
wq.app 0.7.1
wq.app 0.7.1 brings a number of minor new features and bug fixes to version 0.7.0.
- wq/app.js
postsave
configuration option now supports returning to "list" or "edit" views (2589c0e), in addition to detail views which were already supported. It also supports returning to the same page after a save (3e67d1e). See the updated wq configuration docs for more information.
- wq/chart.js
- Better responsive design support by automatically computing an SVG
viewBox
property (
9787f86). See the climata-viewer project for an example.
- Better responsive design support by automatically computing an SVG
- wq/pages.js
pages.go()
Now completely replaces any existing pages when a page with the same URL is rendered (3c97ae8). The old behavior replaced the title and content<div>
s separately, due to issues with fixed headers. As of jQuery Mobile 1.4, fixed headers can exist entirely outside of a page, so this workaround is no longer needed.pages.info
now includes URL parameters (f76dedd) and encoded URL paths (de7d826) for convenience (params
andpath_enc
/full_path_enc
)
- wq/store.js:
localStorage
improvements (a349825)- Fix
localStorageUsage()
to distinguish stored keys from prototype properties. - Clean up the outbox whenever the application starts. Any outbox items marked as
saved
will be removed, while anyunsavedItems()
will remain. This should help conservelocalStorage
space. This functionality can be disabled by setting thecleanOutbox
option to false. - wq/owl.js now also cleans up old records on startup.
- Fix
wq.app 0.7.0
wq.app 0.7.0 includes the latest version of jQuery Mobile, 1.4.5. This version of jQuery Mobile includes a new "flatter" look in keeping with current design trends, and a number of other improvements.
jQuery Mobile 1.4 (#3)
- Updated the SCSS theme builder to match jQuery Mobile 1.4 styles. See the documentation for new usage info.
- The bundled jQuery Mobile is customized to prevent automatic initialization; be sure to call
app.jqmInit()
orpages.jqmInit()
after all routes have been registered. This makes it easier to register page show events and be sure they will execute even on deep links. (81a6f2f; See sheppard/wq-website-v1@af182eb for an example of anactivePage
workaround that is no longer needed). - Other minor bug fixes, including support for external toolbars and the new
<div role="main">
style (8f6ee44, 6c91e0c)
API improvements
- wq/app.js:
- Support for markdown attachments (see wq/wq.db#30)
- wq/chart.js:
- remove existing lines/points if needed when draw mode changes (bc2351b)
- wq/map.js:
- wq/store.js:
- new
keys()
function to get store-specificlocalStorage
keys
- new
- wq/autocomplete.js:
- Build Process:
New Modules
- wq/owl.js: (Beta) client component for the Offline Website Logger
wq.app 0.6.2
This release provides a number of minor improvements to wq.app 0.6.1.
New Modules
- wq/autocomplete.js: A utility for creating AJAX-powered autocomplete widgets via the HTML5
<datalist>
element.
API improvements
- wq/app.js: option to sync form data in the background (
backgroundSync
) - wq/chart.js: options to override x-axis ticks and legend items
- debug mode for wq/app.js, wq.pages.js, and wq/store.js (#25)
Other Changes
- Complete, up-to-date documentation for all wq.app JavaScript modules
- Various minor bugfixes