npm dexie 3.2.0-beta.1
Dexie v3.2.0-beta.1

latest releases: 4.0.7, 4.0.5, 4.0.4...
3 years ago

This release contains the changes and bugfixes needed to make dexie-cloud-addon able do its job. Se details below.
Bumping middle version number due to subtle changes in a few API:s.

Using DBCore.transaction()

Before, we didn't call DBCore.transaction() internally to allow middlewares to intercept transaction creation. This PR corrects that and also added a second argument for which tables / object stores to include in the transaction. This allows for DBCore middlewares to inject code into both implicit and explicit transactions.

Supplying more information to DBCoreTable.mutate().

DBCoreMutateRequest has been extended with optional parameters criteria and changeSpec. This allows for middlewares to understand the intent of the mutation (which range-query that was the criteria for the change, and which properties that is meant to be updated). For Dexie Cloud, this feature makes it possible perform consistent operations across peers and maintain offline consistency for range- or index based calls to Collection.modify() and Collection.delete().

Bugfix in virtual index

Couldn't reuse parts of primary keys - only parts of indexes.

Safari workaround: Mutations in a service worker weren't propagated to liveQuery() in browser windows.

Dexie's liveQuery() functionality broadcasts changes using BroadcastChannel which is not supported on Safari. To workaround this, we've so far been using localStorage/onstorage to communicate changes across tabs. This workaround was eventually broken with the latest release of Safari where localStorage became broken when having multiple tabs open. Also the workarond didn't solve broadcasting changes between service worker and tabs/windows. This change makes mutations that are made in the service worker propagate to all service worker clients - which can be tabs/windows or other workers, so that liveQuery() observables will emit correctly when changes are made in the service worker - also on Safari. For other browsers, this hasn't been a problem.

Other changes:

  • Dexie.delete() specifies an empty addons list to ensure no addons are involved when deleting a database using that static method.
  • Correcting typescript Observable interface to better comply with RxJs.
  • Retiring old workaround for safari 8 bug not allowing array argument to IDBDatabase.transaction().
  • Allow multiple calls to Version.upgrade() on the same version - will run all of them instead just of the latest registered.
  • Argument to on.ready() callback will get a special Dexie instance that is not blocked (vip Dexie). This was the case also before but then we had to rely on zone state. This change makes it possible to perform non-dexie operations in on.read() callback (such as fetch()), loosing the zone state (PSD) but still have VIP access to the Dexie instance. This makes the code in a on.ready() callback not having to deal with wrapping all non-Dexie calls with Promise.resolve().

Don't miss a new dexie release

NewReleases is sending notifications on new releases.