Small but Powerful!!

Hot on the heels of the 1.3.0 release of AeroGear.js, comes the 1.3.1 release.

This wasn’t a big patch release, but it includes a few cool new options to DataManager

Preferred Fallback

With the 1.3.0 release, we introduced IndexedDB and WebSQL adapters for DataManager, as well as a way to fallback if an adapter was not supported.

With this release, we’ve added a preferred option to DataManager, where you can specify the adapters and the order in which they fallback

So now if we try and create a WebSQL store and it is not supported, we will only fallback to a Memory store

1
2
3
4
5
6
7
var dm = AeroGear.DataManager([
{
name: "createTest21",
type: "WebSQL",
settings: { preferred: [ "Memory" ] }
}
]).stores;

No Fallback

Another option that was added is fallback. It will always default to true, but if you do not want to fallback if an adapter is not present then set this option to false

1
2
3
4
5
6
7
8
9
var dm = AeroGear.DataManager([
{
name: "createTest32",
type: "WebSQL",
settings: {
fallback: false
}
}
]).stores;

Auto Connect

This next option is a really cool one!!

Since the new IndexedDB and WebSQL adapters need to be opened first, you need to use a callback/promise to handle that, but the Memory and SessionLocal adapters don’t need to be.

Sure we added open methods to those other adapters, but it would have been nice if we could just start calling read or save or whatever.

The new auto option now allows for that.

When set to true, you do not have to worry about “opening” the stores before calling read, for example.

1
2
3
4
5
6
7
8
9
10
11
dm.add({
name: "test1",
type: "IndexedDB",
settings: {
auto: true
}
});

dm.stores.test1.save( data, {
success: function( data ) { ... }
);

Code

As always, you can view the source code here

If bower is your thing:

$ bower install aerogear

Or if you want to create a custom build, JS Custom Builder

Release Notes - AeroGear JavaScript - Version 1.3.1

Bug

  • [AGJS-20] - Grunt 'docs' task fails with no errors
  • [AGJS-105] - DataManager - Memory - read/filter/etc. fails when store is empty
  • [AGJS-107] - Comments in authentication rest adapter are wrong - modules is object not array

Epic

  • [AGJS-51] - Make unit tests more granular

Feature Request

  • [AGJS-15] - Add jQuery 2.0 to build
  • [AGJS-93] - Add more User Control to the Fallback Strategy for DataManager Adapters
  • [AGJS-101] - Auto "connect" for DataManager
  • [AGJS-103] - Handle the case where WebCryptoAPI is not supported by the browser

Task

  • [AGJS-87] - Refactor Pipeline Unit Tests
  • [AGJS-89] - Refactor Auth Unit Tests