Dexie v1.1.0
New Features
- New addon Dexie.Yield gives support for ES6 yield for awaiting Promises in the exact same way as with synchronous multithreaded programming. Works TODAY on Chrome, Opera and Firefox without transpiling(!)
// Include addon "Dexie.Yield", and simplify your application code dramatically:
db.transaction('rw', db.friends, db.pets, function* () {
var catId = yield db.pets.add({ name: "Tito", kind: "cat" });
var dogId = yield db.pets.add({ name: "Josephina", kind: "dog" });
var friendId = yield db.friends.add({ name: "Gurra G", pets: [catId, dogId] });
var gurra = yield db.friends.where('name').equals("Gurra G").first();
var gurrasPets = yield db.pets.where('id').anyOf(gurra.pets).toArray();
console.log(JSON.stringify(gurrasPets));
});
In short, any method that returns a promise can be yielded instead of .then():ed. See more samples in tests-yield.html
- Typescript definition file added (nuget: Install-Package dexie.TypeScript.DefinitelyTyped)
- Support for AMD Module Loading (see samples/requirejs)
API Changes
- Dexie.spawn() deprecated and replaced by Dexie.ignoreTransaction(). Still backward compliant though.
Solved Issues
- Fixed broken CommonJS support (browserify) with sample added.
- #81: TypeError undefined not an object. Kind of a regression bug. Systems that lacks indexedDB should get a promise rejection on db.open() not a TypeError thrown at them.
- #102 Empty array in anyOf()
- Broken intellisense / code completion when using Visual Studio 2013.
- Transaction/Promise issues #91, #95 and #97
- A little bit more defensive to IndexedDBShim issues
- #62 Performance improvement on mobile devices
- #100 Must abort upgrade transaction if schema error