npm dexie 2.0.0-beta.2
Dexie v2.0.0-beta.2

latest releases: 4.0.4, 4.0.3, 4.0.2...
7 years ago

First beta-release of the 2.0 track.

Support for async functions (native and transpiled)

  • Typescript 2.0 compatible async await within transactions without quirks.
  • Compatible with the native async await in Edge 14 and Chrome 53 (with experimental flags on)
  • Should be compatible witht transpiled async await using babel (not verified yet)
  • Should be compatible with Angular2 and Zone.js when using typescript's transpiled async functions (not verified yet)

No need to 'stick to Dexie.Promise'

Native (or polyfilled) Promise can be safely used within transaction scopes. So for example, the use of Promise.all(...) would break transaction in Dexie v1.x but works perfectly well in Dexie v2.x without having to do Dexie.Promise.all(...). We're solving the browser-issues described in #317 by polyfilling the global Promise to play well with indexedDB transactions within the transaction scope only, and revert the patching for every leave from the transaction scope. This is possible only because of the built-in zone system that Dexie has.

Prepared to retire Dexie.Promise in a future major version

Dexie v2.x will keep using Dexie.Promise, but the work needed retire Dexie.Promise in favour of native Promise has been implemented, and once the problem described in #317 is fully solved widely by the affected browsers (IE, Safari and Firefox) we will do that shift. In the meantime, I've started the mounting down of Dexie.Promise-specific API:s so that the user shouldn't have to think about Dexie.Promise anymore. Code will look the same as soon as we do the switch to native Promise.

Breaking Changes / Backward Compatibility

Dexie 2.0 is built with backward compatibility in mind, but there are a few things that you would might need to fix before migrating:

  1. Dexie.Promise.on('error') is deprecated in Dexie 1.5.0 and obsolete in Dexie 2.0.0. Deprecation notes
  2. db.on('error') is deprecated in Dexie 1.5.0 and obsolete in Dexie 2.0.0. Deprecation notes

A full story of obsolete parts of the API is listed in the wiki under Deprecations. Note that some of the deprecations are still available in 2.0 but are planned to go obsolete in 3.0.

The main reason for the major version increment, else than the obsolete methods, is the new way that db.transaction() works - specifically that it patches the global promise within the transaction zone, wich is a change of a behavior in an existing API. db.transaction() is still backward compatible though and you don't need to change your transaction code.

Don't miss a new dexie release

NewReleases is sending notifications on new releases.